diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-27 12:08:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-27 12:08:34 +0300 |
commit | d0a683e342c9e59bec8bb83879f0fc959b79224e (patch) | |
tree | fac5bd8be0faee2016b6ad67c25206ccf42c3447 /app/assets/javascripts/work_items | |
parent | 0ab741639e9d9a83833661925167a98d96751135 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/work_items')
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue | 14 | ||||
-rw-r--r-- | app/assets/javascripts/work_items/graphql/work_item_links.query.graphql | 3 |
2 files changed, 15 insertions, 2 deletions
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 89f086cfca5..e65f0cfb1f2 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 @@ -43,6 +43,7 @@ export default { }; }, update(data) { + this.canUpdate = data.workItem.userPermissions.updateWorkItem; return ( data.workItem.widgets.find((widget) => widget.type === WIDGET_TYPE_HIERARCHY)?.children .nodes ?? [] @@ -51,6 +52,9 @@ export default { skip() { return !this.issuableId; }, + result({ data }) { + this.canUpdate = data.workItem.userPermissions.updateWorkItem; + }, }, }, data() { @@ -58,6 +62,7 @@ export default { isShownAddForm: false, isOpen: true, children: [], + canUpdate: false, }; }, computed: { @@ -117,7 +122,7 @@ export default { > <h5 class="gl-m-0 gl-line-height-32 gl-flex-grow-1">{{ $options.i18n.title }}</h5> <gl-button - v-if="!isShownAddForm" + v-if="!isShownAddForm && canUpdate" category="secondary" data-testid="toggle-add-form" @click="toggleAddForm" @@ -173,7 +178,12 @@ export default { $options.WORK_ITEM_STATUS_TEXT[child.state] }}</span> </gl-badge> - <work-item-links-menu :work-item-id="child.id" :parent-work-item-id="issuableGid" /> + <work-item-links-menu + v-if="canUpdate" + :work-item-id="child.id" + :parent-work-item-id="issuableGid" + data-testid="links-menu" + /> </div> </div> </template> diff --git a/app/assets/javascripts/work_items/graphql/work_item_links.query.graphql b/app/assets/javascripts/work_items/graphql/work_item_links.query.graphql index c2496f53cc8..921f75ccb0a 100644 --- a/app/assets/javascripts/work_items/graphql/work_item_links.query.graphql +++ b/app/assets/javascripts/work_items/graphql/work_item_links.query.graphql @@ -5,6 +5,9 @@ query workItemQuery($id: WorkItemID!) { id } title + userPermissions { + updateWorkItem + } widgets { type ... on WorkItemWidgetHierarchy { |