@beinformed/ui 1.27.5 → 1.27.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/esm/hooks/useForm.js.map +1 -1
  3. package/esm/models/attributes/ChoiceAttributeModel.js +1 -0
  4. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  5. package/esm/models/attributes/ChoiceAttributeOptionModel.js +2 -2
  6. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  7. package/esm/redux/_modularui/ModularUIActions.js +7 -0
  8. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  9. package/esm/redux/_modularui/ModularUIReducer.js +1 -0
  10. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  11. package/esm/redux/_modularui/types.js.map +1 -1
  12. package/esm/redux/actions/Form.js +2 -2
  13. package/esm/redux/actions/Form.js.map +1 -1
  14. package/esm/redux/actions/FormAttributeSet.js +2 -2
  15. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  16. package/esm/redux/actions/FormAttributeSetRepeatable.js +4 -4
  17. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  18. package/esm/redux/actions/FormAutosave.js +2 -2
  19. package/esm/redux/actions/FormAutosave.js.map +1 -1
  20. package/esm/redux/actions/FormValidations.js +2 -2
  21. package/esm/redux/actions/FormValidations.js.map +1 -1
  22. package/esm/redux/connectors/Form.js.map +1 -1
  23. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  24. package/esm/redux/types.js.map +1 -1
  25. package/lib/hooks/__tests__/useForm.spec.js.flow +4 -4
  26. package/lib/hooks/useForm.js.flow +5 -5
  27. package/lib/hooks/useForm.js.map +1 -1
  28. package/lib/models/attributes/ChoiceAttributeModel.js +1 -0
  29. package/lib/models/attributes/ChoiceAttributeModel.js.flow +1 -0
  30. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  31. package/lib/models/attributes/ChoiceAttributeOptionModel.js +2 -2
  32. package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +2 -2
  33. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  34. package/lib/redux/_modularui/ModularUIActions.js +9 -1
  35. package/lib/redux/_modularui/ModularUIActions.js.flow +8 -0
  36. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  37. package/lib/redux/_modularui/ModularUIReducer.js +1 -0
  38. package/lib/redux/_modularui/ModularUIReducer.js.flow +1 -0
  39. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  40. package/lib/redux/_modularui/types.js.flow +5 -0
  41. package/lib/redux/_modularui/types.js.map +1 -1
  42. package/lib/redux/actions/Form.js +1 -1
  43. package/lib/redux/actions/Form.js.flow +4 -4
  44. package/lib/redux/actions/Form.js.map +1 -1
  45. package/lib/redux/actions/FormAttributeSet.js +1 -1
  46. package/lib/redux/actions/FormAttributeSet.js.flow +3 -2
  47. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  48. package/lib/redux/actions/FormAttributeSetRepeatable.js +3 -3
  49. package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +8 -8
  50. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  51. package/lib/redux/actions/FormAutosave.js +1 -1
  52. package/lib/redux/actions/FormAutosave.js.flow +2 -2
  53. package/lib/redux/actions/FormAutosave.js.map +1 -1
  54. package/lib/redux/actions/FormValidations.js +1 -1
  55. package/lib/redux/actions/FormValidations.js.flow +2 -2
  56. package/lib/redux/actions/FormValidations.js.map +1 -1
  57. package/lib/redux/actions/__tests__/Form.spec.js.flow +1 -1
  58. package/lib/redux/connectors/Form.js.flow +2 -5
  59. package/lib/redux/connectors/Form.js.map +1 -1
  60. package/lib/redux/connectors/FormAttributeSet.js.flow +5 -5
  61. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  62. package/lib/redux/types.js.flow +2 -0
  63. package/lib/redux/types.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/hooks/__tests__/useForm.spec.js +4 -4
  66. package/src/hooks/useForm.js +5 -5
  67. package/src/models/attributes/ChoiceAttributeModel.js +1 -0
  68. package/src/models/attributes/ChoiceAttributeOptionModel.js +2 -2
  69. package/src/redux/_modularui/ModularUIActions.js +8 -0
  70. package/src/redux/_modularui/ModularUIReducer.js +1 -0
  71. package/src/redux/_modularui/types.js +5 -0
  72. package/src/redux/actions/Form.js +4 -4
  73. package/src/redux/actions/FormAttributeSet.js +3 -2
  74. package/src/redux/actions/FormAttributeSetRepeatable.js +8 -8
  75. package/src/redux/actions/FormAutosave.js +2 -2
  76. package/src/redux/actions/FormValidations.js +2 -2
  77. package/src/redux/actions/__tests__/Form.spec.js +1 -1
  78. package/src/redux/connectors/Form.js +2 -5
  79. package/src/redux/connectors/FormAttributeSet.js +5 -5
  80. package/src/redux/types.js +2 -0
@@ -1,6 +1,6 @@
1
1
  // @flow
2
2
  import { goBack } from "../_router/RouterActions";
3
- import { updateModel } from "../_modularui/ModularUIActions";
3
+ import { updateForm } from "../_modularui/ModularUIActions";
4
4
  import { logoutSuccess } from "./SignOut";
5
5
  import { reloadApplication } from "./Application";
6
6
  import { startProgress, finishProgress } from "./ProgressIndicator";
@@ -9,17 +9,17 @@ import Authenticate from "../../modularui/Authenticate";
9
9
 
10
10
  import type { Dispatch, GetState, ThunkAction } from "../types";
11
11
  import type FormModel from "../../models/form/FormModel";
12
- import type { UpdateModelAction } from "../_modularui/types";
12
+ import type { UpdateFormAction } from "../_modularui/types";
13
13
 
14
14
  /**
15
15
  * Go back to previous object (back button on form)
16
16
  */
17
- export const previousObject = (form: FormModel): UpdateModelAction => {
17
+ export const previousObject = (form: FormModel): UpdateFormAction => {
18
18
  const newForm = form.clone();
19
19
 
20
20
  newForm.setPreviousObject();
21
21
 
22
- return updateModel(newForm);
22
+ return updateForm(newForm);
23
23
  };
24
24
 
25
25
  /**
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import { updateModel } from "../_modularui/ModularUIActions";
2
+ import { updateForm } from "../_modularui/ModularUIActions";
3
3
 
4
4
  import { getSetting } from "../../constants/Settings";
5
5
 
@@ -68,5 +68,6 @@ export const updateFormAttribute =
68
68
  // server form validations happens async, don't wait for the form to return
69
69
  dispatch(validateFormObject(newForm));
70
70
  }
71
- return dispatch(updateModel(newForm));
71
+
72
+ return dispatch(updateForm(newForm));
72
73
  };
@@ -1,20 +1,20 @@
1
1
  // @flow
2
- import { updateModel } from "../_modularui/ModularUIActions";
2
+ import { updateForm } from "../_modularui/ModularUIActions";
3
3
 
4
4
  import type FormModel from "../../models/form/FormModel";
5
5
  import type FormObjectModel from "../../models/form/FormObjectModel";
6
- import type { UpdateModelAction } from "../_modularui/types";
6
+ import type { UpdateFormAction } from "../_modularui/types";
7
7
 
8
8
  /**
9
9
  */
10
10
  export const addRepeatableAttributeSet = (
11
11
  form: FormModel
12
- ): UpdateModelAction => {
12
+ ): UpdateFormAction => {
13
13
  const newForm = form.clone();
14
14
 
15
15
  newForm.addEmptyFormObject();
16
16
 
17
- return updateModel(newForm);
17
+ return updateForm(newForm);
18
18
  };
19
19
 
20
20
  /**
@@ -22,13 +22,13 @@ export const addRepeatableAttributeSet = (
22
22
  export const cancelRepeatableAttributeSet = (
23
23
  form: FormModel,
24
24
  formObject: FormObjectModel
25
- ): UpdateModelAction => {
25
+ ): UpdateFormAction => {
26
26
  const newForm = form.clone();
27
27
 
28
28
  newForm.addEmptyFormObject();
29
29
  newForm.removeFormObject(formObject);
30
30
 
31
- return updateModel(newForm);
31
+ return updateForm(newForm);
32
32
  };
33
33
 
34
34
  /**
@@ -36,10 +36,10 @@ export const cancelRepeatableAttributeSet = (
36
36
  export const removeRepeatableAttributeSet = (
37
37
  form: FormModel,
38
38
  formObject: FormObjectModel
39
- ): UpdateModelAction => {
39
+ ): UpdateFormAction => {
40
40
  const newForm = form.clone();
41
41
 
42
42
  newForm.removeFormObject(formObject);
43
43
 
44
- return updateModel(newForm);
44
+ return updateForm(newForm);
45
45
  };
@@ -10,7 +10,7 @@ import {
10
10
  AUTOSAVE_STATUS,
11
11
  } from "../../constants/Constants";
12
12
 
13
- import { updateModel } from "../_modularui/ModularUIActions";
13
+ import { updateForm } from "../_modularui/ModularUIActions";
14
14
 
15
15
  import type { UpdateAutosaveAction, ThunkAction, Dispatch } from "../types";
16
16
 
@@ -49,7 +49,7 @@ const autosave = (dispatch: Dispatch, form: FormModel) => {
49
49
  // send the existing form to prevent updates in the ui based on autosave results
50
50
  form.lastServerUpdate = savedForm.lastServerUpdate;
51
51
 
52
- dispatch(updateModel(form));
52
+ dispatch(updateForm(form));
53
53
  dispatch(updateAutosave(AUTOSAVE_STATUS.FINISHED, savedForm));
54
54
  }
55
55
  });
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import debounce from "lodash/debounce";
3
3
 
4
- import { updateModel } from "../_modularui/ModularUIActions";
4
+ import { updateForm } from "../_modularui/ModularUIActions";
5
5
 
6
6
  import ModularUIRequest from "../../modularui/ModularUIRequest";
7
7
 
@@ -30,7 +30,7 @@ const updateValidations =
30
30
  validatedForm.updateValidations(formWithValidations.data);
31
31
  }
32
32
 
33
- dispatch(updateModel(validatedForm));
33
+ dispatch(updateForm(validatedForm));
34
34
  }
35
35
  };
36
36
 
@@ -15,7 +15,7 @@ describe("form actions", () => {
15
15
 
16
16
  expect(store.getActions()).toStrictEqual([
17
17
  {
18
- type: "MODULARUI/UPDATE",
18
+ type: "MODULARUI/UPDATE_FORM",
19
19
  payload: expect.objectContaining({
20
20
  _contributions: expect.objectContaining({
21
21
  label: "Create person",
@@ -16,10 +16,7 @@ import type { AbstractComponent } from "react";
16
16
  import type FormModel from "../../models/form/FormModel";
17
17
  import type { ContextRouter } from "react-router";
18
18
  import type { ReduxState, ThunkAction } from "../types";
19
- import type {
20
- ModularUIConnector,
21
- UpdateModelAction,
22
- } from "../_modularui/types";
19
+ import type { ModularUIConnector, UpdateFormAction } from "../_modularui/types";
23
20
 
24
21
  type OwnProps = {
25
22
  ...?ContextRouter,
@@ -33,7 +30,7 @@ type StateProps = {
33
30
  };
34
31
 
35
32
  type DispatchProps = {
36
- onPrevious: (form: FormModel) => UpdateModelAction,
33
+ onPrevious: (form: FormModel) => UpdateFormAction,
37
34
  onCancel: (form: FormModel) => ThunkAction,
38
35
  showFormNotification: (form: FormModel) => ThunkAction,
39
36
  };
@@ -9,14 +9,14 @@ import {
9
9
  } from "../actions/FormAttributeSetRepeatable";
10
10
 
11
11
  import type { ThunkAction, UpdateFormOptions } from "../types";
12
- import type { UpdateModelAction } from "../_modularui/types";
12
+ import type { UpdateFormAction } from "../_modularui/types";
13
13
  import type { AttributeType } from "../../models/types";
14
14
  import type FormModel from "../../models/form/FormModel";
15
15
  import type FormObjectModel from "../../models/form/FormObjectModel";
16
16
  import type { DispatchAPI } from "redux";
17
17
  import type { ComponentType } from "react";
18
18
 
19
- type Dispatch = DispatchAPI<UpdateModelAction> & DispatchAPI<ThunkAction>;
19
+ type Dispatch = DispatchAPI<UpdateFormAction> & DispatchAPI<ThunkAction>;
20
20
 
21
21
  type OwnProps = {
22
22
  form: FormModel,
@@ -32,9 +32,9 @@ type DispatchProps = {
32
32
  value: string,
33
33
  options: UpdateFormOptions
34
34
  ) => ThunkAction,
35
- onAddAttributeSetClick: () => UpdateModelAction,
36
- onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateModelAction,
37
- onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateModelAction,
35
+ onAddAttributeSetClick: () => UpdateFormAction,
36
+ onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,
37
+ onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,
38
38
  };
39
39
 
40
40
  type Props = {
@@ -21,6 +21,7 @@ import type {
21
21
  UpdateStatusAction,
22
22
  SetModelAction,
23
23
  UpdateModelAction,
24
+ UpdateFormAction,
24
25
  RemoveModelByKeyAction,
25
26
  ResetModularUIAction,
26
27
  InitModelAction,
@@ -138,6 +139,7 @@ export type ReduxAction =
138
139
  | SetModelAction
139
140
  | InitModelAction
140
141
  | UpdateModelAction
142
+ | UpdateFormAction
141
143
  | RemoveModelByKeyAction
142
144
  | ResetModularUIAction
143
145
  | SaveErrorAction