coremodels: Include nested optional fields in output (#53355)

This commit is contained in:
sam boyer 2022-08-08 17:48:21 -04:00 committed by GitHub
parent a8666370be
commit e6903582d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 7 deletions

2
go.mod
View File

@ -51,7 +51,7 @@ require (
github.com/google/wire v0.5.0
github.com/gorilla/websocket v1.4.2
github.com/gosimple/slug v1.12.0
github.com/grafana/cuetsy v0.0.3
github.com/grafana/cuetsy v0.0.4-0.20220714174355-ebd987fdab27
github.com/grafana/grafana-aws-sdk v0.10.8
github.com/grafana/grafana-azure-sdk-go v1.3.0
github.com/grafana/grafana-plugin-sdk-go v0.139.0

4
go.sum
View File

@ -1324,8 +1324,8 @@ github.com/gosimple/slug v1.12.0 h1:xzuhj7G7cGtd34NXnW/yF0l+AGNfWqwgh/IXgFy7dnc=
github.com/gosimple/slug v1.12.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ=
github.com/gosimple/unidecode v1.0.1 h1:hZzFTMMqSswvf0LBJZCZgThIZrpDHFXux9KeGmn6T/o=
github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc=
github.com/grafana/cuetsy v0.0.3 h1:jQLkHOpfDjZiTXknv35iCOTFFK504lgsUapKuOnnNy4=
github.com/grafana/cuetsy v0.0.3/go.mod h1:7OoEYb42s7PbSYtNUTy1DoCeJ3LAOTafsZbndvikTj8=
github.com/grafana/cuetsy v0.0.4-0.20220714174355-ebd987fdab27 h1:r0ZSb0gSKEf1hmdYljn7ezOPJyfrC0qcky576U82yEk=
github.com/grafana/cuetsy v0.0.4-0.20220714174355-ebd987fdab27/go.mod h1:7OoEYb42s7PbSYtNUTy1DoCeJ3LAOTafsZbndvikTj8=
github.com/grafana/dskit v0.0.0-20211011144203-3a88ec0b675f h1:FvvSVEbnGeM2bUivGmsiXTi8URJyBU7TcFEEoRe5wWI=
github.com/grafana/dskit v0.0.0-20211011144203-3a88ec0b675f/go.mod h1:uPG2nyK4CtgNDmWv7qyzYcdI+S90kHHRWvHnBtEMBXM=
github.com/grafana/go-mssqldb v0.0.0-20210326084033-d0ce3c521036 h1:GplhUk6Xes5JIhUUrggPcPBhOn+eT8+WsHiebvq7GgA=

View File

@ -10,7 +10,10 @@
interface AnnotationQuery {
builtIn: number;
datasource: {};
datasource: {
type?: string;
uid?: string;
};
enable: boolean;
hide?: boolean;
iconColor?: string;
@ -125,16 +128,38 @@ enum DashboardCursorSync {
const defaultDashboardCursorSync: DashboardCursorSync = DashboardCursorSync.Off;
interface Panel {
datasource?: {};
datasource?: {
type?: string;
uid?: string;
};
description?: string;
fieldConfig: {
defaults: {};
defaults: {
displayName?: string;
displayNameFromDS?: string;
description?: string;
path?: string;
writeable?: boolean;
filterable?: boolean;
unit?: string;
decimals?: number;
min?: number;
max?: number;
mappings?: {}[];
thresholds?: ThresholdsConfig;
color?: FieldColor;
links?: any[];
noValue?: string;
custom?: {};
};
overrides: {
matcher: {
id: string;
options?: any;
};
properties: {
id: string;
value?: any;
}[];
}[];
};
@ -172,7 +197,10 @@ const defaultPanel: Partial<Panel> = {
interface RowPanel {
collapsed: boolean;
datasource?: {};
datasource?: {
type?: string;
uid?: string;
};
gridPos?: GridPos;
id: number;
panels: (Panel | {