Skip to content

Commit

Permalink
SHIBUI-1602 Fixed issue with validation on providers
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 22, 2019
1 parent 5e7168d commit 6f9d5fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion backend/src/main/resources/metadata-sources-ui-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@
"title": "label.certificate-name-display-only",
"description": "tooltip.certificate-name",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"type": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ export class ProviderEditStepComponent implements OnDestroy {
this.store.select(fromProvider.getProviderXmlIds),
this.provider$
),
filter(([def, names, ids, provider]) => !def),
map(([def, names, ids, provider]) => def ? def.getValidators(
filter(([def, names, ids, provider]) => !!def),
map(([def, names, ids, provider]) => def.getValidators(
names.filter(n => n !== provider.name),
ids.filter(id => id !== provider.xmlId)
) : {})
))
);

this.model$ = this.schema$.pipe(
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/schema-form/widget/string/string.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
validate="true"
[attr.readonly]="schema.readOnly?true:null"
class="text-widget.id textline-widget form-control"
[class.is-invalid]="control.touched && !control.value && errorMessages.length"
[class.is-invalid]="control.touched && !control.value && (errorMessages.length > 0)"
[attr.type]="this.getInputType()"
[id]="formProperty._canonicalPath"
[formControl]="control"
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/schema-form/widget/string/string.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class CustomStringComponent extends StringWidget implements AfterViewInit
if (!this.required) {
this.errorMessages = this.errorMessages.filter(e => e !== REQUIRED_MSG_OVERRIDE);
}
console.log(this.errorMessages.length);
});
}

Expand Down

0 comments on commit 6f9d5fc

Please sign in to comment.