-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into DIGG-465-new-filter-groups
- Loading branch information
Showing
8 changed files
with
124 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
import { useRouter } from "next/router"; | ||
import { useContext } from "react"; | ||
import { EntrystoreProvider } from "@/providers/EntrystoreProvider"; | ||
import { SettingsContext } from "@/providers/SettingsProvider"; | ||
import { DataServicePage } from "@/components/content/Entryscape/DataServicePage"; | ||
import { useScript } from "@/hooks/useScript"; | ||
import { GetServerSideProps } from "next"; | ||
|
||
export default function ExploreApiPage() { | ||
const { env } = useContext(SettingsContext); | ||
|
||
const { query } = useRouter() || {}; | ||
const { dataSet, name } = query || {}; | ||
const ids = (typeof dataSet === "string" && dataSet.split("_")) || []; | ||
const cid = ids[0]; | ||
const eid = ids[1]; | ||
const postscribeStatus = useScript( | ||
"/postscribe.min.js", | ||
"sha384-1nPAWyZS0cvGLWSoWOrkTZAy8Xq8g6llEe985qo5NRPAeDi+F9h9U+0R8v56XWCM", | ||
"anonymous", | ||
); | ||
return postscribeStatus === "ready" ? ( | ||
<EntrystoreProvider | ||
env={env} | ||
cid={cid} | ||
eid={eid} | ||
entrystoreUrl={env.ENTRYSCAPE_DATASETS_PATH} | ||
fetchMore={true} | ||
> | ||
<DataServicePage dataSet={dataSet} name={name} /> | ||
</EntrystoreProvider> | ||
) : ( | ||
<></> | ||
); | ||
return null; | ||
} | ||
|
||
export const getServerSideProps: GetServerSideProps = async ({ params }) => { | ||
const dataSet = params?.dataSet; | ||
|
||
if (!dataSet) { | ||
return { | ||
notFound: true, | ||
}; | ||
} | ||
|
||
// Reconstruct the original URI and redirect to the new format | ||
return { | ||
redirect: { | ||
destination: `/dataservice/${dataSet}`, | ||
permanent: true, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,24 @@ | ||
import { DataSetExploreApiPage } from "@/components/content/Entryscape/DatasetExploreApiPage"; | ||
// export default DataSetExploreApiPage; | ||
import { useRouter } from "next/router"; | ||
import { useContext } from "react"; | ||
import { useScript } from "@/hooks/useScript"; | ||
import { ApiIndexProvider } from "@/providers/ApiIndexContext"; | ||
import EntrystoreProvider from "@/providers/EntrystoreProvider"; | ||
import { SettingsContext } from "@/providers/SettingsProvider"; | ||
import { GetServerSideProps } from "next"; | ||
|
||
export default function ExploreApiPage() { | ||
const { env } = useContext(SettingsContext); | ||
|
||
const { query } = useRouter() || {}; | ||
const { dataSet, apieid } = query || {}; | ||
const ids = (typeof dataSet === "string" && dataSet.split("_")) || []; | ||
const cid = ids[0]; | ||
const eid = ids[1]; | ||
const postscribeStatus = useScript( | ||
"/postscribe.min.js", | ||
"sha384-1nPAWyZS0cvGLWSoWOrkTZAy8Xq8g6llEe985qo5NRPAeDi+F9h9U+0R8v56XWCM", | ||
"anonymous", | ||
); | ||
return postscribeStatus === "ready" ? ( | ||
<ApiIndexProvider apiIndexFileUrl={env.API_DETECTION_PATH}> | ||
<EntrystoreProvider | ||
env={env} | ||
cid={cid} | ||
eid={eid} | ||
entrystoreUrl={env.ENTRYSCAPE_DATASETS_PATH} | ||
fetchMore={true} | ||
> | ||
<DataSetExploreApiPage dataSet={dataSet} apieid={apieid} /> | ||
</EntrystoreProvider> | ||
</ApiIndexProvider> | ||
) : ( | ||
<></> | ||
); | ||
return null; | ||
} | ||
|
||
export const getServerSideProps: GetServerSideProps = async ({ params }) => { | ||
const dataSet = params?.dataSet; | ||
const apieid = params?.apieid; | ||
|
||
if (!dataSet || !apieid) { | ||
return { | ||
notFound: true, | ||
}; | ||
} | ||
|
||
// Reconstruct the original URI and redirect to the new format | ||
return { | ||
redirect: { | ||
destination: `/datasets/${dataSet}/apiexplore/${apieid}`, | ||
permanent: true, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
import { useRouter } from "next/router"; | ||
import { useContext } from "react"; | ||
import { ApiIndexProvider } from "@/providers/ApiIndexContext"; | ||
import { DataSetPage } from "@/components/content/Entryscape/DataSetPage"; | ||
import { useScript } from "@/hooks/useScript"; | ||
import { SettingsContext } from "@/providers/SettingsProvider"; | ||
import EntrystoreProvider from "@/providers/EntrystoreProvider"; | ||
import { GetServerSideProps } from "next"; | ||
|
||
export default function DataSet() { | ||
const { env } = useContext(SettingsContext); | ||
|
||
const { query } = useRouter() || {}; | ||
const { dataSet } = query || {}; | ||
const ids = (typeof dataSet === "string" && dataSet.split("_")) || []; | ||
const cid = ids[0]; | ||
const eid = ids[1]; | ||
const postscribeStatus = useScript( | ||
"/postscribe.min.js", | ||
"sha384-1nPAWyZS0cvGLWSoWOrkTZAy8Xq8g6llEe985qo5NRPAeDi+F9h9U+0R8v56XWCM", | ||
"anonymous", | ||
); | ||
return postscribeStatus === "ready" ? ( | ||
<ApiIndexProvider apiIndexFileUrl={env.API_DETECTION_PATH}> | ||
<EntrystoreProvider | ||
env={env} | ||
cid={cid} | ||
eid={eid} | ||
entrystoreUrl={env.ENTRYSCAPE_DATASETS_PATH} | ||
fetchMore={false} | ||
> | ||
<DataSetPage /> | ||
</EntrystoreProvider> | ||
</ApiIndexProvider> | ||
) : ( | ||
<></> | ||
); | ||
return null; | ||
} | ||
|
||
export const getServerSideProps: GetServerSideProps = async ({ params }) => { | ||
const dataSet = params?.dataSet; | ||
|
||
if (!dataSet) { | ||
return { | ||
notFound: true, | ||
}; | ||
} | ||
|
||
// Reconstruct the original URI and redirect to the new format | ||
return { | ||
redirect: { | ||
destination: `/datasets/${dataSet}`, | ||
permanent: true, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,23 @@ | ||
import { useRouter } from "next/router"; | ||
import { useContext } from "react"; | ||
import { ApiIndexProvider } from "@/providers/ApiIndexContext"; | ||
import EntrystoreProvider from "@/providers/EntrystoreProvider"; | ||
import { SettingsContext } from "@/providers/SettingsProvider"; | ||
|
||
import { DataSetPage } from "@/components/content/Entryscape/DataSetPage"; | ||
import { useScript } from "@/hooks/useScript"; | ||
import { GetServerSideProps } from "next"; | ||
|
||
export default function DataSet() { | ||
const { env } = useContext(SettingsContext); | ||
|
||
const router = useRouter() || {}; | ||
// const { dataSet } = router?.query; | ||
const ids = | ||
(typeof router?.query?.dataSet === "string" && | ||
router?.query?.dataSet.split("_")) || | ||
[]; | ||
const cid = ids[0]; | ||
const eid = ids[1]; | ||
const postscribeStatus = useScript( | ||
"/postscribe.min.js", | ||
"sha384-1nPAWyZS0cvGLWSoWOrkTZAy8Xq8g6llEe985qo5NRPAeDi+F9h9U+0R8v56XWCM", | ||
"anonymous", | ||
); | ||
return postscribeStatus === "ready" ? ( | ||
<ApiIndexProvider apiIndexFileUrl={env.API_DETECTION_PATH}> | ||
<EntrystoreProvider | ||
env={env} | ||
cid={cid} | ||
eid={eid} | ||
entrystoreUrl={env.ENTRYSCAPE_DATASETS_PATH} | ||
fetchMore={false} | ||
> | ||
<DataSetPage /> | ||
</EntrystoreProvider> | ||
</ApiIndexProvider> | ||
) : ( | ||
<></> | ||
); | ||
return null; | ||
} | ||
|
||
export const getServerSideProps: GetServerSideProps = async ({ params }) => { | ||
const dataSet = params?.dataSet; | ||
|
||
if (!dataSet) { | ||
return { | ||
notFound: true, | ||
}; | ||
} | ||
|
||
// Reconstruct the original URI and redirect to the new format | ||
return { | ||
redirect: { | ||
destination: `/datasets/${dataSet}`, | ||
permanent: true, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { DataSetExploreApiPage } from "@/components/content/Entryscape/DatasetExploreApiPage"; | ||
// export default DataSetExploreApiPage; | ||
import { useRouter } from "next/router"; | ||
import { useContext } from "react"; | ||
import { useScript } from "@/hooks/useScript"; | ||
import { ApiIndexProvider } from "@/providers/ApiIndexContext"; | ||
import EntrystoreProvider from "@/providers/EntrystoreProvider"; | ||
import { SettingsContext } from "@/providers/SettingsProvider"; | ||
|
||
export default function ExploreApiPage() { | ||
const { env } = useContext(SettingsContext); | ||
|
||
const { query } = useRouter() || {}; | ||
const { dataSet, apieid } = query || {}; | ||
const ids = (typeof dataSet === "string" && dataSet.split("_")) || []; | ||
const cid = ids[0]; | ||
const eid = ids[1]; | ||
const postscribeStatus = useScript( | ||
"/postscribe.min.js", | ||
"sha384-1nPAWyZS0cvGLWSoWOrkTZAy8Xq8g6llEe985qo5NRPAeDi+F9h9U+0R8v56XWCM", | ||
"anonymous", | ||
); | ||
return postscribeStatus === "ready" ? ( | ||
<ApiIndexProvider apiIndexFileUrl={env.API_DETECTION_PATH}> | ||
<EntrystoreProvider | ||
env={env} | ||
cid={cid} | ||
eid={eid} | ||
entrystoreUrl={env.ENTRYSCAPE_DATASETS_PATH} | ||
fetchMore={true} | ||
> | ||
<DataSetExploreApiPage dataSet={dataSet} apieid={apieid} /> | ||
</EntrystoreProvider> | ||
</ApiIndexProvider> | ||
) : ( | ||
<></> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters