@legalplace/wizardx-core 4.45.2 → 4.45.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,6 +30,7 @@ export type ConnectOptionDispatchProps = {
30
30
  updateOption: (value: boolean, id?: number, index?: number) => void;
31
31
  addMultipleOccurency: () => void;
32
32
  deleteMultipleOccurency: () => void;
33
+ updateOptionChildrenOrderAction: (id: number, options: number[]) => void;
33
34
  setMandatoryOptionAction: (parentId: number, index: number, value: boolean) => void;
34
35
  };
35
36
  export declare const canOptionDisplay: (id: number, index: number, selectors: ConnectorMapSelectors) => Readonly<boolean>;
@@ -84,6 +84,9 @@ const stateToProps = (selectors) => (state, ownProps) => {
84
84
  };
85
85
  const dispatchToProps = (actions) => (dispatch, ownProps) => ({
86
86
  updateOption: (value, id = ownProps.id, index = ownProps.index) => dispatch(actions.updateOptionAction(id, value, index)),
87
+ updateOptionChildrenOrderAction: (id, options) => {
88
+ dispatch(actions.updateOptionChildrenOrderAction(id, options));
89
+ },
87
90
  setMandatoryOptionAction: (parentId, index, value) => dispatch(actions.setMandatoryOptionAction(parentId, index, value)),
88
91
  addMultipleOccurency: () => {
89
92
  dispatch(actions.addMultipleOccurencyAction(ownProps.id));
@@ -23,6 +23,7 @@ export declare const actionsLibrary: {
23
23
  initReferencesAction: (references: import("../..").StateType.References) => import("../..").ActionsType.References.initReferences;
24
24
  updateVariableMetaAction: (id: number, meta: import("../..").ActionsType.References.VariableUpdatableMeta, index?: number | undefined) => import("../..").ActionsType.References.updateVariableMeta;
25
25
  updateOptionMetaAction: (id: number, meta: import("../..").ActionsType.References.OptionUpdatableMeta) => import("../..").ActionsType.References.updateOptionMeta;
26
+ updateOptionChildrenOrderAction: (id: number, options: number[]) => import("../..").ActionsType.References.updateOptionChildrenOrder;
26
27
  setDisabledVariableAction: (id: number, disabled: boolean, index: number, disabledTooltip?: string | undefined) => import("../..").ActionsType.References.setDisabledVariable;
27
28
  initMandatoryOptionAction: (id: number, value: boolean[]) => import("../..").ActionsType.Mandatories.initMandatoryOption;
28
29
  initMandatoryVariableAction: (id: number, value: boolean[]) => import("../..").ActionsType.Mandatories.initMandatoryVariable;
@@ -3,4 +3,5 @@ import type { ActionsType } from "../../types/Actions.type";
3
3
  export declare const initReferencesAction: (references: StateType.References) => ActionsType.References.initReferences;
4
4
  export declare const updateVariableMetaAction: (id: number, meta: ActionsType.References.updateVariableMeta["meta"], index?: number) => ActionsType.References.updateVariableMeta;
5
5
  export declare const updateOptionMetaAction: (id: number, meta: ActionsType.References.updateOptionMeta["meta"]) => ActionsType.References.updateOptionMeta;
6
+ export declare const updateOptionChildrenOrderAction: (id: number, options: ActionsType.References.updateOptionChildrenOrder["options"]) => ActionsType.References.updateOptionChildrenOrder;
6
7
  export declare const setDisabledVariableAction: (id: number, disabled: boolean, index: number, disabledTooltip?: string) => ActionsType.References.setDisabledVariable;
@@ -1,4 +1,4 @@
1
- import { INIT_REFERENCES, SET_DISABLED_VARIABLE, UPDATE_OPTION_META, UPDATE_VARIABLE_META, } from "../constants/references";
1
+ import { INIT_REFERENCES, SET_DISABLED_VARIABLE, UPDATE_OPTION_CHILDREN, UPDATE_OPTION_META, UPDATE_VARIABLE_META, } from "../constants/references";
2
2
  export const initReferencesAction = (references) => (Object.assign({ type: INIT_REFERENCES }, references));
3
3
  export const updateVariableMetaAction = (id, meta, index) => ({
4
4
  type: UPDATE_VARIABLE_META,
@@ -11,6 +11,11 @@ export const updateOptionMetaAction = (id, meta) => ({
11
11
  id,
12
12
  meta,
13
13
  });
14
+ export const updateOptionChildrenOrderAction = (id, options) => ({
15
+ type: UPDATE_OPTION_CHILDREN,
16
+ id,
17
+ options,
18
+ });
14
19
  export const setDisabledVariableAction = (id, disabled, index, disabledTooltip) => ({
15
20
  type: SET_DISABLED_VARIABLE,
16
21
  id,
@@ -1,4 +1,5 @@
1
1
  export declare const INIT_REFERENCES = "INIT_REFERENCES";
2
2
  export declare const UPDATE_VARIABLE_META = "UPDATE_VARIABLE_META";
3
3
  export declare const UPDATE_OPTION_META = "UPDATE_OPTION_META";
4
+ export declare const UPDATE_OPTION_CHILDREN = "UPDATE_OPTION_CHILDREN";
4
5
  export declare const SET_DISABLED_VARIABLE = "SET_DISABLED_VARIABLE";
@@ -1,4 +1,5 @@
1
1
  export const INIT_REFERENCES = "INIT_REFERENCES";
2
2
  export const UPDATE_VARIABLE_META = "UPDATE_VARIABLE_META";
3
3
  export const UPDATE_OPTION_META = "UPDATE_OPTION_META";
4
+ export const UPDATE_OPTION_CHILDREN = "UPDATE_OPTION_CHILDREN";
4
5
  export const SET_DISABLED_VARIABLE = "SET_DISABLED_VARIABLE";
@@ -0,0 +1,3 @@
1
+ import type { StateType } from "../../../types/State.type";
2
+ import type { ActionsType } from "../../../types/Actions.type";
3
+ export declare const updateOptionChildrenOrderReducer: (state: StateType.References, action: ActionsType.References.updateOptionChildrenOrder) => StateType.References;
@@ -0,0 +1,4 @@
1
+ export const updateOptionChildrenOrderReducer = (state, action) => {
2
+ const { options, id } = action;
3
+ return Object.assign(Object.assign({}, state), { options: Object.assign(Object.assign({}, state.options), { [id]: Object.assign(Object.assign({}, state.options[id]), { options }) }) });
4
+ };
@@ -1,9 +1,10 @@
1
1
  import { initReferencesReducer } from "./references/initReferences";
2
2
  import { updateOptionMetaReducer } from "./references/updateOptionMeta";
3
3
  import { updateVariableMetaReducer } from "./references/updateVariableMeta";
4
- import { INIT_REFERENCES, SET_DISABLED_VARIABLE, UPDATE_OPTION_META, UPDATE_VARIABLE_META, } from "../constants/references";
4
+ import { INIT_REFERENCES, SET_DISABLED_VARIABLE, UPDATE_OPTION_META, UPDATE_OPTION_CHILDREN, UPDATE_VARIABLE_META, } from "../constants/references";
5
5
  import { RESET_STATE } from "../constants/app";
6
6
  import { setDisabledVariableReducer } from "./references/setDisabledVariable";
7
+ import { updateOptionChildrenOrderReducer } from "./references/updateOptionChilds";
7
8
  const initialState = {
8
9
  options: {},
9
10
  variables: {},
@@ -43,6 +44,7 @@ const initialState = {
43
44
  const reducersEnum = {
44
45
  [INIT_REFERENCES]: initReferencesReducer,
45
46
  [UPDATE_OPTION_META]: updateOptionMetaReducer,
47
+ [UPDATE_OPTION_CHILDREN]: updateOptionChildrenOrderReducer,
46
48
  [UPDATE_VARIABLE_META]: updateVariableMetaReducer,
47
49
  [SET_DISABLED_VARIABLE]: setDisabledVariableReducer,
48
50
  };
@@ -2,7 +2,7 @@ import type { ModelV3, OptionV3, VariableV3 } from "@legalplace/models-v3-types"
2
2
  import type { StateType } from "./State.type";
3
3
  import type { UPDATE_AVAILABLE_SECTIONS, UPDATE_AVAILABLE_APPSTATES, GO_PREVIOUS_PAGE, GO_NEXT_PAGE, GO_PAGE, INIT_PAGINATION, UPDATE_INSTANCE_PAID, INIT_INSTANCE, UPDATE_INSTANCE, INIT_META, UPDATE_CURRENT_APPSTATE, UPDATE_CURRENT_SECTION_ID, FETCH_MODEL_SUCCEEDED, FETCH_MODEL_FAILED, SET_DATA_STATUS, SET_FETCH_STATUS, INIT_CUSTOMIZATION_META, FETCH_MODEL_UNHEALTHY, FETCH_MODEL_USER_LOCKED, INIT_CUSTOMIZATION_AUTO_DEFAULT, FETCH_MODEL_NONBLOCKING, SET_MODEL_UUID, RESET_STATE, FETCH_INSTANCE_PROOFS } from "../redux/constants/app";
4
4
  import type { INIT_USER, SET_USER_STATUS, SET_USER_VALID_TOKEN } from "../redux/constants/user";
5
- import type { INIT_REFERENCES, UPDATE_VARIABLE_META, UPDATE_OPTION_META, SET_DISABLED_VARIABLE } from "../redux/constants/references";
5
+ import type { INIT_REFERENCES, UPDATE_VARIABLE_META, UPDATE_OPTION_META, SET_DISABLED_VARIABLE, UPDATE_OPTION_CHILDREN } from "../redux/constants/references";
6
6
  import type { INIT_INPUTS, INIT_OPTION, UPDATE_OPTION_INPUT, INIT_VARIABLE, UPDATE_VARIABLE_INPUT, ADD_MULTIPLE_OCCURENCY, DELETE_MULTIPLE_OCCURENCY } from "../redux/constants/inputs";
7
7
  import type { INIT_CONDITIONS, UPDATE_OPTION_CONDITION, UPDATE_VARIABLE_CONDITION, UPDATE_SECTION_CONDITION, UPDATE_PREFILLER_CONDITION, UPDATE_OPTION_VALIDATOR_CONDITION, UPDATE_VARIABLE_VALIDATOR_CONDITION, UPDATE_DOCUMENT_CONDITION } from "../redux/constants/conditions";
8
8
  import type { FETCH_MODEL, FETCH_MODEL_PREREQUISITES } from "../redux/constants/sagas/model";
@@ -166,6 +166,11 @@ export declare namespace ActionsType {
166
166
  id: number;
167
167
  meta: OptionUpdatableMeta;
168
168
  }
169
+ interface updateOptionChildrenOrder {
170
+ type: typeof UPDATE_OPTION_CHILDREN;
171
+ id: number;
172
+ options: number[];
173
+ }
169
174
  }
170
175
  namespace Inputs {
171
176
  interface initInputs {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "4.45.2",
3
+ "version": "4.45.4",
4
4
  "author": "Moncef Hammou (moncef@legalplace.fr)",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@appnest/masonry-layout": "^2.0.8",
23
23
  "@cryptography/sha1": "^0.2.0",
24
- "@legalplace/data-gouv": "^1.6.120",
24
+ "@legalplace/data-gouv": "^1.6.121",
25
25
  "@legalplace/lp-events": "1.14.0",
26
26
  "@legalplace/lplogic": "2.3.1",
27
27
  "@legalplace/model-healthcheck": "^1.1.5",
@@ -62,7 +62,7 @@
62
62
  "@legalplace/eslint-config": "^2.3.0",
63
63
  "@legalplace/models-v3-types": "^5.15.11",
64
64
  "@legalplace/prettier-config": "^2.1.3",
65
- "@legalplace/typeorm-entities": "^5.72.2",
65
+ "@legalplace/typeorm-entities": "^5.73.0",
66
66
  "@swc-node/jest": "^1.3.2",
67
67
  "@swc/core": "^1.2.93",
68
68
  "@swc/jest": "^0.2.4",
@@ -101,5 +101,5 @@
101
101
  "*.test.ts",
102
102
  "*.test.tsx"
103
103
  ],
104
- "gitHead": "7ecad9c3882c3065a6b392460c4a3e0b4bbecfa9"
104
+ "gitHead": "bf23d44156f319798d642cdd74956c5f76e31991"
105
105
  }