diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/assets/javascripts/admin/users | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/assets/javascripts/admin/users')
5 files changed, 22 insertions, 14 deletions
diff --git a/app/assets/javascripts/admin/users/components/actions/delete.vue b/app/assets/javascripts/admin/users/components/actions/delete.vue index a0f4a4bf382..e6dde5898e7 100644 --- a/app/assets/javascripts/admin/users/components/actions/delete.vue +++ b/app/assets/javascripts/admin/users/components/actions/delete.vue @@ -14,7 +14,7 @@ export default { type: Object, required: true, }, - oncallSchedules: { + userDeletionObstacles: { type: Array, required: false, default: () => [], @@ -29,7 +29,7 @@ export default { :username="username" :paths="paths" :delete-path="paths.delete" - :oncall-schedules="oncallSchedules" + :user-deletion-obstacles="userDeletionObstacles" > <slot></slot> </shared-delete-action> diff --git a/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue b/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue index 02fd3efafa1..bd920a91516 100644 --- a/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue +++ b/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue @@ -14,7 +14,7 @@ export default { type: Object, required: true, }, - oncallSchedules: { + userDeletionObstacles: { type: Array, required: false, default: () => [], @@ -29,7 +29,7 @@ export default { :username="username" :paths="paths" :delete-path="paths.deleteWithContributions" - :oncall-schedules="oncallSchedules" + :user-deletion-obstacles="userDeletionObstacles" > <slot></slot> </shared-delete-action> diff --git a/app/assets/javascripts/admin/users/components/actions/shared/shared_delete_action.vue b/app/assets/javascripts/admin/users/components/actions/shared/shared_delete_action.vue index a1589c9d46d..c9f29b55dbf 100644 --- a/app/assets/javascripts/admin/users/components/actions/shared/shared_delete_action.vue +++ b/app/assets/javascripts/admin/users/components/actions/shared/shared_delete_action.vue @@ -22,7 +22,7 @@ export default { type: String, required: true, }, - oncallSchedules: { + userDeletionObstacles: { type: Array, required: true, }, @@ -34,7 +34,7 @@ export default { 'data-delete-user-url': this.deletePath, 'data-gl-modal-action': this.modalType, 'data-username': this.username, - 'data-oncall-schedules': JSON.stringify(this.oncallSchedules), + 'data-user-deletion-obstacles': JSON.stringify(this.userDeletionObstacles), }; }, }, diff --git a/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue b/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue index 413163c8536..ed90343777d 100644 --- a/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue +++ b/app/assets/javascripts/admin/users/components/modals/delete_user_modal.vue @@ -2,7 +2,7 @@ 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'; +import UserDeletionObstaclesList from '~/vue_shared/components/user_deletion_obstacles/user_deletion_obstacles_list.vue'; export default { components: { @@ -10,7 +10,7 @@ export default { GlButton, GlFormInput, GlSprintf, - OncallSchedulesList, + UserDeletionObstaclesList, }, props: { title: { @@ -45,7 +45,7 @@ export default { type: String, required: true, }, - oncallSchedules: { + userDeletionObstacles: { type: String, required: false, default: '[]', @@ -66,9 +66,9 @@ export default { canSubmit() { return this.enteredUsername === this.username; }, - schedules() { + obstacles() { try { - return JSON.parse(this.oncallSchedules); + return JSON.parse(this.userDeletionObstacles); } catch (e) { Sentry.captureException(e); } @@ -112,12 +112,16 @@ export default { </gl-sprintf> </p> - <oncall-schedules-list v-if="schedules.length" :schedules="schedules" :user-name="username" /> + <user-deletion-obstacles-list + v-if="obstacles.length" + :obstacles="obstacles" + :user-name="username" + /> <p> <gl-sprintf :message="s__('AdminUsers|To confirm, type %{username}')"> <template #username> - <code>{{ username }}</code> + <code class="gl-white-space-pre-wrap">{{ username }}</code> </template> </gl-sprintf> </p> diff --git a/app/assets/javascripts/admin/users/components/user_actions.vue b/app/assets/javascripts/admin/users/components/user_actions.vue index c076e0bedf0..4f4e2947341 100644 --- a/app/assets/javascripts/admin/users/components/user_actions.vue +++ b/app/assets/javascripts/admin/users/components/user_actions.vue @@ -9,6 +9,7 @@ import { } from '@gitlab/ui'; import { convertArrayToCamelCase } from '~/lib/utils/common_utils'; import { capitalizeFirstCharacter } from '~/lib/utils/text_utility'; +import { parseUserDeletionObstacles } from '~/vue_shared/components/user_deletion_obstacles/utils'; import { I18N_USER_ACTIONS } from '../constants'; import { generateUserPaths } from '../utils'; import Actions from './actions'; @@ -72,6 +73,9 @@ export default { href: this.userPaths.edit, }; }, + obstaclesForUserDeletion() { + return parseUserDeletionObstacles(this.user); + }, }, methods: { isLdapAction(action) { @@ -141,7 +145,7 @@ export default { :key="action" :paths="userPaths" :username="user.name" - :oncall-schedules="user.oncallSchedules" + :user-deletion-obstacles="obstaclesForUserDeletion" :data-testid="`delete-${action}`" > {{ $options.i18n[action] }} |