diff --git a/app/components/doi-related-identifier.js b/app/components/doi-related-identifier.js index ed9ea5e9f..dfbbca7a7 100644 --- a/app/components/doi-related-identifier.js +++ b/app/components/doi-related-identifier.js @@ -70,9 +70,9 @@ const resourceTypeGeneralList = [ 'Dataset', 'Event', 'Image', - 'Interactive resource', + 'InteractiveResource', 'Model', - 'Physical object', + 'PhysicalObject', 'Service', 'Software', 'Sound', @@ -96,12 +96,18 @@ export default Component.extend({ didReceiveAttrs() { this._super(...arguments); - if (relatedIdentifierTypeList.includes(this.fragment.get('relatedIdentifierType'))) { + if ( + relatedIdentifierTypeList.includes( + this.fragment.get('relatedIdentifierType'), + ) + ) { this.set('controlledIdentifierType', true); } else { this.set('controlledIdentifierType', false); } - if (this.isMetadataRelationTypes.includes(this.fragment.get('relationType'))) { + if ( + this.isMetadataRelationTypes.includes(this.fragment.get('relationType')) + ) { this.set('isMetadataRelationType', true); } else { this.set('isMetadataRelationType', false); @@ -110,7 +116,10 @@ export default Component.extend({ updateRelatedIdentifier(value) { const ark = /^ark:\/[0-9]{5}\/\S+$/; const lsid = /^[uU][rR][nN]:[lL][sS][iI][dD]:(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])[:]?(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])?$/; - const purl = {require_host: true, host_whitelist: [ 'purl.org', 'oclc.org' ]}; + const purl = { + require_host: true, + host_whitelist: [ 'purl.org', 'oclc.org' ], + }; const arxiv = /^(arXiv:)(\d{4}.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?/; const doi = /^(10\.\d{4,5}\/.+)/; const bibcode = /\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z]/; diff --git a/app/components/doi-types.js b/app/components/doi-types.js index d255ed8bf..3386fee73 100644 --- a/app/components/doi-types.js +++ b/app/components/doi-types.js @@ -8,9 +8,9 @@ const resourceTypeGeneralList = [ 'Dataset', 'Event', 'Image', - 'Interactive resource', + 'InteractiveResource', 'Model', - 'Physical object', + 'PhysicalObject', 'Service', 'Software', 'Sound', @@ -24,7 +24,9 @@ export default Component.extend({ resourceTypesGeneral: resourceTypeGeneralList, selectResourceTypeGeneral(resourceTypeGeneral) { - this.model.set('types', { resourceTypeGeneral: pascalCase(resourceTypeGeneral) }); + this.model.set('types', { + resourceTypeGeneral: pascalCase(resourceTypeGeneral), + }); this.set('resourceTypesGeneral', resourceTypeGeneralList); }, diff --git a/app/validators/resource-type.js b/app/validators/resource-type.js index 55789765f..5dac24e5e 100644 --- a/app/validators/resource-type.js +++ b/app/validators/resource-type.js @@ -2,9 +2,7 @@ import BaseValidator from 'ember-cp-validations/validators/base'; const ResourceType = BaseValidator.extend({ - validate(value, options) { - const resourceTypeGeneralList = [ 'Audiovisual', 'Collection', @@ -12,9 +10,9 @@ const ResourceType = BaseValidator.extend({ 'Dataset', 'Event', 'Image', - 'Interactive resource', + 'InteractiveResource', 'Model', - 'Physical object', + 'PhysicalObject', 'Service', 'Software', 'Sound', @@ -26,7 +24,7 @@ const ResourceType = BaseValidator.extend({ const message = 'Resource of the Type is not valid.'; switch (true) { - case (!value && options.allowBlank): + case !value && options.allowBlank: return true; case resourceTypeGeneralList.includes(String(value)): return true;