DEV: removes application.currentPath deprecation (#7905)

See https://deprecations.emberjs.com/v3.x#toc_application-controller-router-properties for more context
This commit is contained in:
Joffrey JAFFEUX 2019-07-18 19:29:37 +02:00 committed by Robin Ward
parent 617c74bc79
commit f9c7d5a4bd
17 changed files with 23 additions and 22 deletions

View File

@ -1,7 +1,7 @@
import computed from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
application: Ember.inject.controller(),
router: Ember.inject.service(),
@computed("siteSettings.enable_group_directory")
showGroups(enableGroupDirectory) {
@ -13,7 +13,7 @@ export default Ember.Controller.extend({
return this.currentUser.get("admin") && enableBadges;
},
@computed("application.currentPath")
@computed("router.currentRouteName")
adminContentsClassName(currentPath) {
let cssClasses = currentPath
.split(".")

View File

@ -1,4 +1,4 @@
export default Ember.Controller.extend({
application: Ember.inject.controller(),
router: Ember.inject.service(),
queryParams: ["category_id"]
});

View File

@ -1,7 +1,7 @@
import { default as computed } from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
application: Ember.inject.controller(),
router: Ember.inject.service(),
@computed("model.automatic")
tabs(automatic) {

View File

@ -1,3 +1,3 @@
export default Ember.Controller.extend({
application: Ember.inject.controller()
router: Ember.inject.service()
});

View File

@ -1,3 +1,3 @@
export default Ember.Controller.extend({
application: Ember.inject.controller()
router: Ember.inject.service()
});

View File

@ -2,6 +2,7 @@ import { exportUserArchive } from "discourse/lib/export-csv";
export default Ember.Controller.extend({
application: Ember.inject.controller(),
router: Ember.inject.service(),
user: Ember.inject.controller(),
userActionType: null,

View File

@ -6,7 +6,7 @@ import {
export default Ember.Controller.extend({
topic: Ember.inject.controller(),
application: Ember.inject.controller(),
router: Ember.inject.service(),
actions: {
togglePosts(user) {

View File

@ -2,14 +2,14 @@ import computed from "ember-addons/ember-computed-decorators";
import Topic from "discourse/models/topic";
export default Ember.Controller.extend({
application: Ember.inject.controller(),
router: Ember.inject.service(),
userTopicsList: Ember.inject.controller("user-topics-list"),
user: Ember.inject.controller(),
pmView: false,
viewingSelf: Ember.computed.alias("user.viewingSelf"),
isGroup: Ember.computed.equal("pmView", "groups"),
currentPath: Ember.computed.alias("application.currentPath"),
currentPath: Ember.computed.alias("router.currentRouteName"),
selected: Ember.computed.alias("userTopicsList.selected"),
bulkSelectEnabled: Ember.computed.alias("userTopicsList.bulkSelectEnabled"),
showToggleBulkSelect: true,

View File

@ -5,9 +5,9 @@ import optionalService from "discourse/lib/optional-service";
export default Ember.Controller.extend(CanCheckEmails, {
indexStream: false,
application: Ember.inject.controller(),
router: Ember.inject.service(),
userNotifications: Ember.inject.controller("user-notifications"),
currentPath: Ember.computed.alias("application.currentPath"),
currentPath: Ember.computed.alias("router.currentRouteName"),
adminTools: optionalService(),
@computed("model.username")

View File

@ -56,10 +56,10 @@
<div class="user-content-wrapper">
<section class="user-primary-navigation">
<div class="container">
{{group-navigation group=model currentPath=application.currentPath tabs=tabs}}
{{group-navigation group=model currentPath=router.currentRouteName tabs=tabs}}
</div>
</section>
{{outlet}}
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
<section class="user-secondary-navigation">
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=application.currentPath}}
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router.currentRouteName}}
{{group-activity-filter filter="posts" categoryId=category_id}}
{{group-activity-filter filter="topics" categoryId=category_id}}
{{#if siteSettings.enable_mentions}}

View File

@ -1,5 +1,5 @@
<section class='user-secondary-navigation'>
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=application.currentPath}}
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router.currentRouteName}}
{{#each tabs as |tab|}}
<li>
{{#link-to tab.route model.name}}

View File

@ -1,5 +1,5 @@
<section class="user-secondary-navigation">
{{#mobile-nav class='messages-nav' desktopClass='nav-stacked action-list' currentPath=application.currentPath}}
{{#mobile-nav class='messages-nav' desktopClass='nav-stacked action-list' currentPath=router.currentRouteName}}
<li>
{{#link-to 'group.messages.inbox' model.name}}

View File

@ -1,5 +1,5 @@
{{#d-section pageClass="user-preferences" class="user-secondary-navigation"}}
{{#mobile-nav class='preferences-nav' desktopClass='preferences-list action-list nav-stacked' currentPath=application.currentPath}}
{{#mobile-nav class='preferences-nav' desktopClass='preferences-list action-list nav-stacked' currentPath=router.currentRouteName}}
<li class='nav-account'>
{{#link-to 'preferences.account'}}
{{i18n 'user.preferences_nav.account'}}

View File

@ -3,14 +3,14 @@
{{/if}}
{{user-card-contents
currentPath=application.currentPath
currentPath=router.currentRouteName
topic=topic.model
showUser=(action "showUser")
togglePosts=(action "togglePosts")
createNewMessageViaParams=(route-action "createNewMessageViaParams")}}
{{group-card-contents
currentPath=application.currentPath
currentPath=router.currentRouteName
topic=topic.model
showUser=(action "showUser")
showGroup=(action "showGroup")

View File

@ -1,5 +1,5 @@
{{#d-section pageClass="user-activity" class="user-secondary-navigation" scrollTop="false"}}
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=application.currentPath}}
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=router.currentRouteName}}
<li>
{{#link-to 'userActivity.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
</li>
@ -26,7 +26,7 @@
connectorTagName='li'
args=(hash model=model)}}
{{/mobile-nav}}
{{/d-section}}
{{#if canDownloadPosts}}
<section class='user-additional-controls'>

View File

@ -1,5 +1,5 @@
{{#d-section pageClass="user-notifications" class="user-secondary-navigation"}}
{{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=application.currentPath}}
{{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=router.currentRouteName}}
<li>
{{#link-to 'userNotifications.index'}}
{{i18n 'user.filters.all'}}