Skip to content

Commit

Permalink
Show Partners section only for super admins in Project Edit
Browse files Browse the repository at this point in the history
- Related to hotosm#6708
  • Loading branch information
royallsilwallz committed Jan 31, 2025
1 parent 579dc75 commit 6d6aee7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/views/projectEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function ProjectEdit() {
const [errorLanguages, loadingLanguages, languages] = useFetch('system/languages/');
const mandatoryFields = ['name', 'shortDescription', 'description', 'instructions'];
const token = useSelector((state) => state.auth.token);
const userDetails = useSelector((state) => state.auth.userDetails);
const [error, setError] = useState(null);
const [success, setSuccess] = useState(false);
const [option, setOption] = useState('description');
Expand Down Expand Up @@ -213,7 +214,6 @@ export function ProjectEdit() {
{ value: 'description', required: true },
{ value: 'instructions', required: true },
{ value: 'metadata', required: true },
{ value: 'partners' },
{ value: 'priority_areas' },
{ value: 'imagery' },
{ value: 'permissions' },
Expand All @@ -222,6 +222,8 @@ export function ProjectEdit() {
{ value: 'custom_editor' },
];

if (userDetails.role === 'ADMIN') elements.splice(3, 0, { value: 'partners' });

return (
<div>
<ul className="list pl0 mt0 ttu">
Expand Down

0 comments on commit 6d6aee7

Please sign in to comment.