From 5aa21b0fd57ee181b4aab079f03b082459d70672 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Wed, 30 Oct 2024 10:59:33 +1300 Subject: [PATCH] fix(tests/dummy/app): removes `application-controller.router-properties` deprecations. --- tests/dummy/app/controllers/application.js | 13 +++-- tests/dummy/app/templates/application.hbs | 68 +++++++++++----------- tests/dummy/app/templates/demo/tabs.hbs | 2 +- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/tests/dummy/app/controllers/application.js b/tests/dummy/app/controllers/application.js index fe45e3686..7c7c608c1 100644 --- a/tests/dummy/app/controllers/application.js +++ b/tests/dummy/app/controllers/application.js @@ -1,9 +1,12 @@ -/* eslint-disable ember/no-actions-hash, prettier/prettier */ +/* eslint-disable ember/no-actions-hash */ import { equal } from '@ember/object/computed'; import Controller from '@ember/controller'; import { computed } from '@ember/object'; +import { inject as service } from '@ember/service'; export default Controller.extend({ + router: service(), + actions: { toggleExpandedItem(value, ev) { if (this.expandedItem === value) { @@ -11,11 +14,11 @@ export default Controller.extend({ } this.set('expandedItem', value); ev.stopPropagation(); - } + }, }, - expandedItem: computed('currentRouteName', function() { - if (this.currentRouteName.substr(0, 6) === 'layout') { + expandedItem: computed('router.currentRouteName', function () { + if (this.router.currentRouteName.substr(0, 6) === 'layout') { return 'layout'; } else { return 'demos'; @@ -23,5 +26,5 @@ export default Controller.extend({ }), demosExpanded: equal('expandedItem', 'demos'), - layoutExpanded: equal('expandedItem', 'layout') + layoutExpanded: equal('expandedItem', 'layout'), }); diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs index ee405d002..983f5ddb6 100644 --- a/tests/dummy/app/templates/application.hbs +++ b/tests/dummy/app/templates/application.hbs @@ -11,54 +11,54 @@ - Introduction + Introduction Components - Forms - Typography - Color & Theme + Forms + Typography + Color & Theme Layout - Cookbook - Addons + Cookbook + Addons diff --git a/tests/dummy/app/templates/demo/tabs.hbs b/tests/dummy/app/templates/demo/tabs.hbs index 551c49f1e..db9107a5d 100644 --- a/tests/dummy/app/templates/demo/tabs.hbs +++ b/tests/dummy/app/templates/demo/tabs.hbs @@ -186,7 +186,7 @@
{{! BEGIN-SNIPPET routable-usage}} - + Index