diff --git a/.github/workflows/build-twins-image.yml b/.github/workflows/build-twins-image.yml new file mode 100644 index 00000000..6608e310 --- /dev/null +++ b/.github/workflows/build-twins-image.yml @@ -0,0 +1,59 @@ +name: Docker Image CI + +on: + push: + paths: + - 'apps/digitaltwins/**' + +jobs: + + test: + + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ["18"] + name: Run tests + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set node version + uses: actions/setup-node@v3 + with: + node-version: '18' + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install git + npm i -g turbo + npm i -g pnpm + - name: Run tests + run: "echo 'setup complete' " + + push: + + name: Push to registry. + runs-on: ohsmart-demo + needs: test + strategy: + matrix: + node-version: ["18"] + env: + IMAGE_TAG: ${{ github.ref_name }} + USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + IMAGE_NAME: "dans-frontend-framework-digital-twins" + ORG: "dansknaw" + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Copy file + run: "cp /data/secrets/digitaltwins/.env.production apps/digitaltwins/." + - name: Login to registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Push to dockerhub + run: | + docker build -f apps/digitaltwins/Dockerfile . -t $ORG/$IMAGE_NAME:$IMAGE_TAG + docker push $ORG/$IMAGE_NAME:$IMAGE_TAG diff --git a/.gitignore b/.gitignore index d584e004..d62ff1aa 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,7 @@ dist-ssr # Testing related playwright-report -test-results \ No newline at end of file +test-results + +# Rollup visualiser +stats.html \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6dddf8a7..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "packages/rdt-search-ui"] - path = packages/rdt-search-ui - url = https://github.com/DANS-KNAW/rdt-search-ui diff --git a/apps/4tu/package.json b/apps/4tu/package.json index 48aebc6f..04826e5a 100644 --- a/apps/4tu/package.json +++ b/apps/4tu/package.json @@ -18,13 +18,13 @@ "@dans-framework/user-auth": "workspace:*", "@dans-framework/utils": "workspace:*", "@fontsource/roboto": "^5.0.7", - "@mui/material": "^5.14.3", + "@mui/material": "^5.16.7", "framer-motion": "^10.15.0", - "lz-string": "^1.5.0", - "notistack": "^3.0.1", "i18next": "^23.4.1", "i18next-browser-languagedetector": "^7.1.0", "i18next-resources-to-backend": "^1.1.4", + "lz-string": "^1.5.0", + "notistack": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^13.0.3", @@ -33,12 +33,10 @@ "web-vitals": "^3.4.0" }, "devDependencies": { - "@types/node": "^20.11.27", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.3", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-react-hooks": "^5.0.0", "vite": "^4.4.5", "vite-plugin-checker": "^0.6.2" } diff --git a/apps/4tu/src/App.tsx b/apps/4tu/src/App.tsx index 439b2b52..9f3fae32 100644 --- a/apps/4tu/src/App.tsx +++ b/apps/4tu/src/App.tsx @@ -13,7 +13,11 @@ import { UserSubmissions, SignInCallback, } from "@dans-framework/user-auth"; -import { RepoAdvisor, RepoBar, NoRepoSelected } from '@dans-framework/repo-advisor'; +import { + RepoAdvisor, + RepoBar, + NoRepoSelected, +} from "@dans-framework/repo-advisor"; import { Generic, type Page } from "@dans-framework/pages"; // Load config variables @@ -27,8 +31,8 @@ import { AnimatePresence, motion } from "framer-motion"; const App = () => { const { i18n } = useTranslation(); - const [ repoConfig, setRepoConfig ] = useState(); - const configIsSet = repoConfig?.hasOwnProperty('form') || false; + const [repoConfig, setRepoConfig] = useState(); + const configIsSet = repoConfig?.hasOwnProperty("form") || false; return ( @@ -36,7 +40,7 @@ const App = () => { {/* Suspense to make sure languages can load first */} - { configIsSet && + {configIsSet && ( { > - } + )} - { : - - } + /> + : } } /> @@ -86,9 +89,8 @@ const App = () => { element={ {repoConfig ? - : - - } + + : } } /> @@ -102,13 +104,16 @@ const App = () => { page.template === "deposit" ? {repoConfig ? - : - - } + + : } : page.template === "advisor" ? - + : } @@ -122,16 +127,15 @@ const App = () => { element={ {repoConfig ? - : - - } + }} + /> + : } } /> diff --git a/apps/4tu/src/config/auth.ts b/apps/4tu/src/config/auth.ts index 8427010e..1eadb6e2 100644 --- a/apps/4tu/src/config/auth.ts +++ b/apps/4tu/src/config/auth.ts @@ -6,4 +6,4 @@ const authProvider = { loadUserInfo: true, }; -export default authProvider; \ No newline at end of file +export default authProvider; diff --git a/apps/4tu/src/config/i18n.ts b/apps/4tu/src/config/i18n.ts index 7ded014b..ef765735 100644 --- a/apps/4tu/src/config/i18n.ts +++ b/apps/4tu/src/config/i18n.ts @@ -1,40 +1,40 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import languages from "./languages"; -import LanguageDetector from "i18next-browser-languagedetector"; -import { i18n as i18nLayout } from "@dans-framework/layout"; -import { i18n as i18nDeposit } from "@dans-framework/deposit"; -import { i18n as i18nAuth } from "@dans-framework/user-auth"; -import { i18n as i18nRepo } from "@dans-framework/repo-advisor"; - -// this is the main language provider for all subcomponents/libraries -i18n - .use(LanguageDetector) - .use(initReactI18next) - .init({ - debug: import.meta.env.DEV, - supportedLngs: languages, - detection: { - order: ["cookie", "localStorage"], - lookupCookie: "i18next", - lookupLocalStorage: "i18nextLng", - caches: ["localStorage", "cookie"], - }, - fallbackLng: "en", - interpolation: { - escapeValue: false, - }, - react: { - useSuspense: true, - }, - }); - -// make sure to import languages for the components that need it -i18n.on("languageChanged", (lng) => { - i18nLayout.changeLanguage(lng); - i18nDeposit.changeLanguage(lng); - i18nAuth.changeLanguage(lng); - i18nRepo.changeLanguage(lng); -}); - -export default i18n; +import i18n from "i18next"; +import { initReactI18next } from "react-i18next"; +import languages from "./languages"; +import LanguageDetector from "i18next-browser-languagedetector"; +import { i18n as i18nLayout } from "@dans-framework/layout"; +import { i18n as i18nDeposit } from "@dans-framework/deposit"; +import { i18n as i18nAuth } from "@dans-framework/user-auth"; +import { i18n as i18nRepo } from "@dans-framework/repo-advisor"; + +// this is the main language provider for all subcomponents/libraries +i18n + .use(LanguageDetector) + .use(initReactI18next) + .init({ + debug: import.meta.env.DEV, + supportedLngs: languages, + detection: { + order: ["cookie", "localStorage"], + lookupCookie: "i18next", + lookupLocalStorage: "i18nextLng", + caches: ["localStorage", "cookie"], + }, + fallbackLng: "en", + interpolation: { + escapeValue: false, + }, + react: { + useSuspense: true, + }, + }); + +// make sure to import languages for the components that need it +i18n.on("languageChanged", (lng) => { + i18nLayout.changeLanguage(lng); + i18nDeposit.changeLanguage(lng); + i18nAuth.changeLanguage(lng); + i18nRepo.changeLanguage(lng); +}); + +export default i18n; diff --git a/apps/4tu/src/config/languages.ts b/apps/4tu/src/config/languages.ts index 329d72a2..84cd9d69 100644 --- a/apps/4tu/src/config/languages.ts +++ b/apps/4tu/src/config/languages.ts @@ -1,5 +1,5 @@ -import type { Language } from "@dans-framework/utils"; - -const languages: Language[] = ["en", "nl"]; - -export default languages; +import type { Language } from "@dans-framework/utils"; + +const languages: Language[] = ["en", "nl"]; + +export default languages; diff --git a/apps/4tu/src/config/pages.ts b/apps/4tu/src/config/pages.ts index b8706f0d..5fa4c536 100644 --- a/apps/4tu/src/config/pages.ts +++ b/apps/4tu/src/config/pages.ts @@ -1,33 +1,33 @@ -import type { Page } from "@dans-framework/pages"; - -const depositPage: Page = { - id: "deposit", - name: { - en: "Deposit", - nl: "Deponeren", - }, - slug: "deposit", - template: "deposit", - inMenu: true, - menuTitle: { - en: "Deposit", - nl: "Deponeren", - }, -}; - -const advisorPage: Page = { - id: "advisor", - name: { - en: "Repository selector", - nl: "Repository selector", - }, - slug: "/", - template: "advisor", - inMenu: true, - menuTitle: { - en: "Repository selector", - nl: "Repository selector", - }, -}; - -export default [ advisorPage, depositPage ]; \ No newline at end of file +import type { Page } from "@dans-framework/pages"; + +const depositPage: Page = { + id: "deposit", + name: { + en: "Deposit", + nl: "Deponeren", + }, + slug: "deposit", + template: "deposit", + inMenu: true, + menuTitle: { + en: "Deposit", + nl: "Deponeren", + }, +}; + +const advisorPage: Page = { + id: "advisor", + name: { + en: "Repository selector", + nl: "Repository selector", + }, + slug: "/", + template: "advisor", + inMenu: true, + menuTitle: { + en: "Repository selector", + nl: "Repository selector", + }, +}; + +export default [advisorPage, depositPage]; diff --git a/apps/cat/package.json b/apps/cat/package.json index 804ef618..7712d600 100644 --- a/apps/cat/package.json +++ b/apps/cat/package.json @@ -10,16 +10,16 @@ "preview": "vite preview" }, "dependencies": { - "@dans-framework/user-auth": "workspace:*", "@dans-framework/deposit": "workspace:*", - "@dans-framework/utils": "workspace:*", "@dans-framework/layout": "workspace:*", "@dans-framework/pages": "workspace:*", - "@dans-framework/theme": "workspace:*", "@dans-framework/rdt-search-ui": "workspace:*", + "@dans-framework/theme": "workspace:*", + "@dans-framework/user-auth": "workspace:*", + "@dans-framework/utils": "workspace:*", "@fontsource/roboto": "^5.0.7", "@mui/icons-material": "^5.14.3", - "@mui/material": "^5.14.3", + "@mui/material": "^5.16.7", "html-react-parser": "^4.2.2", "i18next": "^23.4.1", "i18next-browser-languagedetector": "^7.1.0", @@ -34,10 +34,8 @@ "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.3", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-react-hooks": "^5.0.0", "vite": "^4.4.5", "vite-plugin-checker": "^0.6.2" } } - diff --git a/apps/cat/src/App.tsx b/apps/cat/src/App.tsx index fde27d9f..88677abb 100644 --- a/apps/cat/src/App.tsx +++ b/apps/cat/src/App.tsx @@ -76,7 +76,7 @@ const App = () => { path="user-submissions" element={ - + } /> diff --git a/apps/cat/src/config/elasticSearch.tsx b/apps/cat/src/config/elasticSearch.tsx index 6d8daaab..37be8aed 100644 --- a/apps/cat/src/config/elasticSearch.tsx +++ b/apps/cat/src/config/elasticSearch.tsx @@ -1,312 +1,313 @@ -import { - PieChartFacet, - ListFacet, - type RDTSearchUIProps, -} from "@dans-framework/rdt-search-ui"; -import { Cat2Result } from "../pages/search/result"; - -const fieldConfig: Partial = { - fullTextFields: ["title^2", "dc_description"], - fullTextHighlight: { - fields: { - title: { number_of_fragments: 0 }, - dc_description: { number_of_fragments: 0 }, - }, - }, -}; - -/* - * Note that for the dashboard config, we use cols and rows, based on an 8 col grid. - * The config is for larger screens. For mobile, we use half width and full width cols. - */ - -export const elasticConfig = [ - { - name: "CAT Catalogue", - url: "https://es.ohsmart.dansdemo.nl/fc4e-cat", - fullTextFields: fieldConfig.fullTextFields, - fullTextHighlight: fieldConfig.fullTextHighlight, - resultBodyComponent: Cat2Result, - onClickResultPath: "record", - dashboard: [ - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - ], - }, -]; +import { + PieChartFacet, + ListFacet, + type EndpointProps, + type RDTSearchUIProps, +} from "@dans-framework/rdt-search-ui"; +import { Cat2Result } from "../pages/search/result"; + +const fieldConfig: Partial = { + fullTextFields: ["title^2", "dc_description"], + fullTextHighlight: { + fields: { + title: { number_of_fragments: 0 }, + dc_description: { number_of_fragments: 0 }, + }, + }, +}; + +/* + * Note that for the dashboard config, we use cols and rows, based on an 8 col grid. + * The config is for larger screens. For mobile, we use half width and full width cols. + */ + +export const elasticConfig: EndpointProps[] = [ + { + name: "CAT Catalogue", + url: "https://es.ohsmart.dansdemo.nl/fc4e-cat", + fullTextFields: fieldConfig.fullTextFields, + fullTextHighlight: fieldConfig.fullTextHighlight, + resultBodyComponent: Cat2Result, + onClickResultPath: "record", + dashboard: [ + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ], + }, +]; diff --git a/apps/cat/src/config/footer.ts b/apps/cat/src/config/footer.ts index 4df4155f..0e8bc968 100644 --- a/apps/cat/src/config/footer.ts +++ b/apps/cat/src/config/footer.ts @@ -107,8 +107,7 @@ const footer: Footer = { }, { header: "CAT Tiger", - freetext: - "CAT Fair Assesment Tool", + freetext: "CAT Fair Assesment Tool", links: [ { name: "Contact CAT TIGER", diff --git a/apps/cat/src/pages/search/result.tsx b/apps/cat/src/pages/search/result.tsx index 10e18879..5e82fa0f 100644 --- a/apps/cat/src/pages/search/result.tsx +++ b/apps/cat/src/pages/search/result.tsx @@ -12,7 +12,8 @@ import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; export function Cat2Result(props: ResultBodyProps) { const { result: item } = props; - const title = `${item.pid_stack} - ${item.entity} - ${item.role}` || "empty"; + const title = + `${item.pid_stack} - ${item.entity} - ${item.role}` || "empty"; return ( <> diff --git a/apps/cat/vite.config.ts b/apps/cat/vite.config.ts index e8608ed2..292a5edf 100644 --- a/apps/cat/vite.config.ts +++ b/apps/cat/vite.config.ts @@ -3,13 +3,11 @@ import react from "@vitejs/plugin-react"; import checker from "vite-plugin-checker"; // https://vitejs.dev/config/ -export default () => { - return defineConfig({ - plugins: [ - react(), - checker({ - typescript: true, - }), - ], - }); -}; +export default defineConfig({ + plugins: [ + react(), + checker({ + typescript: true, + }), + ], +}); diff --git a/apps/digitaltwins/.env b/apps/digitaltwins/.env index baab0bde..d3de12f6 100644 --- a/apps/digitaltwins/.env +++ b/apps/digitaltwins/.env @@ -23,6 +23,7 @@ VITE_OIDC_SCOPE = 'openid profile' ## API keys VITE_GEONAMES_API_KEY = '' +VITE_MAPTILER_API_KEY = '' ## Freshdesk ticketing VITE_FRESHDESK_API_KEY = '' diff --git a/apps/digitaltwins/Dockerfile b/apps/digitaltwins/Dockerfile index bb5a0e4e..de271d4c 100644 --- a/apps/digitaltwins/Dockerfile +++ b/apps/digitaltwins/Dockerfile @@ -1,4 +1,4 @@ -# Fetching the latest node image on apline linux +# Fetching the latest node image on alpine linux FROM node:20-alpine AS builder RUN apk update && apk add git && npm i -g turbo && npm i -g pnpm @@ -7,7 +7,7 @@ WORKDIR /app COPY . . RUN git submodule update --init --recursive -## RUN turbo prune --scope=@dans-framework/digitaltwins --docker + RUN pnpm i && pnpm build --filter=@dans-framework/digitaltwins # Fetching the latest nginx image diff --git a/apps/digitaltwins/package.json b/apps/digitaltwins/package.json index 929cfbb3..2da267de 100644 --- a/apps/digitaltwins/package.json +++ b/apps/digitaltwins/package.json @@ -18,7 +18,7 @@ "@dans-framework/user-auth": "workspace:*", "@dans-framework/utils": "workspace:*", "@fontsource/roboto": "^5.0.7", - "@mui/material": "^5.14.3", + "@mui/material": "^5.16.7", "i18next": "^23.4.1", "i18next-browser-languagedetector": "^7.1.0", "i18next-resources-to-backend": "^1.1.4", @@ -29,12 +29,10 @@ "web-vitals": "^3.4.0" }, "devDependencies": { - "@types/node": "^20.11.27", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.3", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-react-hooks": "^5.0.0", "vite": "^4.4.5", "vite-plugin-checker": "^0.6.2" } diff --git a/apps/digitaltwins/src/App.tsx b/apps/digitaltwins/src/App.tsx index 79e02a99..118c305b 100644 --- a/apps/digitaltwins/src/App.tsx +++ b/apps/digitaltwins/src/App.tsx @@ -1,4 +1,4 @@ -import { Suspense, useState } from "react"; +import { Suspense /*useState*/ } from "react"; import { BrowserRouter, Routes, Route } from "react-router-dom"; import Skeleton from "@mui/material/Skeleton"; import Box from "@mui/material/Box"; @@ -24,13 +24,13 @@ import languages from "./config/languages"; import authProvider from "./config/auth"; import form from "./config/form"; import { FileMapper } from "@dans-framework/file-mapper"; -import type { FormConfig } from "@dans-framework/deposit"; +// import type { FormConfig } from "@dans-framework/deposit"; const App = () => { const { i18n } = useTranslation(); // Must keep a parent state for the form mapper component, // otherwise the app will not know of any API response from the FileMapper component - const [ mappedForm, setMappedForm ] = useState(); + // const [ mappedForm, setMappedForm ] = useState(); return ( @@ -67,7 +67,7 @@ const App = () => { path="user-submissions" element={ - + } /> @@ -79,12 +79,19 @@ const App = () => { element={ page.template === "deposit" ? - - + + : page.template === "mapper" ? - - + + : } /> diff --git a/apps/digitaltwins/src/config/form.ts b/apps/digitaltwins/src/config/form.ts index 693823ac..c544191b 100644 --- a/apps/digitaltwins/src/config/form.ts +++ b/apps/digitaltwins/src/config/form.ts @@ -9,13 +9,7 @@ import rights from "./formsections/rights"; // Section data are formatted as js/ts, so we can easily import things like option lists, or set a variable that gets reused // For now, see types/Metadata.ts to check the types of input fields you can use -const sections = [ - citation, - coverage, - relations, - administrative, - rights, -]; +const sections = [citation, coverage, relations, administrative, rights]; const form: FormConfig = { form: sections as InitialSectionType[], diff --git a/apps/digitaltwins/src/config/formsections/administrative.ts b/apps/digitaltwins/src/config/formsections/administrative.ts index c642a503..db925031 100644 --- a/apps/digitaltwins/src/config/formsections/administrative.ts +++ b/apps/digitaltwins/src/config/formsections/administrative.ts @@ -7,20 +7,6 @@ const section: InitialSectionType = { nl: "Administratief", }, fields: [ - { - type: "autocomplete", - label: { - en: "Language of interview", - nl: "Taal van interview", - }, - name: "language_interview", - required: true, - description: { - en: "Provide the language the interview was held in", - nl: "Geef de taal waarin het interview is gehouden op", - }, - options: "languageList", - }, { type: "autocomplete", label: { diff --git a/apps/digitaltwins/src/config/formsections/citation.ts b/apps/digitaltwins/src/config/formsections/citation.ts index 4db9e916..caee1b03 100644 --- a/apps/digitaltwins/src/config/formsections/citation.ts +++ b/apps/digitaltwins/src/config/formsections/citation.ts @@ -43,25 +43,10 @@ const section: InitialSectionType = { multiline: true, required: true, description: { - en: "Some context on the interview. What is the role and relevance of the interviewee in the project? What led to the interview being conducted? Summary of what was discussed in the interview, with time breakdown, and describe important events in the interview. Improves discoverability and reusability of the interview data. Briefly describe the setting and atmosphere of the interview to indicate what does not emerge when only the text is read. Basic HTML tags are allowed.", - nl: "Wat context bij het interview. Wat is de rol en relevantie van de geinterviewde bij dit project? Waarom is dit interview afgenomen? Samenvatting van wat er besproken is in het interview, met een tijdindicatie. Beschrijf belangrijke gebeurtenissen in hter interview. Verbetert zichtbaarheid en herbruikbaarheid van de data. Beschrijf kort de setting en sfeer van het interview om meer dan alleen de tekst die gelezen wordt duidelijk te maken. Simpele HTML tags zijn toegestaan.", + en: "Some context. Basic HTML tags are allowed.", + nl: "Wat context. Simpele HTML tags zijn toegestaan.", }, }, - { - type: "autocomplete", - label: { - en: "Publisher", - nl: "Uitgever", - }, - name: "publisher", - required: true, - description: { - en: "Institution - often the rights holder", - nl: "Instituut - vaak de rechthebbende", - }, - options: "ror", - allowFreeText: true, - }, { type: "group", label: { diff --git a/apps/digitaltwins/src/config/formsections/coverage.ts b/apps/digitaltwins/src/config/formsections/coverage.ts index 56c0b76b..1932c260 100644 --- a/apps/digitaltwins/src/config/formsections/coverage.ts +++ b/apps/digitaltwins/src/config/formsections/coverage.ts @@ -8,53 +8,58 @@ const section: InitialSectionType = { }, fields: [ { - type: "autocomplete", + type: "drawmap", label: { - en: "Subject keywords", - nl: "Trefwoorden bij onderwerp", + en: "Indicate location", + nl: "Map", }, - name: "subject_keywords", + name: "map", required: true, - multiselect: true, description: { - en: "Enter keywords that describe the content of your dataset in terms of artistic or architectural subject matter. Keywords may either be selected from the Getty Art & Architecture Thesaurus (AAT), or entered as free text. These keywords have a different scope from the 'Humanities' domain-specific keywords (below), which should be selected from the European Languages Social Sciences Thesaurus (ELSST), and which describe the content of your dataset in terms of social relations, interactions or phenomena, or ways to study them.", - nl: "Voer trefwoorden in die de inhoud van de dataset beschrijven op het gebied van artistieke of architectonische onderwerpen. Trefwoorden kunnen worden geselecteerd uit de Getty Art & Architecture Thesaurus (AAT) of worden ingevoerd als vrije tekst. Deze trefwoorden hebben een andere reikwijdte dan de 'Geesteswetenschappen' domeinspecifieke trefwoorden (hieronder), die moeten worden geselecteerd uit de European Languages Social Sciences Thesaurus (ELSST) en die de inhoud van uw dataset beschrijven in termen van sociale relaties, interacties of verschijnselen, of manieren om ze te bestuderen.", + en: "Search and select to open and focus a map on this location. Then select a shape type and start drawing.", + nl: "Iets van beschrijving", }, - options: "getty", - allowFreeText: true, - value: [ + fullWidth: true, + wmsLayers: [ { - label: "oral history (discipline)", - value: "http://vocab.getty.edu/page/aat/300054402", - mandatory: true, + name: "natura2000", + source: + "https://service.pdok.nl/rvo/natura2000/wms/v1_0?service=WMS&version=1.3.0&layers=natura2000", + }, + { + name: "nationaleparken", + source: + "https://service.pdok.nl/rvo/nationaleparken/wms/v2_0?service=WMS&version=1.3.0&layers=nationaleparken", }, ], }, { type: "autocomplete", label: { - en: "Location(s) covered in the interview", - nl: "Locatie(s) besproken in het interview", + en: "Species covered", + nl: "Soorten", }, - name: "subject_location", + name: "species", multiselect: true, + required: true, description: { - en: "The location(s) that the interview material deals with", - nl: "De locatie(s) waar het interview over gaat", + en: "Something here", + nl: "Iets hier", }, - options: "geonames", + multiApiValue: "biodiversity_species_scientific", + options: [ "biodiversity_species_scientific", "biodiversity_species_vernacular" ], }, { type: "group", label: { - en: "Period covered in the interview", - nl: "Periode besproken in het interview", + en: "Period covered", + nl: "Periode besproken", }, name: "subject_date_time", repeatable: true, description: { - en: "The dates and times the interview material deals with", - nl: "De data en tijden waarover het interview gaat", + en: "", + nl: "", }, fields: [ { diff --git a/apps/digitaltwins/src/config/formsections/relations.ts b/apps/digitaltwins/src/config/formsections/relations.ts index 9ee845dc..29e31e55 100644 --- a/apps/digitaltwins/src/config/formsections/relations.ts +++ b/apps/digitaltwins/src/config/formsections/relations.ts @@ -52,15 +52,6 @@ const section: InitialSectionType = { nl: "Iets hier", }, options: "dansCollections", - value: [ - { - mandatory: true, - label: "Oral History", - value: - "https://vocabularies.dans.knaw.nl/collections/ssh/cfa04ed6-4cd0-4651-80cb-ed4ca8fa14f3", - id: "ssh/cfa04ed6-4cd0-4651-80cb-ed4ca8fa14f3", - }, - ], }, { type: "group", @@ -71,8 +62,8 @@ const section: InitialSectionType = { name: "relation", repeatable: true, description: { - en: "Other interviews, publications, projects", - nl: "Andere interviews, publicaties, projecten", + en: "Other publications, projects", + nl: "Andere publicaties, projecten", }, fields: [ { @@ -87,7 +78,10 @@ const section: InitialSectionType = { nl: "Type relatie met dit externe item", }, noIndicator: true, - options: relationships.map((r: string) => ({ label: r, value: r.toLowerCase() })), + options: relationships.map((r: string) => ({ + label: r, + value: r.toLowerCase(), + })), toggleRequired: ["relation_item", "relation_reference"], }, { @@ -99,8 +93,8 @@ const section: InitialSectionType = { name: "relation_item", noIndicator: true, description: { - en: "Other interviews, publications, projects, or initiatives can be linked here by providing a description, a URL, and selecting a relation type.", - nl: "Andere interviews, publicaties, projecten of initiatieven kunnen hier worden gelinkt door een beschrijving, een URL en een relatietype te verstrekken.", + en: "Other publications, projects, or initiatives can be linked here by providing a description, a URL, and selecting a relation type.", + nl: "Andere publicaties, projecten of initiatieven kunnen hier worden gelinkt door een beschrijving, een URL en een relatietype te verstrekken.", }, }, { diff --git a/apps/digitaltwins/src/config/pages.ts b/apps/digitaltwins/src/config/pages.ts index 50c04cdd..c11d1833 100644 --- a/apps/digitaltwins/src/config/pages.ts +++ b/apps/digitaltwins/src/config/pages.ts @@ -1,56 +1,54 @@ -import type { Page } from "@dans-framework/pages"; - -const depositPage: Page = { - id: "deposit", - name: { - en: "Deposit", - nl: "Deponeren", - }, - slug: "deposit", - template: "deposit", - inMenu: true, - menuTitle: { - en: "Deposit", - nl: "Deponeren", - }, -}; - -const advisorPage: Page = { - id: "mapper", - name: { - en: "Map your data", - nl: "Map your data", - }, - slug: "map", - template: "mapper", - inMenu: true, - menuTitle: { - en: "Map data", - nl: "Map data", - }, -}; - - -const homePage: Page = { - id: "home", - name: "Home", - slug: "/", - template: "generic", - inMenu: true, - menuTitle: "Home", - content: { - en: "

Some text

", - nl: "

Wat tekst

", - }, - action: { - link: "map", - text: { - en: "Map your data", - nl: "Data mappen", - }, - restricted: true, - }, -}; - - -export default [ advisorPage, depositPage, homePage ]; +import type { Page } from "@dans-framework/pages"; + +const depositPage: Page = { + id: "deposit", + name: { + en: "Deposit", + nl: "Deponeren", + }, + slug: "deposit", + template: "deposit", + inMenu: true, + menuTitle: { + en: "Deposit", + nl: "Deponeren", + }, +}; + +const advisorPage: Page = { + id: "mapper", + name: { + en: "Start mapping terms", + nl: "Start mapping terms", + }, + slug: "map", + template: "mapper", + inMenu: true, + menuTitle: { + en: "Term mapping", + nl: "Term mapping", + }, +}; + +const homePage: Page = { + id: "home", + name: "Home", + slug: "/", + template: "generic", + inMenu: true, + menuTitle: "Home", + content: { + en: "

Some text

", + nl: "

Wat tekst

", + }, + action: { + link: "map", + text: { + en: "Map your data", + nl: "Data mappen", + }, + restricted: true, + }, +}; + +export default [advisorPage, depositPage, homePage]; diff --git a/apps/ohsmart/package.json b/apps/ohsmart/package.json index f3223092..fbb04365 100644 --- a/apps/ohsmart/package.json +++ b/apps/ohsmart/package.json @@ -17,7 +17,7 @@ "@dans-framework/user-auth": "workspace:*", "@dans-framework/utils": "workspace:*", "@fontsource/roboto": "^5.0.7", - "@mui/material": "^5.14.3", + "@mui/material": "^5.16.7", "i18next": "^23.4.1", "i18next-browser-languagedetector": "^7.1.0", "i18next-resources-to-backend": "^1.1.4", @@ -29,12 +29,10 @@ }, "devDependencies": { "@playwright/test": "^1.42.1", - "@types/node": "^20.11.27", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.3", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-react-hooks": "^5.0.0", "vite": "^4.4.5", "vite-plugin-checker": "^0.6.2" } diff --git a/apps/ohsmart/src/App.tsx b/apps/ohsmart/src/App.tsx index 59ae74d3..accd06ef 100644 --- a/apps/ohsmart/src/App.tsx +++ b/apps/ohsmart/src/App.tsx @@ -61,7 +61,7 @@ const App = () => { path="user-submissions" element={ - + } /> diff --git a/apps/ohsmart/src/config/fileOptions.ts b/apps/ohsmart/src/config/fileOptions.ts index aac68f70..b1e1ca83 100644 --- a/apps/ohsmart/src/config/fileOptions.ts +++ b/apps/ohsmart/src/config/fileOptions.ts @@ -1,78 +1,81 @@ export const fileRoleOptions = [ { value: "video_file", - label: { en: "Video file", nl: "Videobestand" } + label: { en: "Video file", nl: "Videobestand" }, }, { value: "audio_file", - label: { en: "Audio file", nl: "Audiobestand" } + label: { en: "Audio file", nl: "Audiobestand" }, }, { value: "transcript", - label: { en: "Transcript", nl: "Transcript" } + label: { en: "Transcript", nl: "Transcript" }, }, { value: "subtitles", - label: { en: "Subtitles", nl: "Ondertiteling" } + label: { en: "Subtitles", nl: "Ondertiteling" }, }, { value: "interview_questions", - label: { en: "Interview questions", nl: "Interviewvragen" } + label: { en: "Interview questions", nl: "Interviewvragen" }, }, { value: "methodology", - label: { en: "Methodology", nl: "Methodologie" } + label: { en: "Methodology", nl: "Methodologie" }, }, { value: "report", - label: { en: "Report", nl: "Rapport" } + label: { en: "Report", nl: "Rapport" }, }, { value: "publication", - label: { en: "Publication", nl: "Publicatie" } + label: { en: "Publication", nl: "Publicatie" }, }, { value: "supplementary_file", - label: { en: "Supplementary file", nl: "Overig materiaal" } + label: { en: "Supplementary file", nl: "Overig materiaal" }, }, { value: "image_file", - label: { en: "Image file", nl: "Beeldbestand" } + label: { en: "Image file", nl: "Beeldbestand" }, }, { value: "thumbnail", - label: { en: "Thumbnail", nl: "Thumbnail" } + label: { en: "Thumbnail", nl: "Thumbnail" }, }, { value: "dissemination_copy", - label: { en: "Dissemination copy", nl: "Disseminatiexemplaar" } + label: { en: "Dissemination copy", nl: "Disseminatiexemplaar" }, }, { value: "preservation_copy", - label: { en: "Preservation copy", nl: "Preservatieexemplaar" } + label: { en: "Preservation copy", nl: "Preservatieexemplaar" }, }, { value: "data_dictionary_code_book", - label: { en: "Data dictionary - code book", nl: "Data dictionary - code book" } + label: { + en: "Data dictionary - code book", + nl: "Data dictionary - code book", + }, }, { value: "data_dictionary_other", - label: { en: "Data dictionary - other", nl: "Data dictionary - overig" } + label: { en: "Data dictionary - other", nl: "Data dictionary - overig" }, }, { value: "original_metadata", - label: { en: "Original metadata", nl: "Oorspronkelijke metadata" } + label: { en: "Original metadata", nl: "Oorspronkelijke metadata" }, }, { value: "data_file", - label: { en: "Data file", nl: "Databestand" } + label: { en: "Data file", nl: "Databestand" }, }, { value: "code", - label: { en: "Code", nl: "Code" } + label: { en: "Code", nl: "Code" }, }, { value: "type_registry_value", - label: { en: "Type registry value", nl: "Type registry value" } - } + label: { en: "Type registry value", nl: "Type registry value" }, + }, ]; diff --git a/apps/ohsmart/src/config/formsections/relations.ts b/apps/ohsmart/src/config/formsections/relations.ts index a83e4597..0893fa5b 100644 --- a/apps/ohsmart/src/config/formsections/relations.ts +++ b/apps/ohsmart/src/config/formsections/relations.ts @@ -87,7 +87,10 @@ const section: InitialSectionType = { nl: "Het type relatie tussen dit interview en een ander object (interview, dataset, publicatie, project).", }, noIndicator: true, - options: relationships.map((r: string) => ({ label: r, value: r.toLowerCase() })), + options: relationships.map((r: string) => ({ + label: r, + value: r.toLowerCase(), + })), toggleRequired: ["relation_item", "relation_reference"], }, { diff --git a/apps/rda/package.json b/apps/rda/package.json index dd77bbea..d3a280b6 100644 --- a/apps/rda/package.json +++ b/apps/rda/package.json @@ -10,16 +10,17 @@ "preview": "vite preview" }, "dependencies": { - "@dans-framework/user-auth": "workspace:*", "@dans-framework/deposit": "workspace:*", - "@dans-framework/utils": "workspace:*", "@dans-framework/layout": "workspace:*", "@dans-framework/pages": "workspace:*", - "@dans-framework/theme": "workspace:*", "@dans-framework/rdt-search-ui": "workspace:*", + "@dans-framework/theme": "workspace:*", + "@dans-framework/user-auth": "workspace:*", + "@dans-framework/utils": "workspace:*", + "@dans-framework/freshdesk": "workspace:*", "@fontsource/roboto": "^5.0.7", "@mui/icons-material": "^5.14.3", - "@mui/material": "^5.14.3", + "@mui/material": "^5.16.7", "html-react-parser": "^4.2.2", "i18next": "^23.4.1", "i18next-browser-languagedetector": "^7.1.0", @@ -34,10 +35,8 @@ "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.3", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", + "eslint-plugin-react-hooks": "^5.0.0", "vite": "^4.4.5", "vite-plugin-checker": "^0.6.2" } } - diff --git a/apps/rda/src/App.tsx b/apps/rda/src/App.tsx index 87f30776..414768da 100644 --- a/apps/rda/src/App.tsx +++ b/apps/rda/src/App.tsx @@ -26,7 +26,11 @@ import languages from "./config/languages"; import authProvider from "./config/auth"; import form from "./config/form"; import { elasticConfig } from "./config/elasticSearch"; -import { FacetedWrapper, FacetedSearchProvider } from "@dans-framework/rdt-search-ui"; +import { + FacetedWrapper, + FacetedSearchProvider, +} from "@dans-framework/rdt-search-ui"; +import { Freshdesk } from "@dans-framework/freshdesk"; const App = () => { const { i18n } = useTranslation(); @@ -83,7 +87,7 @@ const App = () => { path="user-submissions" element={ - + } /> @@ -101,6 +105,7 @@ const App = () => {