-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: admin can delete software from RSD
feat: admin can delete organisation from RSD feat: admin can delete community feat: admin can delete project
- Loading branch information
1 parent
fa38eb8
commit 85dc89d
Showing
33 changed files
with
1,071 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
frontend/components/admin/communities/RemoveCommunityModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// SPDX-FileCopyrightText: 2024 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import {useState} from 'react' | ||
import TextField from '@mui/material/TextField' | ||
|
||
import ConfirmDeleteModal from '~/components/layout/ConfirmDeleteModal' | ||
import {CommunityListProps} from '~/components/communities/apiCommunities' | ||
|
||
export type CommunityModalProps={ | ||
open: boolean | ||
item?: CommunityListProps | ||
} | ||
|
||
type RemoveCommunityModalProps={ | ||
item?: CommunityListProps | ||
onCancel: ()=>void | ||
onDelete: ()=>void | ||
} | ||
|
||
export default function RemoveCommunityModal({item,onCancel,onDelete}:RemoveCommunityModalProps) { | ||
const [confirmation,setConfirmation] = useState<string>('') | ||
return ( | ||
<ConfirmDeleteModal | ||
open={true} | ||
title="Delete community" | ||
removeDisabled={item?.name!==confirmation} | ||
body={ | ||
<> | ||
<p> | ||
Are you sure you want to delete this community? | ||
</p> | ||
<p className="py-4"> | ||
<strong>{item?.name}</strong> | ||
</p> | ||
<TextField | ||
label="Name of the community to delete" | ||
helperText={ | ||
<span>Type the community name exactly as shown above.</span> | ||
} | ||
value = {confirmation} | ||
onChange={({target})=>setConfirmation(target.value)} | ||
sx={{ | ||
width: '100%', | ||
margin: '1rem 0rem' | ||
}} | ||
/> | ||
<p className="text-error text-base"> | ||
This will remove community from all related RSD entries too! | ||
</p> | ||
</> | ||
} | ||
onCancel={onCancel} | ||
onDelete={onDelete} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.