Commit 3853a609 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'ee-projects-r-s' into 'master'

refactor for projects-r*, s* (EE)

See merge request gitlab-org/gitlab-ee!4174
parents b84dc2c7 7cd70129
/* 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 Milestone from './milestone';
import NotificationsForm from './notifications_form';
import notificationsDropdown from './notifications_dropdown';
import LineHighlighter from './line_highlighter';
import MergeRequest from './merge_request';
import initCompareAutocomplete from './compare_autocomplete';
import Sidebar from './right_sidebar';
import Flash from './flash';
import SecretValues from './behaviors/secret_values';
import UserCallout from './user_callout';
import BlobViewer from './blob/viewer/index';
import GfmAutoComplete from './gfm_auto_complete';
import Star from './star';
import TreeView from './tree';
import ZenMode from './zen_mode';
import initSettingsPanels from './settings_panels';
import PerformanceBar from './performance_bar';
import initNotes from './init_notes';
import initIssuableSidebar from './init_issuable_sidebar';
import { ajaxGet, convertPermissionToBoolean } from './lib/utils/common_utils';
import { convertPermissionToBoolean } from './lib/utils/common_utils';
import GlFieldErrors from './gl_field_errors';
import GLForm from './gl_form';
import Shortcuts from './shortcuts';
import ShortcutsNavigation from './shortcuts_navigation';
import ShortcutsIssuable from './shortcuts_issuable';
import U2FAuthenticate from './u2f/authenticate';
import Diff from './diff';
import SearchAutocomplete from './search_autocomplete';
import Activities from './activities';
// EE-only
import UsersSelect from './users_select';
......@@ -267,15 +260,21 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
.catch(fail);
break;
case 'projects:snippets:show':
initNotes();
new ZenMode();
import('./pages/projects/snippets/show')
.then(callDefault)
.catch(fail);
break;
case 'projects:snippets:new':
case 'projects:snippets:edit':
case 'projects:snippets:create':
import('./pages/projects/snippets/new')
.then(callDefault)
.catch(fail);
break;
case 'projects:snippets:edit':
case 'projects:snippets:update':
new GLForm($('.snippet-form'), true);
new ZenMode();
import('./pages/projects/snippets/edit')
.then(callDefault)
.catch(fail);
break;
case 'snippets:new':
import('./pages/snippets/new')
......@@ -298,8 +297,9 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
.catch(fail);
break;
case 'projects:releases:edit':
new ZenMode();
new GLForm($('.release-form'), true);
import('./pages/projects/releases/edit')
.then(callDefault)
.catch(fail);
break;
case 'projects:merge_requests:show':
new Diff();
......@@ -343,21 +343,13 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
shortcut_handler = true;
break;
case 'projects:show':
shortcut_handler = new ShortcutsNavigation();
new NotificationsForm();
new UserCallout({
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);
});
import('./pages/projects/show')
.then(callDefault)
.catch(fail);
shortcut_handler = true;
// ee-start
initGeoInfoModal();
// ee-end
break;
case 'projects:edit':
import('./pages/projects/edit')
......@@ -525,20 +517,19 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
import(/* webpackChunkName: "ee_audit_logs" */ 'ee/pages/admin/audit_logs').then(m => m.default()).catch(fail);
break;
case 'projects:settings:repository:show':
import('./pages/projects/settings/repository/show')
.then(callDefault)
.catch(fail);
// ee-start
new UsersSelect();
new UserCallout();
// Initialize expandable settings panels
initSettingsPanels();
// ee-end
break;
case 'projects:settings:ci_cd:show':
// Initialize expandable settings panels
initSettingsPanels();
const runnerToken = document.querySelector('.js-secret-runner-token');
if (runnerToken) {
const runnerTokenSecretValue = new SecretValues(runnerToken);
runnerTokenSecretValue.init();
}
import('./pages/projects/settings/ci_cd/show')
.then(callDefault)
.catch(fail);
break;
case 'groups:settings:ci_cd:show':
import('./pages/groups/settings/ci_cd/show')
.then(callDefault)
......
import ZenMode from '~/zen_mode';
import GLForm from '~/gl_form';
export default function ($formEl) {
new ZenMode(); // eslint-disable-line no-new
new GLForm($formEl, true); // eslint-disable-line no-new
}
import initForm from '~/pages/projects/init_form';
export default initForm($('.release-form'));
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();
}
const secretVariableTable = document.querySelector('.js-secret-variable-table');
if (secretVariableTable) {
const secretVariableTableValues = new SecretValues(secretVariableTable);
secretVariableTableValues.init();
}
}
import initSettingsPanels from '~/settings_panels';
export default 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 () => {
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);
});
};
import initForm from '~/pages/projects/init_form';
export default initForm($('.snippet-form'));
import initForm from '~/pages/projects/init_form';
export default initForm($('.snippet-form'));
import initNotes from '~/init_notes';
import ZenMode from '~/zen_mode';
export default function () {
initNotes();
new ZenMode(); // eslint-disable-line no-new
}
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