adapt-authoring-ui 1.7.5 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -102,7 +102,7 @@ define(function(require){
|
|
|
102
102
|
|
|
103
103
|
// Match content type + id + errors: e.g. "contentobject abc123 /path must be..."
|
|
104
104
|
// Covers: contentobject, block, article, course, *-component, etc.
|
|
105
|
-
const contentErrorPattern = /\b(\S+)\s+([a-
|
|
105
|
+
const contentErrorPattern = /\b(\S+)\s+([a-z0-9][\w-]*)\s+((?:\/\S+|must\b).*?)(?=,\s*;\s*|,\s*$|$)/g;
|
|
106
106
|
|
|
107
107
|
const prefixMessages = [];
|
|
108
108
|
const groups = {};
|
|
@@ -132,9 +132,9 @@ define(function(require){
|
|
|
132
132
|
|
|
133
133
|
matches.forEach(match => {
|
|
134
134
|
const [, type, id, errorsStr] = match;
|
|
135
|
-
// Split
|
|
135
|
+
// Split on ", /" or ", must" to separate individual validation errors
|
|
136
136
|
const errors = errorsStr
|
|
137
|
-
.split(/,\s*(
|
|
137
|
+
.split(/,\s*(?=\/|must\b)/)
|
|
138
138
|
.map(s => s.trim())
|
|
139
139
|
.filter(Boolean)
|
|
140
140
|
.sort();
|
|
@@ -163,7 +163,7 @@ define(function(require){
|
|
|
163
163
|
const subGroups = typeGroups.map(group => {
|
|
164
164
|
return `<div style="margin-bottom:20px;"><b>IDs:</b> ${group.ids.join(', ')}<ul style="text-align:left;margin-top:10px;">${group.errors.map(e => `<li>${e}</li>`).join('')}</ul></div>`;
|
|
165
165
|
});
|
|
166
|
-
return `<h2 style="margin:20px;">${type} (${totalCount})</h2><div>${subGroups.join('')}</div>`;
|
|
166
|
+
return `<h2 style="margin:20px 0;">${type} (${totalCount})</h2><div>${subGroups.join('')}</div>`;
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
output.push(...formatted);
|
|
@@ -177,7 +177,13 @@ define(function(require){
|
|
|
177
177
|
const formatted = this.formatErrorString(e.message)
|
|
178
178
|
if (formatted) text = formatted
|
|
179
179
|
} catch {}
|
|
180
|
-
|
|
180
|
+
$('.frameworkImport .summaryText').addClass('error').text('Course import failed')
|
|
181
|
+
$('.frameworkImport .statusReport > .error').remove()
|
|
182
|
+
$('.frameworkImport .statusReport').prepend(`<div class="error">
|
|
183
|
+
<h3>Errors</h3>
|
|
184
|
+
<div class="messages">${text}</div>
|
|
185
|
+
</div>`)
|
|
186
|
+
// Origin.Notify.alert({ type: 'error', text });
|
|
181
187
|
Origin.trigger('sidebar:resetButtons');
|
|
182
188
|
}
|
|
183
189
|
}, {
|
package/package.json
CHANGED