diff --git a/mon-entreprise/index.html b/mon-entreprise/index.html
index 592b0e0d2..8e66384b8 100644
--- a/mon-entreprise/index.html
+++ b/mon-entreprise/index.html
@@ -64,11 +64,7 @@
content="<%= htmlWebpackPlugin.options.shareImage %>"
/>
-
+
<%= htmlWebpackPlugin.options.title %>
diff --git a/mon-entreprise/scripts/fetch-stats.js b/mon-entreprise/scripts/fetch-stats.js
index cad6ada15..a007c97f7 100644
--- a/mon-entreprise/scripts/fetch-stats.js
+++ b/mon-entreprise/scripts/fetch-stats.js
@@ -131,6 +131,8 @@ async function fetchSimulators(dt) {
'/profession-liberale/auxiliaire-medical',
'/profession-liberale/sage-femme',
'/profession-liberale/chirugien-dentiste',
+ '/profession-liberale/avocat',
+ '/profession-liberale/expert-comptable',
'/économie-collaborative'
].includes(label)
)
@@ -170,7 +172,10 @@ async function fetchSimulators(dt) {
'/profession-liberale',
'/chirugien-dentiste',
'/auxiliaire-medical',
- '/sage-femme'
+ '/sage-femme',
+ '/medecin',
+ '/avocat',
+ '/expert-comptable'
].some(path => x.label.startsWith(path))
)
diff --git a/mon-entreprise/source/components/ui/Fonts.css b/mon-entreprise/source/components/ui/Fonts.css
new file mode 100644
index 000000000..2befd09d6
--- /dev/null
+++ b/mon-entreprise/source/components/ui/Fonts.css
@@ -0,0 +1,43 @@
+/* roboto-regular - latin */
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Roboto'), local('Roboto-Regular'),
+ url('./fonts/roboto-v20-latin-regular.woff2') format('woff2'),
+ /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('./fonts/roboto-v20-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
+
+/* roboto-italic - latin */
+@font-face {
+ font-family: 'Roboto';
+ font-style: italic;
+ font-weight: 400;
+ src: local('Roboto Italic'), local('Roboto-Italic'),
+ url('./fonts/roboto-v20-latin-italic.woff2') format('woff2'),
+ /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('./fonts/roboto-v20-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
+
+/* roboto-500 - latin */
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: bold;
+ src: local('Roboto Medium'), local('Roboto-Medium'),
+ url('./fonts/roboto-v20-latin-500.woff2') format('woff2'),
+ /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('./fonts/roboto-v20-latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
+
+/* montserrat-600 - latin */
+@font-face {
+ font-family: 'Montserrat';
+ font-style: normal;
+ font-weight: 600;
+ src: local('Montserrat SemiBold'), local('Montserrat-SemiBold'),
+ url('./fonts/montserrat-v15-latin-600.woff2') format('woff2'),
+ /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('./fonts/montserrat-v15-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
diff --git a/mon-entreprise/source/components/ui/Typography.css b/mon-entreprise/source/components/ui/Typography.css
index 591a36702..5e0c044da 100644
--- a/mon-entreprise/source/components/ui/Typography.css
+++ b/mon-entreprise/source/components/ui/Typography.css
@@ -23,6 +23,7 @@ html {
font-size: 1em;
}
}
+
body {
font-weight: 400;
color: #040e19;
@@ -120,7 +121,7 @@ a:not(:disabled):not(.button):not(.button-choice):hover {
strong,
b {
- font-weight: 600;
+ font-weight: bold;
}
textarea {
diff --git a/mon-entreprise/source/components/ui/fonts/montserrat-v15-latin-600.woff b/mon-entreprise/source/components/ui/fonts/montserrat-v15-latin-600.woff
new file mode 100644
index 000000000..e7f8a31ba
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/montserrat-v15-latin-600.woff differ
diff --git a/mon-entreprise/source/components/ui/fonts/montserrat-v15-latin-600.woff2 b/mon-entreprise/source/components/ui/fonts/montserrat-v15-latin-600.woff2
new file mode 100644
index 000000000..29cc1a973
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/montserrat-v15-latin-600.woff2 differ
diff --git a/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-500.woff b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-500.woff
new file mode 100644
index 000000000..869925869
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-500.woff differ
diff --git a/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-500.woff2 b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-500.woff2
new file mode 100644
index 000000000..6362d7f64
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-500.woff2 differ
diff --git a/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-italic.woff b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-italic.woff
new file mode 100644
index 000000000..b940dbcb7
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-italic.woff differ
diff --git a/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-italic.woff2 b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-italic.woff2
new file mode 100644
index 000000000..2741d4f08
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-italic.woff2 differ
diff --git a/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-regular.woff b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-regular.woff
new file mode 100644
index 000000000..69c882540
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-regular.woff differ
diff --git a/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-regular.woff2 b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-regular.woff2
new file mode 100644
index 000000000..1a5370151
Binary files /dev/null and b/mon-entreprise/source/components/ui/fonts/roboto-v20-latin-regular.woff2 differ
diff --git a/mon-entreprise/source/components/ui/index.css b/mon-entreprise/source/components/ui/index.css
index 23b6876d6..3a87792ef 100644
--- a/mon-entreprise/source/components/ui/index.css
+++ b/mon-entreprise/source/components/ui/index.css
@@ -3,6 +3,7 @@
@import './Card.css';
@import './Toggle.css';
@import './reset.css';
+@import './Fonts.css';
:root {
--color: rgb(41, 117, 209);
diff --git a/mon-entreprise/webpack.prod.js b/mon-entreprise/webpack.prod.js
index 4138b6828..4f6bc714c 100644
--- a/mon-entreprise/webpack.prod.js
+++ b/mon-entreprise/webpack.prod.js
@@ -77,23 +77,6 @@ module.exports = {
clientsClaim: true,
skipWaiting: true,
swDest: 'sw.js',
- runtimeCaching: [
- {
- urlPattern: new RegExp(
- 'https://fonts.(?:googleapis|gstatic).com/(.*)'
- ),
- handler: 'cacheFirst',
- options: {
- cacheName: 'google-fonts',
- expiration: {
- maxEntries: 5
- },
- cacheableResponse: {
- statuses: [0, 200]
- }
- }
- }
- ],
navigateFallback: '/fallback',
navigateFallbackWhitelist: [/^\/[^_]+$/], // fallback for anything that doesn't start with
navigateFallbackBlacklist: [
diff --git a/publicodes/source/mecanisms/recalcul.ts b/publicodes/source/mecanisms/recalcul.ts
index f4ddd46a1..409948beb 100644
--- a/publicodes/source/mecanisms/recalcul.ts
+++ b/publicodes/source/mecanisms/recalcul.ts
@@ -7,19 +7,17 @@ const evaluateRecalcul = (cache, situation, parsedRules, node) => {
return defaultNode(false)
}
- const amendedSituation =
- node.explanation.amendedSituation
- .map(([originRule, replacement]) => [
- evaluateNode(cache, situation, parsedRules, originRule),
- evaluateNode(cache, situation, parsedRules, replacement)
- ])
- .filter(
- ([originRule, replacement]) =>
- originRule.nodeValue !== replacement.nodeValue ||
- serializeUnit(originRule.unit) !== serializeUnit(replacement.unit)
- )
-
-
+ const amendedSituation = node.explanation.amendedSituation
+ .map(([originRule, replacement]) => [
+ evaluateNode(cache, situation, parsedRules, originRule),
+ evaluateNode(cache, situation, parsedRules, replacement)
+ ])
+ .filter(
+ ([originRule, replacement]) =>
+ originRule.nodeValue !== replacement.nodeValue ||
+ serializeUnit(originRule.unit) !== serializeUnit(replacement.unit)
+ )
+
// Optimisation : no need for recalcul if situation is the same
const recalculCache = Object.keys(amendedSituation).length
? { _meta: { ...cache._meta, inRecalcul: true } } // Create an empty cache
@@ -27,8 +25,14 @@ const evaluateRecalcul = (cache, situation, parsedRules, node) => {
const evaluatedNode = evaluateNode(
recalculCache,
- { ...situation,
- ...Object.fromEntries(amendedSituation.map(([originRule, replacement]) => [originRule.dottedName, replacement]))
+ {
+ ...situation,
+ ...Object.fromEntries(
+ amendedSituation.map(([originRule, replacement]) => [
+ originRule.dottedName,
+ replacement
+ ])
+ )
},
parsedRules,
node.explanation.recalcul
diff --git a/webpack/common.js b/webpack/common.js
index 5b897c7ac..8726e3ecd 100644
--- a/webpack/common.js
+++ b/webpack/common.js
@@ -65,6 +65,19 @@ module.exports.commonLoaders = ({ legacy = false, file = true } = {}) => {
}
]
: []),
+ {
+ test: /\.(ttf|woff2?)$/,
+ use: [
+ {
+ loader: 'file-loader',
+ options: {
+ name: '[name].[ext]',
+ outputPath: 'fonts',
+ publicPath: '/fonts'
+ }
+ }
+ ]
+ },
{
test: /\.yaml$/,
use: ['json-loader', 'yaml-loader']
@@ -82,7 +95,7 @@ module.exports.commonLoaders = ({ legacy = false, file = true } = {}) => {
use: ['raw-loader']
},
{
- test: /\.(ttf|pdf)$/,
+ test: /\.pdf$/,
use: ['file-loader']
}
]