From f7d73d0420147300cbd6189620495498d27ec861 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 30 Sep 2021 13:17:15 +0530 Subject: [PATCH] mgr/dashboard: Taking care of deprecation warnings and other errors 1. deprecation group is deprecated: This API is not typesafe and can result in issues with Closure Compiler renaming. Use the `FormBuilder#group` overload with `AbstractControlOptions` instead. 2. cypress/integration/rgw/users.po.ts(113,23): error TS2345: Argument of type 'void' is not assignable to parameter of type 'string'. 3. Cannot find module 'isomorphic-form-data' from 'node_modules/swagger-ui/dist/swagger-ui.js' Fixes: https://tracker.ceph.com/issues/50268 Signed-off-by: Nizamudeen A --- .../dashboard/frontend/cypress/integration/rgw/users.po.ts | 2 +- .../frontend/src/app/shared/forms/cd-form-builder.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/users.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/users.po.ts index 7ded71f59a929..a4266f989e083 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/users.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/users.po.ts @@ -109,7 +109,7 @@ export class UsersPageHelper extends PageHelper { // creating this user to edit for the test this.navigateTo('create'); this.create(tenant, uname, 'xxx', 'xxx@xxx', '50'); - + const name = tenant + '$' + uname; this.navigateEdit(name); // put invalid email to make field invalid diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts index 307407a2fc583..9741b1e6377b8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { FormBuilder } from '@angular/forms'; +import { AbstractControlOptions, FormBuilder } from '@angular/forms'; import { CdFormGroup } from './cd-form-group'; @@ -12,7 +12,7 @@ import { CdFormGroup } from './cd-form-group'; export class CdFormBuilder extends FormBuilder { group( controlsConfig: { [key: string]: any }, - extra: { [key: string]: any } | null = null + extra: AbstractControlOptions | null = null ): CdFormGroup { const form = super.group(controlsConfig, extra); return new CdFormGroup(form.controls, form.validator, form.asyncValidator); -- 2.39.5