mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 13:33:03 +00:00
100553: Updated form validation errors from metadata schema and field form
This commit is contained in:
@@ -87,11 +87,13 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy {
|
|||||||
name: 'name',
|
name: 'name',
|
||||||
validators: {
|
validators: {
|
||||||
required: null,
|
required: null,
|
||||||
pattern: '^[^. ,_]{1,32}$',
|
pattern: '^[^. ,]*$',
|
||||||
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
pattern: 'error.validation.metadata.namespace.invalid-pattern',
|
pattern: 'error.validation.metadata.name.invalid-pattern',
|
||||||
|
maxLength: 'error.validation.metadata.name.max-length',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.namespace = new DynamicInputModel({
|
this.namespace = new DynamicInputModel({
|
||||||
@@ -100,8 +102,12 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy {
|
|||||||
name: 'namespace',
|
name: 'namespace',
|
||||||
validators: {
|
validators: {
|
||||||
required: null,
|
required: null,
|
||||||
|
maxLength: 256,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
|
errorMessages: {
|
||||||
|
maxLength: 'error.validation.metadata.namespace.max-length',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.formModel = [
|
this.formModel = [
|
||||||
new DynamicFormGroupModel(
|
new DynamicFormGroupModel(
|
||||||
|
@@ -109,11 +109,13 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy {
|
|||||||
name: 'element',
|
name: 'element',
|
||||||
validators: {
|
validators: {
|
||||||
required: null,
|
required: null,
|
||||||
pattern: '^[^.]*$',
|
pattern: '^[^. ,]*$',
|
||||||
|
maxLength: 64,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
pattern: 'error.validation.metadata.element.invalid-pattern',
|
pattern: 'error.validation.metadata.element.invalid-pattern',
|
||||||
|
maxLength: 'error.validation.metadata.element.max-length',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.qualifier = new DynamicInputModel({
|
this.qualifier = new DynamicInputModel({
|
||||||
@@ -121,11 +123,13 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy {
|
|||||||
label: qualifier,
|
label: qualifier,
|
||||||
name: 'qualifier',
|
name: 'qualifier',
|
||||||
validators: {
|
validators: {
|
||||||
pattern: '^[^.]*$',
|
pattern: '^[^. ,]*$',
|
||||||
|
maxLength: 64,
|
||||||
},
|
},
|
||||||
required: false,
|
required: false,
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
pattern: 'error.validation.metadata.qualifier.invalid-pattern',
|
pattern: 'error.validation.metadata.qualifier.invalid-pattern',
|
||||||
|
maxLength: 'error.validation.metadata.qualifier.max-length',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.scopeNote = new DynamicInputModel({
|
this.scopeNote = new DynamicInputModel({
|
||||||
|
@@ -1478,12 +1478,19 @@
|
|||||||
|
|
||||||
"error.validation.groupExists": "This group already exists",
|
"error.validation.groupExists": "This group already exists",
|
||||||
|
|
||||||
"error.validation.metadata.namespace.invalid-pattern": "This field cannot contain dots, please use the Element & Qualifier fields instead",
|
"error.validation.metadata.name.invalid-pattern": "This field cannot contain dots, commas or spaces. Please use the Element & Qualifier fields instead",
|
||||||
|
|
||||||
"error.validation.metadata.element.invalid-pattern": "This field cannot contain dots, please use the Qualifier field instead",
|
"error.validation.metadata.name.max-length": "This field may not contain more than 32 characters",
|
||||||
|
|
||||||
"error.validation.metadata.qualifier.invalid-pattern": "This field cannot contain dots",
|
"error.validation.metadata.namespace.max-length": "This field may not contain more than 256 characters",
|
||||||
|
|
||||||
|
"error.validation.metadata.element.invalid-pattern": "This field cannot contain dots, commas or spaces. Please use the Qualifier field instead",
|
||||||
|
|
||||||
|
"error.validation.metadata.element.max-length": "This field may not contain more than 64 characters",
|
||||||
|
|
||||||
|
"error.validation.metadata.qualifier.invalid-pattern": "This field cannot contain dots, commas or spaces",
|
||||||
|
|
||||||
|
"error.validation.metadata.qualifier.max-length": "This field may not contain more than 64 characters",
|
||||||
|
|
||||||
"feed.description": "Syndication feed",
|
"feed.description": "Syndication feed",
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user