π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
improvement: add hide/ unhide icon for all password field in the platform. (#3513)
Prateek Shourya817737b2c08c
diff --git a/web/components/account/sign-in-forms/optional-set-password.tsx b/web/components/account/sign-in-forms/optional-set-password.tsxindex 1669811cb8..d7a5952984 100644--- a/web/components/account/sign-in-forms/optional-set-password.tsx+++ b/web/components/account/sign-in-forms/optional-set-password.tsx@@ -8,6 +8,8 @@ import useToast from "hooks/use-toast";import { Button, Input } from "@plane/ui";// helpersimport { checkEmailValidity } from "helpers/string.helper";+// icons+import { Eye, EyeOff } from "lucide-react";type Props = {email: string;@@ -31,6 +33,7 @@ export const SignInOptionalSetPasswordForm: React.FC<Props> = (props) => {const { email, handleSignInRedirection } = props;// statesconst [isGoingToWorkspace, setIsGoingToWorkspace] = useState(false);+ const [showPassword, setShowPassword] = useState(false);// toast alertconst { setToastAlert } = useToast();// form info@@ -114,17 +117,30 @@ export const SignInOptionalSetPasswordForm: React.FC<Props> = (props) => {required: "Password is required",}}render={({ field: { value, onChange, ref } }) => (- <Input- type="password"- value={value}- onChange={onChange}- ref={ref}- hasError={Boolean(errors.password)}- placeholder="Enter password"- className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"- minLength={8}- autoFocus- />+ <div className="relative flex items-center rounded-md bg-onboarding-background-200">+ <Input+ type={showPassword ? "text" : "password"}+ value={value}+ onChange={onChange}+ ref={ref}+ hasError={Boolean(errors.password)}+ placeholder="Enter password"+ className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"+ minLength={8}+ autoFocus+ />+ {showPassword ? (+ <EyeOff+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(false)}+ />+ ) : (+ <Eye+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(true)}+ />+ )}+ </div>)}/><p className="text-onboarding-text-200 text-xs mt-2 pb-3">diff --git a/web/components/account/sign-in-forms/password.tsx b/web/components/account/sign-in-forms/password.tsxindex fd4ccbf403..fe20d5b107 100644--- a/web/components/account/sign-in-forms/password.tsx+++ b/web/components/account/sign-in-forms/password.tsx@@ -2,7 +2,7 @@ import React, { useState } from "react";import Link from "next/link";import { observer } from "mobx-react-lite";import { Controller, useForm } from "react-hook-form";-import { XCircle } from "lucide-react";+import { Eye, EyeOff, XCircle } from "lucide-react";// servicesimport { AuthService } from "services/auth.service";// hooks@@ -40,6 +40,7 @@ export const SignInPasswordForm: React.FC<Props> = observer((props) => {const { email, handleStepChange, handleEmailClear, onSubmit } = props;// statesconst [isSendingUniqueCode, setIsSendingUniqueCode] = useState(false);+ const [showPassword, setShowPassword] = useState(false);// toast alertconst { setToastAlert } = useToast();const {@@ -157,15 +158,28 @@ export const SignInPasswordForm: React.FC<Props> = observer((props) => {required: "Password is required",}}render={({ field: { value, onChange } }) => (- <Input- type="password"- value={value}- onChange={onChange}- hasError={Boolean(errors.password)}- placeholder="Enter password"- className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"- autoFocus- />+ <div className="relative flex items-center rounded-md bg-onboarding-background-200">+ <Input+ type={showPassword ? "text" : "password"}+ value={value}+ onChange={onChange}+ hasError={Boolean(errors.password)}+ placeholder="Enter password"+ className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"+ autoFocus+ />+ {showPassword ? (+ <EyeOff+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(false)}+ />+ ) : (+ <Eye+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(true)}+ />+ )}+ </div>)}/><div className="w-full text-right mt-2 pb-3">diff --git a/web/components/account/sign-up-forms/optional-set-password.tsx b/web/components/account/sign-up-forms/optional-set-password.tsxindex 38fdaeca1d..db14f0ccb5 100644--- a/web/components/account/sign-up-forms/optional-set-password.tsx+++ b/web/components/account/sign-up-forms/optional-set-password.tsx@@ -10,6 +10,8 @@ import { Button, Input } from "@plane/ui";import { checkEmailValidity } from "helpers/string.helper";// constantsimport { ESignUpSteps } from "components/account";+// icons+import { Eye, EyeOff } from "lucide-react";type Props = {email: string;@@ -34,6 +36,7 @@ export const SignUpOptionalSetPasswordForm: React.FC<Props> = (props) => {const { email, handleSignInRedirection } = props;// statesconst [isGoingToWorkspace, setIsGoingToWorkspace] = useState(false);+ const [showPassword, setShowPassword] = useState(false);// toast alertconst { setToastAlert } = useToast();// form info@@ -119,16 +122,29 @@ export const SignUpOptionalSetPasswordForm: React.FC<Props> = (props) => {required: "Password is required",}}render={({ field: { value, onChange } }) => (- <Input- type="password"- value={value}- onChange={onChange}- hasError={Boolean(errors.password)}- placeholder="Enter password"- className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"- minLength={8}- autoFocus- />+ <div className="relative flex items-center rounded-md bg-onboarding-background-200">+ <Input+ type={showPassword ? "text" : "password"}+ value={value}+ onChange={onChange}+ hasError={Boolean(errors.password)}+ placeholder="Enter password"+ className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"+ minLength={8}+ autoFocus+ />+ {showPassword ? (+ <EyeOff+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(false)}+ />+ ) : (+ <Eye+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(true)}+ />+ )}+ </div>)}/><p className="text-onboarding-text-200 text-xs mt-2 pb-3">diff --git a/web/components/account/sign-up-forms/password.tsx b/web/components/account/sign-up-forms/password.tsxindex 6ff6753df2..293e03ef87 100644--- a/web/components/account/sign-up-forms/password.tsx+++ b/web/components/account/sign-up-forms/password.tsx@@ -1,8 +1,8 @@-import React from "react";+import React, { useState } from "react";import Link from "next/link";import { observer } from "mobx-react-lite";import { Controller, useForm } from "react-hook-form";-import { XCircle } from "lucide-react";+import { Eye, EyeOff, XCircle } from "lucide-react";// servicesimport { AuthService } from "services/auth.service";// hooks@@ -32,6 +32,8 @@ const authService = new AuthService();export const SignUpPasswordForm: React.FC<Props> = observer((props) => {const { onSubmit } = props;+ // states+ const [showPassword, setShowPassword] = useState(false);// toast alertconst { setToastAlert } = useToast();// form info@@ -112,15 +114,28 @@ export const SignUpPasswordForm: React.FC<Props> = observer((props) => {required: "Password is required",}}render={({ field: { value, onChange } }) => (- <Input- type="password"- value={value}- onChange={onChange}- hasError={Boolean(errors.password)}- placeholder="Enter password"- className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"- autoFocus- />+ <div className="relative flex items-center rounded-md bg-onboarding-background-200">+ <Input+ type={showPassword ? "text" : "password"}+ value={value}+ onChange={onChange}+ hasError={Boolean(errors.password)}+ placeholder="Enter password"+ className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"+ autoFocus+ />+ {showPassword ? (+ <EyeOff+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(false)}+ />+ ) : (+ <Eye+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(true)}+ />+ )}+ </div>)}/><p className="text-onboarding-text-200 text-xs mt-2 pb-3">diff --git a/web/components/instance/setup-form/sign-in-form.tsx b/web/components/instance/setup-form/sign-in-form.tsxindex f34d807c91..c4a9de6a39 100644--- a/web/components/instance/setup-form/sign-in-form.tsx+++ b/web/components/instance/setup-form/sign-in-form.tsx@@ -1,6 +1,6 @@-import { FC } from "react";+import { FC, useState } from "react";import { useForm, Controller } from "react-hook-form";-import { XCircle } from "lucide-react";+import { Eye, EyeOff, XCircle } from "lucide-react";// hooksimport { useUser } from "hooks/store";// ui@@ -24,6 +24,8 @@ export interface IInstanceSetupEmailForm {export const InstanceSetupSignInForm: FC<IInstanceSetupEmailForm> = (props) => {const { handleNextStep } = props;+ // states+ const [showPassword, setShowPassword] = useState(false);// store hooksconst { fetchCurrentUser } = useUser();// form info@@ -107,14 +109,27 @@ export const InstanceSetupSignInForm: FC<IInstanceSetupEmailForm> = (props) => {required: "Password is required",}}render={({ field: { value, onChange } }) => (- <Input- type="password"- value={value}- onChange={onChange}- hasError={Boolean(errors.password)}- placeholder="Enter password"- className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"- />+ <div className="relative flex items-center rounded-md bg-onboarding-background-200">+ <Input+ type={showPassword ? "text" : "password"}+ value={value}+ onChange={onChange}+ hasError={Boolean(errors.password)}+ placeholder="Enter password"+ className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"+ />+ {showPassword ? (+ <EyeOff+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(false)}+ />+ ) : (+ <Eye+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(true)}+ />+ )}+ </div>)}/><p className="pb-2 text-xs text-custom-text-200">diff --git a/web/pages/accounts/reset-password.tsx b/web/pages/accounts/reset-password.tsxindex 2b893d665a..9854ec5bb2 100644--- a/web/pages/accounts/reset-password.tsx+++ b/web/pages/accounts/reset-password.tsx@@ -1,4 +1,4 @@-import { ReactElement } from "react";+import { ReactElement, useState } from "react";import Image from "next/image";import { useRouter } from "next/router";import { Controller, useForm } from "react-hook-form";@@ -19,6 +19,8 @@ import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png";import { checkEmailValidity } from "helpers/string.helper";// typeimport { NextPageWithLayout } from "lib/types";+// icons+import { Eye, EyeOff } from "lucide-react";type TResetPasswordFormValues = {email: string;@@ -37,6 +39,8 @@ const ResetPasswordPage: NextPageWithLayout = () => {// routerconst router = useRouter();const { uidb64, token, email } = router.query;+ // states+ const [showPassword, setShowPassword] = useState(false);// toastconst { setToastAlert } = useToast();// sign in redirection hook@@ -117,15 +121,28 @@ const ResetPasswordPage: NextPageWithLayout = () => {required: "Password is required",}}render={({ field: { value, onChange } }) => (- <Input- type="password"- value={value}- onChange={onChange}- hasError={Boolean(errors.password)}- placeholder="Enter password"- className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"- minLength={8}- />+ <div className="relative flex items-center rounded-md bg-onboarding-background-200">+ <Input+ type={showPassword ? "text" : "password"}+ value={value}+ onChange={onChange}+ hasError={Boolean(errors.password)}+ placeholder="Enter password"+ className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 placeholder:text-onboarding-text-400"+ minLength={8}+ />+ {showPassword ? (+ <EyeOff+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(false)}+ />+ ) : (+ <Eye+ className="absolute right-3 h-5 w-5 stroke-custom-text-400 hover:cursor-pointer"+ onClick={() => setShowPassword(true)}+ />+ )}+ </div>)}/><Button