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

use correct logic for frontend package feature flag
This commit is contained in:
Brendan O'Handley 2024-03-27 11:57:00 -05:00 committed by GitHub
parent f850b00a92
commit d4a68d6662
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)