Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update linkbutton to use a:href #71

Merged
merged 5 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ 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/)

### 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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 LinkButton from "../../../../shared/components/link-button";
import { BsChevronLeft, BsChevronRight } from "react-icons/bs";
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";

Expand Down
11 changes: 6 additions & 5 deletions frontend/src/pages/testlab/parts/3_test-form/test-form.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import React, { useContext, useEffect, useState } from "react";
import { BsChevronLeft, BsChevronRight } from "react-icons/bs";
import { useNavigate } from "react-router-dom";

import {
getComponentCriteria,
postTestResult,
} from "../../../../shared/services/api";
import LinkButton from "../../../../shared/components/link-button";
import {
ComponentCriteria,
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 TestItem from "./test-item";

// type TestFormProps = {
// testData: TestData;
Expand Down Expand Up @@ -115,7 +117,6 @@ const TestForm = () => {

<div className='control-group'>
<h2 className='visually-hidden'>Navigation</h2>

<LinkButton
type='button'
label='Back'
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/shared/components/link-button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from "react";
import { useNavigate } from "react-router-dom";
import { Link } from "react-router-dom";

type LinkButtonProps = {
to: string;
Expand All @@ -20,19 +20,18 @@ const LinkButton = ({
iconPosition = "left",
ariaLabel = undefined,
}: LinkButtonProps) => {
const navigate = useNavigate();
return (
<button
<Link
aria-label={ariaLabel}
className={`${className ? className : ""} ${
className={`button ${className ? className : ""} ${
icon ? "button-with-icon" : ""
}`}
type={type}
onClick={() => navigate(to)}
to={to}
>
{iconPosition === "left" ? icon : ""} {label}{" "}
{iconPosition === "right" ? icon : ""}
</button>
</Link>
);
};

Expand Down
1 change: 1 addition & 0 deletions frontend/src/shared/layout/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down