@grafana/scenes 5.19.0 → 5.19.1
Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# v5.19.1 (Wed Oct 09 2024)
|
2
|
+
|
3
|
+
#### 🐛 Bug Fix
|
4
|
+
|
5
|
+
- Fix a crash when refresh interval set to empty string [#933](https://github.com/grafana/scenes/pull/933) ([@oscarkilhed](https://github.com/oscarkilhed))
|
6
|
+
|
7
|
+
#### Authors: 1
|
8
|
+
|
9
|
+
- Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed))
|
10
|
+
|
11
|
+
---
|
12
|
+
|
1
13
|
# v5.19.0 (Wed Oct 09 2024)
|
2
14
|
|
3
15
|
#### 🚀 Enhancement
|
@@ -32,7 +32,11 @@ class SceneRefreshPicker extends SceneObjectBase {
|
|
32
32
|
const filterDissalowedIntervals = (i) => {
|
33
33
|
var _a2;
|
34
34
|
const minInterval = (_a2 = state.minRefreshInterval) != null ? _a2 : config.minRefreshInterval;
|
35
|
-
|
35
|
+
try {
|
36
|
+
return minInterval ? rangeUtil.intervalToMs(i) >= rangeUtil.intervalToMs(minInterval) : true;
|
37
|
+
} catch (e) {
|
38
|
+
return false;
|
39
|
+
}
|
36
40
|
};
|
37
41
|
super(__spreadProps(__spreadValues({
|
38
42
|
refresh: ""
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SceneRefreshPicker.js","sources":["../../../src/components/SceneRefreshPicker.tsx"],"sourcesContent":["import React from 'react';\nimport { Unsubscribable } from 'rxjs';\nimport { rangeUtil } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { RefreshPicker } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObject, SceneObjectState, SceneObjectUrlValues } from '../core/types';\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\n\nexport const DEFAULT_INTERVALS = ['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'];\n\nexport interface SceneRefreshPickerState extends SceneObjectState {\n /**\n * Refresh interval, e.g. 5s, 1m, 2h\n */\n refresh: string;\n autoEnabled?: boolean;\n autoMinInterval?: string;\n autoValue?: string;\n /**\n * List of allowed refresh intervals, e.g. ['5s', '1m']\n */\n intervals?: string[];\n isOnCanvas?: boolean;\n primary?: boolean;\n withText?: boolean;\n /**\n * Overrides the default minRefreshInterval from the grafana config. Can be set to \"0s\" to remove the minimum refresh interval.\n */\n minRefreshInterval?: string;\n}\n\nexport class SceneRefreshPicker extends SceneObjectBase<SceneRefreshPickerState> {\n public static Component = SceneRefreshPickerRenderer;\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['refresh'] });\n private _intervalTimer: ReturnType<typeof setInterval> | undefined;\n private _autoTimeRangeListener: Unsubscribable | undefined;\n private _autoRefreshBlocked: boolean = false;\n\n public constructor(state: Partial<SceneRefreshPickerState>) {\n const filterDissalowedIntervals = (i: string) => {\n const minInterval = state.minRefreshInterval ?? config.minRefreshInterval;\n return minInterval ? rangeUtil.intervalToMs(i) >= rangeUtil.intervalToMs(minInterval) : true;\n };\n\n super({\n refresh: '',\n ...state,\n autoValue: undefined,\n autoEnabled: state.autoEnabled ?? true,\n autoMinInterval: state.autoMinInterval ?? config.minRefreshInterval,\n intervals: (state.intervals ?? DEFAULT_INTERVALS).filter(filterDissalowedIntervals),\n });\n\n this.addActivationHandler(() => {\n this.setupIntervalTimer();\n\n const onVisibilityChange = () => {\n if (this._autoRefreshBlocked && document.visibilityState === 'visible') {\n this._autoRefreshBlocked = false;\n this.onRefresh();\n }\n };\n\n document.addEventListener('visibilitychange', onVisibilityChange);\n\n return () => {\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n document.removeEventListener('visibilitychange', onVisibilityChange);\n this._autoTimeRangeListener?.unsubscribe();\n };\n });\n }\n\n public onRefresh = () => {\n const queryController = sceneGraph.getQueryController(this);\n if (queryController?.state.isRunning) {\n queryController.cancelAll();\n return;\n }\n\n const timeRange = sceneGraph.getTimeRange(this);\n\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n timeRange.onRefresh();\n this.setupIntervalTimer();\n };\n\n public onIntervalChanged = (interval: string) => {\n this.setState({ refresh: interval });\n this.setupIntervalTimer();\n };\n\n public getUrlState() {\n let refresh: string | undefined = this.state.refresh;\n\n if (typeof refresh !== 'string' || refresh.length === 0) {\n refresh = undefined;\n }\n\n return { refresh };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const { intervals } = this.state;\n let refresh = values.refresh;\n\n if (typeof refresh === 'string' && isIntervalString(refresh)) {\n if (intervals?.includes(refresh)) {\n this.setState({ refresh });\n } else {\n this.setState({\n // Default to the first refresh interval if the interval from the URL is not allowed, just like in the old architecture.\n refresh: intervals ? intervals[0] : undefined,\n });\n }\n }\n }\n\n private setupAutoTimeRangeListener = () => {\n // If the time range has changed, we need to recalculate the auto interval but prevent unnecessary processing\n return sceneGraph.getTimeRange(this).subscribeToState((newState, prevState) => {\n if (newState.from !== prevState.from || newState.to !== prevState.to) {\n this.setupIntervalTimer();\n }\n });\n };\n\n private calculateAutoRefreshInterval = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const resolution = window?.innerWidth ?? 2000;\n return rangeUtil.calculateInterval(timeRange.state.value, resolution, this.state.autoMinInterval);\n };\n\n private isTabVisible() {\n return document.visibilityState === undefined || document.visibilityState === 'visible';\n }\n\n private setupIntervalTimer = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const { refresh, intervals } = this.state;\n\n if (this._intervalTimer || refresh === '') {\n clearInterval(this._intervalTimer);\n }\n\n if (refresh === '') {\n return;\n }\n\n // If the provided interval is not allowed\n if (refresh !== RefreshPicker.autoOption.value && intervals && !intervals.includes(refresh)) {\n return;\n }\n\n let intervalMs: number;\n\n // Unsubscribe from previous listener no matter what\n this._autoTimeRangeListener?.unsubscribe();\n\n if (refresh === RefreshPicker.autoOption.value) {\n const autoRefreshInterval = this.calculateAutoRefreshInterval();\n\n intervalMs = autoRefreshInterval.intervalMs;\n\n this._autoTimeRangeListener = this.setupAutoTimeRangeListener();\n\n if (autoRefreshInterval.interval !== this.state.autoValue) {\n this.setState({ autoValue: autoRefreshInterval.interval });\n }\n } else {\n intervalMs = rangeUtil.intervalToMs(refresh);\n }\n\n this._intervalTimer = setInterval(() => {\n if (this.isTabVisible()) {\n timeRange.onRefresh();\n } else {\n this._autoRefreshBlocked = true;\n }\n }, intervalMs);\n };\n}\n\nexport function SceneRefreshPickerRenderer({ model }: SceneComponentProps<SceneRefreshPicker>) {\n const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();\n const isRunning = useQueryControllerState(model);\n\n let text = refresh === RefreshPicker.autoOption?.value ? autoValue : withText ? 'Refresh' : undefined;\n let tooltip: string | undefined;\n let width: string | undefined;\n\n if (isRunning) {\n tooltip = 'Cancel all queries';\n\n if (withText) {\n text = 'Cancel';\n }\n }\n\n if (withText) {\n width = '96px';\n }\n\n return (\n <RefreshPicker\n showAutoInterval={autoEnabled}\n value={refresh}\n intervals={intervals}\n tooltip={tooltip}\n width={width}\n text={text}\n onRefresh={model.onRefresh}\n primary={primary}\n onIntervalChanged={model.onIntervalChanged}\n isLoading={isRunning}\n isOnCanvas={isOnCanvas ?? true}\n />\n );\n}\n\nfunction useQueryControllerState(model: SceneObject): boolean {\n const queryController = sceneGraph.getQueryController(model);\n if (!queryController) {\n return false;\n }\n\n return queryController.useState().isRunning;\n}\n\nfunction isIntervalString(str: string): boolean {\n try {\n const res = rangeUtil.describeInterval(str);\n return res.count > 0;\n } catch {\n return false;\n }\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWa,MAAA,iBAAA,GAAoB,CAAC,IAAA,EAAM,KAAO,EAAA,KAAA,EAAO,IAAM,EAAA,IAAA,EAAM,KAAO,EAAA,KAAA,EAAO,IAAM,EA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EA,SAAS,iBAAiB,GAAsB,EAAA;AAC9C,EAAI,IAAA;AACF,IAAM,MAAA,GAAA,GAAM,SAAU,CAAA,gBAAA,CAAiB,GAAG,CAAA,CAAA;AAC1C,IAAA,OAAO,IAAI,KAAQ,GAAA,CAAA,CAAA;AAAA,WACb,CAAN,EAAA;AACA,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AACF;;;;"}
|
1
|
+
{"version":3,"file":"SceneRefreshPicker.js","sources":["../../../src/components/SceneRefreshPicker.tsx"],"sourcesContent":["import React from 'react';\nimport { Unsubscribable } from 'rxjs';\nimport { rangeUtil } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { RefreshPicker } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObject, SceneObjectState, SceneObjectUrlValues } from '../core/types';\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\n\nexport const DEFAULT_INTERVALS = ['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'];\n\nexport interface SceneRefreshPickerState extends SceneObjectState {\n /**\n * Refresh interval, e.g. 5s, 1m, 2h\n */\n refresh: string;\n autoEnabled?: boolean;\n autoMinInterval?: string;\n autoValue?: string;\n /**\n * List of allowed refresh intervals, e.g. ['5s', '1m']\n */\n intervals?: string[];\n isOnCanvas?: boolean;\n primary?: boolean;\n withText?: boolean;\n /**\n * Overrides the default minRefreshInterval from the grafana config. Can be set to \"0s\" to remove the minimum refresh interval.\n */\n minRefreshInterval?: string;\n}\n\nexport class SceneRefreshPicker extends SceneObjectBase<SceneRefreshPickerState> {\n public static Component = SceneRefreshPickerRenderer;\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['refresh'] });\n private _intervalTimer: ReturnType<typeof setInterval> | undefined;\n private _autoTimeRangeListener: Unsubscribable | undefined;\n private _autoRefreshBlocked: boolean = false;\n\n public constructor(state: Partial<SceneRefreshPickerState>) {\n const filterDissalowedIntervals = (i: string) => {\n const minInterval = state.minRefreshInterval ?? config.minRefreshInterval;\n try {\n return minInterval ? rangeUtil.intervalToMs(i) >= rangeUtil.intervalToMs(minInterval) : true;\n } catch (e) {\n // Unable to parse interval\n return false;\n }\n };\n\n super({\n refresh: '',\n ...state,\n autoValue: undefined,\n autoEnabled: state.autoEnabled ?? true,\n autoMinInterval: state.autoMinInterval ?? config.minRefreshInterval,\n intervals: (state.intervals ?? DEFAULT_INTERVALS).filter(filterDissalowedIntervals),\n });\n\n this.addActivationHandler(() => {\n this.setupIntervalTimer();\n\n const onVisibilityChange = () => {\n if (this._autoRefreshBlocked && document.visibilityState === 'visible') {\n this._autoRefreshBlocked = false;\n this.onRefresh();\n }\n };\n\n document.addEventListener('visibilitychange', onVisibilityChange);\n\n return () => {\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n document.removeEventListener('visibilitychange', onVisibilityChange);\n this._autoTimeRangeListener?.unsubscribe();\n };\n });\n }\n\n public onRefresh = () => {\n const queryController = sceneGraph.getQueryController(this);\n if (queryController?.state.isRunning) {\n queryController.cancelAll();\n return;\n }\n\n const timeRange = sceneGraph.getTimeRange(this);\n\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n timeRange.onRefresh();\n this.setupIntervalTimer();\n };\n\n public onIntervalChanged = (interval: string) => {\n this.setState({ refresh: interval });\n this.setupIntervalTimer();\n };\n\n public getUrlState() {\n let refresh: string | undefined = this.state.refresh;\n\n if (typeof refresh !== 'string' || refresh.length === 0) {\n refresh = undefined;\n }\n\n return { refresh };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const { intervals } = this.state;\n let refresh = values.refresh;\n\n if (typeof refresh === 'string' && isIntervalString(refresh)) {\n if (intervals?.includes(refresh)) {\n this.setState({ refresh });\n } else {\n this.setState({\n // Default to the first refresh interval if the interval from the URL is not allowed, just like in the old architecture.\n refresh: intervals ? intervals[0] : undefined,\n });\n }\n }\n }\n\n private setupAutoTimeRangeListener = () => {\n // If the time range has changed, we need to recalculate the auto interval but prevent unnecessary processing\n return sceneGraph.getTimeRange(this).subscribeToState((newState, prevState) => {\n if (newState.from !== prevState.from || newState.to !== prevState.to) {\n this.setupIntervalTimer();\n }\n });\n };\n\n private calculateAutoRefreshInterval = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const resolution = window?.innerWidth ?? 2000;\n return rangeUtil.calculateInterval(timeRange.state.value, resolution, this.state.autoMinInterval);\n };\n\n private isTabVisible() {\n return document.visibilityState === undefined || document.visibilityState === 'visible';\n }\n\n private setupIntervalTimer = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const { refresh, intervals } = this.state;\n\n if (this._intervalTimer || refresh === '') {\n clearInterval(this._intervalTimer);\n }\n\n if (refresh === '') {\n return;\n }\n\n // If the provided interval is not allowed\n if (refresh !== RefreshPicker.autoOption.value && intervals && !intervals.includes(refresh)) {\n return;\n }\n\n let intervalMs: number;\n\n // Unsubscribe from previous listener no matter what\n this._autoTimeRangeListener?.unsubscribe();\n\n if (refresh === RefreshPicker.autoOption.value) {\n const autoRefreshInterval = this.calculateAutoRefreshInterval();\n\n intervalMs = autoRefreshInterval.intervalMs;\n\n this._autoTimeRangeListener = this.setupAutoTimeRangeListener();\n\n if (autoRefreshInterval.interval !== this.state.autoValue) {\n this.setState({ autoValue: autoRefreshInterval.interval });\n }\n } else {\n intervalMs = rangeUtil.intervalToMs(refresh);\n }\n\n this._intervalTimer = setInterval(() => {\n if (this.isTabVisible()) {\n timeRange.onRefresh();\n } else {\n this._autoRefreshBlocked = true;\n }\n }, intervalMs);\n };\n}\n\nexport function SceneRefreshPickerRenderer({ model }: SceneComponentProps<SceneRefreshPicker>) {\n const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();\n const isRunning = useQueryControllerState(model);\n\n let text = refresh === RefreshPicker.autoOption?.value ? autoValue : withText ? 'Refresh' : undefined;\n let tooltip: string | undefined;\n let width: string | undefined;\n\n if (isRunning) {\n tooltip = 'Cancel all queries';\n\n if (withText) {\n text = 'Cancel';\n }\n }\n\n if (withText) {\n width = '96px';\n }\n\n return (\n <RefreshPicker\n showAutoInterval={autoEnabled}\n value={refresh}\n intervals={intervals}\n tooltip={tooltip}\n width={width}\n text={text}\n onRefresh={model.onRefresh}\n primary={primary}\n onIntervalChanged={model.onIntervalChanged}\n isLoading={isRunning}\n isOnCanvas={isOnCanvas ?? true}\n />\n );\n}\n\nfunction useQueryControllerState(model: SceneObject): boolean {\n const queryController = sceneGraph.getQueryController(model);\n if (!queryController) {\n return false;\n }\n\n return queryController.useState().isRunning;\n}\n\nfunction isIntervalString(str: string): boolean {\n try {\n const res = rangeUtil.describeInterval(str);\n return res.count > 0;\n } catch {\n return false;\n }\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWa,MAAA,iBAAA,GAAoB,CAAC,IAAA,EAAM,KAAO,EAAA,KAAA,EAAO,IAAM,EAAA,IAAA,EAAM,KAAO,EAAA,KAAA,EAAO,IAAM,EAAA,IAAA,EAAM,IAAI,EAAA;AAuBzF,MAAM,2BAA2B,eAAyC,CAAA;AAAA,EAOxE,YAAY,KAAyC,EAAA;AAzC9D,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AA0CI,IAAM,MAAA,yBAAA,GAA4B,CAAC,CAAc,KAAA;AA1CrD,MAAAA,IAAAA,GAAAA,CAAAA;AA2CM,MAAA,MAAM,eAAcA,GAAA,GAAA,KAAA,CAAM,kBAAN,KAAA,IAAA,GAAAA,MAA4B,MAAO,CAAA,kBAAA,CAAA;AACvD,MAAI,IAAA;AACF,QAAO,OAAA,WAAA,GAAc,UAAU,YAAa,CAAA,CAAC,KAAK,SAAU,CAAA,YAAA,CAAa,WAAW,CAAI,GAAA,IAAA,CAAA;AAAA,eACjF,CAAP,EAAA;AAEA,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACF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T;AAAA,GACF;AAEA,EAAA,IAAI,QAAU,EAAA;AACZ,IAAQ,KAAA,GAAA,MAAA,CAAA;AAAA,GACV;AAEA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,gBAAkB,EAAA,WAAA;AAAA,IAClB,KAAO,EAAA,OAAA;AAAA,IACP,SAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,WAAW,KAAM,CAAA,SAAA;AAAA,IACjB,OAAA;AAAA,IACA,mBAAmB,KAAM,CAAA,iBAAA;AAAA,IACzB,SAAW,EAAA,SAAA;AAAA,IACX,YAAY,UAAc,IAAA,IAAA,GAAA,UAAA,GAAA,IAAA;AAAA,GAC5B,CAAA,CAAA;AAEJ,CAAA;AAEA,SAAS,wBAAwB,KAA6B,EAAA;AAC5D,EAAM,MAAA,eAAA,GAAkB,UAAW,CAAA,kBAAA,CAAmB,KAAK,CAAA,CAAA;AAC3D,EAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,eAAA,CAAgB,UAAW,CAAA,SAAA,CAAA;AACpC,CAAA;AAEA,SAAS,iBAAiB,GAAsB,EAAA;AAC9C,EAAI,IAAA;AACF,IAAM,MAAA,GAAA,GAAM,SAAU,CAAA,gBAAA,CAAiB,GAAG,CAAA,CAAA;AAC1C,IAAA,OAAO,IAAI,KAAQ,GAAA,CAAA,CAAA;AAAA,WACb,CAAN,EAAA;AACA,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AACF;;;;"}
|
package/dist/index.js
CHANGED
@@ -10769,7 +10769,11 @@ class SceneRefreshPicker extends SceneObjectBase {
|
|
10769
10769
|
const filterDissalowedIntervals = (i) => {
|
10770
10770
|
var _a2;
|
10771
10771
|
const minInterval = (_a2 = state.minRefreshInterval) != null ? _a2 : runtime.config.minRefreshInterval;
|
10772
|
-
|
10772
|
+
try {
|
10773
|
+
return minInterval ? data.rangeUtil.intervalToMs(i) >= data.rangeUtil.intervalToMs(minInterval) : true;
|
10774
|
+
} catch (e) {
|
10775
|
+
return false;
|
10776
|
+
}
|
10773
10777
|
};
|
10774
10778
|
super(__spreadProps$3(__spreadValues$6({
|
10775
10779
|
refresh: ""
|