FIX: renders channels-list wrapper only once (#25383)

This bug was causing broken layout when using the `header_dropdown` setting instead of `sidebar` as we were rendering `<div class="channels-list"></div>` two times.
This commit is contained in:
Joffrey JAFFEUX 2024-01-23 11:33:45 +01:00 committed by GitHub
parent 9d3800adec
commit eff485e4c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 137 additions and 147 deletions

View File

@ -59,12 +59,6 @@ export default class ChannelsListDirect extends Component {
} }
<template> <template>
<div
role="region"
aria-label={{i18n "chat.aria_roles.channels_list"}}
class="channels-list"
>
<PluginOutlet <PluginOutlet
@name="below-direct-chat-channels" @name="below-direct-chat-channels"
@tagName="" @tagName=""
@ -128,6 +122,5 @@ export default class ChannelsListDirect extends Component {
{{/each}} {{/each}}
{{/if}} {{/if}}
</div> </div>
</div>
</template> </template>
} }

View File

@ -51,12 +51,6 @@ export default class ChannelsListPublic extends Component {
} }
<template> <template>
<div
role="region"
aria-label={{i18n "chat.aria_roles.channels_list"}}
class="channels-list"
>
{{#if this.site.desktopView}} {{#if this.site.desktopView}}
<LinkTo @route="chat.threads" class="chat-channel-row --threads"> <LinkTo @route="chat.threads" class="chat-channel-row --threads">
<span class="chat-channel-title"> <span class="chat-channel-title">
@ -117,10 +111,7 @@ export default class ChannelsListPublic extends Component {
</LinkTo> </LinkTo>
</div> </div>
{{else}} {{else}}
{{#each {{#each this.chatChannelsManager.publicMessageChannels as |channel|}}
this.chatChannelsManager.publicMessageChannels
as |channel|
}}
<ChatChannelRow <ChatChannelRow
@channel={{channel}} @channel={{channel}}
@options={{hash settingsButton=true}} @options={{hash settingsButton=true}}
@ -136,6 +127,5 @@ export default class ChannelsListPublic extends Component {
@tagName="" @tagName=""
@outletArgs={{hash inSidebar=this.inSidebar}} @outletArgs={{hash inSidebar=this.inSidebar}}
/> />
</div>
</template> </template>
} }

View File

@ -1,5 +1,6 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { inject as service } from "@ember/service"; import { inject as service } from "@ember/service";
import i18n from "discourse-common/helpers/i18n";
import ChannelsListDirect from "discourse/plugins/chat/discourse/components/channels-list-direct"; import ChannelsListDirect from "discourse/plugins/chat/discourse/components/channels-list-direct";
import ChannelsListPublic from "discourse/plugins/chat/discourse/components/channels-list-public"; import ChannelsListPublic from "discourse/plugins/chat/discourse/components/channels-list-public";
@ -7,10 +8,16 @@ export default class ChannelsList extends Component {
@service chat; @service chat;
<template> <template>
<div
role="region"
aria-label={{i18n "chat.aria_roles.channels_list"}}
class="channels-list"
>
<ChannelsListPublic /> <ChannelsListPublic />
{{#if this.chat.userCanAccessDirectMessages}} {{#if this.chat.userCanAccessDirectMessages}}
<ChannelsListDirect /> <ChannelsListDirect />
{{/if}} {{/if}}
</div>
</template> </template>
} }