Runtime: make sure we don't lose nested default config values (#23560)

* Fixed so we dont miss the deep default options.

* removed console log.

* remove check of feature toggle and assuming that the new variables are the default ones.

* removed e2e statement about used featuretoggles.
This commit is contained in:
Marcus Andersson 2020-04-15 10:54:52 +02:00 committed by GitHub
parent ab8305fcb9
commit ab98a8be3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 23 deletions

View File

@ -24,12 +24,8 @@ const assertDefaultsForNewVariable = () => {
e2e()
.window()
.then((win: any) => {
let chainer = 'not.exist';
let value: string = undefined;
if (win.grafanaBootData.settings.featureToggles.newVariables) {
chainer = 'have.text';
value = '';
}
const chainer = 'have.text';
const value = '';
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsDataSourceSelect().within(select => {
e2e()
@ -85,10 +81,8 @@ const createQueryVariable = ({ name, label, dataSourceName, query }: CreateQuery
e2e()
.window()
.then((win: any) => {
let text = `string:${dataSourceName}`;
if (win.grafanaBootData.settings.featureToggles.newVariables) {
text = `${dataSourceName}`;
}
const text = `${dataSourceName}`;
e2e.pages.Dashboard.Settings.Variables.Edit.QueryVariable.queryOptionsDataSourceSelect()
.select(text)
.blur();
@ -352,11 +346,7 @@ const assertUpdateItem = (data: QueryVariableData[]) => {
e2e()
.window()
.then((win: any) => {
if (win.grafanaBootData.settings.featureToggles.newVariables) {
queryVariables[1].selectedOption = 'A constant';
} else {
queryVariables[1].selectedOption = 'undefined';
}
queryVariables[1].selectedOption = 'A constant';
assertVariableLabelAndComponent(queryVariables[1]);
});
@ -627,11 +617,5 @@ e2e.scenario({
// assert that move up works
assertMoveUpItem(queryVariables);
e2e()
.window()
.then((win: any) => {
logSection('This scenario ran with these featureToggles', win.grafanaBootData.settings.featureToggles);
});
},
});

View File

@ -1,4 +1,4 @@
import extend from 'lodash/extend';
import merge from 'lodash/merge';
import { getTheme } from '@grafana/ui';
import { DataSourceInstanceSettings, GrafanaTheme, GrafanaThemeType, PanelPluginMeta } from '@grafana/data';
@ -128,7 +128,7 @@ export class GrafanaBootConfig {
disableSanitizeHtml: false,
};
extend(this, defaults, options);
merge(this, defaults, options);
}
}