Skip to content

Commit

Permalink
Merge pull request #188 from recogito/develop
Browse files Browse the repository at this point in the history
Beta fixes
  • Loading branch information
lwjameson authored May 29, 2024
2 parents f2ee425 + 21b1231 commit 506e990
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions src/apps/dashboard-projects/ProjectsHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) =>
Expand Down
8 changes: 4 additions & 4 deletions src/components/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
};

Expand All @@ -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']);
}
Expand Down

0 comments on commit 506e990

Please sign in to comment.