mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Reset admin theme controller on modal cancel event (#20289)
When installing themes using the "Install this theme component" button on meta.discourse.org, we pass the repo name and URL via query params. However, these stick. So if a user cancels the installation, on the next navigation to the same route, they'll see the modal again. This PR clears the query params of the controller when dismissing the modal.
This commit is contained in:
parent
b94fa3b87a
commit
afdb4a084a
@ -135,6 +135,11 @@ export default Controller.extend(ModalFunctionality, {
|
||||
branch: null,
|
||||
selection: "popular",
|
||||
});
|
||||
|
||||
this.themesController.setProperties({
|
||||
repoName: null,
|
||||
repoUrl: null,
|
||||
});
|
||||
},
|
||||
|
||||
themeHasSameUrl(theme, url) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { click, fillIn, visit } from "@ember/test-helpers";
|
||||
import { click, currentURL, fillIn, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import I18n from "I18n";
|
||||
|
||||
@ -82,6 +82,13 @@ acceptance("Admin - Themes - Install modal", function (needs) {
|
||||
"testUrl",
|
||||
"repo url is visible"
|
||||
);
|
||||
|
||||
await click(".d-modal-cancel");
|
||||
assert.strictEqual(
|
||||
currentURL(),
|
||||
"/admin/customize/themes",
|
||||
"query params are cleared after dismissing the modal"
|
||||
);
|
||||
});
|
||||
|
||||
test("installed themes are matched with the popular list by URL", async function (assert) {
|
||||
|
Loading…
Reference in New Issue
Block a user