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