Skip to content

Commit

Permalink
SHIBUI-888 Fixed label issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Oct 22, 2018
1 parent aec268d commit 9edc46c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions ui/src/app/schema-form/widget/select/select.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<div class="widget form-group">
<label [attr.for]="id" class="horizontal control-label" *ngIf="schema.title">
<span>
<label [attr.for]="id" class="horizontal control-label">
<span *ngIf="schema.title">
<translate-i18n [key]="schema.title">{{ schema.title }}</translate-i18n>
<i class="fa fa-asterisk text-danger" aria-hidden="true" *ngIf="required"></i>
</span>
<span *ngIf="!schema.title" class="sr-only" [translate]="formProperty.parent.schema.title">
{{ formProperty.parent.schema.title }}
</span>
<span *ngIf="schema.description">
<info-icon [description]="schema.description | translate"></info-icon>
</span>
Expand All @@ -12,6 +15,7 @@
{{ schema.description }}
</span>
<select *ngIf="schema.type !== 'array'"
[id]="id"
[formControl]="control"
[attr.name]="name"
class="form-control"
Expand Down
8 changes: 7 additions & 1 deletion ui/src/app/shared/pipe/date.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export class CustomDatePipe implements PipeTransform {
this.pipe = new DatePipe('en');
}
transform(value: string, format: string): string {
return this.pipe.transform(value, format);
let transformed: string;
try {
transformed = this.pipe.transform(value, format);
} catch (err) {
transformed = value;
}
return transformed;
}
}

0 comments on commit 9edc46c

Please sign in to comment.