Fixes some Ember Deprecations for 1.13:

- Remove ArrayController
- Remove {{view}} from templates
- Replace many cases of needs: [‘controller’] with inject
- Enable Ember Legacy Views
This commit is contained in:
Robin Ward
2016-10-20 13:26:41 -04:00
parent 2a61cc8c88
commit bf91532260
50 changed files with 255 additions and 336 deletions

View File

@ -1,19 +1,20 @@
import { ajax } from 'discourse/lib/ajax';
export default Ember.ArrayController.extend({
needs: ["adminBackups"],
status: Ember.computed.alias("controllers.adminBackups"),
export default Ember.Controller.extend({
adminBackups: Ember.inject.controller(),
status: Ember.computed.alias('adminBackups.model'),
uploadLabel: function() { return I18n.t("admin.backups.upload.label"); }.property(),
restoreTitle: function() {
if (!this.get('status.model.allowRestore')) {
if (!this.get('status.allowRestore')) {
return "admin.backups.operations.restore.is_disabled";
} else if (this.get("status.model.isOperationRunning")) {
} else if (this.get("status.isOperationRunning")) {
return "admin.backups.operations.is_running";
} else {
return "admin.backups.operations.restore.title";
}
}.property("status.model.{allowRestore,isOperationRunning}"),
}.property("status.{allowRestore,isOperationRunning}"),
actions: {