DEV: Apply prettier

DEV: Apply prettier

From 519effe056d08147b9b7c8fba05f2e8fc93f8ca2 Mon Sep 17 00:00:00 2001
From: David Taylor <david@taylorhq.com>
Date: Mon, 22 Oct 2018 19:49:32 +0100
Subject: [PATCH] DEV: Apply prettier


diff --git a/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6 b/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6
index 67fea45..afee7fd 100644
--- a/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6
+++ b/assets/javascripts/discourse-assign/assigned-messages-route-map.js.es6
@@ -1,6 +1,6 @@
 export default {
-  resource: 'user.userPrivateMessages',
+  resource: "user.userPrivateMessages",
   map() {
-    this.route('assigned');
+    this.route("assigned");
   }
 };
diff --git a/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6 b/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6
index 6dfa1e2..3547610 100644
--- a/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6
+++ b/assets/javascripts/discourse-assign/assigns-activity-route-map.js.es6
@@ -1,6 +1,6 @@
 export default {
-  resource: 'user.userActivity',
+  resource: "user.userActivity",
   map() {
-     this.route('assigned');
+    this.route("assigned");
   }
 };
diff --git a/assets/javascripts/discourse-assign/connectors/topic-footer-main-buttons-before-create/assign-button.js.es6 b/assets/javascripts/discourse-assign/connectors/topic-footer-main-buttons-before-create/assign-button.js.es6
index 1542597..04fa018 100644
--- a/assets/javascripts/discourse-assign/connectors/topic-footer-main-buttons-before-create/assign-button.js.es6
+++ b/assets/javascripts/discourse-assign/connectors/topic-footer-main-buttons-before-create/assign-button.js.es6
@@ -1,27 +1,30 @@
-import showModal from 'discourse/lib/show-modal';
-import { ajax } from 'discourse/lib/ajax';
+import showModal from "discourse/lib/show-modal";
+import { ajax } from "discourse/lib/ajax";
 
 export default {
   shouldRender(args, component) {
-    const needsButton = component.currentUser && component.currentUser.get('staff');
-    return needsButton && (!component.get('site.mobileView') || args.topic.get('isPrivateMessage'));
+    const needsButton =
+      component.currentUser && component.currentUser.get("staff");
+    return (
+      needsButton &&
+      (!component.get("site.mobileView") || args.topic.get("isPrivateMessage"))
+    );
   },
 
   actions: {
-    unassign(){
-
-      this.set('topic.assigned_to_user', null);
+    unassign() {
+      this.set("topic.assigned_to_user", null);
 
       return ajax("/assign/unassign", {
-        type: 'PUT',
-        data: { topic_id: this.get('topic.id')}
+        type: "PUT",
+        data: { topic_id: this.get("topic.id") }
       });
     },
-    assign(){
+    assign() {
       showModal("assign-user", {
         model: {
           topic: this.topic,
-          username: this.topic.get('assigned_to_user.username')
+          username: this.topic.get("assigned_to_user.username")
         }
       });
     }
diff --git a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6 b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6
index 153654e..a7ba007 100644
--- a/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6
+++ b/assets/javascripts/discourse-assign/connectors/user-messages-nav/assigned-messages.js.es6
@@ -1,6 +1,10 @@
 export function shouldShowAssigned(args, component) {
-  const needsButton = component.currentUser && component.currentUser.get('staff');
-  return needsButton && (!component.get('site.mobileView') || args.model.get('isPrivateMessage'));
+  const needsButton =
+    component.currentUser && component.currentUser.get("staff");
+  return (
+    needsButton &&
+    (!component.get("site.mobileView") || args.model.get("isPrivateMessage"))
+  );
 }
 
 export default {
diff --git a/assets/javascripts/discourse-assign/controllers/assign-user.js.es6 b/assets/javascripts/discourse-assign/controllers/assign-user.js.es6
index 17fdeaf..adf3b2e 100644
--- a/assets/javascripts/discourse-assign/controllers/assign-user.js.es6
+++ b/assets/javascripts/discourse-assign/controllers/assign-user.js.es6
@@ -1,10 +1,9 @@
 //import { default as computed } from 'ember-addons/ember-computed-decorators';
-import { ajax } from 'discourse/lib/ajax';
-import { popupAjaxError } from 'discourse/lib/ajax-error';
+import { ajax } from "discourse/lib/ajax";
+import { popupAjaxError } from "discourse/lib/ajax-error";
 
 export default Ember.Controller.extend({
-
-  assignSuggestions: function(){
+  assignSuggestions: function() {
     ajax("/assign/suggestions").then(users => {
       this.set("assignSuggestions", users);
     });
@@ -17,26 +16,30 @@ export default Ember.Controller.extend({
 
   actions: {
     assignUser(user) {
-      this.set('model.username', user.username);
-      this.send('assign');
+      this.set("model.username", user.username);
+      this.send("assign");
     },
-    assign(){
-
-      let path = '/assign/assign';
+    assign() {
+      let path = "/assign/assign";
 
-      if (Ember.isEmpty(this.get('model.username'))) {
-        path = '/assign/unassign';
-        this.set('model.assigned_to_user', null);
+      if (Ember.isEmpty(this.get("model.username"))) {
+        path = "/assign/unassign";
+        this.set("model.assigned_to_user", null);
       }
 
-      this.send('closeModal');
-
-      return ajax(path,{
-        type: 'PUT',
-        data: { username: this.get('model.username'), topic_id: this.get('model.topic.id') }
-      }).then(()=>{
-        // done
-      }).catch(popupAjaxError);
+      this.send("closeModal");
+
+      return ajax(path, {
+        type: "PUT",
+        data: {
+          username: this.get("model.username"),
+          topic_id: this.get("model.topic.id")
+        }
+      })
+        .then(() => {
+          // done
+        })
+        .catch(popupAjaxError);
     }
   }
 });
diff --git a/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6 b/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6
index 5545517..cd1c8aa 100644
--- a/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6
+++ b/assets/javascripts/discourse-assign/controllers/user-activity-assigned.js.es6
@@ -1,25 +1,27 @@
-import { ajax } from 'discourse/lib/ajax';
-import computed from 'ember-addons/ember-computed-decorators';
+import { ajax } from "discourse/lib/ajax";
+import computed from "ember-addons/ember-computed-decorators";
 
 export default Ember.Controller.extend({
   user: Ember.inject.controller(),
 
-  @computed('model.topics')
+  @computed("model.topics")
   canUnassignAll(topics) {
-    return topics && topics.length && this.currentUser.get('staff');
+    return topics && topics.length && this.currentUser.get("staff");
   },
 
   actions: {
     unassignAll() {
-      let user = this.get('user.model');
+      let user = this.get("user.model");
       bootbox.confirm(
-        I18n.t("discourse_assign.unassign_all.confirm", { username: user.get('username') }),
+        I18n.t("discourse_assign.unassign_all.confirm", {
+          username: user.get("username")
+        }),
         value => {
           if (value) {
             ajax("/assign/unassign-all", {
-              type: 'PUT',
-              data: { user_id: user.get('id') }
-            }).then(() => this.send('unassignedAll'));
+              type: "PUT",
+              data: { user_id: user.get("id") }
+            }).then(() => this.send("unassignedAll"));
           }
         }
       );
diff --git a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
index a06f4ff..9fa9f6b 100644
--- a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
+++ b/assets/javascripts/discourse-assign/ini

GitHub

2 Likes