Chore: deprecate/remove folderId from more typescript (#81194)

This commit is contained in:
Ryan McKinley
2024-02-02 08:42:43 -08:00
committed by GitHub
parent 5d7ed2319f
commit ed925c81d4
7 changed files with 10 additions and 11 deletions

View File

@@ -153,7 +153,7 @@ const dashboard = {
},
meta: {
canSave: true,
folderId: 1,
folderUid: 'abc',
folderTitle: 'super folder',
},
} as DashboardModel;

View File

@@ -13,6 +13,10 @@ exports[`PanelAlertTabContent Will render alerts belonging to panel and a button
},
],
"condition": "C",
"folder": {
"title": "super folder",
"uid": "abc",
},
"name": "mypanel",
"queries": [
{

View File

@@ -35,7 +35,7 @@ const setupTestContext = (options: Partial<Props>) => {
timezone: 'utc',
},
{
folderId: 1,
folderUid: 'abc',
folderTitle: 'test',
}
),

View File

@@ -18,8 +18,6 @@ export interface SaveDashboardOptions {
dashboard: DashboardModel;
/** Set a commit message for the version history. */
message?: string;
/** The id of the folder to save the dashboard in. */
folderId?: number;
/** The UID of the folder to save the dashboard in. Overrides `folderId`. */
folderUid?: string;
/** Set to `true` if you want to overwrite existing dashboard with newer version,

View File

@@ -17,9 +17,7 @@ interface APIQuery {
limit?: number;
page?: number;
type?: DashboardSearchItemType;
// DashboardIds []int64
dashboardUID?: string[];
folderIds?: number[];
folderUIDs?: string[];
sort?: string;
starred?: boolean;
@@ -27,7 +25,7 @@ interface APIQuery {
// Internal object to hold folderId
interface LocationInfoEXT extends LocationInfo {
folderId?: number;
folderUid?: string;
}
export class SQLSearcher implements GrafanaSearcher {
@@ -36,7 +34,6 @@ export class SQLSearcher implements GrafanaSearcher {
kind: 'folder',
name: 'General',
url: '/dashboards',
folderId: 0,
},
}; // share location info with everyone
@@ -182,14 +179,14 @@ export class SQLSearcher implements GrafanaSearcher {
kind: 'folder',
name: hit.folderTitle,
url: hit.folderUrl!,
folderId: hit.folderId,
folderUid: hit.folderUid,
};
} else if (k === 'folder') {
this.locationInfo[hit.uid] = {
kind: k,
name: hit.title!,
url: hit.url,
folderId: hit.id,
folderUid: hit.folderUid,
};
}
}

View File

@@ -17,6 +17,7 @@ export enum DashboardSearchItemType {
* extraneous properties
*/
export interface DashboardSearchHit extends WithAccessControlMetadata {
/** @deprecated use folderUid */
folderId?: number;
folderTitle?: string;
folderUid?: string;

View File

@@ -27,7 +27,6 @@ export interface DashboardMeta {
canStar?: boolean;
canAdmin?: boolean;
url?: string;
folderId?: number;
folderUid?: string;
canMakeEditable?: boolean;
provisioned?: boolean;