diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/assets/javascripts/pages/admin | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/assets/javascripts/pages/admin')
4 files changed, 43 insertions, 8 deletions
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 cf06ee2c22a..d6fa1be29b0 100644 --- a/app/assets/javascripts/pages/admin/dev_ops_report/index.js +++ b/app/assets/javascripts/pages/admin/dev_ops_report/index.js @@ -1,3 +1,5 @@ -import initDevOpsScoreEmptyState from '~/analytics/devops_report/devops_score_empty_state'; +import initDevOpsScore from '~/analytics/devops_report/devops_score'; +import initDevOpsScoreDisabledUsagePing from '~/analytics/devops_report/devops_score_disabled_usage_ping'; -initDevOpsScoreEmptyState(); +initDevOpsScoreDisabledUsagePing(); +initDevOpsScore(); diff --git a/app/assets/javascripts/pages/admin/labels/index/index.js b/app/assets/javascripts/pages/admin/labels/index/index.js index e5ab5d43bbf..17ee7c03ed6 100644 --- a/app/assets/javascripts/pages/admin/labels/index/index.js +++ b/app/assets/javascripts/pages/admin/labels/index/index.js @@ -1,3 +1,21 @@ -import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior'; +document.addEventListener('DOMContentLoaded', () => { + const pagination = document.querySelector('.labels .gl-pagination'); + const emptyState = document.querySelector('.labels .nothing-here-block.hidden'); -document.addEventListener('DOMContentLoaded', initDeprecatedRemoveRowBehavior); + function removeLabelSuccessCallback() { + this.closest('li').classList.add('gl-display-none!'); + + const labelsCount = document.querySelectorAll( + 'ul.manage-labels-list li:not(.gl-display-none\\!)', + ).length; + + // display the empty state if there are no more labels + if (labelsCount < 1 && !pagination && emptyState) { + emptyState.classList.remove('hidden'); + } + } + + document.querySelectorAll('.js-remove-label').forEach((row) => { + row.addEventListener('ajax:success', removeLabelSuccessCallback); + }); +}); diff --git a/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue b/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue index 20407334b3f..a3b78da6ef5 100644 --- a/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue +++ b/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue @@ -1,6 +1,8 @@ <script> import { GlModal, GlButton, GlFormInput, GlSprintf } from '@gitlab/ui'; +import * as Sentry from '@sentry/browser'; import { s__, sprintf } from '~/locale'; +import OncallSchedulesList from '~/vue_shared/components/oncall_schedules_list.vue'; export default { components: { @@ -8,6 +10,7 @@ export default { GlButton, GlFormInput, GlSprintf, + OncallSchedulesList, }, props: { title: { @@ -42,6 +45,11 @@ export default { type: String, required: true, }, + oncallSchedules: { + type: String, + required: false, + default: '[]', + }, }, data() { return { @@ -58,6 +66,14 @@ export default { canSubmit() { return this.enteredUsername === this.username; }, + schedules() { + try { + return JSON.parse(this.oncallSchedules); + } catch (e) { + Sentry.captureException(e); + } + return []; + }, }, methods: { show() { @@ -96,6 +112,8 @@ export default { </gl-sprintf> </p> + <oncall-schedules-list v-if="schedules.length" :schedules="schedules" /> + <p> <gl-sprintf :message="s__('AdminUsers|To confirm, type %{username}')"> <template #username> diff --git a/app/assets/javascripts/pages/admin/users/index.js b/app/assets/javascripts/pages/admin/users/index.js index b1079c3b068..9a8b0c9990f 100644 --- a/app/assets/javascripts/pages/admin/users/index.js +++ b/app/assets/javascripts/pages/admin/users/index.js @@ -1,7 +1,6 @@ import Vue from 'vue'; -import { initAdminUsersApp, initCohortsEmptyState } from '~/admin/users'; -import initTabs from '~/admin/users/tabs'; +import { initAdminUsersApp } from '~/admin/users'; import initConfirmModal from '~/confirm_modal'; import csrf from '~/lib/utils/csrf'; import Translate from '~/vue_shared/translate'; @@ -62,6 +61,4 @@ document.addEventListener('DOMContentLoaded', () => { }); initConfirmModal(); - initCohortsEmptyState(); - initTabs(); }); |