-
Notifications
You must be signed in to change notification settings - Fork 23
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
#149760707 Users should be able to read books within the app #55
Conversation
- add styles for pdf viewer - adjust notification section height
* renders reset password form | ||
* | ||
* @param {object} 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.
Trailing spaces not allowed no-trailing-spaces
/** | ||
* renders reset password form | ||
* | ||
* @param {object} 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.
Trailing spaces not allowed no-trailing-spaces
@@ -6,6 +6,13 @@ import Header from '../Header'; | |||
import Loading from '../common/Loading'; | |||
|
|||
|
|||
/** | |||
* renders reset password form | |||
* |
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
* @param {object} 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.
Trailing spaces not allowed no-trailing-spaces
client/components/auth/Password.jsx
Outdated
* @memberof 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.
Trailing spaces not allowed no-trailing-spaces
/** | ||
* renders forgot password form | ||
* | ||
* @param {object} 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.
Trailing spaces not allowed no-trailing-spaces
|
||
/** | ||
* renders forgot password form | ||
* |
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
'templates/images/eloquentjs_cover.png'} | ||
src={(props.cover && | ||
requestImageUrl(props.cover, { width: 80 })) || | ||
BOOK_IMAGE_FALLBACK } |
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.
'BOOK_IMAGE_FALLBACK' is not defined no-undef
/** | ||
* class method that renders a component to the DOM | ||
* |
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
* @param {Object} event DOM onSubmit event | ||
* @return {Undefined} sends a network request | ||
* |
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
sandbox = sandbox.restore(); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
done(); | ||
}); | ||
}); | ||
it('should send a message if an error occured while getting notifications', |
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 a newline after '(' function-paren-newline
assert.equal(res.body.metadata.total, 3); | ||
assert(res.body.notifications.length > 0); | ||
assert.equal(res.body.notifications[0].type, 'return'); | ||
assert.equal(res.body.notifications[0].bookTitle, 'eloquent javascript'); |
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.
Line 36 exceeds the maximum line length of 80 max-len
server.get('/api/v1/books/1') | ||
.expect(500) | ||
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, 'Something went wrong. Internal server error') | ||
assert.equal(res.body.message, | ||
'Something went wrong. Internal server error'); |
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 a newline before ')' function-paren-newline
server.get('/api/v1/books/1') | ||
.expect(500) | ||
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, 'Something went wrong. Internal server error') | ||
assert.equal(res.body.message, |
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 a newline after '(' function-paren-newline
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, | ||
'Something went wrong. Internal server error'); |
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 a newline before ')' function-paren-newline
.expect(500) | ||
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, |
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 a newline after '(' function-paren-newline
Book.findById = () => Promise.reject(1); | ||
}); | ||
describe('deleteBook', () => { | ||
it('should send a message if an error occurs while deleting 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.
Expected a newline after '(' function-paren-newline
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, | ||
'Something went wrong. Internal server error'); |
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 a newline before ')' function-paren-newline
.expect(500) | ||
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, |
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 a newline after '(' function-paren-newline
expect(error.errors[0].path).to.equal('email'); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
}); | ||
}); | ||
|
||
it('should raise validation error if email already exists', |
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 a newline after '(' function-paren-newline
expect(error.errors[0].path).to.equal('email'); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
}); | ||
}); | ||
|
||
it('should raise validation error if email field is missing', |
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 a newline after '(' function-paren-newline
expect(error.errors[0].type).to.equal('notNull Violation'); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
}); | ||
}); | ||
|
||
it('should raise validation error if title field is missing', |
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 a newline after '(' function-paren-newline
'Something went wrong. Internal server error'); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, | ||
'Something went wrong. Internal server error'); |
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 a newline before ')' function-paren-newline
.expect(500) | ||
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, |
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 a newline after '(' function-paren-newline
}); | ||
}); | ||
|
||
it('should send a message if an error occurs while verifying an account', |
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 a newline after '(' function-paren-newline
); | ||
next(); | ||
}); | ||
} | ||
|
||
app.use('/api-docs', express.static(path.join(__dirname, '/docs'))); | ||
|
||
app.use('/', express.static(path.join(__dirname, 'client/static'))); | ||
app.use('/', |
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 a newline after '(' function-paren-newline
@@ -27,32 +27,27 @@ if ( | |||
); | |||
res.header( | |||
'Access-Control-Allow-Headers', | |||
'Authorization, X-PINGOTHER, Origin, X-Requested-With,' + | |||
'Content-Type, Accept, x-access-token' | |||
'Authorization, X-PINGOTHER, Origin, X-Requested-With, Content-Type, Accept, x-access-token' |
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.
Line 30 exceeds the maximum line length of 80 max-len
.click('#borrow-book-2-btn') | ||
.waitForElementVisible('#toast-container') | ||
.assert.urlEquals('http://localhost:8080/library') | ||
.assert.containsText('.toast', 'You currently have this book. Return ' + | ||
'it before trying to borrow it again') | ||
.assert.containsText('.toast', 'You currently have this book. Return it before trying to borrow it again') |
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.
Line 55 exceeds the maximum line length of 80 max-len
.click('#borrow-book-2-btn') | ||
.waitForElementVisible('#toast-container') | ||
.assert.urlEquals('http://localhost:8080/library') | ||
.assert.containsText('.toast', 'You have successfully borrowed ' + | ||
'eloquent ruby again. Check your dashboard to read it') | ||
.assert.containsText('.toast', 'You have successfully borrowed eloquent ruby again. Check your dashboard to read it') |
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.
Line 38 exceeds the maximum line length of 80 max-len
.assert.containsText('.toast', 'You have successfully returned ' + | ||
'eloquent javascript') | ||
.assert.containsText('.toast', | ||
'You have successfully returned eloquent javascript') |
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 a newline before ')' function-paren-newline
event.waitUntil(self.registration.showNotification(title, options)); | ||
}); | ||
|
||
self.addEventListener('fetch', (event) => { |
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 'self' no-restricted-globals
const options = { | ||
body: event.data.text() | ||
}; | ||
event.waitUntil(self.registration.showNotification(title, options)); |
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 'self' no-restricted-globals
workbox.router.registerRoute('/api-docs/', workbox.strategies.networkFirst()); | ||
|
||
|
||
self.addEventListener('push', (event) => { |
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 'self' no-restricted-globals
importScripts('workbox-sw.prod.js'); | ||
|
||
|
||
const workbox = new WorkboxSW({ |
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.
'WorkboxSW' is not defined no-undef
}); | ||
} | ||
} | ||
importScripts('workbox-sw.prod.js'); |
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.
'importScripts' is not defined no-undef
58755e2
to
75b9921
Compare
const email = userData.email; | ||
delete req.body.isAdmin; | ||
const username = req.body.username; | ||
const email = req.body.email; |
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.
Use object destructuring prefer-destructuring
const username = userData.username; | ||
const email = userData.email; | ||
delete req.body.isAdmin; | ||
const username = req.body.username; |
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.
Use object destructuring prefer-destructuring
const defaulters = () => ( | ||
/** | ||
* function for sending emails to defaulters | ||
* |
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
}); | ||
} | ||
return res.status(403).send({ | ||
message: 'This book is currently not on your list.' + | ||
' You have either returned it or never borrowed it' | ||
message: 'This book is currently not on your list. You have either returned it or never borrowed it' |
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.
Line 345 exceeds the maximum line length of 80 max-len
@@ -216,8 +255,7 @@ const bookController = { | |||
.then((borrowed) => { | |||
if (borrowed && borrowed.returned === false) { | |||
return res.status(403).send({ | |||
message: 'You currently have this book.' + | |||
' Return it before trying to borrow it again', | |||
message: 'You currently have this book. Return it before trying to borrow it again', |
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.
Line 258 exceeds the maximum line length of 80 max-len
where: { id }, | ||
returning: true, | ||
plain: true, | ||
}) |
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 a newline before ')' function-paren-newline
message: | ||
'Successfully added new category, ' + | ||
`${category.category}, to Library`, | ||
`Successfully added new category, ${category.category}, to Library`, |
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.
Line 32 exceeds the maximum line length of 80 max-len
</figure> | ||
</div> | ||
</Link> | ||
) : <h5 className="center">Nothing here</h5>; |
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 newline before ')' function-paren-newline
<figcaption> | ||
<h5 className="bold-text">{book.title || ''}</h5 > | ||
</figcaption> | ||
<img src={book.cover || BOOK_IMAGE_FALLBACK} |
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.
'BOOK_IMAGE_FALLBACK' is not defined no-undef
</div>} | ||
<div className="pdf-container"> | ||
file={this.props.bookUrl || BOOK_FALLBACK} |
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.
'BOOK_FALLBACK' is not defined no-undef
…elloBooks into feature/read-book
75b9921
to
72f8980
Compare
'Something went wrong. Internal server error'); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, | ||
'Something went wrong. Internal server error'); |
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 a newline before ')' function-paren-newline
'Something went wrong. Internal server error'); | ||
done(); | ||
}); | ||
}); |
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 a newline before ')' function-paren-newline
.end((err, res) => { | ||
assert.equal(res.status, 500); | ||
assert.equal(res.body.message, | ||
'Something went wrong. Internal server error'); |
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 a newline before ')' function-paren-newline
What does this PR do?
adds the ability to read books within the app
Description of Task to be completed?
Users should be able to read books within the app
How should this be manually tested?
Navigate to the app, click to read a borrowed book from the dashboard
What are the relevant pivotal tracker stories?
#149760707
Screenshots (if appropriate)