mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
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:
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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");
|
||||
|
@ -17,7 +17,10 @@ module("Discourse Chat | Component | chat-channel-row", function (hooks) {
|
||||
|
||||
assert
|
||||
.dom(".chat-channel-row")
|
||||
.hasAttribute("href", `/chat/channel/${this.categoryChatChannel.id}/-`);
|
||||
.hasAttribute(
|
||||
"href",
|
||||
`/chat/c/${this.categoryChatChannel.slugifiedTitle}/${this.categoryChatChannel.id}`
|
||||
);
|
||||
});
|
||||
|
||||
test("allows tabbing", async function (assert) {
|
||||
|
@ -14,7 +14,7 @@ module("Discourse Chat | Unit | Helpers | format-chat-date", function (hooks) {
|
||||
|
||||
assert.equal(
|
||||
query(".chat-time").getAttribute("href"),
|
||||
"/chat/channel/1/-?messageId=1"
|
||||
"/chat/c/-/1?messageId=1"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -43,9 +43,9 @@ module(
|
||||
const data = this.args.data;
|
||||
assert.strictEqual(
|
||||
query(".chat-invitation a").getAttribute("href"),
|
||||
`/chat/channel/${data.chat_channel_id}/${slugifyChannel({
|
||||
`/chat/c/${slugifyChannel({
|
||||
title: data.chat_channel_title,
|
||||
})}?messageId=${data.chat_message_id}`
|
||||
})}/${data.chat_channel_id}?messageId=${data.chat_message_id}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -52,9 +52,9 @@ module(
|
||||
|
||||
assert.strictEqual(
|
||||
query(".chat-invitation a").getAttribute("href"),
|
||||
`/chat/channel/${data.chat_channel_id}/${slugifyChannel({
|
||||
`/chat/c/${slugifyChannel({
|
||||
title: data.chat_channel_title,
|
||||
})}?messageId=${data.chat_message_id}`
|
||||
})}/${data.chat_channel_id}?messageId=${data.chat_message_id}`
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -91,9 +91,9 @@ module(
|
||||
|
||||
assert.strictEqual(
|
||||
query(".chat-invitation a").getAttribute("href"),
|
||||
`/chat/channel/${data.chat_channel_id}/${slugifyChannel({
|
||||
`/chat/c/${slugifyChannel({
|
||||
title: data.chat_channel_title,
|
||||
})}?messageId=${data.chat_message_id}`
|
||||
})}/${data.chat_channel_id}?messageId=${data.chat_message_id}`
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -130,9 +130,9 @@ module(
|
||||
|
||||
assert.strictEqual(
|
||||
query(".chat-invitation a").getAttribute("href"),
|
||||
`/chat/channel/${data.chat_channel_id}/${slugifyChannel({
|
||||
`/chat/c/${slugifyChannel({
|
||||
title: data.chat_channel_title,
|
||||
})}?messageId=${data.chat_message_id}`
|
||||
})}/${data.chat_channel_id}?messageId=${data.chat_message_id}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user