diff --git a/package.json b/package.json index 0ba01efe..63b5aa1e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "drama-queen-container", "private": true, - "version": "1.3.7", + "version": "1.3.8", "workspaces": [ "drama-queen", "queen-v2", diff --git a/queen-v2/package.json b/queen-v2/package.json index b9d74c75..eaa3bce3 100644 --- a/queen-v2/package.json +++ b/queen-v2/package.json @@ -12,7 +12,7 @@ "dependencies": { "@axa-fr/react-oidc-context": "^3.1.6", "@craco/craco": "^6.4.0", - "@inseefr/lunatic": "2.5.2-rc1-beta", + "@inseefr/lunatic": "^2.6.1", "@inseefr/trevas": "^0.1.16", "@material-ui/core": "^4.11.3", "@material-ui/icons": "^4.11.2", diff --git a/queen-v2/src/components/lightOrchestrator/componentDisplayer/component.js b/queen-v2/src/components/lightOrchestrator/componentDisplayer/component.js index f8dc9000..43a733f1 100644 --- a/queen-v2/src/components/lightOrchestrator/componentDisplayer/component.js +++ b/queen-v2/src/components/lightOrchestrator/componentDisplayer/component.js @@ -2,44 +2,24 @@ import * as lunatic from '@inseefr/lunatic'; import { useCustomLunaticStyles } from 'components/orchestrator/lunaticStyle/style'; -export const ComponentDisplayer = ({ - components, - preferences, - features, - readonly, - savingType, - filterDescription, - currentErrors, -}) => { +export const ComponentDisplayer = ({ components, readonly, pageTag }) => { const lunaticClasses = useCustomLunaticStyles(); return ( <> - {components.map(function (component) { - const { id, componentType, response, storeName, ...other } = component; - const Component = lunatic[componentType]; - return ( + <lunatic.LunaticComponents + components={components} + componentProps={() => ({ + filterDescription: false, + disabled: readonly, + readOnly: readonly, + shortcut: true, + })} + wrapper={({ children, id, componentType }) => ( <div className={`${lunaticClasses.lunatic} ${componentType}`} key={`component-${id}`}> - <Component - id={id} - response={response} - {...other} - {...component} - labelPosition="TOP" - unitPosition="AFTER" - preferences={preferences} - features={features} - writable - readOnly={readonly} - disabled={readonly} - focused // waiting for Lunatic feature - savingType={savingType} - filterDescription={filterDescription} - shortcut={true} - errors={currentErrors} - /> + {children} </div> - ); - })} + )} + />{' '} </> ); }; diff --git a/queen-v2/src/components/lightOrchestrator/lightOrchestrator.js b/queen-v2/src/components/lightOrchestrator/lightOrchestrator.js index e2185a8a..e02626b7 100644 --- a/queen-v2/src/components/lightOrchestrator/lightOrchestrator.js +++ b/queen-v2/src/components/lightOrchestrator/lightOrchestrator.js @@ -21,7 +21,7 @@ function noDataChange() { const preferences = ['COLLECTED']; const features = ['VTL']; -const savingType = 'COLLECTED'; +// const savingType = 'COLLECTED'; const missingShortcut = { dontKnow: 'f2', refused: 'f4' }; @@ -104,10 +104,11 @@ function LightOrchestrator({ // getErrors, // getModalErrors, - getCurrentErrors, + // getCurrentErrors, getData, loopVariables = [], Provider, + pageTag, } = lunaticStateRef.current; const previousPageTag = useRef(); @@ -152,7 +153,7 @@ function LightOrchestrator({ // const errors = getErrors(); // const modalErrors = getModalErrors(); - const currentErrors = typeof getCurrentErrors === 'function' ? getCurrentErrors() : []; + // const currentErrors = typeof getCurrentErrors === 'function' ? getCurrentErrors() : []; const trueGoToPage = useCallback( targetPage => { @@ -222,15 +223,7 @@ function LightOrchestrator({ <div className={classes.mainTile}> <div className={classes.activeView}> <Provider> - <ComponentDisplayer - components={components} - preferences={preferences} - features={features} - readonly={readonly} - savingType={savingType} - filterDescription={filterDescription} - currentErrors={currentErrors} - /> + <ComponentDisplayer components={components} readonly={readonly} pageTag={pageTag} /> </Provider> <LoopPanel loopVariables={loopVariables} diff --git a/yarn.lock b/yarn.lock index 957fc523..e1b21c83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1602,12 +1602,12 @@ remove-accents "^0.4.2" sass "^1.32.2" -"@inseefr/lunatic@2.5.2-rc1-beta": - version "2.5.2-rc1-beta" - resolved "https://registry.yarnpkg.com/@inseefr/lunatic/-/lunatic-2.5.2-rc1-beta.tgz#b06dc4cde9e34ffb4236cb1e448295edee7f40ed" - integrity sha512-dQxWo9PnyJDfUCYl3lxilozd/hY7oSyV8gBkx1QXUY2V7n30CBdEvDhXSP9iYMEwOE1sTWlgFMuWxFJddI2EGA== +"@inseefr/lunatic@^2.6.1": + version "2.6.1" + resolved "https://registry.yarnpkg.com/@inseefr/lunatic/-/lunatic-2.6.1.tgz#00f71d1356fdc9e5807c6734dd8e02ceb61dc583" + integrity sha512-VT9nvz4tdcdg/CgD40srtBQfPmJtrvsh5v96xBDLrNR6pK4UGGFGBkp1mPbq8Y6ulNGcwiGSUCitXz0WvTBSlQ== dependencies: - "@inseefr/trevas" "^0.1.19" + "@inseefr/trevas" "^0.1.20" "@inseefr/vtl-2.0-antlr-tools" "^0.1.0-bundle" antlr4 "4.11.0" classnames "^2.3.1" @@ -1636,7 +1636,7 @@ data-forge "^1.8.8" date-fns "^2.27.0" -"@inseefr/trevas@^0.1.19": +"@inseefr/trevas@^0.1.20": version "0.1.20" resolved "https://registry.yarnpkg.com/@inseefr/trevas/-/trevas-0.1.20.tgz#a1d68cf3d22a4da1ef99c1c8560470c8dda407d7" integrity sha512-x1UotSHqHfGhut0JgPCLu+TXZtDpcYSrFQtlIl/L1kav6zYBa888AHhkADWB2hpJM/XAG3lQEfZrqgnsgbQK1g==