From 0f90e066eefc07d0fa83242bbf9c62b8947536c8 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 27 Jun 2018 13:39:57 -0700 Subject: [PATCH] Remove all references to breadcrumbs outside of routes --- ui/app/components/job-page/abstract.js | 19 ---------- ui/app/controllers/allocations/allocation.js | 36 ------------------- .../allocations/allocation/index.js | 6 +--- .../allocations/allocation/task.js | 15 -------- .../allocations/allocation/task/index.js | 6 +--- .../allocations/allocation/task/logs.js | 7 ---- ui/app/controllers/jobs/job.js | 21 ----------- ui/app/controllers/jobs/job/definition.js | 11 ++---- ui/app/controllers/jobs/job/deployments.js | 12 ++----- ui/app/controllers/jobs/job/index.js | 8 +---- ui/app/controllers/jobs/job/loading.js | 7 ---- ui/app/controllers/jobs/job/task-group.js | 18 +--------- ui/app/controllers/jobs/job/versions.js | 12 ++----- ui/app/templates/jobs/job/deployments.hbs | 2 +- ui/app/templates/jobs/job/versions.hbs | 2 +- 15 files changed, 12 insertions(+), 170 deletions(-) delete mode 100644 ui/app/controllers/allocations/allocation.js delete mode 100644 ui/app/controllers/allocations/allocation/task.js delete mode 100644 ui/app/controllers/allocations/allocation/task/logs.js delete mode 100644 ui/app/controllers/jobs/job.js delete mode 100644 ui/app/controllers/jobs/job/loading.js diff --git a/ui/app/components/job-page/abstract.js b/ui/app/components/job-page/abstract.js index d2922c2af..01f63b2cf 100644 --- a/ui/app/components/job-page/abstract.js +++ b/ui/app/components/job-page/abstract.js @@ -1,7 +1,5 @@ import Component from '@ember/component'; -import { computed } from '@ember/object'; import { inject as service } from '@ember/service'; -import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; export default Component.extend({ system: service(), @@ -20,23 +18,6 @@ export default Component.extend({ // Set to a { title, description } to surface an error errorMessage: null, - breadcrumbs: computed('job.{name,id}', function() { - const job = this.get('job'); - return [ - { label: 'Jobs', args: ['jobs'] }, - { - label: job.get('name'), - args: [ - 'jobs.job', - job, - qpBuilder({ - jobNamespace: job.get('namespace.name') || 'default', - }), - ], - }, - ]; - }), - actions: { clearErrorMessage() { this.set('errorMessage', null); diff --git a/ui/app/controllers/allocations/allocation.js b/ui/app/controllers/allocations/allocation.js deleted file mode 100644 index 4f44f27bf..000000000 --- a/ui/app/controllers/allocations/allocation.js +++ /dev/null @@ -1,36 +0,0 @@ -import Controller from '@ember/controller'; -import { computed } from '@ember/object'; -import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; - -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.plainId'), - qpBuilder({ - jobNamespace: this.get('model.job.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')], - }, - ]; - }), -}); diff --git a/ui/app/controllers/allocations/allocation/index.js b/ui/app/controllers/allocations/allocation/index.js index 1131d6b7f..b6fd778ba 100644 --- a/ui/app/controllers/allocations/allocation/index.js +++ b/ui/app/controllers/allocations/allocation/index.js @@ -1,11 +1,9 @@ import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import Sortable from 'nomad-ui/mixins/sortable'; import { lazyClick } from 'nomad-ui/helpers/lazy-click'; export default Controller.extend(Sortable, { - allocationController: controller('allocations.allocation'), - queryParams: { sortProperty: 'sort', sortDescending: 'desc', @@ -14,8 +12,6 @@ export default Controller.extend(Sortable, { sortProperty: 'name', sortDescending: false, - breadcrumbs: alias('allocationController.breadcrumbs'), - listToSort: alias('model.states'), sortedStates: alias('listSorted'), diff --git a/ui/app/controllers/allocations/allocation/task.js b/ui/app/controllers/allocations/allocation/task.js deleted file mode 100644 index 616df57a3..000000000 --- a/ui/app/controllers/allocations/allocation/task.js +++ /dev/null @@ -1,15 +0,0 @@ -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')], - }, - ]); - }), -}); diff --git a/ui/app/controllers/allocations/allocation/task/index.js b/ui/app/controllers/allocations/allocation/task/index.js index e45f85230..c020bc4a2 100644 --- a/ui/app/controllers/allocations/allocation/task/index.js +++ b/ui/app/controllers/allocations/allocation/task/index.js @@ -1,12 +1,8 @@ -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import { computed } from '@ember/object'; import { alias } from '@ember/object/computed'; export default Controller.extend({ - taskController: controller('allocations.allocation.task'), - - breadcrumbs: alias('taskController.breadcrumbs'), - network: alias('model.resources.networks.firstObject'), ports: computed('network.reservedPorts.[]', 'network.dynamicPorts.[]', function() { return (this.get('network.reservedPorts') || []) diff --git a/ui/app/controllers/allocations/allocation/task/logs.js b/ui/app/controllers/allocations/allocation/task/logs.js deleted file mode 100644 index 6ce1642b5..000000000 --- a/ui/app/controllers/allocations/allocation/task/logs.js +++ /dev/null @@ -1,7 +0,0 @@ -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'), -}); diff --git a/ui/app/controllers/jobs/job.js b/ui/app/controllers/jobs/job.js deleted file mode 100644 index 29c87a2a2..000000000 --- a/ui/app/controllers/jobs/job.js +++ /dev/null @@ -1,21 +0,0 @@ -import Controller from '@ember/controller'; -import { computed } from '@ember/object'; -import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; - -export default Controller.extend({ - breadcrumbs: computed('model.{name,id}', function() { - return [ - { label: 'Jobs', args: ['jobs'] }, - { - label: this.get('model.name'), - args: [ - 'jobs.job', - this.get('model.plainId'), - qpBuilder({ - jobNamespace: this.get('model.namespace.name') || 'default', - }), - ], - }, - ]; - }), -}); diff --git a/ui/app/controllers/jobs/job/definition.js b/ui/app/controllers/jobs/job/definition.js index b105b72b0..f209d3547 100644 --- a/ui/app/controllers/jobs/job/definition.js +++ b/ui/app/controllers/jobs/job/definition.js @@ -1,11 +1,4 @@ -import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; -export default Controller.extend(WithNamespaceResetting, { - jobController: controller('jobs.job'), - - job: alias('model.job'), - - breadcrumbs: alias('jobController.breadcrumbs'), -}); +export default Controller.extend(WithNamespaceResetting); diff --git a/ui/app/controllers/jobs/job/deployments.js b/ui/app/controllers/jobs/job/deployments.js index 0540c98b1..f209d3547 100644 --- a/ui/app/controllers/jobs/job/deployments.js +++ b/ui/app/controllers/jobs/job/deployments.js @@ -1,12 +1,4 @@ -import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; -export default Controller.extend(WithNamespaceResetting, { - jobController: controller('jobs.job'), - - job: alias('model'), - deployments: alias('model.deployments'), - - breadcrumbs: alias('jobController.breadcrumbs'), -}); +export default Controller.extend(WithNamespaceResetting); diff --git a/ui/app/controllers/jobs/job/index.js b/ui/app/controllers/jobs/job/index.js index 8dc0ae650..617874ba5 100644 --- a/ui/app/controllers/jobs/job/index.js +++ b/ui/app/controllers/jobs/job/index.js @@ -1,13 +1,10 @@ import { inject as service } from '@ember/service'; -import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; export default Controller.extend(WithNamespaceResetting, { system: service(), - jobController: controller('jobs.job'), - queryParams: { currentPage: 'page', sortProperty: 'sort', @@ -19,9 +16,6 @@ export default Controller.extend(WithNamespaceResetting, { sortProperty: 'name', sortDescending: false, - breadcrumbs: alias('jobController.breadcrumbs'), - job: alias('model'), - actions: { gotoTaskGroup(taskGroup) { this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup); diff --git a/ui/app/controllers/jobs/job/loading.js b/ui/app/controllers/jobs/job/loading.js deleted file mode 100644 index 2251e2d75..000000000 --- a/ui/app/controllers/jobs/job/loading.js +++ /dev/null @@ -1,7 +0,0 @@ -import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; - -export default Controller.extend({ - jobController: controller('jobs.job'), - breadcrumbs: alias('jobController.breadcrumbs'), -}); diff --git a/ui/app/controllers/jobs/job/task-group.js b/ui/app/controllers/jobs/job/task-group.js index 1ace41f8f..6f8740ce0 100644 --- a/ui/app/controllers/jobs/job/task-group.js +++ b/ui/app/controllers/jobs/job/task-group.js @@ -1,14 +1,11 @@ import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import { computed } from '@ember/object'; import Sortable from 'nomad-ui/mixins/sortable'; import Searchable from 'nomad-ui/mixins/searchable'; import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; -import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; export default Controller.extend(Sortable, Searchable, WithNamespaceResetting, { - jobController: controller('jobs.job'), - queryParams: { currentPage: 'page', searchTerm: 'search', @@ -32,19 +29,6 @@ export default Controller.extend(Sortable, Searchable, WithNamespaceResetting, { listToSearch: alias('listSorted'), sortedAllocations: alias('listSearched'), - breadcrumbs: computed('jobController.breadcrumbs.[]', 'model.{name}', function() { - return this.get('jobController.breadcrumbs').concat([ - { - label: this.get('model.name'), - args: [ - 'jobs.job.task-group', - this.get('model.name'), - qpBuilder({ jobNamespace: this.get('model.job.namespace.name') || 'default' }), - ], - }, - ]); - }), - actions: { gotoAllocation(allocation) { this.transitionToRoute('allocations.allocation', allocation); diff --git a/ui/app/controllers/jobs/job/versions.js b/ui/app/controllers/jobs/job/versions.js index eb669a22b..f209d3547 100644 --- a/ui/app/controllers/jobs/job/versions.js +++ b/ui/app/controllers/jobs/job/versions.js @@ -1,12 +1,4 @@ -import { alias } from '@ember/object/computed'; -import Controller, { inject as controller } from '@ember/controller'; +import Controller from '@ember/controller'; import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; -export default Controller.extend(WithNamespaceResetting, { - jobController: controller('jobs.job'), - - job: alias('model'), - versions: alias('model.versions'), - - breadcrumbs: alias('jobController.breadcrumbs'), -}); +export default Controller.extend(WithNamespaceResetting); diff --git a/ui/app/templates/jobs/job/deployments.hbs b/ui/app/templates/jobs/job/deployments.hbs index 22f6c268c..1f17dcfa3 100644 --- a/ui/app/templates/jobs/job/deployments.hbs +++ b/ui/app/templates/jobs/job/deployments.hbs @@ -4,6 +4,6 @@ {{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} {{partial "jobs/job/subnav"}}
- {{job-deployments-stream deployments=deployments}} + {{job-deployments-stream deployments=model.deployments}}
{{/gutter-menu}} diff --git a/ui/app/templates/jobs/job/versions.hbs b/ui/app/templates/jobs/job/versions.hbs index 641dd13e5..541fb1bb4 100644 --- a/ui/app/templates/jobs/job/versions.hbs +++ b/ui/app/templates/jobs/job/versions.hbs @@ -4,6 +4,6 @@ {{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}} {{partial "jobs/job/subnav"}}
- {{job-versions-stream versions=versions verbose=true}} + {{job-versions-stream versions=model.versions verbose=true}}
{{/gutter-menu}}