REFACTOR: handles every chat resource as an URL (#18961)

- Note this is also tweaking the UI a little bit as we are now using links/buttons in the header as needed
- It disables the find ideal channel in drawer mode, if loading `/chat` in drawer mode it will either reopen at the last position or just stay on index
This commit is contained in:
Joffrey JAFFEUX
2022-11-11 06:39:15 +01:00
committed by GitHub
parent 4db5525d25
commit 66130dc8c1
60 changed files with 639 additions and 759 deletions

View File

@ -1,13 +1,11 @@
import componentTest, {
setupRenderingTest,
} from "discourse/tests/helpers/component-test";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import hbs from "htmlbars-inline-precompile";
import fabricators from "../helpers/fabricators";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import pretender from "discourse/tests/helpers/create-pretender";
import { CHATABLE_TYPES } from "discourse/plugins/chat/discourse/models/chat-channel";
import { set } from "@ember/object";
import { module } from "qunit";
function membershipFixture(id, options = {}) {
@ -221,50 +219,3 @@ module(
});
}
);
module(
"Discourse Chat | Component | chat-channel-settings-view | Public channel - admin user",
function (hooks) {
setupRenderingTest(hooks);
componentTest("admin actions", {
template: hbs`{{chat-channel-settings-view channel=channel}}`,
beforeEach() {
set(this.currentUser, "admin", true);
set(this.currentUser, "has_chat_enabled", true);
this.siteSettings.chat_enabled = true;
this.set("channel", fabricators.chatChannel());
},
async test(assert) {
assert.ok(exists(".close-btn"));
assert.ok(exists(".delete-btn"));
},
});
}
);
module(
"Discourse Chat | Component | chat-channel-settings-view | Archived Public channel - admin user",
function (hooks) {
setupRenderingTest(hooks);
componentTest("archive action", {
template: hbs`{{chat-channel-settings-view channel=channel}}`,
beforeEach() {
set(this.currentUser, "admin", true);
set(this.currentUser, "has_chat_enabled", true);
this.siteSettings.chat_enabled = true;
this.siteSettings.chat_allow_archiving_channels = true;
this.set("channel", fabricators.chatChannel());
},
async test(assert) {
assert.ok(exists(".archive-btn"));
},
});
}
);