FIX: various fixes to channel archive status (#19649)
- improves UI by displaying channel status on it's own line - ensures channel status is correctly updated right after the request on frontend - adds status on info page
This commit is contained in:
parent
5e844793d8
commit
4ba4959a26
|
@ -38,9 +38,9 @@ export default Component.extend(ModalFunctionality, {
|
||||||
|
|
||||||
return this.chatApi
|
return this.chatApi
|
||||||
.createChannelArchive(this.chatChannel.id, this._data())
|
.createChannelArchive(this.chatChannel.id, this._data())
|
||||||
.then((result) => {
|
.then(() => {
|
||||||
this.flash(I18n.t("chat.channel_archive.process_started"), "success");
|
this.flash(I18n.t("chat.channel_archive.process_started"), "success");
|
||||||
result.target.status = CHANNEL_STATUSES.archived;
|
this.chatChannel.set("status", CHANNEL_STATUSES.archived);
|
||||||
|
|
||||||
discourseLater(() => {
|
discourseLater(() => {
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
|
|
|
@ -2,5 +2,7 @@
|
||||||
<div class="chat-channel-status">
|
<div class="chat-channel-status">
|
||||||
{{d-icon this.channelStatusIcon}}
|
{{d-icon this.channelStatusIcon}}
|
||||||
<span>{{this.channelStatusMessage}}</span>
|
<span>{{this.channelStatusMessage}}</span>
|
||||||
|
|
||||||
|
<ChatChannelArchiveStatus @channel={{this.channel}} />
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
|
@ -33,10 +33,9 @@
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ChatChannelArchiveStatus @channel={{this.chatChannel}} />
|
|
||||||
<ChatChannelStatus @channel={{this.chatChannel}} />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ChatChannelStatus @channel={{this.chatChannel}} />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<ChatRetentionReminder @chatChannel={{this.chatChannel}} />
|
<ChatRetentionReminder @chatChannel={{this.chatChannel}} />
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ChatChannelStatus @channel={{this.model}} />
|
||||||
|
|
||||||
<div class="chat-tabs chat-info-tabs">
|
<div class="chat-tabs chat-info-tabs">
|
||||||
<ul class="chat-tabs-list nav-pills" role="tablist">
|
<ul class="chat-tabs-list nav-pills" role="tablist">
|
||||||
{{#each this.tabs as |tab|}}
|
{{#each this.tabs as |tab|}}
|
||||||
|
|
|
@ -664,8 +664,9 @@ body.has-full-page-chat {
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-channel-status {
|
.chat-channel-status {
|
||||||
padding-top: 1rem;
|
background: var(--secondary);
|
||||||
font-weight: 500;
|
padding: 0.5rem 1rem;
|
||||||
|
border-bottom: 1px solid var(--primary-low);
|
||||||
}
|
}
|
||||||
|
|
||||||
html.has-full-page-chat {
|
html.has-full-page-chat {
|
||||||
|
|
|
@ -62,10 +62,7 @@ RSpec.describe "Archive channel", type: :system, js: true do
|
||||||
click_button(I18n.t("js.chat.channel_archive.title"))
|
click_button(I18n.t("js.chat.channel_archive.title"))
|
||||||
|
|
||||||
expect(page).to have_content(I18n.t("js.chat.channel_archive.process_started"))
|
expect(page).to have_content(I18n.t("js.chat.channel_archive.process_started"))
|
||||||
|
expect(page).to have_css(".chat-channel-archive-status")
|
||||||
chat.visit_channel(channel_1)
|
|
||||||
|
|
||||||
expect(page).to have_content(I18n.t("js.chat.channel_status.archived_header"))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when archived channels had unreads" do
|
context "when archived channels had unreads" do
|
||||||
|
|
Loading…
Reference in New Issue