mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 01:42:12 +08:00
Dashboards: Use string for AnnoKeyDashboardIsSnapshot
(#105306)
This commit is contained in:
@ -97,7 +97,7 @@ type GrafanaClientAnnotations = {
|
||||
[AnnoKeyFolderTitle]?: string;
|
||||
[AnnoKeyFolderUrl]?: string;
|
||||
[AnnoKeySavedFromUI]?: string;
|
||||
[AnnoKeyDashboardIsSnapshot]?: boolean;
|
||||
[AnnoKeyDashboardIsSnapshot]?: string;
|
||||
[AnnoKeyDashboardSnapshotOriginalUrl]?: string;
|
||||
[AnnoKeyGrantPermissions]?: string;
|
||||
// TODO: This should be provided by the API
|
||||
|
@ -30,6 +30,7 @@ import {
|
||||
QueryVariableKind,
|
||||
TextVariableKind,
|
||||
} from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen';
|
||||
import { AnnoKeyDashboardIsSnapshot } from 'app/features/apiserver/types';
|
||||
import { DashboardWithAccessInfo } from 'app/features/dashboard/api/types';
|
||||
import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource';
|
||||
|
||||
@ -367,7 +368,7 @@ describe('transformSaveModelSchemaV2ToScene', () => {
|
||||
...defaultDashboard.metadata,
|
||||
annotations: {
|
||||
...defaultDashboard.metadata.annotations,
|
||||
'grafana.app/dashboard-is-snapshot': true,
|
||||
[AnnoKeyDashboardIsSnapshot]: 'true',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -131,9 +131,15 @@ export function ensureV2Response(
|
||||
[AnnoKeyUpdatedTimestamp]: dto.meta.updated,
|
||||
[AnnoKeyFolder]: dto.meta.folderUid,
|
||||
[AnnoKeySlug]: dto.meta.slug,
|
||||
[AnnoKeyDashboardGnetId]: dashboard.gnetId ?? undefined,
|
||||
[AnnoKeyDashboardIsSnapshot]: dto.meta.isSnapshot,
|
||||
};
|
||||
if (dashboard.gnetId) {
|
||||
annotationsMeta[AnnoKeyDashboardGnetId] = dashboard.gnetId;
|
||||
}
|
||||
if (dto.meta.isSnapshot) {
|
||||
// FIXME -- lets not put non-annotation data in annotations!
|
||||
annotationsMeta[AnnoKeyDashboardIsSnapshot] = 'true';
|
||||
}
|
||||
|
||||
creationTimestamp = dto.meta.created;
|
||||
labelsMeta = {
|
||||
[DeprecatedInternalId]: dashboard.id?.toString() ?? undefined,
|
||||
|
Reference in New Issue
Block a user