Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #207

Merged
merged 48 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a926741
started work on map with drawing feature
Aug 22, 2024
10d7a53
updates
Aug 22, 2024
a63013c
updates to map, updated mui
Aug 23, 2024
989a72c
updates to mapping func
Aug 26, 2024
5d7ade6
saving changes
Aug 28, 2024
8b53e76
coupled to geonames, still to fix ts
Aug 28, 2024
0425a08
fixalot
Aug 29, 2024
bdee27a
updated geonames reverse lookup
Sep 2, 2024
20e356f
started work on coord conversions
Sep 2, 2024
17eef8e
Updated ES endpoint
akeldamas Sep 26, 2024
917e350
wip
Oct 7, 2024
73a882d
wip
Oct 7, 2024
e4ba9d1
wip
Oct 14, 2024
915e294
should be good to go
Oct 16, 2024
773c637
usability features and fixes
Oct 17, 2024
7ed70ab
some optimisation, lazy loading, code splitting, added rollup visualiser
Oct 22, 2024
205eb5a
added drawmap note to docs
Oct 22, 2024
fba8978
Merge pull request #201 from DANS-KNAW/feature/draw-map
ddzyne Oct 28, 2024
4f71add
Created digital twins jobs for image build and push.
Oct 29, 2024
5028659
Dummy push to build digital twins image.
Oct 29, 2024
8bc91e2
Leftover fixes to build job.
Oct 29, 2024
bfff228
Dummy push for job run.
Oct 29, 2024
e6ae393
added feature for wms tile layers on map
Nov 4, 2024
fdecd4b
Merge pull request #202 from DANS-KNAW/feature/draw-map
ddzyne Nov 4, 2024
62bd501
added Naturalis Biodiversity api
Nov 5, 2024
40c1781
Add freshdesk widget component
akeldamas Nov 3, 2024
3f8f5cc
Revise dashboard layout to fit specs
akeldamas Nov 10, 2024
b566a3a
Resolved typo
akeldamas Nov 11, 2024
f2fb031
Changed Date Data display label
akeldamas Nov 11, 2024
ab66fba
wip
Nov 11, 2024
1708ded
updated filemapper, prettified all code
Nov 20, 2024
91e7bda
updated species lookup to separate vernacular/scientifc names and lim…
Nov 27, 2024
1b90153
added wms feature click listener and api call to get feature
Nov 29, 2024
aac7da0
prettified
Nov 29, 2024
e9babcc
Merge branch 'development' into app/digitaltwins-dev
ddzyne Nov 29, 2024
846543c
Merge pull request #206 from DANS-KNAW/app/digitaltwins-dev
ddzyne Nov 29, 2024
b3b661f
prevent wms feature api from firing on every draw action
Nov 29, 2024
365a794
updated rdt
Dec 3, 2024
99b2298
removed submodule rdt-search-ui and incorporated into main repo
Dec 3, 2024
a1fc60c
removed submodule rdt-search-ui and incorporated into main repo
Dec 3, 2024
405b219
updated userSubmissions call to include target credentials
Dec 3, 2024
1c03fe2
added comment
Dec 3, 2024
e80fc84
updated packages, removed redundant modules, fixed typescript
Dec 4, 2024
83b641d
fixed deps
Dec 4, 2024
33ce5e0
changed vite config rda
Dec 4, 2024
dda2f9a
changed vite config cat
Dec 4, 2024
c376ddf
added typescript dep back to root package.json
Dec 4, 2024
d745b1f
updated usersubmssion component props for all apps
Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/build-twins-image.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ dist-ssr

# Testing related
playwright-report
test-results
test-results

# Rollup visualiser
stats.html
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

10 changes: 4 additions & 6 deletions apps/4tu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
Expand Down
50 changes: 27 additions & 23 deletions apps/4tu/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,16 +31,16 @@ import { AnimatePresence, motion } from "framer-motion";

const App = () => {
const { i18n } = useTranslation();
const [ repoConfig, setRepoConfig ] = useState<FormConfig>();
const configIsSet = repoConfig?.hasOwnProperty('form') || false;
const [repoConfig, setRepoConfig] = useState<FormConfig>();
const configIsSet = repoConfig?.hasOwnProperty("form") || false;
return (
<AuthWrapper authProvider={authProvider}>
<ThemeWrapper theme={theme} siteTitle={siteTitle}>
<BrowserRouter>
{/* Suspense to make sure languages can load first */}
<Suspense>
<AnimatePresence>
{ configIsSet &&
{configIsSet && (
<motion.div
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
Expand All @@ -45,14 +49,14 @@ const App = () => {
>
<RepoBar repo={repoConfig?.displayName} />
</motion.div>
}
)}
</AnimatePresence>
</Suspense>
<LanguageBar
languages={languages}
changeLanguage={i18n.changeLanguage}
/>
<MenuBar
<MenuBar
pages={pages}
userSettings={configIsSet}
userSubmissions={configIsSet}
Expand All @@ -75,9 +79,8 @@ const App = () => {
<UserSettings
target={repoConfig.targetCredentials}
depositSlug=""
/> :
<NoRepoSelected advisorLocation="/" />
}
/>
: <NoRepoSelected advisorLocation="/" />}
</AuthRoute>
}
/>
Expand All @@ -86,9 +89,8 @@ const App = () => {
element={
<AuthRoute>
{repoConfig ?
<UserSubmissions depositSlug="" /> :
<NoRepoSelected advisorLocation="/" />
}
<UserSubmissions depositSlug="" targetCredentials={repoConfig.targetCredentials} />
: <NoRepoSelected advisorLocation="/" />}
</AuthRoute>
}
/>
Expand All @@ -102,13 +104,16 @@ const App = () => {
page.template === "deposit" ?
<AuthRoute>
{repoConfig ?
<Deposit config={repoConfig} page={page} /> :
<NoRepoSelected advisorLocation="/" />
}
<Deposit config={repoConfig} page={page} />
: <NoRepoSelected advisorLocation="/" />}
</AuthRoute>
: page.template === "advisor" ?
<AuthRoute>
<RepoAdvisor page={page} setRepoConfig={setRepoConfig} depositLocation="/deposit" />
<RepoAdvisor
page={page}
setRepoConfig={setRepoConfig}
depositLocation="/deposit"
/>
</AuthRoute>
: <Generic {...page} />
}
Expand All @@ -122,16 +127,15 @@ const App = () => {
element={
<AuthRoute>
{repoConfig ?
<Deposit
config={repoConfig}
page={{
<Deposit
config={repoConfig}
page={{
name: "Deposit",
id: "deposit",
inMenu: true,
}}
/> :
<NoRepoSelected advisorLocation="/" />
}
}}
/>
: <NoRepoSelected advisorLocation="/" />}
</AuthRoute>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/4tu/src/config/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const authProvider = {
loadUserInfo: true,
};

export default authProvider;
export default authProvider;
80 changes: 40 additions & 40 deletions apps/4tu/src/config/i18n.ts
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 5 additions & 5 deletions apps/4tu/src/config/languages.ts
Original file line number Diff line number Diff line change
@@ -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;
66 changes: 33 additions & 33 deletions apps/4tu/src/config/pages.ts
Original file line number Diff line number Diff line change
@@ -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 ];
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];
Loading
Loading