Prometheus: Use correct logic for frontend package feature flag (#85294)

use correct logic for frontend package feature flag
pull/85300/head
Brendan O'Handley 1 year ago committed by GitHub
parent f850b00a92
commit d4a68d6662
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      public/app/plugins/datasource/prometheus/module.ts

@ -14,10 +14,10 @@ import { PrometheusDatasource } from './datasource';
const usePackage = config.featureToggles.usePrometheusFrontendPackage;
const PrometheusDataSourceUsed = usePackage ? PrometheusDatasource : PrometheusDatasourcePackage;
const PromQueryEditorByAppUsed = usePackage ? PromQueryEditorByApp : PromQueryEditorByAppPackage;
const ConfigEditorUsed = usePackage ? ConfigEditor : ConfigEditorPackage;
const PromCheatSheetUsed = usePackage ? PromCheatSheet : PromCheatSheetPackage;
const PrometheusDataSourceUsed = usePackage ? PrometheusDatasourcePackage : PrometheusDatasource;
const PromQueryEditorByAppUsed = usePackage ? PromQueryEditorByAppPackage : PromQueryEditorByApp;
const ConfigEditorUsed = usePackage ? ConfigEditorPackage : ConfigEditor;
const PromCheatSheetUsed = usePackage ? PromCheatSheetPackage : PromCheatSheet;
// @ts-ignore These type errors will be removed when we fully migrate to the @grafana/prometheus package
export const plugin = new DataSourcePlugin(PrometheusDataSourceUsed)

Loading…
Cancel
Save