Skip to content
Snippets Groups Projects
Verified Commit 29a01246 authored by Lorenz van Herwaarden's avatar Lorenz van Herwaarden :two: Committed by GitLab
Browse files

Merge branch '507873-show-toast-when-work-item-confidentiality-is-changed' into 'master'

Add toast when work item confidentiality is toggled

See merge request gitlab-org/gitlab!174771



Merged-by: Lorenz van Herwaarden's avatarLorenz van Herwaarden <lvanherwaarden@gitlab.com>
Approved-by: Nick Leonard's avatarNick Leonard <nleonard@gitlab.com>
Approved-by: Lorenz van Herwaarden's avatarLorenz van Herwaarden <lvanherwaarden@gitlab.com>
Co-authored-by: default avatarChad Lavimoniere <clavimoniere@gitlab.com>
parents fa6d6b8e 1818249b
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,8 @@ export default {
i18n: {
enableConfidentiality: s__('WorkItem|Turn on confidentiality'),
disableConfidentiality: s__('WorkItem|Turn off confidentiality'),
confidentialityEnabled: s__('WorkItem|Confidentiality turned on.'),
confidentialityDisabled: s__('WorkItem|Confidentiality turned off.'),
confidentialParentTooltip: s__(
'WorkItem|Child items of a confidential parent must be confidential. Turn off confidentiality on the parent item first.',
),
......@@ -280,6 +282,11 @@ export default {
isEpic() {
return this.workItemType === WORK_ITEM_TYPE_VALUE_EPIC;
},
confidentialityToggledText() {
return this.isConfidential
? this.$options.i18n.confidentialityDisabled
: this.$options.i18n.confidentialityEnabled;
},
},
methods: {
copyToClipboard(text, message) {
......@@ -292,6 +299,7 @@ export default {
handleToggleWorkItemConfidentiality() {
this.track('click_toggle_work_item_confidentiality');
this.$emit('toggleWorkItemConfidentiality', !this.isConfidential);
toast(this.confidentialityToggledText);
this.closeDropdown();
},
handleDelete() {
......
......@@ -62814,6 +62814,12 @@ msgstr ""
msgid "WorkItem|Comments only"
msgstr ""
 
msgid "WorkItem|Confidentiality turned off."
msgstr ""
msgid "WorkItem|Confidentiality turned on."
msgstr ""
msgid "WorkItem|Configure work items such as epics, issues, and tasks to represent how your team works."
msgstr ""
 
......@@ -324,6 +324,7 @@ describe('WorkItemActions component', () => {
findConfidentialityToggleButton().vm.$emit('action');
expect(wrapper.emitted('toggleWorkItemConfidentiality')[0]).toEqual([true]);
expect(toast).toHaveBeenCalledWith('Confidentiality turned on.');
});
it('does not render when canUpdate is false', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment