-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout de l'option "allowJs" dans tsconfig.js
Cela permet l'inférence de type à partir des fichiers js qui ne sont pas encore convertis en TypeScript. Par ailleurs suppression des dernières traces de Flow. Ajout d'options plus strictes pour dans la config tsconfig.js
- Loading branch information
1 parent
34085d3
commit 1b963b8
Showing
35 changed files
with
539 additions
and
610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ dist/ | |
.DS_Store | ||
package-lock.json | ||
yarn-error.log | ||
flow-typed/ | ||
cypress/videos | ||
cypress/screenshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { dropWhile } from 'ramda' | ||
import { nextQuestionUrlSelector } from 'Selectors/companyStatusSelectors' | ||
|
||
const thenGoToNextQuestion = actionCreator => (...args: unknown[]) => ( | ||
dispatch, | ||
getState, | ||
{ history, sitePaths } | ||
) => { | ||
dispatch(actionCreator(...args)) | ||
history.push(nextQuestionUrlSelector(getState(), { sitePaths })) | ||
} | ||
|
||
export const isSoleProprietorship = thenGoToNextQuestion( | ||
(isSoleProprietorship?: boolean) => | ||
({ | ||
type: 'COMPANY_IS_SOLE_PROPRIETORSHIP', | ||
isSoleProprietorship | ||
} as const) | ||
) | ||
|
||
type DirectorStatus = 'SALARIED' | 'SELF_EMPLOYED' | ||
|
||
export const defineDirectorStatus = thenGoToNextQuestion( | ||
(status: DirectorStatus) => | ||
({ | ||
type: 'DEFINE_DIRECTOR_STATUS', | ||
status | ||
} as const) | ||
) | ||
|
||
export const companyHasMultipleAssociates = thenGoToNextQuestion( | ||
(multipleAssociates?: boolean) => | ||
({ | ||
type: 'COMPANY_HAS_MULTIPLE_ASSOCIATES', | ||
multipleAssociates | ||
} as const) | ||
) | ||
|
||
export const isAutoentrepreneur = thenGoToNextQuestion( | ||
(autoEntrepreneur?: boolean) => | ||
({ | ||
type: 'COMPANY_IS_MICROENTERPRISE', | ||
autoEntrepreneur | ||
} as const) | ||
) | ||
|
||
export const directorIsInAMinority = thenGoToNextQuestion( | ||
(minorityDirector?: boolean) => | ||
({ | ||
type: 'SPECIFY_DIRECTORS_SHARE', | ||
minorityDirector | ||
} as const) | ||
) | ||
|
||
export const goToCompanyStatusChoice = () => ( | ||
dispatch, | ||
_, | ||
{ history, sitePaths } | ||
) => { | ||
dispatch({ | ||
type: 'RESET_COMPANY_STATUS_CHOICE' | ||
} as const) | ||
history.push(sitePaths.créer.index) | ||
} | ||
|
||
export const resetCompanyStatusChoice = (from: string) => ( | ||
dispatch, | ||
getState | ||
) => { | ||
const answeredQuestion = Object.keys( | ||
getState().inFranceApp.companyLegalStatus | ||
) | ||
const answersToReset = dropWhile(a => a !== from, answeredQuestion) | ||
if (!answersToReset.length) { | ||
return | ||
} | ||
dispatch({ | ||
type: 'RESET_COMPANY_STATUS_CHOICE', | ||
answersToReset | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.