feat: add sliceClick to job-page/summary

This commit is contained in:
Jai Bhagat
2021-12-16 11:24:03 -05:00
parent c6dd71322a
commit 094c1912f9
2 changed files with 20 additions and 1 deletions

View File

@@ -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;

View File

@@ -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|
}}
<ol data-test-legend class="legend">