FIX: Maintain editing state after saving query changes (#223)

In the widget version of the data-explorer we would maintain the `editing` state after saving query changes. This was lost in upgrade to glimmer. 

# Current State
https://user-images.githubusercontent.com/50783505/217622464-79adaab6-84ed-4b64-93ae-c889aa8fb1bd.mp4

# Updated State
https://user-images.githubusercontent.com/50783505/217623475-1998fab6-0b70-42d2-923d-574efb9d5601.mov

# Other Changes
- `createProperties` was added back to the `query` model as it is being utilized in the creation of a new data explorer query. This was accidentally removed and was causing errors when trying to create a new query.
- Add new-query test
This commit is contained in:
Isaac Janzen
2023-02-08 13:40:53 -06:00
committed by GitHub
parent 04b2177749
commit 556d12ac50
3 changed files with 74 additions and 7 deletions
@@ -110,7 +110,6 @@ export default class PluginsExplorerController extends Controller {
.then(() => {
this.dirty = false;
this.editingName = false;
this.editingQuery = false;
})
.catch((x) => {
popupAjaxError(x);
@@ -327,8 +326,6 @@ export default class PluginsExplorerController extends Controller {
this.selectedItem.set("group_ids", []);
}
this.dirty = false;
this.editingName = false;
this.editingQuery = false;
})
.catch(popupAjaxError)
.finally(() => (this.loading = false));
@@ -383,10 +380,6 @@ export default class PluginsExplorerController extends Controller {
@action
run() {
if (this.dirty || this.runDisabled) {
return;
}
this.setProperties({
loading: true,
showResults: false,
@@ -56,4 +56,12 @@ export default class Query extends RestModel {
}
return props;
}
createProperties() {
if (this.sql) {
// Importing
return this.updateProperties();
}
return this.getProperties("name");
}
}