From 6eb8b29d70c6f76f1f24a1c2d6596e85134db1a9 Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Mon, 15 Apr 2019 13:14:52 +0200 Subject: [PATCH] Chore: Add more explicit typing (#16594) --- .../datasources/utils/passwordHandlers.test.ts | 2 +- .../app/features/datasources/utils/passwordHandlers.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/app/features/datasources/utils/passwordHandlers.test.ts b/public/app/features/datasources/utils/passwordHandlers.test.ts index 2dddc4fc130..f1bf86f34eb 100644 --- a/public/app/features/datasources/utils/passwordHandlers.test.ts +++ b/public/app/features/datasources/utils/passwordHandlers.test.ts @@ -2,7 +2,7 @@ import { createResetHandler, PasswordFieldEnum, Ctrl } from './passwordHandlers' describe('createResetHandler', () => { Object.keys(PasswordFieldEnum).forEach(fieldKey => { - const field = PasswordFieldEnum[fieldKey]; + const field: any = PasswordFieldEnum[fieldKey as any]; it(`should reset existing ${field} field`, () => { const event: any = { diff --git a/public/app/features/datasources/utils/passwordHandlers.ts b/public/app/features/datasources/utils/passwordHandlers.ts index f7bcdc1aec2..25f9298fb3d 100644 --- a/public/app/features/datasources/utils/passwordHandlers.ts +++ b/public/app/features/datasources/utils/passwordHandlers.ts @@ -15,8 +15,14 @@ export enum PasswordFieldEnum { */ export type Ctrl = { current: { - secureJsonFields: {}; - secureJsonData?: {}; + secureJsonFields: { + [key: string]: boolean; + }; + secureJsonData?: { + [key: string]: string; + }; + password?: string; + basicAuthPassword?: string; }; };