From 447dd41f6465c412918689c7abc7b5161f7ee719 Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Fri, 28 Jun 2024 17:11:16 +0200 Subject: [PATCH 1/9] feat: add back arrow --- .../ResetPassword/View/resetPasswordStyle.tsx | 3 + .../ResetPassword/View/resetPasswordView.tsx | 8 ++- .../View/updatePasswordStyle.tsx | 3 + .../View/updatePasswordView.tsx | 9 ++- .../UserSignin/View/userSigninStyle.tsx | 3 + .../UserSignin/View/userSigninView.tsx | 9 ++- .../UserSignup/View/userSignupStyle.tsx | 3 + .../UserSignup/View/userSignupView.tsx | 9 ++- .../PdfViewer/View/pdfViewerStyle.tsx | 5 +- .../PdfViewer/View/pdfViewerView.tsx | 59 ++++++++++--------- 10 files changed, 72 insertions(+), 39 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordStyle.tsx b/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordStyle.tsx index e6c6a23a0..992008d0f 100644 --- a/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordStyle.tsx @@ -5,6 +5,9 @@ export const ResetPasswordStyle = makeStyles(() => ({ section: { backgroundColor: Colours.colours.white, }, + container: { + maxWidth: 700, + }, account: { fontSize: 72, color: Colours.colours.violet, diff --git a/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordView.tsx b/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordView.tsx index d48530e58..4cceedbe6 100644 --- a/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordView.tsx +++ b/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/resetPasswordView.tsx @@ -9,6 +9,7 @@ import { Card, CardContent, CircularProgress } from "@material-ui/core"; import { AccountCircle } from "@material-ui/icons"; import Skeleton from "@material-ui/lab/Skeleton"; import { ViewProperties } from "../../../../Shared/Abstractions"; +import { BackArrow } from "../../../../Shared/Components"; import { ReactChangeEvent, ReactKeyboardEvent } from "../../../../Shared/types"; import { ResetPasswordStyle } from "./resetPasswordStyle"; @@ -43,8 +44,11 @@ export const ResetPasswordView = (props: Properties): JSX.Element => { const classes = ResetPasswordStyle(); return (
- - + + + + + diff --git a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordStyle.tsx b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordStyle.tsx index c6c94a78f..03e632e04 100644 --- a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordStyle.tsx @@ -5,6 +5,9 @@ export const UpdatePasswordStyle = makeStyles(() => ({ section: { backgroundColor: Colours.colours.white, }, + container: { + maxWidth: 700, + }, account: { fontSize: 72, color: Colours.colours.violet, diff --git a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordView.tsx b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordView.tsx index b63950074..39e299fcb 100644 --- a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordView.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/updatePasswordView.tsx @@ -9,7 +9,7 @@ import { AccountCircle } from "@material-ui/icons"; import Skeleton from "@material-ui/lab/Skeleton"; import { ViewProperties } from "../../../../Shared/Abstractions"; import { ReactChangeEvent, ReactKeyboardEvent } from "../../../../Shared/types"; -import { TextFiedWithPassword } from "../../../../Shared/Components"; +import { BackArrow, TextFiedWithPassword } from "../../../../Shared/Components"; import { UpdatePasswordStyle } from "./updatePasswordStyle"; interface Properties extends ViewProperties { @@ -46,8 +46,11 @@ export const UpdatePasswordView = (props: Properties): JSX.Element => { const classes = UpdatePasswordStyle(); return (
- - + + + + + diff --git a/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninStyle.tsx b/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninStyle.tsx index b59633ab2..007f272e4 100644 --- a/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninStyle.tsx @@ -5,6 +5,9 @@ export const UserSigninStyle = makeStyles(theme => ({ section: { backgroundColor: Colours.colours.white, }, + container: { + maxWidth: 700, + }, tertiaryAction: { [theme.breakpoints.up("sm")]: { textAlign: "right", diff --git a/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninView.tsx b/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninView.tsx index 1e8cbb20e..2b10a032a 100644 --- a/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninView.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UserSignin/View/userSigninView.tsx @@ -11,7 +11,7 @@ import { AccountCircle } from "@material-ui/icons"; import Skeleton from "@material-ui/lab/Skeleton"; import { ViewProperties } from "../../../../Shared/Abstractions"; import { ReactChangeEvent, ReactKeyboardEvent } from "../../../../Shared/types"; -import { TextFiedWithPassword } from "../../../../Shared/Components"; +import { BackArrow, TextFiedWithPassword } from "../../../../Shared/Components"; import { UserSigninStyle } from "./userSigninStyle"; interface Properties extends ViewProperties { @@ -53,8 +53,11 @@ export const UserSigninView = (props: Properties): JSX.Element => { const classes = UserSigninStyle(); return (
- - + + + + + diff --git a/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupStyle.tsx b/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupStyle.tsx index b0cfb89b9..736ae8d97 100644 --- a/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupStyle.tsx @@ -5,6 +5,9 @@ export const UserSignupStyle = makeStyles(() => ({ section: { backgroundColor: Colours.colours.white, }, + container: { + maxWidth: 700, + }, account: { fontSize: 72, color: Colours.colours.violet, diff --git a/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupView.tsx b/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupView.tsx index 5d47cdd68..06ca919f4 100644 --- a/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupView.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UserSignup/View/userSignupView.tsx @@ -14,7 +14,7 @@ import Skeleton from "@material-ui/lab/Skeleton"; import { VioletCheckbox } from "../../../../Theme"; import { ViewProperties } from "../../../../Shared/Abstractions"; import { ReactChangeEvent, ReactKeyboardEvent } from "../../../../Shared/types"; -import { TextFiedWithPassword } from "../../../../Shared/Components"; +import { BackArrow, TextFiedWithPassword } from "../../../../Shared/Components"; import { ReactHtmlParser } from "../../../../Shared/Services/Renderers"; import { UserSignupStyle } from "./userSignupStyle"; @@ -63,8 +63,11 @@ export const UserSignupView = (props: Properties): JSX.Element => { const classes = UserSignupStyle(); return (
- - + + + + + diff --git a/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerStyle.tsx b/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerStyle.tsx index 970da590a..969a16285 100644 --- a/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerStyle.tsx +++ b/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerStyle.tsx @@ -5,6 +5,9 @@ export const PdfViewerStyle = makeStyles(() => ({ section: { backgroundColor: Colours.colours.white, }, + container: { + maxWidth: 700, + }, header: { color: Colours.colours.black, fontSize: 14, @@ -28,7 +31,7 @@ export const PdfViewerStyle = makeStyles(() => ({ cursor: "pointer", }, canvas: { - padding: 60, + padding: 15, marginLeft: "auto", marginRight: "auto", display: "block", diff --git a/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerView.tsx b/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerView.tsx index 53de5f9eb..f088a4026 100644 --- a/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerView.tsx +++ b/TokanPages.ClientApp/src/Components/PdfViewer/View/pdfViewerView.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { useDispatch, useSelector } from "react-redux"; -import { Box, Grid } from "@material-ui/core"; +import { Box, Container, Grid } from "@material-ui/core"; import NavigateBeforeIcon from "@material-ui/icons/NavigateBefore"; import NavigateNextIcon from "@material-ui/icons/NavigateNext"; import CheckIcon from "@material-ui/icons/Check"; @@ -9,7 +9,7 @@ import { ApplicationState } from "../../../Store/Configuration"; import { GET_DOCUMENTS_URL } from "../../../Api/Request"; import { RaiseError } from "../../../Shared/Services/ErrorServices"; import { PDF_WORKER_URL } from "../../../Shared/constants"; -import { ProgressBar } from "../../../Shared/Components"; +import { BackArrow, ProgressBar } from "../../../Shared/Components"; import { PdfViewerStyle } from "./pdfViewerStyle"; interface PdfViewerViewProps { @@ -134,32 +134,37 @@ export const PdfViewerView = (props: PdfViewerViewProps): JSX.Element => { return (
- - - {isLoading && !hasError ? ( - - ) : hasError ? ( - - ) : ( - - )} -
- {currentPage} / {numPages} -
-
- - -
+ + + - - - -
+ + + {isLoading && !hasError ? ( + + ) : hasError ? ( + + ) : ( + + )} +
+ {currentPage} / {numPages} +
+
+ + +
+
+ + + +
+
); }; From a8385c064f6bd43852a70347d84f7c52037ea08e Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Fri, 28 Jun 2024 17:12:19 +0200 Subject: [PATCH 2/9] test: update snapshots --- .../resetPasswordView.test.tsx.snap | 18 +++-- .../updatePasswordView.test.tsx.snap | 18 +++-- .../userSigninView.test.tsx.snap | 22 +++-- .../__snapshots__/userSignin.test.tsx.snap | 71 +++++++++++----- .../userSignupView.test.tsx.snap | 18 +++-- .../__snapshots__/userSignup.test.tsx.snap | 81 +++++++++++++------ 6 files changed, 157 insertions(+), 71 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/__snapshots__/resetPasswordView.test.tsx.snap b/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/__snapshots__/resetPasswordView.test.tsx.snap index a6059f0aa..d19cf0ed5 100644 --- a/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/__snapshots__/resetPasswordView.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Account/ResetPassword/View/__snapshots__/resetPasswordView.test.tsx.snap @@ -5,28 +5,34 @@ exports[`test account group component: resetPasswordView should render correctly className="makeStyles-section-1" > + + + Reset Password diff --git a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/__snapshots__/updatePasswordView.test.tsx.snap b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/__snapshots__/updatePasswordView.test.tsx.snap index 9052cad4d..da2a8f1a7 100644 --- a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/__snapshots__/updatePasswordView.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/View/__snapshots__/updatePasswordView.test.tsx.snap @@ -5,28 +5,34 @@ exports[`test account group component: updatePasswordView should render correctl className="makeStyles-section-1" > + + + Update password diff --git a/TokanPages.ClientApp/src/Components/Account/UserSignin/View/__snapshots__/userSigninView.test.tsx.snap b/TokanPages.ClientApp/src/Components/Account/UserSignin/View/__snapshots__/userSigninView.test.tsx.snap index a7682a82e..2750c9f6c 100644 --- a/TokanPages.ClientApp/src/Components/Account/UserSignin/View/__snapshots__/userSigninView.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Account/UserSignin/View/__snapshots__/userSigninView.test.tsx.snap @@ -5,28 +5,34 @@ exports[`test account group component: userSigninView should render correctly '< className="makeStyles-section-1" > + + + Sign in @@ -89,7 +95,7 @@ exports[`test account group component: userSigninView should render correctly '< /> @@ -104,7 +110,7 @@ exports[`test account group component: userSigninView should render correctly '< />
+

+ + + Create a new account diff --git a/TokanPages.ClientApp/src/Components/Account/UserSignup/__snapshots__/userSignup.test.tsx.snap b/TokanPages.ClientApp/src/Components/Account/UserSignup/__snapshots__/userSignup.test.tsx.snap index 05ba608d9..d2d82d063 100644 --- a/TokanPages.ClientApp/src/Components/Account/UserSignup/__snapshots__/userSignup.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Account/UserSignup/__snapshots__/userSignup.test.tsx.snap @@ -5,23 +5,57 @@ exports[`test account group component: userSignup should render correctly '
+

Date: Fri, 28 Jun 2024 17:16:44 +0200 Subject: [PATCH 3/9] test: update tests --- .../Account/ResetPassword/resetPassword.test.tsx | 7 ++++++- .../Account/UpdatePassword/updatePassword.test.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Account/ResetPassword/resetPassword.test.tsx b/TokanPages.ClientApp/src/Components/Account/ResetPassword/resetPassword.test.tsx index ed68cc100..4246fa9a2 100644 --- a/TokanPages.ClientApp/src/Components/Account/ResetPassword/resetPassword.test.tsx +++ b/TokanPages.ClientApp/src/Components/Account/ResetPassword/resetPassword.test.tsx @@ -2,6 +2,7 @@ import "../../../setupTests"; import React from "react"; import * as Redux from "react-redux"; import * as Router from "react-router"; +import { BrowserRouter } from "react-router-dom"; import { render } from "enzyme"; import { ResetPassword } from "./resetPassword"; @@ -33,7 +34,11 @@ describe("test account group component: resetPassword", () => { }); it("should renders correctly '' when content is loaded.", () => { - const html = render(); + const html = render( + + + + ); expect(useDispatchMock).toBeCalledTimes(1); expect(html).toMatchSnapshot(); }); diff --git a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/updatePassword.test.tsx b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/updatePassword.test.tsx index 3f78655ac..c69cbee15 100644 --- a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/updatePassword.test.tsx +++ b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/updatePassword.test.tsx @@ -3,6 +3,7 @@ import React from "react"; import * as Redux from "react-redux"; import * as Router from "react-router"; import * as Dom from "react-router-dom"; +import { BrowserRouter } from "react-router-dom"; import { render } from "enzyme"; import { UpdatePassword } from "./updatePassword"; @@ -42,7 +43,11 @@ describe("test account group component: updatePassword", () => { }); it("should render correctly '' when content is loaded.", () => { - const html = render(); + const html = render( + + + + ); expect(useDispatchMock).toBeCalledTimes(1); expect(html).toMatchSnapshot(); }); From b257fb1b82ffccac6b9cdcba18783f6d162cc0bc Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Fri, 28 Jun 2024 17:17:00 +0200 Subject: [PATCH 4/9] feat: update snapshots --- .../__snapshots__/resetPassword.test.tsx.snap | 61 ++++++++++++---- .../updatePassword.test.tsx.snap | 69 ++++++++++++++----- 2 files changed, 96 insertions(+), 34 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Account/ResetPassword/__snapshots__/resetPassword.test.tsx.snap b/TokanPages.ClientApp/src/Components/Account/ResetPassword/__snapshots__/resetPassword.test.tsx.snap index d77f510ec..9947bc30a 100644 --- a/TokanPages.ClientApp/src/Components/Account/ResetPassword/__snapshots__/resetPassword.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Account/ResetPassword/__snapshots__/resetPassword.test.tsx.snap @@ -5,23 +5,57 @@ exports[`test account group component: resetPassword should renders correctly '< class="makeStyles-section-1" >
+

diff --git a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/__snapshots__/updatePassword.test.tsx.snap b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/__snapshots__/updatePassword.test.tsx.snap index 4c02b1515..c2e60e45d 100644 --- a/TokanPages.ClientApp/src/Components/Account/UpdatePassword/__snapshots__/updatePassword.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Account/UpdatePassword/__snapshots__/updatePassword.test.tsx.snap @@ -5,23 +5,57 @@ exports[`test account group component: updatePassword should render correctly '< class="makeStyles-section-1" >
+

+ +
+
+
+
+ +

+ Contact me +

+
@@ -67,10 +110,10 @@ exports[`test component: contactFormView should render correctly '