From b59c6493c89ddc2bfaed2affb24bb26441a00608 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Thu, 21 Nov 2024 18:08:08 +0100 Subject: [PATCH] :boom: [#3283] Remove password Formio component --- src/formio/components/index.ts | 1 - src/formio/components/password.ts | 32 ------ src/formio/index.ts | 2 - test-d/formio/components/password.test-d.ts | 113 -------------------- 4 files changed, 148 deletions(-) delete mode 100644 src/formio/components/password.ts delete mode 100644 test-d/formio/components/password.test-d.ts diff --git a/src/formio/components/index.ts b/src/formio/components/index.ts index eb4900f..5de6aa0 100644 --- a/src/formio/components/index.ts +++ b/src/formio/components/index.ts @@ -24,7 +24,6 @@ export * from './map'; export * from './editgrid'; export * from './signature'; export * from './cosign'; -export * from './password'; // Layout components export * from './content'; diff --git a/src/formio/components/password.ts b/src/formio/components/password.ts deleted file mode 100644 index 401e96f..0000000 --- a/src/formio/components/password.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type PasswordInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - * - * @deprecated - * - * The password component should not be used anymore - it's intended usage has never - * been clear. - */ -export interface BasePasswordComponentSchema - extends Omit { - type: 'password'; - autocomplete?: string; -} - -/** - * @group Form.io components - * @category Concrete types - * - * @deprecated - * - * The password component should not be used anymore - it's intended usage has never - * been clear. - */ -export type PasswordComponentSchema = MultipleCapable; diff --git a/src/formio/index.ts b/src/formio/index.ts index 521d749..0e7d69c 100644 --- a/src/formio/index.ts +++ b/src/formio/index.ts @@ -18,7 +18,6 @@ import { MapComponentSchema, NpFamilyMembersComponentSchema, NumberComponentSchema, - PasswordComponentSchema, PhoneNumberComponentSchema, PostcodeComponentSchema, ProductPriceComponentSchema, @@ -89,7 +88,6 @@ export type AnyComponentSchema = | SoftRequiredErrorsComponentSchema // deprecated | PostcodeComponentSchema - | PasswordComponentSchema | CosignV1ComponentSchema; /** diff --git a/test-d/formio/components/password.test-d.ts b/test-d/formio/components/password.test-d.ts deleted file mode 100644 index 4b3cb1c..0000000 --- a/test-d/formio/components/password.test-d.ts +++ /dev/null @@ -1,113 +0,0 @@ -import {expectAssignable, expectNotAssignable} from 'tsd'; - -import {PasswordComponentSchema} from '../../../lib'; - -// minimal password component schema -expectAssignable({ - id: 'yejak', - type: 'password', - key: 'somePassword', - label: 'Some password', -}); - -// with additional, password-component specific properties -expectAssignable({ - id: 'yejak', - type: 'password', - key: 'somePassword', - label: 'Some password', - autocomplete: 'password', -}); - -// multiple false and appropriate default value type -expectAssignable({ - id: 'yejak', - type: 'password', - key: 'somePassword', - label: 'Some password', - multiple: false, - defaultValue: '', -}); - -// multiple true and appropriate default value type -expectAssignable({ - id: 'yejak', - type: 'password', - key: 'somePassword', - label: 'Some password', - multiple: true, - defaultValue: [''], -}); - -// full, correct schema -expectAssignable({ - id: 'yejak', - type: 'password', - defaultValue: '', - // basic tab - label: 'Some password', - key: 'somePassword', - description: '', - tooltip: 'A tooltip', - showInSummary: true, - showInEmail: false, - showInPDF: true, - multiple: false, - hidden: false, - clearOnHide: true, - isSensitiveData: true, - autocomplete: 'password', - // Advanced tab - conditional: { - show: undefined, - when: '', - eq: '', - }, - // Validation tab - validate: { - required: false, - plugins: [], - }, - translatedErrors: {nl: {required: 'Geef wachtwoord.'}}, - errors: {required: 'Geef wachtwoord.'}, - // registration tab - registration: { - attribute: '', - }, - // translations tab in builder form - openForms: { - translations: { - nl: {label: 'foo', description: 'bar', tooltip: 'baz'}, - }, - }, -}); - -// invalid, multiple true and non-array default value -expectNotAssignable({ - id: 'yejak', - type: 'password' as const, - key: 'somePassword', - label: 'Some password', - multiple: true, - defaultValue: '', -}); - -// invalid, multiple false and array default value -expectNotAssignable({ - id: 'yejak', - type: 'password' as const, - key: 'somePassword', - label: 'Some password', - multiple: false, - defaultValue: [''], -}); - -// invalid, multiple true and wrong default value in array element -expectNotAssignable({ - id: 'yejak', - type: 'password' as const, - key: 'somePassword', - label: 'Some password', - multiple: true, - defaultValue: [0], -});