-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Convert routes to ES6 classes
- Loading branch information
1 parent
123ee72
commit bbd0684
Showing
143 changed files
with
922 additions
and
551 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class AccountRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Account'); | ||
} | ||
}); | ||
} |
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,11 +1,14 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default Route.extend(AuthenticatedRouteMixin, { | ||
@classic | ||
export default class ApplicationsRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
titleToken() { | ||
return this.l10n.t('Applications'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.authManager.currentUser; | ||
} | ||
}); | ||
} |
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,8 +1,10 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default Route.extend(AuthenticatedRouteMixin, { | ||
@classic | ||
export default class BillingRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
titleToken() { | ||
return this.l10n.t('Billing Info'); | ||
} | ||
}); | ||
} |
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,8 +1,10 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class IndexRoute extends Route { | ||
beforeModel() { | ||
this._super(...arguments); | ||
super.beforeModel(...arguments); | ||
this.transitionTo('account.billing.invoices.list', 'all'); | ||
} | ||
}); | ||
} |
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,11 +1,14 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default Route.extend(AuthenticatedRouteMixin, { | ||
@classic | ||
export default class EmailPreferencesRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
titleToken() { | ||
return this.l10n.t('Email Preferences'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.authManager.currentUser.query('emailNotifications', { include: 'event' }); | ||
} | ||
}); | ||
} |
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,8 +1,10 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class IndexRoute extends Route { | ||
beforeModel() { | ||
this._super(...arguments); | ||
super.beforeModel(...arguments); | ||
this.transitionTo('account.profile'); | ||
} | ||
}); | ||
} |
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,8 +1,10 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default Route.extend(AuthenticatedRouteMixin, { | ||
@classic | ||
export default class PasswordRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
titleToken() { | ||
return this.l10n.t('Password'); | ||
} | ||
}); | ||
} |
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,18 +1,20 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import { action } from '@ember/object'; | ||
import Route from '@ember/routing/route'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default Route.extend(AuthenticatedRouteMixin, { | ||
@classic | ||
export default class ProfileRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
titleToken() { | ||
return this.l10n.t('Profile'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.authManager.currentUser; | ||
}, | ||
} | ||
|
||
actions: { | ||
willTransition() { | ||
this.authManager.currentUser.rollbackAttributes(); | ||
} | ||
@action | ||
willTransition() { | ||
this.authManager.currentUser.rollbackAttributes(); | ||
} | ||
}); | ||
} |
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,8 +1,10 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | ||
|
||
export default Route.extend(AuthenticatedRouteMixin, { | ||
@classic | ||
export default class AdminRoute extends Route.extend(AuthenticatedRouteMixin) { | ||
titleToken() { | ||
return this.l10n.t('Administration'); | ||
} | ||
}); | ||
} |
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,7 +1,9 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class ContentRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Content'); | ||
} | ||
}); | ||
} |
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,15 +1,19 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import { action } from '@ember/object'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class IndexRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Social Links'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.store.queryRecord('setting', {}); | ||
}, | ||
actions: { | ||
willTransition() { | ||
this.controller.model.rollbackAttributes(); | ||
} | ||
} | ||
}); | ||
|
||
@action | ||
willTransition() { | ||
this.controller.model.rollbackAttributes(); | ||
} | ||
} |
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,11 +1,13 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class PagesRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Pages'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.store.findAll('page'); | ||
} | ||
}); | ||
} |
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,19 +1,23 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class SystemImagesRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('System Images'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.store.query('event-topic', { | ||
include : 'event-sub-topics', | ||
sort : 'name' | ||
}); | ||
}, | ||
} | ||
|
||
afterModel(model, transition) { | ||
this._super(...arguments); | ||
super.afterModel(...arguments); | ||
if (transition.targetName === 'admin.content.system-images.index') { | ||
this.replaceWith('admin.content.system-images.list', model.toArray()[0].id); | ||
} | ||
} | ||
}); | ||
} |
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,11 +1,14 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class ListRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Sub topics'); | ||
}, | ||
} | ||
|
||
model(params) { | ||
this.set('params', params); | ||
return this.store.findRecord('event-topic', params.topic_id, { include: 'event-sub-topics' }); | ||
} | ||
}); | ||
} |
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,7 +1,9 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class EventsRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Events'); | ||
} | ||
}); | ||
} |
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,7 +1,9 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class ImportRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Import'); | ||
} | ||
}); | ||
} |
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,8 +1,10 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class IndexRoute extends Route { | ||
beforeModel() { | ||
this._super(...arguments); | ||
super.beforeModel(...arguments); | ||
this.transitionTo('admin.events.list', 'live'); | ||
} | ||
}); | ||
} |
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,10 +1,13 @@ | ||
import classic from 'ember-classic-decorator'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
@classic | ||
export default class MessagesRoute extends Route { | ||
titleToken() { | ||
return this.l10n.t('Messages'); | ||
}, | ||
} | ||
|
||
model() { | ||
return this.store.query('message-setting', {}); | ||
} | ||
}); | ||
} |
Oops, something went wrong.