Bug 1330858 - Hide Object string for cookies object;r=Honza
authorFred Lin <gasolin@mozilla.com>
Tue, 17 Jan 2017 10:39:15 +0800
changeset 374906 d9380dbe417707fcb6813d1100cf7e62be4d5a1f
parent 374905 92b0af77c610afcfc293320807a44f7dbdc15d4d
child 374907 99bd07f1c6869cf7d31db2a985233d6d7eefd2ef
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1330858
milestone53.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 1330858 - Hide Object string for cookies object;r=Honza MozReview-Commit-ID: G2G0xY2S2Ij
devtools/client/netmonitor/shared/components/properties-view.js
devtools/client/shared/components/tree/tree-view.js
--- a/devtools/client/netmonitor/shared/components/properties-view.js
+++ b/devtools/client/netmonitor/shared/components/properties-view.js
@@ -95,25 +95,31 @@ const PropertiesView = createClass({
     if (level >= 1 && path.includes(EDITOR_CONFIG_ID)) {
       return null;
     }
 
     return TreeRow(props);
   },
 
   renderValueWithRep(props) {
-    // Hide rep summary for sections
-    if (props.member.level === 0) {
+    const { member } = props;
+
+    // Hide strings with following conditions
+    // 1. this row is a togglable section
+    // 2. the `value` object has a `value` property, only happend in Cookies panel
+    // Put 2 here to not dup this method
+    if (member.level === 0 ||
+      (typeof member.value === "object" && member.value.value)) {
       return null;
     }
 
     return Rep(Object.assign(props, {
       // FIXME: A workaround for the issue in StringRep
       // Force StringRep to crop the text everytime
-      member: Object.assign({}, props.member, { open: false }),
+      member: Object.assign({}, member, { open: false }),
       mode: MODE.TINY,
       cropLimit: 60,
     }));
   },
 
   shouldRenderSearchBox(object) {
     return this.props.enableFilter && object && Object.keys(object)
       .filter((section) => !object[section][EDITOR_CONFIG_ID]).length > 0;
@@ -144,21 +150,21 @@ const PropertiesView = createClass({
         expandedNodes = new Set([...expandedNodes, ...nodes]);
       }
     }
     return expandedNodes;
   },
 
   render() {
     const {
-      object,
       decorator,
       enableInput,
       expandableStrings,
       filterPlaceHolder,
+      object,
       renderRow,
       renderValue,
       sectionNames,
     } = this.props;
 
     return (
       div({ className: "properties-view" },
         this.shouldRenderSearchBox(object) &&
@@ -186,13 +192,11 @@ const PropertiesView = createClass({
             onFilter: (props) => this.onFilter(props, sectionNames),
             renderRow: renderRow || this.renderRowWithEditor,
             renderValue: renderValue || this.renderValueWithRep,
           }),
         ),
       )
     );
   }
-
 });
 
 module.exports = PropertiesView;
-
--- a/devtools/client/shared/components/tree/tree-view.js
+++ b/devtools/client/shared/components/tree/tree-view.js
@@ -44,17 +44,17 @@ define(function (require, exports, modul
    *
    * Complete tree decorator interface:
    * var TreeDecorator = {
    *   getRowClass: function(object);
    *   getCellClass: function(object, colId);
    *   getHeaderClass: function(colId);
    *   renderValue: function(object, colId);
    *   renderRow: function(object);
-   *   renderCelL: function(object, colId);
+   *   renderCell: function(object, colId);
    *   renderLabelCell: function(object);
    * }
    */
   let TreeView = React.createClass({
     displayName: "TreeView",
 
     // The only required property (not set by default) is the input data
     // object that is used to puputate the tree.
@@ -73,17 +73,17 @@ define(function (require, exports, modul
       }).isRequired,
       // Tree decorator (see also the interface above)
       decorator: PropTypes.shape({
         getRowClass: PropTypes.func,
         getCellClass: PropTypes.func,
         getHeaderClass: PropTypes.func,
         renderValue: PropTypes.func,
         renderRow: PropTypes.func,
-        renderCelL: PropTypes.func,
+        renderCell: PropTypes.func,
         renderLabelCell: PropTypes.func,
       }),
       // Custom tree row (node) renderer
       renderRow: PropTypes.func,
       // Custom cell renderer
       renderCell: PropTypes.func,
       // Custom value renderef
       renderValue: PropTypes.func,