From 62f296cd5a41decd4c0a6c8b6277a3653e9ccefc Mon Sep 17 00:00:00 2001 From: Sabrina Ko <60155296+sabrinako@users.noreply.github.com> Date: Mon, 1 Nov 2021 14:46:11 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jamie White --- ui/app/components/panel-header.hbs | 10 +++--- ui/app/components/section.ts | 5 ++- .../status-report-meta-table/index.hbs | 14 ++++---- .../workspace/projects/project/app/build.hbs | 2 +- .../projects/project/app/deployment.hbs | 4 +-- .../projects/project/app/release.hbs | 4 +-- .../components/panel-header-test.ts | 2 +- ui/translations/en-us.yaml | 33 ++++++++++--------- 8 files changed, 39 insertions(+), 35 deletions(-) diff --git a/ui/app/components/panel-header.hbs b/ui/app/components/panel-header.hbs index 405f8e16992..f8b6542cfd4 100644 --- a/ui/app/components/panel-header.hbs +++ b/ui/app/components/panel-header.hbs @@ -1,17 +1,17 @@ {{#let (hash title=(or - (and (eq @artifact "deployment") "Deployment") - (and (eq @artifact "build") "Build") - (and (eq @artifact "release") "Release") - (and @artifact "n/a") + (and (eq @artifact "deployment") "page.deployment.title") + (and (eq @artifact "build") "page.build.title") + (and (eq @artifact "release") "page.release.title") + "page.unavailable.title" ) ) as |vars| }}
-

{{vars.title}} +

{{t vars.title}} {{#if @sequence}} v{{@sequence}} {{/if}} diff --git a/ui/app/components/section.ts b/ui/app/components/section.ts index 11572cc7bbb..eb7b8e4a93e 100644 --- a/ui/app/components/section.ts +++ b/ui/app/components/section.ts @@ -9,7 +9,10 @@ type Args = { export default class extends Component { @tracked expanded = this.args.expanded ?? true; - @tracked isExpandable = this.args.isExpandable ?? true; + + get isExpandable(): boolean { + return this.args.isExpandable ?? true; + } @action toggleExpanded(): void { diff --git a/ui/app/components/status-report-meta-table/index.hbs b/ui/app/components/status-report-meta-table/index.hbs index 672aa8cb3b2..33c0f6f9656 100644 --- a/ui/app/components/status-report-meta-table/index.hbs +++ b/ui/app/components/status-report-meta-table/index.hbs @@ -1,6 +1,6 @@ {{#let (hash - shouldRenderHealthAndTag= (and + shouldRenderHealthAndTag=(and (or (eq @artifactType "Deployment") (eq @artifactType "Release") @@ -14,14 +14,14 @@
- {{#if (or (or (has-block) vars.shouldRenderCommit) vars.shouldRenderHealthAndTag)}} + {{#if (or (has-block) vars.shouldRenderCommit vars.shouldRenderHealthAndTag)}} {{yield}} {{else}} - {{t "page.deployment.overview.unavailable"}} + {{t "page.artifact.overview.unavailable"}} {{/if}} {{#if vars.shouldRenderHealthAndTag}} - + - + diff --git a/ui/app/templates/workspace/projects/project/app/build.hbs b/ui/app/templates/workspace/projects/project/app/build.hbs index 3381e664cc2..ac59258e220 100644 --- a/ui/app/templates/workspace/projects/project/app/build.hbs +++ b/ui/app/templates/workspace/projects/project/app/build.hbs @@ -12,7 +12,7 @@ <:body> - + - + - +
{{t "page.deployment.overview.health-check"}}{{t "page.artifact.overview.health-check"}}
  @@ -32,14 +32,14 @@ disabled={{this.isRefreshRunning}} {{on "click" this.refreshHealthCheck}} > - {{t "page.deployment.overview.re-run-health-check"}} + {{t "page.artifact.overview.re-run-health-check"}}
- {{t "page.deployment.overview.image"}} + {{t "page.artifact.overview.image"}} @@ -48,7 +48,7 @@ {{/if}} {{#if vars.shouldRenderCommit}}
Commit{{t "page.artifact.overview.commit"}}
Status{{t "page.build.overview.status"}}
- Status - {{t "page.deployment.overview.status"}} Deployed by {{component-name @model.component.name}} diff --git a/ui/app/templates/workspace/projects/project/app/release.hbs b/ui/app/templates/workspace/projects/project/app/release.hbs index 3bb5c654edc..e99882afd3a 100644 --- a/ui/app/templates/workspace/projects/project/app/release.hbs +++ b/ui/app/templates/workspace/projects/project/app/release.hbs @@ -13,11 +13,11 @@
- <:heading>{{t "page.build.overview.heading"}} + <:heading>{{t "page.release.overview.heading"}} <:body>
Status{{t "page.release.overview.status"}} Released on {{component-name @model.component.name}} diff --git a/ui/tests/integration/components/panel-header-test.ts b/ui/tests/integration/components/panel-header-test.ts index 19c3122ed18..22c63298a4d 100644 --- a/ui/tests/integration/components/panel-header-test.ts +++ b/ui/tests/integration/components/panel-header-test.ts @@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; -module('Integration | Component | panel-title', function (hooks) { +module('Integration | Component | panel-header', function (hooks) { setupRenderingTest(hooks); test('it renders an empty component when params not passed', async function (assert) { diff --git a/ui/translations/en-us.yaml b/ui/translations/en-us.yaml index 2b27bc50246..34271e50540 100644 --- a/ui/translations/en-us.yaml +++ b/ui/translations/en-us.yaml @@ -17,15 +17,20 @@ product: name: 'Waypoint' page: + artifact: + overview: + image: 'Image' + health-check: 'Health' + re-run-health-check: 'Re-run' + unavailable: 'Currently unavailable' + commit: 'Commit' builds: title: 'Builds' build: + title: 'Build' overview: - heading: Overview - image: Image - health-check: Health - re-run-health-check: Re-run - unavailable: Currently unavailable + heading: 'Overview' + status: 'Status' deployments: title: 'Deployments' destroyed_label: 'Destroyed' @@ -38,32 +43,30 @@ page: 2: 'Deployed by ' # SUCCESS 3: 'Failed to deploy by ' # ERROR deployment: + title: 'Deployment' resources: heading: Resources deployment-table-caption: Resources created by this deployment release-table-caption-prefix: Resources created by Release overview: - heading: Overview - image: Image - health-check: Health - re-run-health-check: Re-run - unavailable: Currently unavailable + heading: 'Overview' + status: 'Status' logs: heading: Deployment Logs releases: title: 'Releases' release: + title: 'Release' resources: heading: Resources table-caption: Resources created by this release overview: - heading: Overview - image: Image - health-check: Health - re-run-health-check: Re-run - unavailable: Currently unavailable + heading: 'Overview' + status: 'Status' logs: heading: Release Logs + unavailable: + title: '' form: project_new: