v8.7.0
1) Add keypress functionality to simple-list-input
Now we have the possibility to receive the event object through emitting the keypress
function from inside the simple-list-input
. This allows us to add any type of rule to the value that is been added.
2) Custom global validators #1369
This opens the possibility to add custom metadata validators to all the pages.
To enable this include scope: metadata
in object and on type indicate if is error
or warning
.
e.g.
'use strict';
module.exports = {
label: 'Lorem Ipsum',
description: 'Lorem ipsum dolor sit amet, consectetur...',
type: 'error',
scope: 'metadata',
validate(metadata) {
if (metadata.authors.length < 1) {
return [{
preview: 'Validation message'
}];
}
return [];
}
};
- Custom Metadata validation for specific page: This allows validations for specific pages taking in count the
uri
used.
To use it include scope: 'metadata' in object and include uri:<URI>
e.g.
'use strict';
module.exports = {
label: 'Lorem ipsum',
description: 'Lorem ipsum dolor sit amet, consectetur...',
type: 'error',
scope: 'metadata',
uri: 'cjp2sl6c50000cyv2gt73xbwt',
validate(metadata) {
if (metadata.authors.length < 1) {
return [{
preview: 'Blah blah'
}];
}
return [];
}
};