Skip to content

Commit

Permalink
more informative error message for invalid components
Browse files Browse the repository at this point in the history
  • Loading branch information
Farrell authored and Farrell committed Sep 4, 2018
1 parent f93dc71 commit 4641f94
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/decorators/component-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function updateOrder(el) {

if (_.get(store, 'state.ui.currentFocus')) {
// save an open child component's form before saving the parent component
return store.dispatch('unfocus').then(() => store.dispatch('saveComponent', { uri, data: { [path]: newList }}));
return store.dispatch('unfocus').then(() => store.dispatch('saveComponent', { uri, data: { [path]: newList } }));
} else {
return store.dispatch('saveComponent', { uri, data: { [path]: newList }});
return store.dispatch('saveComponent', { uri, data: { [path]: newList } });
}
} else {
// data is in a page area
Expand Down Expand Up @@ -178,7 +178,9 @@ function containsChildComponents(uri, path, el) {
!child.classList.contains('kiln-inactive-placeholder') &&
!child.classList.contains('mini-selector') &&
!child.classList.contains('mini-selector-inactive')) {
log.error(`Template for ${getComponentName(uri)}${path} contains non-component elements! All direct children of a component list must be components.`, { action: 'containsChildComponents', nonChildEl: child });
log.error(`Template for ${getComponentName(uri)}${path} contains non-component elements!
All direct children of a component list must be components.`, { action: 'containsChildComponents', nonChildEl: child });
log.debug('Ensure each child component has a valid handlebars template and a single root element with a data-uri property');
result = false;
}
});
Expand Down

0 comments on commit 4641f94

Please sign in to comment.