mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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() {
|
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() {
|
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";
|
import ChatChannelTitle from "discourse/plugins/chat/discourse/components/chat-channel-title";
|
||||||
|
|
||||||
export default class ChatFullPageHeader extends Component {
|
export default class ChatFullPageHeader extends Component {
|
||||||
@service chatGuardian;
|
|
||||||
@service chatStateManager;
|
@service chatStateManager;
|
||||||
@service modal;
|
@service modal;
|
||||||
@service router;
|
@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
|
@action
|
||||||
editChannelTitle() {
|
editChannelTitle() {
|
||||||
return this.modal.show(ChatModalEditChannelName, {
|
return this.modal.show(ChatModalEditChannelName, {
|
||||||
@ -85,14 +66,6 @@ export default class ChatFullPageHeader extends Component {
|
|||||||
<ChatChannelTitle @channel={{@channel}} />
|
<ChatChannelTitle @channel={{@channel}} />
|
||||||
</LinkTo>
|
</LinkTo>
|
||||||
|
|
||||||
{{#if this.canEditChannel}}
|
|
||||||
<DButton
|
|
||||||
@icon="pencil-alt"
|
|
||||||
class="btn-flat"
|
|
||||||
@action={{this.editChannelTitle}}
|
|
||||||
/>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (or @channel.threadingEnabled this.site.desktopView)}}
|
{{#if (or @channel.threadingEnabled this.site.desktopView)}}
|
||||||
<div class="chat-full-page-header__right-actions">
|
<div class="chat-full-page-header__right-actions">
|
||||||
{{#if this.site.desktopView}}
|
{{#if this.site.desktopView}}
|
||||||
|
Loading…
Reference in New Issue
Block a user