From a70cc8d349ca73d2935b9a6aeee00b99b2f7bed0 Mon Sep 17 00:00:00 2001 From: Victor Zhang Date: Mon, 29 Apr 2024 16:24:54 -0400 Subject: [PATCH] fix: move workflow link to source query tab --- .../DataTableViewSourceQuery.scss | 3 +++ .../DataTableViewSourceQuery.tsx | 26 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.scss b/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.scss index bdb2b5380..b13b2021d 100644 --- a/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.scss +++ b/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.scss @@ -22,4 +22,7 @@ border-radius: var(--border-radius); } } + .DataTableViewSourceQuery-workflow { + margin-bottom: 12px; + } } diff --git a/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.tsx b/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.tsx index 879101c37..3a3fa4b0e 100644 --- a/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.tsx +++ b/querybook/webapp/components/DataTableViewSourceQuery/DataTableViewSourceQuery.tsx @@ -34,6 +34,7 @@ export const DataTableViewSourceQuery: React.FunctionComponent = ({ dataJobMetadataById, }) => { const [showOldJobMetadata, setShowOldJobMetadata] = useState(false); + const jobMetadataIds = useMemo( () => Array.from( @@ -74,12 +75,31 @@ export const DataTableViewSourceQuery: React.FunctionComponent = ({ const loaded = !(dataJobMetadataById[id] as any).__loading; const dataJobMetadata = dataJobMetadataById[id]; return loaded ? ( - + ) : ( ); }); + const customProperties = table.custom_properties ?? {}; + const workflowValue = customProperties['workflow']?.toString() ?? null; + const workflowDOM = workflowValue ? ( +
+
+ + Workflow + +
+ + {workflowValue} + +
+ ) : null; + const errorDOM = jobMetadataIds.length > 0 ? null : ( @@ -100,6 +120,7 @@ export const DataTableViewSourceQuery: React.FunctionComponent = ({ return (
{parentDOM} + {workflowDOM} {errorDOM} {showMoreDOM}
@@ -108,7 +129,8 @@ export const DataTableViewSourceQuery: React.FunctionComponent = ({ const DataJobMetadataInfo: React.FC<{ dataJobMetadata: IDataJobMetadata; -}> = ({ dataJobMetadata }) => { + table: IDataTable; +}> = ({ dataJobMetadata, table }) => { const queryExecutionUrlRows = []; if ( dataJobMetadata.is_adhoc &&