Bug 1254242 - Clean up React propType definitions in devtools/client/memory/components/Toolbar.js. r=nchevobbe.
authordevguru <princewurl510@gmail.com>
Tue, 05 Mar 2019 09:19:11 +0000
changeset 520230 e31662ecc9d1aca960b7998ce143dd1df1913af2
parent 520229 81de709aaadd8c580d4dc341d71905dad618aeff
child 520231 79221722fcc6b17019ed84227deb02e85f4bf1e2
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1254242
milestone67.0a1
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
Bug 1254242 - Clean up React propType definitions in devtools/client/memory/components/Toolbar.js. r=nchevobbe. Differential Revision: https://phabricator.services.mozilla.com/D22004
devtools/client/memory/components/Toolbar.js
--- a/devtools/client/memory/components/Toolbar.js
+++ b/devtools/client/memory/components/Toolbar.js
@@ -9,44 +9,34 @@ const PropTypes = require("devtools/clie
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const { L10N } = require("../utils");
 const models = require("../models");
 const { viewState } = require("../constants");
 
 class Toolbar extends Component {
   static get propTypes() {
     return {
-      censusDisplays: PropTypes.arrayOf(PropTypes.shape({
-        displayName: PropTypes.string.isRequired,
-      })).isRequired,
-      censusDisplay: PropTypes.shape({
-        displayName: PropTypes.string.isRequired,
-      }).isRequired,
+      censusDisplays: PropTypes.arrayOf(models.censusDisplay).isRequired,
+      censusDisplay: models.censusDisplay.isRequired,
       onTakeSnapshotClick: PropTypes.func.isRequired,
       onImportClick: PropTypes.func.isRequired,
       onClearSnapshotsClick: PropTypes.func.isRequired,
       onCensusDisplayChange: PropTypes.func.isRequired,
       onToggleRecordAllocationStacks: PropTypes.func.isRequired,
       allocations: models.allocations,
       filterString: PropTypes.string,
       setFilterString: PropTypes.func.isRequired,
       diffing: models.diffingModel,
       onToggleDiffing: PropTypes.func.isRequired,
       view: models.view.isRequired,
       onViewChange: PropTypes.func.isRequired,
-      labelDisplays: PropTypes.arrayOf(PropTypes.shape({
-        displayName: PropTypes.string.isRequired,
-      })).isRequired,
-      labelDisplay: PropTypes.shape({
-        displayName: PropTypes.string.isRequired,
-      }).isRequired,
+      labelDisplays: PropTypes.arrayOf(models.labelDisplay).isRequired,
+      labelDisplay: models.labelDisplay.isRequired,
       onLabelDisplayChange: PropTypes.func.isRequired,
-      treeMapDisplays: PropTypes.arrayOf(PropTypes.shape({
-        displayName: PropTypes.string.isRequired,
-      })).isRequired,
+      treeMapDisplays: PropTypes.arrayOf(models.treeMapDisplay).isRequired,
       onTreeMapDisplayChange: PropTypes.func.isRequired,
       snapshots: PropTypes.arrayOf(models.snapshot).isRequired,
     };
   }
 
   render() {
     const {
       onTakeSnapshotClick,