From ff1012dc18c92d8033d9eda7001392d19c71393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Henninger?= Date: Wed, 18 May 2022 14:49:50 +0200 Subject: [PATCH] Hot fix : get back to old editors from 1.2.0 version for when Xpath is selected as the specifications language --- package.json | 2 +- .../components/rich-editor.jsx | 5 +++-- .../components/simple-editor.jsx | 16 ++++++++++++++++ .../control-with-suggestions-container.jsx | 3 +++ .../controls/control-with-suggestions/index.js | 1 + .../codes-lists/components/codes-lists.jsx | 4 ++-- .../component-new-edit/components/controls.jsx | 6 +++--- .../components/nestedFilter.jsx | 4 ++-- .../components/redirections.jsx | 4 ++-- .../variables/calculated-variables.jsx | 4 ++-- 10 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 src/forms/controls/control-with-suggestions/components/simple-editor.jsx diff --git a/package.json b/package.json index bccf4ef3b..1b98e9f81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pogues", - "version": "1.3.0", + "version": "1.3.1", "description": "Outil de conception et de test de questionnaires.", "repository": { "type": "git", diff --git a/src/forms/controls/control-with-suggestions/components/rich-editor.jsx b/src/forms/controls/control-with-suggestions/components/rich-editor.jsx index 17efee495..1676c5824 100644 --- a/src/forms/controls/control-with-suggestions/components/rich-editor.jsx +++ b/src/forms/controls/control-with-suggestions/components/rich-editor.jsx @@ -1,7 +1,7 @@ import React from 'react'; import VTLEditor from './vtl-editor'; -import TextareaWithSuggestions from './textarea-with-suggestions'; +import RichTextareaWithSuggestions from './rich-textarea-with-suggestions'; import { FORMULA_LANGUAGE } from 'constants/pogues-constants'; @@ -9,7 +9,8 @@ const { XPATH, VTL } = FORMULA_LANGUAGE; const RichEditor = ({ formulasLanguage, ...props }) => { if (formulasLanguage === VTL) return ; - if (formulasLanguage === XPATH) return ; + if (formulasLanguage === XPATH) + return ; return null; }; diff --git a/src/forms/controls/control-with-suggestions/components/simple-editor.jsx b/src/forms/controls/control-with-suggestions/components/simple-editor.jsx new file mode 100644 index 000000000..bac18b1ea --- /dev/null +++ b/src/forms/controls/control-with-suggestions/components/simple-editor.jsx @@ -0,0 +1,16 @@ +import React from 'react'; + +import VTLEditor from './vtl-editor'; +import TextareaWithSuggestions from './textarea-with-suggestions'; + +import { FORMULA_LANGUAGE } from 'constants/pogues-constants'; + +const { XPATH, VTL } = FORMULA_LANGUAGE; + +const SimpleEditor = ({ formulasLanguage, ...props }) => { + if (formulasLanguage === VTL) return ; + if (formulasLanguage === XPATH) return ; + return null; +}; + +export default SimpleEditor; diff --git a/src/forms/controls/control-with-suggestions/containers/control-with-suggestions-container.jsx b/src/forms/controls/control-with-suggestions/containers/control-with-suggestions-container.jsx index 963e395ee..88805c7e2 100644 --- a/src/forms/controls/control-with-suggestions/containers/control-with-suggestions-container.jsx +++ b/src/forms/controls/control-with-suggestions/containers/control-with-suggestions-container.jsx @@ -4,6 +4,7 @@ import InputWithSuggestions from '../components/input-with-suggestions'; import TextareaWithSuggestions from '../components/textarea-with-suggestions'; import RichTextareaWithSuggestions from '../components/rich-textarea-with-suggestions'; import RichEditor from '../components/rich-editor'; +import SimpleEditor from '../components/simple-editor'; export const InputWithSuggestionsContainer = withCurrentFormVariables(InputWithSuggestions); @@ -15,3 +16,5 @@ export const RichTextareaWithSuggestionsContainer = withCurrentFormVariables( ); export const RichEditorContainer = withCurrentFormVariables(RichEditor); + +export const SimpleEditorContainer = withCurrentFormVariables(SimpleEditor); diff --git a/src/forms/controls/control-with-suggestions/index.js b/src/forms/controls/control-with-suggestions/index.js index 6a3c29be9..172e8af74 100644 --- a/src/forms/controls/control-with-suggestions/index.js +++ b/src/forms/controls/control-with-suggestions/index.js @@ -3,4 +3,5 @@ export { TextareaWithSuggestionsContainer as TextareaWithVariableAutoCompletion, RichTextareaWithSuggestionsContainer as RichTextareaWithVariableAutoCompletion, RichEditorContainer as RichEditorWithVariable, + SimpleEditorContainer as SimpleEditorWithVariable, } from './containers/control-with-suggestions-container'; diff --git a/src/widgets/codes-lists/components/codes-lists.jsx b/src/widgets/codes-lists/components/codes-lists.jsx index c2c30cbfb..f62d17eff 100644 --- a/src/widgets/codes-lists/components/codes-lists.jsx +++ b/src/widgets/codes-lists/components/codes-lists.jsx @@ -15,7 +15,7 @@ import ListRadios from 'forms/controls/list-radios'; import Select from 'forms/controls/select'; import GenericOption from 'forms/controls/generic-option'; import { storeToArray, uuid } from 'utils/utils'; -import { RichEditorWithVariable } from 'forms/controls/control-with-suggestions'; +import { InputWithVariableAutoCompletion } from 'forms/controls/control-with-suggestions'; import { SearchCodesLists } from 'widgets/search-codes-lists'; import { ErrorsPanel } from 'widgets/errors-panel'; @@ -181,7 +181,7 @@ const CodesList = props => { { /> {
-