Bug 1315922 - fix react/prop-types issues in client/netmonitor;r=honza draft
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 16 Jan 2017 13:27:03 +0100
changeset 463313 d1eb291c687cead504ab31959031df0143419fff
parent 463312 dcc242748505f031d1ec9fddb3027d85c4868987
child 463314 50613c273124683551f540162d44dbf91d42cad8
push id42014
push userjdescottes@mozilla.com
push dateWed, 18 Jan 2017 20:17:21 +0000
reviewershonza
bugs1315922
milestone53.0a1
Bug 1315922 - fix react/prop-types issues in client/netmonitor;r=honza MozReview-Commit-ID: 2Sjk6YEyDhw
devtools/client/netmonitor/components/request-list-content.js
devtools/client/netmonitor/components/request-list-header.js
devtools/client/netmonitor/components/request-list-item.js
devtools/client/netmonitor/shared/components/editor.js
devtools/client/netmonitor/shared/components/properties-view.js
--- a/devtools/client/netmonitor/components/request-list-content.js
+++ b/devtools/client/netmonitor/components/request-list-content.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 /* globals NetMonitorView */
 
 "use strict";
 
 const { Task } = require("devtools/shared/task");
-const { createClass, createFactory, DOM } = require("devtools/client/shared/vendor/react");
+const { createClass, createFactory, DOM, PropTypes } = require("devtools/client/shared/vendor/react");
 const { div } = DOM;
 const Actions = require("../actions/index");
 const RequestListItem = createFactory(require("./request-list-item"));
 const { connect } = require("devtools/client/shared/vendor/react-redux");
 const { setTooltipImageContent,
         setTooltipStackTraceContent } = require("./request-list-tooltip");
 const { getDisplayedRequests,
         getWaterfallScale } = require("../selectors/index");
@@ -21,16 +21,32 @@ const { KeyCodes } = require("devtools/c
 const REQUESTS_TOOLTIP_TOGGLE_DELAY = 500;
 
 /**
  * Renders the actual contents of the request list.
  */
 const RequestListContent = createClass({
   displayName: "RequestListContent",
 
+  propTypes: {
+    displayedRequests: PropTypes.object.isRequired,
+    firstRequestStartedMillis: PropTypes.number.isRequired,
+    onItemContextMenu: PropTypes.func.isRequired,
+    onItemMouseDown: PropTypes.func.isRequired,
+    onSecurityIconClick: PropTypes.func.isRequired,
+    onSelectDelta: PropTypes.func.isRequired,
+    scale: PropTypes.number,
+    selectedRequestId: PropTypes.string,
+    tooltip: PropTypes.shape({
+      hide: PropTypes.func.isRequired,
+      startTogglingOnHover: PropTypes.func.isRequired,
+      stopTogglingOnHover: PropTypes.func.isRequired,
+    }).isRequired
+  },
+
   componentDidMount() {
     // Set the CSS variables for waterfall scaling
     this.setScalingStyles();
 
     // Install event handler for displaying a tooltip
     this.props.tooltip.startTogglingOnHover(this.refs.contentEl, this.onHover, {
       toggleDelay: REQUESTS_TOOLTIP_TOGGLE_DELAY,
       interactive: true
--- a/devtools/client/netmonitor/components/request-list-header.js
+++ b/devtools/client/netmonitor/components/request-list-header.js
@@ -41,16 +41,17 @@ const HEADERS = [
 const RequestListHeader = createClass({
   displayName: "RequestListHeader",
 
   propTypes: {
     sort: PropTypes.object,
     scale: PropTypes.number,
     waterfallWidth: PropTypes.number,
     onHeaderClick: PropTypes.func.isRequired,
+    resizeWaterfall: PropTypes.func.isRequired,
   },
 
   componentDidMount() {
     // This is the first time the waterfall column header is actually rendered.
     // Measure its width and update the 'waterfallWidth' property in the store.
     // The 'waterfallWidth' will be further updated on every window resize.
     const waterfallHeaderEl = findDOMNode(this)
       .querySelector("#requests-menu-waterfall-header-box");
--- a/devtools/client/netmonitor/components/request-list-item.js
+++ b/devtools/client/netmonitor/components/request-list-item.js
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+/* eslint-disable react/prop-types */
+
 "use strict";
 
 const { createClass, createFactory, PropTypes, DOM } = require("devtools/client/shared/vendor/react");
 const { div, span, img } = DOM;
 const { L10N } = require("../l10n");
 const { getFormattedSize } = require("../utils/format-utils");
 const { getAbbreviatedMimeType } = require("../request-utils");
 
@@ -55,16 +57,18 @@ const RequestListItem = createClass({
   displayName: "RequestListItem",
 
   propTypes: {
     item: PropTypes.object.isRequired,
     index: PropTypes.number.isRequired,
     isSelected: PropTypes.bool.isRequired,
     firstRequestStartedMillis: PropTypes.number.isRequired,
     onContextMenu: PropTypes.func.isRequired,
+    onFocusedNodeChange: PropTypes.func,
+    onFocusedNodeUnmount: PropTypes.func,
     onMouseDown: PropTypes.func.isRequired,
     onSecurityIconClick: PropTypes.func.isRequired,
   },
 
   componentDidMount() {
     if (this.props.isSelected) {
       this.refs.el.focus();
     }
@@ -438,8 +442,10 @@ function timingBoxes(item) {
       title: text
     }, text));
   }
 
   return boxes;
 }
 
 module.exports = RequestListItem;
+
+/* eslint-enable react/prop-types */
--- a/devtools/client/netmonitor/shared/components/editor.js
+++ b/devtools/client/netmonitor/shared/components/editor.js
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+/* eslint-disable react/prop-types */
+
 "use strict";
 
 const { createClass, DOM, PropTypes } = require("devtools/client/shared/vendor/react");
 const SourceEditor = require("devtools/client/sourceeditor/editor");
 
 const { div } = DOM;
 
 /**
@@ -91,8 +93,10 @@ const Editor = createClass({
           style: { visibility: open ? "visible" : "hidden" },
         }),
       )
     );
   }
 });
 
 module.exports = Editor;
+
+/* eslint-enable react/prop-types */
--- a/devtools/client/netmonitor/shared/components/properties-view.js
+++ b/devtools/client/netmonitor/shared/components/properties-view.js
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+/* eslint-disable react/prop-types */
+
 "use strict";
 
 const {
   createClass,
   createFactory,
   DOM,
   PropTypes,
 } = require("devtools/client/shared/vendor/react");
@@ -195,8 +197,10 @@ const PropertiesView = createClass({
           }),
         ),
       )
     );
   }
 });
 
 module.exports = PropertiesView;
+
+/* eslint-enable react/prop-types */