FIX: Do not show empty list in the topic admin menu (#26825)

This commit is contained in:
Jan Cernik 2024-04-30 12:31:39 -05:00 committed by GitHub
parent f4acb43ee7
commit ddf7bbfa97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 31 additions and 26 deletions

View File

@ -294,33 +294,38 @@ export default class TopicAdminMenu extends Component {
{{/if}}
</ul>
<ul class="topic-admin-menu-undefined">
{{#if this.currentUser.staff}}
<li class="topic-admin-moderation-history">
<DButton
class="btn-transparent"
@label="review.moderation_history"
@href={{this.topicModerationHistoryUrl}}
@icon="list"
/>
</li>
{{/if}}
{{#if (or this.currentUser.staff this.extraButtons.length)}}
<ul class="topic-admin-menu-undefined">
{{#if this.currentUser.staff}}
<li class="topic-admin-moderation-history">
<DButton
class="btn-transparent"
@label="review.moderation_history"
@href={{this.topicModerationHistoryUrl}}
@icon="list"
/>
</li>
{{/if}}
{{#each this.extraButtons as |button|}}
<li>
<DButton
@label={{button.label}}
@translatedLabel={{button.translatedLabel}}
@icon={{button.icon}}
class={{concatClass
"btn-transparent"
button.className
}}
@action={{fn this.onExtraButtonAction button.action}}
/>
</li>
{{/each}}
</ul>
{{#each this.extraButtons as |button|}}
<li>
<DButton
@label={{button.label}}
@translatedLabel={{button.translatedLabel}}
@icon={{button.icon}}
class={{concatClass
"btn-transparent"
button.className
}}
@action={{fn
this.onExtraButtonAction
button.action
}}
/>
</li>
{{/each}}
</ul>
{{/if}}
</ul>
</div>
</:content>