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

fix(user manual link): Dynamic url based on release tag #55

Merged
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
1 change: 1 addition & 0 deletions scripts/legal-notice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ legal_notice_json='{
"license": "'$license'",
"licensePath": "'$server_url'/'$repository'/blob/'$ref'/LICENSE",
"noticePath": "'$server_url'/'$repository'/blob/'$ref'/NOTICE.md",
"readmePath": "'$server_url'/'$repository'/blob/'$ref'/docs/user-guide/README.md",
"sourcePath": "'$server_url'/'$repository'/tree/'$ref'",
"commitId": "'$commit_id'"
}'
Expand Down
1 change: 1 addition & 0 deletions src/assets/about/legal-notice.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "Apache-2.0",
"licensePath": "//blob//LICENSE",
"noticePath": "//blob//NOTICE.md",
"readmePath": "//blob//docs/user-guide/README.md",
"sourcePath": "//tree/",
"commitId": "9d2eee5ec7dbdce76e62d5a23e6b0dc9a1946f0f"
}
4 changes: 2 additions & 2 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import { useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';

import legalNoticeContent from '../assets/about/legal-notice.json';
import { useAppSelector } from '../features/store';
import I18nService from '../services/i18nService';
import { USER_GUIDE_URL } from '../utils/constants';
import { openInNewTab } from '../utils/utils';

const Nav = () => {
Expand Down Expand Up @@ -79,7 +79,7 @@ const Nav = () => {
<Button
color="secondary"
variant="contained"
onClick={() => openInNewTab(USER_GUIDE_URL)}
onClick={() => openInNewTab(legalNoticeContent.readmePath)}
size="small"
sx={{ mr: 3 }}
>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Button, Tab, TabPanel, Tabs, Typography } from 'cx-portal-shared-compon
import { SyntheticEvent, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';

import legalNoticeContent from '../assets/about/legal-notice.json';
import { DataExchangeStepper } from '../components/DataExchangeStepper';
import { fetchUseCases } from '../features/app/actions';
import { setSelectedUseCases } from '../features/app/slice';
Expand All @@ -35,7 +36,6 @@ import { ISubmodelList } from '../features/provider/submodels/types';
import { removeSelectedFiles, setUploadStatus } from '../features/provider/upload/slice';
import { useAppDispatch, useAppSelector } from '../features/store';
import { consumeDataSteps, provideDataSteps } from '../models/Home';
import { USER_GUIDE_URL } from '../utils/constants';
import { openInNewTab } from '../utils/utils';

export default function Home() {
Expand Down Expand Up @@ -85,7 +85,7 @@ export default function Home() {
<Button
variant="text"
size="medium"
onClick={() => openInNewTab(USER_GUIDE_URL)}
onClick={() => openInNewTab(legalNoticeContent.readmePath)}
endIcon={<ArrowForwardIcon />}
sx={{
p: 0,
Expand Down
4 changes: 0 additions & 4 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import { theme } from 'cx-portal-shared-components';

import { IDefaultObject, ISelectList } from '../models/Common';

const USER_GUIDE_URL =
'https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/blob/main/docs/user-guide/README.md';

const ONLY_NUM_REGEX = /^[1-9]\d*$/;

const ALPHA_NUM_REGEX = /[a-zA-Z0-9]$/;
Expand Down Expand Up @@ -95,6 +92,5 @@ export {
PURPOSE_VALUES,
SPACE_CHECK_REGEX,
STATUS_COLOR_MAPPING,
USER_GUIDE_URL,
USER_TYPE_SWITCH,
};