@beinformed/ui 1.49.5 → 1.49.6
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.
- package/CHANGELOG.md +7 -0
- package/esm/redux/actions/FormAutoupdate.js +1 -1
- package/esm/redux/actions/FormAutoupdate.js.map +1 -1
- package/lib/redux/actions/FormAutoupdate.js +1 -1
- package/lib/redux/actions/FormAutoupdate.js.flow +15 -11
- package/lib/redux/actions/FormAutoupdate.js.map +1 -1
- package/package.json +1 -1
- package/src/redux/actions/FormAutoupdate.js +15 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.49.6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.5...v1.49.6) (2024-07-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **autoupdate:** autoupdate should not commit by default ([20dc1c5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/20dc1c5e36eb46e6ee0c45a9ae6fb6047f080adf))
|
|
11
|
+
|
|
5
12
|
## [1.49.5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.4...v1.49.5) (2024-07-03)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -11,7 +11,7 @@ export const autoupdateFormObject = (form, attribute) => {
|
|
|
11
11
|
form.setPreviousObject();
|
|
12
12
|
}
|
|
13
13
|
if (form.isChanged()) {
|
|
14
|
-
return loadModularUI(form.connectKey, form.selfhref, {
|
|
14
|
+
return loadModularUI(form.connectKey, form.selfhref.setParameter("commit", "false"), {
|
|
15
15
|
method: HTTP_METHODS.POST,
|
|
16
16
|
data: form.formdata,
|
|
17
17
|
updateHandler: newModel => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormAutoupdate.js","names":["loadModularUI","HTTP_METHODS","FormModel","autoupdateFormObject","form","attribute","allObjects","length","currentFormObject","hasAttributeByKey","key","setPreviousObject","isChanged","connectKey","selfhref","method","POST","data","formdata","updateHandler","newModel","clonedModel","clone","updateCurrentFormObject"],"sources":["../../../src/redux/actions/FormAutoupdate.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/ModularUIActions\";\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { AttributeType, ModularUIModel } from \"../../models/types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const autoupdateFormObject = (\n form: FormModel,\n attribute: AttributeType,\n): ?ThunkAction => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged()) {\n return loadModularUI(form.connectKey
|
|
1
|
+
{"version":3,"file":"FormAutoupdate.js","names":["loadModularUI","HTTP_METHODS","FormModel","autoupdateFormObject","form","attribute","allObjects","length","currentFormObject","hasAttributeByKey","key","setPreviousObject","isChanged","connectKey","selfhref","setParameter","method","POST","data","formdata","updateHandler","newModel","clonedModel","clone","updateCurrentFormObject"],"sources":["../../../src/redux/actions/FormAutoupdate.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/ModularUIActions\";\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { AttributeType, ModularUIModel } from \"../../models/types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const autoupdateFormObject = (\n form: FormModel,\n attribute: AttributeType,\n): ?ThunkAction => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged()) {\n return loadModularUI(\n form.connectKey,\n form.selfhref.setParameter(\"commit\", \"false\"),\n {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel: ModularUIModel): ModularUIModel => {\n if (newModel instanceof FormModel) {\n const clonedModel: FormModel = form.clone();\n clonedModel.updateCurrentFormObject(newModel);\n return clonedModel;\n }\n return newModel;\n },\n },\n );\n }\n\n return null;\n};\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,gCAAgC;AAC9D,SAASC,YAAY,QAAQ,2BAA2B;AAExD,OAAOC,SAAS,MAAM,6BAA6B;AAKnD;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAClCC,IAAe,EACfC,SAAwB,KACP;EACjB;EACA;EACA;EACA,OACED,IAAI,CAACE,UAAU,CAACC,MAAM,GAAG,CAAC,KACzB,CAACH,IAAI,CAACI,iBAAiB,IACtB,CAACJ,IAAI,CAACI,iBAAiB,CAACC,iBAAiB,CAACJ,SAAS,CAACK,GAAG,CAAC,CAAC,EAC3D;IACAN,IAAI,CAACO,iBAAiB,CAAC,CAAC;EAC1B;EAEA,IAAIP,IAAI,CAACQ,SAAS,CAAC,CAAC,EAAE;IACpB,OAAOZ,aAAa,CAClBI,IAAI,CAACS,UAAU,EACfT,IAAI,CAACU,QAAQ,CAACC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,EAC7C;MACEC,MAAM,EAAEf,YAAY,CAACgB,IAAI;MACzBC,IAAI,EAAEd,IAAI,CAACe,QAAQ;MACnBC,aAAa,EAAGC,QAAwB,IAAqB;QAC3D,IAAIA,QAAQ,YAAYnB,SAAS,EAAE;UACjC,MAAMoB,WAAsB,GAAGlB,IAAI,CAACmB,KAAK,CAAC,CAAC;UAC3CD,WAAW,CAACE,uBAAuB,CAACH,QAAQ,CAAC;UAC7C,OAAOC,WAAW;QACpB;QACA,OAAOD,QAAQ;MACjB;IACF,CACF,CAAC;EACH;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@ const autoupdateFormObject = (form, attribute) => {
|
|
|
18
18
|
form.setPreviousObject();
|
|
19
19
|
}
|
|
20
20
|
if (form.isChanged()) {
|
|
21
|
-
return (0, _ModularUIActions.loadModularUI)(form.connectKey, form.selfhref, {
|
|
21
|
+
return (0, _ModularUIActions.loadModularUI)(form.connectKey, form.selfhref.setParameter("commit", "false"), {
|
|
22
22
|
method: _Constants.HTTP_METHODS.POST,
|
|
23
23
|
data: form.formdata,
|
|
24
24
|
updateHandler: newModel => {
|
|
@@ -25,18 +25,22 @@ export const autoupdateFormObject = (
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
if (form.isChanged()) {
|
|
28
|
-
return loadModularUI(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
return loadModularUI(
|
|
29
|
+
form.connectKey,
|
|
30
|
+
form.selfhref.setParameter("commit", "false"),
|
|
31
|
+
{
|
|
32
|
+
method: HTTP_METHODS.POST,
|
|
33
|
+
data: form.formdata,
|
|
34
|
+
updateHandler: (newModel: ModularUIModel): ModularUIModel => {
|
|
35
|
+
if (newModel instanceof FormModel) {
|
|
36
|
+
const clonedModel: FormModel = form.clone();
|
|
37
|
+
clonedModel.updateCurrentFormObject(newModel);
|
|
38
|
+
return clonedModel;
|
|
39
|
+
}
|
|
40
|
+
return newModel;
|
|
41
|
+
},
|
|
38
42
|
},
|
|
39
|
-
|
|
43
|
+
);
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormAutoupdate.js","names":["_ModularUIActions","require","_Constants","_FormModel","_interopRequireDefault","autoupdateFormObject","form","attribute","allObjects","length","currentFormObject","hasAttributeByKey","key","setPreviousObject","isChanged","loadModularUI","connectKey","selfhref","method","HTTP_METHODS","POST","data","formdata","updateHandler","newModel","FormModel","clonedModel","clone","updateCurrentFormObject","exports"],"sources":["../../../src/redux/actions/FormAutoupdate.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/ModularUIActions\";\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { AttributeType, ModularUIModel } from \"../../models/types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const autoupdateFormObject = (\n form: FormModel,\n attribute: AttributeType,\n): ?ThunkAction => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged()) {\n return loadModularUI(form.connectKey
|
|
1
|
+
{"version":3,"file":"FormAutoupdate.js","names":["_ModularUIActions","require","_Constants","_FormModel","_interopRequireDefault","autoupdateFormObject","form","attribute","allObjects","length","currentFormObject","hasAttributeByKey","key","setPreviousObject","isChanged","loadModularUI","connectKey","selfhref","setParameter","method","HTTP_METHODS","POST","data","formdata","updateHandler","newModel","FormModel","clonedModel","clone","updateCurrentFormObject","exports"],"sources":["../../../src/redux/actions/FormAutoupdate.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/ModularUIActions\";\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { AttributeType, ModularUIModel } from \"../../models/types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const autoupdateFormObject = (\n form: FormModel,\n attribute: AttributeType,\n): ?ThunkAction => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged()) {\n return loadModularUI(\n form.connectKey,\n form.selfhref.setParameter(\"commit\", \"false\"),\n {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel: ModularUIModel): ModularUIModel => {\n if (newModel instanceof FormModel) {\n const clonedModel: FormModel = form.clone();\n clonedModel.updateCurrentFormObject(newModel);\n return clonedModel;\n }\n return newModel;\n },\n },\n );\n }\n\n return null;\n};\n"],"mappings":";;;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA;AACA;AACO,MAAMI,oBAAoB,GAAGA,CAClCC,IAAe,EACfC,SAAwB,KACP;EACjB;EACA;EACA;EACA,OACED,IAAI,CAACE,UAAU,CAACC,MAAM,GAAG,CAAC,KACzB,CAACH,IAAI,CAACI,iBAAiB,IACtB,CAACJ,IAAI,CAACI,iBAAiB,CAACC,iBAAiB,CAACJ,SAAS,CAACK,GAAG,CAAC,CAAC,EAC3D;IACAN,IAAI,CAACO,iBAAiB,CAAC,CAAC;EAC1B;EAEA,IAAIP,IAAI,CAACQ,SAAS,CAAC,CAAC,EAAE;IACpB,OAAO,IAAAC,+BAAa,EAClBT,IAAI,CAACU,UAAU,EACfV,IAAI,CAACW,QAAQ,CAACC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,EAC7C;MACEC,MAAM,EAAEC,uBAAY,CAACC,IAAI;MACzBC,IAAI,EAAEhB,IAAI,CAACiB,QAAQ;MACnBC,aAAa,EAAGC,QAAwB,IAAqB;QAC3D,IAAIA,QAAQ,YAAYC,kBAAS,EAAE;UACjC,MAAMC,WAAsB,GAAGrB,IAAI,CAACsB,KAAK,CAAC,CAAC;UAC3CD,WAAW,CAACE,uBAAuB,CAACJ,QAAQ,CAAC;UAC7C,OAAOE,WAAW;QACpB;QACA,OAAOF,QAAQ;MACjB;IACF,CACF,CAAC;EACH;EAEA,OAAO,IAAI;AACb,CAAC;AAACK,OAAA,CAAAzB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -25,18 +25,22 @@ export const autoupdateFormObject = (
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
if (form.isChanged()) {
|
|
28
|
-
return loadModularUI(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
return loadModularUI(
|
|
29
|
+
form.connectKey,
|
|
30
|
+
form.selfhref.setParameter("commit", "false"),
|
|
31
|
+
{
|
|
32
|
+
method: HTTP_METHODS.POST,
|
|
33
|
+
data: form.formdata,
|
|
34
|
+
updateHandler: (newModel: ModularUIModel): ModularUIModel => {
|
|
35
|
+
if (newModel instanceof FormModel) {
|
|
36
|
+
const clonedModel: FormModel = form.clone();
|
|
37
|
+
clonedModel.updateCurrentFormObject(newModel);
|
|
38
|
+
return clonedModel;
|
|
39
|
+
}
|
|
40
|
+
return newModel;
|
|
41
|
+
},
|
|
38
42
|
},
|
|
39
|
-
|
|
43
|
+
);
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
return null;
|