import { AsyncPipe, NgFor, NgIf, } from '@angular/common'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Optional, Output, } from '@angular/core'; import { ControlContainer, FormsModule, NgForm, } from '@angular/forms'; import { ActivatedRoute, Router, } from '@angular/router'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { BehaviorSubject, Subscription, } from 'rxjs'; import { map, tap, } from 'rxjs/operators'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { ScriptDataService } from '../../../core/data/processes/script-data.service'; import { getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { Script } from '../../scripts/script.model'; import { controlContainerFactory } from '../process-form-factory'; const SCRIPT_QUERY_PARAMETER = 'script'; /** * Component used to select a script */ @Component({ selector: 'ds-scripts-select', templateUrl: './scripts-select.component.html', styleUrls: ['./scripts-select.component.scss'], viewProviders: [{ provide: ControlContainer, useFactory: controlContainerFactory, deps: [[new Optional(), NgForm]] }], standalone: true, imports: [NgIf, FormsModule, NgFor, AsyncPipe, TranslateModule, InfiniteScrollModule, ThemedLoadingComponent, NgbDropdownModule], }) export class ScriptsSelectComponent implements OnInit, OnDestroy { /** * Emits the selected script when the selection changes */ @Output() select: EventEmitter