diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/assets/javascripts/pages/admin | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/assets/javascripts/pages/admin')
13 files changed, 49 insertions, 94 deletions
diff --git a/app/assets/javascripts/pages/admin/abuse_reports/index.js b/app/assets/javascripts/pages/admin/abuse_reports/index.js index 5649c47d7e8..0a4311ec73a 100644 --- a/app/assets/javascripts/pages/admin/abuse_reports/index.js +++ b/app/assets/javascripts/pages/admin/abuse_reports/index.js @@ -1,8 +1,5 @@ -/* eslint-disable no-new */ import UsersSelect from '~/users_select'; import AbuseReports from './abuse_reports'; -document.addEventListener('DOMContentLoaded', () => { - new AbuseReports(); - new UsersSelect(); -}); +new AbuseReports(); /* eslint-disable-line no-new */ +new UsersSelect(); /* eslint-disable-line no-new */ diff --git a/app/assets/javascripts/pages/admin/admin.js b/app/assets/javascripts/pages/admin/admin.js index e92262852cf..2732fc191be 100644 --- a/app/assets/javascripts/pages/admin/admin.js +++ b/app/assets/javascripts/pages/admin/admin.js @@ -12,8 +12,6 @@ function showDenylistType() { } export default function adminInit() { - const modal = $('.change-owner-holder'); - $('input#user_force_random_password').on('change', function randomPasswordClick() { const $elems = $('#user_password, #user_password_confirmation'); if ($(this).attr('checked')) { @@ -28,36 +26,6 @@ export default function adminInit() { $('.js-toggle-colors-container').toggleClass('hide'); }); - $('.log-tabs a').on('click', function logTabsClick(e) { - e.preventDefault(); - $(this).tab('show'); - }); - - $('.log-bottom').on('click', (e) => { - e.preventDefault(); - const $visibleLog = $('.file-content:visible'); - - // eslint-disable-next-line no-jquery/no-animate - $visibleLog.animate( - { - scrollTop: $visibleLog.find('ol').height(), - }, - 'fast', - ); - }); - - $('.change-owner-link').on('click', function changeOwnerLinkClick(e) { - e.preventDefault(); - $(this).hide(); - modal.show(); - }); - - $('.change-owner-cancel-link').on('click', (e) => { - e.preventDefault(); - modal.hide(); - $('.change-owner-link').show(); - }); - $('li.project_member, li.group_member').on('ajax:success', refreshCurrentPage); $("input[name='denylist_type']").on('click', showDenylistType); diff --git a/app/assets/javascripts/pages/admin/application_settings/general/index.js b/app/assets/javascripts/pages/admin/application_settings/general/index.js index f7bd32880ff..eda1a9d3599 100644 --- a/app/assets/javascripts/pages/admin/application_settings/general/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/general/index.js @@ -1,25 +1,27 @@ -// This is a true violation of @gitlab/no-runtime-template-compiler, as it -// relies on app/views/admin/application_settings/_gitpod.html.haml for its -// template. -/* eslint-disable @gitlab/no-runtime-template-compiler */ import Vue from 'vue'; import IntegrationHelpText from '~/vue_shared/components/integrations_help_text.vue'; import initUserInternalRegexPlaceholder from '../account_and_limits'; -document.addEventListener('DOMContentLoaded', () => { +(() => { initUserInternalRegexPlaceholder(); - const gitpodSettingEl = document.querySelector('#js-gitpod-settings-help-text'); - if (!gitpodSettingEl) { + const el = document.querySelector('#js-gitpod-settings-help-text'); + if (!el) { return; } + const { message, messageUrl } = el.dataset; + // eslint-disable-next-line no-new new Vue({ - el: gitpodSettingEl, - name: 'GitpodSettings', - components: { - IntegrationHelpText, + el, + render(createElement) { + return createElement(IntegrationHelpText, { + props: { + message, + messageUrl, + }, + }); }, }); -}); +})(); diff --git a/app/assets/javascripts/pages/admin/application_settings/index.js b/app/assets/javascripts/pages/admin/application_settings/index.js index e7e74588bec..e3c6b0f6f5b 100644 --- a/app/assets/javascripts/pages/admin/application_settings/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/index.js @@ -4,13 +4,11 @@ import initSearchSettings from '~/search_settings'; import selfMonitor from '~/self_monitor'; import initSettingsPanels from '~/settings_panels'; -document.addEventListener('DOMContentLoaded', () => { - if (gon.features?.ciInstanceVariablesUi) { - initVariableList('js-instance-variables'); - } - selfMonitor(); - // Initialize expandable settings panels - initSettingsPanels(); - projectSelect(); - initSearchSettings(); -}); +if (gon.features?.ciInstanceVariablesUi) { + initVariableList('js-instance-variables'); +} +selfMonitor(); +// Initialize expandable settings panels +initSettingsPanels(); +projectSelect(); +initSearchSettings(); diff --git a/app/assets/javascripts/pages/admin/dev_ops_report/index.js b/app/assets/javascripts/pages/admin/dev_ops_report/index.js index 220fc049562..cf06ee2c22a 100644 --- a/app/assets/javascripts/pages/admin/dev_ops_report/index.js +++ b/app/assets/javascripts/pages/admin/dev_ops_report/index.js @@ -1,5 +1,3 @@ -import initDevopAdoption from 'ee_else_ce/admin/dev_ops_report/devops_adoption'; -import initDevOpsScoreEmptyState from '~/admin/dev_ops_report/devops_score_empty_state'; +import initDevOpsScoreEmptyState from '~/analytics/devops_report/devops_score_empty_state'; initDevOpsScoreEmptyState(); -initDevopAdoption(); diff --git a/app/assets/javascripts/pages/admin/impersonation_tokens/index.js b/app/assets/javascripts/pages/admin/impersonation_tokens/index.js index ae2209b0292..dc1bb88bf4b 100644 --- a/app/assets/javascripts/pages/admin/impersonation_tokens/index.js +++ b/app/assets/javascripts/pages/admin/impersonation_tokens/index.js @@ -1,3 +1,3 @@ -import initExpiresAtField from '~/access_tokens'; +import { initExpiresAtField } from '~/access_tokens'; -document.addEventListener('DOMContentLoaded', initExpiresAtField); +initExpiresAtField(); diff --git a/app/assets/javascripts/pages/admin/index.js b/app/assets/javascripts/pages/admin/index.js index 792a6eda14e..8d5dfd689e8 100644 --- a/app/assets/javascripts/pages/admin/index.js +++ b/app/assets/javascripts/pages/admin/index.js @@ -2,10 +2,8 @@ import initAdminStatisticsPanel from '../../admin/statistics_panel/index'; import initVueAlerts from '../../vue_alerts'; import initAdmin from './admin'; -document.addEventListener('DOMContentLoaded', initVueAlerts); +initVueAlerts(); -document.addEventListener('DOMContentLoaded', () => { - const statisticsPanelContainer = document.getElementById('js-admin-statistics-container'); - initAdmin(); - initAdminStatisticsPanel(statisticsPanelContainer); -}); +const statisticsPanelContainer = document.getElementById('js-admin-statistics-container'); +initAdmin(); +initAdminStatisticsPanel(statisticsPanelContainer); diff --git a/app/assets/javascripts/pages/admin/instance_statistics/index.js b/app/assets/javascripts/pages/admin/instance_statistics/index.js deleted file mode 100644 index d6b0a834ce3..00000000000 --- a/app/assets/javascripts/pages/admin/instance_statistics/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import initInstanceStatisticsApp from '~/analytics/instance_statistics'; - -document.addEventListener('DOMContentLoaded', () => initInstanceStatisticsApp()); diff --git a/app/assets/javascripts/pages/admin/projects/index.js b/app/assets/javascripts/pages/admin/projects/index.js index 2286a085143..042ff7808f1 100644 --- a/app/assets/javascripts/pages/admin/projects/index.js +++ b/app/assets/javascripts/pages/admin/projects/index.js @@ -17,12 +17,10 @@ function mountRemoveMemberModal() { }); } -document.addEventListener('DOMContentLoaded', () => { - mountRemoveMemberModal(); +mountRemoveMemberModal(); - new ProjectsList(); // eslint-disable-line no-new +new ProjectsList(); // eslint-disable-line no-new - document - .querySelectorAll('.js-namespace-select') - .forEach((dropdown) => new NamespaceSelect({ dropdown })); -}); +document + .querySelectorAll('.js-namespace-select') + .forEach((dropdown) => new NamespaceSelect({ dropdown })); diff --git a/app/assets/javascripts/pages/admin/projects/index/index.js b/app/assets/javascripts/pages/admin/projects/index/index.js index 1971323abac..cc9a9b6cc38 100644 --- a/app/assets/javascripts/pages/admin/projects/index/index.js +++ b/app/assets/javascripts/pages/admin/projects/index/index.js @@ -6,7 +6,7 @@ import Translate from '~/vue_shared/translate'; import deleteProjectModal from './components/delete_project_modal.vue'; -document.addEventListener('DOMContentLoaded', () => { +(() => { Vue.use(Translate); const deleteProjectModalEl = document.getElementById('delete-project-modal'); @@ -39,4 +39,4 @@ document.addEventListener('DOMContentLoaded', () => { }); }, }); -}); +})(); diff --git a/app/assets/javascripts/pages/admin/runners/index.js b/app/assets/javascripts/pages/admin/runners/index.js index f07ac1d8674..45ed3ac6bd8 100644 --- a/app/assets/javascripts/pages/admin/runners/index.js +++ b/app/assets/javascripts/pages/admin/runners/index.js @@ -3,12 +3,10 @@ import { FILTERED_SEARCH } from '~/pages/constants'; import initFilteredSearch from '~/pages/search/init_filtered_search'; import { initInstallRunner } from '~/pages/shared/mount_runner_instructions'; -document.addEventListener('DOMContentLoaded', () => { - initFilteredSearch({ - page: FILTERED_SEARCH.ADMIN_RUNNERS, - filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, - useDefaultState: true, - }); - - initInstallRunner(); +initFilteredSearch({ + page: FILTERED_SEARCH.ADMIN_RUNNERS, + filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, + useDefaultState: true, }); + +initInstallRunner(); diff --git a/app/assets/javascripts/pages/admin/services/index/index.js b/app/assets/javascripts/pages/admin/services/index/index.js index b2dfbb5a9fc..b695cf70c5d 100644 --- a/app/assets/javascripts/pages/admin/services/index/index.js +++ b/app/assets/javascripts/pages/admin/services/index/index.js @@ -1,6 +1,4 @@ import PersistentUserCallout from '~/persistent_user_callout'; -document.addEventListener('DOMContentLoaded', () => { - const callout = document.querySelector('.js-service-templates-deprecated'); - PersistentUserCallout.factory(callout); -}); +const callout = document.querySelector('.js-service-templates-deprecated'); +PersistentUserCallout.factory(callout); diff --git a/app/assets/javascripts/pages/admin/usage_trends/index.js b/app/assets/javascripts/pages/admin/usage_trends/index.js new file mode 100644 index 00000000000..23d2bd85979 --- /dev/null +++ b/app/assets/javascripts/pages/admin/usage_trends/index.js @@ -0,0 +1,3 @@ +import initUsageTrendsApp from '~/analytics/usage_trends'; + +initUsageTrendsApp(); |