Commit 2402c406 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat(mail): add new templating with ejs and mjml.

parent c7151fae
......@@ -44,6 +44,9 @@ build-test:
- yarn build
only:
- merge_requests
artifacts:
paths:
- build/assets
build-dev:
stage: build
......@@ -125,7 +128,6 @@ sonarqube:
-Dsonar.cpd.exclusions=tests/**,src/**/*.spec.ts*
-Dsonar.qualitygate.wait=true
sonarqube-mr:
stage: quality
only:
......
......@@ -18,16 +18,12 @@
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
"typescript",
"typescriptreact",
}
],
"gitlab.instanceUrl": "https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo",
......
......@@ -8,7 +8,9 @@
*/
const webpack = require('webpack')
const path = require('path')
const { useHotReload } = require('cozy-scripts/config/webpack.vars')
const CopyPlugin = require('copy-webpack-plugin')
const CTS = require('cozy-scripts/utils/constants.js')
const babelConf = require('./babel.config')
......@@ -30,6 +32,14 @@ module.exports = {
plugins: useHotReload ? babelConf.plugins : [],
},
},
{
test: /\.hbs$/,
loader: 'handlebars-loader',
},
{
test: path.resolve(__dirname, 'node_modules/uglify-js/tools/node.js'),
loader: 'null-loader',
},
{
test: /\.scss$/,
loaders: [
......@@ -42,6 +52,18 @@ module.exports = {
},
// Necessary for cozy-ui during Preact -> React apps transition
plugins: [
new CopyPlugin({
patterns: [
{
from: './src/assets/icons/visu/ecogesture',
to: './assets/ecogesture',
},
{
from: './src/assets/icons/email',
to: './assets/',
},
],
}),
new webpack.DefinePlugin({
'process.env': {
USE_REACT: 'true',
......
......@@ -64,6 +64,14 @@ const config = {
emitWarning: true,
},
},
{
test: /\.hbs$/,
loader: 'handlebars-loader',
},
{
test: path.resolve(__dirname, 'node_modules/uglify-js/tools/node.js'),
loader: 'null-loader',
},
{
test: /\.ts$/,
exclude: /(node_modules|cozy-(bar|client-js))/,
......
......@@ -4,7 +4,7 @@ module.exports = {
setupFiles: ['<rootDir>/tests/jestLib/setup.js'],
moduleDirectories: ['src', 'node_modules'],
moduleNameMapper: {
'\\.(png|gif|jpe?g|svg)$': '<rootDir>/tests/__mocks__/fileMock.js',
'\\.(png|gif|jpe?g|svg|hbs)$': '<rootDir>/tests/__mocks__/fileMock.js',
// identity-obj-proxy module is installed by cozy-scripts
'\\.(css|styl|sass|scss)$': 'identity-obj-proxy',
},
......
......@@ -52,6 +52,12 @@
"description": "Requis pour la récupération et l’envoi de statistiques d’utilisation anonymisées dans un environnement de test."
},
"dacc": {
"description": "Requis pour envoyer des statistiques d'utilisation anonymisées."
},
"backoffice-rec": {
"description": "Requis pour la récupération et l’envoi de statistiques d’utilisation anonymisées."
},
"backoffice-prod": {
"description": "Requis pour la récupération et l’envoi de statistiques d’utilisation anonymisées."
}
}
......@@ -100,6 +106,12 @@
"description": "Required for gathering and sending anonymous usage statistics for test environment."
},
"dacc": {
"description": "Required for sending cozy anonymized stats."
},
"backoffice-rec": {
"description": "Required for gathering and sending anonymous usage statistics."
},
"backoffice-prod": {
"description": "Required for gathering and sending anonymous usage statistics."
}
}
......@@ -176,6 +188,14 @@
"dacc-dev": {
"type": "cc.cozycloud.dacc.dev",
"verbs": ["ALL"]
},
"backoffice-rec": {
"type": "org.ecolyo.backoffice-rec",
"verbs": ["ALL"]
},
"backoffice-prod": {
"type": "org.ecolyo.backoffice-prod",
"verbs": ["ALL"]
}
}
}
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M37.4271 42.1187L41.5276 38.7162L43.421 37.9754C43.3145 38.1199 43.2409 38.2539 43.1895 38.3672L43.1609 38.4472C43.6427 38.7265 44.2959 39.0461 45.0804 39.3771C46.6507 40.0395 48.5355 40.659 50.1938 41.0492C52.0327 41.4819 54.4827 42.073 56.874 43.0477C59.2574 44.0193 61.8284 45.4667 63.7678 47.7651C64.2138 48.2938 64.6029 49.0351 64.6684 49.9543C64.6722 50.008 64.6748 50.0612 64.6763 50.1138L55.4517 49.5974C55.1148 49.434 54.7624 49.2777 54.3955 49.1281C52.5317 48.3684 50.5369 47.8754 48.6899 47.4408C46.6621 46.9637 44.4271 46.228 42.5282 45.4269C41.5781 45.0261 40.6594 44.5868 39.8673 44.1276C39.1532 43.7136 38.2499 43.12 37.5961 42.3353C37.5368 42.2641 37.4805 42.1919 37.4271 42.1187Z" fill="#E4A400"/>
<path d="M36.7925 53.4128L40.893 50.0102L42.7864 49.2695C42.6799 49.4139 42.6063 49.548 42.5549 49.6613L42.5263 49.7412C43.0081 50.0206 43.6613 50.3402 44.4459 50.6712C46.0162 51.3336 47.9009 51.9531 49.5592 52.3433C51.3981 52.776 53.8481 53.367 56.2395 54.3418C58.6229 55.3134 61.1939 56.7607 63.1332 59.0592C63.5792 59.5878 63.9683 60.3292 64.0338 61.2483C64.0376 61.3021 64.0402 61.3553 64.0418 61.4079L54.8171 60.8915C54.4802 60.7281 54.1278 60.5718 53.7609 60.4222C51.8971 59.6625 49.9023 59.1695 48.0553 58.7349C46.0275 58.2578 43.7925 57.5221 41.8936 56.721C40.9435 56.3202 40.0248 55.8809 39.2328 55.4217C38.5187 55.0076 37.6153 54.4141 36.9615 53.6294C36.9022 53.5582 36.8459 53.4859 36.7925 53.4128Z" fill="#E4A400"/>
<path d="M38.1814 43.1596C38.663 41.5925 39.824 40.4887 40.6698 39.8219C41.784 38.9436 43.1536 38.2035 44.4832 37.5967C47.103 36.401 50.1273 35.4724 52.2573 34.9596L59.9266 32.4029C60.139 32.3321 60.3534 32.2843 60.5674 32.2579C62.0584 31.5626 62.8233 29.8441 62.2905 28.2457C61.717 26.5256 59.8577 25.596 58.1376 26.1694L50.4683 28.726C48.3383 29.2389 45.314 30.1674 42.6942 31.3631C41.3646 31.97 39.995 32.7101 38.8808 33.5884C37.8882 34.3709 36.4616 35.7551 36.2083 37.7837C35.9101 40.1713 36.9833 41.9613 38.1814 43.1596Z" fill="#FFDC5F"/>
<path d="M45.5469 47.7089C47.8945 46.7341 50.4181 45.9754 52.2675 45.5301L59.6937 43.0545C61.1242 42.3325 61.8469 40.652 61.3251 39.0868C60.7517 37.3667 58.8924 36.4371 57.1723 37.0105L49.503 39.5671C47.373 40.0799 44.3486 41.0085 41.7289 42.2042C40.3993 42.8111 39.0296 43.5512 37.9155 44.4295C36.9229 45.212 35.4963 46.5962 35.2429 48.6248C34.8805 51.5266 36.5438 53.5457 37.9952 54.6926C37.999 54.6578 38.003 54.6228 38.0074 54.5878C38.2608 52.5593 39.6873 51.175 40.68 50.3925C41.497 49.7484 42.4515 49.1786 43.4268 48.6812C43.738 48.5168 44.0814 48.3483 44.4552 48.1777C44.8084 48.0165 45.1741 47.8599 45.5469 47.7089Z" fill="#FFDC5F"/>
<path d="M64.3752 49.5303C64.929 51.2568 63.9783 53.1054 62.2517 53.6592L50.6376 57.3845L50.5125 57.4141C48.6461 57.8552 45.8418 58.6793 43.5253 59.6858C42.5435 60.1123 41.7524 60.5277 41.1851 60.903L36.409 62.2254C35.6867 62.4254 35.0773 62.8577 34.6523 63.428C34.2153 62.4902 33.9805 61.3812 34.1405 60.1002C34.4028 57.9999 35.9447 56.6085 36.9508 55.8563C38.1071 54.9918 39.5302 54.2623 40.9089 53.6634C43.6358 52.4787 46.7655 51.5597 48.8745 51.0543L60.2462 47.4068C61.9728 46.853 63.8214 47.8037 64.3752 49.5303Z" fill="#FFDC5F"/>
<path d="M34.0001 65.3896C34.0001 63.9138 34.9848 62.6193 36.4071 62.2255L62.6718 54.9534C64.7632 54.3743 66.8309 55.9474 66.8309 58.1174C66.8309 58.1174 66.8309 70.1178 66.8309 73.4786C66.8309 76.8394 61.8901 82.5852 60.3723 82.5852C58.8546 82.5852 42.3759 82.5852 41.0749 82.5852C39.774 82.5852 34.0001 76.8394 34.0001 73.4786C34.0001 70.1178 34.0001 65.3896 34.0001 65.3896Z" fill="#F4F4F4"/>
<path d="M36.6834 78.8601C38.3774 80.921 40.373 82.5852 41.0732 82.5852H60.3706C61.8883 82.5852 66.8292 76.8394 66.8292 73.4786V58.1174C66.8292 55.9474 64.7614 54.3743 62.67 54.9534L62.4592 55.0117V69.7538C62.4592 73.1146 57.5184 78.8605 56.0006 78.8605H36.7032L36.6834 78.8601Z" fill="#DDDDDD"/>
<rect x="40.7487" y="84.2116" width="20.0562" height="6.56618" rx="3.28309" fill="#C4C4C4"/>
<path d="M40.951 86.3565C40.8199 86.7112 40.7483 87.0946 40.7483 87.4948C40.7483 89.308 42.2182 90.7779 44.0314 90.7779H57.5214C59.3346 90.7779 60.8045 89.308 60.8045 87.4948C60.8045 87.0946 60.7328 86.7112 60.6017 86.3565C60.1388 87.6086 58.9343 88.5012 57.5214 88.5012H44.0314C42.6184 88.5012 41.414 87.6086 40.951 86.3565Z" fill="#9C9C9C"/>
<ellipse cx="46.8744" cy="86.4882" rx="3.08975" ry="1.40933" fill="white"/>
<rect x="40.7487" y="91.3668" width="20.0562" height="6.56618" rx="3.28309" fill="#C4C4C4"/>
<path d="M40.9512 93.5117C40.82 93.8664 40.7484 94.2498 40.7484 94.65C40.7484 96.4632 42.2183 97.9331 44.0315 97.9331H57.5215C59.3347 97.9331 60.8046 96.4632 60.8046 94.65C60.8046 94.2498 60.733 93.8664 60.6018 93.5117C60.1389 94.7638 58.9345 95.6563 57.5215 95.6563H44.0315C42.6186 95.6563 41.4141 94.7638 40.9512 93.5117Z" fill="#9C9C9C"/>
<ellipse cx="46.8745" cy="93.6434" rx="3.08975" ry="1.40933" fill="white"/>
<rect x="48" y="3" width="4" height="15" rx="2" fill="#FFDC5F"/>
<rect x="95" y="44" width="4" height="15" rx="2" transform="rotate(90 95 44)" fill="#FFDC5F"/>
<rect x="21" y="44" width="4" height="15" rx="2" transform="rotate(90 21 44)" fill="#FFDC5F"/>
<rect x="17" y="17.8284" width="4" height="15" rx="2" transform="rotate(-45 17 17.8284)" fill="#FFDC5F"/>
<rect width="4" height="15" rx="2" transform="matrix(-0.707107 -0.707107 -0.707107 0.707107 82.4351 15.8284)" fill="#FFDC5F"/>
</svg>
<svg width="151" height="119" viewBox="0 0 151 119" fill="none" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="80.4368" cy="35.6158" rx="44.9526" ry="5.76316" fill="#DAF6FF"/>
<ellipse cx="42.4" cy="34.4631" rx="4.61053" ry="4.61052" fill="#DAF6FF"/>
<ellipse cx="50.4685" cy="33.3105" rx="5.76316" ry="5.76316" fill="#DAF6FF"/>
<ellipse cx="58.5366" cy="32.1579" rx="4.61053" ry="4.61053" fill="#DAF6FF"/>
<circle cx="68.9105" cy="33.3105" r="5.76316" fill="#DAF6FF"/>
<ellipse cx="80.4367" cy="31.0052" rx="8.06842" ry="8.06842" fill="#DAF6FF"/>
<circle cx="59.6894" cy="31.0052" r="8.06842" fill="#DAF6FF"/>
<ellipse cx="93.1157" cy="32.1579" rx="9.22105" ry="9.22106" fill="#DAF6FF"/>
<ellipse cx="106.947" cy="32.1579" rx="6.91578" ry="6.91579" fill="#DAF6FF"/>
<ellipse cx="117.321" cy="33.3105" rx="5.76316" ry="5.76316" fill="#DAF6FF"/>
<ellipse cx="121.931" cy="33.3105" rx="3.45789" ry="3.45789" fill="#DAF6FF"/>
<path d="M131.805 21.3969C132.193 23.7476 130.602 25.9677 128.251 26.3556C125.901 26.7435 123.681 25.1524 123.293 22.8018C122.905 20.4511 124.496 18.231 126.846 17.8431C129.197 17.4552 131.417 19.0463 131.805 21.3969Z" fill="#FBD345"/>
<path d="M129.177 24.0167C128.736 23.3832 129.549 22.7617 129.813 22.5781C130.077 22.3945 131.628 22.0065 132.016 22.6738C132.479 23.4717 132.986 23.4147 133.049 23.8523C133.173 24.7061 129.618 24.6503 129.177 24.0167Z" fill="#F88600"/>
<path d="M132.574 28.7028C133.194 32.4638 130.864 34.6688 127.102 35.2895C123.341 35.9102 120.313 34.4941 118.809 32.7233C117.181 30.8059 117.4 26.8348 118.677 26.624C123.636 30.1779 123.784 25.7811 126.268 24.9341C127.91 24.374 129.603 23.9465 129.317 24.868C129.032 25.7895 132.012 25.2978 132.574 28.7028Z" fill="#FBD345"/>
<ellipse cx="127.567" cy="22.5446" rx="0.47561" ry="0.951219" transform="rotate(-9.37132 127.567 22.5446)" fill="black"/>
<path d="M34.9409 6.90283H23.5773V7.22019H34.9409C37.5969 7.22019 39.839 9.00122 40.549 11.4397H40.8774C40.1583 8.82373 37.7728 6.90283 34.9409 6.90283Z" fill="black"/>
<path d="M36.6464 11.4397C36.2156 10.9905 35.6107 10.7111 34.9409 10.7111H23.5773C22.2692 10.7111 21.2087 11.7767 21.2087 13.0912V22.1123C21.2087 23.4268 22.2692 24.4924 23.5773 24.4924V24.1751C22.4436 24.1751 21.5245 23.2515 21.5245 22.1123V13.0912C21.5245 11.952 22.4436 11.0284 23.5773 11.0284H34.9409C35.4023 11.0284 35.8282 11.1814 36.171 11.4397H36.6464Z" fill="black"/>
<path d="M34.9409 7.22015H23.5773V10.711H34.9409C35.6108 10.711 36.2157 10.9905 36.6465 11.4396H40.549C39.839 9.0012 37.5969 7.22015 34.9409 7.22015Z" fill="#E4EAEB"/>
<path d="M34.9464 9.12427H23.8931V10.3937H34.9464C36.076 10.3937 37.0427 11.0949 37.4388 12.0878H38.7666C38.3243 10.3827 36.7816 9.12427 34.9464 9.12427Z" fill="#84AAB3"/>
<path d="M34.7885 7.69623H22.7108V8.01358H34.7885C37.0038 8.01358 38.8861 9.44615 39.5681 11.4397H39.901C39.2068 9.26796 37.1803 7.69623 34.7885 7.69623Z" fill="#84AAB3"/>
<path d="M27.1534 7.22693H27.4775L28.1256 10.7916H27.1534V7.22693Z" fill="#84AAB3"/>
<path d="M36.551 11.7637H41.2881V13.3236H36.551V11.7637Z" fill="#D7EAEE"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.2272 11.4396H41.6124V13.6477H36.2272V11.4396ZM36.5512 11.7637V13.3236H41.2883V11.7637H36.5512Z" fill="#121212"/>
<rect x="36.8669" y="11.937" width="2.36855" height="1.38662" fill="#84AAB3"/>
<rect x="40.3408" y="11.937" width="0.315808" height="1.38662" fill="#84AAB3"/>
<path d="M27.4844 3.40284C27.4636 3.32247 27.512 3.2405 27.5923 3.21975L39.2472 0.210226C39.4883 0.147969 39.7342 0.292951 39.7965 0.534053L40.0572 1.54355C40.1194 1.78465 39.9744 2.03057 39.7333 2.09283L28.0785 5.10235C27.9981 5.12311 27.9161 5.07478 27.8954 4.99441L27.4844 3.40284Z" fill="#E4EAEB"/>
<path d="M27.842 3.49005L39.1604 0.56742C39.3211 0.525915 39.4851 0.62257 39.5266 0.783304L39.6135 1.1198L28.0041 4.11759L27.842 3.49005Z" fill="#84AAB3"/>
<path d="M28.2064 4.90204L39.3451 2.02579C39.4318 2.00341 39.4839 1.91504 39.4615 1.82839L28.1659 4.74515L28.2064 4.90204Z" fill="#84AAB3"/>
<rect x="26.5864" y="3.81415" width="0.972178" height="1.29624" transform="rotate(-14.4787 26.5864 3.81415)" fill="#84AAB2"/>
<rect x="20.0243" y="6.57874" width="7.1293" height="29.4894" fill="#E4EAEB"/>
<rect x="20.6725" y="7.22687" width="2.91653" height="28.8413" fill="#84AAB3"/>
<rect x="26.1815" y="7.22687" width="0.324059" height="28.8413" fill="#84AAB3"/>
<path d="M20.0245 2.4928C20.0245 2.24379 20.2263 2.04193 20.4753 2.04193H26.7029C26.9519 2.04193 27.1538 2.24379 27.1538 2.4928V5.93064H20.0245V2.4928Z" fill="#E4EAEB"/>
<path d="M26.1815 2.36597H26.3552C26.4382 2.36597 26.5055 2.43325 26.5055 2.51626V5.93062H26.1815V2.36597Z" fill="#84AAB3"/>
<path d="M20.6725 2.51626C20.6725 2.43325 20.7398 2.36597 20.8228 2.36597H23.589V5.93062H20.6725V2.51626Z" fill="#84AAB2"/>
<path d="M16.9886 84H73.9058C112.824 84 130.241 84 133.646 87.3117C137.052 90.6234 129.597 91.7068 133.646 93.5122C136.976 94.9967 150.304 95.4447 149.817 101.122C149.331 106.799 110.391 103.397 105.526 105.763C100.662 108.128 112.824 109.548 110.391 112.859C108.695 115.169 70.9869 114.752 64.1763 112.859C57.3657 110.967 66.3696 108.513 67.5816 105.763C69.041 102.451 57.3657 103.397 44.231 103.397C31.0962 103.397 4.3403 102.451 0.934995 100.086C-2.47031 97.72 4.3403 95.8276 6.77266 94.8814C9.20502 93.9352 12.6103 92.989 11.1509 89.2041C9.98336 86.1763 14.5562 84.4731 16.9886 84Z" fill="url(#paint0_radial)"/>
<path d="M15.7791 38.9474H140.169L136.345 59.4691C134.173 71.1323 123.994 79.5895 112.13 79.5895H43.8172C31.9533 79.5895 21.7751 71.1323 19.6022 59.4691L15.7791 38.9474Z" fill="#E5E5E5"/>
<path d="M79.2053 50.6474V79.5895H43.817C31.9531 79.5895 21.7749 71.1323 19.602 59.4691L17.9586 50.6474H79.2053Z" fill="white"/>
<rect x="10.8526" y="32.7895" width="139.168" height="12.3158" rx="6.15789" fill="white"/>
<path d="M10.8528 38.9474H150.021C150.021 42.3483 147.264 45.1053 143.863 45.1053H17.0107C13.6097 45.1053 10.8528 42.3483 10.8528 38.9474Z" fill="#EDEDED"/>
<path d="M31.2939 89.022C32.7217 89.1972 34.554 89.5726 38.0564 89.0411C39.7673 88.7814 41.8187 85.7464 31.5877 86.6265C29.3418 86.8196 29.1523 88.7593 31.2939 89.022Z" fill="#84AAB3"/>
<path d="M119.625 89.022C121.053 89.1972 122.885 89.5726 126.388 89.0411C128.099 88.7814 130.15 85.7464 119.919 86.6265C117.673 86.8196 117.484 88.7593 119.625 89.022Z" fill="#84AAB3"/>
<path d="M44.1052 75.2789C44.721 71.5842 44.1052 68.5052 40.4105 68.5052C33.021 68.5052 36.1 78.9737 35.4842 82.0526C34.8684 85.1315 31.758 86.1683 31.1737 86.3631L31.1736 86.3631C29.3264 86.9789 29.3264 88.8263 31.1736 88.8263C32.4052 88.8263 36.1 88.8263 38.5632 86.9789C41.4357 84.8246 43.4894 78.9737 44.1052 75.2789Z" fill="#CECECE"/>
<path d="M112.05 75.2789C111.435 71.5842 112.05 68.5052 115.745 68.5052C123.135 68.5052 120.056 78.9737 120.671 82.0526C121.287 85.1315 124.398 86.1683 124.982 86.3631L124.982 86.3631C126.829 86.9789 126.829 88.8263 124.982 88.8263C123.75 88.8263 120.056 88.8263 117.592 86.9789C114.72 84.8246 112.666 78.9737 112.05 75.2789Z" fill="#CECECE"/>
<path d="M46.6585 31.0122C43.0355 31.7368 43.805 32.3201 44.2806 32.9146C46.183 35.2927 45.2137 52.8472 49.6474 54.8177C55.1895 57.2809 53.3421 48.6598 57.0369 49.8914C60.7316 51.123 59.5 75.6473 61.3474 85.5C61.6544 87.1371 68.1211 87.9631 69.9685 85.5C71.8158 83.0368 70.5842 52.9703 73.0474 54.8177C74.9923 56.2764 72.3415 85.5 75.2557 85.5H80.9024V74.2927C80.9024 69.9821 81.8538 37.6707 83.5158 32.0335C83.76 31.2053 81.8536 30.5366 78.0488 30.5366C71.8658 30.5366 49.0366 30.5366 46.6585 31.0122Z" fill="url(#paint1_linear)"/>
<path d="M75.5 90C72.8996 91.6468 63.5617 92.1309 60.063 91.5467C58.2513 91.2441 54.6854 90.6247 51.9999 89.5C49.4992 88.4527 48.5517 86 49 86C49.9999 86 49.5 87.5 53 89C57.1427 90.0669 61.0311 90.9171 64.0001 91C67.8744 91.3791 77.7501 88.5751 75.5 90Z" fill="#DAF6FF"/>
<path d="M88.5001 88.5C86.5001 89.3 80 90.5 77.5 90C76.5 90.009 74.7732 90.7976 77.0001 91C82.5 91.5 88.6919 89.5 90.0001 88.5C91.3082 87.5 91.5 85.5 91 85.5C90.5 85.5 91.0001 87.5 88.5001 88.5Z" fill="#DAF6FF"/>
<path d="M33.1925 23.9264C32.891 20.4391 36.4686 17.9827 38.7155 14.2751C40.7159 17.6154 43.9943 20.1817 44.2356 22.9715C44.4768 25.7613 41.7483 28.8469 39.1999 29.0673C36.6515 29.2877 33.4941 27.4136 33.1925 23.9264Z" fill="#2B98BA"/>
<path d="M34.3694 23.2391C34.0623 19.6872 36.9597 18.0053 38.9178 14.2576C40.7351 17.6789 43.9397 19.5488 44.1854 22.3903C44.4311 25.2318 42.3502 27.5587 40.0849 27.7546C37.8197 27.9505 34.6765 26.7909 34.3694 23.2391Z" fill="#5FD8FF"/>
<path d="M36.59 23.0711C37.1804 24.6814 39.4407 24.9506 38.3641 25.864C37.2875 26.7773 35.8038 24.8903 35.2134 23.2801C34.623 21.6698 36.2391 19.5007 36.2391 19.5007C36.2391 19.5007 35.9996 21.4609 36.59 23.0711Z" fill="white"/>
<line x1="67.25" y1="52" x2="67.25" y2="61" stroke="white" stroke-width="0.5"/>
<line x1="63.25" y1="58" x2="63.25" y2="74" stroke="white" stroke-width="0.5"/>
<line x1="78.25" y1="52" x2="78.25" y2="68" stroke="white" stroke-width="0.5"/>
<line x1="76.25" y1="41" x2="76.25" y2="49" stroke="white" stroke-width="0.5"/>
<line x1="61.25" y1="38" x2="61.25" y2="45" stroke="white" stroke-width="0.5"/>
<path d="M38.9999 92.5C37.882 92.5 41.8519 94.3585 42.5077 94.4783C44.8772 95.4192 58.8204 96.9837 59 96C59.1796 95.0163 50.4921 95.1158 47.0001 94.4783C45.0326 94.1191 40.2311 92.5 38.9999 92.5Z" fill="#DAF6FF"/>
<path d="M82 95.5C79.6 96.3 72.6667 96.5 69.5 96.5C68.8333 96.6667 67.6 97.1 68 97.5C68.5 98 81 97 85.5 95.5C89.1 94.3 90.3333 93.3333 90.5 93C88.6667 93.5 84.4 94.7 82 95.5Z" fill="#DAF6FF"/>
<path d="M100.192 98.2852C98.4753 98.9176 93.2335 99.347 91.2505 99.4967C91.2291 100.142 95.0539 99.8382 98.8858 99.319C102.718 98.7998 104.9 96.8965 104.92 96.2879C104.942 95.6424 102.337 97.4947 100.192 98.2852Z" fill="#DAF6FF"/>
<defs>
<radialGradient id="paint0_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(71.9512 85.6951) rotate(93.0128) scale(28.5394 105.625)">
<stop offset="0.09375" stop-color="#0089B4"/>
<stop offset="1" stop-color="#67DAFE"/>
</radialGradient>
<linearGradient id="paint1_linear" x1="63.7026" y1="30.5366" x2="65.0001" y2="87" gradientUnits="userSpaceOnUse">
<stop offset="0.0520833" stop-color="#68DBFF"/>
<stop offset="1" stop-color="#0089B4"/>
</linearGradient>
</defs>
</svg>
<svg width="92" height="53" viewBox="0 0 92 53" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.7369 44.2337C33.063 37.6318 31.7942 28.246 30.9483 14.2469C25.7036 14.0082 21.051 12.3379 16.7369 9.55396C12.4227 12.3379 7.77017 14.0082 2.5255 14.2469C1.67958 28.246 0.410707 37.6318 16.7369 44.2337Z" fill="#1B1C22"/>
<path d="M16.7369 7L15.6309 7.71373C11.5862 10.3238 7.27889 11.8606 2.43376 12.081L0.55506 12.1665L0.437561 14.111C0.402669 14.6884 0.366401 15.2629 0.330341 15.8341C-0.0576808 21.9803 -0.421614 27.745 1.21133 32.7126C3.09394 38.4397 7.46133 42.8092 15.9763 46.2524L16.7369 46.56V44.2333C1.05085 37.8902 1.60717 28.9773 2.42518 15.8719C2.45856 15.3371 2.49238 14.7953 2.52554 14.2464C7.77022 14.0078 12.4228 12.3375 16.7369 9.55353V7Z" fill="#FFC600"/>
<path d="M16.737 7L17.843 7.71373C21.8877 10.3238 26.195 11.8606 31.0401 12.081L32.9188 12.1665L33.0363 14.111C33.0712 14.6884 33.1075 15.2629 33.1435 15.8341C33.5316 21.9803 33.8955 27.745 32.2625 32.7126C30.3799 38.4397 26.0125 42.8092 17.4976 46.2524L16.737 46.56V44.2333C32.423 37.8902 31.8667 28.9773 31.0487 15.8719C31.0153 15.3371 30.9815 14.7953 30.9483 14.2464C25.7037 14.0078 21.0511 12.3375 16.737 9.55353V7Z" fill="#DB8300"/>
<path d="M11.5779 20.6339H12.3201C12.6165 20.6339 12.9008 20.7545 13.1104 20.9691C13.32 21.1837 13.4377 21.4748 13.4377 21.7784V33.396H10.4603V21.7784C10.4603 21.4748 10.578 21.1837 10.7876 20.9691C10.9972 20.7545 11.2815 20.6339 11.5779 20.6339ZM16.7347 26.2909H17.4769C17.7733 26.2909 18.0576 26.4115 18.2672 26.6261C18.4768 26.8408 18.5945 27.1319 18.5945 27.4354V33.396H15.6171V27.4354C15.6171 27.1319 15.7348 26.8408 15.9444 26.6261C16.154 26.4115 16.4383 26.2909 16.7347 26.2909ZM22.1989 24.1026H22.9411C23.2375 24.1026 23.5218 24.2232 23.7314 24.4378C23.941 24.6525 24.0587 24.9435 24.0587 25.2471V33.396H21.0813V25.2471C21.0813 24.9435 21.199 24.6525 21.4086 24.4378C21.6182 24.2232 21.9025 24.1026 22.1989 24.1026Z" fill="#FFC600"/>
<rect x="61" y="0.590149" width="31" height="51.9286" rx="5" fill="white"/>
<rect x="64" y="7.86017" width="25" height="37.3886" fill="#FFC600"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M60.7164 27.9228C61.4382 27.1534 61.4382 25.9556 60.7164 25.1861L51.9586 15.8505C50.7184 14.5284 48.5 15.406 48.5 17.2188V22.4002H44C42.8954 22.4002 42 23.2956 42 24.4002V28.7088C42 29.8133 42.8954 30.7088 44 30.7088H48.5V35.8901C48.5 37.7029 50.7184 38.5806 51.9586 37.2585L60.7164 27.9228Z" fill="#FFC600"/>
</svg>
This diff is collapsed.
<svg width="4" height="20" viewBox="0 0 4 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="2" cy="2" r="2" fill="#C4C4C4"/>
<circle cx="2" cy="10" r="2" fill="#C4C4C4"/>
<circle cx="2" cy="18" r="2" fill="#C4C4C4"/>
</svg>
<svg width="132" height="101" viewBox="0 0 132 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="path-1-outside-1" maskUnits="userSpaceOnUse" x="5.19354" y="26.5161" width="48" height="58" fill="black">
<rect fill="white" x="5.19354" y="26.5161" width="48" height="58"/>
<path d="M49.3242 31.1333C43.0891 29.9235 36.6391 30.4998 30.7172 32.7958C24.7954 35.0918 19.6427 39.0141 15.8528 44.1107C12.0628 49.2074 9.78985 55.2711 9.29572 61.6032C8.80158 67.9353 10.1064 74.2782 13.0598 79.9011L42.9032 64.2258L49.3242 31.1333Z"/>
</mask>
<path d="M49.3242 31.1333C43.0891 29.9235 36.6391 30.4998 30.7172 32.7958C24.7954 35.0918 19.6427 39.0141 15.8528 44.1107C12.0628 49.2074 9.78985 55.2711 9.29572 61.6032C8.80158 67.9353 10.1064 74.2782 13.0598 79.9011L42.9032 64.2258L49.3242 31.1333Z" stroke="#FFC600" stroke-width="6.12903" mask="url(#path-1-outside-1)"/>
<mask id="path-2-outside-2" maskUnits="userSpaceOnUse" x="5.19354" y="26.5161" width="75" height="75" fill="black">
<rect fill="white" x="5.19354" y="26.5161" width="75" height="75"/>
<path d="M49.3242 31.1333C40.6684 29.4538 31.6992 31.2325 24.3395 36.0881C16.9797 40.9437 11.8154 48.4895 9.9536 57.1079C8.09182 65.7262 9.68086 74.731 14.38 82.1916C19.0792 89.6521 26.5144 94.9746 35.0915 97.0178C43.6686 99.0611 52.7049 97.6625 60.263 93.1218C67.8211 88.5812 73.2993 81.2599 75.5231 72.7278C77.7469 64.1957 76.5393 55.1319 72.1592 47.4797C67.779 39.8275 60.5751 34.196 52.0918 31.7926L42.9032 64.2258L49.3242 31.1333Z"/>
</mask>
<path d="M49.3242 31.1333C40.6684 29.4538 31.6992 31.2325 24.3395 36.0881C16.9797 40.9437 11.8154 48.4895 9.9536 57.1079C8.09182 65.7262 9.68086 74.731 14.38 82.1916C19.0792 89.6521 26.5144 94.9746 35.0915 97.0178C43.6686 99.0611 52.7049 97.6625 60.263 93.1218C67.8211 88.5812 73.2993 81.2599 75.5231 72.7278C77.7469 64.1957 76.5393 55.1319 72.1592 47.4797C67.779 39.8275 60.5751 34.196 52.0918 31.7926L42.9032 64.2258L49.3242 31.1333Z" stroke="#FFC600" stroke-width="6.12903" stroke-linejoin="round" mask="url(#path-2-outside-2)"/>
<mask id="path-3-outside-3" maskUnits="userSpaceOnUse" x="5.19354" y="54.5161" width="41" height="29" fill="black">
<rect fill="white" x="5.19354" y="54.5161" width="41" height="29"/>
<path d="M13.1599 80.0901C9.48504 73.2003 8.31607 65.2484 9.85263 57.5925L42.9032 64.2258L13.1599 80.0901Z"/>
</mask>
<path d="M13.1599 80.0901C9.48504 73.2003 8.31607 65.2484 9.85263 57.5925L42.9032 64.2258L13.1599 80.0901Z" stroke="#FFC600" stroke-width="6.12903" stroke-linejoin="round" mask="url(#path-3-outside-3)"/>
<g clip-path="url(#clip0)">
<circle cx="94.6153" cy="19.3846" r="15.8549" fill="#121212" stroke="#D87B39" stroke-width="1.5"/>
<path d="M78.7552 19.9511L82.5315 22.9721L85.5525 17.6853L89.3287 25.993L93.8601 13.1539L97.6364 25.2378L101.413 16.1748L105 24.3893L108.21 19.0183L110.476 21.6504" stroke="#D87B39" stroke-width="1.5"/>
</g>
<g clip-path="url(#clip1)">
<circle cx="78" cy="51.2307" r="15.8549" fill="#121212" stroke="#3A98EC" stroke-width="1.5"/>
<path d="M62.8951 56.1199C63.7905 53.6578 66.7897 48.7336 71.6244 48.7336C77.6677 48.7336 77.6677 56.1199 83.7111 56.1199C88.5457 56.1199 90.4259 50.7481 93.1118 49.4051" stroke="#3A98EC" stroke-width="1.5"/>
</g>
<g clip-path="url(#clip2)">
<circle cx="114" cy="51.2307" r="15.8549" fill="#121212" stroke="#45D1B8" stroke-width="1.5"/>
<circle cx="108.713" cy="52.7413" r="3.77098" fill="#121212" stroke="#45D1B8" stroke-width="1.5"/>
<path d="M116.266 61.0437C117.514 61.0437 118.526 60.0316 118.526 58.7832C118.526 57.5348 117.514 56.5227 116.266 56.5227C115.017 56.5227 114.005 57.5348 114.005 58.7832C114.005 60.0316 115.017 61.0437 116.266 61.0437Z" fill="#121212" stroke="#45D1B8" stroke-width="1.5"/>
<path d="M115.51 53.4912C118.844 53.4912 121.547 50.7885 121.547 47.4545C121.547 44.1205 118.844 41.4178 115.51 41.4178C112.176 41.4178 109.474 44.1205 109.474 47.4545C109.474 50.7885 112.176 53.4912 115.51 53.4912Z" fill="#121212" stroke="#45D1B8" stroke-width="1.5"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="33.2308" height="33.2308" fill="white" transform="translate(78 2.76923)"/>
</clipPath>
<clipPath id="clip1">
<rect width="33.2308" height="33.2308" fill="white" transform="translate(61.3846 34.6154)"/>
</clipPath>
<clipPath id="clip2">
<rect width="33.2308" height="33.2308" fill="white" transform="translate(97.3846 34.6154)"/>
</clipPath>
</defs>
</svg>
<svg width="16" height="27" viewBox="0 0 16 27" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.5 11H1V26H15V11H11.5" stroke="#C4C4C4" stroke-width="1.5"/>
<path d="M8 17L8 3" stroke="#C4C4C4" stroke-width="1.5"/>
<path d="M13.4202 7.38441L8.03577 2L2.65135 7.38441" stroke="#C4C4C4" stroke-width="1.5"/>
</svg>
......@@ -5,7 +5,9 @@ import {
createMockStore,
mockInitialEcolyoState,
} from '../../../tests/__mocks__/store'
import mockClient from '../../../tests/__mocks__/client'
import TutorialWelcome from './TutorialWelcome'
import * as cc from 'cozy-client'
import { Button, IconButton } from '@material-ui/core'
import { act } from '@testing-library/react'
......@@ -31,14 +33,16 @@ jest.mock('components/Hooks/userInstanceSettings', () => ({
fetchStatus: 'string',
}),
}))
const mockCreateBodyWelcome = jest.fn()
const mockgetDefaultActions = jest.fn()
jest.mock('services/mail.service', () => {
jest.mock('notifications/welcome.hbs', () => {
return jest.fn(() => {
return {
CreateBodyWelcome: mockCreateBodyWelcome,
SendMail: mockgetDefaultActions,
}
return {}
})
})
jest.mock('mjml-browser', () => {
return jest.fn(() => {
return '<h1>Test</h1>'
})
})
......@@ -50,6 +54,25 @@ jest.mock('services/profile.service', () => {
}
})
})
jest.mock('notifications/welcome.hbs', () => {
return jest.fn(() => {
return {
welcomeTemplate: '<h1>Test</h1>',
}
})
})
jest.mock('mjml-browser', () => {
return jest.fn(() => {
return {
mjml2html: {
html: '<h1>Test</h1>',
},
}
})
})
describe('TutorialWelcome component', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let store: any
......@@ -83,6 +106,9 @@ describe('TutorialWelcome component', () => {
})
it('should change slides and end tutorial', async () => {
const mockUseClient = jest.spyOn(cc, 'useClient')
mockUseClient.mockReturnValue(mockClient)
const wrapper = mount(
<Provider store={store}>
<TutorialWelcome open={true} />
......@@ -92,6 +118,7 @@ describe('TutorialWelcome component', () => {
await new Promise(resolve => setTimeout(resolve))
wrapper.update()
})
// tmp.getStackClient().fetchJSON.mockResolvedValueOnce({})
expect(wrapper.find('.illu1')).toBeTruthy()
//click on next button and display next slide
......
......@@ -5,9 +5,12 @@ import { IconButton } from '@material-ui/core'
import Icon from 'cozy-ui/transpiled/react/Icon'
import { useClient } from 'cozy-client'
import { useDispatch } from 'react-redux'
import get from 'lodash/get'
import { updateProfile } from 'store/profile/profile.actions'
import MailService from 'services/mail.service'
import userInstanceSettings from 'components/Hooks/userInstanceSettings'
const welcomeTemplate = require('notifications/welcome.hbs')
const mjml2html = require('mjml-browser')
import Dialog from '@material-ui/core/Dialog'
import Button from '@material-ui/core/Button'
import CircleEmpty from 'assets/icons/ico/circleEmpty.svg'
......@@ -36,21 +39,26 @@ const TutorialWelcome: React.FC<TutorialWelcomeProps> = ({
if (instanceSettings.public_name !== '') {
username = instanceSettings.public_name
}
const bodyWelcome = mailService.CreateBodyWelcome(
username,
window.location.href
)
const template = welcomeTemplate({
title: 'Bienvenue sur Ecolyo !',
username: username,
clientUrl: client.options.uri,
})
const mailData = {
mode: 'noreply',
subject: '[Ecolyo] - Bienvenue',
parts: [
{
type: 'text/html',
body: bodyWelcome,
body: mjml2html(template).html,
},
],
}
mailService.SendMail(client, mailData)
dispatch(
updateProfile({
isFirstConnection: false,
......
export interface MonthlReport {
year: number
month: number
image: string
info: string
newsTitle: string
newsContent: string
question: string
link: string
}
<mj-section background-color="black">
<mj-section>
<mj-column vertical-align="middle">
<mj-image src="https://ecolyo.com/assets/logo-grandlyon.svg" alt="logo-grandlyon">
</mj-image>
</mj-column>
<mj-column vertical-align="middle">
<mj-image src="https://ecolyo.com/assets/logo-gouv.svg" alt="logo-gouvernement">
</mj-image>
</mj-column>
<mj-column vertical-align="middle" >
<mj-image src="https://ecolyo.com/assets/logo-territoire.svg" alt="logo-territoire" height="100px">
</mj-image>
</mj-column>
<mj-column vertical-align="middle">
<mj-image src="https://ecolyo.com/assets/logo-tiga-white.svg" alt="logo-tiga" >
</mj-image>
</mj-column>
</mj-section>
</mj-section>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment