Skip to content

Commit 076068e

Browse files
committed
StatsHouse UI: update metric visible param deprecated
1 parent 08ab0c0 commit 076068e

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

statshouse-ui/public/openapi/openapi.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,8 @@
773773
"type": "string"
774774
},
775775
"raw": {
776-
"type": "boolean"
776+
"type": "boolean",
777+
"deprecated": true
777778
},
778779
"raw_kind": {
779780
"$ref": "#/components/schemas/MetricMetaTagRawKind"
@@ -815,7 +816,8 @@
815816
}
816817
},
817818
"visible": {
818-
"type": "boolean"
819+
"type": "boolean",
820+
"deprecated": true
819821
},
820822
"disable": {
821823
"type": "boolean"

statshouse-ui/src/admin/models/metric.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export interface IMetric extends IShortMetric {
4444
readonly stringTopDescription: string;
4545
readonly weight: number;
4646
readonly resolution: number;
47+
/**
48+
* @deprecated
49+
*/
4750
readonly visible: boolean;
4851
readonly disable: boolean;
4952
readonly pre_key_tag_id?: string;
@@ -69,6 +72,9 @@ export interface IBackendMetric {
6972
readonly string_top_description?: string;
7073
readonly weight?: number;
7174
readonly resolution?: number;
75+
/**
76+
* @deprecated
77+
*/
7278
readonly visible?: boolean;
7379
readonly disable?: boolean;
7480
readonly pre_key_tag_id?: string;

statshouse-ui/src/admin/pages/FormPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ export function EditForm(props: { isReadonly: boolean; adminMode: boolean; isHis
458458
name="visible"
459459
type="checkbox"
460460
className="form-check-input"
461-
checked={values.visible}
461+
checked={!values.disable}
462462
onChange={(e) => dispatch({ visible: e.target.checked, disable: !e.target.checked })}
463463
disabled={isReadonly}
464464
/>

statshouse-ui/src/api/metric.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export type MetricMetaValue = {
4242
update_time: number;
4343
description?: string;
4444
tags?: MetricMetaTag[];
45+
/**
46+
* @deprecated
47+
*/
4548
visible?: boolean;
4649
disable?: boolean;
4750
kind: MetricMetaKind;

0 commit comments

Comments
 (0)