Merge pull request #1006 from betagouv/quickfix

Répare la page blanche sur publi.codes
pull/1011/head
Johan Girod 2020-04-27 16:39:17 +02:00 committed by GitHub
commit a92adb8ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1908 additions and 2490 deletions

View File

@ -21,7 +21,7 @@ commands:
default: fr
integration_folder:
type: enum
enum: [mon-entreprise, external]
enum: [mon-entreprise, external, publi.codes]
default: mon-entreprise
base_url:
type: string
@ -70,6 +70,9 @@ jobs:
- cypress:
base_url: http://localhost:5001
language: en
- cypress:
base_url: http://localhost:5002
integration_folder: publi.codes
bundlesize-test:
docker:
@ -97,6 +100,9 @@ jobs:
language: en
- cypress:
integration_folder: external
- cypress:
base_url: https://publi.codes
integration_folder: publi.codes
- run:
name: Send email if test failed
when: on_fail

View File

@ -6,4 +6,4 @@
},
"integrationFolder": "cypress/integration/mon-entreprise",
"chromeWebSecurity": false
}
}

View File

@ -0,0 +1,15 @@
describe('Navigation', function() {
it('landing should not crash', function() {
cy.visit('/')
})
it('liste des mécanismes should not crash', function() {
cy.contains('Liste des mécanismes').click()
cy.contains('barème')
})
it('bac à sable should work', function() {
cy.contains('Bac à sable').click()
cy.contains('dépenses primeur')
cy.contains('Résultats')
cy.contains('11,50')
})
})

View File

@ -99,11 +99,12 @@
"i18n:ui:check": "yarn run i18next && node source/scripts/i18n/check-missing-UI-translation",
"i18n:ui:translate": "rm -rf source/locales/static-analysis-fr.json && yarn run i18next && node source/scripts/i18n/translate-ui.js",
"publicodes:serve": "PORT=5002 serve --config serve.publicodes.json --no-clipboard",
"publicodes:test-dev": "cypress open --browser chromium --config baseUrl=http://localhost:8080/publicodes,integrationFolder=cypress/integration/publi.codes",
"mon-entreprise:serve": "PORT=5000 serve --config serve.mon-entreprise.json --no-clipboard",
"mon-entreprise:test": "cypress open --browser chromium",
"mon-entreprise:test-dev": "cypress open --browser chromium",
"mycompanyinfrance:serve": "PORT=5001 serve --config serve.infrance.json --no-clipboard",
"mycompanyinfrance:test": "cypress open --browser chromium --config baseUrl=http://localhost:8080/infrance",
"serve-dev": "yarn run mon-entreprise:serve & yarn run mycompanyinfrance:serve"
"mycompanyinfrance:test-dev": "cypress open --browser chromium --config baseUrl=http://localhost:8080/infrance",
"serve-dev": "yarn run mon-entreprise:serve & yarn run mycompanyinfrance:serve & yarn run publicodes:serve"
},
"devDependencies": {
"@babel/core": "^7.6.4",

View File

@ -90,7 +90,6 @@ export default function Provider({
)
)
if (language && initialStore) initialStore.lang = language
const store = createStore(reducers, initialStore, storeEnhancer)
onStoreCreated?.(store)

View File

@ -112,11 +112,22 @@ export default function PaySlip() {
</Fragment>
)
})}
{/* Total cotisation */}
<div className="payslip__total">
<Trans>Total des retenues</Trans>
{/* Réductions */}
<div>
<Trans>Réductions</Trans>
</div>
<Value
expression="- contrat salarié . cotisations . patronales . réductions de cotisations"
displayedUnit="€"
/>
<Value
expression="- contrat salarié . cotisations . salariales . réduction heures supplémentaires"
displayedUnit="€"
/>
{/* Total cotisation */}
<p className="payslip__total">
<Trans>Total des retenues</Trans>
</p>
<Value
expression="contrat salarié . cotisations . patronales"
displayedUnit="€"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -56,18 +56,6 @@ function activeTargetInput(state: DottedName | null = null, action: Action) {
}
}
function lang(
state = i18n.language as AvailableLangs,
{ type, lang }
): AvailableLangs {
switch (type) {
case 'SWITCH_LANG':
return lang
default:
return state
}
}
type QuestionsKind =
| "à l'affiche"
| 'non prioritaires'
@ -206,7 +194,6 @@ const existingCompanyReducer = (state, action: Action) => {
}
const mainReducer = (state, action: Action) =>
combineReducers({
lang,
explainedVariable,
// We need to access the `rules` in the simulation reducer
simulation: (a: Simulation | null = null, b: Action): Simulation | null =>

View File

@ -1,6 +1,9 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { Link, NavLink } from 'react-router-dom'
const activeStyle = {
fontWeight: 'bold',
textDecoration: 'underline'
} as React.CSSProperties
export const Header = ({ noSubtitle = false, sectionName = '' }) => (
<header css="text-align: center; a {text-decoration: none}">
<Link to="/">
@ -23,5 +26,15 @@ export const Header = ({ noSubtitle = false, sectionName = '' }) => (
Le langage pour les algorithmes d'intérêt public.
</p>
)}
<br />
<nav css="display">
<NavLink activeStyle={activeStyle} to="/studio">
Bac à sable
</NavLink>{' '}
{' '}
<NavLink activeStyle={activeStyle} to="/mécanismes">
Liste des mécanismes
</NavLink>
</nav>
</header>
)

View File

@ -3,6 +3,7 @@ import { ScrollToTop } from 'Components/utils/Scroll'
import publicodeReadme from 'Engine/README.md'
import React, { useEffect } from 'react'
import { Header } from './Header'
import { NavLink } from 'react-router-dom'
export default function Landing() {
useEffect(() => {
@ -23,7 +24,6 @@ export default function Landing() {
<ScrollToTop />
<Header />
<br />
<br />
<MarkdownWithAnchorLinks source={publicodeReadme} />
</div>
)