From f0cf931c7b98fd981b8586a7fedd93f7472797c5 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 19 Apr 2018 10:18:16 -0700 Subject: [PATCH] Refactor job-page components to use common title and error parts --- .../templates/components/job-page/batch.hbs | 7 +++---- .../job-page/parameterized-child.hbs | 7 +++---- .../components/job-page/parameterized.hbs | 8 +++---- .../components/job-page/periodic-child.hbs | 7 +++---- .../components/job-page/periodic.hbs | 21 ++++--------------- .../templates/components/job-page/service.hbs | 15 +++---------- .../templates/components/job-page/system.hbs | 7 +++---- 7 files changed, 23 insertions(+), 49 deletions(-) diff --git a/ui/app/templates/components/job-page/batch.hbs b/ui/app/templates/components/job-page/batch.hbs index 74b7f5c28..d92573add 100644 --- a/ui/app/templates/components/job-page/batch.hbs +++ b/ui/app/templates/components/job-page/batch.hbs @@ -6,10 +6,9 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -

- {{job.name}} - {{job.status}} -

+ {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{job-page/parts/title job=job handleError=(action "handleError")}}
diff --git a/ui/app/templates/components/job-page/parameterized-child.hbs b/ui/app/templates/components/job-page/parameterized-child.hbs index b01ad400f..cd3d18f0b 100644 --- a/ui/app/templates/components/job-page/parameterized-child.hbs +++ b/ui/app/templates/components/job-page/parameterized-child.hbs @@ -6,10 +6,9 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -

- {{job.trimmedName}} - {{job.status}} -

+ {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}}
diff --git a/ui/app/templates/components/job-page/parameterized.hbs b/ui/app/templates/components/job-page/parameterized.hbs index a8e3ed47f..b976e73a8 100644 --- a/ui/app/templates/components/job-page/parameterized.hbs +++ b/ui/app/templates/components/job-page/parameterized.hbs @@ -6,11 +6,11 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -

- {{job.name}} - {{job.status}} + {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{#job-page/parts/title job=job handleError=(action "handleError")}} Parameterized -

+ {{/job-page/parts/title}}
diff --git a/ui/app/templates/components/job-page/periodic-child.hbs b/ui/app/templates/components/job-page/periodic-child.hbs index e39aed637..946ce2579 100644 --- a/ui/app/templates/components/job-page/periodic-child.hbs +++ b/ui/app/templates/components/job-page/periodic-child.hbs @@ -6,10 +6,9 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -

- {{job.trimmedName}} - {{job.status}} -

+ {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}}
diff --git a/ui/app/templates/components/job-page/periodic.hbs b/ui/app/templates/components/job-page/periodic.hbs index 25fcdc102..31e0ffe32 100644 --- a/ui/app/templates/components/job-page/periodic.hbs +++ b/ui/app/templates/components/job-page/periodic.hbs @@ -6,25 +6,12 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} - {{#if errorMessage}} -
-
-
-

Could Not Force Launch

-

Your ACL token does not grant permission to submit jobs.

-
-
- -
-
-
- {{/if}} -

- {{job.name}} - {{job.status}} + {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{#job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}} periodic -

+ {{/job-page/parts/title}}
diff --git a/ui/app/templates/components/job-page/service.hbs b/ui/app/templates/components/job-page/service.hbs index 136749f0c..80e2ab721 100644 --- a/ui/app/templates/components/job-page/service.hbs +++ b/ui/app/templates/components/job-page/service.hbs @@ -6,18 +6,9 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -

- {{job.name}} - {{job.status}} - {{#if (not (eq job.status "dead"))}} - {{two-step-button - idleText="Stop" - cancelText="Cancel" - confirmText="Yes, Stop" - confirmationMessage="Are you sure you want to stop this job?" - onConfirm=(action "stopJob")}} - {{/if}} -

+ {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{job-page/parts/title job=job handleError=(action "handleError")}}
diff --git a/ui/app/templates/components/job-page/system.hbs b/ui/app/templates/components/job-page/system.hbs index 74b7f5c28..d92573add 100644 --- a/ui/app/templates/components/job-page/system.hbs +++ b/ui/app/templates/components/job-page/system.hbs @@ -6,10 +6,9 @@ {{/each}} {{/global-header}} {{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}} -

- {{job.name}} - {{job.status}} -

+ {{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}} + + {{job-page/parts/title job=job handleError=(action "handleError")}}