-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3974 from hashicorp/f-ui-allocations-use-job-brea…
…dcrumbs UI: Allocation and task breadcrumbs extend job breadcrumbs
- Loading branch information
Showing
18 changed files
with
200 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
import Controller from '@ember/controller'; | ||
import { computed } from '@ember/object'; | ||
import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; | ||
|
||
export default Controller.extend({}); | ||
export default Controller.extend({ | ||
breadcrumbs: computed('model.job', function() { | ||
return [ | ||
{ label: 'Jobs', args: ['jobs'] }, | ||
{ | ||
label: this.get('model.job.name'), | ||
args: [ | ||
'jobs.job', | ||
this.get('model.job'), | ||
qpBuilder({ | ||
jobNamespace: this.get('model.namespace.name') || 'default', | ||
}), | ||
], | ||
}, | ||
{ | ||
label: this.get('model.taskGroupName'), | ||
args: [ | ||
'jobs.job.task-group', | ||
this.get('model.job'), | ||
this.get('model.taskGroupName'), | ||
qpBuilder({ | ||
jobNamespace: this.get('model.namespace.name') || 'default', | ||
}), | ||
], | ||
}, | ||
{ | ||
label: this.get('model.shortId'), | ||
args: ['allocations.allocation', this.get('model')], | ||
}, | ||
]; | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Controller, { inject as controller } from '@ember/controller'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default Controller.extend({ | ||
allocationController: controller('allocations.allocation'), | ||
|
||
breadcrumbs: computed('allocationController.breadcrumbs.[]', 'model.name', function() { | ||
return this.get('allocationController.breadcrumbs').concat([ | ||
{ | ||
label: this.get('model.name'), | ||
args: ['allocations.allocation.task', this.get('model.allocation'), this.get('model')], | ||
}, | ||
]); | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Controller, { inject as controller } from '@ember/controller'; | ||
import { alias } from '@ember/object/computed'; | ||
|
||
export default Controller.extend({ | ||
taskController: controller('allocations.allocation.task'), | ||
breadcrumbs: alias('taskController.breadcrumbs'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copied from source since it isn't exposed to import | ||
// https://github.com/emberjs/ember.js/blob/v2.18.2/packages/ember-routing/lib/system/query_params.js | ||
import EmberObject from '@ember/object'; | ||
|
||
const QueryParams = EmberObject.extend({ | ||
isQueryParams: true, | ||
values: null, | ||
}); | ||
|
||
export const qpBuilder = values => QueryParams.create({ values }); | ||
|
||
export default QueryParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters