From 094c1912f96f3a06e504795f436057f8e998e4ad Mon Sep 17 00:00:00 2001 From: Jai Bhagat Date: Thu, 16 Dec 2021 11:24:03 -0500 Subject: [PATCH] feat: add sliceClick to job-page/summary --- ui/app/components/job-page/parts/summary.js | 20 ++++++++++++++++++- .../components/job-page/parts/summary.hbs | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ui/app/components/job-page/parts/summary.js b/ui/app/components/job-page/parts/summary.js index 0cb821cc8..51aace4a4 100644 --- a/ui/app/components/job-page/parts/summary.js +++ b/ui/app/components/job-page/parts/summary.js @@ -1,14 +1,32 @@ import Component from '@ember/component'; -import { computed } from '@ember/object'; +import { action, computed } from '@ember/object'; +import { inject as service } from '@ember/service'; import { classNames } from '@ember-decorators/component'; import classic from 'ember-classic-decorator'; @classic @classNames('boxed-section') export default class Summary extends Component { + @service router; + job = null; forceCollapsed = false; + @action + gotoAllocations(status) { + this.router.transitionTo('jobs.job.allocations', this.job, { + queryParams: { + status: JSON.stringify(status), + namespace: this.job.get('namespace.name'), + }, + }); + } + + @action + onSliceClick(ev, slice) { + this.gotoAllocations([slice.label.camelize()]); + } + @computed('forceCollapsed') get isExpanded() { if (this.forceCollapsed) return false; diff --git a/ui/app/templates/components/job-page/parts/summary.hbs b/ui/app/templates/components/job-page/parts/summary.hbs index ebd75dc56..9b4ed8509 100644 --- a/ui/app/templates/components/job-page/parts/summary.hbs +++ b/ui/app/templates/components/job-page/parts/summary.hbs @@ -44,6 +44,7 @@ (if a.item.hasChildren "children-status-bar" "allocation-status-bar") allocationContainer=a.item.summary job=a.item.summary + onSliceClick=this.onSliceClick class="split-view" as |chart| }}