diff options
Diffstat (limited to 'app/assets/javascripts/work_items/components/work_item_actions.vue')
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_actions.vue | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/app/assets/javascripts/work_items/components/work_item_actions.vue b/app/assets/javascripts/work_items/components/work_item_actions.vue index 2753c3fa388..9f9d94ec3c2 100644 --- a/app/assets/javascripts/work_items/components/work_item_actions.vue +++ b/app/assets/javascripts/work_items/components/work_item_actions.vue @@ -8,10 +8,14 @@ import { } from '@gitlab/ui'; import { s__ } from '~/locale'; import Tracking from '~/tracking'; +import { + sprintfWorkItem, + I18N_WORK_ITEM_DELETE, + I18N_WORK_ITEM_ARE_YOU_SURE_DELETE, +} from '../constants'; export default { i18n: { - deleteTask: s__('WorkItem|Delete task'), enableTaskConfidentiality: s__('WorkItem|Turn on confidentiality'), disableTaskConfidentiality: s__('WorkItem|Turn off confidentiality'), }, @@ -31,6 +35,11 @@ export default { required: false, default: null, }, + workItemType: { + type: String, + required: false, + default: null, + }, canUpdate: { type: Boolean, required: false, @@ -53,6 +62,14 @@ export default { }, }, emits: ['deleteWorkItem', 'toggleWorkItemConfidentiality'], + computed: { + i18n() { + return { + deleteWorkItem: sprintfWorkItem(I18N_WORK_ITEM_DELETE, this.workItemType), + areYouSureDelete: sprintfWorkItem(I18N_WORK_ITEM_ARE_YOU_SURE_DELETE, this.workItemType), + }; + }, + }, methods: { handleToggleWorkItemConfidentiality() { this.track('click_toggle_work_item_confidentiality'); @@ -75,6 +92,7 @@ export default { <div> <gl-dropdown icon="ellipsis_v" + data-testid="work-item-actions-dropdown" text-sr-only :text="__('More actions')" category="tertiary" @@ -97,20 +115,18 @@ export default { v-if="canDelete" v-gl-modal="'work-item-confirm-delete'" data-testid="delete-action" - >{{ $options.i18n.deleteTask }}</gl-dropdown-item + >{{ i18n.deleteWorkItem }}</gl-dropdown-item > </gl-dropdown> <gl-modal modal-id="work-item-confirm-delete" - :title="$options.i18n.deleteWorkItem" - :ok-title="$options.i18n.deleteWorkItem" + :title="i18n.deleteWorkItem" + :ok-title="i18n.deleteWorkItem" ok-variant="danger" @ok="handleDeleteWorkItem" @hide="handleCancelDeleteWorkItem" > - {{ - s__('WorkItem|Are you sure you want to delete the task? This action cannot be reversed.') - }} + {{ i18n.areYouSureDelete }} </gl-modal> </div> </template> |