Commit 99c4413b by cahrens

Simply check for existing text and type.

parent c550963f
...@@ -18,10 +18,10 @@ define(["backbone", "gettext", "underscore"], function (Backbone, gettext, _) { ...@@ -18,10 +18,10 @@ define(["backbone", "gettext", "underscore"], function (Backbone, gettext, _) {
if (!response.empty) { if (!response.empty) {
var summary = "summary" in response ? response.summary : {}; var summary = "summary" in response ? response.summary : {};
var messages = "messages" in response ? response.messages : []; var messages = "messages" in response ? response.messages : [];
if (!(_.has(summary, "text")) || !summary.text) { if (!summary.text) {
summary.text = gettext("This component has validation issues."); summary.text = gettext("This component has validation issues.");
} }
if (!(_.has(summary, "type")) || !summary.type) { if (!summary.type) {
summary.type = this.WARNING; summary.type = this.WARNING;
// Possible types are ERROR, WARNING, and NOT_CONFIGURED. NOT_CONFIGURED is treated as a warning. // Possible types are ERROR, WARNING, and NOT_CONFIGURED. NOT_CONFIGURED is treated as a warning.
_.find(messages, function (message) { _.find(messages, function (message) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment