File tree Expand file tree Collapse file tree
src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121</ ng-template >
2222
2323< div *ngIf ="!(isHierarchicalVocabulary() | async) " class ="position-relative right-addon ">
24- < i *ngIf ="searching " class ="fas fa-circle-notch fa-spin fa-2x fa-fw text-primary position-absolute mt-1 p-0 " aria-hidden ="true "> </ i >
25- < i *ngIf ="!searching "
24+ < i *ngIf ="searching || loadingInitialValue " class ="fas fa-circle-notch fa-spin fa-2x fa-fw text-primary position-absolute mt-1 p-0 " aria-hidden ="true "> </ i >
25+ < i *ngIf ="!searching && !loadingInitialValue "
2626 dsAuthorityConfidenceState
2727 class ="far fa-circle fa-2x fa-fw position-absolute mt-1 p-0 "
2828 aria-hidden ="true "
3232 class ="form-control "
3333 [attr.aria-labelledby] ="'label_' + model.id "
3434 [attr.autoComplete] ="model.autoComplete "
35+ [attr.aria-label] ="model.label | translate "
3536 [class.is-invalid] ="showErrorMessages "
3637 [id] ="model.id "
3738 [inputFormatter] ="formatter "
5859 < input class ="form-control "
5960 [attr.aria-labelledby] ="'label_' + model.id "
6061 [attr.autoComplete] ="model.autoComplete "
62+ [attr.aria-label] ="model.label | translate "
6163 [class.is-invalid] ="showErrorMessages "
6264 [class.tree-input] ="!model.readOnly "
6365 [id] ="id "
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
5555
5656 pageInfo : PageInfo = new PageInfo ( ) ;
5757 searching = false ;
58+ loadingInitialValue = false ;
5859 searchFailed = false ;
5960 hideSearchingWhenUnsubscribed$ = new Observable ( ( ) => ( ) => this . changeSearchingStatus ( false ) ) ;
6061 click$ = new Subject < string > ( ) ;
@@ -151,6 +152,15 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
151152 this . cdr . detectChanges ( ) ;
152153 }
153154
155+ /**
156+ * Changes the loadingInitialValue status
157+ * @param status
158+ */
159+ changeLoadingInitialValueStatus ( status : boolean ) {
160+ this . loadingInitialValue = status ;
161+ this . cdr . detectChanges ( ) ;
162+ }
163+
154164 /**
155165 * Checks if configured vocabulary is Hierarchical or not
156166 */
@@ -257,8 +267,10 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
257267 setCurrentValue ( value : any , init = false ) : void {
258268 let result : string ;
259269 if ( init ) {
270+ this . changeLoadingInitialValueStatus ( true ) ;
260271 this . getInitValueFromModel ( )
261272 . subscribe ( ( formValue : FormFieldMetadataValueObject ) => {
273+ this . changeLoadingInitialValueStatus ( false ) ;
262274 this . currentValue = formValue ;
263275 this . cdr . detectChanges ( ) ;
264276 } ) ;
You can’t perform that action at this time.
0 commit comments