From 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Nov 2021 13:16:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-5-stable-ee --- .../javascripts/incidents/components/incidents_list.vue | 11 +++++++++-- app/assets/javascripts/incidents/constants.js | 5 ++++- app/assets/javascripts/incidents/list.js | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts/incidents') diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue index 4d34daa43ba..37597da3c8e 100644 --- a/app/assets/javascripts/incidents/components/incidents_list.vue +++ b/app/assets/javascripts/incidents/components/incidents_list.vue @@ -125,6 +125,7 @@ export default { 'authorUsernameQuery', 'assigneeUsernameQuery', 'slaFeatureAvailable', + 'canCreateIncident', ], apollo: { incidents: { @@ -230,13 +231,16 @@ export default { }, emptyStateData() { const { - emptyState: { title, emptyClosedTabTitle, description }, + emptyState: { title, emptyClosedTabTitle, description, cannotCreateIncidentDescription }, createIncidentBtnLabel, } = this.$options.i18n; if (this.activeClosedTabHasNoIncidents) { return { title: emptyClosedTabTitle }; } + if (!this.canCreateIncident) { + return { title, description: cannotCreateIncidentDescription }; + } return { title, description, @@ -244,6 +248,9 @@ export default { btnText: createIncidentBtnLabel, }; }, + isHeaderButtonVisible() { + return this.canCreateIncident && (!this.isEmpty || this.activeClosedTabHasNoIncidents); + }, }, methods: { hasAssignees(assignees) { @@ -311,7 +318,7 @@ export default { >