Refactor projects:l*
This commit is contained in:
parent
0a51eae586
commit
d08610c3a6
|
@ -483,11 +483,21 @@ import Activities from './activities';
|
|||
case 'groups:labels:new':
|
||||
case 'groups:labels:edit':
|
||||
case 'projects:labels:new':
|
||||
import('./pages/projects/labels/new')
|
||||
.then(callDefault)
|
||||
.catch(fail);
|
||||
break;
|
||||
case 'projects:labels:edit':
|
||||
new Labels();
|
||||
import('./pages/projects/labels/new')
|
||||
.then(callDefault)
|
||||
.catch(fail);
|
||||
break;
|
||||
case 'projects:labels:index':
|
||||
import('./pages/projects/labels/index')
|
||||
.then(callDefault)
|
||||
.catch(fail);
|
||||
break;
|
||||
case 'groups:labels:index':
|
||||
case 'projects:labels:index':
|
||||
if ($('.prioritized-labels').length) {
|
||||
new LabelManager();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import Labels from '~/labels';
|
||||
|
||||
export default function () {
|
||||
new Labels(); // eslint-disable-line no-new
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/* eslint-disable no-new */
|
||||
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();
|
||||
}
|
||||
$('.label-subscription').each((i, el) => {
|
||||
const $el = $(el);
|
||||
|
||||
if ($el.find('.dropdown-group-label').length) {
|
||||
new GroupLabelSubscription($el);
|
||||
} else {
|
||||
new ProjectLabelSubscription($el);
|
||||
}
|
||||
});
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
import Labels from '~/labels';
|
||||
|
||||
export default function () {
|
||||
new Labels(); // eslint-disable-line no-new
|
||||
}
|
Loading…
Reference in New Issue