Skip to content

A platform for community discussion. Free, open, simple.

DEV: Do not autorun query after creation (#42434)

Natalie Tay84095f9965e2
diff --git a/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/new.js b/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/new.js
index 1d5b8df2e12..4746ee35739 100644
--- a/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/new.js
+++ b/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/new.js
@@ -247,12 +247,9 @@ export default class AdminPluginsExplorerNew extends Controller {
this.toasts.success({
data: { message: i18n("explorer.query_created") },
});
- // Run the query straight away — there's nothing new to do on the edit
- // page first, so save and show the results in one step.
this.router.transitionTo(
"adminPlugins.show.explorer.edit",
- result.target.id,
- { queryParams: { run: true } }
+ result.target.id
);
} catch (error) {
popupAjaxError(error);
diff --git a/plugins/discourse-data-explorer/test/javascripts/acceptance/new-query-test.js b/plugins/discourse-data-explorer/test/javascripts/acceptance/new-query-test.js
index 141985bdc21..e9ad4e7da1a 100644
--- a/plugins/discourse-data-explorer/test/javascripts/acceptance/new-query-test.js
+++ b/plugins/discourse-data-explorer/test/javascripts/acceptance/new-query-test.js
@@ -315,7 +315,7 @@ acceptance("New Query - AI", function (needs) {
.exists("the SQL is available behind its own tab");
});
- test("saving transitions to the edit page and runs the query", async function (assert) {
+ test("saving transitions to the edit page without running the query", async function (assert) {
await generate("show me a value");
await click(".query-new__save-btn");
@@ -326,9 +326,9 @@ acceptance("New Query - AI", function (needs) {
),
"transitions to the saved query"
);
- assert.true(
- currentURL().includes("run=true"),
- "carries the auto-run flag so the query runs immediately"
+ assert.false(
+ currentURL().includes("run="),
+ "does not run the saved query before parameters can be adjusted"
);
});
});