Skip to content

Commit 7340c74

Browse files
authored
refactor: rename networkViewEnabled to prometheusAPIAvailable (#9330)
https://linear.app/unleash/issue/2-3290/rename-networkviewenabled-to-prometheusapiavailable Follow-up to: #9325 See: #9325 (comment) Renames `networkViewEnabled` to `prometheusAPIAvailable`. This new name better reflects what it stands for.
1 parent e095411 commit 7340c74

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

frontend/src/component/admin/network/NetworkPrometheusAPIWarning.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
22

33
export const NetworkPrometheusAPIWarning = () => {
44
const {
5-
uiConfig: { networkViewEnabled },
5+
uiConfig: { prometheusAPIAvailable },
66
} = useUiConfig();
77

8-
if (networkViewEnabled) return null;
8+
if (prometheusAPIAvailable) return null;
99

1010
return (
1111
<p>

frontend/src/hooks/api/getters/useInstanceMetrics/useInstanceMetrics.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export const useInstanceMetrics = (
2020
options: SWRConfiguration = {},
2121
): IInstanceMetricsResponse => {
2222
const {
23-
uiConfig: { networkViewEnabled },
23+
uiConfig: { prometheusAPIAvailable },
2424
} = useUiConfig();
2525

2626
const { data, error, mutate } = useConditionalSWR(
27-
networkViewEnabled,
27+
prometheusAPIAvailable,
2828
{},
2929
formatApiPath(`api/admin/metrics/rps`),
3030
fetcher,

frontend/src/hooks/api/getters/useUiConfig/defaultValue.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const defaultValue: IUiConfig = {
2727
title: 'Source code on GitHub',
2828
},
2929
],
30-
networkViewEnabled: false,
30+
prometheusAPIAvailable: false,
3131
resourceLimits: {
3232
segmentValues: 1000,
3333
strategySegments: 5,

frontend/src/interfaces/uiConfig.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface IUiConfig {
2424
links: ILinks[];
2525
disablePasswordAuth?: boolean;
2626
emailEnabled?: boolean;
27-
networkViewEnabled: boolean;
27+
prometheusAPIAvailable: boolean;
2828
maintenanceMode?: boolean;
2929
toast?: IProclamationToast;
3030
segmentValuesLimit?: number;

src/lib/openapi/spec/ui-config-schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const uiConfigSchema = {
9999
),
100100
},
101101
},
102-
networkViewEnabled: {
102+
prometheusAPIAvailable: {
103103
type: 'boolean',
104104
description: 'Whether a Prometheus API is available.',
105105
example: true,

src/lib/routes/admin-api/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class ConfigController extends Controller {
186186
strategySegmentsLimit: this.config.resourceLimits.strategySegments,
187187
frontendApiOrigins: frontendSettings.frontendApiOrigins,
188188
versionInfo: await this.versionService.getVersionInfo(),
189-
networkViewEnabled: this.config.prometheusApi !== undefined,
189+
prometheusAPIAvailable: this.config.prometheusApi !== undefined,
190190
resourceLimits: this.config.resourceLimits,
191191
disablePasswordAuth,
192192
maintenanceMode,

0 commit comments

Comments
 (0)