DashboardScene: Do not hide variables on save (#81501)

pull/81545/head
Dominik Prokop 2 years ago committed by GitHub
parent f77c831e3f
commit 9982830bd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      public/app/features/dashboard-scene/serialization/__snapshots__/transformSceneToSaveModel.test.ts.snap
  2. 1
      public/app/features/dashboard-scene/serialization/sceneVariablesSetToVariables.test.ts
  3. 3
      public/app/features/dashboard-scene/serialization/sceneVariablesSetToVariables.ts

@ -494,7 +494,6 @@ exports[`transformSceneToSaveModel Given a simple scene with custom settings Sho
"text": "1m", "text": "1m",
"value": "1m", "value": "1m",
}, },
"hide": 2,
"name": "intervalVar", "name": "intervalVar",
"query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2, "refresh": 2,
@ -812,7 +811,6 @@ exports[`transformSceneToSaveModel Given a simple scene with variables Should tr
"text": "1m", "text": "1m",
"value": "1m", "value": "1m",
}, },
"hide": 2,
"name": "intervalVar", "name": "intervalVar",
"query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2, "refresh": 2,

@ -336,7 +336,6 @@ describe('sceneVariablesSetToVariables', () => {
"value": "text value", "value": "text value",
}, },
"description": "test-desc", "description": "test-desc",
"hide": 2,
"label": "test-label", "label": "test-label",
"name": "test", "name": "test",
"query": "text value", "query": "text value",

@ -34,7 +34,6 @@ export function sceneVariablesSetToVariables(set: SceneVariables) {
includeAll: variable.state.includeAll, includeAll: variable.state.includeAll,
multi: variable.state.isMulti, multi: variable.state.isMulti,
skipUrlSync: variable.state.skipUrlSync, skipUrlSync: variable.state.skipUrlSync,
hide: variable.state.hide || VariableHide.dontHide,
}); });
} else if (sceneUtils.isCustomVariable(variable)) { } else if (sceneUtils.isCustomVariable(variable)) {
variables.push({ variables.push({
@ -90,7 +89,6 @@ export function sceneVariablesSetToVariables(set: SceneVariables) {
value: variable.state.value, value: variable.state.value,
}, },
query: intervals, query: intervals,
hide: VariableHide.hideVariable,
refresh: variable.state.refresh, refresh: variable.state.refresh,
// @ts-expect-error ?? how to fix this without adding the ts-expect-error // @ts-expect-error ?? how to fix this without adding the ts-expect-error
auto: variable.state.autoEnabled, auto: variable.state.autoEnabled,
@ -105,7 +103,6 @@ export function sceneVariablesSetToVariables(set: SceneVariables) {
value: variable.state.value, value: variable.state.value,
}, },
query: variable.state.value, query: variable.state.value,
hide: VariableHide.hideVariable,
}); });
} else { } else {
throw new Error('Unsupported variable type'); throw new Error('Unsupported variable type');

Loading…
Cancel
Save