Theme: Move displayProcessor & fieldOverrides & visualizations to use new theme model (#33502)

* WIP updating getColorForTheme

* Progress

* More fixes

* Updating more parts

* Fixing unit tests

* Fixing more tests

* Fixing storybook issues

* More refactoring

* Fixed test
This commit is contained in:
Torkel Ödegaard
2021-04-29 12:44:06 +02:00
committed by GitHub
parent 0836e7bde8
commit 017bcc73ba
78 changed files with 1268 additions and 1285 deletions
+6 -2
View File
@@ -1,11 +1,12 @@
import { merge } from 'lodash';
import { getTheme } from '@grafana/ui';
import {
BuildInfo,
createTheme,
DataSourceInstanceSettings,
FeatureToggles,
GrafanaConfig,
GrafanaTheme,
GrafanaThemeV2,
LicenseInfo,
PanelPluginMeta,
systemDateFormats,
@@ -49,6 +50,7 @@ export class GrafanaBootConfig implements GrafanaConfig {
editorsCanAdmin = false;
disableSanitizeHtml = false;
theme: GrafanaTheme;
theme2: GrafanaThemeV2;
pluginsToPreload: string[] = [];
featureToggles: FeatureToggles = {
live: false,
@@ -75,7 +77,9 @@ export class GrafanaBootConfig implements GrafanaConfig {
awsAssumeRoleEnabled = false;
constructor(options: GrafanaBootConfig) {
this.theme = getTheme(options.bootData.user.lightTheme ? 'light' : 'dark');
const mode = options.bootData.user.lightTheme ? 'light' : 'dark';
this.theme2 = createTheme({ colors: { mode } });
this.theme = this.theme2.v1;
const defaults = {
datasources: {},