StatPanels: Fixed possible migration issue (#21681)

pull/21715/head
Torkel Ödegaard 6 years ago committed by GitHub
parent b3d5e678f4
commit 8266959681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.ts

@ -151,11 +151,10 @@ export function sharedSingleStatMigrationHandler(panel: PanelModel<SingleStatBas
// Migrate color from simple string to a mode // Migrate color from simple string to a mode
const { defaults } = fieldOptions; const { defaults } = fieldOptions;
if (defaults.color) { if (defaults.color && typeof defaults.color === 'string') {
const old = defaults.color;
defaults.color = { defaults.color = {
mode: FieldColorMode.Fixed, mode: FieldColorMode.Fixed,
fixedColor: old, fixedColor: defaults.color,
}; };
} }

Loading…
Cancel
Save