DEV: /channel -> /c chat route rename (#19782)

* DEV: Rnemae channel path to just c

Also swap the channel id and channel slug params to be consistent with core.

* linting

* channel_path

* params in wrong order

* Drop slugify helper and channel route without slug

* Request slug and route models through the channel model if possible

* Add client side redirection for backwards-compatibility

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
Roman Rizzi
2023-01-27 09:58:12 -03:00
committed by GitHub
parent 079e1108f1
commit d07b472b79
54 changed files with 171 additions and 152 deletions

View File

@ -45,7 +45,7 @@ acceptance("Discourse Chat - Composer", function (needs) {
});
skip("when pasting html in composer", async function (assert) {
await visit("/chat/channel/11/another-category");
await visit("/chat/c/another-category/11");
const clipboardEvent = new Event("paste", { bubbles: true });
clipboardEvent.clipboardData = {
@ -96,7 +96,7 @@ acceptance("Discourse Chat - Composer - unreliable network", function (needs) {
});
skip("Sending a message with unreliable network", async function (assert) {
await visit("/chat/channel/11/-");
await visit("/chat/c/-/11");
await fillIn(".chat-composer-input", "network-error-message");
await click(".send-btn");
@ -133,7 +133,7 @@ acceptance("Discourse Chat - Composer - unreliable network", function (needs) {
});
skip("Draft with unreliable network", async function (assert) {
await visit("/chat/channel/11/-");
await visit("/chat/c/-/11");
this.chatService.set("isNetworkUnreliable", true);
await settled();

View File

@ -113,7 +113,7 @@ acceptance("Discourse Chat - Chat live pane collapse", function (needs) {
const collapseImage =
".chat-message-container[data-id='1'] .chat-message-collapser-opened";
await visit("/chat/channel/1/cat");
await visit("/chat/c/cat/1");
assert.ok(visible(youtubeContainer));
assert.ok(visible(collapseImage), "the open arrow is shown");
@ -140,7 +140,7 @@ acceptance("Discourse Chat - Chat live pane collapse", function (needs) {
const collapseImage =
".chat-message-container[data-id='2'] .chat-message-collapser-opened";
await visit("/chat/channel/1/cat");
await visit("/chat/c/cat/1");
await click(image);

View File

@ -55,7 +55,7 @@ acceptance(
});
skip("Handles 429 errors by displaying an alert", async function (assert) {
await visit("/chat/channel/1/cat");
await visit("/chat/c/cat/1");
assert.ok(exists(".dialog-content"), "We displayed a 429 error");
await click(".dialog-footer .btn-primary");