Commit 86268771 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'dispatcher-projects-c' into 'master'

dispatcher changes for projects:c* views

See merge request gitlab-org/gitlab-ce!16416
parents 78ca7d97 f21e2c21
/* 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 { s__ } from './locale';
import projectSelect from './project_select'; import projectSelect from './project_select';
import Milestone from './milestone'; import Milestone from './milestone';
import IssuableForm from './issuable_form'; import IssuableForm from './issuable_form';
...@@ -14,19 +13,16 @@ import Project from './project'; ...@@ -14,19 +13,16 @@ import Project from './project';
import projectAvatar from './project_avatar'; import projectAvatar from './project_avatar';
import MergeRequest from './merge_request'; import MergeRequest from './merge_request';
import Compare from './compare'; import Compare from './compare';
import initCompareAutocomplete from './compare_autocomplete';
import ProjectNew from './project_new'; import ProjectNew from './project_new';
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 IssuableTemplateSelectors from './templates/issuable_template_selectors';
import Flash from './flash'; import Flash from './flash';
import CommitsList from './commits';
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';
import Group from './group'; import Group from './group';
import ProjectsList from './projects_list'; import ProjectsList from './projects_list';
import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
import UserCallout from './user_callout'; import UserCallout from './user_callout';
import ShortcutsWiki from './shortcuts_wiki'; import ShortcutsWiki from './shortcuts_wiki';
import BlobViewer from './blob/viewer/index'; import BlobViewer from './blob/viewer/index';
...@@ -42,8 +38,6 @@ import PerformanceBar from './performance_bar'; ...@@ -42,8 +38,6 @@ import PerformanceBar from './performance_bar';
import initNotes from './init_notes'; import initNotes from './init_notes';
import initIssuableSidebar from './init_issuable_sidebar'; import initIssuableSidebar from './init_issuable_sidebar';
import initProjectVisibilitySelector from './project_visibility'; import initProjectVisibilitySelector from './project_visibility';
import GpgBadges from './gpg_badges';
import initChangesDropdown from './init_changes_dropdown';
import NewGroupChild from './groups/new_group_child'; import NewGroupChild from './groups/new_group_child';
import { ajaxGet, convertPermissionToBoolean } from './lib/utils/common_utils'; import { ajaxGet, convertPermissionToBoolean } from './lib/utils/common_utils';
import GlFieldErrors from './gl_field_errors'; import GlFieldErrors from './gl_field_errors';
...@@ -58,7 +52,6 @@ import Diff from './diff'; ...@@ -58,7 +52,6 @@ import Diff from './diff';
import ProjectLabelSubscription from './project_label_subscription'; import ProjectLabelSubscription from './project_label_subscription';
import SearchAutocomplete from './search_autocomplete'; import SearchAutocomplete from './search_autocomplete';
import Activities from './activities'; import Activities from './activities';
import { fetchCommitMergeRequests } from './commit_merge_requests';
(function() { (function() {
var Dispatcher; var Dispatcher;
...@@ -208,9 +201,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -208,9 +201,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
.catch(fail); .catch(fail);
break; break;
case 'projects:compare:show': case 'projects:compare:show':
new Diff(); import('./pages/projects/compare/show')
const paddingTop = 16; .then(callDefault)
initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - paddingTop); .catch(fail);
break; break;
case 'projects:branches:new': case 'projects:branches:new':
import('./pages/projects/branches/new') import('./pages/projects/branches/new')
...@@ -324,23 +317,15 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -324,23 +317,15 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
.catch(fail); .catch(fail);
break; break;
case 'projects:commit:show': case 'projects:commit:show':
new Diff(); import('./pages/projects/commit/show')
new ZenMode(); .then(callDefault)
shortcut_handler = new ShortcutsNavigation(); .catch(fail);
new MiniPipelineGraph({ shortcut_handler = true;
container: '.js-commit-pipeline-graph',
}).bindEvents();
initNotes();
const stickyBarPaddingTop = 16;
initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - stickyBarPaddingTop);
$('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath);
fetchCommitMergeRequests();
break; break;
case 'projects:commit:pipelines': case 'projects:commit:pipelines':
new MiniPipelineGraph({ import('./pages/projects/commit/pipelines')
container: '.js-commit-pipeline-graph', .then(callDefault)
}).bindEvents(); .catch(fail);
$('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath);
break; break;
case 'projects:activity': case 'projects:activity':
import('./pages/projects/activity') import('./pages/projects/activity')
...@@ -349,9 +334,10 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -349,9 +334,10 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
shortcut_handler = true; shortcut_handler = true;
break; break;
case 'projects:commits:show': case 'projects:commits:show':
CommitsList.init(document.querySelector('.js-project-commits-show').dataset.commitsLimit); import('./pages/projects/commits/show')
shortcut_handler = new ShortcutsNavigation(); .then(callDefault)
GpgBadges.fetch(); .catch(fail);
shortcut_handler = true;
break; break;
case 'projects:show': case 'projects:show':
shortcut_handler = new ShortcutsNavigation(); shortcut_handler = new ShortcutsNavigation();
...@@ -573,20 +559,14 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -573,20 +559,14 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
.catch(fail); .catch(fail);
break; break;
case 'projects:clusters:show': case 'projects:clusters:show':
import(/* webpackChunkName: "clusters" */ './clusters/clusters_bundle') import('./pages/projects/clusters/show')
.then(cluster => new cluster.default()) // eslint-disable-line new-cap .then(callDefault)
.catch((err) => { .catch(fail);
Flash(s__('ClusterIntegration|Problem setting up the cluster'));
throw err;
});
break; break;
case 'projects:clusters:index': case 'projects:clusters:index':
import(/* webpackChunkName: "clusters_index" */ './clusters/clusters_index') import('./pages/projects/clusters/index')
.then(clusterIndex => clusterIndex.default()) .then(callDefault)
.catch((err) => { .catch(fail);
Flash(s__('ClusterIntegration|Problem setting up the clusters list'));
throw err;
});
break; break;
} }
switch (path[0]) { switch (path[0]) {
...@@ -666,7 +646,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests'; ...@@ -666,7 +646,9 @@ import { fetchCommitMergeRequests } from './commit_merge_requests';
projectAvatar(); projectAvatar();
switch (path[1]) { switch (path[1]) {
case 'compare': case 'compare':
initCompareAutocomplete(); import('./pages/projects/compare')
.then(callDefault)
.catch(fail);
break; break;
case 'edit': case 'edit':
shortcut_handler = new ShortcutsNavigation(); shortcut_handler = new ShortcutsNavigation();
......
import ClustersIndex from '~/clusters/clusters_index';
export default () => {
new ClustersIndex(); // eslint-disable-line no-new
};
import ClustersBundle from '~/clusters/clusters_bundle';
export default () => {
new ClustersBundle(); // eslint-disable-line no-new
};
import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown';
export default () => {
new MiniPipelineGraph({
container: '.js-commit-pipeline-graph',
}).bindEvents();
$('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath);
};
/* eslint-disable no-new */
import Diff from '~/diff';
import ZenMode from '~/zen_mode';
import ShortcutsNavigation from '~/shortcuts_navigation';
import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown';
import initNotes from '~/init_notes';
import initChangesDropdown from '~/init_changes_dropdown';
import { fetchCommitMergeRequests } from '~/commit_merge_requests';
export default () => {
new Diff();
new ZenMode();
new ShortcutsNavigation();
new MiniPipelineGraph({
container: '.js-commit-pipeline-graph',
}).bindEvents();
initNotes();
const stickyBarPaddingTop = 16;
initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - stickyBarPaddingTop);
$('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath);
fetchCommitMergeRequests();
};
import CommitsList from '~/commits';
import GpgBadges from '~/gpg_badges';
import ShortcutsNavigation from '~/shortcuts_navigation';
export default () => {
CommitsList.init(document.querySelector('.js-project-commits-show').dataset.commitsLimit);
new ShortcutsNavigation(); // eslint-disable-line no-new
GpgBadges.fetch();
};
import initCompareAutocomplete from '~/compare_autocomplete';
export default () => {
initCompareAutocomplete();
};
import Diff from '~/diff';
import initChangesDropdown from '~/init_changes_dropdown';
export default () => {
new Diff(); // eslint-disable-line no-new
const paddingTop = 16;
initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - paddingTop);
};
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