diff --git a/pages/fdo/show/[prefix]/[suffix].tsx b/pages/fdo/show/[prefix]/[suffix].tsx index 8412158bd4dc5b874112f05e9d7316b3daadd3e5..e6adb3d89121edb45e5600265b6d79f463f214c9 100644 --- a/pages/fdo/show/[prefix]/[suffix].tsx +++ b/pages/fdo/show/[prefix]/[suffix].tsx @@ -1,5 +1,6 @@ import React from 'react' +import { HDL_URL } from '../../../../src/constants' import { ErrorComponent } from '../../../../src/components/ErrorComponent' import { GetServerSideProps } from 'next' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' @@ -24,7 +25,7 @@ import Cloud from '@mui/icons-material/Cloud' import VerifiedIcon from '@mui/icons-material/Verified' import ReportIcon from '@mui/icons-material/Report' -const resolvePid = (pid: string) => `https://hdl.handle.net/${pid}` +const resolvePid = (pid: string) => HDL_URL + `/${pid}` const ShowFDO = () => { const { params } = useParsed() diff --git a/pages/fdo/show/[prefix]/sandbox.tsx b/pages/fdo/show/[prefix]/sandbox.tsx index 6b66b8c802d60b914226fef4afeeea6708eea84a..cf6d2009a782a69035438cfcc742a139971a5e0c 100644 --- a/pages/fdo/show/[prefix]/sandbox.tsx +++ b/pages/fdo/show/[prefix]/sandbox.tsx @@ -1,6 +1,7 @@ import React from 'react' import { ErrorComponent } from '../../../../src/components/ErrorComponent' import { GetServerSideProps } from 'next' +import { HDL_URL } from '../../../../src/constants' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import { useShow, useTranslate, useParsed, useCustom, useApiUrl } from '@refinedev/core' import { Show } from '@refinedev/mui' @@ -26,7 +27,7 @@ import ReportIcon from '@mui/icons-material/Report' import { styled, ThemeProvider } from '@mui/material/styles' import Details from '../../../../src/components/fdos/details' -const resolvePid = (pid: string) => `https://hdl.handle.net/${pid}` +const resolvePid = (pid: string) => HDL_URL + `/${pid}` const ShowFDO = () => { const { params } = useParsed() diff --git a/src/components/profiles/list.tsx b/src/components/profiles/list.tsx index 1793d6f53fd007949e35e5542c4e73efddd23f9b..3e4d06fcbc791b553286cc756211654fbc9f79d6 100644 --- a/src/components/profiles/list.tsx +++ b/src/components/profiles/list.tsx @@ -1,4 +1,5 @@ import { IResourceComponentsProps } from '@refinedev/core' +import { HDL_URL } from '../../constants' import Link from '@mui/material/Link' import { List, useDataGrid } from '@refinedev/mui' @@ -33,7 +34,7 @@ const columns: Array<GridColDef<IProfile>> = [ width: 300, renderCell: (params) => { const pid = params?.row.attributes.pid - return <Link href={'https://hdl.handle.net/' + pid}>{pid}</Link> + return <Link href={HDL_URL + '/' + pid}>{pid}</Link> } } ] diff --git a/src/constants.js b/src/constants.js index c891c2a258058c222a7b36ecc91c542f31c7d6da..9b56450d89c57a851c32aa58dd88235937b502d3 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,3 +1,4 @@ import { version } from './version' export const API_URL = process.env.NEXT_PUBLIC_API_URL || '/api' +export const HDL_URL = process.env.NEXT_PUBLIC_HDL_URL || 'https://hdl.handle.net' export const FDO_MANAGER_WEBUI_VERSION = version