Skip to content

Commit

Permalink
Modify message component's root element to add category and severity …
Browse files Browse the repository at this point in the history
…attributes (mozilla#64)



* Add severity and category attributes for the other message components
  • Loading branch information
nchevobbe authored and linclark committed Apr 19, 2016
1 parent fd09dd8 commit d064994
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ function ConsoleApiCall(props) {
repeat
];

return dom.div({ className: "message cm-s-mozilla" },
// @TODO Use of "is" is a temporary hack to get the category and severity
// attributes to be applied. There are targeted in webconsole's CSS rules,
// so if we remove this hack, we have to modify the CSS rules accordingly.
return dom.div({
class: "message cm-s-mozilla",
is: "fdt-message",
category: message.category,
severity: message.severity
},
dom.span({className: "message-body-wrapper"},
dom.span({},
dom.span({className: "message-flex-body"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ function DatePreview(props) {
dom.span({ className: "cm-string-2" }, ` ${dateString}`)
];

return dom.div({ className: "message cm-s-mozilla" },
// @TODO Use of "is" is a temporary hack to get the category and severity
// attributes to be applied. There are targeted in webconsole's CSS rules,
// so if we remove this hack, we have to modify the CSS rules accordingly.
return dom.div({
class: "message cm-s-mozilla",
is: "fdt-message",
category: data.category,
severity: data.severity
},
dom.span({
className: "message-body-wrapper message-body devtools-monospace"
}, dom.span({},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ const {
DefaultRenderer.displayName = "DefaultRenderer";

function DefaultRenderer(props) {
return dom.div({ className: "message cm-s-mozilla" },
const { data } = props;
// @TODO Use of "is" is a temporary hack to get the category and severity
// attributes to be applied. There are targeted in webconsole's CSS rules,
// so if we remove this hack, we have to modify the CSS rules accordingly.
return dom.div({
class: "message cm-s-mozilla",
is: "fdt-message",
category: data.category,
severity: data.severity
},
"This evaluation result type is not supported yet."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ function PageError(props) {
repeat
];

return dom.div({ className: "message cm-s-mozilla"},
// @TODO Use of "is" is a temporary hack to get the category and severity
// attributes to be applied. There are targeted in webconsole's CSS rules,
// so if we remove this hack, we have to modify the CSS rules accordingly.
return dom.div({
class: "message cm-s-mozilla",
is: "fdt-message",
category: message.category,
severity: message.severity
},
dom.span({className: "message-body-wrapper"},
dom.span({},
dom.span({className: "message-flex-body"},
Expand Down

0 comments on commit d064994

Please sign in to comment.