Skip to content

Commit

Permalink
SHIBUI-1594 added validation for protocol support enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 19, 2019
1 parent 7393c1b commit f865cda
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
12 changes: 7 additions & 5 deletions backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ label.service-provider-status=Metadata Source Status:
label.current-metadata-sources=Current Metadata Sources
label.current-metadata-providers=Current Metadata Providers
label.add-a-new-metadata-provider=Add a new metadata provider
label.service-resolver-name-dashboard-display-only=Service Resolver Name (Dashboard Display Only)
label.service-resolver-entity-id=Service Resolver Entity ID
label.service-resolver-name-dashboard-display-only=Service Provider Name (Dashboard Display Only)
label.service-resolver-entity-id=Service Provider Entity ID
label.add-a-new-metadata-source=Add a new metadata source - Finish Summary
label.name-and-entityid=Name and Entity ID.
label.finish-summary-validation=Finished!
Expand All @@ -222,8 +222,8 @@ label.how-are-you-adding-the-metadata-information=How are you adding the metadat
label.upload-url=Upload/URL
label.or=or
label.name-and-upload-url=Name and Upload Url
label.service-resolver-file=Select Resolver Metadata File
label.service-resolver-metadata-url=Service Resolver Metadata URL
label.service-resolver-file=Select Provider Metadata File
label.service-resolver-metadata-url=Service Provider Metadata URL
label.search-criteria-by=Search Criteria by { displayType }
label.entity-ids-added=Entity Ids Added
label.ui-mdui-info=User Interface / MDUI Information
Expand Down Expand Up @@ -445,6 +445,8 @@ message.type-required=Missing required property: Type
message.match-required=Missing required property: Match
message.value-required=Missing required property: Value

message.protocol-support-required=Protocol Support Enumeration is required if any NameID formats are defined.

message.conflict=Conflict
message.data-version-contention=Data Version Contention
message.contention-new-version=A newer version of this metadata source has been saved. Below are a list of changes. You can use your changes or their changes.
Expand All @@ -463,7 +465,7 @@ message.unsaved-editor=You have not saved your changes. If you exit this screen,
message.editor-invalid=All forms must be valid before changes can be saved!
message.unsaved-source-1=You have not completed the wizard! Do you wish to save this information? You can finish the wizard later by clicking the \u0027Edit\u0027
message.unsaved-source-2=icon on the dashboard.
message.service-resolver-name-required=Service Resolver Name is required
message.service-resolver-name-required=Service Provider Name is required
message.entity-id-required=Entity ID is required
message.entity-id-must-be-unique=Entity ID must be unique
message.file-upload-alert=Note: You can only import a file with a single entityID (EntityDescriptor element) in it. Anything more in that file will result in an error.
Expand Down
3 changes: 0 additions & 3 deletions backend/src/main/resources/metadata-sources-ui-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@
},
"serviceProviderSsoDescriptor": {
"type": "object",
"widget": {
"id": "fieldset"
},
"fieldsets": [
{
"type": "group",
Expand Down
11 changes: 11 additions & 0 deletions ui/src/app/metadata/domain/model/wizards/metadata-source-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ export class MetadataSourceBase implements Wizard<MetadataResolver> {
};
}
return null;
},
'/serviceProviderSsoDescriptor': (value, property, form) => {
if (value.nameIdFormats && value.nameIdFormats.length && !value.protocolSupportEnum) {
return {
code: 'PROTOCOL_SUPPORT_ENUM_REQUIRED',
path: `#${property.path}`,
message: 'message.protocol-support-required',
params: [value]
};
}
return null;
}
};
return validators;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class DatalistComponent extends ControlWidget implements AfterViewInit {
} else {
this.control.enable();
}
console.log(this.formProperty);
}

getData(query: string): void {
Expand Down
3 changes: 2 additions & 1 deletion ui/src/app/schema-form/widget/select/select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
<small
[id]="formProperty._canonicalPath + '-help'"
[ngClass]="{'sr-only': !control.touched}"
class="form-text text-danger" *ngIf="errorMessages && errorMessages.length">
class="form-text text-danger"
*ngIf="errorMessages && errorMessages.length">
<ng-container *ngFor="let error of errorMessages; let first=first;">
<ng-container *ngIf="!first">, </ng-container>
<translate-i18n [key]="getError(error)">error</translate-i18n>
Expand Down

0 comments on commit f865cda

Please sign in to comment.