Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-1467 (pull request #420)
Browse files Browse the repository at this point in the history
SHIBUI-1467 updated radio components

Approved-by: Dmitriy Kopylenko <dkopylenko@unicon.net>
  • Loading branch information
rmathis committed Nov 18, 2019
2 parents 4ecf5d0 + a9b5f12 commit a62cc1e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
1 change: 1 addition & 0 deletions backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ tooltip.mark-as-default=Mark as Default
tooltip.protocol-support-enumeration=Protocol Support Enumeration
tooltip.nameid-format=Content is name identifier format which is added to all the applicable roles of the entities which match any of the following <Entity> or {{<ConditionRef>}}elements.
tooltip.enable-this-service-upon-saving=If checkbox is clicked, the metadata provider is enabled for integration with the IdP
tooltip.is-there-a-x509-certificate=Is there a X509 Certificate?
tooltip.authentication-requests-signed=Authentication Requests Signed
tooltip.want-assertions-signed=Want Assertions Signed
tooltip.certificate-name=Certificate Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@
</span>
</label>
<span *ngIf="schema.description" class="sr-only" [translate]="schema.description">{{ schema.description }}</span>
<div *ngFor="let option of schema.oneOf; let i=index;" class="form-check form-check-inline">
<label class="control-label">
<input
[id]="formProperty._canonicalPath + '.' + option.enum[0]"
[formControl]="control"
[name]="name"
[value]="option.enum[0]"
type="radio"
[attr.disabled]="schema.readOnly">&nbsp;
<translate-i18n [key]="option.description">{{ option.description }}</translate-i18n>
</label>
<div class="d-flex">
<ng-container *ngFor="let option of schema.oneOf; let i=index;">
<div class="custom-control custom-radio custom-control-inline">
<input
disableValidation="true"
class="custom-control-input"
[id]="formProperty._canonicalPath + '.' + option.enum[0]"
[formControl]="control"
[name]="name"
[value]="option.enum[0]"
type="radio"
[attr.disabled]="schema.readOnly">
<label
class="custom-control-label"
[for]="formProperty._canonicalPath + '.' + option.enum[0]"
[translate]="option.description">{{ option.description }}</label>
</div>
</ng-container>
</div>
<input *ngIf="schema.readOnly" [attr.name]="name" type="hidden" [formControl]="control">
</div>
14 changes: 10 additions & 4 deletions ui/src/app/schema-form/widget/radio/radio.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
<label [translate]="schema.title">{{schema.title}}</label>
<span *ngIf="schema.description" class="formHelp" [translate]="schema.description">{{schema.description}}</span>
<ng-container *ngFor="let option of schema.oneOf; let i = index;">
<div class="form-check" [ngClass]="schema.widget.class">
<input class="form-check-input" [formControl]="control" type="radio" [attr.name]="name" [id]="formProperty._canonicalPath + '.' + i" [value]="option.enum[0]" [attr.disabled]="schema.readOnly">
<label class="form-check-label" [for]="name" [translate]="option.description">{{option.description}}</label>
<div class="custom-control custom-radio custom-control-inline" [ngClass]="schema.widget.class">
<input class="custom-control-input"
[formControl]="control"
type="radio"
[attr.name]="name"
[id]="formProperty._canonicalPath + '.' + i"
[value]="option.enum[0]"
[attr.disabled]="schema.readOnly"
disableValidation="true">
<label class="custom-control-label" [for]="formProperty._canonicalPath + '.' + i" [translate]="option.description">{{option.description}}</label>
</div>
</ng-container>
<input *ngIf="schema.readOnly" [attr.name]="name" type="hidden" [formControl]="control">
</div>

0 comments on commit a62cc1e

Please sign in to comment.