Skip to content

Commit

Permalink
fix/1277 disable created_by when not part of org
Browse files Browse the repository at this point in the history
  • Loading branch information
niceFont committed Jun 30, 2024
1 parent 795844e commit f65e2c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/editProject/EditProjectContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ export default function EditProjectContent({
});
};

const isOrgMember = userOrganizations.some((o) => o.id === project.project_parents?.parent_organization?.id);

return (
<div ref={contentRef}>
<div className={classes.block}>
Expand Down Expand Up @@ -255,7 +257,11 @@ export default function EditProjectContent({
"project_parents"
)
}
options={userOrganizations}
disabled={!isOrgMember}
options={[
...(isOrgMember ? [] : [project.project_parents?.parent_organization]),
...userOrganizations
]}
label={texts.created_by}
className={classes.select}
required
Expand Down

0 comments on commit f65e2c8

Please sign in to comment.