Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/stories/checkbox-group/checkbox-group.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import Orchestrator from '../utils/orchestrator';
import source from './source';
import sourceComponentset from './sourceComponentset';
import sourceWithCondition from './sourceWithCondition.json';
import sourceLoop from './sourceLoop';
import defaultArgTypes from '../utils/default-arg-types';

Expand Down Expand Up @@ -42,3 +43,10 @@ Loop.args = {
...Default.args,
source: sourceLoop,
};

export const WithCondition = Template.bind({});

WithCondition.args = {
...Default.args,
source: sourceWithCondition,
};
238 changes: 238 additions & 0 deletions src/stories/checkbox-group/sourceWithCondition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
{
"components": [
{
"id": "number",
"componentType": "InputNumber",
"page": "1",
"label": {
"value": "\"Votre age\"",
"type": "VTL|MD"
},
"response": {
"name": "AGE"
}
},
{
"id": "checkboxes",
"componentType": "CheckboxGroup",
"page": "2",
"label": {
"value": "\"Pour quelle raison principale n’étiez-vous pas disponible ?\"",
"type": "VTL|MD"
},
"responses": [
{
"id": "kmort6x9-QOP-kmosa98y",
"label": {
"value": "\"Vous suiviez (ou aviez le projet de suivre) des études ou une formation\"",
"type": "VTL"
},
"response": { "name": "CHECK1" }
},
{
"id": "kmort6x9-QOP-kmos360k",
"label": {
"value": "\"Vous aviez des problèmes de santé ou étiez en situation de handicap\"",
"type": "VTL"
},
"response": { "name": "CHECK2" }
},
{
"id": "new_id_1",
"label": {
"value": "\"Vous étiez sur le point d’avoir un enfant\"",
"type": "VTL"
},
"conditionFilter": {
"value": "cast(AGE, number) <= 50",
"type": "VTL"
},
"response": { "name": "CHECK3" }
},
{
"id": "new_id_2",
"label": {
"value": "\"Vous vous occupiez de vos enfants ou d’un proche\"",
"type": "VTL"
},
"response": { "name": "CHECK4" }
},
{
"id": "new_id_3",
"label": {
"value": "\"Vous étiez en vacances, preniez du temps pour vous ou réfléchissiez à votre avenir\"",
"type": "VTL"
},
"response": { "name": "CHECK5" }
},
{
"id": "new_id_4",
"label": {
"value": "\"Vous étiez à la retraite ou proche de la retraite\"",
"type": "VTL"
},
"conditionFilter": {
"value": "cast(AGE, number) >= 50",
"type": "VTL"
},
"response": { "name": "CHECK6" }
},
{
"id": "new_id_5",
"label": {
"value": "\"Vous aviez des difficultés pour vous déplacer (pas le permis de conduire, voiture en panne, pas de transport à proximité…)\"",
"type": "VTL"
},
"response": { "name": "CHECK7" }
},
{
"id": "new_id_6",
"label": {
"value": "\"Vous déménagiez\"",
"type": "VTL"
},
"response": { "name": "CHECK8" }
},
{
"id": "new_id_7",
"label": {
"value": "\"Vous aviez des problèmes de papier / titre de séjour\"",
"type": "VTL"
},
"response": { "name": "CHECK9" }
},
{
"id": "new_id_8",
"label": {
"value": "\"Pour une autre raison\"",
"type": "VTL"
},
"response": { "name": "CHECK10" }
}
]
}
],
"variables": [
{
"variableType": "COLLECTED",
"name": "CHECK1",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK2",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK3",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK4",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK5",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK6",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK7",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK8",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK9",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "CHECK10",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
},
{
"variableType": "COLLECTED",
"name": "AGE",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
}
}
]
}
10 changes: 9 additions & 1 deletion src/stories/checkbox-one/checkboxOne.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import Orchestrator from '../utils/orchestrator';
import source from './source';
import sourceWithCondition from './sourceWithCondition.json';
import defaultArgTypes from '../utils/default-arg-types';

const stories = {
Expand All @@ -19,6 +20,13 @@ const stories = {
export default stories;

const Template = (args) => <Orchestrator {...args} />;
export const Default = Template.bind({});

export const Default = Template.bind({});
Default.args = { id: 'checkboxOne', source, shortcut: false };

export const WithCondition = Template.bind({});
WithCondition.args = {
id: 'checkboxOneCondition',
source: sourceWithCondition,
shortcut: false,
};
Loading