Commit a905afd8 authored by Clement Ho's avatar Clement Ho

Refactor dispatcher project mr edit and creation diff path

parent 07d0214f
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */
import projectSelect from './project_select'; import projectSelect from './project_select';
import Milestone from './milestone'; import Milestone from './milestone';
import IssuableForm from './issuable_form';
import LabelsSelect from './labels_select';
import MilestoneSelect from './milestone_select';
import NotificationsForm from './notifications_form'; import NotificationsForm from './notifications_form';
import notificationsDropdown from './notifications_dropdown'; import notificationsDropdown from './notifications_dropdown';
import groupAvatar from './group_avatar'; import groupAvatar from './group_avatar';
...@@ -14,7 +11,6 @@ import Compare from './compare'; ...@@ -14,7 +11,6 @@ import Compare from './compare';
import Labels from './labels'; import Labels from './labels';
import LabelManager from './label_manager'; import LabelManager from './label_manager';
import Sidebar from './right_sidebar'; import Sidebar from './right_sidebar';
import IssuableTemplateSelectors from './templates/issuable_template_selectors';
import Flash from './flash'; import Flash from './flash';
import BindInOut from './behaviors/bind_in_out'; import BindInOut from './behaviors/bind_in_out';
import SecretValues from './behaviors/secret_values'; import SecretValues from './behaviors/secret_values';
...@@ -245,14 +241,16 @@ import Activities from './activities'; ...@@ -245,14 +241,16 @@ import Activities from './activities';
}); });
} }
case 'projects:merge_requests:creations:diffs': case 'projects:merge_requests:creations:diffs':
import('./pages/projects/merge_requests/creations/diffs')
.then(callDefault)
.catch(fail);
shortcut_handler = true;
break;
case 'projects:merge_requests:edit': case 'projects:merge_requests:edit':
new Diff(); import('./pages/projects/merge_requests/edit')
shortcut_handler = new ShortcutsNavigation(); .then(callDefault)
new GLForm($('.merge-request-form'), true); .catch(fail);
new IssuableForm($('.merge-request-form')); shortcut_handler = true;
new LabelsSelect();
new MilestoneSelect();
new IssuableTemplateSelectors();
break; break;
case 'projects:tags:new': case 'projects:tags:new':
import('./pages/projects/tags/new') import('./pages/projects/tags/new')
......
import initMergeRequest from '~/pages/projects/merge_requests/init_merge_request';
export default initMergeRequest;
import initMergeRequest from '~/pages/projects/merge_requests/init_merge_request';
export default initMergeRequest;
/* eslint-disable no-new */
import Diff from '~/diff';
import ShortcutsNavigation from '~/shortcuts_navigation';
import GLForm from '~/gl_form';
import IssuableForm from '~/issuable_form';
import LabelsSelect from '~/labels_select';
import MilestoneSelect from '~/milestone_select';
import IssuableTemplateSelectors from '~/templates/issuable_template_selectors';
export default () => {
new Diff();
new ShortcutsNavigation();
new GLForm($('.merge-request-form'), true);
new IssuableForm($('.merge-request-form'));
new LabelsSelect();
new MilestoneSelect();
new IssuableTemplateSelectors();
};
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