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

fix: tooltip scrolling and bar chart ordering issue #218

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 10 additions & 5 deletions src/components/Entities/EntityExecutionsBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface EntityExecutionsBarChartProps {
}

const getExecutionTimeData = (exectuions: Execution[], fillSize = 100) => {
const newExecutions = exectuions.map(execution => {
const newExecutions = exectuions.reverse().map(execution => {
const duration = getWorkflowExecutionTimingMS(execution)?.duration || 1;
return {
value: duration,
Expand Down Expand Up @@ -71,10 +71,14 @@ const getExecutionTimeData = (exectuions: Execution[], fillSize = 100) => {
};

const getStartExecutionTime = (executions: Execution[]) => {
if (executions.length === 0 || !executions[0].closure.startedAt) {
if (executions.length === 0) {
return '';
}
return formatDateUTC(timestampToDate(executions[0].closure.startedAt));
const lastExecution = executions[executions.length - 1];
if (!lastExecution.closure.startedAt) {
return '';
}
return formatDateUTC(timestampToDate(lastExecution.closure.startedAt));
};

/**
Expand All @@ -90,7 +94,7 @@ export const EntityExecutionsBarChart: React.FC<EntityExecutionsBarChartProps> =
const filtersState = useWorkflowExecutionFiltersState();
const sort = {
key: executionSortFields.createdAt,
direction: SortDirection.ASCENDING
direction: SortDirection.DESCENDING
};

const baseFilters = React.useMemo(
Expand All @@ -102,7 +106,8 @@ export const EntityExecutionsBarChart: React.FC<EntityExecutionsBarChartProps> =
{ domain, project },
{
sort,
filter: [...baseFilters, ...filtersState.appliedFilters]
filter: [...baseFilters, ...filtersState.appliedFilters],
limit: 100
}
);

Expand Down
4 changes: 3 additions & 1 deletion src/components/common/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ const BarChartItem: React.FC<BarChartItemProps> = ({
<Tooltip
title={tooltip}
TransitionComponent={Zoom}
onMouseMove={e => setPosition({ x: e.pageX, y: e.pageY })}
onMouseMove={e =>
setPosition({ x: e.pageX, y: e.pageY - window.scrollY })
}
PopperProps={{
anchorEl: {
clientHeight: 0,
Expand Down