From f2a0d42bc497b86b9d74632c2a86a6f1fb0a4bc2 Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Fri, 19 Aug 2022 16:26:48 -0400 Subject: [PATCH] ui: remove next run from jobs that don't have next run Several jobs don't have a future run, so the value being displayed on the Jobs Details page would should the last time it was scheduled. This commit hides the next run field from the page if is not in the future. Fixes #86359 Release justification: low risk, high benefit change Release note (ui change): Remove the Next Planned Execution Time label, when the job doesn't have a next planned execution scheduled. --- .../src/jobs/jobDetailsPage/jobDetails.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx index 74a0eca0be2a..56eb884f2e36 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx @@ -76,6 +76,8 @@ export class JobDetails extends React.Component { renderContent = (): React.ReactElement => { const job = this.props.job; + const nextRun = TimestampToMoment(job.next_run); + const hasNextRun = nextRun.isAfter(); return ( <> @@ -88,10 +90,14 @@ export class JobDetails extends React.Component {

Status

-

- Next Planned Execution Time: -

- {TimestampToMoment(job.next_run).format(DATE_FORMAT_24_UTC)} + {hasNextRun && ( + <> +

+ Next Planned Execution Time: +

+ {nextRun.format(DATE_FORMAT_24_UTC)} + + )}