Skip to content

#154672011 - feedback implementation - #86

Open
fuchodeveloper wants to merge 35 commits into
masterfrom
chore/154672011/feedback-implementation
Open

#154672011 - feedback implementation#86
fuchodeveloper wants to merge 35 commits into
masterfrom
chore/154672011/feedback-implementation

Conversation

@fuchodeveloper

Copy link
Copy Markdown
Owner

Description of Task to be completed?

  • Code review feedback implementation

How should this be manually tested?

  • Clone the project locally from git clone https://github.com/fuchodeveloper/more-recipes.git
  • Open the project in your terminal
  • Install all the necessary dependencies as stated in the README file
  • Run app locally using $ npm run start:dev
  • Navigate to homepage http://localhost:8000
  • Sign up or sign in
  • Navigate to add recipe page from the navigation bar
  • Go ahead to create recipes

Any background context you want to provide?

  • User is required to be authenticated in order to perform privileged actions such as creating recipes

What are the relevant pivotal tracker stories?

  • story type: chore
  • story id: 154672011
  • story title: Code review feedback implementation

Questions:

N/A

fuchodeveloper and others added 30 commits November 12, 2017 10:22
 #152782762 review api endpoints and refactor where necessary - start implementing refactored API documentation
- code cleanup
- add hound.yml file
- refactore docs server host
- check status codes
- refactor function names to fit convention
implement code review feedback
add faker for tests
refactor up upvotes action
refactor get all recipes and sort recipes route
- follow conventions in app
setup test config for local and remote test
global loader type for components
feedback and initial frontend implementation
…t-app-pagination

#151251426 - User should be able to navigate the app using pagination
…-favorited-recipes

#151246935 - User should be able to retrieve favorited recipes
…onventions and best practices

Finishes #154322898
…pp-conventions

#154322898 - refactor app conventions
- create production configuration for webpack
- update app entry file to use production configuration
- files refactoring
@@ -0,0 +1,27 @@
import isEmpty from 'lodash/isEmpty';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,154 @@
import React, { Component } from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,299 @@
/* eslint-disable no-undef */
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,24 @@
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,188 @@
// /* eslint-disable */
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,43 @@
import axios from 'axios';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,30 @@
import axios from 'axios';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,37 @@
import axios from 'axios';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,55 @@
import { batchActions } from 'redux-batched-actions';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,30 @@
import axios from 'axios';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@fuchodeveloper
fuchodeveloper temporarily deployed to more-recipes-application January 26, 2018 19:00 Inactive
@fuchodeveloper
fuchodeveloper temporarily deployed to more-recipes-application January 26, 2018 19:11 Inactive
@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from 1536ceb to dab1219 Compare January 27, 2018 00:40
@@ -0,0 +1,25 @@
import validator from 'validator';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Comment thread server/config/config.js
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE_LOCAL_TEST,
host: process.env.DB_HOST,
port: process.env.DB_PORT,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'process' is not defined no-undef

Comment thread server/config/config.js
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE_LOCAL_TEST,
host: process.env.DB_HOST,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'process' is not defined no-undef

Comment thread server/config/config.js
test_dev: {
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE_LOCAL_TEST,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'process' is not defined no-undef

Comment thread server/config/config.js
},
test_dev: {
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'process' is not defined no-undef

@@ -1,76 +1,140 @@
import jwtDecode from 'jwt-decode';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Comment thread e2e-tests/index.test.js
@@ -0,0 +1,16 @@
module.exports = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'module' is not defined no-undef

@@ -0,0 +1,37 @@
import validator from 'validator';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,38 @@
/* eslint-disable max-len */
import expect from 'expect';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,69 @@
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from dab1219 to a876603 Compare January 27, 2018 06:51
@@ -0,0 +1,37 @@
import validator from 'validator';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Comment thread webpack.config.prod.js
devtool: 'source-map',
entry: [path.join(__dirname, './client/index.js')],
output: {
path: path.join(__dirname, 'dist'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'__dirname' is not defined no-undef

Comment thread webpack.config.prod.js
module.exports = {

devtool: 'source-map',
entry: [path.join(__dirname, './client/index.js')],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'__dirname' is not defined no-undef

Comment thread webpack.config.prod.js
}
});

module.exports = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'module' is not defined no-undef

Comment thread webpack.config.prod.js
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'require' is not defined no-undef

};
};

export default validateId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use Number.isNaN in stead of NaN (line 8)

@@ -0,0 +1,63 @@
import faker from 'faker';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,260 @@
import chai, { expect } from 'chai';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Comment thread server/test/index.spec.js
@@ -0,0 +1,3 @@
import './usersController.spec';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,81 @@
import chai, { expect } from 'chai';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from a876603 to 31ceccc Compare January 27, 2018 06:58
@@ -0,0 +1,52 @@
import validator from 'validator';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,82 @@
/* eslint-disable react/jsx-filename-extension */
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from 31ceccc to 761882b Compare January 27, 2018 07:02
@@ -0,0 +1,148 @@
import React, { Component } from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,140 @@
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@segunolalive segunolalive left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Greate job.

See comments.

Also, when exporting singletons/bare-objects as in the case of your controllers, use Pascal case naming

Comment thread .babelrc Outdated
]
],
"plugins": ["transform-object-rest-spread", "emotion"]
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's good practice to end files with a blank line.

Without a blank line at the end, a shell script might be unable to read the last line of code.

Comment thread .env Outdated
@@ -1,2 +0,0 @@
SECRET_TOKEN=supersecret
DB_URL=postgres://xouvfgrs:MIhorjtYuPrb4yJRSgwELbJPytZb0PJ_@elmer.db.elephantsql.com:5432/xouvfgrs No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as above. Fix all occurrences where the EOF empty line is missing

Comment thread README.md
<p align="center">
<img src="https://travis-ci.org/fuchodeveloper/more-recipes.svg?branch=master" alt="travis ci build test badge" />
<a href='https://coveralls.io/github/fuchodeveloper/more-recipes?branch=master'><img src='https://coveralls.io/repos/github/fuchodeveloper/more-recipes/badge.svg?branch=master' alt='Coverage Status' /></a>
<img src="https://travis-ci.org/fuchodeveloper/more-recipes.svg?branch=develop" alt="travis ci build test badge" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's not advisable to use mark up in your markdown files. Change these to appropriate markdown syntax

Comment thread README.md Outdated
</p>

## More-recipes
## More-recipes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The first markdown tag should correspond to an h1 tag. That is, # and is preferably placed at the top of the file

* @export setCurrentUserError
* @param {object} error - the error that occurred while signing up
*
* @returns {object} error - the error details from the server

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can only have one return value. You are using a wrong jsdoc syntax to document object property types.

Take a look at this

import Adapter from 'enzyme-adapter-react-16';
import expect from 'expect';
import { LoginPage } from '../../../components/auth/LoginPage';
// import mockLocalStorage from '../../__mocks__/mockLocalStorage';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

dead code

Comment thread selenium-debug.log
@@ -0,0 +1,64 @@
13:00:57.528 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this should not be in version control

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should not in version control

ingredient: request.body.ingredient.trim().toLowerCase(),
recipeDirection: request.body.recipeDirection.trim().toLowerCase(),
recipeImage: request.body.recipeImage
name: request.body.name.trim().toLowerCase(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good place to use object destructuring syntax

recipeDirection: body.recipeDirection.trim().toLowerCase(),
recipeImage: body.recipeImage
name: name ? name : recipe.name,
ingredients: ingredients ? ingredients : recipe.body,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you can use the logical OR operator here. ||

@segunolalive

Copy link
Copy Markdown

Fix Hound CI issues as well

@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from 761882b to 8b436bc Compare January 28, 2018 22:51
@@ -0,0 +1,171 @@
import chai, { expect } from 'chai';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,118 @@
import chai, { expect } from 'chai';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from 8b436bc to 1443a9e Compare January 28, 2018 23:22
@@ -0,0 +1,94 @@
import chai, { expect } from 'chai';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,177 @@
import { mapKeys } from 'lodash';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,326 @@
/* eslint-disable no-undef */
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,14 @@
import { SET_FETCHING, UNSET_FETCHING } from '../action/types';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,59 @@
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,231 @@
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch 3 times, most recently from a334ae0 to 67d15bf Compare January 28, 2018 23:42
@@ -0,0 +1,47 @@
import expect from 'expect';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

- refactor serverside files: usersController, favoritesController, votesController, recipesController
- update users model file: changed recipes model coulmn names to singular names
- update backend tests for: usersController, favoritesController, recipesController, votesController
- update project JSDoc conventions
- remove console logs and dev comments
- changed votesController logic to make more readable
- changed recipe placeholder image
- added validations: for recipes, users
- removed logged files
- refactor config.js file to use environment variables
- update codeclimate.yml file with new config
- add parserOption to .eslintrc file
- implement more feedback from fellow reviews
@fuchodeveloper
fuchodeveloper force-pushed the chore/154672011/feedback-implementation branch from 67d15bf to 3ebb38f Compare January 28, 2018 23:45
@@ -0,0 +1,36 @@
/* eslint-disable react/jsx-filename-extension */
import React from 'react';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,11 @@
import expect from 'expect';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,38 @@
/* eslint-disable max-len */
import expect from 'expect';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,10 @@
const localStorage = {};

export default {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@@ -0,0 +1,30 @@
import {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'


};

export default mockData;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

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.

3 participants