DEV: Ember 3.8.0

DEV: Ember 3.8.0

Co-Authored-By: majakomel maja.komel@gmail.com

diff --git a/Gemfile b/Gemfile
index 9d85677..5673b00 100644
--- a/Gemfile
+++ b/Gemfile
@@ -49,7 +49,7 @@ gem 'onebox', '1.8.86'
 gem 'http_accept_language', '~>2.0.5', require: false
 
 gem 'ember-rails', '0.18.5'
-gem 'discourse-ember-source', '~> 3.7.0'
+gem 'discourse-ember-source', '~> 3.8.0'
 gem 'ember-handlebars-template', '0.8.0'
 gem 'barber'
 
diff --git a/Gemfile.lock b/Gemfile.lock
index ba91430..8f7e311 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -108,7 +108,7 @@ GEM
       terminal-table (~> 1)
     debug_inspector (0.0.3)
     diff-lcs (1.3)
-    discourse-ember-source (3.7.0.2)
+    discourse-ember-source (3.8.0.1)
     discourse_image_optim (0.26.2)
       exifr (~> 1.2, >= 1.2.2)
       fspath (~> 3.0)
@@ -472,7 +472,7 @@ DEPENDENCIES
   colored2
   cppjieba_rb
   danger
-  discourse-ember-source (~> 3.7.0)
+  discourse-ember-source (~> 3.8.0)
   discourse_image_optim
   email_reply_trimmer (~> 0.1)
   ember-handlebars-template (= 0.8.0)
diff --git a/app/assets/javascripts/admin/components/resumable-upload.js.es6 b/app/assets/javascripts/admin/components/resumable-upload.js.es6
index e462d9e..c097a71 100644
--- a/app/assets/javascripts/admin/components/resumable-upload.js.es6
+++ b/app/assets/javascripts/admin/components/resumable-upload.js.es6
@@ -1,5 +1,6 @@
 import { iconHTML } from "discourse-common/lib/icon-library";
 import { bufferedRender } from "discourse-common/lib/buffered-render";
+import computed from "ember-addons/ember-computed-decorators";
 
 /*global Resumable:true */
 
@@ -27,18 +28,19 @@ export default Ember.Component.extend(
 
     rerenderTriggers: ["isUploading", "progress"],
 
-    translatedTitle: function() {
-      const title = this.get("title");
-      return title ? I18n.t(title) : this.get("text");
-    }.property("title", "text"),
+    @computed("title", "text")
+    translatedTitle(title, text) {
+      return title ? I18n.t(title) : text;
+    },
 
-    text: function() {
-      if (this.get("isUploading")) {
-        return this.get("progress") + " %";
+    @computed("isUploading", "progress")
+    text(isUploading, progress) {
+      if (isUploading) {
+        return progress + " %";
       } else {
         return this.get("uploadText");
       }
-    }.property("isUploading", "progress"),
+    },
 
     buildBuffer(buffer) {
       const icon = this.get("isUploading") ? "times" : "upload";
diff --git a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6
index 5bf29b0..d7e8005 100644
--- a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6
@@ -1,6 +1,7 @@
 import { popupAjaxError } from "discourse/lib/ajax-error";
 import { bufferedProperty } from "discourse/mixins/buffered-content";
 import { propertyNotEqual } from "discourse/lib/computed";
+import computed from "ember-addons/ember-computed-decorators";
 
 export default Ember.Controller.extend(bufferedProperty("model"), {
   adminBadges: Ember.inject.controller(),
@@ -17,14 +18,13 @@ export default Ember.Controller.extend(bufferedProperty("model"), {
   readOnly: Ember.computed.alias("buffered.system"),
   showDisplayName: propertyNotEqual("name", "displayName"),
 
-  hasQuery: function() {
-    const bQuery = this.get("buffered.query");
-    if (bQuery) {
-      return bQuery.trim().length > 0;
+  @computed("model.query", "buffered.query")
+  hasQuery(modelQuery, bufferedQuery) {
+    if (bufferedQuery) {
+      return bufferedQuery.trim().length > 0;
     }
-    const mQuery = this.get("model.query");
-    return mQuery && mQuery.trim().length > 0;
-  }.property("model.query", "buffered.query"),
+    return modelQuery && modelQuery.trim().length > 0;
+  },
 
   _resetSaving: function() {
     this.set("saving", false);
diff --git a/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6
index 5a20a94..3fafd28 100644
--- a/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-customize-email-templates-edit.js.es6
@@ -1,17 +1,18 @@
 import { popupAjaxError } from "discourse/lib/ajax-error";
 import { bufferedProperty } from "discourse/mixins/buffered-content";
+import computed from "ember-addons/ember-computed-decorators";
 
 export default Ember.Controller.extend(bufferedProperty("emailTemplate"), {
   saved: false,
 
-  hasMultipleSubjects: function() {
-    const buffered = this.get("buffered");
+  @computed("buffered")
+  hasMultipleSubjects(buffered) {
     if (buffered.getProperties("subject")["subject"]) {
       return false;
     } else {
       return buffered.getProperties("id")["id"];
     }
-  }.property("buffered"),
+  },
 
   actions: {
     saveChanges() {
diff --git a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6
index 16ed12e..9a596ad 100644
--- a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6
@@ -1,6 +1,7 @@
 import { exportEntity } from "discourse/lib/export-csv";
 import { outputExportResult } from "discourse/lib/export-result";
 import StaffActionLog from "admin/models/staff-action-log";
+import computed from "ember-addons/ember-computed-decorators";
 
 export default Ember.Controller.extend({
   loading: false,
@@ -20,14 +21,14 @@ export default Ember.Controller.extend({
     }
   }.observes("filterActionId"),
 
-  actionFilter: function() {
-    var name = this.get("filters.action_name");
+  @computed("filters.action_name")
+  actionFilter(name) {
     if (name) {
       return I18n.t("admin.logs.staff_actions.actions." + name);
     } else {
       return null;
     }
-  }.property("filters.action_name"),
+  },
 
   showInstructions: Ember.computed.gt("model.length", 0),
 
diff --git a/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 b/app/assets/javascripts/admin/controllers/admin-plugins.js.es6
index 5e91ad2..2e34bfc 100644
--- a/app/assets/javascripts/admin/controllers/admin-plugins.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-plugins.js.es6
@@ -1,4 +1,7 @@
+import computed from "ember-addons/ember-computed-decorators";
+
 export default Ember.Controller.extend({
+  @computed
   adminRoutes: function() {
     return this.get("model")
       .map(p => {
@@ -7,7 +10,8 @@ export default Ember.Controller.extend({
         }
       })
       .compact();
-  }.property(),
+  },
+
   actions: {
     clearFilter() {
       this.setProperties({ filter: "", onlyOverridden: false });
diff --git a/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6
index 06cec9f..06832ca 100644
--- a/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6
@@ -1,5 +1,6 @@
 import GrantBadgeController from "discourse/mixins/grant-badge-controller";
 import { popupAjaxError } from "discourse/lib/ajax-error";
+import computed from "ember-addons/ember-computed-decorators";
 
 export default Ember.Controller.extend(GrantBadgeController, {
   adminUser: Ember.inject.controller(),
@@ -10,7 +11,8 @@ export default Ember.Controller.extend(GrantBadgeController, {
   sortedBadges: Ember.computed.sort("model", "badgeSortOrder"),
   badgeSortOrder: ["granted_at:desc"],
 
-  groupedBadges: function() {
+  @computed("model", "model.[]", "model.expandedBadges.[]")
+  groupedBadges() {
     const allBadges = this.get("model");
 
     var grouped = _.groupBy(allBadges, badge => badge.badge_id);
@@ -46,7 +48,7 @@ export default Ember.Controller.extend(GrantBadgeController, {

[... diff too long, it was truncated ...]

GitHub sha: 4b455e74

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there: