diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/assets/javascripts/pages/admin | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/assets/javascripts/pages/admin')
7 files changed, 64 insertions, 53 deletions
diff --git a/app/assets/javascripts/pages/admin/admin.js b/app/assets/javascripts/pages/admin/admin.js index 88967d82b2f..038bbe392ba 100644 --- a/app/assets/javascripts/pages/admin/admin.js +++ b/app/assets/javascripts/pages/admin/admin.js @@ -1,13 +1,13 @@ import $ from 'jquery'; import { refreshCurrentPage } from '../../lib/utils/url_utility'; -function showBlacklistType() { - if ($('input[name="blacklist_type"]:checked').val() === 'file') { - $('.blacklist-file').show(); - $('.blacklist-raw').hide(); +function showDenylistType() { + if ($('input[name="denylist_type"]:checked').val() === 'file') { + $('.js-denylist-file').show(); + $('.js-denylist-raw').hide(); } else { - $('.blacklist-file').hide(); - $('.blacklist-raw').show(); + $('.js-denylist-file').hide(); + $('.js-denylist-raw').show(); } } @@ -60,6 +60,6 @@ export default function adminInit() { $('li.project_member, li.group_member').on('ajax:success', refreshCurrentPage); - $("input[name='blacklist_type']").on('click', showBlacklistType); - showBlacklistType(); + $("input[name='denylist_type']").on('click', showDenylistType); + 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 8183e81fb02..af1595398a8 100644 --- a/app/assets/javascripts/pages/admin/application_settings/general/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/general/index.js @@ -1,3 +1,21 @@ +import Vue from 'vue'; import initUserInternalRegexPlaceholder from '../account_and_limits'; +import IntegrationHelpText from '~/vue_shared/components/integrations_help_text.vue'; -document.addEventListener('DOMContentLoaded', initUserInternalRegexPlaceholder()); +document.addEventListener('DOMContentLoaded', () => { + initUserInternalRegexPlaceholder(); + + const gitpodSettingEl = document.querySelector('#js-gitpod-settings-help-text'); + if (!gitpodSettingEl) { + return; + } + + // eslint-disable-next-line no-new + new Vue({ + el: gitpodSettingEl, + name: 'GitpodSettings', + components: { + IntegrationHelpText, + }, + }); +}); 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 643497003ba..220fc049562 100644 --- a/app/assets/javascripts/pages/admin/dev_ops_report/index.js +++ b/app/assets/javascripts/pages/admin/dev_ops_report/index.js @@ -1,27 +1,5 @@ -import Vue from 'vue'; -import UserCallout from '~/user_callout'; -import UsagePingDisabled from '~/admin/dev_ops_report/components/usage_ping_disabled.vue'; +import initDevopAdoption from 'ee_else_ce/admin/dev_ops_report/devops_adoption'; +import initDevOpsScoreEmptyState from '~/admin/dev_ops_report/devops_score_empty_state'; -document.addEventListener('DOMContentLoaded', () => { - // eslint-disable-next-line no-new - new UserCallout(); - - const emptyStateContainer = document.getElementById('js-devops-empty-state'); - - if (!emptyStateContainer) return false; - - const { emptyStateSvgPath, enableUsagePingLink, docsLink, isAdmin } = emptyStateContainer.dataset; - - return new Vue({ - el: emptyStateContainer, - provide: { - isAdmin: Boolean(isAdmin), - svgPath: emptyStateSvgPath, - primaryButtonPath: enableUsagePingLink, - docsLink, - }, - render(h) { - return h(UsagePingDisabled); - }, - }); -}); +initDevOpsScoreEmptyState(); +initDevopAdoption(); diff --git a/app/assets/javascripts/pages/admin/jobs/index/components/stop_jobs_modal.vue b/app/assets/javascripts/pages/admin/jobs/index/components/stop_jobs_modal.vue index 120512bf15e..4b6f52c09be 100644 --- a/app/assets/javascripts/pages/admin/jobs/index/components/stop_jobs_modal.vue +++ b/app/assets/javascripts/pages/admin/jobs/index/components/stop_jobs_modal.vue @@ -1,13 +1,13 @@ <script> +import { GlModal } from '@gitlab/ui'; import axios from '~/lib/utils/axios_utils'; import { deprecatedCreateFlash as createFlash } from '~/flash'; -import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue'; import { redirectTo } from '~/lib/utils/url_utility'; -import { s__ } from '~/locale'; +import { __, s__ } from '~/locale'; export default { components: { - GlModal: DeprecatedModal2, + GlModal, }, props: { url: { @@ -36,17 +36,24 @@ export default { }); }, }, + primaryAction: { + text: s__('AdminArea|Stop jobs'), + attributes: [{ variant: 'danger' }], + }, + cancelAction: { + text: __('Cancel'), + }, }; </script> <template> <gl-modal - id="stop-jobs-modal" - :header-title-text="s__('AdminArea|Stop all jobs?')" - :footer-primary-button-text="s__('AdminArea|Stop jobs')" - footer-primary-button-variant="danger" - @submit="onSubmit" + modal-id="stop-jobs-modal" + :action-primary="$options.primaryAction" + :action-cancel="$options.cancelAction" + @primary="onSubmit" > + <template #modal-title>{{ s__('AdminArea|Stop all jobs?') }}</template> {{ text }} </gl-modal> </template> diff --git a/app/assets/javascripts/pages/admin/jobs/index/index.js b/app/assets/javascripts/pages/admin/jobs/index/index.js index 5a4f8c6e745..4df210debb5 100644 --- a/app/assets/javascripts/pages/admin/jobs/index/index.js +++ b/app/assets/javascripts/pages/admin/jobs/index/index.js @@ -5,19 +5,24 @@ import stopJobsModal from './components/stop_jobs_modal.vue'; Vue.use(Translate); document.addEventListener('DOMContentLoaded', () => { - const stopJobsButton = document.getElementById('stop-jobs-button'); + const buttonId = 'js-stop-jobs-button'; + const modalId = 'stop-jobs-modal'; + const stopJobsButton = document.getElementById(buttonId); if (stopJobsButton) { // eslint-disable-next-line no-new new Vue({ - el: '#stop-jobs-modal', + el: `#js-${modalId}`, components: { stopJobsModal, }, mounted() { stopJobsButton.classList.remove('disabled'); + stopJobsButton.addEventListener('click', () => { + this.$root.$emit('bv::show::modal', modalId, `#${buttonId}`); + }); }, render(createElement) { - return createElement('stop-jobs-modal', { + return createElement(modalId, { props: { url: stopJobsButton.dataset.url, }, diff --git a/app/assets/javascripts/pages/admin/runners/index.js b/app/assets/javascripts/pages/admin/runners/index.js index e60c6133c7c..104b7eeaf96 100644 --- a/app/assets/javascripts/pages/admin/runners/index.js +++ b/app/assets/javascripts/pages/admin/runners/index.js @@ -1,11 +1,12 @@ import initFilteredSearch from '~/pages/search/init_filtered_search'; import AdminRunnersFilteredSearchTokenKeys from '~/filtered_search/admin_runners_filtered_search_token_keys'; import { FILTERED_SEARCH } from '~/pages/constants'; +import { initInstallRunner } from '~/pages/shared/mount_runner_instructions'; -document.addEventListener('DOMContentLoaded', () => { - initFilteredSearch({ - page: FILTERED_SEARCH.ADMIN_RUNNERS, - filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, - useDefaultState: true, - }); +initFilteredSearch({ + page: FILTERED_SEARCH.ADMIN_RUNNERS, + filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, + useDefaultState: true, }); + +initInstallRunner(); diff --git a/app/assets/javascripts/pages/admin/users/index.js b/app/assets/javascripts/pages/admin/users/index.js index 86c4b4f4f48..5f3cdc0bfc6 100644 --- a/app/assets/javascripts/pages/admin/users/index.js +++ b/app/assets/javascripts/pages/admin/users/index.js @@ -5,12 +5,12 @@ import ModalManager from './components/user_modal_manager.vue'; import DeleteUserModal from './components/delete_user_modal.vue'; import UserOperationConfirmationModal from './components/user_operation_confirmation_modal.vue'; import csrf from '~/lib/utils/csrf'; +import initConfirmModal from '~/confirm_modal'; const MODAL_TEXTS_CONTAINER_SELECTOR = '#modal-texts'; const MODAL_MANAGER_SELECTOR = '#user-modal'; const ACTION_MODALS = { deactivate: UserOperationConfirmationModal, - block: UserOperationConfirmationModal, delete: DeleteUserModal, 'delete-with-contributions': DeleteUserModal, }; @@ -62,4 +62,6 @@ document.addEventListener('DOMContentLoaded', () => { }); }, }); + + initConfirmModal(); }); |