Commit ba8bf2ad authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-01-13' into 'master'

CE upstream - Saturday

Closes gitlab-ce#41891 and #2383

See merge request gitlab-org/gitlab-ee!4065
parents 1674970a fc3ca478
...@@ -172,7 +172,7 @@ Assigning a team label makes sure issues get the attention of the appropriate ...@@ -172,7 +172,7 @@ Assigning a team label makes sure issues get the attention of the appropriate
people. people.
The current team labels are ~Build, ~"CI/CD", ~Discussion, ~Documentation, ~Edge, The current team labels are ~Build, ~"CI/CD", ~Discussion, ~Documentation, ~Edge,
~Geo, ~Gitaly, ~Platform, ~Prometheus, ~Release, and ~"UX". ~Geo, ~Gitaly, ~Platform, ~Monitoring, ~Release, and ~"UX".
The descriptions on the [labels page][labels-page] explain what falls under the The descriptions on the [labels page][labels-page] explain what falls under the
responsibility of each team. responsibility of each team.
......
...@@ -495,12 +495,24 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line ...@@ -495,12 +495,24 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
break; break;
case 'groups:labels:new': case 'groups:labels:new':
case 'groups:labels:edit': case 'groups:labels:edit':
new Labels();
break;
case 'projects:labels:new': case 'projects:labels:new':
import('./pages/projects/labels/new')
.then(callDefault)
.catch(fail);
break;
case 'projects:labels:edit': case 'projects:labels:edit':
new Labels(); import('./pages/projects/labels/edit')
.then(callDefault)
.catch(fail);
break; break;
case 'groups:labels:index':
case 'projects:labels:index': case 'projects:labels:index':
import('./pages/projects/labels/index')
.then(callDefault)
.catch(fail);
break;
case 'groups:labels:index':
if ($('.prioritized-labels').length) { if ($('.prioritized-labels').length) {
new LabelManager(); new LabelManager();
} }
......
import LabelManager from './label_manager';
import GroupLabelSubscription from './group_label_subscription';
import ProjectLabelSubscription from './project_label_subscription';
export default () => {
if ($('.prioritized-labels').length) {
new LabelManager(); // eslint-disable-line no-new
}
$('.label-subscription').each((i, el) => {
const $el = $(el);
if ($el.find('.dropdown-group-label').length) {
new GroupLabelSubscription($el); // eslint-disable-line no-new
} else {
new ProjectLabelSubscription($el); // eslint-disable-line no-new
}
});
};
import Labels from '~/labels';
export default () => new Labels();
import initLabels from '~/init_labels';
export default initLabels;
import Labels from '~/labels';
export default () => new Labels();
<script> <script>
/* eslint-disable vue/require-default-prop */ import { __ } from '~/locale';
import { __ } from '../../../locale'; import icon from '~/vue_shared/components/icon.vue';
import toggleButton from '~/vue_shared/components/toggle_button.vue';
import tooltip from '~/vue_shared/directives/tooltip';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import loadingButton from '../../../vue_shared/components/loading_button.vue';
const ICON_ON = 'notifications';
const ICON_OFF = 'notifications-off';
const LABEL_ON = __('Notifications on');
const LABEL_OFF = __('Notifications off');
export default { export default {
directives: {
tooltip,
},
components: { components: {
loadingButton, icon,
toggleButton,
}, },
props: { props: {
loading: { loading: {
...@@ -17,22 +27,23 @@ ...@@ -17,22 +27,23 @@
subscribed: { subscribed: {
type: Boolean, type: Boolean,
required: false, required: false,
default: null,
}, },
id: { id: {
type: Number, type: Number,
required: false, required: false,
default: null,
}, },
}, },
computed: { computed: {
buttonLabel() { showLoadingState() {
let label; return this.subscribed === null;
if (this.subscribed === false) { },
label = __('Subscribe'); notificationIcon() {
} else if (this.subscribed === true) { return this.subscribed ? ICON_ON : ICON_OFF;
label = __('Unsubscribe'); },
} notificationTooltip() {
return this.subscribed ? LABEL_ON : LABEL_OFF;
return label;
}, },
}, },
methods: { methods: {
...@@ -46,21 +57,29 @@ ...@@ -46,21 +57,29 @@
<template> <template>
<div> <div>
<div class="sidebar-collapsed-icon"> <div class="sidebar-collapsed-icon">
<i <span
class="fa fa-rss" v-tooltip
aria-hidden="true" :title="notificationTooltip"
data-container="body"
data-placement="left"
> >
</i> <icon
:name="notificationIcon"
:size="16"
aria-hidden="true"
class="sidebar-item-icon is-active"
/>
</span>
</div> </div>
<span class="issuable-header-text hide-collapsed pull-left"> <span class="issuable-header-text hide-collapsed pull-left">
{{ __('Notifications') }} {{ __('Notifications') }}
</span> </span>
<loading-button <toggle-button
ref="loadingButton" ref="toggleButton"
class="btn btn-default pull-right hide-collapsed js-issuable-subscribe-button" class="pull-right hide-collapsed js-issuable-subscribe-button"
:loading="loading" :is-loading="showLoadingState"
:label="buttonLabel" :value="subscribed"
@click="toggleSubscription" @change="toggleSubscription"
/> />
</div> </div>
</template> </template>
...@@ -23,11 +23,12 @@ ...@@ -23,11 +23,12 @@
name: { name: {
type: String, type: String,
required: false, required: false,
default: '', default: null,
}, },
value: { value: {
type: Boolean, type: Boolean,
required: true, required: false,
default: null,
}, },
disabledInput: { disabledInput: {
type: Boolean, type: Boolean,
...@@ -61,6 +62,7 @@ ...@@ -61,6 +62,7 @@
<template> <template>
<label class="toggle-wrapper"> <label class="toggle-wrapper">
<input <input
v-if="name"
type="hidden" type="hidden"
:name="name" :name="name"
:value="value" :value="value"
......
...@@ -104,7 +104,10 @@ ...@@ -104,7 +104,10 @@
img { img {
height: 28px; height: 28px;
margin-right: 8px;
+ .logo-text {
margin-left: 8px;
}
} }
&.wrap { &.wrap {
......
...@@ -162,10 +162,6 @@ ...@@ -162,10 +162,6 @@
border: 0; border: 0;
} }
span {
display: inline-block;
}
.select2-container span { .select2-container span {
margin-top: 0; margin-top: 0;
} }
......
...@@ -6,6 +6,34 @@ ...@@ -6,6 +6,34 @@
= render "admin/licenses/breakdown", license: @license = render "admin/licenses/breakdown", license: @license
.admin-dashboard.prepend-top-default .admin-dashboard.prepend-top-default
.row
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
= link_to admin_projects_path do
%h3.text-center
Projects:
= number_with_delimiter(Project.cached_count)
%hr
= link_to('New project', new_project_path, class: "btn btn-new")
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
= link_to admin_users_path do
%h3.text-center
Users:
= number_with_delimiter(User.count)
%hr
= link_to 'New user', new_admin_user_path, class: "btn btn-new"
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
= link_to admin_groups_path do
%h3.text-center
Groups:
= number_with_delimiter(Group.count)
%hr
= link_to 'New group', new_admin_group_path, class: "btn btn-new"
.row .row
.col-md-4 .col-md-4
.info-well .info-well
...@@ -160,34 +188,6 @@ ...@@ -160,34 +188,6 @@
= Gitlab::Database.adapter_name = Gitlab::Database.adapter_name
%span.pull-right %span.pull-right
= Gitlab::Database.version = Gitlab::Database.version
.row
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
= link_to admin_projects_path do
%h3.text-center
Projects:
= number_with_delimiter(Project.cached_count)
%hr
= link_to('New project', new_project_path, class: "btn btn-new")
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
= link_to admin_users_path do
%h3.text-center
Users:
= number_with_delimiter(User.count)
%hr
= link_to 'New user', new_admin_user_path, class: "btn btn-new"
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
= link_to admin_groups_path do
%h3.text-center
Groups:
= number_with_delimiter(Group.count)
%hr
= link_to 'New group', new_admin_group_path, class: "btn btn-new"
.row .row
.col-md-4 .col-md-4
.info-well .info-well
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
%h1.title %h1.title
= link_to root_path, title: 'Dashboard', id: 'logo' do = link_to root_path, title: 'Dashboard', id: 'logo' do
= brand_header_logo = brand_header_logo
%span.logo-text.hidden-xs - logo_text = brand_header_logo_type
= brand_header_logo_type - if logo_text.present?
%span.logo-text.hidden-xs
= logo_text
- if current_user - if current_user
= render "layouts/nav/dashboard" = render "layouts/nav/dashboard"
......
---
title: Move row containing Projects, Users and Groups count to the top in admin dashboard
merge_request: 16421
author:
type: changed
---
title: 'Fix custom header logo design nitpick: Remove unneeded margin on empty logo text'
merge_request: 16383
author: Markus Doits
type: fixed
...@@ -164,7 +164,7 @@ Feature: Project Issues ...@@ -164,7 +164,7 @@ Feature: Project Issues
Given project "Shop" have "Release 0.4" open issue Given project "Shop" have "Release 0.4" open issue
When I visit issue page "Release 0.4" When I visit issue page "Release 0.4"
Then I should see that I am subscribed Then I should see that I am subscribed
When I click button "Unsubscribe" When I click the subscription toggle
Then I should see that I am unsubscribed Then I should see that I am unsubscribed
@javascript @javascript
......
...@@ -21,20 +21,20 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps ...@@ -21,20 +21,20 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
step 'I should see that I am subscribed' do step 'I should see that I am subscribed' do
wait_for_requests wait_for_requests
expect(find('.js-issuable-subscribe-button span')).to have_content 'Unsubscribe' expect(find('.js-issuable-subscribe-button')).to have_css 'button.is-checked'
end end
step 'I should see that I am unsubscribed' do step 'I should see that I am unsubscribed' do
wait_for_requests wait_for_requests
expect(find('.js-issuable-subscribe-button span')).to have_content 'Subscribe' expect(find('.js-issuable-subscribe-button')).to have_css 'button:not(.is-checked)'
end end
step 'I click link "Closed"' do step 'I click link "Closed"' do
find('.issues-state-filters [data-state="closed"] span', text: 'Closed').click find('.issues-state-filters [data-state="closed"] span', text: 'Closed').click
end end
step 'I click button "Unsubscribe"' do step 'I click the subscription toggle' do
click_on "Unsubscribe" find('.js-issuable-subscribe-button button').click
end end
step 'I should see "Release 0.3" in issues' do step 'I should see "Release 0.3" in issues' do
......
...@@ -335,14 +335,14 @@ describe 'Issue Boards', :js do ...@@ -335,14 +335,14 @@ describe 'Issue Boards', :js do
wait_for_requests wait_for_requests
page.within('.subscriptions') do page.within('.subscriptions') do
click_button 'Subscribe' find('.js-issuable-subscribe-button button:not(.is-checked)').click
wait_for_requests wait_for_requests
expect(page).to have_content('Unsubscribe') expect(page).to have_css('.js-issuable-subscribe-button button.is-checked')
end end
end end
it 'has "Unsubscribe" button when already subscribed' do it 'has checked subscription toggle when already subscribed' do
create(:subscription, user: user, project: project, subscribable: issue2, subscribed: true) create(:subscription, user: user, project: project, subscribable: issue2, subscribed: true)
visit project_board_path(project, board) visit project_board_path(project, board)
wait_for_requests wait_for_requests
...@@ -351,10 +351,10 @@ describe 'Issue Boards', :js do ...@@ -351,10 +351,10 @@ describe 'Issue Boards', :js do
wait_for_requests wait_for_requests
page.within('.subscriptions') do page.within('.subscriptions') do
click_button 'Unsubscribe' find('.js-issuable-subscribe-button button.is-checked').click
wait_for_requests wait_for_requests
expect(page).to have_content('Subscribe') expect(page).to have_css('.js-issuable-subscribe-button button:not(.is-checked)')
end end
end end
end end
......
...@@ -13,20 +13,18 @@ describe 'User manages subscription', :js do ...@@ -13,20 +13,18 @@ describe 'User manages subscription', :js do
end end
it 'toggles subscription' do it 'toggles subscription' do
subscribe_button = find('.js-issuable-subscribe-button') page.within('.js-issuable-subscribe-button') do
expect(page).to have_css 'button:not(.is-checked)'
find('button:not(.is-checked)').click
expect(subscribe_button).to have_content('Subscribe') wait_for_requests
click_on('Subscribe') expect(page).to have_css 'button.is-checked'
find('button.is-checked').click
wait_for_requests wait_for_requests
expect(subscribe_button).to have_content('Unsubscribe') expect(page).to have_css 'button:not(.is-checked)'
end
click_on('Unsubscribe')
wait_for_requests
expect(subscribe_button).to have_content('Subscribe')
end end
end end
...@@ -20,23 +20,23 @@ describe('Subscriptions', function () { ...@@ -20,23 +20,23 @@ describe('Subscriptions', function () {
subscribed: undefined, subscribed: undefined,
}); });
expect(vm.$refs.loadingButton.loading).toBe(true); expect(vm.$refs.toggleButton.isLoading).toBe(true);
expect(vm.$refs.loadingButton.label).toBeUndefined(); expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass('is-loading');
}); });
it('has "Subscribe" text when currently not subscribed', () => { it('is toggled "off" when currently not subscribed', () => {
vm = mountComponent(Subscriptions, { vm = mountComponent(Subscriptions, {
subscribed: false, subscribed: false,
}); });
expect(vm.$refs.loadingButton.label).toBe('Subscribe'); expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).not.toHaveClass('is-checked');
}); });
it('has "Unsubscribe" text when currently not subscribed', () => { it('is toggled "on" when currently subscribed', () => {
vm = mountComponent(Subscriptions, { vm = mountComponent(Subscriptions, {
subscribed: true, subscribed: true,
}); });
expect(vm.$refs.loadingButton.label).toBe('Unsubscribe'); expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass('is-checked');
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment