@beinformed/ui 1.65.23 → 1.65.24

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 (101) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/esm/hooks/__tests__/useAuthentication.spec.js.flow +100 -132
  3. package/esm/hooks/useAuthentication.js +14 -8
  4. package/esm/hooks/useAuthentication.js.flow +23 -23
  5. package/esm/hooks/useAuthentication.js.map +1 -1
  6. package/esm/hooks/useModularUI.js +1 -1
  7. package/esm/hooks/useModularUI.js.flow +1 -1
  8. package/esm/hooks/useModularUI.js.map +1 -1
  9. package/esm/redux/_i18n/I18nActions.js.flow +1 -1
  10. package/esm/redux/_i18n/I18nActions.js.map +1 -1
  11. package/esm/redux/_modularui/ModularUIActions.js.flow +2 -2
  12. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  13. package/esm/redux/_modularui/ModularUIConnector.js +2 -2
  14. package/esm/redux/_modularui/ModularUIConnector.js.flow +2 -2
  15. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
  16. package/esm/redux/_modularui/ModularUISelectors.js +12 -18
  17. package/esm/redux/_modularui/ModularUISelectors.js.flow +13 -14
  18. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  19. package/esm/redux/_modularui/withModularUI.js.flow +2 -2
  20. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  21. package/esm/redux/actions/Application.js +32 -4
  22. package/esm/redux/actions/Application.js.flow +34 -5
  23. package/esm/redux/actions/Application.js.map +1 -1
  24. package/esm/redux/actions/Authorization.js +20 -25
  25. package/esm/redux/actions/Authorization.js.flow +28 -29
  26. package/esm/redux/actions/Authorization.js.map +1 -1
  27. package/esm/redux/actions/Error.js +2 -0
  28. package/esm/redux/actions/Error.js.flow +5 -4
  29. package/esm/redux/actions/Error.js.map +1 -1
  30. package/esm/redux/actions/Form.js.flow +1 -1
  31. package/esm/redux/actions/Form.js.map +1 -1
  32. package/esm/redux/actions/FormAttributeSet.js.flow +1 -1
  33. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  34. package/esm/redux/actions/FormAutosave.js.flow +1 -1
  35. package/esm/redux/actions/FormAutosave.js.map +1 -1
  36. package/esm/redux/actions/FormAutosubmit.js.flow +1 -1
  37. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  38. package/esm/redux/actions/FormAutoupdate.js.flow +1 -1
  39. package/esm/redux/actions/FormAutoupdate.js.map +1 -1
  40. package/esm/redux/actions/FormValidations.js.flow +1 -1
  41. package/esm/redux/actions/FormValidations.js.map +1 -1
  42. package/esm/redux/actions/Notification.js.flow +3 -3
  43. package/esm/redux/actions/Notification.js.map +1 -1
  44. package/esm/redux/actions/SignIn.js +2 -4
  45. package/esm/redux/actions/SignIn.js.flow +4 -7
  46. package/esm/redux/actions/SignIn.js.map +1 -1
  47. package/esm/redux/actions/SignOut.js.flow +1 -1
  48. package/esm/redux/actions/SignOut.js.map +1 -1
  49. package/esm/redux/actions/__tests__/Application.spec.js.flow +67 -29
  50. package/esm/redux/actions/__tests__/Authorization.spec.js.flow +77 -83
  51. package/esm/redux/connectors/Form.js.flow +2 -2
  52. package/esm/redux/connectors/Form.js.map +1 -1
  53. package/esm/redux/connectors/FormAttributeSet.js.flow +2 -5
  54. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  55. package/esm/redux/connectors/Progress.js.flow +1 -1
  56. package/esm/redux/connectors/Progress.js.map +1 -1
  57. package/esm/redux/connectors/SignIn.js.flow +1 -1
  58. package/esm/redux/connectors/SignIn.js.map +1 -1
  59. package/esm/redux/connectors/SignOut.js.flow +1 -1
  60. package/esm/redux/connectors/SignOut.js.map +1 -1
  61. package/esm/redux/store/configureStore.js +5 -1
  62. package/esm/redux/store/configureStore.js.flow +10 -1
  63. package/esm/redux/store/configureStore.js.map +1 -1
  64. package/esm/redux/types.js.flow +24 -5
  65. package/esm/redux/types.js.map +1 -1
  66. package/lib/hooks/useAuthentication.js +14 -8
  67. package/lib/hooks/useAuthentication.js.map +1 -1
  68. package/lib/hooks/useModularUI.js +1 -1
  69. package/lib/hooks/useModularUI.js.map +1 -1
  70. package/lib/redux/_i18n/I18nActions.js.map +1 -1
  71. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  72. package/lib/redux/_modularui/ModularUIConnector.js +2 -2
  73. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
  74. package/lib/redux/_modularui/ModularUISelectors.js +12 -18
  75. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  76. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  77. package/lib/redux/actions/Application.js +33 -4
  78. package/lib/redux/actions/Application.js.map +1 -1
  79. package/lib/redux/actions/Authorization.js +20 -25
  80. package/lib/redux/actions/Authorization.js.map +1 -1
  81. package/lib/redux/actions/Error.js +2 -0
  82. package/lib/redux/actions/Error.js.map +1 -1
  83. package/lib/redux/actions/Form.js.map +1 -1
  84. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  85. package/lib/redux/actions/FormAutosave.js.map +1 -1
  86. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  87. package/lib/redux/actions/FormAutoupdate.js.map +1 -1
  88. package/lib/redux/actions/FormValidations.js.map +1 -1
  89. package/lib/redux/actions/Notification.js.map +1 -1
  90. package/lib/redux/actions/SignIn.js +2 -4
  91. package/lib/redux/actions/SignIn.js.map +1 -1
  92. package/lib/redux/actions/SignOut.js.map +1 -1
  93. package/lib/redux/connectors/Form.js.map +1 -1
  94. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  95. package/lib/redux/connectors/Progress.js.map +1 -1
  96. package/lib/redux/connectors/SignIn.js.map +1 -1
  97. package/lib/redux/connectors/SignOut.js.map +1 -1
  98. package/lib/redux/store/configureStore.js +5 -1
  99. package/lib/redux/store/configureStore.js.map +1 -1
  100. package/lib/redux/types.js.map +1 -1
  101. package/package.json +9 -9
@@ -1,121 +1,115 @@
1
+ // @flow
1
2
  import configureMockStore from "redux-mock-store";
2
3
  import thunk from "redux-thunk";
3
4
  import { handleUnauthorized } from "../Authorization";
4
5
 
5
6
  import application from "../../../models/application/__mock__/application";
6
- import Href from "../../../models/href/Href";
7
7
  import { MODULARUI_STATUS } from "../../../constants";
8
8
  import { ErrorResponse } from "../../../models";
9
9
  import { Cache } from "../../../utils";
10
10
 
11
- const middlewares = [thunk];
12
- const mockStore = configureMockStore(middlewares);
11
+ const thunkExtra = {
12
+ subscribe: jest.fn((cb) => {
13
+ if (typeof cb === "function") {
14
+ setImmediate(cb);
15
+ }
16
+ return jest.fn();
17
+ }),
18
+ };
19
+
20
+ const middlewares = [thunk.withExtraArgument(thunkExtra)];
21
+
22
+ /**
23
+ * We cast the creator to 'any' then to a function that returns 'any'
24
+ * to bypass the strict Dispatch definition in the redux-mock-store flow-typed file.
25
+ */
26
+ const mockStoreCreator: (state: Object) => any =
27
+ configureMockStore(middlewares);
13
28
 
14
29
  describe("authorization actions", () => {
15
- it("handle unauthorized with application present when logged in", () => {
30
+ beforeEach(() => {
31
+ jest.clearAllMocks();
32
+ Cache.removeItem("auth");
33
+ });
34
+
35
+ it("handle unauthorized with application present when logged in", async () => {
36
+ const connectKey = "application(/)(en)";
16
37
  Cache.setItem("auth", true);
17
- application.connectKey = "/";
18
- const store = mockStore({
38
+
39
+ const store = mockStoreCreator({
19
40
  modularui: {
20
- "/": {
21
- connectKey: "/",
41
+ [connectKey]: {
42
+ connectKey: connectKey,
22
43
  model: application,
23
44
  status: MODULARUI_STATUS.FINISHED,
24
45
  },
25
46
  },
26
- router: {},
47
+ router: { location: { pathname: "/current-page" } },
48
+ i18n: { locale: "en" },
27
49
  });
28
50
 
29
51
  const errorResponse = new ErrorResponse(
30
- {
31
- id: "Error.Authentication.InvalidUsername",
32
- },
33
- "/",
52
+ { id: "Error.Authentication.InvalidUsername" },
53
+ connectKey,
34
54
  );
35
- store.dispatch(handleUnauthorized(errorResponse));
36
55
 
37
- expect(store.getActions()).toStrictEqual([
38
- {
39
- type: "MODULARUI/REMOVE_KEY",
40
- payload: "/",
41
- },
42
- {
43
- type: "MODULARUI/REMOVE_KEY",
44
- payload: "/",
45
- },
46
- {
47
- type: "START_PROGRESS",
48
- },
49
- {
50
- type: "MODULARUI/FETCH",
51
- payload: expect.objectContaining({
52
- href: new Href("/", "Application"),
53
- }),
54
- },
55
- {
56
- type: "AUTHENTICATION_LOGOUT",
57
- },
58
- {
59
- type: "AUTHENTICATION_ERROR",
60
- payload: "Error.Authentication.InvalidUsername",
61
- },
62
- {
63
- type: "ROUTER/REPLACE",
64
- payload: {
65
- location: "/signin",
66
- state: {
67
- from: undefined,
68
- modal: false,
69
- },
70
- },
71
- },
72
- ]);
56
+ await store.dispatch(handleUnauthorized(errorResponse));
57
+
58
+ const actions = store.getActions();
59
+
60
+ expect(actions).toEqual(
61
+ expect.arrayContaining([
62
+ { type: "MODULARUI/REMOVE_KEY", payload: connectKey },
63
+ { type: "START_PROGRESS" },
64
+ { type: "AUTHENTICATION_LOGOUT" },
65
+ ]),
66
+ );
73
67
  });
74
68
 
75
- it("handle unauthorized with application present when logged out", () => {
76
- Cache.removeItem("auth");
77
- application.connectKey = "/";
78
- const store = mockStore({
69
+ it("handle unauthorized when no auth cache and logged out", async () => {
70
+ const store = mockStoreCreator({
79
71
  modularui: {
80
72
  "/": {
81
73
  connectKey: "/",
82
- model: application,
74
+ model: { ...application, isLoggedIn: false },
83
75
  status: MODULARUI_STATUS.FINISHED,
84
76
  },
85
77
  },
86
- router: {},
78
+ router: { location: { pathname: "/dashboard" } },
79
+ i18n: { locale: "en" },
87
80
  });
88
81
 
89
82
  const errorResponse = new ErrorResponse(
90
- {
91
- id: "Error.Authentication.InvalidUsername",
92
- },
83
+ { id: "Error.Authentication.InvalidUsername" },
93
84
  "/",
94
85
  );
95
- store.dispatch(handleUnauthorized(errorResponse));
96
86
 
97
- expect(store.getActions()).toStrictEqual([
98
- {
99
- type: "MODULARUI/REMOVE_KEY",
100
- payload: "/",
101
- },
102
- {
103
- type: "AUTHENTICATION_LOGOUT",
104
- },
105
- {
106
- type: "AUTHENTICATION_ERROR",
107
- payload: "Error.Authentication.InvalidUsername",
108
- },
109
- {
110
- type: "ROUTER/REPLACE",
111
- payload: {
112
- location: "/signin",
113
- state: {
114
- from: undefined,
115
- modal: false,
116
- },
117
- },
118
- },
119
- ]);
87
+ await store.dispatch(handleUnauthorized(errorResponse));
88
+
89
+ expect(store.getActions()).toEqual(
90
+ expect.arrayContaining([{ type: "AUTHENTICATION_LOGOUT" }]),
91
+ );
92
+ });
93
+
94
+ it("adds current location to 'from' state during redirect", async () => {
95
+ const currentLocation = { pathname: "/orders", search: "?id=1" };
96
+ const store = mockStoreCreator({
97
+ modularui: {},
98
+ router: { location: currentLocation },
99
+ i18n: { locale: "en" },
100
+ });
101
+
102
+ // Fix: ErrorResponse expects string or undefined, not null
103
+ const errorResponse = new ErrorResponse({ id: "ERR" }, undefined);
104
+
105
+ await store.dispatch(handleUnauthorized(errorResponse));
106
+
107
+ const actions = store.getActions();
108
+ // Fix: Cast the found action to ReplaceAction to allow .payload access
109
+ const replaceAction = (actions.find(
110
+ (a) => typeof a === "object" && a.type === "ROUTER/REPLACE",
111
+ ): any);
112
+
113
+ expect(replaceAction?.payload.state.from).toEqual(currentLocation);
120
114
  });
121
115
  });
@@ -31,8 +31,8 @@ type StateProps = {
31
31
 
32
32
  type DispatchProps = {
33
33
  onPrevious: (form: FormModel) => UpdateFormAction,
34
- onCancel: (form: FormModel) => ThunkAction,
35
- showFormNotification: (form: FormModel) => ThunkAction,
34
+ onCancel: (form: FormModel) => ThunkAction<>,
35
+ showFormNotification: (form: FormModel) => ThunkAction<>,
36
36
  };
37
37
 
38
38
  type Props = {
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","names":["compose","connect","modularui","HTTP_METHODS","getSetting","cancelForm","previousObject","showFormNotification","Href","mapStateToProps","state","ownProps","isModal","router","location","modal","mapDispatchToProps","onPrevious","onCancel","reduxConnectedForm","moduiConnectedForm","href","formHref","pathname","search","addParameter","propName","method","POST","connectForm"],"sources":["../../../src/redux/connectors/Form.js"],"sourcesContent":["// @flow\nimport { compose } from \"redux\";\nimport { connect } from \"react-redux\";\n\nimport modularui from \"../_modularui/ModularUIConnector\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport { cancelForm, previousObject } from \"../actions/Form\";\nimport { showFormNotification } from \"../actions/Notification\";\n\nimport Href from \"../../models/href/Href\";\n\nimport type { AbstractComponent } from \"react\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type { ContextRouter } from \"react-router\";\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ModularUIConnector, UpdateFormAction } from \"../_modularui/types\";\n\ntype OwnProps = {\n ...?ContextRouter,\n href?: Href,\n isModal?: boolean,\n redirectTo?: string,\n};\n\ntype StateProps = {\n isModal: boolean,\n};\n\ntype DispatchProps = {\n onPrevious: (form: FormModel) => UpdateFormAction,\n onCancel: (form: FormModel) => ThunkAction,\n showFormNotification: (form: FormModel) => ThunkAction,\n};\n\ntype Props = {\n ...OwnProps,\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (\n state: ReduxState,\n ownProps: OwnProps,\n): StateProps => ({\n isModal: state.router.location?.state?.modal || ownProps.isModal || false,\n});\n\nconst mapDispatchToProps: DispatchProps = {\n onPrevious: previousObject,\n onCancel: cancelForm,\n showFormNotification,\n};\n\nconst reduxConnectedForm = connect<Props, OwnProps, StateProps, _, _, _>(\n mapStateToProps,\n mapDispatchToProps,\n);\n\nconst moduiConnectedForm: ModularUIConnector = modularui(\n \"Form\",\n ({ href, location }) => {\n const formHref = href || new Href(`${location.pathname}${location.search}`);\n\n if (getSetting(\"ALWAYS_COMMIT_FORM\")) {\n return formHref;\n }\n\n return formHref.addParameter(\"commit\", \"false\");\n },\n { propName: \"form\", method: HTTP_METHODS.POST },\n);\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useForm' instead\n */\nexport const connect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,WAEmB,GAAG7B,OAAO,CACxCoB,kBAAkB,EAClBD,kBACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Form.js","names":["compose","connect","modularui","HTTP_METHODS","getSetting","cancelForm","previousObject","showFormNotification","Href","mapStateToProps","state","ownProps","isModal","router","location","modal","mapDispatchToProps","onPrevious","onCancel","reduxConnectedForm","moduiConnectedForm","href","formHref","pathname","search","addParameter","propName","method","POST","connectForm"],"sources":["../../../src/redux/connectors/Form.js"],"sourcesContent":["// @flow\nimport { compose } from \"redux\";\nimport { connect } from \"react-redux\";\n\nimport modularui from \"../_modularui/ModularUIConnector\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport { cancelForm, previousObject } from \"../actions/Form\";\nimport { showFormNotification } from \"../actions/Notification\";\n\nimport Href from \"../../models/href/Href\";\n\nimport type { AbstractComponent } from \"react\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type { ContextRouter } from \"react-router\";\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ModularUIConnector, UpdateFormAction } from \"../_modularui/types\";\n\ntype OwnProps = {\n ...?ContextRouter,\n href?: Href,\n isModal?: boolean,\n redirectTo?: string,\n};\n\ntype StateProps = {\n isModal: boolean,\n};\n\ntype DispatchProps = {\n onPrevious: (form: FormModel) => UpdateFormAction,\n onCancel: (form: FormModel) => ThunkAction<>,\n showFormNotification: (form: FormModel) => ThunkAction<>,\n};\n\ntype Props = {\n ...OwnProps,\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (\n state: ReduxState,\n ownProps: OwnProps,\n): StateProps => ({\n isModal: state.router.location?.state?.modal || ownProps.isModal || false,\n});\n\nconst mapDispatchToProps: DispatchProps = {\n onPrevious: previousObject,\n onCancel: cancelForm,\n showFormNotification,\n};\n\nconst reduxConnectedForm = connect<Props, OwnProps, StateProps, _, _, _>(\n mapStateToProps,\n mapDispatchToProps,\n);\n\nconst moduiConnectedForm: ModularUIConnector = modularui(\n \"Form\",\n ({ href, location }) => {\n const formHref = href || new Href(`${location.pathname}${location.search}`);\n\n if (getSetting(\"ALWAYS_COMMIT_FORM\")) {\n return formHref;\n }\n\n return formHref.addParameter(\"commit\", \"false\");\n },\n { propName: \"form\", method: HTTP_METHODS.POST },\n);\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useForm' instead\n */\nexport const connectForm: (\n Component: AbstractComponent<Props>,\n) => AbstractComponent<OwnProps> = compose(\n moduiConnectedForm,\n reduxConnectedForm,\n);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,OAAO,QAAQ,aAAa;AAErC,OAAOC,SAAS,MAAM,kCAAkC;AAExD,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,UAAU,QAAQ,0BAA0B;AAErD,SAASC,UAAU,EAAEC,cAAc,QAAQ,iBAAiB;AAC5D,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,OAAOC,IAAI,MAAM,wBAAwB;AA+BzC,MAAMC,eAAe,GAAGA,CACtBC,KAAiB,EACjBC,QAAkB,MACF;EAChBC,OAAO,EAAEF,KAAK,CAACG,MAAM,CAACC,QAAQ,EAAEJ,KAAK,EAAEK,KAAK,IAAIJ,QAAQ,CAACC,OAAO,IAAI;AACtE,CAAC,CAAC;AAEF,MAAMI,kBAAiC,GAAG;EACxCC,UAAU,EAAEX,cAAc;EAC1BY,QAAQ,EAAEb,UAAU;EACpBE;AACF,CAAC;AAED,MAAMY,kBAAkB,GAAGlB,OAAO,CAChCQ,eAAe,EACfO,kBACF,CAAC;AAED,MAAMI,kBAAsC,GAAGlB,SAAS,CACtD,MAAM,EACN,CAAC;EAAEmB,IAAI;EAAEP;AAAS,CAAC,KAAK;EACtB,MAAMQ,QAAQ,GAAGD,IAAI,IAAI,IAAIb,IAAI,CAAC,GAAGM,QAAQ,CAACS,QAAQ,GAAGT,QAAQ,CAACU,MAAM,EAAE,CAAC;EAE3E,IAAIpB,UAAU,CAAC,oBAAoB,CAAC,EAAE;IACpC,OAAOkB,QAAQ;EACjB;EAEA,OAAOA,QAAQ,CAACG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;AACjD,CAAC,EACD;EAAEC,QAAQ,EAAE,MAAM;EAAEC,MAAM,EAAExB,YAAY,CAACyB;AAAK,CAChD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,WAEmB,GAAG7B,OAAO,CACxCoB,kBAAkB,EAClBD,kBACF,CAAC","ignoreList":[]}
@@ -8,16 +8,13 @@ import {
8
8
  removeRepeatableAttributeSet,
9
9
  } from "../actions/FormAttributeSetRepeatable";
10
10
 
11
- import type { ThunkAction, UpdateFormOptions } from "../types";
11
+ import type { ThunkAction, UpdateFormOptions, Dispatch } from "../types";
12
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
- import type { DispatchAPI } from "redux";
17
16
  import type { ComponentType } from "react";
18
17
 
19
- type Dispatch = DispatchAPI<UpdateFormAction> & DispatchAPI<ThunkAction>;
20
-
21
18
  type OwnProps = {
22
19
  form: FormModel,
23
20
  object: FormObjectModel,
@@ -32,7 +29,7 @@ type DispatchProps = {
32
29
  attribute: AttributeType,
33
30
  value: string,
34
31
  options: UpdateFormOptions,
35
- ) => ThunkAction,
32
+ ) => ThunkAction<>,
36
33
  onAddAttributeSetClick: () => UpdateFormAction,
37
34
  onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,
38
35
  onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,
@@ -1 +1 @@
1
- {"version":3,"file":"FormAttributeSet.js","names":["connect","updateFormAttribute","addRepeatableAttributeSet","cancelRepeatableAttributeSet","removeRepeatableAttributeSet","mapDispatchToProps","dispatch","ownProps","onAttributeChange","attribute","value","options","autosubmit","autosave","autoupdate","form","object","onAddAttributeSetClick","onCancelAttributeSetClick","formObject","onRemoveAttributeSetClick","connectFormAttributeSet"],"sources":["../../../src/redux/connectors/FormAttributeSet.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { updateFormAttribute } from \"../actions/FormAttributeSet\";\nimport {\n addRepeatableAttributeSet,\n cancelRepeatableAttributeSet,\n removeRepeatableAttributeSet,\n} from \"../actions/FormAttributeSetRepeatable\";\n\nimport type { ThunkAction, UpdateFormOptions } from \"../types\";\nimport type { UpdateFormAction } from \"../_modularui/types\";\nimport type { AttributeType } from \"../../models/types\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type FormObjectModel from \"../../models/form/FormObjectModel\";\nimport type { DispatchAPI } from \"redux\";\nimport type { ComponentType } from \"react\";\n\ntype Dispatch = DispatchAPI<UpdateFormAction> & DispatchAPI<ThunkAction>;\n\ntype OwnProps = {\n form: FormModel,\n object: FormObjectModel,\n formLayout?: \"vertical\" | \"horizontal\" | \"compact\",\n autosubmit?: boolean,\n autosave?: boolean,\n autoupdate?: boolean,\n};\n\ntype DispatchProps = {\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n ) => ThunkAction,\n onAddAttributeSetClick: () => UpdateFormAction,\n onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n};\n\ntype Props = {\n ...OwnProps,\n ...DispatchProps,\n};\n\nconst mapDispatchToProps = (\n dispatch: Dispatch,\n ownProps: OwnProps,\n): DispatchProps => ({\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions = {\n autosubmit: ownProps.autosubmit ?? false,\n autosave: ownProps.autosave ?? false,\n autoupdate: ownProps.autoupdate ?? false,\n },\n ) =>\n dispatch(\n updateFormAttribute(\n ownProps.form,\n ownProps.object,\n attribute,\n value,\n options,\n ),\n ),\n onAddAttributeSetClick: () =>\n dispatch(addRepeatableAttributeSet(ownProps.form)),\n onCancelAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(ownProps.form, formObject)),\n onRemoveAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(ownProps.form, formObject)),\n});\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useAttributeSet' or 'useFormNavigation' instead\n */\nexport const connectFormAttributeSet: ComponentType<any> = connect<\n Props,\n OwnProps,\n _,\n DispatchProps,\n _,\n _,\n>(null, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SACEC,yBAAyB,EACzBC,4BAA4B,EAC5BC,4BAA4B,QACvB,uCAAuC;AAqC9C,MAAMC,kBAAkB,GAAGA,CACzBC,QAAkB,EAClBC,QAAkB,MACC;EACnBC,iBAAiB,EAAEA,CACjBC,SAAwB,EACxBC,KAAa,EACbC,OAA0B,GAAG;IAC3BC,UAAU,EAAEL,QAAQ,CAACK,UAAU,IAAI,KAAK;IACxCC,QAAQ,EAAEN,QAAQ,CAACM,QAAQ,IAAI,KAAK;IACpCC,UAAU,EAAEP,QAAQ,CAACO,UAAU,IAAI;EACrC,CAAC,KAEDR,QAAQ,CACNL,mBAAmB,CACjBM,QAAQ,CAACQ,IAAI,EACbR,QAAQ,CAACS,MAAM,EACfP,SAAS,EACTC,KAAK,EACLC,OACF,CACF,CAAC;EACHM,sBAAsB,EAAEA,CAAA,KACtBX,QAAQ,CAACJ,yBAAyB,CAACK,QAAQ,CAACQ,IAAI,CAAC,CAAC;EACpDG,yBAAyB,EAAGC,UAA2B,IACrDb,QAAQ,CAACH,4BAA4B,CAACI,QAAQ,CAACQ,IAAI,EAAEI,UAAU,CAAC,CAAC;EACnEC,yBAAyB,EAAGD,UAA2B,IACrDb,QAAQ,CAACF,4BAA4B,CAACG,QAAQ,CAACQ,IAAI,EAAEI,UAAU,CAAC;AACpE,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAME,uBAA2C,GAAGrB,OAAO,CAOhE,IAAI,EAAEK,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"FormAttributeSet.js","names":["connect","updateFormAttribute","addRepeatableAttributeSet","cancelRepeatableAttributeSet","removeRepeatableAttributeSet","mapDispatchToProps","dispatch","ownProps","onAttributeChange","attribute","value","options","autosubmit","autosave","autoupdate","form","object","onAddAttributeSetClick","onCancelAttributeSetClick","formObject","onRemoveAttributeSetClick","connectFormAttributeSet"],"sources":["../../../src/redux/connectors/FormAttributeSet.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { updateFormAttribute } from \"../actions/FormAttributeSet\";\nimport {\n addRepeatableAttributeSet,\n cancelRepeatableAttributeSet,\n removeRepeatableAttributeSet,\n} from \"../actions/FormAttributeSetRepeatable\";\n\nimport type { ThunkAction, UpdateFormOptions, Dispatch } from \"../types\";\nimport type { UpdateFormAction } from \"../_modularui/types\";\nimport type { AttributeType } from \"../../models/types\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type FormObjectModel from \"../../models/form/FormObjectModel\";\nimport type { ComponentType } from \"react\";\n\ntype OwnProps = {\n form: FormModel,\n object: FormObjectModel,\n formLayout?: \"vertical\" | \"horizontal\" | \"compact\",\n autosubmit?: boolean,\n autosave?: boolean,\n autoupdate?: boolean,\n};\n\ntype DispatchProps = {\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n ) => ThunkAction<>,\n onAddAttributeSetClick: () => UpdateFormAction,\n onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n};\n\ntype Props = {\n ...OwnProps,\n ...DispatchProps,\n};\n\nconst mapDispatchToProps = (\n dispatch: Dispatch,\n ownProps: OwnProps,\n): DispatchProps => ({\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions = {\n autosubmit: ownProps.autosubmit ?? false,\n autosave: ownProps.autosave ?? false,\n autoupdate: ownProps.autoupdate ?? false,\n },\n ) =>\n dispatch(\n updateFormAttribute(\n ownProps.form,\n ownProps.object,\n attribute,\n value,\n options,\n ),\n ),\n onAddAttributeSetClick: () =>\n dispatch(addRepeatableAttributeSet(ownProps.form)),\n onCancelAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(ownProps.form, formObject)),\n onRemoveAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(ownProps.form, formObject)),\n});\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useAttributeSet' or 'useFormNavigation' instead\n */\nexport const connectFormAttributeSet: ComponentType<any> = connect<\n Props,\n OwnProps,\n _,\n DispatchProps,\n _,\n _,\n>(null, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SACEC,yBAAyB,EACzBC,4BAA4B,EAC5BC,4BAA4B,QACvB,uCAAuC;AAkC9C,MAAMC,kBAAkB,GAAGA,CACzBC,QAAkB,EAClBC,QAAkB,MACC;EACnBC,iBAAiB,EAAEA,CACjBC,SAAwB,EACxBC,KAAa,EACbC,OAA0B,GAAG;IAC3BC,UAAU,EAAEL,QAAQ,CAACK,UAAU,IAAI,KAAK;IACxCC,QAAQ,EAAEN,QAAQ,CAACM,QAAQ,IAAI,KAAK;IACpCC,UAAU,EAAEP,QAAQ,CAACO,UAAU,IAAI;EACrC,CAAC,KAEDR,QAAQ,CACNL,mBAAmB,CACjBM,QAAQ,CAACQ,IAAI,EACbR,QAAQ,CAACS,MAAM,EACfP,SAAS,EACTC,KAAK,EACLC,OACF,CACF,CAAC;EACHM,sBAAsB,EAAEA,CAAA,KACtBX,QAAQ,CAACJ,yBAAyB,CAACK,QAAQ,CAACQ,IAAI,CAAC,CAAC;EACpDG,yBAAyB,EAAGC,UAA2B,IACrDb,QAAQ,CAACH,4BAA4B,CAACI,QAAQ,CAACQ,IAAI,EAAEI,UAAU,CAAC,CAAC;EACnEC,yBAAyB,EAAGD,UAA2B,IACrDb,QAAQ,CAACF,4BAA4B,CAACG,QAAQ,CAACQ,IAAI,EAAEI,UAAU,CAAC;AACpE,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAME,uBAA2C,GAAGrB,OAAO,CAOhE,IAAI,EAAEK,kBAAkB,CAAC","ignoreList":[]}
@@ -14,7 +14,7 @@ import type { ComponentType } from "react";
14
14
  type DispatchProps = {
15
15
  onStartProgress: () => StartProgressAction,
16
16
  onFinishProgress: () => FinishProgressAction,
17
- onError: (error: Error | FetchException) => ThunkAction,
17
+ onError: (error: Error | FetchException) => ThunkAction<>,
18
18
  };
19
19
 
20
20
  const mapDispatchToProps: DispatchProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","names":["connect","finishProgress","startProgress","handleError","mapDispatchToProps","onStartProgress","onFinishProgress","onError","connectProgress"],"sources":["../../../src/redux/connectors/Progress.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\nimport { finishProgress, startProgress } from \"../actions/ProgressIndicator\";\nimport { handleError } from \"../actions/Error\";\n\nimport type {\n StartProgressAction,\n FinishProgressAction,\n ThunkAction,\n} from \"../types\";\nimport type FetchException from \"../../exceptions/FetchException\";\nimport type { ComponentType } from \"react\";\n\ntype DispatchProps = {\n onStartProgress: () => StartProgressAction,\n onFinishProgress: () => FinishProgressAction,\n onError: (error: Error | FetchException) => ThunkAction,\n};\n\nconst mapDispatchToProps: DispatchProps = {\n onStartProgress: startProgress,\n onFinishProgress: finishProgress,\n onError: handleError,\n};\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useProgressIndicator' instead\n */\nexport const connectProgress: ComponentType<any> = connect<\n DispatchProps,\n {},\n _,\n _,\n _,\n _,\n>(null, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AACrC,SAASC,cAAc,EAAEC,aAAa,QAAQ,8BAA8B;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;AAgB9C,MAAMC,kBAAiC,GAAG;EACxCC,eAAe,EAAEH,aAAa;EAC9BI,gBAAgB,EAAEL,cAAc;EAChCM,OAAO,EAAEJ;AACX,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMK,eAAmC,GAAGR,OAAO,CAOxD,IAAI,EAAEI,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Progress.js","names":["connect","finishProgress","startProgress","handleError","mapDispatchToProps","onStartProgress","onFinishProgress","onError","connectProgress"],"sources":["../../../src/redux/connectors/Progress.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\nimport { finishProgress, startProgress } from \"../actions/ProgressIndicator\";\nimport { handleError } from \"../actions/Error\";\n\nimport type {\n StartProgressAction,\n FinishProgressAction,\n ThunkAction,\n} from \"../types\";\nimport type FetchException from \"../../exceptions/FetchException\";\nimport type { ComponentType } from \"react\";\n\ntype DispatchProps = {\n onStartProgress: () => StartProgressAction,\n onFinishProgress: () => FinishProgressAction,\n onError: (error: Error | FetchException) => ThunkAction<>,\n};\n\nconst mapDispatchToProps: DispatchProps = {\n onStartProgress: startProgress,\n onFinishProgress: finishProgress,\n onError: handleError,\n};\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useProgressIndicator' instead\n */\nexport const connectProgress: ComponentType<any> = connect<\n DispatchProps,\n {},\n _,\n _,\n _,\n _,\n>(null, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AACrC,SAASC,cAAc,EAAEC,aAAa,QAAQ,8BAA8B;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;AAgB9C,MAAMC,kBAAiC,GAAG;EACxCC,eAAe,EAAEH,aAAa;EAC9BI,gBAAgB,EAAEL,cAAc;EAChCM,OAAO,EAAEJ;AACX,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMK,eAAmC,GAAGR,OAAO,CAOxD,IAAI,EAAEI,kBAAkB,CAAC","ignoreList":[]}
@@ -14,7 +14,7 @@ type StateProps = {
14
14
  };
15
15
 
16
16
  type DispatchProps = {
17
- onSubmit: (username: string, password: string) => ThunkAction,
17
+ onSubmit: (username: string, password: string) => ThunkAction<>,
18
18
  };
19
19
 
20
20
  type Props = {
@@ -1 +1 @@
1
- {"version":3,"file":"SignIn.js","names":["connect","login","getApplication","mapStateToProps","state","application","isAuthenticated","isLoggedIn","errorMessage","auth","error","mapDispatchToProps","onSubmit","connectSignIn"],"sources":["../../../src/redux/connectors/SignIn.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { login } from \"../actions/SignIn\";\n\nimport { getApplication } from \"../_modularui/ModularUISelectors\";\n\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n errorMessage: ?string,\n};\n\ntype DispatchProps = {\n onSubmit: (username: string, password: string) => ThunkAction,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state: ReduxState): StateProps => {\n const application = getApplication(state);\n\n return {\n isAuthenticated: application?.isLoggedIn ?? false,\n errorMessage: state.auth.error,\n };\n};\n\nconst mapDispatchToProps: DispatchProps = {\n onSubmit: login,\n};\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useLogin' instead\n */\nexport const connectSignIn: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _,\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,KAAK,QAAQ,mBAAmB;AAEzC,SAASC,cAAc,QAAQ,kCAAkC;AAmBjE,MAAMC,eAAe,GAAIC,KAAiB,IAAiB;EACzD,MAAMC,WAAW,GAAGH,cAAc,CAACE,KAAK,CAAC;EAEzC,OAAO;IACLE,eAAe,EAAED,WAAW,EAAEE,UAAU,IAAI,KAAK;IACjDC,YAAY,EAAEJ,KAAK,CAACK,IAAI,CAACC;EAC3B,CAAC;AACH,CAAC;AAED,MAAMC,kBAAiC,GAAG;EACxCC,QAAQ,EAAEX;AACZ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMY,aAAiC,GAAGb,OAAO,CAOtDG,eAAe,EAAEQ,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SignIn.js","names":["connect","login","getApplication","mapStateToProps","state","application","isAuthenticated","isLoggedIn","errorMessage","auth","error","mapDispatchToProps","onSubmit","connectSignIn"],"sources":["../../../src/redux/connectors/SignIn.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { login } from \"../actions/SignIn\";\n\nimport { getApplication } from \"../_modularui/ModularUISelectors\";\n\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n errorMessage: ?string,\n};\n\ntype DispatchProps = {\n onSubmit: (username: string, password: string) => ThunkAction<>,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state: ReduxState): StateProps => {\n const application = getApplication(state);\n\n return {\n isAuthenticated: application?.isLoggedIn ?? false,\n errorMessage: state.auth.error,\n };\n};\n\nconst mapDispatchToProps: DispatchProps = {\n onSubmit: login,\n};\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useLogin' instead\n */\nexport const connectSignIn: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _,\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,KAAK,QAAQ,mBAAmB;AAEzC,SAASC,cAAc,QAAQ,kCAAkC;AAmBjE,MAAMC,eAAe,GAAIC,KAAiB,IAAiB;EACzD,MAAMC,WAAW,GAAGH,cAAc,CAACE,KAAK,CAAC;EAEzC,OAAO;IACLE,eAAe,EAAED,WAAW,EAAEE,UAAU,IAAI,KAAK;IACjDC,YAAY,EAAEJ,KAAK,CAACK,IAAI,CAACC;EAC3B,CAAC;AACH,CAAC;AAED,MAAMC,kBAAiC,GAAG;EACxCC,QAAQ,EAAEX;AACZ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMY,aAAiC,GAAGb,OAAO,CAOtDG,eAAe,EAAEQ,kBAAkB,CAAC","ignoreList":[]}
@@ -12,7 +12,7 @@ type StateProps = {
12
12
  };
13
13
 
14
14
  type DispatchProps = {
15
- doLogout: () => ThunkAction,
15
+ doLogout: () => ThunkAction<>,
16
16
  };
17
17
 
18
18
  type Props = {
@@ -1 +1 @@
1
- {"version":3,"file":"SignOut.js","names":["connect","logout","getApplication","mapStateToProps","state","isAuthenticated","isLoggedIn","mapDispatchToProps","doLogout","connectSignOut"],"sources":["../../../src/redux/connectors/SignOut.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { logout } from \"../actions/SignOut\";\n\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\nimport { getApplication } from \"../_modularui\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n};\n\ntype DispatchProps = {\n doLogout: () => ThunkAction,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state: ReduxState): StateProps => ({\n isAuthenticated: getApplication(state)?.isLoggedIn ?? false,\n});\n\nconst mapDispatchToProps = { doLogout: logout };\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useLogout' instead\n */\nexport const connectSignOut: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _,\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,MAAM,QAAQ,oBAAoB;AAI3C,SAASC,cAAc,QAAQ,eAAe;AAe9C,MAAMC,eAAe,GAAIC,KAAiB,KAAkB;EAC1DC,eAAe,EAAEH,cAAc,CAACE,KAAK,CAAC,EAAEE,UAAU,IAAI;AACxD,CAAC,CAAC;AAEF,MAAMC,kBAAkB,GAAG;EAAEC,QAAQ,EAAEP;AAAO,CAAC;;AAE/C;AACA;AACA;AACA,OAAO,MAAMQ,cAAkC,GAAGT,OAAO,CAOvDG,eAAe,EAAEI,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SignOut.js","names":["connect","logout","getApplication","mapStateToProps","state","isAuthenticated","isLoggedIn","mapDispatchToProps","doLogout","connectSignOut"],"sources":["../../../src/redux/connectors/SignOut.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { logout } from \"../actions/SignOut\";\n\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\nimport { getApplication } from \"../_modularui\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n};\n\ntype DispatchProps = {\n doLogout: () => ThunkAction<>,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state: ReduxState): StateProps => ({\n isAuthenticated: getApplication(state)?.isLoggedIn ?? false,\n});\n\nconst mapDispatchToProps = { doLogout: logout };\n\n/**\n * @deprecated - will be removed in the future, use the equivalent hook 'useLogout' instead\n */\nexport const connectSignOut: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _,\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,MAAM,QAAQ,oBAAoB;AAI3C,SAASC,cAAc,QAAQ,eAAe;AAe9C,MAAMC,eAAe,GAAIC,KAAiB,KAAkB;EAC1DC,eAAe,EAAEH,cAAc,CAACE,KAAK,CAAC,EAAEE,UAAU,IAAI;AACxD,CAAC,CAAC;AAEF,MAAMC,kBAAkB,GAAG;EAAEC,QAAQ,EAAEP;AAAO,CAAC;;AAE/C;AACA;AACA;AACA,OAAO,MAAMQ,cAAkC,GAAGT,OAAO,CAOvDG,eAAe,EAAEI,kBAAkB,CAAC","ignoreList":[]}
@@ -11,13 +11,17 @@ const configureStore = (routerHistory, customReducers, initialState) => {
11
11
  if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
12
12
  composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
13
13
  }
14
+ const thunkExtra = {};
14
15
  const combinedReducers = combineReducers({
15
16
  ...customReducers,
16
17
  ...createReducer()
17
18
  });
18
- const middleware = applyMiddleware(modularUIMiddleware, routerMiddleware(routerHistory), thunk);
19
+ const middleware = applyMiddleware(modularUIMiddleware, routerMiddleware(routerHistory), thunk.withExtraArgument(thunkExtra));
19
20
  const enhancers = composeEnhancers(middleware);
20
21
  const store = createReduxStore(combinedReducers, initialState, enhancers);
22
+
23
+ // Populate the extra argument with the store's subscribe method -> use to wait on store updates
24
+ thunkExtra.subscribe = store.subscribe;
21
25
  if (!initialState?.router) {
22
26
  store.dispatch(locationChange(routerHistory.location, "PUSH"));
23
27
  }
@@ -17,6 +17,10 @@ import type { RouterHistory } from "react-router";
17
17
  import type { ReduxAction, ReduxState, ReduxStore } from "../types";
18
18
  import type { Reducer } from "redux";
19
19
 
20
+ type ThunkExtra = {
21
+ subscribe?: $PropertyType<ReduxStore, "subscribe">,
22
+ };
23
+
20
24
  /**
21
25
  */
22
26
  const configureStore = (
@@ -30,6 +34,8 @@ const configureStore = (
30
34
  composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
31
35
  }
32
36
 
37
+ const thunkExtra: ThunkExtra = {};
38
+
33
39
  const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({
34
40
  ...customReducers,
35
41
  ...createReducer(),
@@ -38,7 +44,7 @@ const configureStore = (
38
44
  const middleware = applyMiddleware(
39
45
  modularUIMiddleware,
40
46
  routerMiddleware(routerHistory),
41
- thunk,
47
+ thunk.withExtraArgument(thunkExtra),
42
48
  );
43
49
 
44
50
  const enhancers = composeEnhancers(middleware);
@@ -49,6 +55,9 @@ const configureStore = (
49
55
  enhancers,
50
56
  );
51
57
 
58
+ // Populate the extra argument with the store's subscribe method -> use to wait on store updates
59
+ thunkExtra.subscribe = store.subscribe;
60
+
52
61
  if (!initialState?.router) {
53
62
  store.dispatch(locationChange(routerHistory.location, "PUSH"));
54
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"configureStore.js","names":["applyMiddleware","compose","combineReducers","createStore","createReduxStore","thunk","routerMiddleware","modularUIMiddleware","createReducer","locationChange","configureStore","routerHistory","customReducers","initialState","composeEnhancers","process","env","NODE_ENV","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","combinedReducers","middleware","enhancers","store","router","dispatch","location"],"sources":["../../../src/redux/store/configureStore.js"],"sourcesContent":["// @flow\nimport {\n applyMiddleware,\n compose,\n combineReducers,\n createStore as createReduxStore,\n} from \"redux\";\nimport thunk from \"redux-thunk\";\n\nimport { routerMiddleware } from \"../_router/RouterMiddleware\";\nimport { modularUIMiddleware } from \"../_modularui/ModularUIMiddleware\";\n\nimport { createReducer } from \"../reducers/createReducer\";\nimport { locationChange } from \"../_router/RouterActions\";\n\nimport type { RouterHistory } from \"react-router\";\nimport type { ReduxAction, ReduxState, ReduxStore } from \"../types\";\nimport type { Reducer } from \"redux\";\n\n/**\n */\nconst configureStore = (\n routerHistory: RouterHistory,\n customReducers?: Object,\n initialState?: $Shape<ReduxState>,\n): { routerHistory: RouterHistory, store: ReduxStore } => {\n let composeEnhancers = compose;\n\n if (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n }\n\n const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({\n ...customReducers,\n ...createReducer(),\n });\n\n const middleware = applyMiddleware(\n modularUIMiddleware,\n routerMiddleware(routerHistory),\n thunk,\n );\n\n const enhancers = composeEnhancers(middleware);\n\n const store: ReduxStore = createReduxStore(\n combinedReducers,\n initialState,\n enhancers,\n );\n\n if (!initialState?.router) {\n store.dispatch(locationChange(routerHistory.location, \"PUSH\"));\n }\n\n return { routerHistory, store };\n};\n\nexport default configureStore;\n"],"mappings":"AACA,SACEA,eAAe,EACfC,OAAO,EACPC,eAAe,EACfC,WAAW,IAAIC,gBAAgB,QAC1B,OAAO;AACd,OAAOC,KAAK,MAAM,aAAa;AAE/B,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,mBAAmB,QAAQ,mCAAmC;AAEvE,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,cAAc,QAAQ,0BAA0B;AAMzD;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,aAA4B,EAC5BC,cAAuB,EACvBC,YAAiC,KACuB;EACxD,IAAIC,gBAAgB,GAAGb,OAAO;EAE9B,IAAIc,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IAC1EJ,gBAAgB,GAAGI,MAAM,CAACC,oCAAoC,IAAIlB,OAAO;EAC3E;EAEA,MAAMmB,gBAAkD,GAAGlB,eAAe,CAAC;IACzE,GAAGU,cAAc;IACjB,GAAGJ,aAAa,CAAC;EACnB,CAAC,CAAC;EAEF,MAAMa,UAAU,GAAGrB,eAAe,CAChCO,mBAAmB,EACnBD,gBAAgB,CAACK,aAAa,CAAC,EAC/BN,KACF,CAAC;EAED,MAAMiB,SAAS,GAAGR,gBAAgB,CAACO,UAAU,CAAC;EAE9C,MAAME,KAAiB,GAAGnB,gBAAgB,CACxCgB,gBAAgB,EAChBP,YAAY,EACZS,SACF,CAAC;EAED,IAAI,CAACT,YAAY,EAAEW,MAAM,EAAE;IACzBD,KAAK,CAACE,QAAQ,CAAChB,cAAc,CAACE,aAAa,CAACe,QAAQ,EAAE,MAAM,CAAC,CAAC;EAChE;EAEA,OAAO;IAAEf,aAAa;IAAEY;EAAM,CAAC;AACjC,CAAC;AAED,eAAeb,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"configureStore.js","names":["applyMiddleware","compose","combineReducers","createStore","createReduxStore","thunk","routerMiddleware","modularUIMiddleware","createReducer","locationChange","configureStore","routerHistory","customReducers","initialState","composeEnhancers","process","env","NODE_ENV","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","thunkExtra","combinedReducers","middleware","withExtraArgument","enhancers","store","subscribe","router","dispatch","location"],"sources":["../../../src/redux/store/configureStore.js"],"sourcesContent":["// @flow\nimport {\n applyMiddleware,\n compose,\n combineReducers,\n createStore as createReduxStore,\n} from \"redux\";\nimport thunk from \"redux-thunk\";\n\nimport { routerMiddleware } from \"../_router/RouterMiddleware\";\nimport { modularUIMiddleware } from \"../_modularui/ModularUIMiddleware\";\n\nimport { createReducer } from \"../reducers/createReducer\";\nimport { locationChange } from \"../_router/RouterActions\";\n\nimport type { RouterHistory } from \"react-router\";\nimport type { ReduxAction, ReduxState, ReduxStore } from \"../types\";\nimport type { Reducer } from \"redux\";\n\ntype ThunkExtra = {\n subscribe?: $PropertyType<ReduxStore, \"subscribe\">,\n};\n\n/**\n */\nconst configureStore = (\n routerHistory: RouterHistory,\n customReducers?: Object,\n initialState?: $Shape<ReduxState>,\n): { routerHistory: RouterHistory, store: ReduxStore } => {\n let composeEnhancers = compose;\n\n if (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n }\n\n const thunkExtra: ThunkExtra = {};\n\n const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({\n ...customReducers,\n ...createReducer(),\n });\n\n const middleware = applyMiddleware(\n modularUIMiddleware,\n routerMiddleware(routerHistory),\n thunk.withExtraArgument(thunkExtra),\n );\n\n const enhancers = composeEnhancers(middleware);\n\n const store: ReduxStore = createReduxStore(\n combinedReducers,\n initialState,\n enhancers,\n );\n\n // Populate the extra argument with the store's subscribe method -> use to wait on store updates\n thunkExtra.subscribe = store.subscribe;\n\n if (!initialState?.router) {\n store.dispatch(locationChange(routerHistory.location, \"PUSH\"));\n }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IAAEc;EAAM,CAAC;AACjC,CAAC;AAED,eAAef,cAAc","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import type { Store, DispatchAPI } from "redux";
2
+ import type { Store } from "redux";
3
3
 
4
4
  import type ErrorResponse from "../models/error/ErrorResponse";
5
5
 
@@ -231,11 +231,30 @@ export type ReduxState = {
231
231
  };
232
232
 
233
233
  export type GetState = () => ReduxState;
234
- export type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;
235
- export type PromiseAction = Promise<PossibleAction>;
236
- export type Dispatch = DispatchAPI<PossibleAction>;
234
+ export type ThunkExtra = { subscribe: any };
235
+
236
+ // 1. Define ThunkAction first.
237
+ // We use 'any' for Dispatch here temporarily to break the circularity
238
+ // or use the specialized function type.
239
+ export type ThunkAction<R = any> = (
240
+ dispatch: Dispatch,
241
+ getState: GetState,
242
+ extra: ThunkExtra,
243
+ ) => R;
244
+
245
+ export type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;
246
+
247
+ // 2. Define Dispatch as a naked function type.
248
+ // This is much more reliable in modern Flow than DispatchAPI<...>.
249
+ export type Dispatch = (
250
+ action: ReduxAction | ThunkAction<any> | PromiseAction,
251
+ ) => any;
252
+
253
+ // 3. Update ReduxStore to use the ReduxAction for the base reducer
254
+ // but our custom Dispatch for the store instance.
237
255
  export type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;
238
256
 
239
- export type PossibleAction = ReduxAction | ThunkAction | PromiseAction;
257
+ // 4. Clean up PossibleAction if you still use it elsewhere
258
+ export type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;
240
259
 
241
260
  export type CustomReducers = { [reducerKey: string]: any };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkExtra = { subscribe: any };\n\n// 1. Define ThunkAction first.\n// We use 'any' for Dispatch here temporarily to break the circularity\n// or use the specialized function type.\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\n// 2. Define Dispatch as a naked function type.\n// This is much more reliable in modern Flow than DispatchAPI<...>.\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\n// 3. Update ReduxStore to use the ReduxAction for the base reducer\n// but our custom Dispatch for the store instance.\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n// 4. Clean up PossibleAction if you still use it elsewhere\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
@@ -13,6 +13,7 @@ var _exceptions = require("../exceptions");
13
13
  var _modularui = require("../modularui");
14
14
  var _useModularUIModel = require("./useModularUIModel");
15
15
  /**
16
+ * Hook for handling login logic
16
17
  */
17
18
  const useLogin = () => {
18
19
  _Cache.default.setItem("isRedirectLogin", false);
@@ -20,17 +21,17 @@ const useLogin = () => {
20
21
  const application = (0, _useModularUIModel.useApplication)();
21
22
  const auth = (0, _reactRedux.useSelector)(state => state.auth);
22
23
  const isAuthenticated = application?.isLoggedIn ?? false;
23
- const primaryAuthenticationType = _Cache.default.getItem("primaryAuthenticationType");
24
+ const cachedType = _Cache.default.getItem("primaryAuthenticationType");
24
25
  return {
25
26
  isAuthenticated,
26
- primaryAuthenticationType: primaryAuthenticationType ?? application?.authenticationTypes[0],
27
+ // Safely fallback to the first available type if nothing is cached
28
+ primaryAuthenticationType: cachedType ?? application?.authenticationTypes?.[0],
27
29
  authenticationTypes: application?.authenticationTypes ?? [],
28
30
  errorMessage: auth.error,
29
31
  resetErrors: () => dispatch((0, _actions.resetAuthErrors)()),
30
32
  login: (username, password) => dispatch((0, _actions.login)(username, password)),
31
33
  redirectLogin: authenticationType => {
32
34
  if (_Cache.default.getItem("isRedirectLogin")) {
33
- // prevent endless loop in redirects when authentication type can't be redirected
34
35
  throw new _exceptions.IllegalStateException(`Could not redirect to '${authenticationType.authentication}' using url: '${authenticationType.redirectUri ?? ""}'`);
35
36
  }
36
37
  if (!isAuthenticated) {
@@ -42,6 +43,7 @@ const useLogin = () => {
42
43
  };
43
44
 
44
45
  /**
46
+ * Hook for handling logout logic
45
47
  */
46
48
  exports.useLogin = useLogin;
47
49
  const useLogout = () => {
@@ -49,24 +51,28 @@ const useLogout = () => {
49
51
  const application = (0, _useModularUIModel.useApplication)();
50
52
  const BASE_PATH = (0, _constants.getBasePath)();
51
53
  const authenticate = new _modularui.Authenticate();
52
- const primaryAuthenticationType = _Cache.default.getItem("primaryAuthenticationType");
53
54
  const isAuthenticated = application?.isLoggedIn ?? false;
55
+ const cachedType = _Cache.default.getItem("primaryAuthenticationType");
54
56
  return {
55
57
  isAuthenticated,
56
- primaryAuthenticationType: primaryAuthenticationType ?? application?.authenticationTypes[0],
58
+ primaryAuthenticationType: cachedType ?? application?.authenticationTypes?.[0],
57
59
  authenticationTypes: application?.authenticationTypes ?? [],
58
60
  logout: () => {
59
61
  const type = authenticate.authenticationType;
60
62
  if (type === _constants.INTERNAL_LOGIN_TYPE.PAC4J_INDIRECT) {
61
63
  authenticate.redirectToLogout();
62
- } else if (_Cache.default.getItem("isRedirectLogin")) {
64
+ return; // Redirects stop execution
65
+ }
66
+ if (_Cache.default.getItem("isRedirectLogin")) {
63
67
  const origin = window.location.origin;
64
68
  const url = `${authenticate.getLogoutUrl()}?url=${origin}${BASE_PATH}`;
65
69
  _Cache.default.setItem("isRedirectLogin", false);
66
70
  window.location.assign(url);
67
- } else {
68
- return dispatch((0, _actions.logout)());
71
+ return;
69
72
  }
73
+
74
+ // Returns the Promise from the logout thunk
75
+ return dispatch((0, _actions.logout)());
70
76
  },
71
77
  logoutUrl: authenticate.getLogoutUrl()
72
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthentication.js","names":["_reactRedux","require","_actions","_Cache","_interopRequireDefault","_constants","_exceptions","_modularui","_useModularUIModel","useLogin","Cache","setItem","dispatch","useDispatch","application","useApplication","auth","useSelector","state","isAuthenticated","isLoggedIn","primaryAuthenticationType","getItem","authenticationTypes","errorMessage","error","resetErrors","resetAuthErrors","login","username","password","redirectLogin","authenticationType","IllegalStateException","authentication","redirectUri","window","location","assign","getBasePathServer","exports","useLogout","BASE_PATH","getBasePath","authenticate","Authenticate","logout","type","INTERNAL_LOGIN_TYPE","PAC4J_INDIRECT","redirectToLogout","origin","url","getLogoutUrl","logoutUrl"],"sources":["../../src/hooks/useAuthentication.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\n\nimport { login, logout, resetAuthErrors } from \"../redux/actions\";\n\nimport Cache from \"../utils/browser/Cache\";\nimport {\n getBasePath,\n getBasePathServer,\n INTERNAL_LOGIN_TYPE,\n} from \"../constants\";\nimport { IllegalStateException } from \"../exceptions\";\nimport { Authenticate } from \"../modularui\";\nimport { useApplication } from \"./useModularUIModel\";\n\nimport type { ResetAuthErrorsAction } from \"../redux/types\";\nimport type { AuthenticationType } from \"../models/types\";\n\ntype LoginHook = {\n isAuthenticated: boolean,\n primaryAuthenticationType: AuthenticationType,\n authenticationTypes: Array<AuthenticationType>,\n errorMessage: ?string,\n resetErrors: () => ResetAuthErrorsAction,\n login: (username: string, password: string) => void,\n redirectLogin: (authenticationType: AuthenticationType) => void,\n};\ntype LogoutHook = {\n isAuthenticated: boolean,\n primaryAuthenticationType: AuthenticationType,\n authenticationTypes: Array<AuthenticationType>,\n logout: () => void,\n logoutUrl: string,\n};\n\n/**\n */\nexport const useLogin = (): LoginHook => {\n Cache.setItem(\"isRedirectLogin\", false);\n\n const dispatch = useDispatch();\n\n const application = useApplication();\n const auth = useSelector((state) => state.auth);\n\n const isAuthenticated = application?.isLoggedIn ?? false;\n\n const primaryAuthenticationType = Cache.getItem(\"primaryAuthenticationType\");\n\n return {\n isAuthenticated,\n primaryAuthenticationType:\n primaryAuthenticationType ?? application?.authenticationTypes[0],\n authenticationTypes: application?.authenticationTypes ?? [],\n errorMessage: auth.error,\n resetErrors: () => dispatch(resetAuthErrors()),\n login: (username: string, password: string) =>\n dispatch(login(username, password)),\n redirectLogin: (authenticationType: AuthenticationType) => {\n if (Cache.getItem(\"isRedirectLogin\")) {\n // prevent endless loop in redirects when authentication type can't be redirected\n throw new IllegalStateException(\n `Could not redirect to '${\n authenticationType.authentication\n }' using url: '${authenticationType.redirectUri ?? \"\"}'`,\n );\n }\n\n if (!isAuthenticated) {\n Cache.setItem(\"isRedirectLogin\", true);\n window.location.assign(\n `${getBasePathServer()}${authenticationType.redirectUri ?? \"\"}`,\n );\n }\n },\n };\n};\n\n/**\n */\nexport const useLogout = (): LogoutHook => {\n const dispatch = useDispatch();\n\n const application = useApplication();\n\n const BASE_PATH = getBasePath();\n\n const authenticate = new Authenticate();\n\n const primaryAuthenticationType = Cache.getItem(\"primaryAuthenticationType\");\n\n const isAuthenticated = application?.isLoggedIn ?? false;\n return {\n isAuthenticated,\n primaryAuthenticationType:\n primaryAuthenticationType ?? application?.authenticationTypes[0],\n authenticationTypes: application?.authenticationTypes ?? [],\n logout: () => {\n const type = authenticate.authenticationType;\n if (type === INTERNAL_LOGIN_TYPE.PAC4J_INDIRECT) {\n authenticate.redirectToLogout();\n } else if (Cache.getItem(\"isRedirectLogin\")) {\n const origin = window.location.origin;\n const url = `${authenticate.getLogoutUrl()}?url=${origin}${BASE_PATH}`;\n Cache.setItem(\"isRedirectLogin\", false);\n window.location.assign(url);\n } else {\n return dispatch(logout());\n }\n },\n logoutUrl: authenticate.getLogoutUrl(),\n };\n};\n"],"mappings":";;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,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AAC,MAAM;QACL,OAAOxC,QAAQ,CAAC,IAAAkC,eAAM,EAAC,CAAC,CAAC;MAC3B;IACF,CAAC;IACDQ,SAAS,EAAEV,YAAY,CAACS,YAAY,CAAC;EACvC,CAAC;AACH,CAAC;AAACb,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"file":"useAuthentication.js","names":["_reactRedux","require","_actions","_Cache","_interopRequireDefault","_constants","_exceptions","_modularui","_useModularUIModel","useLogin","Cache","setItem","dispatch","useDispatch","application","useApplication","auth","useSelector","state","isAuthenticated","isLoggedIn","cachedType","getItem","primaryAuthenticationType","authenticationTypes","errorMessage","error","resetErrors","resetAuthErrors","login","username","password","redirectLogin","authenticationType","IllegalStateException","authentication","redirectUri","window","location","assign","getBasePathServer","exports","useLogout","BASE_PATH","getBasePath","authenticate","Authenticate","logout","type","INTERNAL_LOGIN_TYPE","PAC4J_INDIRECT","redirectToLogout","origin","url","getLogoutUrl","logoutUrl"],"sources":["../../src/hooks/useAuthentication.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { login, logout, resetAuthErrors } from \"../redux/actions\";\nimport Cache from \"../utils/browser/Cache\";\nimport {\n getBasePath,\n getBasePathServer,\n INTERNAL_LOGIN_TYPE,\n} from \"../constants\";\nimport { IllegalStateException } from \"../exceptions\";\nimport { Authenticate } from \"../modularui\";\nimport { useApplication } from \"./useModularUIModel\";\n\nimport type { ResetAuthErrorsAction } from \"../redux/types\";\nimport type { AuthenticationType } from \"../models/types\";\n\ntype LoginHook = {\n isAuthenticated: boolean,\n primaryAuthenticationType: ?AuthenticationType,\n authenticationTypes: Array<AuthenticationType>,\n errorMessage: ?string,\n resetErrors: () => ResetAuthErrorsAction,\n login: (username: string, password: string) => any, // Changed to any for Promise support\n redirectLogin: (authenticationType: AuthenticationType) => void,\n};\n\ntype LogoutHook = {\n isAuthenticated: boolean,\n primaryAuthenticationType: ?AuthenticationType,\n authenticationTypes: Array<AuthenticationType>,\n logout: () => any, // Changed to any for Promise support\n logoutUrl: string,\n};\n\n/**\n * Hook for handling login logic\n */\nexport const useLogin = (): LoginHook => {\n Cache.setItem(\"isRedirectLogin\", false);\n\n const dispatch = useDispatch();\n const application = useApplication();\n const auth = useSelector((state) => state.auth);\n\n const isAuthenticated = application?.isLoggedIn ?? false;\n const cachedType = Cache.getItem(\"primaryAuthenticationType\");\n\n return {\n isAuthenticated,\n // Safely fallback to the first available type if nothing is cached\n primaryAuthenticationType:\n cachedType ?? application?.authenticationTypes?.[0],\n authenticationTypes: application?.authenticationTypes ?? [],\n errorMessage: auth.error,\n resetErrors: () => dispatch(resetAuthErrors()),\n login: (username: string, password: string) =>\n dispatch(login(username, password)),\n redirectLogin: (authenticationType: AuthenticationType) => {\n if (Cache.getItem(\"isRedirectLogin\")) {\n throw new IllegalStateException(\n `Could not redirect to '${authenticationType.authentication}' using url: '${authenticationType.redirectUri ?? \"\"}'`,\n );\n }\n\n if (!isAuthenticated) {\n Cache.setItem(\"isRedirectLogin\", true);\n window.location.assign(\n `${getBasePathServer()}${authenticationType.redirectUri ?? \"\"}`,\n );\n }\n },\n };\n};\n\n/**\n * Hook for handling logout logic\n */\nexport const useLogout = (): LogoutHook => {\n const dispatch = useDispatch();\n const application = useApplication();\n const BASE_PATH = getBasePath();\n const authenticate = new Authenticate();\n\n const isAuthenticated = application?.isLoggedIn ?? false;\n const cachedType = Cache.getItem(\"primaryAuthenticationType\");\n\n return {\n isAuthenticated,\n primaryAuthenticationType:\n cachedType ?? application?.authenticationTypes?.[0],\n authenticationTypes: application?.authenticationTypes ?? [],\n logout: () => {\n const type = authenticate.authenticationType;\n\n if (type === INTERNAL_LOGIN_TYPE.PAC4J_INDIRECT) {\n authenticate.redirectToLogout();\n return; // Redirects stop execution\n }\n\n if (Cache.getItem(\"isRedirectLogin\")) {\n const origin = window.location.origin;\n const url = `${authenticate.getLogoutUrl()}?url=${origin}${BASE_PATH}`;\n Cache.setItem(\"isRedirectLogin\", false);\n window.location.assign(url);\n return;\n }\n\n // Returns the Promise from the logout thunk\n return dispatch(logout());\n },\n logoutUrl: authenticate.getLogoutUrl(),\n };\n};\n"],"mappings":";;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AAuBA;AACA;AACA;AACO,MAAMQ,QAAQ,GAAGA,CAAA,KAAiB;EACvCC,cAAK,CAACC,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC;EAEvC,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAMC,WAAW,GAAG,IAAAC,iCAAc,EAAC,CAAC;EACpC,MAAMC,IAAI,GAAG,IAAAC,uBAAW,EAAEC,KAAK,IAAKA,KAAK,CAACF,IAAI,CAAC;EAE/C,MAAMG,eAAe,GAAGL,WAAW,EAAEM,UAAU,IAAI,KAAK;EACxD,MAAMC,UAAU,GAAGX,cAAK,CAACY,OAAO,CAAC,2BAA2B,CAAC;EAE7D,OAAO;IACLH,eAAe;IACf;IACAI,yBAAyB,EACvBF,UAAU,IAAIP,WAAW,EAAEU,mBAAmB,GAAG,CAAC,CAAC;IACrDA,mBAAmB,EAAEV,WAAW,EAAEU,mBAAmB,IAAI,EAAE;IAC3DC,YAAY,EAAET,IAAI,CAACU,KAAK;IACxBC,WAAW,EAAEA,CAAA,KAAMf,QAAQ,CAAC,IAAAgB,wBAAe,EAAC,CAAC,CAAC;IAC9CC,KAAK,EAAEA,CAACC,QAAgB,EAAEC,QAAgB,KACxCnB,QAAQ,CAAC,IAAAiB,cAAK,EAACC,QAAQ,EAAEC,QAAQ,CAAC,CAAC;IACrCC,aAAa,EAAGC,kBAAsC,IAAK;M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