Commit e80901e9 authored by Eulyeon Ko's avatar Eulyeon Ko Committed by David O'Regan

Change names of mapped actions to be consistent

Uniformly use `activeIssue` rather than remapping it to `issue`
throughout swimlane sidebar components.
parent 6e5132d3
...@@ -18,16 +18,16 @@ export default { ...@@ -18,16 +18,16 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters({ issue: 'activeIssue', projectPathForActiveIssue: 'projectPathForActiveIssue' }), ...mapGetters(['activeIssue', 'projectPathForActiveIssue']),
hasDueDate() { hasDueDate() {
return this.issue.dueDate != null; return this.activeIssue.dueDate != null;
}, },
parsedDueDate() { parsedDueDate() {
if (!this.hasDueDate) { if (!this.hasDueDate) {
return null; return null;
} }
return parsePikadayDate(this.issue.dueDate); return parsePikadayDate(this.activeIssue.dueDate);
}, },
formattedDueDate() { formattedDueDate() {
if (!this.hasDueDate) { if (!this.hasDueDate) {
......
...@@ -58,20 +58,20 @@ export default { ...@@ -58,20 +58,20 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters({ issue: 'activeIssue' }), ...mapGetters(['activeIssue']),
hasMilestone() { hasMilestone() {
return this.issue.milestone !== null; return this.activeIssue.milestone !== null;
}, },
groupFullPath() { groupFullPath() {
const { referencePath = '' } = this.issue; const { referencePath = '' } = this.activeIssue;
return referencePath.slice(0, referencePath.indexOf('/')); return referencePath.slice(0, referencePath.indexOf('/'));
}, },
projectPath() { projectPath() {
const { referencePath = '' } = this.issue; const { referencePath = '' } = this.activeIssue;
return referencePath.slice(0, referencePath.indexOf('#')); return referencePath.slice(0, referencePath.indexOf('#'));
}, },
dropdownText() { dropdownText() {
return this.issue.milestone?.title ?? this.$options.i18n.noMilestone; return this.activeIssue.milestone?.title ?? this.$options.i18n.noMilestone;
}, },
}, },
mounted() { mounted() {
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
@close="edit = false" @close="edit = false"
> >
<template v-if="hasMilestone" #collapsed> <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>
<template> <template>
<gl-dropdown <gl-dropdown
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
<gl-dropdown-item <gl-dropdown-item
data-testid="no-milestone-item" data-testid="no-milestone-item"
:is-check-item="true" :is-check-item="true"
:is-checked="!issue.milestone" :is-checked="!activeIssue.milestone"
@click="setMilestone(null)" @click="setMilestone(null)"
> >
{{ $options.i18n.noMilestone }} {{ $options.i18n.noMilestone }}
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
v-for="milestone in milestones" v-for="milestone in milestones"
:key="milestone.id" :key="milestone.id"
:is-check-item="true" :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" data-testid="milestone-item"
@click="setMilestone(milestone.id)" @click="setMilestone(milestone.id)"
> >
......
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
), ),
}, },
updateSubscribedErrorMessage: s__( updateSubscribedErrorMessage: s__(
'IssueBoards|An error occurred while setting notifications status.', 'IssueBoards|An error occurred while setting notifications status. Please try again.',
), ),
}, },
components: { components: {
......
---
title: Update error message used in boards sidebar subscription
merge_request: 50352
author:
type: other
...@@ -23,13 +23,13 @@ export default { ...@@ -23,13 +23,13 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters({ issue: 'activeIssue', projectPathForActiveIssue: 'projectPathForActiveIssue' }), ...mapGetters(['activeIssue', 'projectPathForActiveIssue']),
hasWeight() { hasWeight() {
return this.issue.weight > 0; return this.activeIssue.weight > 0;
}, },
}, },
watch: { watch: {
issue: { activeIssue: {
handler(updatedIssue) { handler(updatedIssue) {
this.weight = updatedIssue.weight; this.weight = updatedIssue.weight;
}, },
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
async setWeight(provided) { async setWeight(provided) {
const weight = provided ?? this.weight; const weight = provided ?? this.weight;
if (this.loading || weight === this.issue.weight) { if (this.loading || weight === this.activeIssue.weight) {
return; return;
} }
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
await this.setActiveIssueWeight({ weight, projectPath: this.projectPathForActiveIssue }); await this.setActiveIssueWeight({ weight, projectPath: this.projectPathForActiveIssue });
this.weight = weight; this.weight = weight;
} catch (e) { } catch (e) {
this.weight = this.issue.weight; this.weight = this.activeIssue.weight;
createFlash({ message: __('An error occurred when updating the issue weight') }); createFlash({ message: __('An error occurred when updating the issue weight') });
} finally { } finally {
this.loading = false; this.loading = false;
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
> >
<template v-if="hasWeight" #collapsed> <template v-if="hasWeight" #collapsed>
<div class="gl-display-flex gl-align-items-center"> <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> <span class="gl-mx-2">-</span>
<gl-button <gl-button
variant="link" variant="link"
......
...@@ -15570,7 +15570,7 @@ msgstr "" ...@@ -15570,7 +15570,7 @@ msgstr ""
msgid "IssueAnalytics|Weight" msgid "IssueAnalytics|Weight"
msgstr "" msgstr ""
msgid "IssueBoards|An error occurred while setting notifications status." msgid "IssueBoards|An error occurred while setting notifications status. Please try again."
msgstr "" msgstr ""
msgid "IssueBoards|Board" 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