Backed out 2 changesets (bug 1488503) for failing in browser_misused_characters_in_strings.js CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Wed, 20 Mar 2019 19:12:27 +0200
changeset 465247 989c91cf970eebff42ea372951399cdfaa8ccf03
parent 465246 a1e3236f2f5307571e516f55994f8c088ddb204f
child 465248 99079ab7e52e38f0698b184c3a9209f0badbde80
push id80981
push usernerli@mozilla.com
push dateWed, 20 Mar 2019 17:12:48 +0000
treeherderautoland@989c91cf970e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1488503
milestone68.0a1
backs out1b763fdfc0ba121950f386e15d7b72432079835d
4968b44840749c5f83a74c1c3e7371eb9b4159ba
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1488503) for failing in browser_misused_characters_in_strings.js CLOSED TREE Backed out changeset 1b763fdfc0ba (bug 1488503) Backed out changeset 4968b4484074 (bug 1488503)
devtools/client/aboutdebugging-new/src/components/connect/ConnectPage.js
devtools/client/aboutdebugging-new/src/components/connect/NetworkLocationsForm.css
devtools/client/aboutdebugging-new/src/components/connect/NetworkLocationsForm.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connect_networklocations.js
devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
--- a/devtools/client/aboutdebugging-new/src/components/connect/ConnectPage.js
+++ b/devtools/client/aboutdebugging-new/src/components/connect/ConnectPage.js
@@ -191,17 +191,17 @@ class ConnectPage extends PureComponent 
         {
           className: "connect-page__breather",
           icon: GLOBE_ICON_SRC,
           title: "Network Location",
           extraContent: networkEnabled
             ? dom.div(
               {},
               NetworkLocationsList({ dispatch, networkLocations }),
-              NetworkLocationsForm({ dispatch, networkLocations }),
+              NetworkLocationsForm({ dispatch }),
             )
             : null,
         },
         networkEnabled
           ? null
           : Localized(
             {
                 id: "about-debugging-connect-network-disabled",
--- a/devtools/client/aboutdebugging-new/src/components/connect/NetworkLocationsForm.css
+++ b/devtools/client/aboutdebugging-new/src/components/connect/NetworkLocationsForm.css
@@ -12,12 +12,8 @@
 .connect-page__network-form {
   display: grid;
   grid-column-gap: calc(var(--base-unit) * 2);
   grid-template-columns: auto 1fr auto;
   align-items: center;
   padding-block-start: calc(var(--base-unit) * 4);
   padding-inline: calc(var(--base-unit) * 6);
 }
-
-.connect-page__network-form__error-message {
-  grid-column: 1 / -1;
-}
--- a/devtools/client/aboutdebugging-new/src/components/connect/NetworkLocationsForm.js
+++ b/devtools/client/aboutdebugging-new/src/components/connect/NetworkLocationsForm.js
@@ -6,99 +6,45 @@
 
 const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 
 const FluentReact = require("devtools/client/shared/vendor/fluent-react");
 const Localized = createFactory(FluentReact.Localized);
 
-const Message = createFactory(require("../shared/Message"));
-
 const Actions = require("../../actions/index");
-const { MESSAGE_LEVEL } = require("../../constants");
-const Types = require("../../types/index");
 
 class NetworkLocationsForm extends PureComponent {
   static get propTypes() {
     return {
       dispatch: PropTypes.func.isRequired,
-      networkLocations: PropTypes.arrayOf(Types.location).isRequired,
     };
   }
 
   constructor(props) {
     super(props);
     this.state = {
-      errorHostValue: null,
-      errorMessageId: null,
       value: "",
     };
   }
 
-  onSubmit(e) {
-    const { networkLocations } = this.props;
-    const { value } = this.state;
-
-    e.preventDefault();
-
-    if (!value) {
-      return;
-    }
-
-    if (!value.match(/[^:]+:\d+/)) {
-      this.setState({
-        errorHostValue: value,
-        errorMessageId: "about-debugging-network-location-form-invalid",
-      });
-      return;
-    }
-
-    if (networkLocations.includes(value)) {
-      this.setState({
-        errorHostValue: value,
-        errorMessageId: "about-debugging-network-location-form-duplicate",
-      });
-      return;
-    }
-
-    this.props.dispatch(Actions.addNetworkLocation(value));
-    this.setState({ errorHostValue: null, errorMessageId: null, value: "" });
-  }
-
-  renderError() {
-    const { errorHostValue, errorMessageId } = this.state;
-
-    if (!errorMessageId) {
-      return null;
-    }
-
-    return Message(
-      {
-        className: "connect-page__network-form__error-message " +
-                   "qa-connect-page__network-form__error-message",
-        level: MESSAGE_LEVEL.ERROR,
-      },
-      Localized(
-        {
-          id: errorMessageId,
-          "$host-value": errorHostValue,
-        },
-        dom.p({}, errorMessageId)
-      ),
-    );
-  }
-
   render() {
     return dom.form(
       {
         className: "connect-page__network-form",
-        onSubmit: (e) => this.onSubmit(e),
+        onSubmit: (e) => {
+          const { value } = this.state;
+          if (value) {
+            this.props.dispatch(Actions.addNetworkLocation(value));
+            this.setState({ value: "" });
+          }
+          e.preventDefault();
+        },
       },
-      this.renderError(),
       Localized(
         {
           id: "about-debugging-network-locations-host-input-label",
         },
         dom.label(
           {
             htmlFor: "about-debugging-network-locations-host-input",
           },
@@ -121,14 +67,14 @@ class NetworkLocationsForm extends PureC
           id: "about-debugging-network-locations-add-button",
         },
         dom.button(
           {
             className: "primary-button js-network-form-submit-button",
           },
           "Add"
         )
-      ),
+      )
     );
   }
 }
 
 module.exports = NetworkLocationsForm;
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connect_networklocations.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_connect_networklocations.js
@@ -4,60 +4,48 @@
 "use strict";
 
 /**
  * Test the network locations form of the Connect page.
  * Check that a network location can be added and removed.
  */
 
 const TEST_NETWORK_LOCATION = "localhost:1111";
-const TEST_NETWORK_LOCATION_INVALID = "testnetwork";
 
 add_task(async function() {
   const { document, tab } = await openAboutDebugging();
 
   await selectConnectPage(document);
 
   let networkLocations = document.querySelectorAll(".js-network-location");
   is(networkLocations.length, 0, "By default, no network locations are displayed");
 
-  info("Check whether error message should show if the input value is invalid");
-  addNetworkLocation(TEST_NETWORK_LOCATION_INVALID, document);
-  await waitUntil(() =>
-    document.querySelector(".qa-connect-page__network-form__error-message"));
+  addNetworkLocation(TEST_NETWORK_LOCATION, document);
 
   info("Wait until the new network location is visible in the list");
-  addNetworkLocation(TEST_NETWORK_LOCATION, document);
   await waitUntil(() => document.querySelectorAll(".js-network-location").length === 1);
-  await waitUntil(() =>
-    !document.querySelector(".qa-connect-page__network-form__error-message"));
+  networkLocations = document.querySelectorAll(".js-network-location");
 
-  networkLocations = document.querySelectorAll(".js-network-location");
   const networkLocationValue =
     networkLocations[0].querySelector(".js-network-location-value");
   is(networkLocationValue.textContent, TEST_NETWORK_LOCATION,
     "Added network location has the expected value");
 
-  info("Check whether error message should show if the input value was duplicate");
-  addNetworkLocation(TEST_NETWORK_LOCATION, document);
-  await waitUntil(() =>
-    document.querySelector(".qa-connect-page__network-form__error-message"));
+  removeNetworkLocation(TEST_NETWORK_LOCATION, document);
 
   info("Wait until the new network location is removed from the list");
-  removeNetworkLocation(TEST_NETWORK_LOCATION, document);
   await waitUntil(() => document.querySelectorAll(".js-network-location").length === 0);
 
   await removeTab(tab);
 });
 
 function addNetworkLocation(location, document) {
   info("Setting a value in the network form input");
   const networkLocationInput =
     document.querySelector(".js-network-form-input");
-  networkLocationInput.value = "";
   networkLocationInput.focus();
   EventUtils.sendString(location, networkLocationInput.ownerGlobal);
 
   info("Click on network form submit button");
   const networkLocationSubmitButton =
     document.querySelector(".js-network-form-submit-button");
   networkLocationSubmitButton.click();
 }
--- a/devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
+++ b/devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
@@ -213,24 +213,16 @@ about-debugging-network-locations-empty-
 # the Connect page. A host is a hostname and a port separated by a colon, as suggested by
 # the input's placeholder "localhost:6080".
 about-debugging-network-locations-host-input-label = Host
 
 # Text of a button displayed next to existing network locations in the Connect page.
 # Clicking on it removes the network location from the list.
 about-debugging-network-locations-remove-button = Remove
 
-# Text used as error message if the format of the input value was invalid in the network locations form of the Setup page.
-# { $host-value } is the input value submitted by the user in the network locations form
-about-debugging-network-location-form-invalid = Invalid host "{ $host-value }". The expected format is "hostname:portnumber".
-
-# Text used as error message if the input value was already registered in the network locations form of the Setup page.
-# { $host-value } is the input value submitted by the user in the network locations form
-about-debugging-network-location-form-duplicate = The host "{ $host-value }" is already registered
-
 # This string is displayed as a label of the button that pushes a test payload
 # to a service worker.
 # Notes, this relates to the "Push" API, which is normally not localized so it is
 # probably better to not localize it.
 about-debugging-worker-action-push = Push
 
 # This string is displayed as a label of the button that starts a service worker.
 about-debugging-worker-action-start = Start