From 2d155fa0c48d63fe376d52e2c5403c8ec1130db6 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Mon, 19 Aug 2024 21:11:36 +0200 Subject: [PATCH] feat: add password requirements (#988) * feat: add password requirements * fix: format issue * fix: unexpected empty string in component jsx * test: adjust unit test passwords --- .../auth/invite/[id]/_registration-form.tsx | 4 +- .../[locale]/init/user/_init-user-form.tsx | 7 ++- .../_components/_change-password-form.tsx | 8 ++- .../_components/create-user-stepper.tsx | 5 +- packages/api/src/router/test/user.spec.ts | 34 +++++++------ packages/translation/src/lang/en.ts | 8 +++ packages/ui/package.json | 1 + packages/ui/src/components/index.tsx | 1 + .../password-input/password-input.tsx | 35 +++++++++++++ .../password-input/password-requirement.tsx | 17 +++++++ .../password-requirements-popover.tsx | 49 +++++++++++++++++++ packages/validation/src/index.ts | 1 + packages/validation/src/user.ts | 28 ++++++++++- pnpm-lock.yaml | 37 +++++++------- 14 files changed, 198 insertions(+), 37 deletions(-) create mode 100644 packages/ui/src/components/password-input/password-input.tsx create mode 100644 packages/ui/src/components/password-input/password-requirement.tsx create mode 100644 packages/ui/src/components/password-input/password-requirements-popover.tsx diff --git a/apps/nextjs/src/app/[locale]/auth/invite/[id]/_registration-form.tsx b/apps/nextjs/src/app/[locale]/auth/invite/[id]/_registration-form.tsx index b1986f12c..4c86fa61b 100644 --- a/apps/nextjs/src/app/[locale]/auth/invite/[id]/_registration-form.tsx +++ b/apps/nextjs/src/app/[locale]/auth/invite/[id]/_registration-form.tsx @@ -7,6 +7,7 @@ import { clientApi } from "@homarr/api/client"; import { useZodForm } from "@homarr/form"; import { showErrorNotification, showSuccessNotification } from "@homarr/notifications"; import { useScopedI18n } from "@homarr/translation/client"; +import { CustomPasswordInput } from "@homarr/ui"; import type { z } from "@homarr/validation"; import { validation } from "@homarr/validation"; @@ -64,7 +65,8 @@ export const RegistrationForm = ({ invite }: RegistrationFormProps) => {
- { > - +