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

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jamie White <jamie@jgwhite.co.uk>
  • Loading branch information
2 people authored and Sabrina Ko committed Nov 1, 2021
1 parent e0a59a0 commit 62f296c
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 35 deletions.
10 changes: 5 additions & 5 deletions ui/app/components/panel-header.hbs
Original file line number Diff line number Diff line change
@@ -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|
}}
<header data-test-panel-header class="panel-header {{@className}}">
<div class="title">
<h1>{{vars.title}}
<h1>{{t vars.title}}
{{#if @sequence}}
<b class="badge badge--version">v{{@sequence}}</b>
{{/if}}
Expand Down
5 changes: 4 additions & 1 deletion ui/app/components/section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ type Args = {

export default class extends Component<Args> {
@tracked expanded = this.args.expanded ?? true;
@tracked isExpandable = this.args.isExpandable ?? true;

get isExpandable(): boolean {
return this.args.isExpandable ?? true;
}

@action
toggleExpanded(): void {
Expand Down
14 changes: 7 additions & 7 deletions ui/app/components/status-report-meta-table/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#let
(hash
shouldRenderHealthAndTag= (and
shouldRenderHealthAndTag=(and
(or
(eq @artifactType "Deployment")
(eq @artifactType "Release")
Expand All @@ -14,14 +14,14 @@
<div class="artifact-overview">
<table>
<tbody>
{{#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}}
<tr>
<th scope="row">{{t "page.deployment.overview.health-check"}}</th>
<th scope="row">{{t "page.artifact.overview.health-check"}}</th>
<td>
<div class="status-indicator">
<StatusReportIndicator @statusReport={{@model.statusReport}} /> &nbsp;
Expand All @@ -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"}}
</Pds::Button>
</div>
</td>
</tr>
<tr>
<th scope="row">
{{t "page.deployment.overview.image"}}
{{t "page.artifact.overview.image"}}
</th>
<td>
<ContainerImageTag @statusReport={{@model.statusReport}}/>
Expand All @@ -48,7 +48,7 @@
{{/if}}
{{#if vars.shouldRenderCommit}}
<tr>
<th scope="row">Commit</th>
<th scope="row">{{t "page.artifact.overview.commit"}}</th>
<td>
<GitCommit @commit={{@model.preload.jobDataSourceRef.git.commit}}/>
</td>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/workspace/projects/project/app/build.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<:body>
<StatusReportMetaTable @model={{@model}} @artifactType="Build">
<tr>
<th scope="row">Status</th>
<th scope="row">{{t "page.build.overview.status"}}</th>
<td>
<Pds::Icon
@type={{icon-for-component operation.component.name}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
<:body>
<StatusReportMetaTable @model={{@model}} @artifactType="Deployment">
<tr>
<th scope="row">
Status
</th>
<th scope="row">{{t "page.deployment.overview.status"}}</th>
<td>
<Pds::Icon @type={{icon-for-component @model.component.name}} class="icon" />
<span>Deployed by <b>{{component-name @model.component.name}}</b>
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/workspace/projects/project/app/release.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
</PanelHeader>

<Section @isExpandable={{false}}>
<:heading>{{t "page.build.overview.heading"}}</:heading>
<:heading>{{t "page.release.overview.heading"}}</:heading>
<:body>
<StatusReportMetaTable @model={{@model}} @artifactType="Release">
<tr>
<th scope="row">Status</th>
<th scope="row">{{t "page.release.overview.status"}}</th>
<td>
<Pds::Icon @type={{icon-for-component @model.component.name}} class="icon" />
<span>Released on <b>{{component-name @model.component.name}}</b>
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/integration/components/panel-header-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
33 changes: 18 additions & 15 deletions ui/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 <b>this deployment</b>
release-table-caption-prefix: Resources created by <b>Release</b>
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 <b>this release</b>
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:
Expand Down

0 comments on commit 62f296c

Please sign in to comment.