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

Commit

Permalink
add tooltip when there is no data in overview table (#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lijiaoa authored Apr 20, 2020
1 parent 8c8220e commit 6b02f7a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/webui/src/components/overview/SuccessTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import DefaultMetric from '../public-child/DefaultMetric';
import Details from './Details';
import { convertDuration } from '../../static/function';
import { TRIALS } from '../../static/datamodel';
import { DETAILTABS } from '../stateless-component/NNItabs';
import '../../static/style/succTable.scss';
import '../../static/style/openRow.scss';

Expand Down Expand Up @@ -55,6 +56,13 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>
return items.slice(0).sort((a: T, b: T) => ((isSortedDescending ? a[key] < b[key] : a[key] > b[key]) ? 1 : -1));
}

tooltipStr = (
<div>
<p>The experiment is running, please wait for the final metric patiently.</p>
<div className="link">You could also find status of trial job with <span>{DETAILTABS}</span> button.</div>
</div>
);

columns = [
{
name: 'Trial No.',
Expand Down Expand Up @@ -125,17 +133,20 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>

render(): React.ReactNode {
const { columns, source } = this.state;
const isNoneData = (source.length === 0) ? true : false;

return (
<div id="succTable">
{/* TODO: [style] lineHeight question */}
<DetailsList
columns={columns}
items={source}
setKey="set"
compact={true}
onRenderRow={this.onRenderRow}
selectionMode={0} // close selector function
className="succTable"
/>
{isNoneData && <div className="succTable-tooltip">{this.tooltipStr}</div>}
</div>
);
}
Expand Down
13 changes: 13 additions & 0 deletions src/webui/src/static/style/succTable.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#succTable{
height: 404px;
overflow-y: scroll;
position: relative;
.succTable-tooltip{
position: absolute;
top: 40%;
left: 17%;
.link{
margin-left: 15px;
a{
font-weight: 500;
color: blue;
}
}
}
}

0 comments on commit 6b02f7a

Please sign in to comment.