Skip to content

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

FIX: various fixes to channel archive status (#19649)

Joffrey JAFFEUX4ba4959a2614
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js
index 57a800b4127..5519e771f2e 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js
@@ -38,9 +38,9 @@ export default Component.extend(ModalFunctionality, {
return this.chatApi
.createChannelArchive(this.chatChannel.id, this._data())
- .then((result) => {
+ .then(() => {
this.flash(I18n.t("chat.channel_archive.process_started"), "success");
- result.target.status = CHANNEL_STATUSES.archived;
+ this.chatChannel.set("status", CHANNEL_STATUSES.archived);
discourseLater(() => {
this.closeModal();
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.hbs
index 3e96c9e6a2b..5bfb42db968 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.hbs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.hbs
@@ -2,5 +2,7 @@
<div class="chat-channel-status">
{{d-icon this.channelStatusIcon}}
<span>{{this.channelStatusMessage}}</span>
+
+ <ChatChannelArchiveStatus @channel={{this.channel}} />
</div>
-{{/if}}
\ No newline at end of file
+{{/if}}
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs
index 9498485781d..bf9154bc6b6 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.hbs
@@ -33,10 +33,9 @@
</div>
{{/if}}
</div>
-
- <ChatChannelArchiveStatus @channel={{this.chatChannel}} />
- <ChatChannelStatus @channel={{this.chatChannel}} />
</div>
+
+ <ChatChannelStatus @channel={{this.chatChannel}} />
{{/if}}
<ChatRetentionReminder @chatChannel={{this.chatChannel}} />
@@ -153,4 +152,4 @@
{{else}}
<ChatChannelPreviewCard @channel={{this.chatChannel}} />
{{/if}}
-{{/if}}
\ No newline at end of file
+{{/if}}
diff --git a/plugins/chat/assets/javascripts/discourse/templates/chat-channel-info.hbs b/plugins/chat/assets/javascripts/discourse/templates/chat-channel-info.hbs
index 47e3dc53e29..83e6b2e8a85 100644
--- a/plugins/chat/assets/javascripts/discourse/templates/chat-channel-info.hbs
+++ b/plugins/chat/assets/javascripts/discourse/templates/chat-channel-info.hbs
@@ -26,6 +26,8 @@
</div>
</div>
+ <ChatChannelStatus @channel={{this.model}} />
+
<div class="chat-tabs chat-info-tabs">
<ul class="chat-tabs-list nav-pills" role="tablist">
{{#each this.tabs as |tab|}}
@@ -60,4 +62,4 @@
{{outlet}}
</div>
</div>
-</div>
\ No newline at end of file
+</div>
diff --git a/plugins/chat/assets/stylesheets/common/common.scss b/plugins/chat/assets/stylesheets/common/common.scss
index 894e3676470..2a390547ef5 100644
--- a/plugins/chat/assets/stylesheets/common/common.scss
+++ b/plugins/chat/assets/stylesheets/common/common.scss
@@ -664,8 +664,9 @@ body.has-full-page-chat {
}
.chat-channel-status {
- padding-top: 1rem;
- font-weight: 500;
+ background: var(--secondary);
+ padding: 0.5rem 1rem;
+ border-bottom: 1px solid var(--primary-low);
}
html.has-full-page-chat {
diff --git a/plugins/chat/spec/system/archive_channel_spec.rb b/plugins/chat/spec/system/archive_channel_spec.rb
index 4a2e77c4d48..3a180757e6f 100644
--- a/plugins/chat/spec/system/archive_channel_spec.rb
+++ b/plugins/chat/spec/system/archive_channel_spec.rb
@@ -62,10 +62,7 @@ RSpec.describe "Archive channel", type: :system, js: true do
click_button(I18n.t("js.chat.channel_archive.title"))
expect(page).to have_content(I18n.t("js.chat.channel_archive.process_started"))
-
- chat.visit_channel(channel_1)
-
- expect(page).to have_content(I18n.t("js.chat.channel_status.archived_header"))
+ expect(page).to have_css(".chat-channel-archive-status")
end
context "when archived channels had unreads" do