From 07cb5f98315fde40ea02000dd985c1f92e16b800 Mon Sep 17 00:00:00 2001 From: Agit Rubar Demir <61833677+agitrubard@users.noreply.github.com> Date: Sat, 7 May 2022 21:25:49 +0300 Subject: [PATCH] Password Show Feature | SIS-191 (#89) * TeacherPasswordOperationController/isPasswordChangeOperationEnabled Endpoint Has Been Fixed * Push Path and PageNotFound user Has Been Fixed * Show Password Feature Has Been Added to Teacher Change Password Page * Show Password Feature Has Been Added to Officer Login Page * Show Password Feature Has Been Added to Student Login Page * Show Password Feature Has Been Added to Teacher Login Page * Show Password Feature Has Been Added to Teacher Change Password Page * Show Password Feature Has Been Added to Officer Login Page * Show Password Feature Has Been Added to Student Login Page * Show Password Feature Has Been Added to Teacher Login Page * Push Page Path Has Been Fixed * Show Password Feature Has Been Added to Student Change Password Page * Show Password Feature Has Been Added to Officer Change Password Page --- .../change-password/[operationId]/index.js | 102 +++++++++++++---- pages/login/officer/index.js | 50 ++++++-- .../change-password/[operationId]/index.js | 103 +++++++++++++---- pages/login/student/index.js | 53 +++++++-- .../change-password/[operationId]/index.js | 107 ++++++++++++++---- pages/login/teacher/index.js | 53 +++++++-- .../TeacherPasswordOperationController.js | 2 +- 7 files changed, 365 insertions(+), 105 deletions(-) diff --git a/pages/login/officer/change-password/[operationId]/index.js b/pages/login/officer/change-password/[operationId]/index.js index 4e143536..0f22541c 100644 --- a/pages/login/officer/change-password/[operationId]/index.js +++ b/pages/login/officer/change-password/[operationId]/index.js @@ -1,4 +1,4 @@ -import {FingerPrintIcon} from "@heroicons/react/outline"; +import {EyeIcon, EyeOffIcon, FingerPrintIcon} from "@heroicons/react/outline"; import {useState} from "react"; import {useRouter} from "next/router"; import SISTitle from "../../../../../public/components/page-titles"; @@ -110,6 +110,18 @@ export default function OfficerChangePassword({isDataFound, operationId}) { } } + + const [isNewPasswordShow, setIsNewPasswordShow] = useState(false); + const showNewPassword = () => { + setIsNewPasswordShow(!isNewPasswordShow); + } + + + const [isNewPasswordRepeatShow, setIsNewPasswordRepeatShow] = useState(false); + const showNewPasswordRepeat = () => { + setIsNewPasswordRepeatShow(!isNewPasswordRepeatShow); + } + return ( <>
@@ -139,38 +151,84 @@ export default function OfficerChangePassword({isDataFound, operationId}) {
- - +
+
+ { + isNewPasswordShow + ? +
+ +
- - +
+
+ { + isNewPasswordRepeatShow + ? +
+ +
-
+
diff --git a/pages/login/student/change-password/[operationId]/index.js b/pages/login/student/change-password/[operationId]/index.js index 0430839e..e1c4c78f 100644 --- a/pages/login/student/change-password/[operationId]/index.js +++ b/pages/login/student/change-password/[operationId]/index.js @@ -1,4 +1,4 @@ -import {FingerPrintIcon} from "@heroicons/react/outline"; +import {EyeIcon, EyeOffIcon, FingerPrintIcon} from "@heroicons/react/outline"; import {useState} from "react"; import {useRouter} from "next/router"; import SISTitle from "../../../../../public/components/page-titles"; @@ -111,6 +111,18 @@ export default function StudentForgotPassword({isDataFound, operationId}) { } } + + const [isNewPasswordShow, setIsNewPasswordShow] = useState(false); + const showNewPassword = () => { + setIsNewPasswordShow(!isNewPasswordShow); + } + + + const [isNewPasswordRepeatShow, setIsNewPasswordRepeatShow] = useState(false); + const showNewPasswordRepeat = () => { + setIsNewPasswordRepeatShow(!isNewPasswordRepeatShow); + } + return ( <>
@@ -140,40 +152,85 @@ export default function StudentForgotPassword({isDataFound, operationId}) {
- - +
+
+ { + isNewPasswordShow + ? +
+ +
- - +
+
+ { + isNewPasswordRepeatShow + ? +
+ +
-
-
+
-
+
-
+