From 6acff02fbf12cfb424551c15542aaec74e1d452e Mon Sep 17 00:00:00 2001 From: Kristina Durivage Date: Mon, 24 Jun 2024 13:45:12 -0500 Subject: [PATCH] change types, display userid if login isnt returned --- .../explore/QueryLibrary/QueryTemplatesTable/AddedByCell.tsx | 2 +- .../features/explore/QueryLibrary/QueryTemplatesTable/types.ts | 1 + public/app/features/query-library/api/mappers.ts | 2 +- public/app/features/query-library/api/types.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/AddedByCell.tsx b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/AddedByCell.tsx index a0d5c497c88..2d4bd8f060c 100644 --- a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/AddedByCell.tsx +++ b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/AddedByCell.tsx @@ -12,7 +12,7 @@ export function AddedByCell(props: AddedByCellProps) { return (
- {props.user?.login || 'Unknown'} + {props.user?.login || `UserId: ${props.user?.userId}` || 'Unknown'}
); } diff --git a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/types.ts b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/types.ts index 0f9041fa533..0c28b4418bc 100644 --- a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/types.ts +++ b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/types.ts @@ -9,4 +9,5 @@ export type QueryTemplateRow = { datasourceType?: string; createdAtTimestamp?: number; user?: User; + uid?: string; }; diff --git a/public/app/features/query-library/api/mappers.ts b/public/app/features/query-library/api/mappers.ts index 3c9d8d8a206..88a1299b204 100644 --- a/public/app/features/query-library/api/mappers.ts +++ b/public/app/features/query-library/api/mappers.ts @@ -12,7 +12,7 @@ export const parseCreatedByValue = (value?: string) => { return undefined; } else { return { - userId: Number(vals[1]), + userId: vals[1], login: vals[2], }; } diff --git a/public/app/features/query-library/api/types.ts b/public/app/features/query-library/api/types.ts index 01a5c6a9635..9ba5276bfa5 100644 --- a/public/app/features/query-library/api/types.ts +++ b/public/app/features/query-library/api/types.ts @@ -27,7 +27,7 @@ export type DataQuerySpecResponse = { }; export type User = { - userId?: number; + userId?: string; login?: string; };