autoland-ui: Fix linting errors (Bug 1343909). r?imadueme draft
authorDavid Walsh <dwalsh@mozilla.com>
Thu, 02 Mar 2017 10:22:36 -0600
changeset 281 b69a8d6e5e9673909828e37fd134e31a35be8241
parent 280 71a6ee2e89b803e5fd5d655ee7032e8451f1550d
child 282 2ee82b97253346dbeb063e0246660d8f588114e9
child 288 10143372a06b0a922302c58880dad5d41989d469
child 292 0076b904d7638beae2b2029501549529d8f5f748
push id130
push userbmo:dwalsh@mozilla.com
push dateThu, 02 Mar 2017 16:23:38 +0000
reviewersimadueme
bugs1343909
autoland-ui: Fix linting errors (Bug 1343909). r?imadueme MozReview-Commit-ID: 5KHAHSDZu3w
autoland/ui/src/components/AutolandController.jsx
autoland/ui/src/constants.js
--- a/autoland/ui/src/components/AutolandController.jsx
+++ b/autoland/ui/src/components/AutolandController.jsx
@@ -65,17 +65,17 @@ class AutolandController extends React.C
           this.resetStateWithUpdates({
             error: 'Response from landing request could not be parsed.',
           });
         });
       });
   };
 
   onTryLand = tryString => {
-    alert(`Landed to try with string: ${tryString}`);
+    if (tryString) { return; }
     this.setState({ hideTry: true });
   };
 
   renderTryChooser() {
     let tryChooser = null;
     if (!this.state.hideTry) {
       tryChooser = (
         <TryChooser
--- a/autoland/ui/src/constants.js
+++ b/autoland/ui/src/constants.js
@@ -1,5 +1,10 @@
+const hostname = window.location.hostname;
+
 const UI_PRODUCTION_HOSTNAME = 'autoland.mozilla.org';
 const API_PRODUCTION_ORIGIN = 'https://api.autoland.mozilla.org';
-const API_DEVELOPMENT_ORIGIN = `http://${window.location.hostname}:9999`;
-export const API_HOST = window.location.hostname === UI_PRODUCTION_HOSTNAME ? API_PRODUCTION_ORIGIN : API_DEVELOPMENT_ORIGIN;
+const API_DEVELOPMENT_ORIGIN = `http://${hostname}:9999`;
+
+export const API_HOST = (hostname === UI_PRODUCTION_HOSTNAME ?
+                                      API_PRODUCTION_ORIGIN :
+                                      API_DEVELOPMENT_ORIGIN);
 export const AUTOLAND_POST_ENDPOINT = '...';