diff --git a/app/assets/javascripts/work_items/components/shared/work_item_link_child_contents.vue b/app/assets/javascripts/work_items/components/shared/work_item_link_child_contents.vue index dd4461a280e..cbe7de4abcd 100644 --- a/app/assets/javascripts/work_items/components/shared/work_item_link_child_contents.vue +++ b/app/assets/javascripts/work_items/components/shared/work_item_link_child_contents.vue @@ -52,6 +52,11 @@ export default { required: false, default: false, }, + showLabels: { + type: Boolean, + required: false, + default: true, + }, }, data() { return { @@ -114,6 +119,9 @@ export default { showRemove() { return this.canUpdate && this.isFocused; }, + displayLabels() { + return this.showLabels && this.labels.length; + }, }, methods: { showScopedLabel(label) { @@ -180,7 +188,7 @@ export default { class="gl-ml-6 ml-xl-0" /> -
+
@@ -241,6 +247,7 @@ export default { :work-item-id="issuableGid" :work-item-type="workItemType" :children="children" + :show-labels="showLabels" @removeChild="removeChild" @click="$emit('click', $event)" /> diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue index 2ec3f8355f5..dd0a26c0b9c 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue @@ -5,6 +5,7 @@ import { GlIcon, GlLoadingIcon, GlTooltipDirective, + GlToggle, } from '@gitlab/ui'; import { isEmpty } from 'lodash'; import { s__ } from '~/locale'; @@ -15,7 +16,12 @@ import { isMetaKey } from '~/lib/utils/common_utils'; import { getParameterByName, setUrlParams, updateHistory } from '~/lib/utils/url_utility'; import AbuseCategorySelector from '~/abuse_reports/components/abuse_category_selector.vue'; -import { FORM_TYPES, WIDGET_ICONS, WORK_ITEM_STATUS_TEXT } from '../../constants'; +import { + FORM_TYPES, + WIDGET_ICONS, + WORK_ITEM_STATUS_TEXT, + I18N_WORK_ITEM_SHOW_LABELS, +} from '../../constants'; import { findHierarchyWidgetChildren } from '../../utils'; import { removeHierarchyChild } from '../../graphql/cache_utils'; import groupWorkItemByIidQuery from '../../graphql/group_work_item_by_iid.query.graphql'; @@ -36,6 +42,7 @@ export default { WorkItemDetailModal, AbuseCategorySelector, WorkItemChildrenWrapper, + GlToggle, }, directives: { GlTooltip: GlTooltipDirective, @@ -104,6 +111,7 @@ export default { reportedUserId: 0, reportedUrl: '', widgetName: 'tasks', + showLabels: true, }; }, computed: { @@ -201,6 +209,7 @@ export default { addChildButtonLabel: s__('WorkItem|Add'), addChildOptionLabel: s__('WorkItem|Existing task'), createChildOptionLabel: s__('WorkItem|New task'), + showLabelsLabel: I18N_WORK_ITEM_SHOW_LABELS, }, WIDGET_TYPE_TASK_ICON: WIDGET_ICONS.TASK, WORK_ITEM_STATUS_TEXT, @@ -224,6 +233,14 @@ export default {