Skip to content

Commit

Permalink
chore: add fallback to task execution link (#743)
Browse files Browse the repository at this point in the history
* chore: add fallback to task execution link

Signed-off-by: Carina Ursu <[email protected]>

* chore: version bump

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina authored Apr 14, 2023
1 parent 530c10d commit 5aecd5c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteorg/console",
"version": "0.0.17",
"version": "0.0.19",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,31 @@ export const TaskExecutionLogsCard: React.FC<
} = taskExecution;

const taskHasStarted = phase >= TaskExecutionPhase.QUEUED;
const externalProps = { ...props, styles, commonStyles };
const defaultHeader = (
<Typography
variant="h6"
className={classnames(styles.title, commonStyles.textWrapped)}
>
{headerText}
</Typography>
);

const externalHeader = registry?.taskExecutionAttemps && (
<ExternalConfigHoc
ChildComponent={registry.taskExecutionAttemps}
data={{
...props,
styles,
commonStyles,
fallback: defaultHeader,
}}
/>
);
return (
<>
<section className={styles.section}>
<header className={styles.header}>
{registry?.taskExecutionAttemps ? (
// Alternate path

<ExternalConfigHoc
ChildComponent={registry.taskExecutionAttemps}
data={externalProps}
/>
) : (
// default path
<Typography
variant="h6"
className={classnames(styles.title, commonStyles.textWrapped)}
>
{headerText}
</Typography>
)}
{externalHeader || defaultHeader}
</header>
<ExecutionStatusBadge phase={phase} type="task" variant="text" />
</section>
Expand Down
1 change: 1 addition & 0 deletions packages/console/src/models/Task/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './constants';
2 changes: 1 addition & 1 deletion packages/console/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './AdminEntity';
export * from './Execution/enums';
export * from './Execution/types';
export { taskSortFields } from './Task/constants';
export * from './Task';
export * from './Common/types';

0 comments on commit 5aecd5c

Please sign in to comment.