Commit 21d968bf authored by Jacob Schatz's avatar Jacob Schatz

Add rest of refactor of dispatcher for project:s*

parent 65fe8b08
...@@ -351,19 +351,9 @@ import Activities from './activities'; ...@@ -351,19 +351,9 @@ import Activities from './activities';
shortcut_handler = true; shortcut_handler = true;
break; break;
case 'projects:show': case 'projects:show':
shortcut_handler = new ShortcutsNavigation(); import('./pages/projects/show')
new NotificationsForm(); .then(callDefault)
new UserCallout({ .catch(fail);
setCalloutPerProject: true,
className: 'js-autodevops-banner',
});
if ($('#tree-slider').length) new TreeView();
if ($('.blob-viewer').length) new BlobViewer();
if ($('.project-show-activity').length) new Activities();
$('#tree-slider').waitForImages(function() {
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath);
});
break; break;
case 'projects:edit': case 'projects:edit':
import('./pages/projects/edit') import('./pages/projects/edit')
...@@ -522,18 +512,15 @@ import Activities from './activities'; ...@@ -522,18 +512,15 @@ import Activities from './activities';
.catch(fail); .catch(fail);
break; break;
case 'projects:settings:repository:show': case 'projects:settings:repository:show':
// Initialize expandable settings panels import('./pages/projects/settings/repository/show')
initSettingsPanels(); .then(callDefault)
.catch(fail);
break; break;
case 'projects:settings:ci_cd:show': case 'projects:settings:ci_cd:show':
// Initialize expandable settings panels import('./pages/projects/settings/ci_cd/show')
initSettingsPanels(); .then(callDefault)
.catch(fail);
const runnerToken = document.querySelector('.js-secret-runner-token'); break;
if (runnerToken) {
const runnerTokenSecretValue = new SecretValues(runnerToken);
runnerTokenSecretValue.init();
}
case 'groups:settings:ci_cd:show': case 'groups:settings:ci_cd:show':
const secretVariableTable = document.querySelector('.js-secret-variable-table'); const secretVariableTable = document.querySelector('.js-secret-variable-table');
if (secretVariableTable) { if (secretVariableTable) {
......
import initSettingsPanels from '~/settings_panels';
import SecretValues from '~/behaviors/secret_values';
export default function () {
// Initialize expandable settings panels
initSettingsPanels();
const runnerToken = document.querySelector('.js-secret-runner-token');
if (runnerToken) {
const runnerTokenSecretValue = new SecretValues(runnerToken);
runnerTokenSecretValue.init();
}
}
import initSettingsPanels from '~/settings_panels';
export default function () {
// Initialize expandable settings panels
initSettingsPanels();
}
import ShortcutsNavigation from '~/shortcuts_navigation';
import NotificationsForm from '~/notifications_form';
import UserCallout from '~/user_callout';
import TreeView from '~/tree';
import BlobViewer from '~/blob/viewer/index';
import Activities from '~/activities';
import { ajaxGet } from '~/lib/utils/common_utils';
export default function () {
new ShortcutsNavigation(); // eslint-disable-line no-new
new NotificationsForm(); // eslint-disable-line no-new
new UserCallout({ // eslint-disable-line no-new
setCalloutPerProject: true,
className: 'js-autodevops-banner',
});
if ($('#tree-slider').length) new TreeView(); // eslint-disable-line no-new
if ($('.blob-viewer').length) new BlobViewer(); // eslint-disable-line no-new
if ($('.project-show-activity').length) new Activities(); // eslint-disable-line no-new
$('#tree-slider').waitForImages(() => {
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath);
});
}
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