Skip to content

Commit

Permalink
feat: display execution tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lyonlu13 committed Jan 22, 2024
1 parent cfc38e4 commit 80e20b1
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
IconButton,
Button,
CircularProgress,
Chip,
} from '@material-ui/core';
import ArchiveOutlined from '@material-ui/icons/ArchiveOutlined';
import UnarchiveOutline from '@material-ui/icons/UnarchiveOutlined';
Expand Down Expand Up @@ -100,6 +101,28 @@ export function getDurationCell(execution: Execution): React.ReactNode {
);
}

export function getExecutionTagsCell(
execution: Execution,
className: string,
): React.ReactNode {
const isArchived = isExecutionArchived(execution);
const tags = execution.spec.tags ?? [];
return (
<div className={className}>
{tags.map(tag => {
return (

Check warning on line 113 in packages/console/src/components/Executions/Tables/WorkflowExecutionTable/cells.tsx

View check run for this annotation

Codecov / codecov/patch

packages/console/src/components/Executions/Tables/WorkflowExecutionTable/cells.tsx#L112-L113

Added lines #L112 - L113 were not covered by tests
<Chip
key={tag}
label={tag}
size="small"
color={isArchived ? 'default' : 'primary'}

Check warning on line 118 in packages/console/src/components/Executions/Tables/WorkflowExecutionTable/cells.tsx

View check run for this annotation

Codecov / codecov/patch

packages/console/src/components/Executions/Tables/WorkflowExecutionTable/cells.tsx#L118

Added line #L118 was not covered by tests
/>
);
})}
</div>
);
}

export function getLaunchPlanCell(
execution: Execution,
className: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Protobuf } from '@flyteorg/flyteidl-types';

const str = {
tableLabel_name: 'execution id',
tableLabel_tags: 'tags',
tableLabel_launchPlan: 'launch plan',
tableLabel_phase: 'status',
tableLabel_startedAt: 'start time',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export const useStyles = makeStyles((theme: Theme) => ({
flexBasis: workflowExecutionsTableColumnWidths.name,
whiteSpace: 'normal',
},
columnExecutionTags: {
flexGrow: 1,
flexBasis: workflowExecutionsTableColumnWidths.tags,
whiteSpace: 'normal',
},
columnLaunchPlan: {
flexGrow: 1,
flexBasis: workflowExecutionsTableColumnWidths.launchPlan,
Expand Down Expand Up @@ -56,4 +61,8 @@ export const useStyles = makeStyles((theme: Theme) => ({
width: '100px', // same as confirmationButton size
textAlign: 'center',
},
executionTagsStack: {
display: 'flex',
gap: theme.spacing(0.5),
},
}));
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
getStartTimeCell,
getStatusCell,
getLaunchPlanCell,
getExecutionTagsCell,
} from './cells';
import { useStyles } from './styles';
import t, { patternKey } from './strings';
Expand Down Expand Up @@ -45,6 +46,13 @@ export function useWorkflowExecutionsTableColumns(
key: 'name',
label: t(patternKey('tableLabel', 'name')),
},
{
cellRenderer: ({ execution }) =>
getExecutionTagsCell(execution, styles.executionTagsStack),
className: styles.columnExecutionTags,
key: 'tags',
label: t(patternKey('tableLabel', 'tags')),
},
{
cellRenderer: ({ execution }) =>
getLaunchPlanCell(execution, commonStyles.textWrapped),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ export const workflowExecutionsTableColumnWidths = {
duration: 100,
actions: 130,
lastRun: 130,
name: 240,
name: 200,
launchPlan: 120,
phase: 120,
startedAt: 200,
tags: 120,
};

export const nodeExecutionsTableColumnWidths = {
Expand Down

0 comments on commit 80e20b1

Please sign in to comment.