From 646a9234390f3113d1218141c88f05bfb9d1d82e Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Wed, 27 Nov 2024 07:46:45 +0100 Subject: [PATCH] fix(ui): handle missing update time on user (#397) --- ui/src/components/sign-up/password-hints.tsx | 12 ++++++++---- ui/src/pages/console/console-panel-users.tsx | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/src/components/sign-up/password-hints.tsx b/ui/src/components/sign-up/password-hints.tsx index 426110aec..821d29933 100644 --- a/ui/src/components/sign-up/password-hints.tsx +++ b/ui/src/components/sign-up/password-hints.tsx @@ -40,28 +40,32 @@ function hasMinLength(value: string, minimum: number): boolean { function hasMinLowerCase(value: string, minimum: number): boolean { const lowerCaseCount = Array.from(value).filter( - (char) => char === char.toLowerCase() && char !== char.toUpperCase(), + (character) => + character === character.toLowerCase() && + character !== character.toUpperCase(), ).length return lowerCaseCount >= minimum } function hasMinUpperCase(value: string, minimum: number): boolean { const upperCaseCount = Array.from(value).filter( - (char) => char === char.toUpperCase() && char !== char.toLowerCase(), + (character) => + character === character.toUpperCase() && + character !== character.toLowerCase(), ).length return upperCaseCount >= minimum } function hasMinNumbers(value: string, minimum: number): boolean { const numbersCount = Array.from(value).filter( - (char) => !isNaN(Number(char)), + (character) => !isNaN(Number(character)), ).length return numbersCount >= minimum } function hasMinSymbols(value: string, minimum: number): boolean { const symbolsCount = Array.from(value).filter( - (char) => !char.match(/[a-zA-Z0-9\s]/), + (character) => !character.match(/[a-zA-Z0-9\s]/), ).length return symbolsCount >= minimum } diff --git a/ui/src/pages/console/console-panel-users.tsx b/ui/src/pages/console/console-panel-users.tsx index dc4903eb5..7829b19e3 100644 --- a/ui/src/pages/console/console-panel-users.tsx +++ b/ui/src/pages/console/console-panel-users.tsx @@ -144,7 +144,11 @@ const ConsolePanelUsers = () => { { title: 'Updated', renderCell: (user) => ( - + <> + {user.updateTime ? ( + + ) : null} + ), }, {