diff --git a/web/app/components/editor/blocks/figma/index.test.ts b/web/app/components/editor/blocks/figma/index.test.ts index 9c1adc4f..9869f706 100644 --- a/web/app/components/editor/blocks/figma/index.test.ts +++ b/web/app/components/editor/blocks/figma/index.test.ts @@ -31,8 +31,7 @@ function figmaType(): NodeType { // reads nothing off the extension instance function pasteHandler(): (view: EditorView, event: ClipboardEvent) => boolean { const addPlugins = createFigmaLinkHandler().config.addProseMirrorPlugins as - | (() => Plugin[]) - | undefined + (() => Plugin[]) | undefined if (!addPlugins) { throw new Error("the figma link handler registers no plugins") diff --git a/web/app/components/editor/blocks/mermaid/MermaidPreview.nuxt.test.ts b/web/app/components/editor/blocks/mermaid/MermaidPreview.nuxt.test.ts index d6ae79c8..e56ea76b 100644 --- a/web/app/components/editor/blocks/mermaid/MermaidPreview.nuxt.test.ts +++ b/web/app/components/editor/blocks/mermaid/MermaidPreview.nuxt.test.ts @@ -123,7 +123,8 @@ describe("", { concurrent: false }, () => { const wrapper = await mountPreview("graph TD; A-->B;") await vi.waitFor(() => { - expect(previewHtml(wrapper)).toContain("") + // happy-dom unwraps the sanitized svg root; a real browser does not + expect(previewHtml(wrapper)).toContain("") }, WAIT_FOR_OPTIONS) expect(mermaid.render).toHaveBeenCalledTimes(1) expect(mermaid.render.mock.calls[0]?.[1]).toBe("graph TD; A-->B;") @@ -219,7 +220,8 @@ describe("", { concurrent: false }, () => { it("clears the diagram when the code is deleted", async ({ expect }) => { const wrapper = await mountPreview("graph TD; A-->B;") await vi.waitFor(() => { - expect(previewHtml(wrapper)).toContain("") + // happy-dom unwraps the sanitized svg root; a real browser does not + expect(previewHtml(wrapper)).toContain("") }, WAIT_FOR_OPTIONS) vi.useFakeTimers() diff --git a/web/app/components/editor/blocks/metrics/VisualizationContainer.vue b/web/app/components/editor/blocks/metrics/VisualizationContainer.vue index c81a4758..8a6be6c9 100644 --- a/web/app/components/editor/blocks/metrics/VisualizationContainer.vue +++ b/web/app/components/editor/blocks/metrics/VisualizationContainer.vue @@ -122,10 +122,7 @@ const data = computed<{ queryIndex?: number multipleQueries?: boolean data?: - | MultipleLineChartData - | MultipleBarChartData - | MultipleGaugeChartData - | null + MultipleLineChartData | MultipleBarChartData | MultipleGaugeChartData | null }>(() => { const results = fetchMetricData.state.value.data ?? [] const queryErrIndex = results.findIndex( diff --git a/web/app/components/editor/blocks/metrics/config-modal/UnitSelect.vue b/web/app/components/editor/blocks/metrics/config-modal/UnitSelect.vue index 171b7318..354f930a 100644 --- a/web/app/components/editor/blocks/metrics/config-modal/UnitSelect.vue +++ b/web/app/components/editor/blocks/metrics/config-modal/UnitSelect.vue @@ -46,9 +46,7 @@ const processedSelectedUnit = computed(() => { return { category, unit: unit as - | VisualizationTimeUnit - | VisualizationDataUnit - | VisualizationMiscUnit, + VisualizationTimeUnit | VisualizationDataUnit | VisualizationMiscUnit, } } diff --git a/web/app/components/editor/blocks/metrics/config-modal/query/promql.ts b/web/app/components/editor/blocks/metrics/config-modal/query/promql.ts index 26e08ab6..23f84a9a 100644 --- a/web/app/components/editor/blocks/metrics/config-modal/query/promql.ts +++ b/web/app/components/editor/blocks/metrics/config-modal/query/promql.ts @@ -106,7 +106,9 @@ function makeWrappedCompleteStrategy( // show presets when empty, when typing "$", or when typing a number const showPresets = - bc.token.length === 0 || /^\$/.test(bc.token) || /^\d/.test(bc.token) + bc.token.length === 0 || + bc.token.startsWith("$") || + /^\d/.test(bc.token) const presets = showPresets ? promqlDurationPresets(t) : [] diff --git a/web/app/components/editor/blocks/metrics/utils.ts b/web/app/components/editor/blocks/metrics/utils.ts index 62000bd5..ce4b73f4 100644 --- a/web/app/components/editor/blocks/metrics/utils.ts +++ b/web/app/components/editor/blocks/metrics/utils.ts @@ -133,8 +133,7 @@ export function buildConfigFromNodeAttrs( // legacy blobs may miss fields entirely and may still use the old "type" // field name, so Partial reflects the actual runtime shape. const legacy = attrs.config as - | (Partial & { type?: GenericQueryChartType | null }) - | null + (Partial & { type?: GenericQueryChartType | null }) | null if (legacy) { return { title: legacy.title ?? "", diff --git a/web/app/components/editor/blocks/metrics/visualizations/BarChart.vue b/web/app/components/editor/blocks/metrics/visualizations/BarChart.vue index 14a53c7b..54ec03f2 100644 --- a/web/app/components/editor/blocks/metrics/visualizations/BarChart.vue +++ b/web/app/components/editor/blocks/metrics/visualizations/BarChart.vue @@ -309,7 +309,9 @@ const legendHandler = computed(() => { class="size-full" :option="option" autoresize - @legendselectchanged="(p: LegendSelectChangedPayload) => legendHandler(p)" + @legendselectchanged=" + (p: unknown) => legendHandler(p as LegendSelectChangedPayload) + " >
diff --git a/web/app/components/editor/blocks/metrics/visualizations/LineChart.vue b/web/app/components/editor/blocks/metrics/visualizations/LineChart.vue index 8c40edb2..f5f9ccb3 100644 --- a/web/app/components/editor/blocks/metrics/visualizations/LineChart.vue +++ b/web/app/components/editor/blocks/metrics/visualizations/LineChart.vue @@ -315,7 +315,9 @@ const legendHandler = computed(() => { class="size-full" :option="option" autoresize - @legendselectchanged="(p: LegendSelectChangedPayload) => legendHandler(p)" + @legendselectchanged=" + (p: unknown) => legendHandler(p as LegendSelectChangedPayload) + " >