Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: archive/unarchive workflow's execution #271

Merged
merged 3 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Entities/EntityExecutions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { Typography } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { contentMarginGridUnits } from 'common/layout';
import { fetchStates } from 'components/hooks/types';
import { WaitForData } from 'components/common/WaitForData';
import { ExecutionFilters } from 'components/Executions/ExecutionFilters';
import { useExecutionShowArchivedState } from 'components/Executions/filters/useExecutionArchiveState';
Expand Down Expand Up @@ -74,7 +75,7 @@ export const EntityExecutions: React.FC<EntityExecutionsProps> = ({

/** Don't render component until finish fetching user profile */
const lastIndex = filtersState.filters.length - 1;
if (filtersState.filters[lastIndex].status !== 'LOADED') {
if (filtersState.filters[lastIndex].status !== fetchStates.LOADED) {
return null;
}

Expand Down
10 changes: 5 additions & 5 deletions src/components/Entities/EntityExecutionsBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Typography from '@material-ui/core/Typography';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { formatDateUTC, millisecondsToHMS } from 'common/formatters';
import { timestampToDate } from 'common/utils';
import { fetchStates } from 'components/hooks/types';
import { BarChart } from 'components/common/BarChart';
import { WaitForData } from 'components/common/WaitForData';
import { useWorkflowExecutionFiltersState } from 'components/Executions/filters/useExecutionFiltersState';
Expand Down Expand Up @@ -53,9 +54,9 @@ export const getExecutionTimeData = (
<span>Running time: {millisecondsToHMS(duration)}</span>
<span>
Started at:{' '}
{execution.closure.startedAt != null &&
{execution.closure.startedAt &&
formatDateUTC(
timestampToDate(execution.closure.startedAt!)
timestampToDate(execution.closure.startedAt)
)}
</span>
</div>
Expand Down Expand Up @@ -121,15 +122,14 @@ export const EntityExecutionsBarChart: React.FC<EntityExecutionsBarChartProps> =
item => {
if (item.metadata) {
onToggle(item.metadata.name);
// const executionId = item.metadata as WorkflowExecutionIdentifier;
// history.push(Routes.ExecutionDetails.makeUrl(executionId));
}
},
[onToggle]
);

/** Don't render component until finish fetching user profile */
if (filtersState.filters[4].status !== 'LOADED') {
const lastIndex = filtersState.filters.length - 1;
if (filtersState.filters[lastIndex].status !== fetchStates.LOADED) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const useStyles = makeStyles((theme: Theme) => ({
paddingLeft: theme.spacing(1)
},
columnName: {
flexGrow: 1,
flexBasis: workflowExecutionsTableColumnWidths.name,
whiteSpace: 'normal'
},
Expand All @@ -23,11 +24,10 @@ export const useStyles = makeStyles((theme: Theme) => ({
textAlign: 'right'
},
columnActions: {
flexGrow: 1,
flexBasis: workflowExecutionsTableColumnWidths.actions,
marginLeft: theme.spacing(2),
marginRight: theme.spacing(2),
textAlign: 'left'
textAlign: 'right'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our conversation, put actions to right side + updated column nanme size
Screen Shot 2022-02-02 at 11 19 04 AM

},
rightMargin: {
marginRight: theme.spacing(1)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Executions/Tables/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const workflowExecutionsTableColumnWidths = {
duration: 100,
actions: 140,
actions: 130,
lastRun: 130,
name: 360,
phase: 120,
Expand Down
5 changes: 3 additions & 2 deletions src/components/Project/ProjectExecutions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Typography from '@material-ui/core/Typography';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { getCacheKey } from 'components/Cache/utils';
import { fetchStates } from 'components/hooks/types';
import { ErrorBoundary } from 'components/common/ErrorBoundary';
import { LargeLoadingSpinner } from 'components/common/LoadingSpinner';
import { DataError } from 'components/Errors/DataError';
Expand Down Expand Up @@ -141,8 +142,8 @@ export const ProjectExecutions: React.FC<ProjectExecutionsProps> = ({
);

/** Don't render component until finish fetching user profile */
const filterLength = filtersState.filters.length;
if (filtersState.filters[filterLength - 1].status === 'LOADED') {
const lastIndex = filtersState.filters.length - 1;
if (filtersState.filters[lastIndex].status === fetchStates.LOADED) {
return (
<div className={styles.container}>
<Typography
Expand Down