mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 06:23:03 +00:00
Add aria-label and loadingInitialValue property to DsDynamicOneboxComponent
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
</ng-template>
|
||||
|
||||
<div *ngIf="!(isHierarchicalVocabulary() | async)" class="position-relative right-addon">
|
||||
<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>
|
||||
<i *ngIf="!searching"
|
||||
<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>
|
||||
<i *ngIf="!searching && !loadingInitialValue"
|
||||
dsAuthorityConfidenceState
|
||||
class="far fa-circle fa-2x fa-fw position-absolute mt-1 p-0"
|
||||
aria-hidden="true"
|
||||
@@ -32,6 +32,7 @@
|
||||
class="form-control"
|
||||
[attr.aria-labelledby]="'label_' + model.id"
|
||||
[attr.autoComplete]="model.autoComplete"
|
||||
[attr.aria-label]="model.label | translate"
|
||||
[class.is-invalid]="showErrorMessages"
|
||||
[id]="model.id"
|
||||
[inputFormatter]="formatter"
|
||||
@@ -58,6 +59,7 @@
|
||||
<input class="form-control"
|
||||
[attr.aria-labelledby]="'label_' + model.id"
|
||||
[attr.autoComplete]="model.autoComplete"
|
||||
[attr.aria-label]="model.label | translate"
|
||||
[class.is-invalid]="showErrorMessages"
|
||||
[class.tree-input]="!model.readOnly"
|
||||
[id]="id"
|
||||
|
@@ -55,6 +55,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
||||
|
||||
pageInfo: PageInfo = new PageInfo();
|
||||
searching = false;
|
||||
loadingInitialValue = false;
|
||||
searchFailed = false;
|
||||
hideSearchingWhenUnsubscribed$ = new Observable(() => () => this.changeSearchingStatus(false));
|
||||
click$ = new Subject<string>();
|
||||
@@ -151,6 +152,15 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the loadingInitialValue status
|
||||
* @param status
|
||||
*/
|
||||
changeLoadingInitialValueStatus(status: boolean) {
|
||||
this.loadingInitialValue = status;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if configured vocabulary is Hierarchical or not
|
||||
*/
|
||||
@@ -257,8 +267,10 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
||||
setCurrentValue(value: any, init = false): void {
|
||||
let result: string;
|
||||
if (init) {
|
||||
this.changeLoadingInitialValueStatus(true);
|
||||
this.getInitValueFromModel()
|
||||
.subscribe((formValue: FormFieldMetadataValueObject) => {
|
||||
this.changeLoadingInitialValueStatus(false);
|
||||
this.currentValue = formValue;
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
|
Reference in New Issue
Block a user