summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-01-11 11:39:54 -0600
committerClement Ho <ClemMakesApps@gmail.com>2018-01-11 11:39:54 -0600
commitf716049998ec41d8f26caedd65ebd1a247179926 (patch)
treea79dddcb0a2778b577fd26f01fbb82c7848314ed
parentd08610c3a654177b3e5b90a2e5f9b2f74bc8d002 (diff)
downloadgitlab-ce-f716049998ec41d8f26caedd65ebd1a247179926.tar.gz
Code improvements
-rw-r--r--app/assets/javascripts/dispatcher.js4
-rw-r--r--app/assets/javascripts/pages/projects/labels/edit/index.js4
-rw-r--r--app/assets/javascripts/pages/projects/labels/index/index.js7
-rw-r--r--app/assets/javascripts/pages/projects/labels/new/index.js4
4 files changed, 8 insertions, 11 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 0794edd5f69..e8ec6daf687 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -482,13 +482,15 @@ import Activities from './activities';
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':
- import('./pages/projects/labels/new')
+ import('./pages/projects/labels/edit')
.then(callDefault)
.catch(fail);
break;
diff --git a/app/assets/javascripts/pages/projects/labels/edit/index.js b/app/assets/javascripts/pages/projects/labels/edit/index.js
index 75dc1ef1859..72c5e4744ac 100644
--- a/app/assets/javascripts/pages/projects/labels/edit/index.js
+++ b/app/assets/javascripts/pages/projects/labels/edit/index.js
@@ -1,5 +1,3 @@
import Labels from '~/labels';
-export default function () {
- new Labels(); // eslint-disable-line no-new
-}
+export default () => new Labels();
diff --git a/app/assets/javascripts/pages/projects/labels/index/index.js b/app/assets/javascripts/pages/projects/labels/index/index.js
index c258be4f908..82a5b4d0760 100644
--- a/app/assets/javascripts/pages/projects/labels/index/index.js
+++ b/app/assets/javascripts/pages/projects/labels/index/index.js
@@ -1,19 +1,18 @@
-/* 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();
+ 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);
+ new GroupLabelSubscription($el); // eslint-disable-line no-new
} else {
- new ProjectLabelSubscription($el);
+ new ProjectLabelSubscription($el); // eslint-disable-line no-new
}
});
};
diff --git a/app/assets/javascripts/pages/projects/labels/new/index.js b/app/assets/javascripts/pages/projects/labels/new/index.js
index 75dc1ef1859..72c5e4744ac 100644
--- a/app/assets/javascripts/pages/projects/labels/new/index.js
+++ b/app/assets/javascripts/pages/projects/labels/new/index.js
@@ -1,5 +1,3 @@
import Labels from '~/labels';
-export default function () {
- new Labels(); // eslint-disable-line no-new
-}
+export default () => new Labels();