-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from NIAEFEUP/fix/open-email-in-new-tab-admin
open email in new tab for admins
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,11 @@ export const AdminSendEmail = ({ | |
message="" | ||
}: Props) => { | ||
return <> | ||
<a href={`${mailtoStringBuilder(nmec)}?subject=${subject}&[email protected]&body=Viva,%0D%0A%0D%0A ${message} %0D%0A%0D%0ACmpts,%0D%0ADaniel Silva%0D%0A(pela comissão de inscrição em turmas)`}> | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={`${mailtoStringBuilder(nmec)}?subject=${subject}&[email protected]&body=Viva,%0D%0A%0D%0A ${message} %0D%0A%0D%0ACmpts,%0D%0ADaniel Silva%0D%0A(pela comissão de inscrição em turmas)`} | ||
> | ||
<Button | ||
variant="secondary" | ||
> | ||
|
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 |
---|---|---|
|
@@ -29,6 +29,9 @@ const rejectRequest = async ( | |
await exchangeRequestService.adminRejectExchangeRequest(requestType, id); | ||
|
||
const a = document.createElement('a'); | ||
a.target = "_blank"; | ||
a.rel = "noopener noreferrer"; | ||
|
||
if(requestType === AdminRequestType.DIRECT_EXCHANGE || requestType === AdminRequestType.URGENT_EXCHANGE) { | ||
a.href = `${mailtoStringBuilder(nmecs)}?subject=Pedido de Alteração de Turma&[email protected]&body=Viva,%0D%0A%0D%0AA alteração pedida não pode ser efetuada.%0D%0A${exchangeMessage}%0D%0A%0D%0ACmpts,%0D%0ADaniel Silva%0D%0A(pela comissão de inscrição em turmas)`; | ||
} else { | ||
|
@@ -51,11 +54,14 @@ const acceptRequest = async ( | |
await exchangeRequestService.adminAcceptExchangeRequest(requestType, id); | ||
|
||
const a = document.createElement('a'); | ||
a.target = "_blank"; | ||
a.rel = "noopener noreferrer"; | ||
if(requestType === AdminRequestType.DIRECT_EXCHANGE || requestType === AdminRequestType.URGENT_EXCHANGE) { | ||
a.href = `${mailtoStringBuilder(nmecs)}?subject=Pedido de Troca de Turma&[email protected]&body=Viva,%0D%0A%0D%0AA alteração pedida foi efetuada.%0D%0A${exchangeMessage}%0D%0A%0D%0ACmpts,%0D%0ADaniel Silva%0D%0A(pela comissão de inscrição em turmas)`; | ||
} else { | ||
a.href = `${mailtoStringBuilder(nmecs)}?subject=Pedido de Inscrição em Unidades Curriculares&[email protected]&body=Viva,%0D%0A%0D%0AA alteração pedida foi efetuada.%0D%0A${exchangeMessage}%0D%0A%0D%0ACmpts,%0D%0ADaniel Silva%0D%0A(pela comissão de inscrição em turmas)`; | ||
} | ||
|
||
a.click(); | ||
} catch (e) { | ||
console.error(e); | ||
|