Skip to content

Commit

Permalink
fix: move workflow link to source query tab
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangvi7 committed May 2, 2024
1 parent 29fdf95 commit a70cc8d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
border-radius: var(--border-radius);
}
}
.DataTableViewSourceQuery-workflow {
margin-bottom: 12px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({
dataJobMetadataById,
}) => {
const [showOldJobMetadata, setShowOldJobMetadata] = useState(false);

const jobMetadataIds = useMemo(
() =>
Array.from(
Expand Down Expand Up @@ -74,12 +75,31 @@ export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({
const loaded = !(dataJobMetadataById[id] as any).__loading;
const dataJobMetadata = dataJobMetadataById[id];
return loaded ? (
<DataJobMetadataInfo key={id} dataJobMetadata={dataJobMetadata} />
<DataJobMetadataInfo
key={id}
dataJobMetadata={dataJobMetadata}
table={table}
/>
) : (
<Loading key={id} />
);
});

const customProperties = table.custom_properties ?? {};
const workflowValue = customProperties['workflow']?.toString() ?? null;
const workflowDOM = workflowValue ? (
<div className="DataTableViewSourceQuery-workflow">
<div className="data-job-source-query-top">
<Title size="med" className="mb12">
Workflow
</Title>
</div>
<Link to={workflowValue} newTab>
{workflowValue}
</Link>
</div>
) : null;

const errorDOM =
jobMetadataIds.length > 0 ? null : (
<EmptyText className="m24">
Expand All @@ -100,6 +120,7 @@ export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({
return (
<div className="DataTableViewSourceQuery">
{parentDOM}
{workflowDOM}
{errorDOM}
{showMoreDOM}
</div>
Expand All @@ -108,7 +129,8 @@ export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({

const DataJobMetadataInfo: React.FC<{
dataJobMetadata: IDataJobMetadata;
}> = ({ dataJobMetadata }) => {
table: IDataTable;
}> = ({ dataJobMetadata, table }) => {
const queryExecutionUrlRows = [];
if (
dataJobMetadata.is_adhoc &&
Expand Down

0 comments on commit a70cc8d

Please sign in to comment.