Skip to content

Commit

Permalink
Merge pull request #1189 from merico-dev/1187-should-be-able-to-force…
Browse files Browse the repository at this point in the history
…-run-a-query-in-edit-mode

1187 should be able to force run a query in edit mode
  • Loading branch information
GerilLeto authored Sep 19, 2023
2 parents 89a7500 + 94b999f commit 4b62e43
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/api",
"version": "10.34.3",
"version": "10.34.4",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/dashboard",
"version": "10.34.3",
"version": "10.34.4",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const PanelRenderModel = PanelMeta.views((self) => ({
}))
.actions((self) => ({
refreshData() {
self.queries.forEach((q) => q.fetchData());
self.queries.forEach((q) => q.fetchData(true));
},
downloadData() {
// @ts-expect-error typeof getRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const QueriesRenderModel = types
console.error(new Error(`[downloadDataByQueryID] query by ID[${queryID}] not found`));
return;
}
return query.fetchData();
return query.fetchData(true);
},
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ export const QueryRenderModel = types
.actions((self) => {
return {
runSQL: flow(function* () {
if (!self.inUse) {
console.debug(`Skipping query[${self.name}]`);
return;
}
if (!self.valid) {
return;
}
Expand Down Expand Up @@ -129,10 +125,6 @@ export const QueryRenderModel = types
}
}),
runHTTP: flow(function* () {
if (!self.inUse) {
console.debug(`Skipping query[${self.name}]`);
return;
}
if (!self.valid || !self.datasource) {
return;
}
Expand Down Expand Up @@ -179,9 +171,14 @@ export const QueryRenderModel = types
})
.actions((self) => {
return {
fetchData: () => {
fetchData: (force: boolean) => {
if (!self.inUse && !force) {
console.debug(`Skipping query[${self.name}]`);
return;
}
return self.typedAsHTTP ? self.runHTTP() : self.runSQL();
},

beforeDestroy() {
self.controller?.abort();
},
Expand All @@ -200,7 +197,7 @@ export const QueryRenderModel = types
const deps = [self.inUse, self.id, self.key, self.formattedSQL, self.pre_process, self.post_process];
return deps.join('--');
},
self.fetchData,
() => self.fetchData(false),
{
fireImmediately: true,
delay: 0,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/root",
"version": "10.34.3",
"version": "10.34.4",
"private": true,
"workspaces": [
"api",
Expand Down
2 changes: 1 addition & 1 deletion settings-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/settings-form",
"version": "10.34.3",
"version": "10.34.4",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@devtable/website",
"private": true,
"license": "Apache-2.0",
"version": "10.34.3",
"version": "10.34.4",
"scripts": {
"dev": "vite",
"preview": "vite preview"
Expand Down

0 comments on commit 4b62e43

Please sign in to comment.