mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
FeatureToggles: remove open type declaration (#64645)
This commit is contained in:
parent
85e5326040
commit
6751a93d49
@ -767,7 +767,8 @@ exports[`better eslint`] = {
|
||||
"packages/grafana-runtime/src/config.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"packages/grafana-runtime/src/services/AngularLoader.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
@ -9,13 +9,15 @@
|
||||
* conf/custom.ini to enable features under development or not yet available in
|
||||
* stable version.
|
||||
*
|
||||
* Only enabled values will be returned in this interface
|
||||
* Only enabled values will be returned in this interface.
|
||||
*
|
||||
* NOTE: the possible values may change between versions without notice, although
|
||||
* this may cause compilation issues when depending on removed feature keys, the
|
||||
* runtime state will continue to work.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface FeatureToggles {
|
||||
[name: string]: boolean | undefined; // support any string value
|
||||
|
||||
alertingBigTransactions?: boolean;
|
||||
trimDefaults?: boolean;
|
||||
disableEnvelopeEncryption?: boolean;
|
||||
|
@ -230,10 +230,11 @@ function overrideFeatureTogglesFromUrl(config: GrafanaBootConfig) {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.forEach((value, key) => {
|
||||
if (key.startsWith('__feature.')) {
|
||||
const featureToggles = config.featureToggles as Record<string, boolean>;
|
||||
const featureName = key.substring(10);
|
||||
const toggleState = value === 'true';
|
||||
if (toggleState !== config.featureToggles[key]) {
|
||||
config.featureToggles[featureName] = toggleState;
|
||||
if (toggleState !== featureToggles[key]) {
|
||||
featureToggles[featureName] = toggleState;
|
||||
console.log(`Setting feature toggle ${featureName} = ${toggleState}`);
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,5 @@ const (
|
||||
hostedGrafanaTeam codeowner = "@grafana/hosted-grafana-team"
|
||||
awsPluginsSquad codeowner = "@grafana/aws-plugins"
|
||||
appO11ySquad codeowner = "@grafana/app-o11y"
|
||||
grafanaPartnerPluginsSquad codeowner = "@grafana/partner-plugins"
|
||||
)
|
||||
|
@ -128,13 +128,15 @@ func generateTypeScript() string {
|
||||
* conf/custom.ini to enable features under development or not yet available in
|
||||
* stable version.
|
||||
*
|
||||
* Only enabled values will be returned in this interface
|
||||
* Only enabled values will be returned in this interface.
|
||||
*
|
||||
* NOTE: the possible values may change between versions without notice, although
|
||||
* this may cause compilation issues when depending on removed feature keys, the
|
||||
* runtime state will continue to work.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface FeatureToggles {
|
||||
[name: string]: boolean | undefined; // support any string value
|
||||
|
||||
`
|
||||
for _, flag := range standardFeatureFlags {
|
||||
buf += " " + getTypeScriptKey(flag.Name) + "?: boolean;\n"
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
import { isGUIDish } from './components/ResourcePicker/utils';
|
||||
import DataSource from './datasource';
|
||||
import { AzureMonitorQuery, AzureQueryType } from './types';
|
||||
@ -321,10 +319,7 @@ export const migrateQuery = async (
|
||||
): Promise<AzureMonitorQuery> => {
|
||||
let query = await migrateStringQueriesToObjectQueries(rawQuery, options);
|
||||
|
||||
if (
|
||||
!config.featureToggles.azLegacyTemplateVariables &&
|
||||
query.queryType === AzureQueryType.GrafanaTemplateVariableFn
|
||||
) {
|
||||
if (query.queryType === AzureQueryType.GrafanaTemplateVariableFn) {
|
||||
query = migrateGrafanaTemplateVariableFn(query);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user