Skip to content

Commit

Permalink
Queen v2 upgrade lunatic (#51)
Browse files Browse the repository at this point in the history
* bumb lunatic to 2.6.1

* bumb : 1.3.8
  • Loading branch information
laurentC35 authored Sep 22, 2023
1 parent 282990b commit cff9cc0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 53 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "drama-queen-container",
"private": true,
"version": "1.3.7",
"version": "1.3.8",
"workspaces": [
"drama-queen",
"queen-v2",
Expand Down
2 changes: 1 addition & 1 deletion queen-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
})}
)}
/>{' '}
</>
);
};
17 changes: 5 additions & 12 deletions queen-v2/src/components/lightOrchestrator/lightOrchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function noDataChange() {

const preferences = ['COLLECTED'];
const features = ['VTL'];
const savingType = 'COLLECTED';
// const savingType = 'COLLECTED';

const missingShortcut = { dontKnow: 'f2', refused: 'f4' };

Expand Down Expand Up @@ -104,10 +104,11 @@ function LightOrchestrator({

// getErrors,
// getModalErrors,
getCurrentErrors,
// getCurrentErrors,
getData,
loopVariables = [],
Provider,
pageTag,
} = lunaticStateRef.current;

const previousPageTag = useRef();
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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}
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down

0 comments on commit cff9cc0

Please sign in to comment.