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

FIXES: fix lint issues Fixes: #1106

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
{
"extends": ["taller/react"],
"extends": [
"taller/react",
"eslint:recommended",
"plugin:react/recommended"
],
"globals": {
"DEV": false,
"MOCK_GRAPHQL__": false,
"drupalSettings": false,
"xdescribe": false,
"xit": false
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect" // Automatically detect the React version
}
},
"rules": {
"no-mixed-operators": 0,
"import/first": 0,
"prefer-promise-reject-errors": 0,
"react/prop-types": 0,
"react/jsx-no-bind": 0
"react/jsx-no-bind": 0,
"react/jsx-indent-props": ["error", 2] // Enforce 2-space indentation for JSX props
// Add any additional rules specific to your project
}
}
6 changes: 3 additions & 3 deletions config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ passport.use(
return done(null, false)
}
catch (err) {
console.log('err', err)
return done(err)
};
// console.log('err', err)
// return done(err)
Copy link
Member

Choose a reason for hiding this comment

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

you're commenting here a line that can affect the tests besides the console, please don't do so.

You can remove the console and keep the line with the return

}
})
)

Expand Down
4 changes: 2 additions & 2 deletions cron.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ const dailyJob = new CronJob({
// Seconds: 0-59 Minutes: 0-59 Hours: 0-23 Day of Month: 1-31 Months: 0-11 (Jan-Dec) Day of Week: 0-6 (Sun-Sat)
cronTime: '0 0 0 * * *', // everyday at 12:00AM
onTick: () => {
//TaskCron.rememberDeadline()
//OrderCron.verify()
// TaskCron.rememberDeadline()
// OrderCron.verify()
OrderCron.checkExpiredPaypalOrders()
}
})
Expand Down
36 changes: 18 additions & 18 deletions cron/orderCron.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ const OrderCron = {
},
checkExpiredPaypalOrders: async () => {
const orders = await models.Order.findAll({ where: {
status: {
[Op.eq]: 'succeeded'
},
provider: {
[Op.eq]: 'paypal'
},
paid: {
[Op.eq]: true
}
status: {
[Op.eq]: 'succeeded'
},
provider: {
[Op.eq]: 'paypal'
},
include: [ models.User, models.Task ]
paid: {
[Op.eq]: true
}
},
include: [ models.User, models.Task ]
})
if (orders[0]) {
try {
Expand Down Expand Up @@ -81,27 +81,27 @@ const OrderCron = {
}).then(result => {
return JSON.parse(result)
}).catch(e => {
console.log('error on order details', e.error)
// console.log('error on order details', e.error)
return JSON.parse(e.error)
})
const orderDetailsResult = await orderDetails()
if(orderDetailsResult["name"] === 'RESOURCE_NOT_FOUND') {
const orderDetailsResult = await orderDetails()
if (orderDetailsResult['name'] === 'RESOURCE_NOT_FOUND') {
return models.Order.update({ status: 'expired', paid: false }, { where: { id: o.dataValues.id } }).then(orderUpdated => {
if(orderUpdated[0] === 1) {
if (orderUpdated[0] === 1) {
orderMail.expiredOrders(order)
return;
Copy link
Member

Choose a reason for hiding this comment

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

you removed a return statement needed here

}
})
}
}
}
})
} catch (e) {
console.log('error', e)
}
catch (e) {
// console.log('error', e)
}
}
return orders
}
}

module.exports = OrderCron
module.exports = OrderCron
1 change: 1 addition & 0 deletions frontend/src/actions/loginActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export const searchUser = data => {
}
})
.catch(error => {
// eslint-disable-next-line no-console
console.log('error', error)
dispatch(addNotification('user.search.error'))
dispatch(searchUserError(error))
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/actions/orderActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const updateOrderError = error => {
return { type: UPDATE_ORDER_ERROR, completed: true, error: error }
}


/*
* Order pay
*/
Expand Down Expand Up @@ -339,7 +338,7 @@ const cancelOrder = id => {
return axios
.post(api.API_URL + '/orders/cancel', { id })
.then(order => {
console.log('order cancel data', order)
// console.log('order cancel data', order)
if (order.data) {
dispatch(addNotification('actions.order.cancel.success'))
dispatch(cancelOrderSuccess(order))
Expand All @@ -351,7 +350,7 @@ const cancelOrder = id => {
}
})
.catch(e => {
console.log('error', e)
// console.log('error', e)
dispatch(
addNotification(
'actions.order.cancel.payment.error'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/actions/taskSolutionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getTaskSolution = (userId, taskId) => {
return dispatch(getTaskSolutionSuccess(response.data))
}).catch(error => {
if (error) {
console.log('error', error)
// console.log('error', error)
dispatch(addNotification(ERRORS[error]))
return dispatch(getTaskSolutionError(error))
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/actions/transferActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const fetchTransferSuccess = (data) => {

const fetchTransferFailed = (error) => {
return {
type: FETCH_TRANSFER,
type: FETCH_TRANSFER_FAILED,
Copy link
Member

Choose a reason for hiding this comment

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

great catch 💯

error: error,
completed: true
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/bank-codes-br.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default BANK_CODES = {
const BANK_CODES = {
'110': 'BANCO PARA TESTE STRIPE',
'260': 'NUBANK',
'001': 'BANCO DO BRASIL S.A. (Banco do Brasil)',
Expand Down Expand Up @@ -42,3 +42,5 @@ export default BANK_CODES = {
'212': 'BANCO ORIGINAL',
'085': 'CECRED-COOPERATIVA CENTRAL DE CREDITO URBANO'
}

export default BANK_CODES
103 changes: 50 additions & 53 deletions frontend/src/components/Cards/TeamCard.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react'
import { makeStyles } from '@material-ui/core/styles'
import { FormattedMessage } from 'react-intl'
import Card from '@material-ui/core/Card'
import CardActionArea from '@material-ui/core/CardActionArea'
import CardActions from '@material-ui/core/CardActions'
import CardContent from '@material-ui/core/CardContent'
import CardMedia from '@material-ui/core/CardMedia'
import Button from '@material-ui/core/Button'
import Typography from '@material-ui/core/Typography'
import LinkedInIcon from '@material-ui/icons/LinkedIn'
import GitHubIcon from '@material-ui/icons/GitHub'
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { FormattedMessage } from 'react-intl';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import CardMedia from '@material-ui/core/CardMedia';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import LinkedInIcon from '@material-ui/icons/LinkedIn';
import GitHubIcon from '@material-ui/icons/GitHub';

const useStyles = makeStyles(theme => ({
wrapper: {
Expand Down Expand Up @@ -38,11 +38,11 @@ const useStyles = makeStyles(theme => ({
media: {
height: 220,
},
}))
}));

export default function TeamCard (props) {
const { data } = props
const classes = useStyles()
export default function TeamCard(props) {
const { data } = props;
const classes = useStyles();

return (
<div className={ classes.wrapper }>
Expand All @@ -53,43 +53,40 @@ export default function TeamCard (props) {
/>
</Typography>
<div className={ classes.root }>
{ data && data.map(member => {
return (
<Card className={ classes.card }>
<CardActionArea>
<CardMedia
className={ classes.media }
image={ member.image }
title={ member.name }
/>
<CardContent>
<Typography gutterBottom variant='h5' component='h2'>
{ member.name }
</Typography>
<Typography variant='body2' color='textSecondary' style={ { whiteSpace: 'initial' } }>
{ member.description }
</Typography>
</CardContent>
</CardActionArea>
<CardActions style={ { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }>
{ member.linkedinUrl &&
<Button target='_blank' href={ member.linkedinUrl } size='small' color='secondary' variant='outlined'>
<span>Linkedin</span>
<LinkedInIcon />
</Button>
}
{ member.githubUrl &&
<Button target='_blank' href={ member.githubUrl } size='small' variant='outlined'>
<span>Github&thinsp;</span>
<GitHubIcon />
</Button>
}
</CardActions>
</Card>
)
})
}
{ data && data.map((member, index) => (
<Card className={ classes.card } key={ index }>
<CardActionArea>
<CardMedia
className={ classes.media }
image={ member.image }
title={ member.name }
/>
<CardContent>
<Typography gutterBottom variant='h5' component='h2'>
{ member.name }
</Typography>
<Typography variant='body2' color='textSecondary' style={ { whiteSpace: 'initial' } }>
{ member.description }
</Typography>
</CardContent>
</CardActionArea>
<CardActions style={ { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }>
{ member.linkedinUrl &&
<Button target='_blank' href={ member.linkedinUrl } size='small' color='secondary' variant='outlined'>
<span>Linkedin</span>
<LinkedInIcon />
</Button>
}
{ member.githubUrl &&
<Button target='_blank' href={ member.githubUrl } size='small' variant='outlined'>
<span>Github&thinsp;</span>
<GitHubIcon />
</Button>
}
</CardActions>
</Card>
)) }
</div>
</div>
)
);
}
6 changes: 5 additions & 1 deletion frontend/src/components/FourOFour.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Block } from '@material-ui/icons'
import { Link } from '@material-ui/core'
import { FormattedMessage } from 'react-intl'

export default () => {
const FourOFour = () => {
return (
<div style={ {
margin: 'auto',
Expand Down Expand Up @@ -47,3 +47,7 @@ export default () => {
</div>
)
}

FourOFour.displayName = 'FourOFour'; // Add displayName

export default FourOFour;
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const renderCustomizedLabel = ({
</text>
)
}

export default class LabelPieCharts extends PureComponent {
render () {
return (
Expand All @@ -43,7 +44,7 @@ export default class LabelPieCharts extends PureComponent {
label={ renderCustomizedLabel }
>
{
data.map((entry, index) => <Cell fill={ COLORS[(COLORS.length - index) % COLORS.length] } />)
data.map((entry, index) => <Cell key={ `cell-${index}` } fill={ COLORS[index % COLORS.length] } />)
}
</Pie>
</PieChart>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const renderCustomizedLabel = ({
</text>
)
}

export default class LabelPieCharts extends PureComponent {
render () {
return (
Expand All @@ -43,7 +44,7 @@ export default class LabelPieCharts extends PureComponent {
label={ renderCustomizedLabel }
>
{
data.map((entry, index) => <Cell fill={ COLORS[(COLORS.length - index) % COLORS.length] } />)
data.map((entry, index) => <Cell key={ `cell-${index}` } fill={ COLORS[(COLORS.length - index) % COLORS.length] } />)
}
</Pie>
</PieChart>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ const renderCustomizedLabel = ({
</text>
)
}

export default class LabelPieCharts extends PureComponent {
render () {
render() {
return (
<PieChart width={ 800 } height={ 400 } style={ { height: '100px', alignItems: 'center', margin: 'auto', marginLeft: '5.8em', display: `${this.props.display}` } } >
<PieChart width={ 800 } height={ 400 } style={ { height: '100px', alignItems: 'center', margin: 'auto', marginLeft: '5.8em', display: `${this.props.display}` } }>
<Pie
style={ { backgroundColor: 'blue' } }
data={ data }
Expand All @@ -42,7 +43,7 @@ export default class LabelPieCharts extends PureComponent {
label={ renderCustomizedLabel }
>
{
data.map((entry, index) => <Cell fill={ COLORS[(COLORS.length - index) % COLORS.length] } />)
data.map((entry, index) => <Cell key={ `cell-${index}` } fill={ COLORS[index % COLORS.length] } />)
}
</Pie>
</PieChart>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/bottom/bottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Bottom extends Component {
defaultMessage='is part of'
/>
</Typography>
<a href='http://worknenjoy.com' target='_blank'>
<a href='http://worknenjoy.com' target='_blank' rel="noreferrer">
<img className={ classes.img } src={ logoWorknEnjoy } width='100' />
</a>
</BaseFooter>
Expand Down
Loading