Skip to content

Commit

Permalink
refact: fix tests after contextual job page changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiWithJai committed Jan 26, 2022
1 parent c1bb21d commit 6c65966
Show file tree
Hide file tree
Showing 13 changed files with 453 additions and 295 deletions.
4 changes: 3 additions & 1 deletion ui/app/routes/jobs/job/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default class IndexRoute extends Route.extend(WithWatchers) {
model.get('hasChildren') &&
this.watchAllJobs.perform({ namespace: model.namespace.get('name') }),
nodes:
model.get('hasClientStatus') && this.can.can('read client') && this.watchNodes.perform(),
model.get('hasClientStatus') &&
this.can.can('read client') &&
this.watchNodes.perform(),
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if this.job.hasClientStatus}}
<ListAccordion
data-test-job-summary
data-test-job-client-summary
@source={{array this.job}}
@key="id"
@startExpanded={{this.isExpanded}}
Expand Down
25 changes: 20 additions & 5 deletions ui/app/templates/components/job-page/parts/summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
@startExpanded={{this.isExpanded}}
@onToggle={{action this.persist}} as |a|
>
<a.head @buttonLabel={{if a.isOpen "collapse" "expand"}}>
<a.head
@buttonLabel={{if a.isOpen "collapse" "expand"}}
@buttonType={{if a.item.hasChildren "children-status" "allocation-status"}}
>
<div class="columns">
<div class="column is-minimum nowrap">
{{#if a.item.hasChildren}}
Expand All @@ -32,7 +35,10 @@
</em>
{{/if}}
{{else}}
<AllocationStatusBar @allocationContainer={{a.item}} @isNarrow={{true}} />
<AllocationStatusBar
@allocationContainer={{a.item}}
@isNarrow={{true}}
/>
{{/if}}
</div>
</div>
Expand All @@ -55,7 +61,10 @@
{{if (eq datum.value 0) "is-empty"}}"
>
<JobPage::Parts::SummaryLegendItem @datum={{datum}} @index={{index}} />
<JobPage::Parts::SummaryLegendItem
@datum={{datum}}
@index={{index}}
/>
</li>
{{/each}}
</ol>
Expand Down Expand Up @@ -83,10 +92,16 @@
@model={{this.job}}
@query={{datum.legendLink.queryParams}}
>
<JobPage::Parts::SummaryLegendItem @datum={{datum}} @index={{index}} />
<JobPage::Parts::SummaryLegendItem
@datum={{datum}}
@index={{index}}
/>
</LinkTo>
{{else}}
<JobPage::Parts::SummaryLegendItem @datum={{datum}} @index={{index}} />
<JobPage::Parts::SummaryLegendItem
@datum={{datum}}
@index={{index}}
/>
{{/if}}
</li>
{{/each}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/job-subnav.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Versions
</LinkTo>
</li>
{{#if this.job.supportsDeployments}}
{{#if @job.supportsDeployments}}
<li data-test-tab="deployments">
<LinkTo
@route="jobs.job.deployments"
Expand Down
9 changes: 6 additions & 3 deletions ui/app/templates/components/list-accordion/accordion-head.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
</div>
<button
data-test-accordion-toggle
class="button is-light is-compact pull-right accordion-toggle {{unless this.isExpandable "is-invisible"}}"
data-test-accordion-summary-chart={{this.buttonType}}
class="button is-light is-compact pull-right accordion-toggle
{{unless this.isExpandable "is-invisible"}}"
onclick={{action (if this.isOpen this.onClose this.onOpen) this.item}}
type="button">
type="button"
>
{{this.buttonLabel}}
</button>
</button>
Loading

0 comments on commit 6c65966

Please sign in to comment.