Commit 6d1e7cc5 authored by Justin Ho's avatar Justin Ho

Update labels dropdown to hide footer

We should only show the footer when either one of the
values `allowLabelCreate` or `labelsManagePath` is
present. If not (which is the case for Jira issue labels),
we should just hide this whole section.
parent d2819ea4
...@@ -48,6 +48,12 @@ export default { ...@@ -48,6 +48,12 @@ export default {
} }
return this.labels; return this.labels;
}, },
showDropdownFooter() {
return (
(this.isDropdownVariantSidebar || this.isDropdownVariantEmbedded) &&
(this.allowLabelCreate || this.labelsManagePath)
);
},
showNoMatchingResultsMessage() { showNoMatchingResultsMessage() {
return Boolean(this.searchKey) && this.visibleLabels.length === 0; return Boolean(this.searchKey) && this.visibleLabels.length === 0;
}, },
...@@ -192,11 +198,7 @@ export default { ...@@ -192,11 +198,7 @@ export default {
</li> </li>
</ul> </ul>
</div> </div>
<div <div v-if="showDropdownFooter" class="dropdown-footer" data-testid="dropdown-footer">
v-if="isDropdownVariantSidebar || isDropdownVariantEmbedded"
class="dropdown-footer"
data-testid="dropdown-footer"
>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li v-if="allowLabelCreate"> <li v-if="allowLabelCreate">
<gl-link <gl-link
...@@ -206,7 +208,7 @@ export default { ...@@ -206,7 +208,7 @@ export default {
{{ footerCreateLabelTitle }} {{ footerCreateLabelTitle }}
</gl-link> </gl-link>
</li> </li>
<li> <li v-if="labelsManagePath">
<gl-link <gl-link
:href="labelsManagePath" :href="labelsManagePath"
class="gl-display-flex flex-row text-break-word label-item" class="gl-display-flex flex-row text-break-word label-item"
......
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