From 9fff407595114b60554a18965f04d38a562bcf47 Mon Sep 17 00:00:00 2001 From: Jerry Nummi Date: Thu, 19 Sep 2019 10:23:18 -0700 Subject: [PATCH] Tidy up Container tab --- app/controllers/container-type.js | 37 ++++++++++--------- app/controllers/container-types/index.js | 9 ++--- app/templates/components/item-types.hbs | 16 ++++---- app/templates/container-type-toolbar.hbs | 2 +- app/templates/container-type.hbs | 5 ++- app/templates/container-types.hbs | 16 ++++---- .../container-types/index-toolbar.hbs | 2 +- app/templates/model-types.hbs | 16 ++++---- 8 files changed, 53 insertions(+), 50 deletions(-) diff --git a/app/controllers/container-type.js b/app/controllers/container-type.js index 57fdcd23d0..f6e7a3a4fb 100644 --- a/app/controllers/container-type.js +++ b/app/controllers/container-type.js @@ -1,4 +1,4 @@ -import { get, computed } from '@ember/object'; +import { action, get, computed } from '@ember/object'; import Controller, { inject as controller } from '@ember/controller'; import debounceComputed from 'ember-inspector/computed/debounce'; import searchMatch from 'ember-inspector/utils/search-match'; @@ -34,22 +34,23 @@ export default Controller.extend({ this.sortProperties = ['name']; }, - actions: { - /** - * Inspect an instance in the object inspector. - * Called whenever an item in the list is clicked. - * - * @method inspectInstance - * @param {Object} obj - */ - inspectInstance(obj) { - if (!get(obj, 'inspectable')) { - return; - } - this.port.send('objectInspector:inspectByContainerLookup', { name: get(obj, 'fullName') }); - }, - sendContainerToConsole() { - this.port.send('objectInspector:sendContainerToConsole'); + /** + * Inspect an instance in the object inspector. + * Called whenever an item in the list is clicked. + * + * @method inspectInstance + * @param {Object} obj + */ + inspectInstance: action(function(obj) { + if (!get(obj, 'inspectable')) { + return; } - } + this.port.send('objectInspector:inspectByContainerLookup', { + name: get(obj, 'fullName') + }); + }), + + sendContainerToConsole: action(function() { + this.port.send('objectInspector:sendContainerToConsole'); + }), }); diff --git a/app/controllers/container-types/index.js b/app/controllers/container-types/index.js index e9f948389b..7079cf9e22 100644 --- a/app/controllers/container-types/index.js +++ b/app/controllers/container-types/index.js @@ -1,9 +1,8 @@ +import { action } from '@ember/object'; import Controller from '@ember/controller'; export default Controller.extend({ - actions: { - sendContainerToConsole() { - this.port.send('objectInspector:sendContainerToConsole'); - } - } + sendContainerToConsole: action(function() { + this.port.send('objectInspector:sendContainerToConsole'); + }) }); diff --git a/app/templates/components/item-types.hbs b/app/templates/components/item-types.hbs index 787839d4dd..a46a8d4b09 100644 --- a/app/templates/components/item-types.hbs +++ b/app/templates/components/item-types.hbs @@ -1,25 +1,25 @@
{{#draggable-column classes="split__panel split__panel--sidebar-2 nav" - setIsDragging=setIsDragging - width=width + setIsDragging=@setIsDragging + width=@width }}
-

{{header}}

+

{{@header}}

    - {{#each sorted as |itemType|}} -
  • + {{#each @sorted as |itemType|}} +
  • {{#link-to - (if (eq type "model") "records" "container-type") + (if (eq @type "model") "records" "container-type") (escape-url itemType.name) class="nav__item" }} - + {{itemType.name}} - {{itemType.count}} + {{itemType.count}} {{/link-to}}
  • {{/each}} diff --git a/app/templates/container-type-toolbar.hbs b/app/templates/container-type-toolbar.hbs index 2c5d40c98e..d831d5299c 100644 --- a/app/templates/container-type-toolbar.hbs +++ b/app/templates/container-type-toolbar.hbs @@ -6,7 +6,7 @@ - + diff --git a/app/templates/container-type.hbs b/app/templates/container-type.hbs index 9fc45ca4a8..a244b74156 100644 --- a/app/templates/container-type.hbs +++ b/app/templates/container-type.hbs @@ -10,7 +10,10 @@ }} {{#r.cell as |value|}} {{#if value.inspectable}} - diff --git a/app/templates/model-types.hbs b/app/templates/model-types.hbs index 0644f7ccb1..f31dd7d422 100644 --- a/app/templates/model-types.hbs +++ b/app/templates/model-types.hbs @@ -1,9 +1,9 @@ -{{#item-types - header="Model Types" - setIsDragging=(action "setIsDragging" target=application) - sorted=(readonly (if orderByRecordCount sortByDescCount sortByName)) - type="model" - width=navWidth -}} + {{outlet}} -{{/item-types}} +