-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User should be informed when books are overdue #33
User should be informed when books are overdue #33
Conversation
- Eslint changes to the updated files
-Changes to the loading of the borrowed books
- api route constructed for overdue books - If the return date has passed then the user can retrieve a list of the books
- Users can now see books that thet have not returned on time - Users can return books from the Overdue books interface.
- Users are inform by email when they have overdue books with the title of the book. - Scheduler to send email daily to inform the user on their overdue books. [Delivers #153101662] - Changes to schedule fix (Clear cache): Cache cleared - DS_Store and vscode removed
server/src/routes/index.js
Outdated
|
||
Router.get('/users/borrowedbooks', authdecodeToken, UserBooksController.getborrowedBooklist); | ||
Router.get('/users/getoverduebooks', authdecodeToken, UserBooksController.getOverdueBooks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
server/src/mailer/mailer.js
Outdated
bcc, | ||
subject, | ||
html, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 0 spaces but found 2 indent
server/src/mailer/mailer.js
Outdated
to, | ||
bcc, | ||
subject, | ||
html, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
server/src/mailer/mailer.js
Outdated
from: 'Mailer from library.com', | ||
to, | ||
bcc, | ||
subject, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
server/src/mailer/mailer.js
Outdated
export const mailOptions = (to, bcc, subject, html) => ({ | ||
from: 'Mailer from library.com', | ||
to, | ||
bcc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
server/src/mailer/mailer.js
Outdated
service: 'gmail', | ||
auth: { | ||
user: process.env.EMAIL_ADDRESS, | ||
pass: process.env.EMAIL_PASSWORD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 6 indent
server/src/mailer/mailer.js
Outdated
export const transporter = nodemailer.createTransport({ | ||
service: 'gmail', | ||
auth: { | ||
user: process.env.EMAIL_ADDRESS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 6 indent
server/src/mailer/mailer.js
Outdated
|
||
export const transporter = nodemailer.createTransport({ | ||
service: 'gmail', | ||
auth: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
server/src/mailer/mailer.js
Outdated
require('dotenv').config(); | ||
|
||
export const transporter = nodemailer.createTransport({ | ||
service: 'gmail', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
server/src/mailer/mailer.js
Outdated
import nodemailer from 'nodemailer'; | ||
require('dotenv').config(); | ||
|
||
export const transporter = nodemailer.createTransport({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 0 spaces but found 2 indent
numberOfRecords={this.state.limit} | ||
fetch={this.props.fetchAllBooksbyId} | ||
/> | ||
</div>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected closing tag to match indentation of opening react/jsx-closing-tag-location
fetch={this.props.fetchAllBooksbyId}/> | ||
|
||
</div>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed no-trailing-spaces
/> | ||
); | ||
}); | ||
const getAllBooks = this.props.borrowedBooks.books.map(book => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'borrowedBooks.books.map' is missing in props validation react/prop-types
import Book from '../../presentation/common/book/DisplayBook.jsx'; | ||
import { Preloader, Row, Col } from 'react-materialize'; | ||
import PaginationWrapper from '../common/Pagination.jsx'; | ||
import Book from '../../presentation/common/book/DisplayBook.jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module '../../presentation/common/book/DisplayBook.jsx' import/no-unresolved
Unexpected use of file extension "jsx" for "../../presentation/common/book/DisplayBook.jsx" import/extensions
import PaginationWrapper from '../common/Pagination.jsx' | ||
import Book from '../../presentation/common/book/DisplayBook.jsx'; | ||
import { Preloader, Row, Col } from 'react-materialize'; | ||
import PaginationWrapper from '../common/Pagination.jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of file extension "jsx" for "../common/Pagination.jsx" import/extensions
Unable to resolve path to module '../common/Pagination.jsx' import/no-unresolved
* @returns {object} component | ||
*/ | ||
render() { | ||
if (!this.props.overdueBooks || this.props.overdueBooks.books.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'overdueBooks' is missing in props validation react/prop-types
'overdueBooks.books' is missing in props validation react/prop-types
'overdueBooks.books.length' is missing in props validation react/prop-types
<div className="pre-loader"> | ||
{this.state.isLoading && <Preloader size="big" />} | ||
</div>; | ||
this.props.fetchOverdueBookstoDashboard (this.state.offset, this.state.limit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fetchOverdueBookstoDashboard' is missing in props validation react/prop-types
Unexpected space between function name and paren no-spaced-func
Unexpected space between function name and paren func-call-spacing
Irregular whitespace not allowed no-irregular-whitespace
* @returns {void} | ||
*/ | ||
componentDidMount() { | ||
<div className="pre-loader"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression no-unused-expressions
* @extends {Component} | ||
*/ | ||
class DisplayOverdueBooks extends React.Component { | ||
constructor(props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing JSDoc comment require-jsdoc
import PaginationWrapper from '../common/Pagination.jsx'; | ||
import Book from '../../presentation/common/book/DisplayBook.jsx'; | ||
import { fetchOverdueBookstoDashboard } from '../../../actions/fetchbooks'; | ||
import MessageforNoOverdueBooks from '../../presentation/messages/dashboardMessages/MessageforNoOverdueBooks.jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of file extension "jsx" for "../../presentation/messages/dashboardMessages/MessageforNoOverdueBooks.jsx" import/extensions
Unable to resolve path to module '../../presentation/messages/dashboardMessages/MessageforNoOverdueBooks.jsx' import/no-unresolved
fixed coverage score by implementing exclude bloack for nyc
@@ -0,0 +1,14 @@ | |||
import nodemailer from 'nodemailer'; | |||
require('dotenv').config(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module 'dotenv' import/no-unresolved
@@ -0,0 +1,14 @@ | |||
import nodemailer from 'nodemailer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected empty line after import statement not followed by another import import/newline-after-import
Unable to resolve path to module 'nodemailer' import/no-unresolved
Missing file extension for "nodemailer" import/extensions
.catch((error) => { | ||
process.stdout.write(error.stack); | ||
process.exit(0); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 0 indent
}) | ||
.catch((error) => { | ||
process.stdout.write(error.stack); | ||
process.exit(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 2 indent
}); | ||
}) | ||
.catch((error) => { | ||
process.stdout.write(error.stack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 2 indent
Trailing spaces not allowed no-trailing-spaces
emails.forEach((email,index) => { | ||
const to = email; | ||
const bcc = null; | ||
const subject = "Default on Returning Book"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use singlequote quotes
bookTitles.push(book.book.title); | ||
}); | ||
|
||
emails.forEach((email,index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required after ',' comma-spacing
where: { | ||
returnstatus: false, | ||
returndate: { | ||
$lt: Date.now() - 24 * 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected mix of '-' and '*' no-mixed-operators
@@ -0,0 +1,63 @@ | |||
import moment from 'moment'; | |||
import model from '../models'; | |||
import { transporter, mailOptions } from '../mailer/mailer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module '../mailer/mailer' import/no-unresolved
Missing file extension for "../mailer/mailer" import/extensions
@@ -0,0 +1,63 @@ | |||
import moment from 'moment'; | |||
import model from '../models'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module '../models' import/no-unresolved
Missing file extension for "../models" import/extensions
@@ -0,0 +1,14 @@ | |||
import nodemailer from 'nodemailer'; | |||
require('dotenv').config(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module 'dotenv' import/no-unresolved
@@ -0,0 +1,14 @@ | |||
import nodemailer from 'nodemailer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected empty line after import statement not followed by another import import/newline-after-import
Unable to resolve path to module 'nodemailer' import/no-unresolved
Missing file extension for "nodemailer" import/extensions
.catch((error) => { | ||
process.stdout.write(error.stack); | ||
process.exit(0); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 0 indent
}) | ||
.catch((error) => { | ||
process.stdout.write(error.stack); | ||
process.exit(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 2 indent
}); | ||
}) | ||
.catch((error) => { | ||
process.stdout.write(error.stack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 2 indent
Trailing spaces not allowed no-trailing-spaces
emails.forEach((email,index) => { | ||
const to = email; | ||
const bcc = null; | ||
const subject = "Default on Returning Book"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use singlequote quotes
bookTitles.push(book.book.title); | ||
}); | ||
|
||
emails.forEach((email,index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required after ',' comma-spacing
where: { | ||
returnstatus: false, | ||
returndate: { | ||
$lt: Date.now() - 24 * 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected mix of '-' and '*' no-mixed-operators
@@ -0,0 +1,63 @@ | |||
import moment from 'moment'; | |||
import model from '../models'; | |||
import { transporter, mailOptions } from '../mailer/mailer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module '../mailer/mailer' import/no-unresolved
Missing file extension for "../mailer/mailer" import/extensions
@@ -0,0 +1,63 @@ | |||
import moment from 'moment'; | |||
import model from '../models'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module '../models' import/no-unresolved
Missing file extension for "../models" import/extensions
Description
Users should be informed that books are overdue. This has been implemented through the client side and email notifications.
What does this PR do?
Screenshots (if appropriate):
Any background context you want to provide?
What are the relevant pivotal tracker stories?
https://www.pivotaltracker.com/story/show/153101662
Types of changes
Checklist: