Bug 1314573 - Uses Reps in long mode in the console; r=bgrins draft
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Thu, 17 Nov 2016 13:38:23 +0100
changeset 440562 39fcc8ff5cb3386663fb5f0821cecd78abae00b3
parent 440559 a7ff746662f006e1a132ce1e21cac3a0cbbea0e2
child 440563 1e33216239ebdcde47a0f7e80e3c138a8d3335f2
push id36265
push userchevobbe.nicolas@gmail.com
push dateThu, 17 Nov 2016 20:39:34 +0000
reviewersbgrins
bugs1314573
milestone53.0a1
Bug 1314573 - Uses Reps in long mode in the console; r=bgrins In the MessageBody component, we already have the "mode" props we use to pass it to the Reps. We only default it to "long" so most of the message will use it. We only need to specify to use "short" mode in ConsoleTable cells. MozReview-Commit-ID: 6KyZkN86bHJ
devtools/client/webconsole/new-console-output/components/console-table.js
devtools/client/webconsole/new-console-output/components/grip-message-body.js
--- a/devtools/client/webconsole/new-console-output/components/console-table.js
+++ b/devtools/client/webconsole/new-console-output/components/console-table.js
@@ -53,17 +53,18 @@ const ConsoleTable = createClass({
   getRows: function (columns, items) {
     return items.map(item => {
       let cells = [];
       columns.forEach((value, key) => {
         cells.push(
           dom.td(
             {},
             GripMessageBody({
-              grip: item[key]
+              grip: item[key],
+              mode: "short",
             })
           )
         );
       });
       return dom.tr({}, cells);
     });
   },
 
--- a/devtools/client/webconsole/new-console-output/components/grip-message-body.js
+++ b/devtools/client/webconsole/new-console-output/components/grip-message-body.js
@@ -32,16 +32,20 @@ GripMessageBody.propTypes = {
     PropTypes.object,
   ]).isRequired,
   serviceContainer: PropTypes.shape({
     createElement: PropTypes.func.isRequired,
   }),
   userProvidedStyle: PropTypes.string,
 };
 
+GripMessageBody.defaultProps = {
+  mode: "long",
+};
+
 function GripMessageBody(props) {
   const { grip, userProvidedStyle, serviceContainer } = props;
 
   let styleObject;
   if (userProvidedStyle && userProvidedStyle !== "") {
     styleObject = cleanupStyle(userProvidedStyle, serviceContainer.createElement);
   }