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

Hide warning icon when retry is 0 #4013

Merged
merged 1 commit into from
Dec 13, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default class Summary extends React.Component {
this.setHideDialog = this.setHideDialog.bind(this);
this.checkRetryHealthy = this.checkRetryHealthy.bind(this);
this.checkRetryLink = this.checkRetryLink.bind(this);
this.hasRetries = this.hasRetries.bind(this);
}

async componentDidMount() {
Expand Down Expand Up @@ -362,6 +363,16 @@ export default class Summary extends React.Component {
}
}

hasRetries() {
const { jobInfo } = this.props;

if (isNil(jobInfo.jobStatus.retries) || jobInfo.jobStatus.retries === 0) {
return false;
} else {
return true;
}
}

render() {
const {
autoReloadInterval,
Expand Down Expand Up @@ -564,84 +575,90 @@ export default class Summary extends React.Component {
>
Go to Job Metrics Page
</Link>
<div className={c(t.bl, t.mh3)}></div>
<Link
styles={{ root: [FontClassNames.mediumPlus] }}
href={getTensorBoardUrl(jobInfo, rawJobConfig)}
disabled={isNil(getTensorBoardUrl(jobInfo, rawJobConfig))}
target='_blank'
>
Go to TensorBoard Page
</Link>
<div className={c(t.bl, t.mh3)}></div>
<div className={c(t.flex)}>
<Link
styles={{ root: [FontClassNames.mediumPlus] }}
href={`job-retry.html?username=${namespace}&jobName=${jobName}`}
disabled={!this.checkRetryLink()}
target='_blank'
>
Go to Retry History Page
</Link>
{config.jobHistory !== 'true' && (
<div className={t.ml2}>
<TooltipHost
calloutProps={{
isBeakVisible: false,
}}
tooltipProps={{
onRenderContent: () => (
<div className={c(t.flex, t.itemsCenter)}>
{HISTORY_DISABLE_MESSAGE}
</div>
),
}}
directionalHint={DirectionalHint.topLeftEdge}
>
<div>
<Icon
iconName='Info'
styles={{
root: [
{ fontSize: IconFontSizes.medium },
ColorClassNames.neutralSecondary,
],
}}
/>
</div>
</TooltipHost>
</div>
)}
{config.jobHistory === 'true' && !isRetryHealthy && (
<div className={t.ml2}>
<TooltipHost
calloutProps={{
isBeakVisible: false,
}}
tooltipProps={{
onRenderContent: () => (
<div className={c(t.flex, t.itemsCenter)}>
{HISTORY_API_ERROR_MESSAGE}
</div>
),
}}
directionalHint={DirectionalHint.topLeftEdge}
>
<div>
<Icon
iconName='Warning'
styles={{
root: [
{ fontSize: IconFontSizes.medium },
ColorClassNames.neutralSecondary,
],
}}
/>
</div>
</TooltipHost>
</div>
)}
</div>
{!isNil(getTensorBoardUrl(jobInfo, rawJobConfig)) && (
<div className={c(t.flex)}>
<div className={c(t.bl, t.mh3)}></div>
<Link
styles={{ root: [FontClassNames.mediumPlus] }}
href={getTensorBoardUrl(jobInfo, rawJobConfig)}
target='_blank'
>
Go to TensorBoard Page
</Link>
</div>
)}
{this.hasRetries() && (
<div className={c(t.flex)}>
<div className={c(t.bl, t.mh3)}></div>
<Link
styles={{ root: [FontClassNames.mediumPlus] }}
href={`job-retry.html?username=${namespace}&jobName=${jobName}`}
disabled={!this.checkRetryLink()}
target='_blank'
>
Go to Retry History Page
</Link>
{config.jobHistory !== 'true' && (
<div className={t.ml2}>
<TooltipHost
calloutProps={{
isBeakVisible: false,
}}
tooltipProps={{
onRenderContent: () => (
<div className={c(t.flex, t.itemsCenter)}>
{HISTORY_DISABLE_MESSAGE}
</div>
),
}}
directionalHint={DirectionalHint.topLeftEdge}
>
<div>
<Icon
iconName='Info'
styles={{
root: [
{ fontSize: IconFontSizes.medium },
ColorClassNames.neutralSecondary,
],
}}
/>
</div>
</TooltipHost>
</div>
)}
{config.jobHistory === 'true' && !isRetryHealthy && (
<div className={t.ml2}>
<TooltipHost
calloutProps={{
isBeakVisible: false,
}}
tooltipProps={{
onRenderContent: () => (
<div className={c(t.flex, t.itemsCenter)}>
{HISTORY_API_ERROR_MESSAGE}
</div>
),
}}
directionalHint={DirectionalHint.topLeftEdge}
>
<div>
<Icon
iconName='Warning'
styles={{
root: [
{ fontSize: IconFontSizes.medium },
ColorClassNames.neutralSecondary,
],
}}
/>
</div>
</TooltipHost>
</div>
)}{' '}
</div>
)}
<div className={c(t.flex)}></div>
</div>
<div>
<span>
Expand Down