Skip to content

Commit

Permalink
Merge pull request #1925 from SUNET/cat-tou-help
Browse files Browse the repository at this point in the history
Cat tou help
  • Loading branch information
eunjuhuss authored Dec 5, 2024
2 parents 5db1b93 + 661f30b commit 9c975d8
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 13 deletions.
25 changes: 13 additions & 12 deletions src/components/Common/CommonToU.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import EduIDButton from "./EduIDButton";

interface CommonToUProps {
version: string;
handleAccept(e: React.MouseEvent<HTMLElement>): void;
handleCancel(e: React.MouseEvent<HTMLElement>): void;
handleAccept?(e: React.MouseEvent<HTMLElement>): void;
handleCancel?(e: React.MouseEvent<HTMLElement>): void;
}

/**
Expand All @@ -16,7 +16,7 @@ interface CommonToUProps {
export function CommonToU(props: CommonToUProps): JSX.Element {
return (
<React.Fragment>
{ToUs[props.version]}
{ToUs["2016-v1"]}

<p>
<strong>
Expand All @@ -27,15 +27,16 @@ export function CommonToU(props: CommonToUProps): JSX.Element {
/>
</strong>
</p>

<div className="buttons">
<EduIDButton id="cancel-button" buttonstyle="secondary" onClick={props.handleCancel}>
<FormattedMessage defaultMessage="Cancel" description="button cancel" />
</EduIDButton>
<EduIDButton type="submit" buttonstyle="primary" onClick={props.handleAccept} id="accept-button">
<FormattedMessage defaultMessage="I accept" description="Terms of use (accept button text)" />
</EduIDButton>
</div>
{props.handleAccept ? (
<div className="buttons">
<EduIDButton id="cancel-button" buttonstyle="secondary" onClick={props.handleCancel}>
<FormattedMessage defaultMessage="Cancel" description="button cancel" />
</EduIDButton>
<EduIDButton type="submit" buttonstyle="primary" onClick={props.handleAccept} id="accept-button">
<FormattedMessage defaultMessage="I accept" description="Terms of use (accept button text)" />
</EduIDButton>
</div>
) : null}
</React.Fragment>
);
}
23 changes: 23 additions & 0 deletions src/components/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useEffect, useState } from "react";
import { Accordion } from "react-accessible-accordion";
import { FormattedMessage, useIntl } from "react-intl";
import AccordionItemTemplate from "./Common/AccordionItemTemplate";
import { CommonToU } from "./Common/CommonToU";
import ScrollToTopButton from "./ScrollToTopButton";

interface ApprovedSecurityKeysTypes {
Expand Down Expand Up @@ -1260,6 +1261,27 @@ export function Help(): JSX.Element {
</ul>
</article>
</AccordionItemTemplate>
<AccordionItemTemplate
uuid="help-tou"
title={<FormattedMessage description="about terms of use - handle" defaultMessage="Terms of use" />}
additionalInfo={null}
>
<article>
<h4>
<FormattedMessage
description="what are eduIDs terms of use - heading"
defaultMessage="What are eduIDs terms of use?"
/>
</h4>
<p>
<FormattedMessage
description="what are eduIDs terms of use - paragraph"
defaultMessage={`These terms are accepted by the user upon creating an eduID account. You may be asked to accept the terms again if you haven't used the service for a period of time.`}
/>
</p>
<CommonToU version="2016-v1" />
</article>
</AccordionItemTemplate>
<AccordionItemTemplate
uuid="help-privacy-accessibility"
title={
Expand Down Expand Up @@ -1414,6 +1436,7 @@ export function Help(): JSX.Element {
networks and many other related services to public organisations and higher education and research institutions.`}
/>
</p>

<p>
<FormattedMessage
description="what is sunet - paragraph 2"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/signup/SignupMain-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ async function testTermsOfUse({
await screen.findByText(/^Register: Terms of use/);

// specifically verify that the test-version ("1999-v1") of the ToU is displayed
if (state.tou.version === "1999-v1") {
if (state.tou.version === "2016-v1") {
await screen.findByText(/This a test version of terms of use version/);
}

Expand Down
12 changes: 12 additions & 0 deletions src/translation/extractedMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@
"developer_comment": "ToU second paragraph",
"string": "attempts to gain access to network resources that they do not have the right"
},
"EDXXCi": {
"developer_comment": "what are eduIDs terms of use - heading",
"string": "What are eduIDs terms of use?"
},
"EGngEP": {
"developer_comment": "how enhance eduid - heading",
"string": "How can I enhance my eduID?"
Expand Down Expand Up @@ -915,6 +919,10 @@
"developer_comment": "no error information message",
"string": "There is no technical information available"
},
"MuAdBa": {
"developer_comment": "about terms of use - handle",
"string": "Terms of use"
},
"MuypUP": {
"developer_comment": "generic error page",
"string": "The issue has been reported to the team."
Expand Down Expand Up @@ -1995,6 +2003,10 @@
"developer_comment": "Phones main title",
"string": "Mobile phone numbers"
},
"j7couZ": {
"developer_comment": "what are eduIDs terms of use - paragraph",
"string": "These terms are accepted by the user upon creating an eduID account. You may be asked to accept the terms again if you haven't used the service for a period of time."
},
"j8RvSZ": {
"developer_comment": "use freja - list definition",
"string": "How to use Freja+ with eduID:"
Expand Down

0 comments on commit 9c975d8

Please sign in to comment.