Skip to content

A platform for community discussion. Free, open, simple.

UX: shows editing title only on settings page (#24330)

Joffrey JAFFEUXb1cff6de6a4f
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings.gjs
index c7af8b917fe..e102defdc54 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings.gjs
@@ -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() {
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-full-page-header.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-full-page-header.gjs
index c502c71c055..9e7180c643f 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-full-page-header.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-full-page-header.gjs
@@ -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}}