Skip to content

Commit

Permalink
fix: bar chart order changes whenever click on launch workflow button (
Browse files Browse the repository at this point in the history
…#227)

Signed-off-by: csirius <[email protected]>
  • Loading branch information
govalt authored Oct 13, 2021
1 parent 82a9271 commit f2961d0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/Entities/EntityExecutionsBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export interface EntityExecutionsBarChartProps {
id: ResourceIdentifier;
}

const getExecutionTimeData = (exectuions: Execution[], fillSize = 100) => {
const newExecutions = exectuions.reverse().map(execution => {
const getExecutionTimeData = (executions: Execution[], fillSize = 100) => {
const newExecutions = [...executions].reverse().map(execution => {
const duration = getWorkflowExecutionTimingMS(execution)?.duration || 1;
return {
value: duration,
Expand All @@ -50,9 +50,10 @@ const getExecutionTimeData = (exectuions: Execution[], fillSize = 100) => {
<span>Running time: {millisecondsToHMS(duration)}</span>
<span>
Started at:{' '}
{execution.closure.startedAt != null && formatDateUTC(
timestampToDate(execution.closure.startedAt!)
)}
{execution.closure.startedAt != null &&
formatDateUTC(
timestampToDate(execution.closure.startedAt!)
)}
</span>
</div>
)
Expand Down Expand Up @@ -111,6 +112,8 @@ export const EntityExecutionsBarChart: React.FC<EntityExecutionsBarChartProps> =
}
);

console.log(executions);

const handleClickItem = React.useCallback(item => {
if (item.metadata) {
// const executionId = item.metadata as WorkflowExecutionIdentifier;
Expand Down

0 comments on commit f2961d0

Please sign in to comment.