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
people.
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
responsibility of each team.
......
......@@ -495,12 +495,24 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
break;
case 'groups:labels:new':
case 'groups:labels:edit':
new Labels();
break;
case 'projects:labels:new':
import('./pages/projects/labels/new')
.then(callDefault)
.catch(fail);
break;
case 'projects:labels:edit':
new Labels();
import('./pages/projects/labels/edit')
.then(callDefault)
.catch(fail);
break;
case 'groups:labels:index':
case 'projects:labels:index':
import('./pages/projects/labels/index')
.then(callDefault)
.catch(fail);
break;
case 'groups:labels:index':
if ($('.prioritized-labels').length) {
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>
/* 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 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 {
directives: {
tooltip,
},
components: {
loadingButton,
icon,
toggleButton,
},
props: {
loading: {
......@@ -17,22 +27,23 @@
subscribed: {
type: Boolean,
required: false,
default: null,
},
id: {
type: Number,
required: false,
default: null,
},
},
computed: {
buttonLabel() {
let label;
if (this.subscribed === false) {
label = __('Subscribe');
} else if (this.subscribed === true) {
label = __('Unsubscribe');
}
return label;
showLoadingState() {
return this.subscribed === null;
},
notificationIcon() {
return this.subscribed ? ICON_ON : ICON_OFF;
},
notificationTooltip() {
return this.subscribed ? LABEL_ON : LABEL_OFF;
},
},
methods: {
......@@ -46,21 +57,29 @@
<template>
<div>
<div class="sidebar-collapsed-icon">
<i
class="fa fa-rss"
aria-hidden="true"
<span
v-tooltip
: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>
<span class="issuable-header-text hide-collapsed pull-left">
{{ __('Notifications') }}
</span>
<loading-button
ref="loadingButton"
class="btn btn-default pull-right hide-collapsed js-issuable-subscribe-button"
:loading="loading"
:label="buttonLabel"
@click="toggleSubscription"
<toggle-button
ref="toggleButton"
class="pull-right hide-collapsed js-issuable-subscribe-button"
:is-loading="showLoadingState"
:value="subscribed"
@change="toggleSubscription"
/>
</div>
</template>
......@@ -23,11 +23,12 @@
name: {
type: String,
required: false,
default: '',
default: null,
},
value: {
type: Boolean,
required: true,
required: false,
default: null,
},
disabledInput: {
type: Boolean,
......@@ -61,6 +62,7 @@
<template>
<label class="toggle-wrapper">
<input
v-if="name"
type="hidden"
:name="name"
:value="value"
......
......@@ -104,7 +104,10 @@
img {
height: 28px;
margin-right: 8px;
+ .logo-text {
margin-left: 8px;
}
}
&.wrap {
......
......@@ -162,10 +162,6 @@
border: 0;
}
span {
display: inline-block;
}
.select2-container span {
margin-top: 0;
}
......
......@@ -6,6 +6,34 @@
= render "admin/licenses/breakdown", license: @license
.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
.col-md-4
.info-well
......@@ -160,34 +188,6 @@
= Gitlab::Database.adapter_name
%span.pull-right
= 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
.col-md-4
.info-well
......
......@@ -6,8 +6,10 @@
%h1.title
= link_to root_path, title: 'Dashboard', id: 'logo' do
= brand_header_logo
%span.logo-text.hidden-xs
= brand_header_logo_type
- logo_text = brand_header_logo_type
- if logo_text.present?
%span.logo-text.hidden-xs
= logo_text
- if current_user
= 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
Given project "Shop" have "Release 0.4" open issue
When I visit issue page "Release 0.4"
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
@javascript
......
......@@ -21,20 +21,20 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
step 'I should see that I am subscribed' do
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
step 'I should see that I am unsubscribed' do
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
step 'I click link "Closed"' do
find('.issues-state-filters [data-state="closed"] span', text: 'Closed').click
end
step 'I click button "Unsubscribe"' do
click_on "Unsubscribe"
step 'I click the subscription toggle' do
find('.js-issuable-subscribe-button button').click
end
step 'I should see "Release 0.3" in issues' do
......
......@@ -335,14 +335,14 @@ describe 'Issue Boards', :js do
wait_for_requests
page.within('.subscriptions') do
click_button 'Subscribe'
find('.js-issuable-subscribe-button button:not(.is-checked)').click
wait_for_requests
expect(page).to have_content('Unsubscribe')
expect(page).to have_css('.js-issuable-subscribe-button button.is-checked')
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)
visit project_board_path(project, board)
wait_for_requests
......@@ -351,10 +351,10 @@ describe 'Issue Boards', :js do
wait_for_requests
page.within('.subscriptions') do
click_button 'Unsubscribe'
find('.js-issuable-subscribe-button button.is-checked').click
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
......
......@@ -13,20 +13,18 @@ describe 'User manages subscription', :js do
end
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')
click_on('Unsubscribe')
wait_for_requests
expect(subscribe_button).to have_content('Subscribe')
expect(page).to have_css 'button:not(.is-checked)'
end
end
end
......@@ -20,23 +20,23 @@ describe('Subscriptions', function () {
subscribed: undefined,
});
expect(vm.$refs.loadingButton.loading).toBe(true);
expect(vm.$refs.loadingButton.label).toBeUndefined();
expect(vm.$refs.toggleButton.isLoading).toBe(true);
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, {
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, {
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