-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from InseeFr/dev-warning-varcal
Dev warning varcal
- Loading branch information
Showing
4 changed files
with
68 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pogues", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Outil de conception et de test de questionnaires.", | ||
"repository": { | ||
"type": "git", | ||
|
@@ -17,12 +17,12 @@ | |
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Loic Henninger", | ||
"email": "loic.henninger@insee.fr" | ||
"name": "François Bulot", | ||
"email": "francois.bulot@insee.fr" | ||
}, | ||
{ | ||
"name": "Ophelie Rogel", | ||
"email": "ophelie.rogel@insee.fr" | ||
"name": "Ophelie Bibonne", | ||
"email": "ophelie.bibonne@insee.fr" | ||
}, | ||
{ | ||
"name": "Nicolas Laval", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ import { ErrorsIntegrity as ErrorsIntegrityPanel } from 'layout/errors-integrity | |
|
||
import Dictionary from 'utils/dictionary/dictionary'; | ||
import { getSortedChildren } from 'utils/component/component-utils'; | ||
import { ERRORS_INTEGRITY } from 'constants/dom-constants'; | ||
|
||
const { INNER, ALERT, LIST } = ERRORS_INTEGRITY; | ||
|
||
const { LOOP, FILTER, NESTEDFILTRE } = COMPONENT_TYPE; | ||
|
||
|
@@ -25,6 +28,8 @@ const QuestionnaireListComponents = props => { | |
editingComponentId, | ||
errorsIntegrity, | ||
setSelectedComponentId, | ||
activeCalculatedVariables, | ||
calculatedVariables, | ||
} = props; | ||
|
||
useEffect(() => { | ||
|
@@ -35,6 +40,17 @@ const QuestionnaireListComponents = props => { | |
const [showComponentModal, setShowComponentModal] = useState(false); | ||
const [showRemoveQuestionnaireDialog, setShowRemoveQuestionnaireDialog] = | ||
useState(false); | ||
const [showWarning, setShowWarning] = useState(false); | ||
|
||
// Temporary : to help diagnose calculated variables bug | ||
useEffect(() => { | ||
if (questionnaire.id && calculatedVariables[questionnaire.id]) { | ||
setShowWarning( | ||
Object.keys(activeCalculatedVariables).length === 0 && | ||
Object.keys(calculatedVariables[questionnaire.id]).length !== 0, | ||
); | ||
} | ||
}, [activeCalculatedVariables, calculatedVariables, questionnaire]); | ||
|
||
const handleOpenQuestionnaireDetail = () => { | ||
setShowQuestionnaireModal(true); | ||
|
@@ -161,7 +177,40 @@ const QuestionnaireListComponents = props => { | |
</div> | ||
</div> | ||
|
||
{/* Questionnaire integrity errors */} | ||
{/* Temporary warning to help diagnose the bug concerning disappearing of calculated variables */} | ||
{showWarning && ( | ||
<div id="errors-integrity"> | ||
<div className={INNER}> | ||
<div className={ALERT} style={{ marginTop: '2.5em' }}> | ||
<div className="alert-icon big"> | ||
<div className="alert-triangle" />! | ||
</div> | ||
</div> | ||
<div className={LIST}> | ||
<ul> | ||
<li> | ||
Il n'y a plus de variables calculées dans votre | ||
questionnaire.{' '} | ||
<strong> | ||
Si ce n'est pas une action voulue de votre part | ||
</strong> | ||
, il s'agit probablement d'une erreur de l'application. | ||
Dans ce cas, veuillez contacter au plus vite{' '} | ||
<a href="mailto:[email protected];[email protected];[email protected];[email protected]"> | ||
l'équipe de l'atelier de conception | ||
</a>{' '} | ||
pour que nous corrigions ce problème. | ||
</li> | ||
<li> | ||
Par ailleurs, si vous quittez votre questionnaire | ||
maintenant sans le sauvegarder, vous retrouverez les | ||
variables calculées en retournant sur le questionnaire. | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
)} | ||
|
||
<ErrorsIntegrityPanel | ||
errorsIntegrity={errorsIntegrity} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters