Skip to content

Commit

Permalink
chore: pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Nastya Rusina <nastya@union.ai>
  • Loading branch information
anrusina committed Feb 2, 2022
1 parent 1d6aa58 commit 9fe5bdb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
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'
},
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

0 comments on commit 9fe5bdb

Please sign in to comment.