diff --git a/app/assets/stylesheets/wcag.scss b/app/assets/stylesheets/wcag.scss index d2452a6496c..4f71606b84d 100644 --- a/app/assets/stylesheets/wcag.scss +++ b/app/assets/stylesheets/wcag.scss @@ -412,11 +412,6 @@ html { .reviewable .status span.approved { color: var(--success-hover); } - - // Chat - .chat-channel .open-drawer-btn { - color: var(--primary-medium); - } } // chat diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-browse-view.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-browse-view.hbs deleted file mode 100644 index 669c1b5cc5b..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-browse-view.hbs +++ /dev/null @@ -1,88 +0,0 @@ -
- {{#if this.site.mobileView}} - - {{d-icon "chevron-left"}} - - {{/if}} - - {{i18n "chat.browse.title"}} - - {{#if this.currentUser.staff}} - - {{/if}} -
- -
-
- - - -
- - {{#if - (and - this.channelsCollection.fetchedOnce (not this.channelsCollection.length) - ) - }} -
- {{i18n "chat.empty_state.title"}} -
-

{{i18n "chat.empty_state.direct_message"}}

- -
-
- {{else if this.channelsCollection.length}} - -
-
-
- {{#each this.channelsCollection as |channel|}} - - {{/each}} -
-
-
- - -
- {{/if}} -
\ No newline at end of file diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-browse-view.js b/plugins/chat/assets/javascripts/discourse/components/chat-browse-view.js deleted file mode 100644 index 2e5200dbc17..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-browse-view.js +++ /dev/null @@ -1,76 +0,0 @@ -import Component from "@ember/component"; -import { action, computed } from "@ember/object"; -import { schedule } from "@ember/runloop"; -import { inject as service } from "@ember/service"; -import { INPUT_DELAY } from "discourse-common/config/environment"; -import discourseDebounce from "discourse-common/lib/debounce"; -import ChatModalCreateChannel from "discourse/plugins/chat/discourse/components/chat/modal/create-channel"; -import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message"; - -const TABS = ["all", "open", "closed", "archived"]; - -export default class ChatBrowseView extends Component { - @service chatApi; - @service modal; - - tagName = ""; - - didReceiveAttrs() { - super.didReceiveAttrs(...arguments); - - if (!this.channelsCollection) { - this.set("channelsCollection", this.chatApi.channels()); - } - - this.channelsCollection.load({ - filter: this.filter, - status: this.status, - }); - } - - @computed("siteSettings.chat_allow_archiving_channels") - get tabs() { - if (this.siteSettings.chat_allow_archiving_channels) { - return TABS; - } else { - return [...TABS].removeObject("archived"); - } - } - - @action - showChatNewMessageModal() { - this.modal.show(ChatModalNewMessage); - } - - @action - onScroll() { - discourseDebounce( - this, - this.channelsCollection.load, - { filter: this.filter, status: this.status }, - INPUT_DELAY - ); - } - - @action - debouncedFiltering(event) { - this.set("channelsCollection", this.chatApi.channels()); - - discourseDebounce( - this, - this.channelsCollection.load, - { filter: event.target.value, status: this.status }, - INPUT_DELAY - ); - } - - @action - createChannel() { - this.modal.show(ChatModalCreateChannel); - } - - @action - focusFilterInput(input) { - schedule("afterRender", () => input?.focus()); - } -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-info.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-info.gjs deleted file mode 100644 index e7f7693c2bb..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-info.gjs +++ /dev/null @@ -1,110 +0,0 @@ -import Component from "@glimmer/component"; -import { action } from "@ember/object"; -import { LinkTo } from "@ember/routing"; -import { inject as service } from "@ember/service"; -import DButton from "discourse/components/d-button"; -import icon from "discourse-common/helpers/d-icon"; -import I18n from "discourse-i18n"; -import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title"; -import ChatModalEditChannelName from "discourse/plugins/chat/discourse/components/chat/modal/edit-channel-name"; -import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status"; - -export default class ChatChannelMessageEmojiPicker extends Component { - @service chatChannelInfoRouteOriginManager; - @service site; - @service modal; - @service chatGuardian; - - membersLabel = I18n.t("chat.channel_info.tabs.members"); - settingsLabel = I18n.t("chat.channel_info.tabs.settings"); - backToChannelLabel = I18n.t("chat.channel_info.back_to_all_channel"); - backToAllChannelsLabel = I18n.t("chat.channel_info.back_to_channel"); - - get showTabs() { - return this.site.desktopView && this.args.channel.isOpen; - } - - get canEditChannel() { - return ( - this.chatGuardian.canEditChatChannel() && - (this.args.channel.isCategoryChannel || - (this.args.channel.isDirectMessageChannel && - this.args.channel.chatable.group)) - ); - } - - @action - editChannelTitle() { - return this.modal.show(ChatModalEditChannelName, { - model: this.args.channel, - }); - } - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs index 27bb34b7b21..5f583126460 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs @@ -21,6 +21,7 @@ import discourseDebounce from "discourse-common/lib/debounce"; import { bind } from "discourse-common/utils/decorators"; import and from "truth-helpers/helpers/and"; import not from "truth-helpers/helpers/not"; +import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status"; import ChatChannelSubscriptionManager from "discourse/plugins/chat/discourse/lib/chat-channel-subscription-manager"; import { FUTURE, @@ -45,7 +46,6 @@ import ChatComposerChannel from "./chat/composer/channel"; import ChatScrollToBottomArrow from "./chat/scroll-to-bottom-arrow"; import ChatSelectionManager from "./chat/selection-manager"; import ChatChannelPreviewCard from "./chat-channel-preview-card"; -import ChatFullPageHeader from "./chat-full-page-header"; import ChatMentionWarnings from "./chat-mention-warnings"; import Message from "./chat-message"; import ChatNotices from "./chat-notices"; @@ -719,14 +719,9 @@ export default class ChatChannel extends Component { {{didUpdate this.loadMessages @targetMessageId}} data-id={{@channel.id}} > - + -
{ - this.chat.activeChannel = channel; - }); - } - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.gjs deleted file mode 100644 index edd1cb0a2f5..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.gjs +++ /dev/null @@ -1,25 +0,0 @@ -import Component from "@glimmer/component"; -import { on } from "@ember/modifier"; -import { inject as service } from "@ember/service"; -import i18n from "discourse-common/helpers/i18n"; - -export default class ChatDrawerHeader extends Component { - @service chatStateManager; - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/back-link.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/back-link.gjs deleted file mode 100644 index b7eb916c6ca..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/back-link.gjs +++ /dev/null @@ -1,21 +0,0 @@ -import Component from "@glimmer/component"; -import { array } from "@ember/helper"; -import { LinkTo } from "@ember/routing"; -import { inject as service } from "@ember/service"; -import dIcon from "discourse-common/helpers/d-icon"; -import or from "truth-helpers/helpers/or"; - -export default class ChatDrawerHeaderBackLink extends Component { - @service chatStateManager; - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.gjs deleted file mode 100644 index 8acd4089387..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.gjs +++ /dev/null @@ -1,45 +0,0 @@ -import Component from "@glimmer/component"; -import { on } from "@ember/modifier"; -import { LinkTo } from "@ember/routing"; -import { inject as service } from "@ember/service"; -import ChannelTitle from "../../channel-title"; - -export default class ChatDrawerChannelHeaderTitle extends Component { - @service chatStateManager; - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/close-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/close-button.gjs deleted file mode 100644 index a6b997502b8..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/close-button.gjs +++ /dev/null @@ -1,12 +0,0 @@ -import DButton from "discourse/components/d-button"; - -const CloseButton = ; - -export default CloseButton; diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/full-page-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/full-page-button.gjs deleted file mode 100644 index b29bf6a3881..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/full-page-button.gjs +++ /dev/null @@ -1,18 +0,0 @@ -import Component from "@glimmer/component"; -import { inject as service } from "@ember/service"; -import DButton from "discourse/components/d-button"; - -export default class ChatDrawerHeaderFullPageButton extends Component { - @service chatStateManager; - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/left-actions.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/left-actions.gjs deleted file mode 100644 index 32175e9acd4..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/left-actions.gjs +++ /dev/null @@ -1,18 +0,0 @@ -import Component from "@glimmer/component"; -import { inject as service } from "@ember/service"; -import i18n from "discourse-common/helpers/i18n"; -import BackLink from "./back-link"; - -export default class ChatDrawerHeaderLeftActions extends Component { - @service chatStateManager; - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.gjs deleted file mode 100644 index 5eb030a5980..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.gjs +++ /dev/null @@ -1,30 +0,0 @@ -import Component from "@glimmer/component"; -import { inject as service } from "@ember/service"; -import ThreadsListButton from "../../chat/thread/threads-list-button"; -import CloseButton from "./close-button"; -import FullPageButton from "./full-page-button"; -import ToggleExpandButton from "./toggle-expand-button"; - -export default class ChatDrawerHeaderRightActions extends Component { - @service chat; - - get showThreadsListButton() { - return this.chat.activeChannel?.threadingEnabled; - } - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/title.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/title.gjs deleted file mode 100644 index 6cdec83cfc1..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/title.gjs +++ /dev/null @@ -1,40 +0,0 @@ -import Component from "@glimmer/component"; -import replaceEmoji from "discourse/helpers/replace-emoji"; -import icon from "discourse-common/helpers/d-icon"; -import I18n from "discourse-i18n"; - -export default class ChatDrawerHeaderTitle extends Component { - get headerTitle() { - if (this.args.title) { - return I18n.t(this.args.title); - } - return replaceEmoji(this.args.translatedTitle); - } - - get showChannel() { - return this.args.channelName ?? false; - } - - get showIcon() { - return this.args.icon ?? false; - } - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.gjs deleted file mode 100644 index 98bf7d16ac0..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.gjs +++ /dev/null @@ -1,28 +0,0 @@ -import Component from "@glimmer/component"; -import { inject as service } from "@ember/service"; -import i18n from "discourse-common/helpers/i18n"; -import ChannelsList from "../channels-list"; -import Header from "./header"; -import RightActions from "./header/right-actions"; - -export default class ChatDrawerIndex extends Component { - @service chatStateManager; - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/threads/index.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/threads/index.gjs deleted file mode 100644 index 2f0668a1a15..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/threads/index.gjs +++ /dev/null @@ -1,47 +0,0 @@ -import Component from "@glimmer/component"; -import { inject as service } from "@ember/service"; -import I18n from "discourse-i18n"; -import ChatDrawerHeader from "discourse/plugins/chat/discourse/components/chat-drawer/header"; -import ChatDrawerHeaderBackLink from "discourse/plugins/chat/discourse/components/chat-drawer/header/back-link"; -import ChatDrawerHeaderRightActions from "discourse/plugins/chat/discourse/components/chat-drawer/header/right-actions"; -import ChatDrawerHeaderTitle from "discourse/plugins/chat/discourse/components/chat-drawer/header/title"; -import UserThreads from "discourse/plugins/chat/discourse/components/user-threads"; - -export default class ChatDrawerThreads extends Component { - @service appEvents; - @service chat; - @service chatStateManager; - @service chatChannelsManager; - - backLinkTitle = I18n.t("chat.return_to_list"); - - -} 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 deleted file mode 100644 index 16e5346fbe5..00000000000 --- a/plugins/chat/assets/javascripts/discourse/components/chat-full-page-header.gjs +++ /dev/null @@ -1,99 +0,0 @@ -import Component from "@glimmer/component"; -import { on } from "@ember/modifier"; -import { action } from "@ember/object"; -import { LinkTo } from "@ember/routing"; -import { inject as service } from "@ember/service"; -import DButton from "discourse/components/d-button"; -import concatClass from "discourse/helpers/concat-class"; -import icon from "discourse-common/helpers/d-icon"; -import and from "truth-helpers/helpers/and"; -import or from "truth-helpers/helpers/or"; -import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title"; -import ChatModalEditChannelName from "discourse/plugins/chat/discourse/components/chat/modal/edit-channel-name"; -import ThreadsListButton from "discourse/plugins/chat/discourse/components/chat/thread/threads-list-button"; -import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status"; - -export default class ChatFullPageHeader extends Component { - @service chatStateManager; - @service modal; - @service router; - @service site; - - get displayed() { - return this.args.displayed ?? true; - } - - get showThreadsListButton() { - return ( - this.args.channel.threadingEnabled && - this.router.currentRoute.name !== "chat.channel.threads" && - this.router.currentRoute.name !== "chat.channel.thread.index" && - this.router.currentRoute.name !== "chat.channel.thread" - ); - } - - @action - editChannelTitle() { - return this.modal.show(ChatModalEditChannelName, { - model: this.args.channel, - }); - } - - @action - trapMouse(event) { - event.stopPropagation(); - } - - -} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs index 7a9cc69e5fa..c1f9e4cf173 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs @@ -98,12 +98,15 @@ export default class ChatMessageThreadIndicator extends Component { @bind openThread(event) { - if (event.type === "keydown" && event.key !== "Enter") { + if (event?.type === "keydown" && event?.key !== "Enter") { return; } // handle middle mouse - if (event.type === "mousedown" && (event.which === 2 || event.shiftKey)) { + if ( + event?.type === "mousedown" && + (event?.which === 2 || event?.shiftKey) + ) { window.open( getURL( this.router.urlFor( diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder.gjs index 9ec60d2fe6c..362f283891c 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder.gjs @@ -41,7 +41,7 @@ export default class ChatRetentionReminder extends Component {
{{/if}} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs index bfa86dba572..6d7b62f9fa2 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs @@ -7,7 +7,6 @@ import isElementInViewport from "discourse/lib/is-element-in-viewport"; import { bind } from "discourse-common/utils/decorators"; import I18n from "discourse-i18n"; import eq from "truth-helpers/helpers/eq"; -import ChatThreadListHeader from "discourse/plugins/chat/discourse/components/chat/thread-list/header"; import ChatThreadListItem from "discourse/plugins/chat/discourse/components/chat/thread-list/item"; import ChatTrackMessage from "discourse/plugins/chat/discourse/modifiers/chat/track-message"; @@ -179,10 +178,6 @@ export default class ChatThreadList extends Component {