Commit 019bf2e7 authored by Jake Lear's avatar Jake Lear

Add iteration link to issue sidebar

parent 1c8ff093
......@@ -90,10 +90,13 @@ export default {
};
},
computed: {
iteration() {
iterationTitle() {
// NOTE: Optional chaining guards when search result is empty
return this.iterations.find(({ id }) => id === this.currentIteration)?.title;
},
iterationUrl() {
return this.iterations.find(({ id }) => id === this.currentIteration)?.webUrl;
},
showNoIterationContent() {
return !this.editing && !this.currentIteration;
},
......@@ -159,7 +162,7 @@ export default {
<div>
<div v-gl-tooltip class="sidebar-collapsed-icon">
<gl-icon :size="16" :aria-label="$options.iterationText" name="iteration" />
<span class="collapse-truncated-title">{{ iteration }}</span>
<span class="collapse-truncated-title">{{ iterationTitle }}</span>
</div>
<div class="title hide-collapsed mt-3">
{{ $options.iterationText }}
......@@ -177,8 +180,8 @@ export default {
</div>
<div data-testid="select-iteration" class="hide-collapsed">
<span v-if="showNoIterationContent" class="no-value">{{ $options.noIteration }}</span>
<gl-link v-else-if="!editing" href
><strong>{{ iteration }}</strong></gl-link
<gl-link v-else-if="!editing" :href="iterationUrl"
><strong>{{ iterationTitle }}</strong></gl-link
>
</div>
<gl-new-dropdown
......
......@@ -5,6 +5,7 @@ query groupIterations($fullPath: ID!, $title: String) {
id
title
state
webUrl
}
}
}
......
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