diff --git a/api/package.json b/api/package.json index b4a287ea3..e9a661a94 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/api", - "version": "10.58.0", + "version": "10.58.1", "description": "", "main": "index.js", "scripts": { diff --git a/api/src/dashboard_migration/handlers/10.41.0.ts b/api/src/dashboard_migration/handlers/10.41.0.ts index 78e7cc1c5..3a5f6fb43 100644 --- a/api/src/dashboard_migration/handlers/10.41.0.ts +++ b/api/src/dashboard_migration/handlers/10.41.0.ts @@ -2,8 +2,7 @@ function upgradePanels(panels: Record[]) { return panels.map((p) => { const { title, ...rest } = p; if (typeof title !== 'string') { - console.log(p); - throw new Error(`Unexpected type of panel.title: ${typeof title}`); + return p; } const name = title ? title : p.id; return { diff --git a/dashboard/package.json b/dashboard/package.json index b8f61708b..ebafd1a53 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/dashboard", - "version": "10.58.0", + "version": "10.58.1", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/dashboard/src/model/render-model/dashboard/content/queries/mute-query.ts b/dashboard/src/model/render-model/dashboard/content/queries/mute-query.ts index 3efd73594..1d33d7765 100644 --- a/dashboard/src/model/render-model/dashboard/content/queries/mute-query.ts +++ b/dashboard/src/model/render-model/dashboard/content/queries/mute-query.ts @@ -17,10 +17,8 @@ export const MuteQueryModel = QueryMeta.views((self) => ({ if (!isAlive(self)) { return []; } - // @ts-expect-error untyped getRoot(self) - const contentModel = getRoot(self).content; - const { context } = contentModel.payloadForSQL; + const { context } = this.contentModel.payloadForSQL; const contextOptions: SelectItem[] = Object.keys(context).map((k) => ({ group: 'Context', label: k, @@ -28,14 +26,28 @@ export const MuteQueryModel = QueryMeta.views((self) => ({ description: undefined, })); - const filterOptions: SelectItem[] = contentModel.filters.keyLabelOptions.map((o: SelectItem) => ({ + const filterOptions: SelectItem[] = this.contentModel.filters.keyLabelOptions.map((o: SelectItem) => ({ group: 'Filters', label: o.label, value: `filters.${o.value}`, description: o.value, })); - return [...contextOptions, ...filterOptions]; + const ret = [...contextOptions, ...filterOptions]; + const validValues = new Set(ret.map((r) => r.value)); + self.run_by.forEach((c) => { + if (validValues.has(c)) { + return; + } + + ret.push({ + group: 'Invalid', + label: c, + value: c, + }); + }); + + return ret; }, get unmetRunByConditions() { // this computed has dependencies on reactive values outside the model, @@ -47,8 +59,7 @@ export const MuteQueryModel = QueryMeta.views((self) => ({ if (run_by.length === 0) { return []; } - // @ts-expect-error untyped getRoot(self) - const payload = getRoot(self).content.payloadForSQL; + const payload = this.contentModel.payloadForSQL; return run_by.filter((c) => { const value = _.get(payload, c); @@ -91,8 +102,7 @@ export const MuteQueryModel = QueryMeta.views((self) => ({ if (react_to.length === 0) { return ''; } - // @ts-expect-error untyped getRoot(self) - const source = getRoot(self).content.payloadForSQL; + const source = self.contentModel.payloadForSQL; const payload = [...react_to].reduce((acc, path) => { acc[path] = _.get(source, path); return acc; @@ -107,14 +117,13 @@ export const MuteQueryModel = QueryMeta.views((self) => ({ if (self.unmetRunByConditions.length === 0) { return { context: [], filters: [] }; } - // @ts-expect-error untyped getRoot(self) - const { keyLabelMap } = getRoot(self).content.filters; + const { keyLabelMap } = self.contentModel.filters; const contextNames = self.unmetRunByConditions .filter((k) => k.startsWith('context.')) - .map((k) => k.split('context.')[0]); + .map((k) => k.replace('context.', '')); const filterNames = self.unmetRunByConditions .filter((k) => k.startsWith('filters.')) - .map((k) => _.get({ filters: keyLabelMap }, k)) + .map((k) => _.get({ filters: keyLabelMap }, k, k.replace('filters.', ''))) .filter((v) => !!v); return { context: contextNames, diff --git a/dashboard/src/types/dashboard.ts b/dashboard/src/types/dashboard.ts index fe6fd482b..83aa2d024 100644 --- a/dashboard/src/types/dashboard.ts +++ b/dashboard/src/types/dashboard.ts @@ -113,5 +113,5 @@ export const initialDashboardContent: TDashboardContent = { ], panels: [], filters: [], - version: '9.19.0', + version: '10.41.0', }; diff --git a/package.json b/package.json index 61d5e4504..d661d726d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/root", - "version": "10.58.0", + "version": "10.58.1", "private": true, "workspaces": [ "api", diff --git a/settings-form/package.json b/settings-form/package.json index 2d3c3f9ca..55439345a 100644 --- a/settings-form/package.json +++ b/settings-form/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/settings-form", - "version": "10.58.0", + "version": "10.58.1", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/website/package.json b/website/package.json index 5ffee321c..6f6d02e38 100644 --- a/website/package.json +++ b/website/package.json @@ -2,7 +2,7 @@ "name": "@devtable/website", "private": true, "license": "Apache-2.0", - "version": "10.58.0", + "version": "10.58.1", "scripts": { "dev": "vite", "preview": "vite preview"