Commit 63553bb1 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'explore-dispatcher-refactor' into 'master'

Refactors the dispatcher for `explore:*`.

See merge request gitlab-org/gitlab-ce!16296
parents fe7443ef efb0ed16
...@@ -36,12 +36,10 @@ import BindInOut from './behaviors/bind_in_out'; ...@@ -36,12 +36,10 @@ import BindInOut from './behaviors/bind_in_out';
import SecretValues from './behaviors/secret_values'; import SecretValues from './behaviors/secret_values';
import DeleteModal from './branches/branches_delete_modal'; import DeleteModal from './branches/branches_delete_modal';
import Group from './group'; import Group from './group';
import GroupsList from './groups_list';
import ProjectsList from './projects_list'; import ProjectsList from './projects_list';
import setupProjectEdit from './project_edit'; import setupProjectEdit from './project_edit';
import MiniPipelineGraph from './mini_pipeline_graph_dropdown'; import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
import BlobLinePermalinkUpdater from './blob/blob_line_permalink_updater'; import BlobLinePermalinkUpdater from './blob/blob_line_permalink_updater';
import Landing from './landing';
import BlobForkSuggestion from './blob/blob_fork_suggestion'; import BlobForkSuggestion from './blob/blob_fork_suggestion';
import UserCallout from './user_callout'; import UserCallout from './user_callout';
import ShortcutsWiki from './shortcuts_wiki'; import ShortcutsWiki from './shortcuts_wiki';
...@@ -231,19 +229,17 @@ import Activities from './activities'; ...@@ -231,19 +229,17 @@ import Activities from './activities';
case 'explore:projects:index': case 'explore:projects:index':
case 'explore:projects:trending': case 'explore:projects:trending':
case 'explore:projects:starred': case 'explore:projects:starred':
import('./pages/explore/projects')
.then(callDefault)
.catch(fail);
break;
case 'admin:projects:index': case 'admin:projects:index':
new ProjectsList(); new ProjectsList();
break; break;
case 'explore:groups:index': case 'explore:groups:index':
new GroupsList(); import('./pages/explore/groups')
const landingElement = document.querySelector('.js-explore-groups-landing'); .then(callDefault)
if (!landingElement) break; .catch(fail);
const exploreGroupsLanding = new Landing(
landingElement,
landingElement.querySelector('.dismiss-button'),
'explore_groups_landing_dismissed',
);
exploreGroupsLanding.toggle();
break; break;
case 'projects:milestones:new': case 'projects:milestones:new':
case 'projects:milestones:edit': case 'projects:milestones:edit':
...@@ -514,8 +510,8 @@ import Activities from './activities'; ...@@ -514,8 +510,8 @@ import Activities from './activities';
break; break;
case 'projects:forks:new': case 'projects:forks:new':
import(/* webpackChunkName: 'project_fork' */ './project_fork') import(/* webpackChunkName: 'project_fork' */ './project_fork')
.then(fork => fork.default()) .then(callDefault)
.catch(() => {}); .catch(fail);
break; break;
case 'projects:artifacts:browse': case 'projects:artifacts:browse':
import('./pages/projects/artifacts/browse') import('./pages/projects/artifacts/browse')
...@@ -652,8 +648,8 @@ import Activities from './activities'; ...@@ -652,8 +648,8 @@ import Activities from './activities';
shortcut_handler = new ShortcutsNavigation(); shortcut_handler = new ShortcutsNavigation();
new ProjectNew(); new ProjectNew();
import(/* webpackChunkName: 'project_permissions' */ './projects/permissions') import(/* webpackChunkName: 'project_permissions' */ './projects/permissions')
.then(permissions => permissions.default()) .then(callDefault)
.catch(() => {}); .catch(fail);
break; break;
case 'new': case 'new':
new ProjectNew(); new ProjectNew();
......
import GroupsList from '~/groups_list';
import Landing from '~/landing';
export default function () {
new GroupsList(); // eslint-disable-line no-new
const landingElement = document.querySelector('.js-explore-groups-landing');
if (!landingElement) return;
const exploreGroupsLanding = new Landing(
landingElement,
landingElement.querySelector('.dismiss-button'),
'explore_groups_landing_dismissed',
);
exploreGroupsLanding.toggle();
}
import ProjectsList from '~/projects_list';
export default () => new ProjectsList();
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