Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
fixed build because of meant eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ledoux committed Mar 13, 2019
1 parent 44d66f4 commit fe63b2a
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 31 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"moment-timezone": "^0.5.21",
"node-fetch": "^2.3.0",
"object-assign": "4.1.1",
"pass-culture-shared": "0.1.0-alpha3",
"pass-culture-shared": "0.1.0-alpha5",
"phonegap-build-api": "^0.4.0",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.8",
Expand Down Expand Up @@ -70,7 +70,7 @@
"redux": "^3.6.0",
"redux-persist": "^5.10.0",
"redux-saga": "^0.15.3",
"redux-saga-data": "^1.4.0",
"redux-saga-data": "^1.5.0",
"reselect": "^3.0.1",
"testcafe": "^0.20.4",
"typeface-barlow": "^0.0.54",
Expand Down
2 changes: 1 addition & 1 deletion src/components/booking/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Booking extends PureComponent {
}

updateUserFromStore = (state, action) => {
const bookedPayload = action.data
const bookedPayload = action.config.datum
this.actions.requestData({
apiPath: '/users/current',
body: {},
Expand Down
10 changes: 4 additions & 6 deletions src/components/forms/utils/tests/parseSubmitErrors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import { parseSubmitErrors } from '../parseSubmitErrors'
describe('src | components | forms | utils | parseSubmitErrors ', () => {
it('', () => {
// given
const action = {
errors: {
identifier: ['identifiant incorrect'],
password: ['mot de passe incorrect'],
},
const errors = {
identifier: ['identifiant incorrect'],
password: ['mot de passe incorrect'],
}

// when
const result = parseSubmitErrors(action.errors)
const result = parseSubmitErrors(errors)
const expected = {
identifier: ['identifiant incorrect'],
password: ['mot de passe incorrect'],
Expand Down
7 changes: 4 additions & 3 deletions src/components/pages/activation/password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class ActivationPassword extends React.PureComponent {

handleActivationPasswordRequestFail = formResolver => (state, action) => {
const nextstate = { isLoading: false }
const { config } = action
const { errors } = config
// resolve form with errors
this.setState(nextstate, () => {
const errors =
(Array.isArray(action.errors) && action.errors[0]) || action.errors
formResolver(errors)
const error = (Array.isArray(errors) && errors[0]) || errors
formResolver(error)
})
}

Expand Down
7 changes: 4 additions & 3 deletions src/components/pages/discovery/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import PropTypes from 'prop-types'
import { withLogin } from 'pass-culture-shared'
import React, { Fragment } from 'react'
import get from 'lodash.get'
import { connect } from 'react-redux'
import { compose } from 'redux'
import { Route } from 'react-router-dom'
Expand Down Expand Up @@ -52,7 +51,9 @@ export class RawDiscoveryPage extends React.PureComponent {
handleRequestSuccess = (state, action) => {
const { dispatch, history, match } = this.props
const { offerId, mediationId } = match.params
const len = get(action, 'data.length')
const { config } = action
const { data } = config
const len = data.length
const isempty = !(len && len > 0)
// loading
this.setState({ isempty, isloading: false })
Expand All @@ -64,7 +65,7 @@ export class RawDiscoveryPage extends React.PureComponent {
const shouldNotReloadPage = isempty || (offerId && mediationId)

if (shouldNotReloadPage) return
const firstRecommendation = get(action, 'data[0]') || {}
const firstRecommendation = data[0] || {}
// NOTE -> si la premiere carte n'a pas d'offerid
// alors il s'agit d'une carte tuto
const firstOfferId =
Expand Down
4 changes: 3 additions & 1 deletion src/components/pages/forgot-password/withResetForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const withPasswordForm = (
handleRequestFail = formResolver => (state, action) => {
// on retourne les erreurs API au formulaire
const nextstate = { isloading: false }
this.setState(nextstate, () => formResolver(action.errors))
const { config } = action
const { errors } = config
this.setState(nextstate, () => formResolver(errors))
}

handleRequestSuccess = formResolver => () => {
Expand Down
6 changes: 4 additions & 2 deletions src/components/pages/profile/forms/withProfileForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ const withProfileForm = (
handleRequestFail = formResolver => (state, action) => {
// on retourne les erreurs API au formulaire
const nextstate = { isloading: false }
const errors = parseSubmitErrors(action.errors)
this.setState(nextstate, () => formResolver(errors))
const { config } = action
const { errors } = config
const errorsByKey = parseSubmitErrors(errors)
this.setState(nextstate, () => formResolver(errorsByKey))
}

handleRequestSuccess = formResolver => () => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/pages/search/RawSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ class RawSearch extends PureComponent {
requestData({
apiPath,
handleSuccess: (state, action) => {
const hasMore = action.data && action.data.length > 0
const { config } = action
const { data } = config
const hasMore = data.length > 0
this.setState({ hasMore })
},
})
Expand Down
6 changes: 4 additions & 2 deletions src/components/pages/signin/SigninContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ class Signin extends React.PureComponent {
handleRequestFail = formResolver => (state, action) => {
// on retourne les erreurs API au formulaire
const nextstate = { isloading: false }
const { config } = action
const { errors } = config

const errors = parseSubmitErrors(action.errors)
this.setState(nextstate, () => formResolver(errors))
const errorsByKey = parseSubmitErrors(errors)
this.setState(nextstate, () => formResolver(errorsByKey))
}

handleRequestSuccess = formResolver => () => {
Expand Down
2 changes: 1 addition & 1 deletion testcafe/01_activation.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test('Sans email en query, je suis redirigé·e vers /activation/error', async t
.eql(`${baseURL}/error`)
})

test("Avec un email déjà activé, j'ai un message d'erreur", async t => {
test.only("Avec un email déjà activé, j'ai un message d'erreur", async t => {
// given
const { user } = await fetchSandbox(
'webapp_01_activation',
Expand Down
41 changes: 32 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,17 @@ cosmiconfig@^5.0.0:
lodash.get "^4.4.2"
parse-json "^4.0.0"

coveralls@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.3.tgz#83b1c64aea1c6afa69beaf50b55ac1bc4d13e2b8"
dependencies:
growl "~> 1.10.0"
js-yaml "^3.11.0"
lcov-parse "^0.0.10"
log-driver "^1.2.7"
minimist "^1.2.0"
request "^2.86.0"

crc32-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4"
Expand Down Expand Up @@ -4732,6 +4743,10 @@ growl@1.10.3:
version "1.10.3"
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f"

"growl@~> 1.10.0":
version "1.10.5"
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e"

growly@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
Expand Down Expand Up @@ -6044,7 +6059,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"

js-yaml@^3.12.0, js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1:
js-yaml@^3.11.0, js-yaml@^3.12.0, js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1:
version "3.12.2"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.2.tgz#ef1d067c5a9d9cb65bd72f285b5d8105c77f14fc"
dependencies:
Expand Down Expand Up @@ -6274,6 +6289,10 @@ lcid@^2.0.0:
dependencies:
invert-kv "^2.0.0"

lcov-parse@^0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3"

left-pad@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
Expand Down Expand Up @@ -6558,6 +6577,10 @@ lodash@4.17.10:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"

log-driver@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"

log-symbols@^2.0.0, log-symbols@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"
Expand Down Expand Up @@ -7804,9 +7827,9 @@ pascalcase@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"

pass-culture-shared@0.1.0-alpha3:
version "0.1.0-alpha3"
resolved "https://registry.yarnpkg.com/pass-culture-shared/-/pass-culture-shared-0.1.0-alpha3.tgz#a68de627f8310515dbd5cb8ab47894ff7f0ccc8c"
pass-culture-shared@0.1.0-alpha5:
version "0.1.0-alpha5"
resolved "https://registry.yarnpkg.com/pass-culture-shared/-/pass-culture-shared-0.1.0-alpha5.tgz#e63fda5929dbc819ac06a464623e5086deb9173a"
dependencies:
classnames "2.2.5"
eslint "^5.8.0"
Expand All @@ -7830,7 +7853,7 @@ pass-culture-shared@0.1.0-alpha3:
react-time-input "^0.0.19"
redux "^4.0.0"
redux-saga "^0.15.3"
redux-saga-data "^1.4.1"
redux-saga-data "^1.5.0"
reselect "^3.0.1"
uuid "^3.3.2"

Expand Down Expand Up @@ -9610,9 +9633,9 @@ redux-persist@^5.10.0:
version "5.10.0"
resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-5.10.0.tgz#5d8d802c5571e55924efc1c3a9b23575283be62b"

redux-saga-data@^1.4.0, redux-saga-data@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/redux-saga-data/-/redux-saga-data-1.4.1.tgz#fe6364bb584c0c46b54b85549ffe983df36e5709"
redux-saga-data@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/redux-saga-data/-/redux-saga-data-1.5.0.tgz#e2730e685813561573cdab7ebb22acb0c8c7926f"
dependencies:
eslint "^5.8.0"
lodash.uniqby "^4.7.0"
Expand Down Expand Up @@ -9907,7 +9930,7 @@ request@2.11.x:
form-data "~0.0.3"
mime "~1.2.7"

request@^2.87.0, request@^2.88.0:
request@^2.86.0, request@^2.87.0, request@^2.88.0:
version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
dependencies:
Expand Down

0 comments on commit fe63b2a

Please sign in to comment.