diff --git a/strudel-cookiecutter/base/{@cookiecutter.name@}/cypress.config.ts b/strudel-cookiecutter/base/{@cookiecutter.name@}/cypress.config.ts index 28e33d10..f5b3bb98 100644 --- a/strudel-cookiecutter/base/{@cookiecutter.name@}/cypress.config.ts +++ b/strudel-cookiecutter/base/{@cookiecutter.name@}/cypress.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from "cypress"; export default defineConfig({ e2e: { - baseUrl: 'http://localhost:5175/strudel-kit/demo/', + baseUrl: 'http://localhost:5175/', specPattern: ['cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', 'src/**/*.cy.{js,jsx,ts,tsx}'] }, }); diff --git a/strudel-cookiecutter/base/{@cookiecutter.name@}/package.json b/strudel-cookiecutter/base/{@cookiecutter.name@}/package.json index 07260d0e..f9076eb2 100644 --- a/strudel-cookiecutter/base/{@cookiecutter.name@}/package.json +++ b/strudel-cookiecutter/base/{@cookiecutter.name@}/package.json @@ -44,8 +44,6 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", "gh-pages": "^6.1.1", - "typedoc": "^0.25.13", - "typedoc-plugin-markdown": "^4.0.0", "typescript": "^5.2.2", "vite": "^5.2.10" }, diff --git a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/Footer.tsx b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/Footer.tsx index d64b88e1..2ca31199 100644 --- a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/Footer.tsx +++ b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/Footer.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { config } from '../../strudel.config'; import { AppLink } from './AppLink'; import { ImageWrapper } from './ImageWrapper'; +import { cleanPath } from '../utils/queryParams.utils'; /** * Bottom footer component @@ -38,7 +39,7 @@ export const Footer: React.FC = () => { {config.footer.image && ( - + )} diff --git a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/TopBar.tsx b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/TopBar.tsx index 0558e727..e430f295 100644 --- a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/TopBar.tsx +++ b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/components/TopBar.tsx @@ -5,6 +5,7 @@ import React from 'react'; import { AppLink } from './AppLink'; import { config } from '../../strudel.config'; import { ImageWrapper } from './ImageWrapper'; +import { cleanPath } from '../utils/queryParams.utils'; /** * Top navigation bar component @@ -33,7 +34,7 @@ export const TopBar: React.FC = () => { )} {config.navbar.logo && ( - + )} diff --git a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/queryParams.utils.ts b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/queryParams.utils.ts index 15cafd7b..d58ce0d8 100644 --- a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/queryParams.utils.ts +++ b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/queryParams.utils.ts @@ -111,6 +111,10 @@ export const cleanUrl = (url: string) => { return url.replace(/([^:]\/)\/+/g, "$1"); } +export const cleanPath = (url: string) => { + return url.replace(/\/\//g, "/"); +} + /** * Fetch data from a local CSV, TSV, or JSON, or an external API * that returns JSON. @@ -120,7 +124,8 @@ export const fetchData = async (dataSource: string) => { const base = document.querySelector('base')?.getAttribute('href') ?? ''; // Use the VITE_BASE_URL env variable to specify a path prefix that // should be added to routes and local requests - const basename = base + import.meta.env.VITE_BASE_URL; + const basePath = import.meta.env.VITE_BASE_URL || ''; + const basename = base + basePath; const fileExtension = dataSource.split('.').pop(); const isExternal = dataSource.startsWith('http'); const dataSourcePath = isExternal ? cleanUrl(dataSource) : cleanUrl(`${basename}/${dataSource}`); diff --git a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/useDataFromSource.tsx b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/useDataFromSource.tsx index 0d9094bc..450024bc 100644 --- a/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/useDataFromSource.tsx +++ b/strudel-cookiecutter/base/{@cookiecutter.name@}/src/utils/useDataFromSource.tsx @@ -16,7 +16,8 @@ export const useDataFromSource = (dataSource: string): any => { * Use the VITE_BASE_URL env variable to specify a path prefix that * should be added to routes and local requests */ - const basename = base + import.meta.env.VITE_BASE_URL; + const basePath = import.meta.env.VITE_BASE_URL || ''; + const basename = base + basePath; useEffect(() => { const fetchData = async () => { diff --git a/strudel-cookiecutter/compare-data/{@cookiecutter.name@}/_config/taskflow.config.ts b/strudel-cookiecutter/compare-data/{@cookiecutter.name@}/_config/taskflow.config.ts index 4b439dfa..3c9939c3 100644 --- a/strudel-cookiecutter/compare-data/{@cookiecutter.name@}/_config/taskflow.config.ts +++ b/strudel-cookiecutter/compare-data/{@cookiecutter.name@}/_config/taskflow.config.ts @@ -18,7 +18,7 @@ export const taskflow: CompareDataConfig = { /** * Source of the data for the initial list of items. */ - source: "default/compare-data/scenarios.json", + source: "data/default/compare-data/scenarios.json", /** * Field name for the unique ID in the data source. */ diff --git a/strudel-cookiecutter/contribute-data/{@cookiecutter.name@}/_config/taskflow.config.ts b/strudel-cookiecutter/contribute-data/{@cookiecutter.name@}/_config/taskflow.config.ts index 4f175b74..754bb4be 100644 --- a/strudel-cookiecutter/contribute-data/{@cookiecutter.name@}/_config/taskflow.config.ts +++ b/strudel-cookiecutter/contribute-data/{@cookiecutter.name@}/_config/taskflow.config.ts @@ -6,7 +6,7 @@ export const taskflow: ContributeDataConfig = { /** * Source of the data for the initial list of datasets on the portal page. */ - source: "default/contribute-data/contributor_datasets.json", + source: "data/default/contribute-data/contributor_datasets.json", /** * Name of the field in the data that represents a unique identifier for each record. */ diff --git a/strudel-cookiecutter/monitor-activities/{@cookiecutter.name@}/_config/taskflow.config.ts b/strudel-cookiecutter/monitor-activities/{@cookiecutter.name@}/_config/taskflow.config.ts index f32987c3..1e8510d8 100644 --- a/strudel-cookiecutter/monitor-activities/{@cookiecutter.name@}/_config/taskflow.config.ts +++ b/strudel-cookiecutter/monitor-activities/{@cookiecutter.name@}/_config/taskflow.config.ts @@ -6,7 +6,7 @@ export const taskflow: MonitorActivitiesConfig = { /** * Source of the data for the initial list of items. */ - source: "default/monitor-activities/experiments.json", + source: "data/default/monitor-activities/experiments.json", /** * Field name for the unique ID in the data source. */ diff --git a/strudel-cookiecutter/run-computation/{@cookiecutter.name@}/_config/taskflow.config.ts b/strudel-cookiecutter/run-computation/{@cookiecutter.name@}/_config/taskflow.config.ts index d89be82d..6aa4dfb4 100644 --- a/strudel-cookiecutter/run-computation/{@cookiecutter.name@}/_config/taskflow.config.ts +++ b/strudel-cookiecutter/run-computation/{@cookiecutter.name@}/_config/taskflow.config.ts @@ -18,7 +18,7 @@ export const taskflow: RunComputationConfig = { /** * Source of the data for the initial list of items. */ - source: "default/run-computation/list.json", + source: "data/default/run-computation/list.json", /** * Field name for the unique ID in the data source. */ @@ -28,7 +28,7 @@ export const taskflow: RunComputationConfig = { /** * Source of the data for the table on the inputs page. */ - source: "default/run-computation/inputs.json", + source: "data/default/run-computation/inputs.json", /** * Field name for the unique ID in the data source. */ @@ -40,7 +40,7 @@ export const taskflow: RunComputationConfig = { * The return format must be compatible with Plotly's data attribue. * See the [Plotly Figure Reference](https://plotly.com/javascript/reference/index/) for more details. */ - source: "default/run-computation/results_line_chart.json" + source: "data/default/run-computation/results_line_chart.json" }, barChart: { /** @@ -48,13 +48,13 @@ export const taskflow: RunComputationConfig = { * The return format must be compatible with Plotly's data attribue. * See the [Plotly Figure Reference](https://plotly.com/javascript/reference/index/) for more details. */ - source: "default/run-computation/results_bar_chart.json" + source: "data/default/run-computation/results_bar_chart.json" }, results: { /** * Source of the data for the table on the results page. */ - source: "default/run-computation/results_table.json", + source: "data/default/run-computation/results_table.json", /** * Field name for the unique ID in the data source. */ diff --git a/strudel-cookiecutter/search-data-repositories/{@cookiecutter.name@}/_config/taskflow.config.ts b/strudel-cookiecutter/search-data-repositories/{@cookiecutter.name@}/_config/taskflow.config.ts index be9214bf..312afeba 100644 --- a/strudel-cookiecutter/search-data-repositories/{@cookiecutter.name@}/_config/taskflow.config.ts +++ b/strudel-cookiecutter/search-data-repositories/{@cookiecutter.name@}/_config/taskflow.config.ts @@ -6,7 +6,7 @@ export const taskflow: SearchDataRepositoriesConfig = { /** * Source of the data for the initial list of items on the main page. */ - source: "default/search-data-repositories/datasets.json", + source: "data/default/search-data-repositories/datasets.json", /** * Field name for the unique ID in the data source. */