<!--

    Copyright © 2016-2023 The Thingsboard Authors

    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.

-->
<form fxLayout="column" class="mat-content mat-padding" [formGroup]="persistentFilterFormGroup" (ngSubmit)="update()">
  <mat-form-field fxFlex class="mat-block" floatLabel="always">
    <mat-label translate>widgets.persistent-table.rpc-status-list</mat-label>
    <mat-select formControlName="rpcStatus"
                placeholder="{{ rpcSearchPlaceholder }}">
      <mat-option [value]="null">
        {{ 'widgets.persistent-table.rpc-search-status-all' | translate }}
      </mat-option>
      <mat-option *ngFor="let searchStatus of persistentSearchStatuses" [value]="searchStatus">
        {{ rpcSearchStatusTranslationMap.get(searchStatus) | translate }}
      </mat-option>
    </mat-select>
  </mat-form-field>
  <div fxLayout="row" class="tb-panel-actions" fxLayoutAlign="end center">
    <button type="button"
            mat-button
            (click)="cancel()">
      {{ 'action.cancel' | translate }}
    </button>
    <button type="submit"
            mat-raised-button
            color="primary"
            [disabled]="persistentFilterFormGroup.invalid || !persistentFilterFormGroup.dirty">
      {{ 'action.update' | translate }}
    </button>
  </div>
</form>
