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",
"value": "1m",
},
"hide": 2,
"name": "intervalVar",
"query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2,
@ -812,7 +811,6 @@ exports[`transformSceneToSaveModel Given a simple scene with variables Should tr
"text": "1m",
"value": "1m",
},
"hide": 2,
"name": "intervalVar",
"query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2,

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

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

Loading…
Cancel
Save