fix: build works

pull/89/head
Pierre-Louis Guhur 2 years ago
parent bf22ec4c67
commit f05b668a5d

@ -3,7 +3,7 @@
*/ */
import {createContext, useContext, useReducer, useEffect} from 'react'; import {createContext, useContext, useReducer, useEffect} from 'react';
import {useRouter} from "next/router"; import {useRouter} from "next/router";
import {DEFAULT_NUM_GRADES} from '@services/constants'; import {DEFAULT_GRADES} from '@services/constants';
// Store data about an election // Store data about an election
const ElectionContext = createContext(null); const ElectionContext = createContext(null);
@ -115,7 +115,7 @@ const initialElection = {
title: "", title: "",
description: "", description: "",
candidates: [{...defaultCandidate}, {...defaultCandidate}], candidates: [{...defaultCandidate}, {...defaultCandidate}],
grades: DEFAULT_NUM_GRADES, grades: DEFAULT_GRADES,
isTimeLimited: false, isTimeLimited: false,
isRandomOrder: false, isRandomOrder: false,
restrictResult: true, restrictResult: true,

281
package-lock.json generated

@ -20,6 +20,7 @@
"clipboard": "^2.0.10", "clipboard": "^2.0.10",
"dotenv": "^8.6.0", "dotenv": "^8.6.0",
"eslint-config-next": "^13.0.0", "eslint-config-next": "^13.0.0",
"framer-motion": "^7.6.4",
"highcharts-react-official": "^3.1.0", "highcharts-react-official": "^3.1.0",
"i18next": "^22.0.3", "i18next": "^22.0.3",
"mailgun.js": "^3.3.2", "mailgun.js": "^3.3.2",
@ -30,6 +31,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-flags-select": "^2.2.3", "react-flags-select": "^2.2.3",
"react-i18next": "^12.0.0", "react-i18next": "^12.0.0",
"react-toastify": "^9.1.0",
"reactstrap": "^9.1.4", "reactstrap": "^9.1.4",
"sass": "^1.32.13" "sass": "^1.32.13"
}, },
@ -226,6 +228,21 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@emotion/is-prop-valid": {
"version": "0.8.8",
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
"integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
"optional": true,
"dependencies": {
"@emotion/memoize": "0.7.4"
}
},
"node_modules/@emotion/memoize": {
"version": "0.7.4",
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
"optional": true
},
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
@ -400,6 +417,64 @@
"@jridgewell/sourcemap-codec": "1.4.14" "@jridgewell/sourcemap-codec": "1.4.14"
} }
}, },
"node_modules/@motionone/animation": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/animation/-/animation-10.14.0.tgz",
"integrity": "sha512-h+1sdyBP8vbxEBW5gPFDnj+m2DCqdlAuf2g6Iafb1lcMnqjsRXWlPw1AXgvUMXmreyhqmPbJqoNfIKdytampRQ==",
"dependencies": {
"@motionone/easing": "^10.14.0",
"@motionone/types": "^10.14.0",
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"
}
},
"node_modules/@motionone/dom": {
"version": "10.13.1",
"resolved": "https://registry.npmjs.org/@motionone/dom/-/dom-10.13.1.tgz",
"integrity": "sha512-zjfX+AGMIt/fIqd/SL1Lj93S6AiJsEA3oc5M9VkUr+Gz+juRmYN1vfvZd6MvEkSqEjwPQgcjN7rGZHrDB9APfQ==",
"dependencies": {
"@motionone/animation": "^10.13.1",
"@motionone/generators": "^10.13.1",
"@motionone/types": "^10.13.0",
"@motionone/utils": "^10.13.1",
"hey-listen": "^1.0.8",
"tslib": "^2.3.1"
}
},
"node_modules/@motionone/easing": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/easing/-/easing-10.14.0.tgz",
"integrity": "sha512-2vUBdH9uWTlRbuErhcsMmt1jvMTTqvGmn9fHq8FleFDXBlHFs5jZzHJT9iw+4kR1h6a4SZQuCf72b9ji92qNYA==",
"dependencies": {
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"
}
},
"node_modules/@motionone/generators": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/generators/-/generators-10.14.0.tgz",
"integrity": "sha512-6kRHezoFfIjFN7pPpaxmkdZXD36tQNcyJe3nwVqwJ+ZfC0e3rFmszR8kp9DEVFs9QL/akWjuGPSLBI1tvz+Vjg==",
"dependencies": {
"@motionone/types": "^10.14.0",
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"
}
},
"node_modules/@motionone/types": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/types/-/types-10.14.0.tgz",
"integrity": "sha512-3bNWyYBHtVd27KncnJLhksMFQ5o2MSdk1cA/IZqsHtA9DnRM1SYgN01CTcJ8Iw8pCXF5Ocp34tyAjY7WRpOJJQ=="
},
"node_modules/@motionone/utils": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/utils/-/utils-10.14.0.tgz",
"integrity": "sha512-sLWBLPzRqkxmOTRzSaD3LFQXCPHvDzyHJ1a3VP9PRzBxyVd2pv51/gMOsdAcxQ9n+MIeGJnxzXBYplUHKj4jkw==",
"dependencies": {
"@motionone/types": "^10.14.0",
"hey-listen": "^1.0.8",
"tslib": "^2.3.1"
}
},
"node_modules/@next/env": { "node_modules/@next/env": {
"version": "13.0.0", "version": "13.0.0",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.0.tgz", "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.0.tgz",
@ -1189,6 +1264,14 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/clsx": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
"engines": {
"node": ">=6"
}
},
"node_modules/color-convert": { "node_modules/color-convert": {
"version": "1.9.3", "version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@ -2040,6 +2123,34 @@
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
}, },
"node_modules/framer-motion": {
"version": "7.6.4",
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-7.6.4.tgz",
"integrity": "sha512-Ac3Bl9M45fS8A0ibOUnYMSCfjaCrFfWT0uh0/MZVm/DGWcr5IsRRinWRiVGABA9RGJgn4THehqcn235JVQkucQ==",
"dependencies": {
"@motionone/dom": "10.13.1",
"framesync": "6.1.2",
"hey-listen": "^1.0.8",
"popmotion": "11.0.5",
"style-value-types": "5.1.2",
"tslib": "2.4.0"
},
"optionalDependencies": {
"@emotion/is-prop-valid": "^0.8.2"
},
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
}
},
"node_modules/framesync": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/framesync/-/framesync-6.1.2.tgz",
"integrity": "sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g==",
"dependencies": {
"tslib": "2.4.0"
}
},
"node_modules/fs.realpath": { "node_modules/fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@ -2249,6 +2360,11 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/hey-listen": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz",
"integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q=="
},
"node_modules/highcharts": { "node_modules/highcharts": {
"version": "10.2.1", "version": "10.2.1",
"resolved": "https://registry.npmjs.org/highcharts/-/highcharts-10.2.1.tgz", "resolved": "https://registry.npmjs.org/highcharts/-/highcharts-10.2.1.tgz",
@ -3198,6 +3314,17 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/popmotion": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/popmotion/-/popmotion-11.0.5.tgz",
"integrity": "sha512-la8gPM1WYeFznb/JqF4GiTkRRPZsfaj2+kCxqQgr2MJylMmIKUwBfWW8Wa5fml/8gmtlD5yI01MP1QCZPWmppA==",
"dependencies": {
"framesync": "6.1.2",
"hey-listen": "^1.0.8",
"style-value-types": "5.1.2",
"tslib": "2.4.0"
}
},
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.14", "version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
@ -3356,6 +3483,18 @@
"react-dom": "^16.8.0 || ^17 || ^18" "react-dom": "^16.8.0 || ^17 || ^18"
} }
}, },
"node_modules/react-toastify": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.0.tgz",
"integrity": "sha512-63i/5SROvfYz9yzdkmxIrpndtggTdif/5ZpswY3VH+s2/S1Hxo/hiv+oGXnPH6UO2pJBOgfcLNeyVh7okRmnhg==",
"dependencies": {
"clsx": "^1.1.1"
},
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
}
},
"node_modules/react-transition-group": { "node_modules/react-transition-group": {
"version": "4.4.5", "version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
@ -3683,6 +3822,15 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/style-value-types": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.1.2.tgz",
"integrity": "sha512-Vs9fNreYF9j6W2VvuDTP7kepALi7sk0xtk2Tu8Yxi9UoajJdEVpNpCov0HsLTqXvNGKX+Uv09pkozVITi1jf3Q==",
"dependencies": {
"hey-listen": "^1.0.8",
"tslib": "2.4.0"
}
},
"node_modules/styled-jsx": { "node_modules/styled-jsx": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz",
@ -4126,6 +4274,21 @@
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
"@emotion/is-prop-valid": {
"version": "0.8.8",
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
"integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
"optional": true,
"requires": {
"@emotion/memoize": "0.7.4"
}
},
"@emotion/memoize": {
"version": "0.7.4",
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
"optional": true
},
"@eslint/eslintrc": { "@eslint/eslintrc": {
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz",
@ -4246,6 +4409,64 @@
"@jridgewell/sourcemap-codec": "1.4.14" "@jridgewell/sourcemap-codec": "1.4.14"
} }
}, },
"@motionone/animation": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/animation/-/animation-10.14.0.tgz",
"integrity": "sha512-h+1sdyBP8vbxEBW5gPFDnj+m2DCqdlAuf2g6Iafb1lcMnqjsRXWlPw1AXgvUMXmreyhqmPbJqoNfIKdytampRQ==",
"requires": {
"@motionone/easing": "^10.14.0",
"@motionone/types": "^10.14.0",
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"
}
},
"@motionone/dom": {
"version": "10.13.1",
"resolved": "https://registry.npmjs.org/@motionone/dom/-/dom-10.13.1.tgz",
"integrity": "sha512-zjfX+AGMIt/fIqd/SL1Lj93S6AiJsEA3oc5M9VkUr+Gz+juRmYN1vfvZd6MvEkSqEjwPQgcjN7rGZHrDB9APfQ==",
"requires": {
"@motionone/animation": "^10.13.1",
"@motionone/generators": "^10.13.1",
"@motionone/types": "^10.13.0",
"@motionone/utils": "^10.13.1",
"hey-listen": "^1.0.8",
"tslib": "^2.3.1"
}
},
"@motionone/easing": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/easing/-/easing-10.14.0.tgz",
"integrity": "sha512-2vUBdH9uWTlRbuErhcsMmt1jvMTTqvGmn9fHq8FleFDXBlHFs5jZzHJT9iw+4kR1h6a4SZQuCf72b9ji92qNYA==",
"requires": {
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"
}
},
"@motionone/generators": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/generators/-/generators-10.14.0.tgz",
"integrity": "sha512-6kRHezoFfIjFN7pPpaxmkdZXD36tQNcyJe3nwVqwJ+ZfC0e3rFmszR8kp9DEVFs9QL/akWjuGPSLBI1tvz+Vjg==",
"requires": {
"@motionone/types": "^10.14.0",
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"
}
},
"@motionone/types": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/types/-/types-10.14.0.tgz",
"integrity": "sha512-3bNWyYBHtVd27KncnJLhksMFQ5o2MSdk1cA/IZqsHtA9DnRM1SYgN01CTcJ8Iw8pCXF5Ocp34tyAjY7WRpOJJQ=="
},
"@motionone/utils": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/@motionone/utils/-/utils-10.14.0.tgz",
"integrity": "sha512-sLWBLPzRqkxmOTRzSaD3LFQXCPHvDzyHJ1a3VP9PRzBxyVd2pv51/gMOsdAcxQ9n+MIeGJnxzXBYplUHKj4jkw==",
"requires": {
"@motionone/types": "^10.14.0",
"hey-listen": "^1.0.8",
"tslib": "^2.3.1"
}
},
"@next/env": { "@next/env": {
"version": "13.0.0", "version": "13.0.0",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.0.tgz", "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.0.tgz",
@ -4742,6 +4963,11 @@
"shallow-clone": "^3.0.0" "shallow-clone": "^3.0.0"
} }
}, },
"clsx": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg=="
},
"color-convert": { "color-convert": {
"version": "1.9.3", "version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@ -5376,6 +5602,28 @@
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
}, },
"framer-motion": {
"version": "7.6.4",
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-7.6.4.tgz",
"integrity": "sha512-Ac3Bl9M45fS8A0ibOUnYMSCfjaCrFfWT0uh0/MZVm/DGWcr5IsRRinWRiVGABA9RGJgn4THehqcn235JVQkucQ==",
"requires": {
"@emotion/is-prop-valid": "^0.8.2",
"@motionone/dom": "10.13.1",
"framesync": "6.1.2",
"hey-listen": "^1.0.8",
"popmotion": "11.0.5",
"style-value-types": "5.1.2",
"tslib": "2.4.0"
}
},
"framesync": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/framesync/-/framesync-6.1.2.tgz",
"integrity": "sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g==",
"requires": {
"tslib": "2.4.0"
}
},
"fs.realpath": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@ -5518,6 +5766,11 @@
"has-symbols": "^1.0.2" "has-symbols": "^1.0.2"
} }
}, },
"hey-listen": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz",
"integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q=="
},
"highcharts": { "highcharts": {
"version": "10.2.1", "version": "10.2.1",
"resolved": "https://registry.npmjs.org/highcharts/-/highcharts-10.2.1.tgz", "resolved": "https://registry.npmjs.org/highcharts/-/highcharts-10.2.1.tgz",
@ -6135,6 +6388,17 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
}, },
"popmotion": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/popmotion/-/popmotion-11.0.5.tgz",
"integrity": "sha512-la8gPM1WYeFznb/JqF4GiTkRRPZsfaj2+kCxqQgr2MJylMmIKUwBfWW8Wa5fml/8gmtlD5yI01MP1QCZPWmppA==",
"requires": {
"framesync": "6.1.2",
"hey-listen": "^1.0.8",
"style-value-types": "5.1.2",
"tslib": "2.4.0"
}
},
"postcss": { "postcss": {
"version": "8.4.14", "version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
@ -6229,6 +6493,14 @@
"warning": "^4.0.2" "warning": "^4.0.2"
} }
}, },
"react-toastify": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.0.tgz",
"integrity": "sha512-63i/5SROvfYz9yzdkmxIrpndtggTdif/5ZpswY3VH+s2/S1Hxo/hiv+oGXnPH6UO2pJBOgfcLNeyVh7okRmnhg==",
"requires": {
"clsx": "^1.1.1"
}
},
"react-transition-group": { "react-transition-group": {
"version": "4.4.5", "version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
@ -6449,6 +6721,15 @@
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
}, },
"style-value-types": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-5.1.2.tgz",
"integrity": "sha512-Vs9fNreYF9j6W2VvuDTP7kepALi7sk0xtk2Tu8Yxi9UoajJdEVpNpCov0HsLTqXvNGKX+Uv09pkozVITi1jf3Q==",
"requires": {
"hey-listen": "^1.0.8",
"tslib": "2.4.0"
}
},
"styled-jsx": { "styled-jsx": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz",

@ -22,6 +22,7 @@
"clipboard": "^2.0.10", "clipboard": "^2.0.10",
"dotenv": "^8.6.0", "dotenv": "^8.6.0",
"eslint-config-next": "^13.0.0", "eslint-config-next": "^13.0.0",
"framer-motion": "^7.6.4",
"highcharts-react-official": "^3.1.0", "highcharts-react-official": "^3.1.0",
"i18next": "^22.0.3", "i18next": "^22.0.3",
"mailgun.js": "^3.3.2", "mailgun.js": "^3.3.2",
@ -32,6 +33,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-flags-select": "^2.2.3", "react-flags-select": "^2.2.3",
"react-i18next": "^12.0.0", "react-i18next": "^12.0.0",
"react-toastify": "^9.1.0",
"reactstrap": "^9.1.4", "reactstrap": "^9.1.4",
"sass": "^1.32.13" "sass": "^1.32.13"
}, },

@ -3,20 +3,20 @@ import Head from "next/head";
import {useRouter} from "next/router"; import {useRouter} from "next/router";
import {useTranslation} from "next-i18next"; import {useTranslation} from "next-i18next";
import {serverSideTranslations} from "next-i18next/serverSideTranslations"; import {serverSideTranslations} from "next-i18next/serverSideTranslations";
// import { import {
// Collapse, Collapse,
// Container, Container,
// Row, Row,
// Col, Col,
// Input, Input,
// Label, Label,
// InputGroup, InputGroup,
// InputGroupAddon, InputGroupAddon,
// Button, Button,
// Card, Card,
// CardBody, CardBody,
// Modal, ModalHeader, ModalBody, ModalFooter, CustomInput Modal, ModalHeader, ModalBody, ModalFooter, CustomInput
// } from "reactstrap"; } from "reactstrap";
// import {ReactMultiEmail, isEmail} from "react-multi-email"; // import {ReactMultiEmail, isEmail} from "react-multi-email";
// import "react-multi-email/style.css"; // import "react-multi-email/style.css";
// import {toast, ToastContainer} from "react-toastify"; // import {toast, ToastContainer} from "react-toastify";
@ -43,439 +43,441 @@ import {serverSideTranslations} from "next-i18next/serverSideTranslations";
// Error messages // Error messages
const AT_LEAST_2_CANDIDATES_ERROR = "Please add at least 2 candidates."; // const AT_LEAST_2_CANDIDATES_ERROR = "Please add at least 2 candidates.";
const NO_TITLE_ERROR = "Please add a title."; // const NO_TITLE_ERROR = "Please add a title.";
//
const isValidDate = (date) => date instanceof Date && !isNaN(date); // const isValidDate = (date) => date instanceof Date && !isNaN(date);
const getOnlyValidDate = (date) => (isValidDate(date) ? date : new Date()); // const getOnlyValidDate = (date) => (isValidDate(date) ? date : new Date());
//
// Convert a Date object into YYYY-MM-DD // // Convert a Date object into YYYY-MM-DD
const dateToISO = (date) => // const dateToISO = (date) =>
getOnlyValidDate(date).toISOString().substring(0, 10); // getOnlyValidDate(date).toISOString().substring(0, 10);
//
// Retrieve the current hour, minute, sec, ms, time into a timestamp // // Retrieve the current hour, minute, sec, ms, time into a timestamp
const hours = (date) => getOnlyValidDate(date).getHours() * 3600 * 1000; // const hours = (date) => getOnlyValidDate(date).getHours() * 3600 * 1000;
const minutes = (date) => getOnlyValidDate(date).getMinutes() * 60 * 1000; // const minutes = (date) => getOnlyValidDate(date).getMinutes() * 60 * 1000;
const seconds = (date) => getOnlyValidDate(date).getSeconds() * 1000; // const seconds = (date) => getOnlyValidDate(date).getSeconds() * 1000;
const ms = (date) => getOnlyValidDate(date).getMilliseconds(); // const ms = (date) => getOnlyValidDate(date).getMilliseconds();
const time = (date) => // const time = (date) =>
hours(getOnlyValidDate(date)) + // hours(getOnlyValidDate(date)) +
minutes(getOnlyValidDate(date)) + // minutes(getOnlyValidDate(date)) +
seconds(getOnlyValidDate(date)) + // seconds(getOnlyValidDate(date)) +
ms(getOnlyValidDate(date)); // ms(getOnlyValidDate(date));
//
// Retrieve the time part from a timestamp and remove the day. Return a int. // // Retrieve the time part from a timestamp and remove the day. Return a int.
const timeMinusDate = (date) => time(getOnlyValidDate(date)); // const timeMinusDate = (date) => time(getOnlyValidDate(date));
//
// Retrieve the day and remove the time. Return a Date // // Retrieve the day and remove the time. Return a Date
const dateMinusTime = (date) => // const dateMinusTime = (date) =>
new Date(getOnlyValidDate(date).getTime() - time(getOnlyValidDate(date))); // new Date(getOnlyValidDate(date).getTime() - time(getOnlyValidDate(date)));
//
const displayClockOptions = () => // const displayClockOptions = () =>
Array(24) // Array(24)
.fill(1) // .fill(1)
.map((x, i) => ( // .map((x, i) => (
<option value={i} key={i}> // <option value={i} key={i}>
{i}h00 // {i}h00
</option> // </option>
)); // ));
export const getStaticProps = async ({locale}) => ({ export const getStaticProps = async ({locale}) => ({
props: { props: {
...(await serverSideTranslations(locale, [])), ...(await serverSideTranslations(locale, ['resource'])),
}, },
}); });
const CreateElection = (props) => { const CreateElection = (props) => {
const {t} = useTranslation(); // const {t} = useTranslation();
// default value : start at the last hour // // default value : start at the last hour
const now = new Date(); // const now = new Date();
const [title, setTitle] = useState(""); // const [title, setTitle] = useState("");
const [candidates, setCandidates] = useState([{label: ""}, {description: ""}]); // const [candidates, setCandidates] = useState([{label: ""}, {description: ""}]);
const [numGrades, setNumGrades] = useState(5); // const [numGrades, setNumGrades] = useState(5);
const [waiting, setWaiting] = useState(false); // const [waiting, setWaiting] = useState(false);
const [isAdvancedOptionsOpen, setAdvancedOptionsOpen] = useState(false); // const [isAdvancedOptionsOpen, setAdvancedOptionsOpen] = useState(false);
const [isAddCandidateMOpen, setAddCandidateMOpen] = useState(false); // const [isAddCandidateMOpen, setAddCandidateMOpen] = useState(false);
const [isTimeLimited, setTimeLimited] = useState(false); // const [isTimeLimited, setTimeLimited] = useState(false);
const [restrictResult, setRestrictResult] = useState(false); // const [restrictResult, setRestrictResult] = useState(false);
const [restrictVote, setRestrictVote] = useState(false); // const [restrictVote, setRestrictVote] = useState(false);
const [start, setStart] = useState( // const [start, setStart] = useState(
new Date(now.getTime() - minutes(now) - seconds(now) - ms(now)) // new Date(now.getTime() - minutes(now) - seconds(now) - ms(now))
); // );
const [finish, setFinish] = useState( // const [finish, setFinish] = useState(
new Date(start.getTime() + 7 * 24 * 3600 * 1000) // new Date(start.getTime() + 7 * 24 * 3600 * 1000)
); // );
const [emails, setEmails] = useState([]); // const [emails, setEmails] = useState([]);
// set the title on loading // // set the title on loading
const router = useRouter(); // const router = useRouter();
useEffect(() => { // useEffect(() => {
if (!router.isReady) return; // if (!router.isReady) return;
const {title: urlTitle} = router.query; // const {title: urlTitle} = router.query;
setTitle(urlTitle || ""); // setTitle(urlTitle || "");
}, [router.isReady]); // }, [router.isReady]);
const handleIsTimeLimited = (event) => { // const handleIsTimeLimited = (event) => {
setTimeLimited(event.target.value === "1"); // setTimeLimited(event.target.value === "1");
}; // };
const handleRestrictResultCheck = (event) => { // const handleRestrictResultCheck = (event) => {
setRestrictResult(event.target.value === "1"); // setRestrictResult(event.target.value === "1");
}; // };
const handleRestrictVote = (event) => { // const handleRestrictVote = (event) => {
setRestrictVote(event.target.value === "1"); // setRestrictVote(event.target.value === "1");
}; // };
const toggleAdvancedOptions = () => { // const toggleAdvancedOptions = () => {
setAdvancedOptionsOpen(!isAdvancedOptionsOpen); // setAdvancedOptionsOpen(!isAdvancedOptionsOpen);
}; // };
const toggleAddCandidateM = () => { // const toggleAddCandidateM = () => {
setAddCandidateMOpen(!isAddCandidateMOpen); // setAddCandidateMOpen(!isAddCandidateMOpen);
}; // };
const addCandidate = () => { // const addCandidate = () => {
if (candidates.length < 1000) { // if (candidates.length < 1000) {
candidates.push({label: ""}); // candidates.push({label: ""});
setCandidates(candidates); // setCandidates(candidates);
} // }
}; // };
const checkFields = () => { // const checkFields = () => {
if (!candidates) { // if (!candidates) {
return {ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR}; // return {ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR};
} // }
let numCandidates = 0; // let numCandidates = 0;
candidates.forEach((c) => { // candidates.forEach((c) => {
if (c.label !== "") numCandidates += 1; // if (c.label !== "") numCandidates += 1;
}); // });
if (numCandidates < 2) { // if (numCandidates < 2) {
return {ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR}; // return {ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR};
} // }
if (!title || title === "") { // if (!title || title === "") {
return {ok: false, msg: NO_TITLE_ERROR}; // return {ok: false, msg: NO_TITLE_ERROR};
} // }
return {ok: true, msg: "OK"}; // return {ok: true, msg: "OK"};
}; // };
const handleSubmit = () => { // const handleSubmit = () => {
const check = checkFields(); // const check = checkFields();
if (!check.ok) { // if (!check.ok) {
toast.error(t(check.msg), { // toast.error(t(check.msg), {
position: toast.POSITION.TOP_CENTER, // position: toast.POSITION.TOP_CENTER,
}); // });
return; // return;
} // }
setWaiting(true); // setWaiting(true);
createElection( // createElection(
title, // title,
candidates.map((c) => c.label).filter((c) => c !== ""), // candidates.map((c) => c.label).filter((c) => c !== ""),
{ // {
mails: emails, // mails: emails,
numGrades, // numGrades,
start: start.getTime() / 1000, // start: start.getTime() / 1000,
finish: finish.getTime() / 1000, // finish: finish.getTime() / 1000,
restrictResult: restrictResult, // restrictResult: restrictResult,
restrictVote: restrictVote, // restrictVote: restrictVote,
locale: router.locale.substring(0, 2).toLowerCase(), // locale: router.locale.substring(0, 2).toLowerCase(),
}, // },
(result) => { // (result) => {
if (result.id) { // if (result.id) {
router.push(`/new/confirm/${result.id}`); // router.push(`/new/confirm/${result.id}`);
} else { // } else {
toast.error(t("Unknown error. Try again please."), { // toast.error(t("Unknown error. Try again please."), {
position: toast.POSITION.TOP_CENTER, // position: toast.POSITION.TOP_CENTER,
}); // });
setWaiting(false); // setWaiting(false);
} // }
} // }
); // );
}; // };
const [visibled, setVisibility] = useState(false); // const [visibled, setVisibility] = useState(false);
const toggle = () => setVisibility(!visibled) // const toggle = () => setVisibility(!visibled)
const handleSendNotReady = (msg) => { // const handleSendNotReady = (msg) => {
toast.error(t(msg), { // toast.error(t(msg), {
position: toast.POSITION.TOP_CENTER, // position: toast.POSITION.TOP_CENTER,
}); // });
}; // };
const check = checkFields(); // const check = checkFields();
const grades = translateGrades(t); // const grades = translateGrades(t);
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
return ( return (
<Container className="addCandidatePage"> <p>FOO</p>);
<Head> }
<meta // <Container className="addCandidatePage">
key="og:title" // <Head>
property="og:title" // <meta
content={t("common.application")} // key="og:title"
/> // property="og:title"
<meta // content={t("common.application")}
property="og:description" // />
key="og:description" // <meta
content={t("resource.valueProp")} // property="og:description"
/> // key="og:description"
</Head> // content={t("resource.valueProp")}
<ToastContainer /> // />
{waiting ? <Loader /> : ""} // </Head>
<form onSubmit={handleSubmit} autoComplete="off"> // <ToastContainer />
<Row className="stepForm"> // {waiting ? <Loader /> : ""}
<Col className="stepFormCol"> // <form onSubmit={handleSubmit} autoComplete="off">
<img src="/icone-one-white.svg" /> // <Row className="stepForm">
<h4>Les candidats</h4> // <Col className="stepFormCol">
</Col> // <img src="/icone-one-white.svg" />
<Col className="stepFormCol"> // <h4>Les candidats</h4>
<img src="/icone-two-dark.svg" /> // </Col>
<h4>Paramètres du vote</h4> // <Col className="stepFormCol">
</Col> // <img src="/icone-two-dark.svg" />
<Col className="stepFormCol"> // <h4>Paramètres du vote</h4>
<img src="/icone-three-dark.svg" /> // </Col>
<h4>Confirmation</h4> // <Col className="stepFormCol">
// <img src="/icone-three-dark.svg" />
</Col> // <h4>Confirmation</h4>
</Row> //
// </Col>
<div className="settings-modal-body"> // </Row>
<Row> //
<Col xs="10" lg="10"> // <div className="settings-modal-body">
<Label for="title">{t("Access to results")} {t("Immediately")}</Label> // <Row>
<p>{t("No one will be able to see the result until the end date is reached or until all participants have voted.")}</p> // <Col xs="10" lg="10">
</Col> // <Label for="title">{t("Access to results")} {t("Immediately")}</Label>
<Col l xs="2" lg="2"> // <p>{t("No one will be able to see the result until the end date is reached or until all participants have voted.")}</p>
<CustomInput // </Col>
type="switch" // <Col l xs="2" lg="2">
id="restrict_result_false" // <CustomInput
name={handleRestrictResultCheck} // type="switch"
/> // id="restrict_result_false"
</Col> // name={handleRestrictResultCheck}
</Row> // />
<hr className="mt-2 mb-2" /> // </Col>
<Row> // </Row>
<Col md="10"> // <hr className="mt-2 mb-2" />
<Label for="title">{t("Voting time")}</Label> // <Row>
</Col> // <Col md="10">
<Col l md="2"> // <Label for="title">{t("Voting time")}</Label>
<CustomInput // </Col>
type="switch" // <Col l md="2">
id="is_time_limited_true" // <CustomInput
name={handleIsTimeLimited} // type="switch"
value={"1"} // id="is_time_limited_true"
/> // name={handleIsTimeLimited}
</Col> // value={"1"}
</Row> // />
<div // </Col>
className={ // </Row>
(isTimeLimited ? "d-block " : "d-none") + " bg-light p-3" // <div
} // className={
> // (isTimeLimited ? "d-block " : "d-none") + " bg-light p-3"
<Row> // }
<Col xs="12" md="3" lg="3"> // >
<span className="label">- {t("Starting date")}</span> // <Row>
</Col> // <Col xs="12" md="3" lg="3">
<Col xs="6" md="4" lg="3"> // <span className="label">- {t("Starting date")}</span>
<input // </Col>
className="form-control" // <Col xs="6" md="4" lg="3">
type="date" // <input
value={dateToISO(start)} // className="form-control"
onChange={(e) => { // type="date"
setStart( // value={dateToISO(start)}
new Date( // onChange={(e) => {
timeMinusDate(start) + // setStart(
new Date(e.target.valueAsNumber).getTime() // new Date(
) // timeMinusDate(start) +
); // new Date(e.target.valueAsNumber).getTime()
}} // )
/> // );
</Col> // }}
<Col xs="6" md="5" lg="3"> // />
<select // </Col>
className="form-control" // <Col xs="6" md="5" lg="3">
value={getOnlyValidDate(start).getHours()} // <select
onChange={(e) => // className="form-control"
setStart( // value={getOnlyValidDate(start).getHours()}
new Date( // onChange={(e) =>
dateMinusTime(start).getTime() + // setStart(
e.target.value * 3600000 // new Date(
) // dateMinusTime(start).getTime() +
) // e.target.value * 3600000
} // )
> // )
{displayClockOptions()} // }
</select> // >
</Col> // {displayClockOptions()}
</Row> // </select>
// </Col>
<Row className="mt-2"> // </Row>
<Col xs="12" md="3" lg="3"> //
<span className="label">- {t("Ending date")}</span> // <Row className="mt-2">
</Col> // <Col xs="12" md="3" lg="3">
<Col xs="6" md="4" lg="3"> // <span className="label">- {t("Ending date")}</span>
<input // </Col>
className="form-control" // <Col xs="6" md="4" lg="3">
type="date" // <input
value={dateToISO(finish)} // className="form-control"
min={dateToISO(start)} // type="date"
onChange={(e) => { // value={dateToISO(finish)}
setFinish( // min={dateToISO(start)}
new Date( // onChange={(e) => {
timeMinusDate(finish) + // setFinish(
new Date(e.target.valueAsNumber).getTime() // new Date(
) // timeMinusDate(finish) +
); // new Date(e.target.valueAsNumber).getTime()
}} // )
/> // );
</Col> // }}
<Col xs="6" md="5" lg="3"> // />
<select // </Col>
className="form-control" // <Col xs="6" md="5" lg="3">
value={getOnlyValidDate(finish).getHours()} // <select
onChange={(e) => // className="form-control"
setFinish( // value={getOnlyValidDate(finish).getHours()}
new Date( // onChange={(e) =>
dateMinusTime(finish).getTime() + // setFinish(
e.target.value * 3600000 // new Date(
) // dateMinusTime(finish).getTime() +
) // e.target.value * 3600000
} // )
> // )
{displayClockOptions()} // }
</select> // >
</Col> // {displayClockOptions()}
</Row> // </select>
</div> // </Col>
<hr className="mt-2 mb-2" /> // </Row>
<Row> // </div>
<Col xs="9"> // <hr className="mt-2 mb-2" />
<Label>{t("Grades")}</Label> // <Row>
<p>{t("You can select here the number of grades for your election")}</p> // <Col xs="9">
</Col> // <Label>{t("Grades")}</Label>
<Col xs="3"> // <p>{t("You can select here the number of grades for your election")}</p>
<div className="numGradesContainer justify-content-end" tabIndex={candidates.length + 3} // </Col>
onChange={(e) => setNumGrades(e.target.value)}> // <Col xs="3">
<Label className="numGrades"> // <div className="numGradesContainer justify-content-end" tabIndex={candidates.length + 3}
<Input type="radio" name="radio" value="5" /> // onChange={(e) => setNumGrades(e.target.value)}>
<div className="customCheckmarck numGradeFive"></div> // <Label className="numGrades">
</Label> // <Input type="radio" name="radio" value="5" />
<Label className="numGrades"> // <div className="customCheckmarck numGradeFive"></div>
<Input type="radio" checked="checked" name="radio" value="6" /> // </Label>
<div className="customCheckmarck numGradeSix"></div> // <Label className="numGrades">
</Label> // <Input type="radio" checked="checked" name="radio" value="6" />
<Label className="numGrades"> // <div className="customCheckmarck numGradeSix"></div>
<Input type="radio" name="radio" value="7" /> // </Label>
<div className="customCheckmarck numGradeSeven"></div> // <Label className="numGrades">
</Label> // <Input type="radio" name="radio" value="7" />
</div> // <div className="customCheckmarck numGradeSeven"></div>
</Col> // </Label>
<Col // </div>
xs="12" // </Col>
md="9" // <Col
lg="9" // xs="12"
> // md="9"
{grades.map((mention, i) => { // lg="9"
return ( // >
<span // {grades.map((mention, i) => {
key={i} // return (
className="badge badge-light mr-2 mt-2 " // <span
style={{ // key={i}
backgroundColor: mention.color, // className="badge badge-light mr-2 mt-2 "
color: "#fff", // style={{
opacity: i < numGrades ? 1 : 0.3, // backgroundColor: mention.color,
}} // color: "#fff",
> // opacity: i < numGrades ? 1 : 0.3,
{mention.label} // }}
</span> // >
); // {mention.label}
})} // </span>
</Col> // );
</Row> // })}
<hr className="mt-2 mb-2" /> // </Col>
<Row> // </Row>
<Col xs="10" lg="10"> // <hr className="mt-2 mb-2" />
<Label for="title">{t("Vote privée")}</Label> // <Row>
<p>{t("Uniquement les personnes invités par mail pourront participé au vote")}</p> // <Col xs="10" lg="10">
</Col> // <Label for="title">{t("Vote privée")}</Label>
<Col l xs="2" lg="2"> // <p>{t("Uniquement les personnes invités par mail pourront participé au vote")}</p>
<CustomInput // </Col>
type="switch" // <Col l xs="2" lg="2">
id="restrict_vote_false" // <CustomInput
name={handleRestrictVote} // type="switch"
/> // id="restrict_vote_false"
</Col> // name={handleRestrictVote}
</Row> // />
<hr className="mt-2 mb-2" /> // </Col>
<Row> // </Row>
<Col xs="12"> // <hr className="mt-2 mb-2" />
<Label>{t("Participants")}</Label> // <Row>
<p>{t("If you list voters' emails, only them will be able to access the election")}</p> // <Col xs="12">
<ReactMultiEmail // <Label>{t("Participants")}</Label>
placeholder={t("Add here participants' emails")} // <p>{t("If you list voters' emails, only them will be able to access the election")}</p>
emails={emails} // <ReactMultiEmail
onChange={setEmails} // placeholder={t("Add here participants' emails")}
validateEmail={(email) => { // emails={emails}
return isEmail(email); // return boolean // onChange={setEmails}
}} // validateEmail={(email) => {
getLabel={(email, index, removeEmail) => { // return isEmail(email); // return boolean
return ( // }}
<div data-tag key={index}> // getLabel={(email, index, removeEmail) => {
{email} // return (
<span // <div data-tag key={index}>
data-tag-handle // {email}
onClick={() => removeEmail(index)} // <span
> // data-tag-handle
× // onClick={() => removeEmail(index)}
</span> // >
</div> // ×
); // </span>
}} // </div>
/> // );
<div className="mt-2 mailMutedText"> // }}
<small className="text-muted"> // />
<FontAwesomeIcon icon={faExclamationCircle} className="mr-2" /> // <div className="mt-2 mailMutedText">
{t("Copier-coller les emails des participants depuis un fichier Excel")} // <small className="text-muted">
</small> // <FontAwesomeIcon icon={faExclamationCircle} className="mr-2" />
</div> // {t("Copier-coller les emails des participants depuis un fichier Excel")}
</Col> // </small>
</Row> // </div>
<hr className="mt-2 mb-2" /> // </Col>
<Col xs="12" md="3"> // </Row>
// <hr className="mt-2 mb-2" />
</Col> // <Col xs="12" md="3">
</div> //
<div className="justify-content-center"> // </Col>
{check.ok ? ( // </div>
<ConfirmModal // <div className="justify-content-center">
title={title} // {check.ok ? (
candidates={candidates} // <ConfirmModal
isTimeLimited={isTimeLimited} // title={title}
start={start} // candidates={candidates}
finish={finish} // isTimeLimited={isTimeLimited}
emails={emails} // start={start}
restrictResult={restrictResult} // finish={finish}
restrictVote={restrictVote} // emails={emails}
grades={grades.slice(0, numGrades)} // restrictResult={restrictResult}
className={"btn float-right btn-block"} // restrictVote={restrictVote}
tabIndex={candidates.length + 1} // grades={grades.slice(0, numGrades)}
confirmCallback={handleSubmit} // className={"btn float-right btn-block"}
/> // tabIndex={candidates.length + 1}
) : ( // confirmCallback={handleSubmit}
// />
<Button onClick={toggle} className="cursorPointer btn-validation mb-5" >{t("Confirm")}<img src="/arrow-white.svg" /></Button> // ) : (
//
)} // <Button onClick={toggle} className="cursorPointer btn-validation mb-5" >{t("Confirm")}<img src="/arrow-white.svg" /></Button>
</div></form> //
// )}
// </div></form>
</Container > //
); //
}; // </Container >
// );
// };
export default CreateElection; export default CreateElection;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save