From 7be2835d30946572ff963d84c3efc060a01b1e85 Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 00:14:45 +0200 Subject: [PATCH 01/11] Redesigned Login Area --- .gitignore | 2 ++ src/components/basicElements/Login.css | 0 src/components/basicElements/Login.tsx | 46 ++++++++++++++++++-------- src/style/helpers.scss | 24 ++++++++++++++ 4 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 src/components/basicElements/Login.css diff --git a/.gitignore b/.gitignore index 0f319d1a..38c3a417 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,8 @@ local.properties */.idea/ +/.idea + # Sensitive or high-churn files */.idea/**/dataSources/ */.idea/**/dataSources.ids diff --git a/src/components/basicElements/Login.css b/src/components/basicElements/Login.css new file mode 100644 index 00000000..e69de29b diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index c0e94775..c9eccbe3 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -1,7 +1,9 @@ import React, {FormEvent, ReactElement, useState} from 'react'; -import {Button, Form, Container, Row,Col,Spinner} from "react-bootstrap"; +import {Button, Form, Container, Row,Col,Spinner, Image} from "react-bootstrap"; import {loginWithUsernameAndPassword} from "../../background/api/auth"; +import logo from "../../assets/images/logos/logoWithWhiteBorder.png"; + function Login(): ReactElement { const [userName, setUsername] = useState(""); const [password, setPassword] = useState(""); @@ -30,26 +32,36 @@ function Login(): ReactElement { return ( - - - + + + + + + + + +

Greetings Traveller!

+
+ +

Be welcome at FileFighter

+
+
+ + +
- Username - setUsername(event.target.value)}/> + setUsername(event.target.value)}/> - Password setPassword(event.target.value)}/> - Contact your administrator if you have forgotten your password. + Contact your administrator if you have forgotten your login details. - - setStayLoggedIn(!stayLoggedIn)}/> - - - + + setStayLoggedIn(!stayLoggedIn)}/> + + *By clicking this, you accept the usage of cookies. + +

{errorMessage}

+
); } diff --git a/src/style/helpers.scss b/src/style/helpers.scss index 3e759fd0..bb926a0c 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -1,3 +1,27 @@ .text-shadow-none{ text-shadow: none; } + +.center-items { + display: flex; + align-items: center; + justify-content: center; +} + + +.login-container { + + border-radius: 15px; + background-color: #333333; + @media (min-width: 992px) { + width: 50%; + left: 25%; + } + @media (max-height: 659px) { + margin-top: 15px; + } + @media (min-height: 660px) { + margin-top: 10%; + } + padding-top: 15px +} \ No newline at end of file From adba7bc01971d752934c93952141613dfc003128 Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 00:19:32 +0200 Subject: [PATCH 02/11] Minor color change --- WebApp.iml | 8 ++++++++ src/style/helpers.scss | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 WebApp.iml diff --git a/WebApp.iml b/WebApp.iml new file mode 100644 index 00000000..80cc7391 --- /dev/null +++ b/WebApp.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/style/helpers.scss b/src/style/helpers.scss index bb926a0c..b1009d81 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -1,4 +1,8 @@ -.text-shadow-none{ +root { + --highlight-area-gray: #333333; +} + +.text-shadow-none { text-shadow: none; } @@ -12,7 +16,7 @@ .login-container { border-radius: 15px; - background-color: #333333; + background-color: var(--highlight-area-gray); @media (min-width: 992px) { width: 50%; left: 25%; From 936aeccaece4c496bc871760228105b2bc5f464a Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 00:53:47 +0200 Subject: [PATCH 03/11] Added background image --- .../images/background/parallax-mountain.png | Bin 0 -> 14251 bytes src/components/basicElements/Login.tsx | 103 +++++++++--------- src/style/helpers.scss | 21 +++- 3 files changed, 72 insertions(+), 52 deletions(-) create mode 100644 src/assets/images/background/parallax-mountain.png diff --git a/src/assets/images/background/parallax-mountain.png b/src/assets/images/background/parallax-mountain.png new file mode 100644 index 0000000000000000000000000000000000000000..870688c0a73959a649f6e4a50b997bc48eb504df GIT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i=m%&o~B zl%>S(o85u0pOg554+=K4b}}_Ia&)pcu|Jvl`^hib0EWxw!vX8d#0mr#)iIC}2YNs< M67qKo#SEVOAGV}@qyPW_ literal 0 HcmV?d00001 diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index c9eccbe3..475ec460 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -1,5 +1,5 @@ import React, {FormEvent, ReactElement, useState} from 'react'; -import {Button, Form, Container, Row,Col,Spinner, Image} from "react-bootstrap"; +import {Button, Col, Container, Form, Image, Row, Spinner} from "react-bootstrap"; import {loginWithUsernameAndPassword} from "../../background/api/auth"; import logo from "../../assets/images/logos/logoWithWhiteBorder.png"; @@ -9,13 +9,13 @@ function Login(): ReactElement { const [password, setPassword] = useState(""); const [stayLoggedIn, setStayLoggedIn] = useState(true); const [errorMessage, setErrorMessage] = useState(""); - const [loading,setLoading]=useState(false); + const [loading, setLoading] = useState(false); const handleSubmit = (event: FormEvent) => { event.preventDefault(); setLoading(true) - loginWithUsernameAndPassword(userName, password,stayLoggedIn) + loginWithUsernameAndPassword(userName, password, stayLoggedIn) .then(() => { //nothing to do here :) setErrorMessage(""); @@ -32,55 +32,58 @@ function Login(): ReactElement { return ( - - + + + + + + + +

Greetings Traveller!

+
+ +

Be welcome at FileFighter

+
+
+ + + +
+ + setUsername(event.target.value)}/> + - - - - - -

Greetings Traveller!

-
- -

Be welcome at FileFighter

-
-
- - - - - - setUsername(event.target.value)}/> - - - - setPassword(event.target.value)}/> - - Contact your administrator if you have forgotten your login details. - - + + setPassword(event.target.value)}/> + + Contact your administrator if you have forgotten your login details. + + - - - setStayLoggedIn(!stayLoggedIn)}/> - - *By clicking this, you accept the usage of cookies. - - -

{errorMessage}

- - -
+ + + setStayLoggedIn(!stayLoggedIn)}/> + + *By clicking this, you accept the usage of cookies. + + +

{errorMessage}

+ + +
+
); } diff --git a/src/style/helpers.scss b/src/style/helpers.scss index b1009d81..856f93e2 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -12,15 +12,24 @@ root { justify-content: center; } +.login-page { + background-image: url("../assets/images/background/parallax-mountain.png"); +} .login-container { - + opacity: .95; + background-color: $body-bg; border-radius: 15px; - background-color: var(--highlight-area-gray); + @media (min-width: 992px) { width: 50%; left: 25%; } + + @media (min-width: 1150px) { + width: 40%; + left: 30%; + } @media (max-height: 659px) { margin-top: 15px; } @@ -28,4 +37,12 @@ root { margin-top: 10%; } padding-top: 15px +} + +.login-input .row:first-child { + justify-content: center; +} + +.login-input .row:first-child .col { + max-width: 450px; } \ No newline at end of file From 02b707983f216732b278c56d8993bc996ae46038 Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 00:57:40 +0200 Subject: [PATCH 04/11] alignment changes --- src/components/basicElements/Login.tsx | 4 ++-- src/style/helpers.scss | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index 475ec460..f927a4a0 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -33,8 +33,8 @@ function Login(): ReactElement { return ( - - + + diff --git a/src/style/helpers.scss b/src/style/helpers.scss index 856f93e2..bcf1fd47 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -39,6 +39,10 @@ root { padding-top: 15px } +.login-intro .row { + justify-content: center; +} + .login-input .row:first-child { justify-content: center; } From 7b6182996aea3be7634a1d76413cc4742d92630e Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 17:41:10 +0200 Subject: [PATCH 05/11] Added stories --- .../basicElements/Login.stories.tsx | 54 +++++ src/components/basicElements/Login.tsx | 190 ++++++++++++------ 2 files changed, 187 insertions(+), 57 deletions(-) create mode 100644 src/components/basicElements/Login.stories.tsx diff --git a/src/components/basicElements/Login.stories.tsx b/src/components/basicElements/Login.stories.tsx new file mode 100644 index 00000000..df97bdd2 --- /dev/null +++ b/src/components/basicElements/Login.stories.tsx @@ -0,0 +1,54 @@ +import React from "react"; +import {storiesOf} from "@storybook/react"; +import {BrowserRouter} from "react-router-dom"; +import '../../style/custom.scss'; +import Login, {LoginHeader, LoginInput, LoginInteractionArea} from "./Login"; +import {action} from "@storybook/addon-actions"; + +storiesOf("Login", module) + .add("default", () => + + + + ) + + .add("onlyHeader", () => + + + + ) + + .add("onlyInput", () => ( + + console.log("Clicked on submit")} + username={""} + setUsername={action("changed username")} + password={""} + setPassword={action("changed password")} + isLoading={false} + setIsLoading={action("is loading")} + stayLoggedIn={false} + setStayLoggedIn={action("changed stay logged in")} + errorMessage={""} + /> + + ) + ) + + .add("interactionArea", () => + + console.log("Clicked on submit")} + username={""} + setUsername={action("changed username")} + password={""} + setPassword={action("changed password")} + isLoading={false} + setIsLoading={action("is loading")} + stayLoggedIn={false} + setStayLoggedIn={action("changed stay logged in")} + errorMessage={""} + /> + + ) \ No newline at end of file diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index f927a4a0..fbe7ef5d 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -1,91 +1,167 @@ -import React, {FormEvent, ReactElement, useState} from 'react'; +import React, {Dispatch, FormEvent, ReactElement, SetStateAction, useState} from 'react'; import {Button, Col, Container, Form, Image, Row, Spinner} from "react-bootstrap"; import {loginWithUsernameAndPassword} from "../../background/api/auth"; import logo from "../../assets/images/logos/logoWithWhiteBorder.png"; +export interface LoginInputInterface { + handleSubmit: (event: FormEvent) => void, + username: string|number|string[]|undefined, + setUsername: Dispatch>, + password: string|number|string[]|undefined, + setPassword: Dispatch>, + isLoading: boolean, + setIsLoading: Dispatch>, + stayLoggedIn: boolean, + setStayLoggedIn: Dispatch>, + errorMessage: string|null +} + function Login(): ReactElement { const [userName, setUsername] = useState(""); const [password, setPassword] = useState(""); const [stayLoggedIn, setStayLoggedIn] = useState(true); const [errorMessage, setErrorMessage] = useState(""); - const [loading, setLoading] = useState(false); + const [isLoading, setIsLoading] = useState(false); const handleSubmit = (event: FormEvent) => { event.preventDefault(); - setLoading(true) + setIsLoading(true) loginWithUsernameAndPassword(userName, password, stayLoggedIn) .then(() => { //nothing to do here :) setErrorMessage(""); - setLoading(false); + setIsLoading(false); }) .catch(((error) => { console.log(error); - setLoading(false) + setIsLoading(false) setErrorMessage(error.response?.data.message); })) }; - return ( - - - - - - -

Greetings Traveller!

-
- -

Be welcome at FileFighter

-
-
- - - -
- - setUsername(event.target.value)}/> - + + ); +} - - setPassword(event.target.value)}/> - - Contact your administrator if you have forgotten your login details. - - +export function LoginInteractionArea(props: LoginInputInterface) { + const { + handleSubmit, + username, + setUsername, + password, + setPassword, + isLoading, + setIsLoading, + stayLoggedIn, + setStayLoggedIn, + errorMessage, + } = props + return ( + + + + + ) +} - - - setStayLoggedIn(!stayLoggedIn)}/> - - *By clicking this, you accept the usage of cookies. - - -

{errorMessage}

- - -
-
-
-
); +export function LoginHeader() { + return ( + + + + + +

Greetings Traveller!

+
+ +

Be welcome at FileFighter

+
+
+ ) +} + +export function LoginInput(props: LoginInputInterface) { + const { + handleSubmit, + username, + setUsername, + password, + setPassword, + isLoading, + stayLoggedIn, + setStayLoggedIn, + errorMessage, + } = props + + return ( + + + +
+ + setUsername(event.target.value)}/> + + + + setPassword(event.target.value)}/> + + Contact your administrator if you have forgotten your login details. + + + + + + setStayLoggedIn(!stayLoggedIn)}/> + + *By clicking this, you accept the usage of cookies. + + +

{errorMessage}

+
+ +
+
+ ) } export default Login; From ec918fe278434c436f14539b57afdf4e2366568b Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 17:46:43 +0200 Subject: [PATCH 06/11] deleted own centering css --- src/components/basicElements/Login.tsx | 2 +- src/style/helpers.scss | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index fbe7ef5d..f904f449 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -123,7 +123,7 @@ export function LoginInput(props: LoginInputInterface) { return ( - +
diff --git a/src/style/helpers.scss b/src/style/helpers.scss index bcf1fd47..9b598ef6 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -39,14 +39,6 @@ root { padding-top: 15px } -.login-intro .row { - justify-content: center; -} - -.login-input .row:first-child { - justify-content: center; -} - .login-input .row:first-child .col { max-width: 450px; } \ No newline at end of file From 341f9de60e806b7808871294311ca3466d8ea4cc Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 17:54:08 +0200 Subject: [PATCH 07/11] Deleted Nested Container --- src/components/basicElements/Login.tsx | 16 ++++++++-------- src/style/helpers.scss | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index f904f449..b95d3ff1 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -74,7 +74,7 @@ export function LoginInteractionArea(props: LoginInputInterface) { errorMessage, } = props return ( - +
- +
) } export function LoginHeader() { return ( - +
@@ -104,7 +104,7 @@ export function LoginHeader() {

Be welcome at FileFighter

- +
) } @@ -122,10 +122,10 @@ export function LoginInput(props: LoginInputInterface) { } = props return ( - +
- - + + setUsername(event.target.value)}/> @@ -160,7 +160,7 @@ export function LoginInput(props: LoginInputInterface) { - +
) } diff --git a/src/style/helpers.scss b/src/style/helpers.scss index 9b598ef6..648c0599 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -39,6 +39,6 @@ root { padding-top: 15px } -.login-input .row:first-child .col { +.login-input { max-width: 450px; } \ No newline at end of file From bd0adb251072ceac2468ab43e39f852d38893716 Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 17:55:40 +0200 Subject: [PATCH 08/11] Removed ide file --- .gitignore | 2 ++ WebApp.iml | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 WebApp.iml diff --git a/.gitignore b/.gitignore index 38c3a417..91d44bea 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,8 @@ local.properties /.idea +WebApp.iml + # Sensitive or high-churn files */.idea/**/dataSources/ */.idea/**/dataSources.ids diff --git a/WebApp.iml b/WebApp.iml deleted file mode 100644 index 80cc7391..00000000 --- a/WebApp.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From f8ef5ca43f0ca498f376eb61fc7c4ffb1d2a0394 Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 18:00:54 +0200 Subject: [PATCH 09/11] Fixed bug in centering --- src/components/basicElements/Login.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/basicElements/Login.tsx b/src/components/basicElements/Login.tsx index b95d3ff1..821dfa41 100644 --- a/src/components/basicElements/Login.tsx +++ b/src/components/basicElements/Login.tsx @@ -95,13 +95,13 @@ export function LoginInteractionArea(props: LoginInputInterface) { export function LoginHeader() { return (
- + - +

Greetings Traveller!

- +

Be welcome at FileFighter

@@ -123,7 +123,7 @@ export function LoginInput(props: LoginInputInterface) { return (
- +
From 573579362e2ea645369a03c9149fcdaab0f147fa Mon Sep 17 00:00:00 2001 From: Gimleux Date: Mon, 19 Apr 2021 18:07:25 +0200 Subject: [PATCH 10/11] snapshots --- .../__snapshots__/storybook.test.ts.snap | 390 ++++++++++++++++++ 1 file changed, 390 insertions(+) diff --git a/src/__tests__/__snapshots__/storybook.test.ts.snap b/src/__tests__/__snapshots__/storybook.test.ts.snap index 19fcf8f1..af6a5056 100644 --- a/src/__tests__/__snapshots__/storybook.test.ts.snap +++ b/src/__tests__/__snapshots__/storybook.test.ts.snap @@ -636,6 +636,396 @@ exports[`Storyshots Health default 1`] = `
`; +exports[`Storyshots Login default 1`] = ` +
+
+
+
+ +
+
+

+ Greetings Traveller! +

+
+
+

+ Be welcome at FileFighter +

+
+
+
+
+
+ +
+ +
+
+ + + Contact your administrator if you have forgotten your login details. + +
+ +
+
+ + +
+ + *By clicking this, you accept the usage of cookies. + +
+

+ +

+ +
+
+
+
+
+`; + +exports[`Storyshots Login interactionArea 1`] = ` +
+
+
+ +
+
+

+ Greetings Traveller! +

+
+
+

+ Be welcome at FileFighter +

+
+
+
+
+
+
+
+ +
+
+ + + Contact your administrator if you have forgotten your login details. + +
+ +
+
+ + +
+ + *By clicking this, you accept the usage of cookies. + +
+

+ +

+
+
+
+
+
+`; + +exports[`Storyshots Login onlyHeader 1`] = ` +
+
+ +
+
+

+ Greetings Traveller! +

+
+
+

+ Be welcome at FileFighter +

+
+
+`; + +exports[`Storyshots Login onlyInput 1`] = ` +
+
+
+
+
+ +
+
+ + + Contact your administrator if you have forgotten your login details. + +
+ +
+
+ + +
+ + *By clicking this, you accept the usage of cookies. + +
+

+ +

+
+
+
+
+`; + exports[`Storyshots Registration default 1`] = `
Date: Mon, 19 Apr 2021 19:12:11 +0200 Subject: [PATCH 11/11] use mixins for breakpoints, add logout to nav --- src/components/basicElements/Header.tsx | 8 ++++++++ src/style/helpers.scss | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/basicElements/Header.tsx b/src/components/basicElements/Header.tsx index 925529c0..4067a398 100644 --- a/src/components/basicElements/Header.tsx +++ b/src/components/basicElements/Header.tsx @@ -5,6 +5,7 @@ import logo from "../../assets/images/logos/logo.png"; import { Nav, Navbar, NavbarBrand, NavDropdown } from "react-bootstrap"; import { SystemState } from "../../background/redux/actions/sytemState"; import { connect, ConnectedProps } from "react-redux"; +import {logout} from "../../background/api/auth"; export interface navBarElement_Interface { name: string; @@ -98,6 +99,13 @@ function Header(props: PropsFromRedux): ReactElement { > Profile + { + logout() + }} + > + Logout + )} diff --git a/src/style/helpers.scss b/src/style/helpers.scss index 648c0599..72dceb60 100644 --- a/src/style/helpers.scss +++ b/src/style/helpers.scss @@ -21,15 +21,16 @@ root { background-color: $body-bg; border-radius: 15px; - @media (min-width: 992px) { + @include media-breakpoint-up(lg) { width: 50%; left: 25%; } - @media (min-width: 1150px) { + @include media-breakpoint-up(xl) { width: 40%; left: 30%; } + @media (max-height: 659px) { margin-top: 15px; } @@ -41,4 +42,4 @@ root { .login-input { max-width: 450px; -} \ No newline at end of file +}