Removed semicolon tslint rule, since it was conflicting with prettier.
Fixes: https://tracker.ceph.com/issues/45756
Signed-off-by: Tiago Melo <tmelo@suse.com>
"glob-to-regexp": "^0.3.0"
}
},
+ "@ng-bootstrap/ng-bootstrap": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-6.1.0.tgz",
+ "integrity": "sha512-2GzkNJBKdeHkaUqaCAqSILPft0IzzHjMfAlAuGY6/ZLlVQ0glt5MTbIXtIhSbjR+OvlrljoXFLrvzs1LGdmE+A=="
+ },
"@ngtools/webpack": {
"version": "9.1.5",
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.5.tgz",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
- "fsevents": {
- "dev": true,
- "optional": true,
- "version": "2.1.2"
- },
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"@angular/platform-browser-dynamic": "9.1.6",
"@angular/router": "9.1.6",
"@auth0/angular-jwt": "2.1.1",
+ "@ng-bootstrap/ng-bootstrap": "6.1.0",
"@ngx-translate/i18n-polyfill": "1.0.0",
"@swimlane/ngx-datatable": "17.0.0",
"@types/file-saver": "2.0.1",
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
+import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
import { TreeModule } from 'angular-tree-component';
import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
import { AlertModule } from 'ngx-bootstrap/alert';
import { TabsModule } from 'ngx-bootstrap/tabs';
import { TimepickerModule } from 'ngx-bootstrap/timepicker';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
-import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
import { OrchestratorDocModalComponent } from '../../shared/components/orchestrator-doc-modal/orchestrator-doc-modal.component';
import { SharedModule } from '../../shared/shared.module';
AlertModule.forRoot(),
TooltipModule.forRoot(),
MgrModulesModule,
- TypeaheadModule.forRoot(),
+ NgbTypeaheadModule,
TimepickerModule.forRoot(),
TreeModule.forRoot(),
BsDatepickerModule.forRoot(),
<input id="value"
class="form-control"
type="text"
- [typeahead]="possibleValues"
- [typeaheadMinLength]="0"
+ [ngbTypeahead]="search"
formControlName="value">
<span *ngIf="form.showError('value', formDir, 'required')"
class="help-block"
import { ReactiveFormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
+import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
import { BsModalRef } from 'ngx-bootstrap/modal';
-import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
import {
configureTestBed,
imports: [
HttpClientTestingModule,
SharedModule,
- TypeaheadModule.forRoot(),
+ NgbTypeaheadModule,
RouterTestingModule,
ReactiveFormsModule
],
import * as _ from 'lodash';
import { BsModalRef } from 'ngx-bootstrap/modal';
+import { Observable } from 'rxjs';
+import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
import { CdFormBuilder } from '../../../../shared/forms/cd-form-builder';
import { CdFormGroup } from '../../../../shared/forms/cd-form-group';
this.submitAction.emit(this.form.value);
this.bsModalRef.hide();
}
+
+ search = (text$: Observable<string>) => {
+ return text$.pipe(
+ debounceTime(200),
+ distinctUntilChanged(),
+ map((term) =>
+ this.possibleValues
+ .filter((v) => v.toLowerCase().indexOf(term.toLowerCase()) > -1)
+ .slice(0, 10)
+ )
+ );
+ };
}
name="path"
id="path"
formControlName="path"
- [typeahead]="pathDataSource"
- (typeaheadOnSelect)="pathChangeHandler()"
+ [ngbTypeahead]="pathDataSource"
+ (selectItem)="pathChangeHandler()"
(blur)="pathChangeHandler()">
<span class="invalid-feedback"
*ngIf="nfsForm.showError('path', formDir, 'required')"
name="path"
id="path"
formControlName="path"
- [typeahead]="bucketDataSource"
- (typeaheadOnSelect)="bucketChangeHandler()"
+ [ngbTypeahead]="bucketDataSource"
+ (selectItem)="bucketChangeHandler()"
(blur)="bucketChangeHandler()">
<span class="invalid-feedback"
import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
-import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
+import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
import { ToastrModule } from 'ngx-toastr';
import { ActivatedRouteStub } from '../../../../testing/activated-route-stub';
RouterTestingModule,
SharedModule,
ToastrModule.forRoot(),
- TypeaheadModule.forRoot()
+ NgbTypeaheadModule
],
providers: [
{
import { I18n } from '@ngx-translate/i18n-polyfill';
import * as _ from 'lodash';
import { forkJoin, Observable, of } from 'rxjs';
-import { map, mergeMap } from 'rxjs/operators';
+import { debounceTime, distinctUntilChanged, map, mergeMap } from 'rxjs/operators';
import { NfsService } from '../../../shared/api/nfs.service';
import { RgwUserService } from '../../../shared/api/rgw-user.service';
this.i18n
);
- pathDataSource: Observable<any> = Observable.create((observer: any) => {
- observer.next(this.nfsForm.getValue('path'));
- }).pipe(
- mergeMap((token: string) => this.getPathTypeahead(token)),
- map((val: any) => val.paths)
- );
+ pathDataSource = (text$: Observable<string>) => {
+ return text$.pipe(
+ debounceTime(200),
+ distinctUntilChanged(),
+ mergeMap((token: string) => this.getPathTypeahead(token)),
+ map((val: any) => val.paths)
+ );
+ };
- bucketDataSource: Observable<any> = Observable.create((observer: any) => {
- observer.next(this.nfsForm.getValue('path'));
- }).pipe(mergeMap((token: string) => this.getBucketTypeahead(token)));
+ bucketDataSource = (text$: Observable<string>) => {
+ return text$.pipe(
+ debounceTime(200),
+ distinctUntilChanged(),
+ mergeMap((token: string) => this.getBucketTypeahead(token))
+ );
+ };
constructor(
private authStorageService: AuthStorageService,
import { ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
+import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
import { TabsModule } from 'ngx-bootstrap/tabs';
-import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
import { SharedModule } from '../../shared/shared.module';
import { Nfs501Component } from './nfs-501/nfs-501.component';
SharedModule,
TabsModule.forRoot(),
CommonModule,
- TypeaheadModule.forRoot(),
+ NgbTypeaheadModule,
NgBootstrapFormValidationModule
],
declarations: [
"prefer-const": true,
"quotemark": [true, "single", "avoid-escape"],
"radix": true,
- "semicolon": [true, "always"],
"triple-equals": [true, "allow-null-check"],
"typedef-whitespace": [
true,