Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

update succeed table in time #2103

Merged
merged 1 commit into from
Mar 2, 2020
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
2 changes: 1 addition & 1 deletion src/webui/src/components/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
</div>
</Stack>
<Stack horizontal tokens={stackTokens}>
<div style={{ width: '40%'}}>
<div style={{ width: '40%', position: 'relative'}}>
<Accuracy
accuracyData={accuracyGraphData}
accNodata={noDataMessage}
Expand Down
5 changes: 5 additions & 0 deletions src/webui/src/components/overview/SuccessTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>
}
];

componentWillReceiveProps(nextProps: SuccessTableProps): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not put this logic in render()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because ui got trialIds by props, got the table source by trialIds
when props changed, need to restore the state value in componentWillReceiveProps to trigger render. I think.

const { trialIds } = nextProps;
this.setState(() => ({ source: TRIALS.table(trialIds) }));
}

render(): React.ReactNode {
const { columns, source } = this.state;
return (
Expand Down
8 changes: 8 additions & 0 deletions src/webui/src/static/style/overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@
color: #333;
font-size: 14px;
}
}

/* overview-succeed-graph */
.showMess{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}