From 89165768c866f0fc435d04ecbc3f570e37ae0636 Mon Sep 17 00:00:00 2001 From: Ewan Cahen Date: Tue, 11 Oct 2022 17:11:10 +0200 Subject: [PATCH 1/2] fix: more information in invitation email templates --- .../organisation/maintainers/OrganisationMaintainerLink.tsx | 6 +++--- frontend/components/organisation/maintainers/index.tsx | 3 +++ .../projects/edit/maintainers/ProjectMaintainerLink.tsx | 4 ++-- frontend/components/projects/edit/maintainers/index.tsx | 3 +++ frontend/components/software/edit/editSoftwareContext.tsx | 4 +++- .../software/edit/maintainers/SoftwareMaintainerLink.tsx | 4 ++-- frontend/components/software/edit/maintainers/index.tsx | 3 +++ frontend/config/userMenuItems.tsx | 2 +- 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx b/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx index 3cebf5ecf..ee99ffd71 100644 --- a/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx +++ b/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx @@ -18,8 +18,8 @@ import InvitationList from '~/components/layout/InvitationList' import {Invitation} from '~/types/Invitation' import {getUnusedInvitations} from '~/utils/getUnusedInvitations' -export default function OrganisationMaintainerLink({organisation, account, token}: - { organisation: string, account: string, token: string }) { +export default function OrganisationMaintainerLink({organisation, name, account, token}: + {organisation: string, name: string, account: string, token: string}) { const {showErrorMessage,showInfoMessage} = useSnackbar() const [magicLink, setMagicLink] = useState(null) const [unusedInvitations, setUnusedInvitations] = useState([]) @@ -81,7 +81,7 @@ export default function OrganisationMaintainerLink({organisation, account, token > + href={`mailto:?subject=Organisation maintainer invite&body=Please use the following link to become a maintainer of the organisation ${name}. \n ${magicLink}`} rel="noreferrer"> Email this invite diff --git a/frontend/components/organisation/maintainers/index.tsx b/frontend/components/organisation/maintainers/index.tsx index 37d6ca5a5..6d319130e 100644 --- a/frontend/components/organisation/maintainers/index.tsx +++ b/frontend/components/organisation/maintainers/index.tsx @@ -1,4 +1,6 @@ // SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all) +// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) +// SPDX-FileCopyrightText: 2022 Netherlands eScience Center // SPDX-FileCopyrightText: 2022 dv4all // // SPDX-License-Identifier: Apache-2.0 @@ -113,6 +115,7 @@ export default function OrganisationMaintainers({organisation, isMaintainer}: /> diff --git a/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx b/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx index 3eccc4385..3bab934b2 100644 --- a/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx +++ b/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx @@ -18,7 +18,7 @@ import InvitationList from '~/components/layout/InvitationList' import {Invitation} from '~/types/Invitation' import {getUnusedInvitations} from '~/utils/getUnusedInvitations' -export default function ProjectMaintainerLink({project,account,token}: { project: string,account:string,token: string }) { +export default function ProjectMaintainerLink({project,title,account,token}: {project: string, title: string, account: string, token: string}) { const {showErrorMessage,showInfoMessage} = useSnackbar() const [magicLink, setMagicLink] = useState(null) const [unusedInvitations, setUnusedInvitations] = useState([]) @@ -80,7 +80,7 @@ export default function ProjectMaintainerLink({project,account,token}: { project > + href={`mailto:?subject=Project maintainer invite&body=Please use the following link to become a maintainer of the project ${title}. \n ${magicLink}`} rel="noreferrer"> Email this invite diff --git a/frontend/components/projects/edit/maintainers/index.tsx b/frontend/components/projects/edit/maintainers/index.tsx index 5182a2591..32b2f680f 100644 --- a/frontend/components/projects/edit/maintainers/index.tsx +++ b/frontend/components/projects/edit/maintainers/index.tsx @@ -1,4 +1,6 @@ // SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all) +// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) +// SPDX-FileCopyrightText: 2022 Netherlands eScience Center // SPDX-FileCopyrightText: 2022 dv4all // // SPDX-License-Identifier: Apache-2.0 @@ -113,6 +115,7 @@ export default function ProjectMaintainers() { /> diff --git a/frontend/components/software/edit/editSoftwareContext.tsx b/frontend/components/software/edit/editSoftwareContext.tsx index 5be72542d..e843d8eb1 100644 --- a/frontend/components/software/edit/editSoftwareContext.tsx +++ b/frontend/components/software/edit/editSoftwareContext.tsx @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all) +// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) // SPDX-FileCopyrightText: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences // SPDX-FileCopyrightText: 2022 Matthias RĂ¼ster (GFZ) +// SPDX-FileCopyrightText: 2022 Netherlands eScience Center // SPDX-FileCopyrightText: 2022 dv4all // // SPDX-License-Identifier: Apache-2.0 @@ -13,7 +15,7 @@ import {EditSoftwareAction, editSoftwareReducer} from './editSoftwareReducer' export type SoftwareInfo = { id: string | null, slug: string | null, - brand_name: string | null, + brand_name: string, concept_doi: string | null, } diff --git a/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx b/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx index f15add212..5aa1ba36d 100644 --- a/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx +++ b/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx @@ -20,7 +20,7 @@ import {Invitation} from '~/types/Invitation' import InvitationList from '~/components/layout/InvitationList' import {getUnusedInvitations} from '~/utils/getUnusedInvitations' -export default function SoftwareMaintainerLink({software,account,token}: { software: string,account:string,token: string }) { +export default function SoftwareMaintainerLink({software,brand_name,account,token}: {software: string, brand_name: string, account: string,token: string}) { const {showErrorMessage,showInfoMessage} = useSnackbar() const [magicLink, setMagicLink] = useState(null) const [unusedInvitations, setUnusedInvitations] = useState([]) @@ -82,7 +82,7 @@ export default function SoftwareMaintainerLink({software,account,token}: { softw > + href={`mailto:?subject=Software maintainer invite&body=Please use the following link to become a maintainer of the software ${brand_name}. \n ${magicLink}`} rel="noreferrer"> Email this invite diff --git a/frontend/components/software/edit/maintainers/index.tsx b/frontend/components/software/edit/maintainers/index.tsx index c2bf8da0c..1a83dfcdb 100644 --- a/frontend/components/software/edit/maintainers/index.tsx +++ b/frontend/components/software/edit/maintainers/index.tsx @@ -1,4 +1,6 @@ // SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all) +// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) +// SPDX-FileCopyrightText: 2022 Netherlands eScience Center // SPDX-FileCopyrightText: 2022 dv4all // // SPDX-License-Identifier: Apache-2.0 @@ -110,6 +112,7 @@ export default function SoftwareMaintainers() { /> diff --git a/frontend/config/userMenuItems.tsx b/frontend/config/userMenuItems.tsx index 57665deda..5a11417b1 100644 --- a/frontend/config/userMenuItems.tsx +++ b/frontend/config/userMenuItems.tsx @@ -9,7 +9,7 @@ import TerminalIcon from '@mui/icons-material/Terminal' import ListAltIcon from '@mui/icons-material/ListAlt' import BusinessIcon from '@mui/icons-material/Business' import ManageAccountsIcon from '@mui/icons-material/ManageAccounts' -import PlaylistAddCheckIcon from '@mui/icons-material/PlaylistAddCheck'; +import PlaylistAddCheckIcon from '@mui/icons-material/PlaylistAddCheck' import Logout from '@mui/icons-material/Logout' import {MenuItemType} from './menuItems' From 2a8a73dfc3359bc748e83a8101281eab02e2d4d1 Mon Sep 17 00:00:00 2001 From: Ewan Cahen Date: Wed, 12 Oct 2022 11:06:26 +0200 Subject: [PATCH 2/2] fix: add name to the subject field in email template and URL encode the newline --- .../organisation/maintainers/OrganisationMaintainerLink.tsx | 2 +- .../projects/edit/maintainers/ProjectMaintainerLink.tsx | 2 +- .../software/edit/maintainers/SoftwareMaintainerLink.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx b/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx index ee99ffd71..612aa3691 100644 --- a/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx +++ b/frontend/components/organisation/maintainers/OrganisationMaintainerLink.tsx @@ -81,7 +81,7 @@ export default function OrganisationMaintainerLink({organisation, name, account, > + href={`mailto:?subject=Maintainer invite for organisation ${encodeURIComponent(name)}&body=Please use the following link to become a maintainer of the organisation ${encodeURIComponent(name)}. ${encodeURIComponent('\n')}${magicLink}`} rel="noreferrer"> Email this invite diff --git a/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx b/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx index 3bab934b2..127d9eafc 100644 --- a/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx +++ b/frontend/components/projects/edit/maintainers/ProjectMaintainerLink.tsx @@ -80,7 +80,7 @@ export default function ProjectMaintainerLink({project,title,account,token}: {pr > + href={`mailto:?subject=Maintainer invite for project ${encodeURIComponent(title)}&body=Please use the following link to become a maintainer of the project ${encodeURIComponent(title)}. ${encodeURIComponent('\n')}${magicLink}`} rel="noreferrer"> Email this invite diff --git a/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx b/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx index 5aa1ba36d..a60c4b23b 100644 --- a/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx +++ b/frontend/components/software/edit/maintainers/SoftwareMaintainerLink.tsx @@ -82,7 +82,7 @@ export default function SoftwareMaintainerLink({software,brand_name,account,toke > + href={`mailto:?subject=Maintainer invite for software ${encodeURIComponent(brand_name)}&body=Please use the following link to become a maintainer of the software ${encodeURIComponent(brand_name)}. ${encodeURIComponent('\n')}${magicLink}`} rel="noreferrer"> Email this invite