2022-04-13 21:55:03 +02:00
|
|
|
<!--
|
|
|
|
|
|
2023-01-31 10:43:56 +02:00
|
|
|
Copyright © 2016-2023 The Thingsboard Authors
|
2022-04-13 21:55:03 +02:00
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
|
|
|
|
|
-->
|
2023-01-16 15:11:40 +02:00
|
|
|
<mat-form-field [formGroup]="selectQueueFormGroup"
|
|
|
|
|
class="mat-block autocomplete-queue">
|
2022-04-13 21:55:03 +02:00
|
|
|
<input matInput type="text" placeholder="{{ 'queue.queue-name' | translate }}"
|
|
|
|
|
#queueInput
|
2022-07-11 18:03:14 +03:00
|
|
|
formControlName="queueName"
|
2022-04-13 21:55:03 +02:00
|
|
|
(focusin)="onFocus()"
|
|
|
|
|
[required]="required"
|
|
|
|
|
[matAutocomplete]="queueAutocomplete">
|
2022-07-11 18:03:14 +03:00
|
|
|
<button *ngIf="selectQueueFormGroup.get('queueName').value && !disabled"
|
2022-04-13 21:55:03 +02:00
|
|
|
type="button"
|
2023-02-17 19:24:01 +02:00
|
|
|
matSuffix mat-icon-button aria-label="Clear"
|
2022-04-13 21:55:03 +02:00
|
|
|
(click)="clear()">
|
|
|
|
|
<mat-icon class="material-icons">close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<mat-autocomplete class="tb-autocomplete"
|
|
|
|
|
#queueAutocomplete="matAutocomplete"
|
2022-05-25 18:45:00 +03:00
|
|
|
[displayWith]="displayQueueFn"
|
|
|
|
|
>
|
|
|
|
|
<mat-option *ngFor="let queue of filteredQueues | async" [value]="queue" class="queue-option">
|
2022-04-13 21:55:03 +02:00
|
|
|
<span [innerHTML]="queue.name | highlight:searchText"></span>
|
2022-05-25 18:45:00 +03:00
|
|
|
<small class="queue-option-description">{{getDescription(queue)}}</small>
|
2022-04-13 21:55:03 +02:00
|
|
|
</mat-option>
|
|
|
|
|
<mat-option *ngIf="!(filteredQueues | async)?.length" [value]="null" class="tb-not-found">
|
|
|
|
|
<div class="tb-not-found-content" (click)="$event.stopPropagation()">
|
|
|
|
|
<div *ngIf="!textIsNotEmpty(searchText); else searchNotEmpty">
|
2022-07-11 14:49:12 +03:00
|
|
|
<span translate>queue.no-queues-found</span>
|
2022-04-13 21:55:03 +02:00
|
|
|
</div>
|
|
|
|
|
<ng-template #searchNotEmpty>
|
|
|
|
|
<span>
|
|
|
|
|
{{ translate.get('queue.no-queues-matching',
|
2022-05-05 11:02:45 +03:00
|
|
|
{queue: truncate.transform(searchText, true, 6, '...')}) | async }}
|
2022-04-13 21:55:03 +02:00
|
|
|
</span>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-autocomplete>
|
2023-01-16 15:14:11 +02:00
|
|
|
<mat-hint *ngIf = "autocompleteHint">{{ autocompleteHint | translate }}</mat-hint>
|
2022-07-11 18:03:14 +03:00
|
|
|
<mat-error *ngIf="selectQueueFormGroup.get('queueName').hasError('required')">
|
2022-04-13 21:55:03 +02:00
|
|
|
{{ 'queue.queue-required' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|