From c0e610626a6b008cc5dd8a1396b6a2ffdcd8c078 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 13 Nov 2023 11:09:46 +0100 Subject: [PATCH 1/5] Update linkbutton to use a:href --- README.md | 5 +++++ .../pages/testlab/parts/2_preparation/preparation.tsx | 10 +++------- .../src/pages/testlab/parts/3_test-form/test-form.tsx | 11 +++-------- frontend/src/shared/components/link-button.tsx | 10 ++++------ frontend/src/shared/layout/buttons.scss | 1 + 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8fb430d..17f5512 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,11 @@ contains the backend of this application. It processes the db calls and handle t The newest production-ready release of this application is hosted by the Eastern Switzerland University of Applied Sciences (OST). In the background a [mongo DB](https://www.mongodb.com/) stores the test results and user profiles. +### Deployment + +[Dev Branch Deployment](https://cactus-dev.sifs0003.infs.ch/) +[Main Branch Deployment](https://cactus.projects-ost.ch/) + ## Contribution We appreciate your interest in contributing to our project. There are two mainly focused ways to contribute this project showed in this visualization. diff --git a/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx b/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx index b333c5e..bd5fb4f 100644 --- a/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx +++ b/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx @@ -3,7 +3,6 @@ import { useNavigate } from "react-router-dom"; import Alert from "../../../../shared/components/alert"; import Heading from "../../../../shared/components/heading"; -import LinkButton from "../../../../shared/components/link-button"; import { BsChevronLeft, BsChevronRight } from "react-icons/bs"; import LabPathDisplay from "../../components/lab-path-display"; @@ -223,12 +222,9 @@ const Preparation = ({

Navigation

- } - /> + {buttonState === "save" && ( diff --git a/frontend/src/shared/components/link-button.tsx b/frontend/src/shared/components/link-button.tsx index fe1cf2d..baba2a8 100644 --- a/frontend/src/shared/components/link-button.tsx +++ b/frontend/src/shared/components/link-button.tsx @@ -1,5 +1,4 @@ import React, { ReactElement } from "react"; -import { useNavigate } from "react-router-dom"; type LinkButtonProps = { to: string; @@ -20,19 +19,18 @@ const LinkButton = ({ iconPosition = "left", ariaLabel = undefined, }: LinkButtonProps) => { - const navigate = useNavigate(); return ( - + ); }; diff --git a/frontend/src/shared/layout/buttons.scss b/frontend/src/shared/layout/buttons.scss index 14786b7..09bf756 100644 --- a/frontend/src/shared/layout/buttons.scss +++ b/frontend/src/shared/layout/buttons.scss @@ -18,6 +18,7 @@ button, font-size: 1rem; // display: inline-block; transition-duration: 0.3s; + cursor: pointer; -webkit-user-select: none; /* Safari */ -ms-user-select: none; /* IE 10 and IE 11 */ From b9c19ce37e6ec2ac83db422199d805aa400aacd1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 13 Nov 2023 11:14:34 +0100 Subject: [PATCH 2/5] Add instructions for using branches in README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 17f5512..de6863d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ The newest production-ready release of this application is hosted by the Eastern [Dev Branch Deployment](https://cactus-dev.sifs0003.infs.ch/) [Main Branch Deployment](https://cactus.projects-ost.ch/) +### Use of Branches + +The main and dev-branches are protected. Create a feature branch and a pull request (into dev) to add changes. The main branch is only to be changed from the dev-branch. + ## Contribution We appreciate your interest in contributing to our project. There are two mainly focused ways to contribute this project showed in this visualization. From aa8dcc748de89d09f1a1e08f62c5b0f3f7f1be57 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 13 Nov 2023 11:41:40 +0100 Subject: [PATCH 3/5] Replace a with Link component in LinkButton --- frontend/src/shared/components/link-button.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/shared/components/link-button.tsx b/frontend/src/shared/components/link-button.tsx index baba2a8..89e6865 100644 --- a/frontend/src/shared/components/link-button.tsx +++ b/frontend/src/shared/components/link-button.tsx @@ -1,4 +1,5 @@ import React, { ReactElement } from "react"; +import { Link } from "react-router-dom"; type LinkButtonProps = { to: string; @@ -20,17 +21,17 @@ const LinkButton = ({ ariaLabel = undefined, }: LinkButtonProps) => { return ( - {iconPosition === "left" ? icon : ""} {label}{" "} {iconPosition === "right" ? icon : ""} - + ); }; From ccb41bd7b0c22a54a5fcca1ce317fdf94636a3dc Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 13 Nov 2023 12:53:45 +0100 Subject: [PATCH 4/5] revert changes --- .../pages/testlab/parts/2_preparation/preparation.tsx | 10 +++++++--- .../src/pages/testlab/parts/3_test-form/test-form.tsx | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx b/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx index bd5fb4f..78bb38c 100644 --- a/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx +++ b/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx @@ -12,6 +12,7 @@ import { TestDataContext } from "../../test-lab"; import { browserName, osName } from "react-device-detect"; import SelectScreenreader from "./parts/select-screenreader"; import ComponentLinkSection from "./parts/component-link-section"; +import LinkButton from "../../../../shared/components/link-button"; type PreparationProps = { linkDocs: string; @@ -222,9 +223,12 @@ const Preparation = ({

Navigation

- + } + /> {buttonState === "save" && ( + } + /> From 1a45abacb65aecc21ee7b8d1828712db14a9fa9c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 13 Nov 2023 12:57:48 +0100 Subject: [PATCH 5/5] Sort imports --- .../pages/testlab/parts/2_preparation/preparation.tsx | 8 ++++---- .../src/pages/testlab/parts/3_test-form/test-form.tsx | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx b/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx index 78bb38c..18a48e1 100644 --- a/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx +++ b/frontend/src/pages/testlab/parts/2_preparation/preparation.tsx @@ -1,18 +1,18 @@ import React, { useContext, useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; +import { browserName, osName } from "react-device-detect"; +import { BsChevronLeft, BsChevronRight } from "react-icons/bs"; import Alert from "../../../../shared/components/alert"; import Heading from "../../../../shared/components/heading"; -import { BsChevronLeft, BsChevronRight } from "react-icons/bs"; +import LinkButton from "../../../../shared/components/link-button"; +import { Library } from "../../../../shared/resources/types"; import LabPathDisplay from "../../components/lab-path-display"; -import { Library } from "../../../../shared/resources/types"; import "./preparation.scss"; import { TestDataContext } from "../../test-lab"; -import { browserName, osName } from "react-device-detect"; import SelectScreenreader from "./parts/select-screenreader"; import ComponentLinkSection from "./parts/component-link-section"; -import LinkButton from "../../../../shared/components/link-button"; type PreparationProps = { linkDocs: string; diff --git a/frontend/src/pages/testlab/parts/3_test-form/test-form.tsx b/frontend/src/pages/testlab/parts/3_test-form/test-form.tsx index dd38475..b40984e 100644 --- a/frontend/src/pages/testlab/parts/3_test-form/test-form.tsx +++ b/frontend/src/pages/testlab/parts/3_test-form/test-form.tsx @@ -1,5 +1,7 @@ import React, { useContext, useEffect, useState } from "react"; +import { BsChevronLeft, BsChevronRight } from "react-icons/bs"; import { useNavigate } from "react-router-dom"; + import { getComponentCriteria, postTestResult, @@ -9,13 +11,13 @@ import { CriteriaGroup, CriteriumResult, } from "../../../../shared/resources/types"; +import LinkButton from "../../../../shared/components/link-button"; +import Heading from "../../../../shared/components/heading"; import Alert from "../../../../shared/components/alert"; -import { BsChevronLeft, BsChevronRight } from "react-icons/bs"; + import LabPathDisplay from "../../components/lab-path-display"; -import TestItem from "./test-item"; -import Heading from "../../../../shared/components/heading"; import { TestDataContext } from "../../test-lab"; -import LinkButton from "../../../../shared/components/link-button"; +import TestItem from "./test-item"; // type TestFormProps = { // testData: TestData;