From bb2df817a03b13ca30f620131435ea2aa7c312d6 Mon Sep 17 00:00:00 2001 From: y72wvh Date: Tue, 2 Apr 2024 08:24:05 +0200 Subject: [PATCH 01/25] feat: automatic opening and closing of the questionnaire access button --- src/components/main.js | 4 +- src/components/template/footer-menu.js | 4 +- src/components/template/menu.js | 6 +- src/components/template/response-button.js | 68 +++++++++++++--------- src/utils/api/api.js | 12 +++- src/utils/properties.js | 2 + src/utils/read-content.js | 5 +- 7 files changed, 65 insertions(+), 36 deletions(-) diff --git a/src/components/main.js b/src/components/main.js index 2d655e1..2496796 100644 --- a/src/components/main.js +++ b/src/components/main.js @@ -221,7 +221,9 @@ render={routeProps => -
{showResponseButton && }
+
+ {showResponseButton && } +
)} diff --git a/src/components/template/footer-menu.js b/src/components/template/footer-menu.js index b2e84d6..8c26d5d 100644 --- a/src/components/template/footer-menu.js +++ b/src/components/template/footer-menu.js @@ -4,7 +4,7 @@ import { Navbar, Nav, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; import logoTwitter from 'img/common/logo-twitter.png'; import { urlInseeFr } from 'utils/properties'; -import { getIsSurveyOnlineById } from 'utils/read-content'; +import { isSurveyOnLine } from 'utils/api'; function FooterMenu({ path, home, id }) { const [isDesktop, setIsDesktop] = useState(window.innerWidth > 767); @@ -44,7 +44,7 @@ function FooterMenu({ path, home, id }) { {`Questions/réponses`} - {getIsSurveyOnlineById(id) && ( + {isSurveyOnLine(id) && ( {`Contacter l'assistance`} diff --git a/src/components/template/menu.js b/src/components/template/menu.js index c09b1b6..b0e2fe1 100644 --- a/src/components/template/menu.js +++ b/src/components/template/menu.js @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { urlInseeFr } from 'utils/properties'; import logoTwitter from 'img/common/logo-twitter.png'; import { getResultsMenuTitle, getSurveyDetailLink } from 'utils/read-content'; -import { getIsSurveyOnlineById } from '../../utils/read-content'; +import { isSurveyOnLine } from 'utils/api'; function Menu({ id }) { const [isDesktop, setIsDesktop] = useState(window.innerWidth > 767); @@ -40,7 +40,7 @@ function Menu({ id }) { to={`/${id}/login`} eventKey={1} id="menuItemRepondre" - disabled={!getIsSurveyOnlineById(id)} + disabled={!isSurveyOnLine(id)} > {`Accéder au questionnaire`} @@ -66,7 +66,7 @@ function Menu({ id }) { {`Questions/réponses`} - {getIsSurveyOnlineById(id) && ( + {isSurveyOnLine(id) && ( {`Contacter l'assistance`} diff --git a/src/components/template/response-button.js b/src/components/template/response-button.js index 9436346..ac9b219 100644 --- a/src/components/template/response-button.js +++ b/src/components/template/response-button.js @@ -1,34 +1,50 @@ -import React from 'react'; +import React, { useState, useEffect } from 'react'; + import { Link } from 'react-router-dom'; +import { isSurveyOnLine } from 'utils/api'; import { - getIsSurveyOnlineById, getSurveyOfflineMessageById, getSurveyOfflineMessageInfoById, } from '../../utils/read-content'; -const ResponseButton = ({ id }) => ( -
-
-

{`Répondre à l'enquête`}

- - - -

- {!getIsSurveyOnlineById(id) && ( - <> -

{getSurveyOfflineMessageById(id)}
-

{getSurveyOfflineMessageInfoById(id)}

- - )} -
-
-); +const ResponseButton = ({ id, urlBackEnd }) => { + const [surveyOnLine, setSurveyOnLine] = useState(false); + + useEffect(() => { + const fetchData = async () => { + try { + const response = await isSurveyOnLine(urlBackEnd)(id); + if (response.data !== undefined && response.data !== '') { + setSurveyOnLine(true); + } + } catch (error) { + console.error('Error checking survey online:', error); + setSurveyOnLine(false); + } + }; + + fetchData(); + }, [id, urlBackEnd]); + + return ( +
+
+

{`Répondre à l'enquête`}

+ + + +

+ {!surveyOnLine && ( + <> +

{getSurveyOfflineMessageById(id)}
+

{getSurveyOfflineMessageInfoById(id)}

+ + )} +
+
+ ); +}; export default ResponseButton; diff --git a/src/utils/api/api.js b/src/utils/api/api.js index 3c6efe9..407a0dd 100644 --- a/src/utils/api/api.js +++ b/src/utils/api/api.js @@ -1,5 +1,5 @@ import Axios from 'axios'; -import { pathEmail, pathGetUrlQuestionnaire, pathUser } from 'utils/properties'; +import { pathEmail, pathGetUrlQuestionnaire, pathUser, pathIsSurveyOnline } from 'utils/properties'; import { authentication, getHeader } from './utils'; export const getQuestionnaireUrl = (apiUrl, keycloakAuth) => { @@ -57,3 +57,13 @@ export const putMailToLdap = apiUrl => mail => { .catch(e => reject(new Error(`Error during refreshToken : ${e.message}`))); }); }; + +export const isSurveyOnLine = apiUrl => surveyId => { + return new Promise((resolve, reject) => { + Axios.get(`${apiUrl}${pathIsSurveyOnline}/${surveyId}`, { + responseType: 'text', + }) + .then(res => resolve(res)) + .catch(e => reject(e)); + }); +}; diff --git a/src/utils/properties.js b/src/utils/properties.js index 2b4b23f..b3d5ab7 100644 --- a/src/utils/properties.js +++ b/src/utils/properties.js @@ -14,6 +14,8 @@ export const pathUser = '/repondant'; /* Path send mail */ export const pathMail = '/e-mail'; +export const pathIsSurveyOnline = '/is-survey-online'; + /*Path control mail*/ export const pathEmail = '/mail'; diff --git a/src/utils/read-content.js b/src/utils/read-content.js index 741a4ac..259d598 100644 --- a/src/utils/read-content.js +++ b/src/utils/read-content.js @@ -32,7 +32,6 @@ export const idExists = id => content.specifique.find(e => e.id === id) !== unde export const getContentById = id => content.specifique.find(e => e.id === id).content; export const getSurveyTitleById = id => content.specifique.find(e => e.id === id).title; export const getSurveyTitleShortById = id => content.specifique.find(e => e.id === id).titleShort; -export const getIsSurveyOnlineById = id => content.specifique.find(e => e.id === id).isSurveyOnline; export const getSurveyOfflineMessageById = id => content.specifique.find(e => e.id === id).messageSurveyOffline; export const getSurveyOfflineMessageInfoById = id => @@ -75,9 +74,9 @@ export const getListOptionsSurvey = id => }; }); - // site enquête non accessible +// site enquête non accessible - export const getAccessibleContentById = id => content.specifique.find(e => e.id === id).accessible; +export const getAccessibleContentById = id => content.specifique.find(e => e.id === id).accessible; // faq export const getFaqData = id => From 28aa2fdd4408e6b7af6836393522b9c4762633b9 Mon Sep 17 00:00:00 2001 From: y72wvh Date: Tue, 2 Apr 2024 08:29:16 +0200 Subject: [PATCH 02/25] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2a50bb..5ebe1c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "colempub", - "version": "1.0.2", + "version": "1.1.0", "dependencies": { "axios": "^0.19.2", "bootstrap": "^3.3.7", From 07a7d1736ed5ac75c74f131d048d07454c616d1c Mon Sep 17 00:00:00 2001 From: y72wvh Date: Tue, 2 Apr 2024 10:02:06 +0200 Subject: [PATCH 03/25] Update response-button.js --- src/components/template/response-button.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/template/response-button.js b/src/components/template/response-button.js index ac9b219..03799fa 100644 --- a/src/components/template/response-button.js +++ b/src/components/template/response-button.js @@ -14,7 +14,9 @@ const ResponseButton = ({ id, urlBackEnd }) => { const fetchData = async () => { try { const response = await isSurveyOnLine(urlBackEnd)(id); - if (response.data !== undefined && response.data !== '') { + if (response.data && response.data.ongoing === false) { + setSurveyOnLine(false); + } else { setSurveyOnLine(true); } } catch (error) { From 4b7dc4b0e432e6edf7a7c7527d60955b21c1bfd1 Mon Sep 17 00:00:00 2001 From: y72wvh Date: Wed, 10 Apr 2024 14:40:49 +0200 Subject: [PATCH 04/25] fix: reposne api name --- src/components/template/response-button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/template/response-button.js b/src/components/template/response-button.js index 03799fa..c231b94 100644 --- a/src/components/template/response-button.js +++ b/src/components/template/response-button.js @@ -14,7 +14,7 @@ const ResponseButton = ({ id, urlBackEnd }) => { const fetchData = async () => { try { const response = await isSurveyOnLine(urlBackEnd)(id); - if (response.data && response.data.ongoing === false) { + if (response.data && response.data.opened === false) { setSurveyOnLine(false); } else { setSurveyOnLine(true); From b541cc2e9671c15505501e982ef757243fb45735 Mon Sep 17 00:00:00 2001 From: y72wvh Date: Wed, 17 Apr 2024 11:21:31 +0200 Subject: [PATCH 05/25] feat: add surveys --- public/configuration.json | 6 +- public/keycloak.json | 6 +- src/resources/content.json | 130 +++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 6 deletions(-) diff --git a/public/configuration.json b/public/configuration.json index f7d3edd..0797d31 100644 --- a/public/configuration.json +++ b/public/configuration.json @@ -1,6 +1,6 @@ { "urlColemanPromotionBack_commentaire": "access portal's api url", - "urlColemanPromotionBack": "${ACCESS_API_URL}", - "urlSurveys": "${MY_SURVEYS_URL}", - "authType": "${AUTHENTICATION_MODE}" + "urlColemanPromotionBack": "http://localhost:8090", + "urlSurveys": "https://mes-enquetes.developpement.insee.fr", + "authType": "OIDC" } diff --git a/public/keycloak.json b/public/keycloak.json index 37f11f0..5f51be9 100644 --- a/public/keycloak.json +++ b/public/keycloak.json @@ -1,8 +1,8 @@ { - "realm": "${KC_REALM}", - "auth-server-url": "${KC_URL}", + "realm": "questionnaire-particuliers", + "auth-server-url": "https://auth.insee.test/auth", "ssl-required": "external", - "resource": "${KC_CLIENT}", + "resource": "coleman-frontend", "public-client": true, "confidential-port": 0 } diff --git a/src/resources/content.json b/src/resources/content.json index 2f7768c..693858d 100644 --- a/src/resources/content.json +++ b/src/resources/content.json @@ -106,6 +106,71 @@ ] } }, + { + "id": "eacei", + "isSurveyOnline": false, + "messageSurveyOffline": "L'enquête est terminée", + "messageInfoSurveyOffline": "", + "title": "Survey about eacei", + "titleShort": "eacei survey", + "verifmail": true, + "content": { + "description": { + "title": "Survey about eacei 2023", + "body": "Présentation des objectifs de l'enquête." + }, + "resultats": { + "title": "Résultats 2019", + "menu-title": "Résultats de l'enquête 2019", + "picture-url": "img/chi_resultats.png", + "legende": "L'enquête donne lieu à de nombreuses publications.", + "link-url": "https://en.wikipedia.org/wiki/Chicken" + }, + "enquete-en-detail": { + "menu-link": "https://en.wikipedia.org/wiki/Chicken" + }, + + "donnees-personnelles": { + "cartouche": "Vos réponses seront conservées pendant cinq ans à compter de la fin de la collecte pour les besoins de l’enquête.", + "context": "" + }, + "a-quoi-servent-vos-reponses": { + "body": "Vos réponses nous sont fort utiles." + }, + "faq-data": [ + { + "title": "Est-ce obligatoire de répondre ?", + "body": "Oui, l’enquête est obligatoire." + }, + { + "title": "Pourquoi est-ce important de répondre ?", + "body": "Afin de prendre en compte la diversité des situations et d'assurer ainsi la qualité statistique des résultats, il est très important que votre foyer réponde à cette enquête." + }, + { + "title": "Quand aura-t-on les résultats de l’enquête ?", + "body": "Les données seront exploitées dès la fin de l'enquête." + } + ] + }, + "configuration": { + "listOptionsObjetMailAssistance": [ + { + "auth": true, + "value": "affichageQuestionnaire", + "displayValue": "Affichage du questionnaire" + }, + { + "auth": true, + "value": "comprehensionQuestionnaire", + "displayValue": "Compréhension du questionnaire" + }, + { "auth": true, "value": "autre", "displayValue": "Autre" }, + { "auth": false, "value": "perteMotDePasse", "displayValue": "Mot de passe oublié" }, + { "auth": false, "value": "perteIdentifiant", "displayValue": "Identifiant oublié" }, + { "auth": false, "value": "autre", "displayValue": "Autre" } + ] + } + }, { "id": "qoe", "isSurveyOnline": false, @@ -239,6 +304,71 @@ { "auth": false, "value": "autre", "displayValue": "Autre" } ] } + }, + { + "id": "eec", + "isSurveyOnline": false, + "messageSurveyOffline": "L'enquête est terminée", + "messageInfoSurveyOffline": "", + "title": "Survey about Chicken", + "titleShort": "Chicken survey", + "verifmail": true, + "content": { + "description": { + "title": "Survey about Chicken 2023", + "body": "Présentation des objectifs de l'enquête." + }, + "resultats": { + "title": "Résultats 2019", + "menu-title": "Résultats de l'enquête 2019", + "picture-url": "img/chi_resultats.png", + "legende": "L'enquête donne lieu à de nombreuses publications.", + "link-url": "https://en.wikipedia.org/wiki/Chicken" + }, + "enquete-en-detail": { + "menu-link": "https://en.wikipedia.org/wiki/Chicken" + }, + + "donnees-personnelles": { + "cartouche": "Vos réponses seront conservées pendant cinq ans à compter de la fin de la collecte pour les besoins de l’enquête.", + "context": "" + }, + "a-quoi-servent-vos-reponses": { + "body": "Vos réponses nous sont fort utiles." + }, + "faq-data": [ + { + "title": "Est-ce obligatoire de répondre ?", + "body": "Oui, l’enquête est obligatoire." + }, + { + "title": "Pourquoi est-ce important de répondre ?", + "body": "Afin de prendre en compte la diversité des situations et d'assurer ainsi la qualité statistique des résultats, il est très important que votre foyer réponde à cette enquête." + }, + { + "title": "Quand aura-t-on les résultats de l’enquête ?", + "body": "Les données seront exploitées dès la fin de l'enquête." + } + ] + }, + "configuration": { + "listOptionsObjetMailAssistance": [ + { + "auth": true, + "value": "affichageQuestionnaire", + "displayValue": "Affichage du questionnaire" + }, + { + "auth": true, + "value": "comprehensionQuestionnaire", + "displayValue": "Compréhension du questionnaire" + }, + { "auth": true, "value": "autre", "displayValue": "Autre" }, + { "auth": false, "value": "perteMotDePasse", "displayValue": "Mot de passe oublié" }, + { "auth": false, "value": "perteIdentifiant", "displayValue": "Identifiant oublié" }, + { "auth": false, "value": "autre", "displayValue": "Autre" } + ] + } } ] } From cd251a8444dd27c0182bd1d498388ce96224f2fc Mon Sep 17 00:00:00 2001 From: Lea Renaux Date: Wed, 24 Apr 2024 10:18:32 +0200 Subject: [PATCH 06/25] add spinner and messageSurveyOffline in ResponseButton --- src/components/template/response-button.js | 63 +++++++++++++--------- src/components/template/survey-item.js | 4 +- src/index.scss | 34 +++++++++--- 3 files changed, 67 insertions(+), 34 deletions(-) diff --git a/src/components/template/response-button.js b/src/components/template/response-button.js index c231b94..3bc44ba 100644 --- a/src/components/template/response-button.js +++ b/src/components/template/response-button.js @@ -1,47 +1,58 @@ -import React, { useState, useEffect } from 'react'; - +import React, {useState, useEffect} from 'react'; import { Link } from 'react-router-dom'; +import ReactLoading from 'react-loading'; import { isSurveyOnLine } from 'utils/api'; -import { - getSurveyOfflineMessageById, - getSurveyOfflineMessageInfoById, -} from '../../utils/read-content'; -const ResponseButton = ({ id, urlBackEnd }) => { - const [surveyOnLine, setSurveyOnLine] = useState(false); +const ResponseButton = ({ id, urlBackEnd}) => { + const [surveyOnLine, setSurveyOnLine] = useState(undefined); + const [messageSurveyOffline, setMessageSurveyOffline] = useState(""); + const [messageInfoSurveyOffline, setMessageInfoSurveyOffline] = useState(""); - useEffect(() => { - const fetchData = async () => { - try { - const response = await isSurveyOnLine(urlBackEnd)(id); - if (response.data && response.data.opened === false) { + useEffect(() => { + const fetchData = async () => { + try { + const response = await isSurveyOnLine(urlBackEnd)(id); + if (response.data && response.data.opened === false) { + setSurveyOnLine(false); + setMessageSurveyOffline(response.data.messageSurveyOffline); + setMessageInfoSurveyOffline(response.data.messageInfoSurveyOffline); + } else { + setSurveyOnLine(true); + } + } catch (error) { + console.error('Error checking survey online:', error); setSurveyOnLine(false); - } else { - setSurveyOnLine(true); } - } catch (error) { - console.error('Error checking survey online:', error); - setSurveyOnLine(false); - } - }; - - fetchData(); - }, [id, urlBackEnd]); + }; + + fetchData(); + }, [id, urlBackEnd]); + + if(surveyOnLine === undefined) { + return ( +
+
+

{`Veuillez patienter`}

+ +
+
+ ) + } return (

{`Répondre à l'enquête`}

-

{!surveyOnLine && ( <> -

{getSurveyOfflineMessageById(id)}
-

{getSurveyOfflineMessageInfoById(id)}

+ {messageSurveyOffline &&
{messageSurveyOffline}
} + {messageInfoSurveyOffline &&

{messageInfoSurveyOffline}

} )}
diff --git a/src/components/template/survey-item.js b/src/components/template/survey-item.js index 7902f00..90a79e3 100644 --- a/src/components/template/survey-item.js +++ b/src/components/template/survey-item.js @@ -4,8 +4,8 @@ import { Link } from 'react-router-dom'; const SurveyItem = ({ survey }) => (
- -
diff --git a/src/components/template/footer-menu.js b/src/components/template/footer-menu.js index 8c26d5d..6004e02 100644 --- a/src/components/template/footer-menu.js +++ b/src/components/template/footer-menu.js @@ -4,9 +4,8 @@ import { Navbar, Nav, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; import logoTwitter from 'img/common/logo-twitter.png'; import { urlInseeFr } from 'utils/properties'; -import { isSurveyOnLine } from 'utils/api'; -function FooterMenu({ path, home, id }) { +function FooterMenu({ path, home, id, isSurveyOnLine }) { const [isDesktop, setIsDesktop] = useState(window.innerWidth > 767); const updateFooterMenu = () => { if (window.innerWidth <= 767) { @@ -44,7 +43,7 @@ function FooterMenu({ path, home, id }) { {`Questions/réponses`} - {isSurveyOnLine(id) && ( + {isSurveyOnLine && ( {`Contacter l'assistance`} diff --git a/src/components/template/menu.js b/src/components/template/menu.js index b0e2fe1..bdb8b5f 100644 --- a/src/components/template/menu.js +++ b/src/components/template/menu.js @@ -6,9 +6,9 @@ import { Link } from 'react-router-dom'; import { urlInseeFr } from 'utils/properties'; import logoTwitter from 'img/common/logo-twitter.png'; import { getResultsMenuTitle, getSurveyDetailLink } from 'utils/read-content'; -import { isSurveyOnLine } from 'utils/api'; +import ReactLoading from 'react-loading'; -function Menu({ id }) { +function Menu({ id, isSurveyOnLine }) { const [isDesktop, setIsDesktop] = useState(window.innerWidth > 767); const updateFooterMenu = () => { if (window.innerWidth <= 767) { @@ -35,16 +35,21 @@ function Menu({ id }) {
)} diff --git a/src/components/template/footer-menu.js b/src/components/template/footer-menu.js index 8c26d5d..b2e84d6 100644 --- a/src/components/template/footer-menu.js +++ b/src/components/template/footer-menu.js @@ -4,7 +4,7 @@ import { Navbar, Nav, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; import logoTwitter from 'img/common/logo-twitter.png'; import { urlInseeFr } from 'utils/properties'; -import { isSurveyOnLine } from 'utils/api'; +import { getIsSurveyOnlineById } from 'utils/read-content'; function FooterMenu({ path, home, id }) { const [isDesktop, setIsDesktop] = useState(window.innerWidth > 767); @@ -44,7 +44,7 @@ function FooterMenu({ path, home, id }) { {`Questions/réponses`} - {isSurveyOnLine(id) && ( + {getIsSurveyOnlineById(id) && ( {`Contacter l'assistance`} diff --git a/src/components/template/menu.js b/src/components/template/menu.js index b0e2fe1..c09b1b6 100644 --- a/src/components/template/menu.js +++ b/src/components/template/menu.js @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { urlInseeFr } from 'utils/properties'; import logoTwitter from 'img/common/logo-twitter.png'; import { getResultsMenuTitle, getSurveyDetailLink } from 'utils/read-content'; -import { isSurveyOnLine } from 'utils/api'; +import { getIsSurveyOnlineById } from '../../utils/read-content'; function Menu({ id }) { const [isDesktop, setIsDesktop] = useState(window.innerWidth > 767); @@ -40,7 +40,7 @@ function Menu({ id }) { to={`/${id}/login`} eventKey={1} id="menuItemRepondre" - disabled={!isSurveyOnLine(id)} + disabled={!getIsSurveyOnlineById(id)} > {`Accéder au questionnaire`} @@ -66,7 +66,7 @@ function Menu({ id }) { {`Questions/réponses`} - {isSurveyOnLine(id) && ( + {getIsSurveyOnlineById(id) && ( {`Contacter l'assistance`} diff --git a/src/components/template/response-button.js b/src/components/template/response-button.js index 3bc44ba..9436346 100644 --- a/src/components/template/response-button.js +++ b/src/components/template/response-button.js @@ -1,63 +1,34 @@ -import React, {useState, useEffect} from 'react'; +import React from 'react'; import { Link } from 'react-router-dom'; -import ReactLoading from 'react-loading'; -import { isSurveyOnLine } from 'utils/api'; +import { + getIsSurveyOnlineById, + getSurveyOfflineMessageById, + getSurveyOfflineMessageInfoById, +} from '../../utils/read-content'; -const ResponseButton = ({ id, urlBackEnd}) => { - const [surveyOnLine, setSurveyOnLine] = useState(undefined); - const [messageSurveyOffline, setMessageSurveyOffline] = useState(""); - const [messageInfoSurveyOffline, setMessageInfoSurveyOffline] = useState(""); - - useEffect(() => { - const fetchData = async () => { - try { - const response = await isSurveyOnLine(urlBackEnd)(id); - if (response.data && response.data.opened === false) { - setSurveyOnLine(false); - setMessageSurveyOffline(response.data.messageSurveyOffline); - setMessageInfoSurveyOffline(response.data.messageInfoSurveyOffline); - } else { - setSurveyOnLine(true); - } - } catch (error) { - console.error('Error checking survey online:', error); - setSurveyOnLine(false); - } - }; - - fetchData(); - }, [id, urlBackEnd]); - - if(surveyOnLine === undefined) { - return ( -
-
-

{`Veuillez patienter`}

- -
-
- ) - } - - return ( -
-
-

{`Répondre à l'enquête`}

- - - -

- {!surveyOnLine && ( - <> - {messageSurveyOffline &&

{messageSurveyOffline}
} - {messageInfoSurveyOffline &&

{messageInfoSurveyOffline}

} - - )} -
-
- ); -}; +const ResponseButton = ({ id }) => ( +
+
+

{`Répondre à l'enquête`}

+ + + +

+ {!getIsSurveyOnlineById(id) && ( + <> +

{getSurveyOfflineMessageById(id)}
+

{getSurveyOfflineMessageInfoById(id)}

+ + )} +
+
+); export default ResponseButton; diff --git a/src/components/template/survey-item.js b/src/components/template/survey-item.js index 90a79e3..7902f00 100644 --- a/src/components/template/survey-item.js +++ b/src/components/template/survey-item.js @@ -4,8 +4,8 @@ import { Link } from 'react-router-dom'; const SurveyItem = ({ survey }) => (
- -