diff --git a/frontend/components/Viewing/Collection/Members.js b/frontend/components/Viewing/Collection/Members.js
index f6bcf0d6..6e0ba753 100644
--- a/frontend/components/Viewing/Collection/Members.js
+++ b/frontend/components/Viewing/Collection/Members.js
@@ -4,7 +4,8 @@ import useSWR from 'swr';
import axios from 'axios';
import Select from 'react-select';
-import feConfig from "../../../config.json";
+import getConfig from 'next/config';
+const { publicRuntimeConfig } = getConfig();
import CountMembers from '../../../sparql/CountMembers';
import CountMembersTotal from '../../../sparql/CountMembersSearch';
@@ -48,7 +49,7 @@ export default function Members(properties) {
const [customBounds, setCustomBounds] = useState([0, 10000]);
const [typeFilter, setTypeFilter] = useState('Show Only Root Objects');
const dispatch = useDispatch();
- const [processedUri, setProcessedUri] = useState(feConfig.backend);
+ const [processedUri, setProcessedUri] = useState(publicRuntimeConfig.backend);
const theme = JSON.parse(localStorage.getItem('theme')) || {};
const registries = JSON.parse(localStorage.getItem("registries")) || {};
@@ -334,7 +335,7 @@ function MemberTable(properties) {
}
const objectUriParts = getAfterThirdSlash(properties.uri);
- const objectUri = `${feConfig.backend}/${objectUriParts}`;
+ const objectUri = `${publicRuntimeConfig.backend}/${objectUriParts}`;
const icon = compareUri(member.uri, `/${objectUriParts}`);
@@ -354,7 +355,7 @@ function MemberTable(properties) {
const handleDelete = async (member) => {
if (member.uri && window.confirm("Would you like to remove this item from the collection?")) {
try {
- await axios.get(`${feConfig.backend}${member.uri}/remove`, {
+ await axios.get(`${publicRuntimeConfig.backend}${member.uri}/remove`, {
headers: {
"Accept": "text/plain; charset=UTF-8",
"X-authorization": token
@@ -461,7 +462,7 @@ function compareUri(memberUri, baseUri) {
const createUrl = (query, options) => {
query = loadTemplate(query, options);
- return `${feConfig.backend}/sparql?query=${encodeURIComponent(
+ return `${publicRuntimeConfig.backend}/sparql?query=${encodeURIComponent(
query
)}`;
};
diff --git a/frontend/components/Viewing/MetadataInfo.js b/frontend/components/Viewing/MetadataInfo.js
index 5804e152..3177cc07 100644
--- a/frontend/components/Viewing/MetadataInfo.js
+++ b/frontend/components/Viewing/MetadataInfo.js
@@ -6,12 +6,11 @@ import { faPlus, faTrash, faPencilAlt } from '@fortawesome/free-solid-svg-icons'
import RenderIcon from './PageJSON/Rendering/RenderIcon';
import styles from '../../styles/view.module.css';
import axios from 'axios';
-import getConfig from "next/config";
import { getAfterThirdSlash } from './ViewHeader';
import { isUriOwner, formatMultipleTitles } from './Shell';
-
-import feConfig from "../../config.json";
+import getConfig from 'next/config';
+const { publicRuntimeConfig } = getConfig();
export default function MetadataInfo({ title, link, label, icon, specific, uri }) {
const theme = JSON.parse(localStorage.getItem('theme')) || {};
@@ -52,7 +51,7 @@ export default function MetadataInfo({ title, link, label, icon, specific, uri }
if (uri) {
objectUriParts = getAfterThirdSlash(uri);
}
- const objectUri = `${feConfig.backend}/${objectUriParts}`;
+ const objectUri = `${publicRuntimeConfig.backend}/${objectUriParts}`;
const [editSourceIndex, setEditSourceIndex] = useState(null);
const [editedSource, setEditedSource] = useState('');
diff --git a/frontend/components/Viewing/Modals/AddToCollectionModal.js b/frontend/components/Viewing/Modals/AddToCollectionModal.js
index fcf93432..462d5e82 100644
--- a/frontend/components/Viewing/Modals/AddToCollectionModal.js
+++ b/frontend/components/Viewing/Modals/AddToCollectionModal.js
@@ -10,8 +10,8 @@ import Select from "react-select";
import { getCanSubmitTo } from '../../../redux/actions';
import { useSelector, useDispatch } from "react-redux";
-import getConfig from "next/config";
-import feConfig from "../../../config.json";
+import getConfig from 'next/config';
+const { publicRuntimeConfig } = getConfig();
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
@@ -87,7 +87,7 @@ export default function AddToCollectionModal(properties) {
* @param {String} collection The uri of the collection to add to.
*/
const addToCollection = async (collection) => {
- const url = `${feConfig.backend}${properties.url}/addToCollection`;
+ const url = `${publicRuntimeConfig.backend}${properties.url}/addToCollection`;
var headers = {
Accept: "text/plain; charset=UTF-8",
"X-authorization": token
diff --git a/frontend/components/Viewing/Modals/CurationModal.js b/frontend/components/Viewing/Modals/CurationModal.js
index 890af857..4ec6a590 100644
--- a/frontend/components/Viewing/Modals/CurationModal.js
+++ b/frontend/components/Viewing/Modals/CurationModal.js
@@ -7,8 +7,8 @@ import React, { useEffect, useState } from "react";
import Select from "react-select";
import CustomModal from "./CustomModal";
-import getConfig from "next/config";
-import feConfig from "../../../config.json";
+import getConfig from 'next/config';
+const { publicRuntimeConfig } = getConfig();
import axios from "axios";
import parse from 'html-react-parser';
@@ -65,7 +65,7 @@ export default function CurationModal(properties) {
axios({
method: 'GET',
- url: `${feConfig.backend}/admin/plugins`,
+ url: `${publicRuntimeConfig.backend}/admin/plugins`,
params: {
category: 'curation'
},
@@ -78,7 +78,7 @@ export default function CurationModal(properties) {
for(let plugin of curatePlugins) {
axios({
method: 'POST',
- url: `${feConfig.backend}/call`,
+ url: `${publicRuntimeConfig.backend}/call`,
params: {
name: plugin.name,
endpoint: 'evaluate',
@@ -141,7 +141,7 @@ export default function CurationModal(properties) {
async function runPlugin(pluginName, pluginData) {
return await axios({
method: 'POST',
- url: `${feConfig.backend}/call`,
+ url: `${publicRuntimeConfig.backend}/call`,
params: {
name: pluginName,
endpoint: 'run',
diff --git a/frontend/components/Viewing/Modals/DownloadModal.js b/frontend/components/Viewing/Modals/DownloadModal.js
index 6c35052d..10df89d1 100644
--- a/frontend/components/Viewing/Modals/DownloadModal.js
+++ b/frontend/components/Viewing/Modals/DownloadModal.js
@@ -7,8 +7,8 @@ import React, { useEffect, useState } from "react";
import Select from "react-select";
import CustomModal from "./CustomModal";
-import getConfig from "next/config";
-import feConfig from "../../../config.json";
+import getConfig from 'next/config';
+const { publicRuntimeConfig } = getConfig();
import { useDispatch } from "react-redux";
import { downloadFiles } from "../../../redux/actions";
@@ -41,7 +41,7 @@ export default function DownloadModal(properties) {
if (type != 'plugin') {
const item = {
- url: `${feConfig.backend}${properties.url}/${type}`,
+ url: `${publicRuntimeConfig.backend}${properties.url}/${type}`,
name: properties.name,
displayId: properties.displayId,
type: "xml",
@@ -62,7 +62,7 @@ export default function DownloadModal(properties) {
const pluginData = {
uri: properties.uri,
- instanceUrl: `${feConfig.backend}/`,
+ instanceUrl: `${publicRuntimeConfig.backend}/`,
size: 1,
type: properties.type
};
@@ -95,7 +95,7 @@ export default function DownloadModal(properties) {
axios({
method: 'GET',
- url: `${feConfig.backend}/admin/plugins`,
+ url: `${publicRuntimeConfig.backend}/admin/plugins`,
params: {
category: 'download'
},
@@ -128,7 +128,7 @@ export default function DownloadModal(properties) {
axios({
method: 'POST',
- url: `${feConfig.backend}/call`,
+ url: `${publicRuntimeConfig.backend}/call`,
params: {
name: plugin.name,
endpoint: 'status',
@@ -140,7 +140,7 @@ export default function DownloadModal(properties) {
axios({
method: 'POST',
- url: `${feConfig.backend}/call`,
+ url: `${publicRuntimeConfig.backend}/call`,
params: {
name: plugin.name,
endpoint: 'evaluate',
diff --git a/frontend/components/Viewing/Modals/ShareModal.js b/frontend/components/Viewing/Modals/ShareModal.js
index 6c072999..1abde6e2 100644
--- a/frontend/components/Viewing/Modals/ShareModal.js
+++ b/frontend/components/Viewing/Modals/ShareModal.js
@@ -9,8 +9,8 @@ import { useSelector } from "react-redux";
import Select from "react-select";
-import getConfig from "next/config";
-import feConfig from "../../../config.json";
+import getConfig from 'next/config';
+const { publicRuntimeConfig } = getConfig();
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
@@ -52,7 +52,7 @@ export default function ShareModal(properties) {
* @param {String} owner The owner to add.
*/
const addOwner = async (owner) => {
- const url = `${feConfig.backend}${properties.url}/addOwner`;
+ const url = `${publicRuntimeConfig.backend}${properties.url}/addOwner`;
var headers = {
Accept: "text/plain; charset=UTF-8",
"X-authorization": token
@@ -60,7 +60,7 @@ export default function ShareModal(properties) {
const parameters = new URLSearchParams();
parameters.append("user", owner);
- parameters.append("uri", feConfig.backend + properties.url);
+ parameters.append("uri", publicRuntimeConfig.backend + properties.url);
let response;
@@ -79,7 +79,7 @@ export default function ShareModal(properties) {
* Copies the link to the users clipboard.
*/
const copyToClipboard = () => {
- navigator.clipboard.writeText(`${feConfig.backend}${properties.url}`).then(() => {
+ navigator.clipboard.writeText(`${publicRuntimeConfig.backend}${properties.url}`).then(() => {
setTimeout(() => {
setCopyText("Copy");
}, 1000);
@@ -139,7 +139,7 @@ export default function ShareModal(properties) {
size="1x"
/>
-