UI: Refactoring no text option for extension
This commit is contained in:
parent
48c8160e1f
commit
845f209996
@ -41,6 +41,7 @@
|
|||||||
<mat-option *ngFor="let resource of filteredResources$ | async" [value]="resource">
|
<mat-option *ngFor="let resource of filteredResources$ | async" [value]="resource">
|
||||||
<span [innerHTML]="resource.title | highlight:searchText"></span>
|
<span [innerHTML]="resource.title | highlight:searchText"></span>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
<ng-container *ngIf="subType !== ResourceSubType.EXTENSION; else extensionNoText">
|
||||||
<mat-option *ngIf="!(filteredResources$ | async)?.length" [value]="null">
|
<mat-option *ngIf="!(filteredResources$ | async)?.length" [value]="null">
|
||||||
<div (click)="$event.stopPropagation()">
|
<div (click)="$event.stopPropagation()">
|
||||||
<div *ngIf="!textIsNotEmpty(searchText); else searchNotEmpty">
|
<div *ngIf="!textIsNotEmpty(searchText); else searchNotEmpty">
|
||||||
@ -53,5 +54,11 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
</ng-container>
|
||||||
|
<ng-template #extensionNoText>
|
||||||
|
<mat-option *ngIf="!(filteredResources$ | async)?.length" [value]="searchText">
|
||||||
|
{{ searchText }}
|
||||||
|
</mat-option>
|
||||||
|
</ng-template>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@ -79,6 +79,8 @@ export class ResourceAutocompleteComponent implements ControlValueAccessor, OnIn
|
|||||||
@Input()
|
@Input()
|
||||||
subType = ResourceSubType.EXTENSION;
|
subType = ResourceSubType.EXTENSION;
|
||||||
|
|
||||||
|
ResourceSubType = ResourceSubType;
|
||||||
|
|
||||||
resourceFormGroup = this.fb.group({
|
resourceFormGroup = this.fb.group({
|
||||||
resource: this.fb.control<string|ResourceInfo>(null)
|
resource: this.fb.control<string|ResourceInfo>(null)
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user