Commit 0fa15a51 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'ee-dispatcher-dashboard-todos' into 'master'

Refactor dashboard todos inside dispatcher (EE)

See merge request gitlab-org/gitlab-ee!3967
parents f26d81f3 4388eb2a
...@@ -57,7 +57,6 @@ import GfmAutoComplete from './gfm_auto_complete'; ...@@ -57,7 +57,6 @@ import GfmAutoComplete from './gfm_auto_complete';
import ShortcutsBlob from './shortcuts_blob'; import ShortcutsBlob from './shortcuts_blob';
import SigninTabsMemoizer from './signin_tabs_memoizer'; import SigninTabsMemoizer from './signin_tabs_memoizer';
import Star from './star'; import Star from './star';
import Todos from './todos';
import TreeView from './tree'; import TreeView from './tree';
import UsagePing from './usage_ping'; import UsagePing from './usage_ping';
import UsernameValidator from './username_validator'; import UsernameValidator from './username_validator';
...@@ -123,6 +122,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line ...@@ -123,6 +122,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
} }
const fail = () => Flash('Error loading dynamic module'); const fail = () => Flash('Error loading dynamic module');
const callDefault = m => m.default();
path = page.split(':'); path = page.split(':');
shortcut_handler = null; shortcut_handler = null;
...@@ -240,7 +240,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line ...@@ -240,7 +240,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
projectSelect(); projectSelect();
break; break;
case 'dashboard:todos:index': case 'dashboard:todos:index':
new Todos(); import('./pages/dashboard/todos/index').then(callDefault).catch(fail);
break; break;
case 'dashboard:projects:index': case 'dashboard:projects:index':
case 'dashboard:projects:starred': case 'dashboard:projects:starred':
...@@ -607,7 +607,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line ...@@ -607,7 +607,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
new CILintEditor(); new CILintEditor();
break; break;
case 'users:show': case 'users:show':
import('./pages/users/show').then(m => m.default()).catch(fail); import('./pages/users/show').then(callDefault).catch(fail);
break; break;
case 'admin:conversational_development_index:show': case 'admin:conversational_development_index:show':
new UserCallout(); new UserCallout();
......
import Todos from './todos';
export default () => new Todos();
/* eslint-disable class-methods-use-this, no-unneeded-ternary, quote-props */ /* eslint-disable class-methods-use-this, no-unneeded-ternary, quote-props */
import { visitUrl } from './lib/utils/url_utility'; import { visitUrl } from '~/lib/utils/url_utility';
import UsersSelect from './users_select'; import UsersSelect from '~/users_select';
import { isMetaClick } from './lib/utils/common_utils'; import { isMetaClick } from '~/lib/utils/common_utils';
export default class Todos { export default class Todos {
constructor() { constructor() {
......
import * as urlUtils from '~/lib/utils/url_utility'; import * as urlUtils from '~/lib/utils/url_utility';
import Todos from '~/todos'; import Todos from '~/pages/dashboard/todos/index/todos';
import '~/lib/utils/common_utils'; import '~/lib/utils/common_utils';
describe('Todos', () => { describe('Todos', () => {
......
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