@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.
- package/CHANGELOG.md +6 -0
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +1 -0
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +2 -2
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js +7 -0
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js +1 -0
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/actions/Form.js +2 -2
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +2 -2
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +4 -4
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +2 -2
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +2 -2
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/types.js.map +1 -1
- package/lib/hooks/__tests__/useForm.spec.js.flow +4 -4
- package/lib/hooks/useForm.js.flow +5 -5
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +1 -0
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +1 -0
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +2 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +2 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/redux/_modularui/ModularUIActions.js +9 -1
- package/lib/redux/_modularui/ModularUIActions.js.flow +8 -0
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js +1 -0
- package/lib/redux/_modularui/ModularUIReducer.js.flow +1 -0
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +5 -0
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/actions/Form.js +1 -1
- package/lib/redux/actions/Form.js.flow +4 -4
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +1 -1
- package/lib/redux/actions/FormAttributeSet.js.flow +3 -2
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +3 -3
- package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +8 -8
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +1 -1
- package/lib/redux/actions/FormAutosave.js.flow +2 -2
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +1 -1
- package/lib/redux/actions/FormValidations.js.flow +2 -2
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/__tests__/Form.spec.js.flow +1 -1
- package/lib/redux/connectors/Form.js.flow +2 -5
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js.flow +5 -5
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/types.js.flow +2 -0
- package/lib/redux/types.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/__tests__/useForm.spec.js +4 -4
- package/src/hooks/useForm.js +5 -5
- package/src/models/attributes/ChoiceAttributeModel.js +1 -0
- package/src/models/attributes/ChoiceAttributeOptionModel.js +2 -2
- package/src/redux/_modularui/ModularUIActions.js +8 -0
- package/src/redux/_modularui/ModularUIReducer.js +1 -0
- package/src/redux/_modularui/types.js +5 -0
- package/src/redux/actions/Form.js +4 -4
- package/src/redux/actions/FormAttributeSet.js +3 -2
- package/src/redux/actions/FormAttributeSetRepeatable.js +8 -8
- package/src/redux/actions/FormAutosave.js +2 -2
- package/src/redux/actions/FormValidations.js +2 -2
- package/src/redux/actions/__tests__/Form.spec.js +1 -1
- package/src/redux/connectors/Form.js +2 -5
- package/src/redux/connectors/FormAttributeSet.js +5 -5
- package/src/redux/types.js +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import { goBack } from "../_router/RouterActions";
|
|
3
|
-
import {
|
|
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 {
|
|
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):
|
|
17
|
+
export const previousObject = (form: FormModel): UpdateFormAction => {
|
|
18
18
|
const newForm = form.clone();
|
|
19
19
|
|
|
20
20
|
newForm.setPreviousObject();
|
|
21
21
|
|
|
22
|
-
return
|
|
22
|
+
return updateForm(newForm);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
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
|
-
|
|
71
|
+
|
|
72
|
+
return dispatch(updateForm(newForm));
|
|
72
73
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
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 {
|
|
6
|
+
import type { UpdateFormAction } from "../_modularui/types";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
*/
|
|
10
10
|
export const addRepeatableAttributeSet = (
|
|
11
11
|
form: FormModel
|
|
12
|
-
):
|
|
12
|
+
): UpdateFormAction => {
|
|
13
13
|
const newForm = form.clone();
|
|
14
14
|
|
|
15
15
|
newForm.addEmptyFormObject();
|
|
16
16
|
|
|
17
|
-
return
|
|
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
|
-
):
|
|
25
|
+
): UpdateFormAction => {
|
|
26
26
|
const newForm = form.clone();
|
|
27
27
|
|
|
28
28
|
newForm.addEmptyFormObject();
|
|
29
29
|
newForm.removeFormObject(formObject);
|
|
30
30
|
|
|
31
|
-
return
|
|
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
|
-
):
|
|
39
|
+
): UpdateFormAction => {
|
|
40
40
|
const newForm = form.clone();
|
|
41
41
|
|
|
42
42
|
newForm.removeFormObject(formObject);
|
|
43
43
|
|
|
44
|
-
return
|
|
44
|
+
return updateForm(newForm);
|
|
45
45
|
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
AUTOSAVE_STATUS,
|
|
11
11
|
} from "../../constants/Constants";
|
|
12
12
|
|
|
13
|
-
import {
|
|
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(
|
|
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 {
|
|
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(
|
|
33
|
+
dispatch(updateForm(validatedForm));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -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) =>
|
|
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 {
|
|
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<
|
|
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: () =>
|
|
36
|
-
onCancelAttributeSetClick: (formObject: FormObjectModel) =>
|
|
37
|
-
onRemoveAttributeSetClick: (formObject: FormObjectModel) =>
|
|
35
|
+
onAddAttributeSetClick: () => UpdateFormAction,
|
|
36
|
+
onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,
|
|
37
|
+
onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
type Props = {
|
package/src/redux/types.js
CHANGED
|
@@ -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
|