Skip to content
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

#152539728 UI redesign of main page #27

Merged

Conversation

benfluleck
Copy link
Owner

@benfluleck benfluleck commented Nov 13, 2017

What does this PR do?

  • This PR implements the change in main page UI
  • Changed in routes to accommodate token coming from client
  • Refactored code to pass new route test

Description of Task to be completed?

  • Redesign main page with a main tab serving the main page with books borrowed by the user, all books and books history.

How should this be manually tested?

Screenshots (if appropriate):

screen shot 2017-11-13 at 10 24 06 pm

screen shot 2017-11-13 at 10 24 41 pm

#### Any background context you want to provide? - Materialize ccss, - React tabs

What are the relevant pivotal tracker stories?

152686714

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New chore (expected functionality to be implemented)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Benny Ogidan added 6 commits November 12, 2017 16:15
- Group components in folders
- Token decoded at the server side
- Welcome message for unauthenticated users implemented
- User Book Routes refactored to reflect change in routes
- Borrowed books displayed
- fetchbook by User id implemented
- Implemented pagination
- Implemented Display for Userbooks

};
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon semi

getJWT,
authenticate,
authenticate,
decodeToken

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

getJWT,
authenticate,
authenticate,

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

});


module.exports = {
module.exports ={

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infix operators must be spaced space-infix-ops

} else if (token) {
resolve({status: 'Success', token});
} else {
reject(new Error({status: 'Error', message: 'Error generating token'}));

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 '{' object-curly-spacing
A space is required before '}' object-curly-spacing

const token = req.headers['x-access-token'] || req.headers.authorization;
if (token) {
jwt.verify(token, process.env.JWT_SECRET, (error, decoded) => {
if (error) {
return res
.status(401)
.json({ message: 'Unauthorised access' });
.json({token:null, message: 'Unauthorised access'});

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 '{' object-curly-spacing
Missing space before value for key 'token' key-spacing
A space is required before '}' object-curly-spacing

@@ -10,61 +10,63 @@ import jwt from 'jsonwebtoken';
* @return {undefined} if not defined send a response to the server indicating this
*/
const authenticate = (req, res, next) => {
if (req.url.startsWith('/auth')) return next();
if (req.url.startsWith('/auth'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected { after 'if' condition curly

@@ -1,5 +1,5 @@
import jwt from 'jsonwebtoken';

import jwtDecode from 'jwt-decode';

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 'jwt-decode' import/no-unresolved
Missing file extension for "jwt-decode" import/extensions

@@ -22,6 +22,7 @@ import {
*/
export default function bookReducer (state = {
books: [],
borrowedbooks:[],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before value for key 'borrowedbooks' key-spacing

}
return JSON.parse(serializedState);
} catch (error) {
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary return statement no-useless-return

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 92.526% when pulling f541fa3 on feature/152539728/ui-redesign-for-sign-in-page into 664b850 on development.

@benfluleck benfluleck merged commit cdcc563 into development Nov 13, 2017
@benfluleck benfluleck deleted the feature/152539728/ui-redesign-for-sign-in-page branch December 13, 2017 12:37
@benfluleck benfluleck changed the title UI redesign of main page #152539728 UI redesign of main page Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants