Commit d13218f7 authored by David O'Regan's avatar David O'Regan

Merge branch '283874-followup-to-mr-47253' into 'master'

Update error message to be more actionable in BoardSidebarSubscription and import getters without remapping names

See merge request gitlab-org/gitlab!50352
parents 053a7423 e80901e9
......@@ -18,16 +18,16 @@ export default {
};
},
computed: {
...mapGetters({ issue: 'activeIssue', projectPathForActiveIssue: 'projectPathForActiveIssue' }),
...mapGetters(['activeIssue', 'projectPathForActiveIssue']),
hasDueDate() {
return this.issue.dueDate != null;
return this.activeIssue.dueDate != null;
},
parsedDueDate() {
if (!this.hasDueDate) {
return null;
}
return parsePikadayDate(this.issue.dueDate);
return parsePikadayDate(this.activeIssue.dueDate);
},
formattedDueDate() {
if (!this.hasDueDate) {
......
......@@ -58,20 +58,20 @@ export default {
},
},
computed: {
...mapGetters({ issue: 'activeIssue' }),
...mapGetters(['activeIssue']),
hasMilestone() {
return this.issue.milestone !== null;
return this.activeIssue.milestone !== null;
},
groupFullPath() {
const { referencePath = '' } = this.issue;
const { referencePath = '' } = this.activeIssue;
return referencePath.slice(0, referencePath.indexOf('/'));
},
projectPath() {
const { referencePath = '' } = this.issue;
const { referencePath = '' } = this.activeIssue;
return referencePath.slice(0, referencePath.indexOf('#'));
},
dropdownText() {
return this.issue.milestone?.title ?? this.$options.i18n.noMilestone;
return this.activeIssue.milestone?.title ?? this.$options.i18n.noMilestone;
},
},
mounted() {
......@@ -120,7 +120,7 @@ export default {
@close="edit = false"
>
<template v-if="hasMilestone" #collapsed>
<strong class="gl-text-gray-900">{{ issue.milestone.title }}</strong>
<strong class="gl-text-gray-900">{{ activeIssue.milestone.title }}</strong>
</template>
<template>
<gl-dropdown
......@@ -133,7 +133,7 @@ export default {
<gl-dropdown-item
data-testid="no-milestone-item"
:is-check-item="true"
:is-checked="!issue.milestone"
:is-checked="!activeIssue.milestone"
@click="setMilestone(null)"
>
{{ $options.i18n.noMilestone }}
......@@ -145,7 +145,7 @@ export default {
v-for="milestone in milestones"
:key="milestone.id"
:is-check-item="true"
:is-checked="issue.milestone && milestone.id === issue.milestone.id"
:is-checked="activeIssue.milestone && milestone.id === activeIssue.milestone.id"
data-testid="milestone-item"
@click="setMilestone(milestone.id)"
>
......
......@@ -15,7 +15,7 @@ export default {
),
},
updateSubscribedErrorMessage: s__(
'IssueBoards|An error occurred while setting notifications status.',
'IssueBoards|An error occurred while setting notifications status. Please try again.',
),
},
components: {
......
---
title: Update error message used in boards sidebar subscription
merge_request: 50352
author:
type: other
......@@ -23,13 +23,13 @@ export default {
};
},
computed: {
...mapGetters({ issue: 'activeIssue', projectPathForActiveIssue: 'projectPathForActiveIssue' }),
...mapGetters(['activeIssue', 'projectPathForActiveIssue']),
hasWeight() {
return this.issue.weight > 0;
return this.activeIssue.weight > 0;
},
},
watch: {
issue: {
activeIssue: {
handler(updatedIssue) {
this.weight = updatedIssue.weight;
},
......@@ -45,7 +45,7 @@ export default {
async setWeight(provided) {
const weight = provided ?? this.weight;
if (this.loading || weight === this.issue.weight) {
if (this.loading || weight === this.activeIssue.weight) {
return;
}
......@@ -55,7 +55,7 @@ export default {
await this.setActiveIssueWeight({ weight, projectPath: this.projectPathForActiveIssue });
this.weight = weight;
} catch (e) {
this.weight = this.issue.weight;
this.weight = this.activeIssue.weight;
createFlash({ message: __('An error occurred when updating the issue weight') });
} finally {
this.loading = false;
......@@ -74,7 +74,7 @@ export default {
>
<template v-if="hasWeight" #collapsed>
<div class="gl-display-flex gl-align-items-center">
<strong class="gl-text-gray-900">{{ issue.weight }}</strong>
<strong class="gl-text-gray-900">{{ activeIssue.weight }}</strong>
<span class="gl-mx-2">-</span>
<gl-button
variant="link"
......
......@@ -15576,7 +15576,7 @@ msgstr ""
msgid "IssueAnalytics|Weight"
msgstr ""
msgid "IssueBoards|An error occurred while setting notifications status."
msgid "IssueBoards|An error occurred while setting notifications status. Please try again."
msgstr ""
msgid "IssueBoards|Board"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment