diff --git a/package-lock.json b/package-lock.json index f82baffb..41e4ef5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "dependencies": { "@allmaps/iiif-parser": "1.0.0-beta.36", - "@annotorious/react": "3.0.0-rc.25", + "@annotorious/react": "3.0.0-rc.27", "@astrojs/netlify": "^2.6.0", "@astrojs/node": "^5.3.6", "@astrojs/react": "^2.3.2", @@ -36,8 +36,8 @@ "@radix-ui/react-tooltip": "^1.0.7", "@react-spring/web": "^9.7.3", "@recogito/annotorious-supabase": "^1.0.0-rc.10", - "@recogito/react-pdf-annotator": "1.0.0-rc.21", - "@recogito/react-text-annotator": "3.0.0-rc.28", + "@recogito/react-pdf-annotator": "^1.0.0-rc.21", + "@recogito/react-text-annotator": "^3.0.0-rc.28", "@supabase/auth-helpers-shared": "^0.3.4", "@supabase/supabase-js": "^2.32.0", "@table-library/react-table-library": "^4.1.7", @@ -131,7 +131,6 @@ "dequal": "^2.0.3", "nanoevents": "^9.0.0", "nanoid": "^5.0.7", - "nanoid": "^5.0.7", "uuid": "^9.0.1" } }, @@ -12676,4 +12675,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/apps/dashboard-projects/ProjectsHome.tsx b/src/apps/dashboard-projects/ProjectsHome.tsx index 1b8f61ec..909fef1a 100644 --- a/src/apps/dashboard-projects/ProjectsHome.tsx +++ b/src/apps/dashboard-projects/ProjectsHome.tsx @@ -92,12 +92,14 @@ export const ProjectsHome = (props: ProjectsHomeProps) => { // Filtered projects const myProjects = projects.filter((p) => p.created_by?.id === me.id); - const openJoinProjects = projects.filter( - (p) => - me.id !== p.created_by?.id && - p.is_open_join && - p.users.filter((u) => u.user.id === me.id).length === 0 - ); + const openJoinProjects = me.isOrgAdmin + ? projects.filter((p) => me.id !== p.created_by?.id && p.is_open_join) + : projects.filter( + (p) => + me.id !== p.created_by?.id && + p.is_open_join && + p.users.filter((u) => u.user.id === me.id).length === 0 + ); const sharedProjects = isReader ? projects.filter(({ created_by, users }) => diff --git a/src/components/ProjectCard/ProjectCard.tsx b/src/components/ProjectCard/ProjectCard.tsx index d8ae659c..17609b87 100644 --- a/src/components/ProjectCard/ProjectCard.tsx +++ b/src/components/ProjectCard/ProjectCard.tsx @@ -57,15 +57,15 @@ export const ProjectCard = (props: ProjectCardProps) => { const texts = documents.filter(({ content_type }) => content_type); - const { t } = props.i18n; + const { t, lang } = props.i18n; const showDocs = props.orgPolicies ? props.orgPolicies.get('projects').has('INSERT') : false; const onClick = () => { - if (!is_open_join || users.length > 0) { - window.location.href = `./projects/${id}`; + if (!is_open_join || users.length > 0 || props.me.isOrgAdmin) { + window.location.pathname = `${lang}/projects/${id}`; } }; @@ -77,7 +77,7 @@ export const ProjectCard = (props: ProjectCardProps) => { setJoinProjectOpen(false); joinProject(supabase, id).then((resp) => { if (resp) { - window.location.href = `./projects/${id}`; + window.location.pathname = `${lang}/projects/${id}`; } else { props.onError(props.i18n.t['Something happened']); }