UX: shows editing title only on settings page (#24330)
This commit is contained in:
parent
2b4251c56c
commit
b1cff6de6a
|
@ -66,7 +66,21 @@ export default class ChatAboutScreen extends Component {
|
|||
);
|
||||
|
||||
get canEditChannel() {
|
||||
return this.chatGuardian.canEditChatChannel();
|
||||
if (
|
||||
this.args.channel.isCategoryChannel &&
|
||||
this.chatGuardian.canEditChatChannel()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
this.args.channel.isDirectMessageChannel &&
|
||||
this.args.channel.chatable.group
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
get shouldRenderDescriptionSection() {
|
||||
|
|
|
@ -13,7 +13,6 @@ import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-
|
|||
import ChatChannelTitle from "discourse/plugins/chat/discourse/components/chat-channel-title";
|
||||
|
||||
export default class ChatFullPageHeader extends Component {
|
||||
@service chatGuardian;
|
||||
@service chatStateManager;
|
||||
@service modal;
|
||||
@service router;
|
||||
|
@ -32,24 +31,6 @@ export default class ChatFullPageHeader extends Component {
|
|||
);
|
||||
}
|
||||
|
||||
get canEditChannel() {
|
||||
if (
|
||||
this.args.channel.isCategoryChannel &&
|
||||
this.chatGuardian.canEditChatChannel()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
this.args.channel.isDirectMessageChannel &&
|
||||
this.args.channel.chatable.group
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@action
|
||||
editChannelTitle() {
|
||||
return this.modal.show(ChatModalEditChannelName, {
|
||||
|
@ -85,14 +66,6 @@ export default class ChatFullPageHeader extends Component {
|
|||
<ChatChannelTitle @channel={{@channel}} />
|
||||
</LinkTo>
|
||||
|
||||
{{#if this.canEditChannel}}
|
||||
<DButton
|
||||
@icon="pencil-alt"
|
||||
class="btn-flat"
|
||||
@action={{this.editChannelTitle}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
{{#if (or @channel.threadingEnabled this.site.desktopView)}}
|
||||
<div class="chat-full-page-header__right-actions">
|
||||
{{#if this.site.desktopView}}
|
||||
|
|
Loading…
Reference in New Issue