-
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.
Merge pull request #322 from wcmc-its/dev_v2_mrj4001
Dev v2 mrj4001
- Loading branch information
Showing
19 changed files
with
634 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
import { Request, Response } from 'express'; | ||
const nodemailer = require("nodemailer"); | ||
const smtpTransport = require("nodemailer-smtp-transport"); | ||
|
||
export async function sendNotification(req) { | ||
console.log("error*************22222222222222222") | ||
|
||
let transporter = nodemailer.createTransport(smtpTransport({ | ||
host: 'smtp.med.cornell.edu', | ||
port: 587, | ||
secure: true, // true for 465, false for other ports | ||
logger: true, | ||
debug: true, | ||
secureConnection: true, | ||
auth: { | ||
user: 'svc_deptdb', | ||
pass: 'Lv173A201!LMtu8Bvp' | ||
}, | ||
tls:{ | ||
rejectUnAuthorized:true, | ||
// ciphers: "SSLv3" | ||
} | ||
})); | ||
// setup email data with unicode symbols | ||
let mailOptions = { | ||
from: 'veenkatesh.mca@gmail.com', // sender address | ||
// to: toEmail, // list of receivers | ||
bcc: "manikya442@gmail.com", | ||
subject: "test email", // Subject line | ||
text: "It is working", // plain text body | ||
// html: body, // html body | ||
|
||
// dsn: { | ||
// id: 'some random message specific id', | ||
// return: 'headers', | ||
// notify: ['failure', 'delay', 'success'], | ||
// recipient: 'info@fankick.io' | ||
// } | ||
}; | ||
|
||
console.log("mailOptions", mailOptions) | ||
// send mail with defined transport object | ||
transporter.sendMail(mailOptions, (error, info) => { | ||
if (error) { | ||
console.log("error*************123", error) | ||
return console.log(error); | ||
} | ||
console.log('Message %s sent: %s', info.messageId, info.response); | ||
console.log('Message Preview Url: %s', info) | ||
}); | ||
} | ||
|
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
9 changes: 9 additions & 0 deletions
9
src/components/elements/Notifications/Notifications.module.css
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,9 @@ | ||
.selectFrequecy{ | ||
width: 300px; | ||
} | ||
.nestedMenu{ | ||
margin-left: 25px; | ||
} | ||
.selectCount{ | ||
width: 80px; | ||
} |
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,61 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import styles from './Notifications.module.css'; | ||
import appStyles from '../App/App.module.css'; | ||
import { useSelector, useDispatch, RootStateOrAny } from "react-redux"; | ||
import Loader from "../Common/Loader"; | ||
import { Form,Button } from "react-bootstrap"; | ||
import { sendNotification } from "../../../redux/actions/actions"; | ||
|
||
const Notifications = () => { | ||
const dispatch = useDispatch() | ||
|
||
useEffect(() => { | ||
|
||
}, []) | ||
|
||
const onSave = ()=>{ | ||
sendNotification(); | ||
} | ||
|
||
return ( | ||
<div className={appStyles.mainContainer}> | ||
<h1 className={styles.header}>Manage Notifications</h1> | ||
<Form.Group className="mb-3" controlId="formBasicCheckbox"> | ||
<Form.Check type="checkbox" label="Disable all notifications" /> | ||
</Form.Group> | ||
|
||
<Form.Label className="fw-bold">Frequency</Form.Label> | ||
<Form.Select aria-label="Default select example" className={styles.selectFrequecy}> | ||
<option>Daily</option> | ||
<option value="1">Every 7 days</option> | ||
<option value="2">Every 14 days</option> | ||
<option value="3">Every 28 days</option> | ||
</Form.Select> | ||
|
||
<div className="mt-5"> | ||
<p className="fw-bold">Reasons for sending a notification</p> | ||
<Form.Group className="mb-3" controlId="formBasicCheckbox"> | ||
<Form.Check type="checkbox" label="A new publication has been accepted on your behalf" /> | ||
</Form.Group> | ||
<Form.Group className="mb-3" controlId="formBasicCheckbox"> | ||
<Form.Check type="checkbox" label="A new publication has been suggested" /> | ||
</Form.Group> | ||
<div className={styles.nestedMenu}> | ||
<Form.Group className="mb-3" controlId="formBasicCheckbox"> | ||
<Form.Check type="checkbox" label="Minimum evidence score for triggering a notification(higher scores indicate greater confidence)" /> | ||
</Form.Group> | ||
<Form.Select aria-label="Default select example" className={styles.selectCount}> | ||
<option>7</option> | ||
<option value="1">One</option> | ||
<option value="2">Two</option> | ||
<option value="3">Three</option> | ||
</Form.Select> | ||
</div> | ||
<p className="mt-3">Emails will be sent to Email</p> | ||
</div> | ||
<Button variant="warning" className="m-2" onClick={()=>onSave()}>Save</Button> | ||
</div> | ||
) | ||
} | ||
|
||
export default Notifications; |
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,32 @@ | ||
import { Modal, Button, Alert } from "react-bootstrap"; | ||
import { ExportButton } from "./ExportButton"; | ||
import Loader from "../Common/Loader"; | ||
import { ExportButtonProps } from "../../../../types/Export"; | ||
|
||
interface ExportModalProps { | ||
title: string, | ||
show: boolean, | ||
handleClose: () => void, | ||
error?: boolean, | ||
} | ||
|
||
const NoAccessModal = ({ show, handleClose, title, error }: ExportModalProps) => { | ||
|
||
return ( | ||
<div> | ||
<Modal show={show}> | ||
{/* <Modal.Header closeButton> | ||
<Modal.Title> {title}</Modal.Title> | ||
</Modal.Header> */} | ||
<Modal.Body > | ||
<p>You do not have sufficient privileges to visit other profiles..</p> | ||
<div className="textAlignCenter"> | ||
<ExportButton title="Ok Continue" onClick={()=> handleClose()}/> | ||
</div> | ||
</Modal.Body> | ||
</Modal> | ||
</div> | ||
) | ||
} | ||
|
||
export default NoAccessModal; |
Oops, something went wrong.