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}} {{/if}}
</ul> </ul>
<ul class="topic-admin-menu-undefined"> {{#if (or this.currentUser.staff this.extraButtons.length)}}
{{#if this.currentUser.staff}} <ul class="topic-admin-menu-undefined">
<li class="topic-admin-moderation-history"> {{#if this.currentUser.staff}}
<DButton <li class="topic-admin-moderation-history">
class="btn-transparent" <DButton
@label="review.moderation_history" class="btn-transparent"
@href={{this.topicModerationHistoryUrl}} @label="review.moderation_history"
@icon="list" @href={{this.topicModerationHistoryUrl}}
/> @icon="list"
</li> />
{{/if}} </li>
{{/if}}
{{#each this.extraButtons as |button|}} {{#each this.extraButtons as |button|}}
<li> <li>
<DButton <DButton
@label={{button.label}} @label={{button.label}}
@translatedLabel={{button.translatedLabel}} @translatedLabel={{button.translatedLabel}}
@icon={{button.icon}} @icon={{button.icon}}
class={{concatClass class={{concatClass
"btn-transparent" "btn-transparent"
button.className button.className
}} }}
@action={{fn this.onExtraButtonAction button.action}} @action={{fn
/> this.onExtraButtonAction
</li> button.action
{{/each}} }}
</ul> />
</li>
{{/each}}
</ul>
{{/if}}
</ul> </ul>
</div> </div>
</:content> </:content>