@elliemae/pui-app-sdk 2.21.2 → 2.21.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.
@@ -1,16 +1,38 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.setStore = exports.getStore = exports.createAppStore = void 0;
9
+
10
+ var _toolkit = require("@reduxjs/toolkit");
11
+
12
+ var _reduxInjectors = require("redux-injectors");
13
+
14
+ var _connectedReactRouter = require("connected-react-router");
15
+
16
+ var _reduxSaga = _interopRequireDefault(require("redux-saga"));
17
+
18
+ var _reducers = require("./reducers.js");
19
+
20
+ var _webpackHmr = require("./webpack-hmr.js");
21
+
1
22
  /* eslint-disable max-params */
2
- import { configureStore } from '@reduxjs/toolkit';
3
- import { createInjectorsEnhancer, forceReducerReload } from 'redux-injectors';
4
- import { routerMiddleware } from 'connected-react-router';
5
- import createSagaMiddleware from 'redux-saga';
6
- import { createReducer } from "./reducers.js";
7
- const rootReducer = createReducer();
23
+ const rootReducer = (0, _reducers.createReducer)();
8
24
  // global variable
9
25
  let appStore = null;
10
- export const setStore = store => {
26
+
27
+ const setStore = store => {
11
28
  appStore = store;
12
29
  };
13
- export const getStore = () => appStore;
30
+
31
+ exports.setStore = setStore;
32
+
33
+ const getStore = () => appStore;
34
+
35
+ exports.getStore = getStore;
14
36
 
15
37
  const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
16
38
  thunk: false
@@ -19,46 +41,30 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
19
41
  const {
20
42
  run: runSaga
21
43
  } = sagaMiddleware;
22
- const enhancers = [createInjectorsEnhancer({
23
- createReducer,
44
+ const enhancers = [(0, _reduxInjectors.createInjectorsEnhancer)({
45
+ createReducer: _reducers.createReducer,
24
46
  runSaga
25
47
  })];
26
- const baseStore = configureStore({
48
+ const baseStore = (0, _toolkit.configureStore)({
27
49
  reducer: rootReducer,
28
50
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
29
51
  // @ts-ignore
30
- middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat(routerMiddleware(history)),
52
+ middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat((0, _connectedReactRouter.routerMiddleware)(history)),
31
53
  devTools: process.env.NODE_ENV !== 'production',
32
54
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
33
55
  // @ts-ignore
34
56
  preloadedState: initialState,
35
57
  enhancers
36
58
  });
37
- let hotModule = null;
38
-
39
- try {
40
- hotModule = module?.hot;
41
- } catch (err) {
42
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
43
- // @ts-ignore
44
- // block:start
45
- hotModule = import.meta?.webpackHot; // block:end
46
- }
47
-
48
- if (hotModule) {
49
- hotModule.accept('./reducers', () => {
50
- forceReducerReload(baseStore);
51
- });
52
- }
53
-
59
+ (0, _webpackHmr.enableHotReloading)(baseStore);
54
60
  return baseStore;
55
61
  };
56
62
 
57
- export const createAppStore = (initialState: RootState = ({} as RootState), history: History, middlewareConfig?: MiddlewareConfig) => {
58
- const sagaMiddleware = createSagaMiddleware({});
63
+ const createAppStore = (initialState = {}, history, middlewareConfig) => {
64
+ const sagaMiddleware = (0, _reduxSaga.default)({});
59
65
  const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
60
66
  setStore(store);
61
67
  return store;
62
68
  };
63
- export type AppStore = ReturnType<typeof createAppStore>;
64
- export type AppDispatch = AppStore['dispatch'];
69
+
70
+ exports.createAppStore = createAppStore;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.enableHotReloading = void 0;
7
+
8
+ var _reduxInjectors = require("redux-injectors");
9
+
10
+ // eslint-disable-next-line @typescript-eslint/ban-types
11
+ const enableHotReloading = baseStore => {
12
+ let hotModule = null;
13
+
14
+ try {
15
+ var _module;
16
+
17
+ hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
18
+ } catch (err) {
19
+ var _import$meta;
20
+
21
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22
+ // @ts-ignore
23
+ hotModule = (_import$meta = import.meta) === null || _import$meta === void 0 ? void 0 : _import$meta.webpackHot;
24
+ }
25
+
26
+ if (hotModule) {
27
+ hotModule.accept('./reducers', () => {
28
+ (0, _reduxInjectors.forceReducerReload)(baseStore);
29
+ });
30
+ }
31
+ };
32
+
33
+ exports.enableHotReloading = enableHotReloading;
@@ -15,17 +15,18 @@ var _index = require("../media-breakpoint/index.js");
15
15
 
16
16
  var _index2 = require("../window-size/index.js");
17
17
 
18
- var _htmlWaitMessage = require("../modals/wait-message/html-wait-message.js");
18
+ var _index3 = require("../error-toast/index.js");
19
+
20
+ var _index4 = require("../modals/wait-message/index.js");
19
21
 
20
22
  var _style = _interopRequireDefault(require("./style.js"));
21
23
 
22
- var _GlobalStyle, _MediaBreakpoint, _WindowSize, _HTMLWaitMessage;
24
+ var _GlobalStyle, _MediaBreakpoint, _WindowSize, _DefaultWaitMessage, _ErrorToast;
23
25
 
24
26
  const HostedApp = ({
27
+ WaitMessage,
25
28
  children
26
- }) => /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})), _HTMLWaitMessage || (_HTMLWaitMessage = /*#__PURE__*/(0, _jsx2.default)(_htmlWaitMessage.HTMLWaitMessage, {
27
- close: true
28
- })), children);
29
+ }) => /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/(0, _jsx2.default)(_index4.WaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/(0, _jsx2.default)(_index3.ErrorToast, {})), children);
29
30
 
30
31
  exports.HostedApp = HostedApp;
31
32
 
@@ -17,15 +17,9 @@ var _reactRouterDom = require("react-router-dom");
17
17
 
18
18
  var _puiTheme = require("@elliemae/pui-theme");
19
19
 
20
- var _reduxInjectors = require("redux-injectors");
21
-
22
20
  var _index = require("../../utils/micro-frontend/index.js");
23
21
 
24
- var _index2 = require("../../sideeffect/wait-message/index.js");
25
-
26
- var _index3 = require("../../sideeffect/error-toast/index.js");
27
-
28
- var _index4 = require("../error-boundary/index.js");
22
+ var _index2 = require("../error-boundary/index.js");
29
23
 
30
24
  var _standAloneApp = require("./stand-alone-app.js");
31
25
 
@@ -34,14 +28,6 @@ var _hostedApp = require("./hosted-app.js");
34
28
  var _jsxRuntime = require("react/jsx-runtime");
35
29
 
36
30
  const AppToRender = props => {
37
- (0, _reduxInjectors.useInjectSaga)({
38
- key: 'waitMessage',
39
- saga: _index2.waitMessage
40
- });
41
- (0, _reduxInjectors.useInjectSaga)({
42
- key: 'errorToast',
43
- saga: _index3.errorToast
44
- });
45
31
  const isParent = (0, _index.isStandAloneGuest)() || (0, _index.isHost)();
46
32
  return isParent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_standAloneApp.StandAloneApp, { ...props
47
33
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_hostedApp.HostedApp, { ...props
@@ -56,7 +42,7 @@ const AppRoot = ({
56
42
  WaitMessage,
57
43
  errorTemplate,
58
44
  children
59
- }) => /*#__PURE__*/(0, _jsx3.default)(_index4.ErrorBoundary, {
45
+ }) => /*#__PURE__*/(0, _jsx3.default)(_index2.ErrorBoundary, {
60
46
  errorTemplate: errorTemplate
61
47
  }, void 0, /*#__PURE__*/(0, _jsx3.default)(_reactRedux.Provider, {
62
48
  store: store
@@ -35,7 +35,6 @@ const InputMask = ({
35
35
  name,
36
36
  defaultValue = '',
37
37
  rules = {},
38
- mask,
39
38
  ...rest
40
39
  }) => /*#__PURE__*/(0, _jsx3.default)(_reactHookForm.Controller, {
41
40
  name: name,
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable max-params */
2
- // @strip-block
3
2
  import { configureStore } from '@reduxjs/toolkit';
4
- import { createInjectorsEnhancer, forceReducerReload } from 'redux-injectors';
3
+ import { createInjectorsEnhancer } from 'redux-injectors';
5
4
  import { routerMiddleware } from 'connected-react-router';
6
5
  import createSagaMiddleware from 'redux-saga';
7
6
  import { createReducer } from "./reducers.js";
7
+ import { enableHotReloading } from "./webpack-hmr.js";
8
8
  const rootReducer = createReducer();
9
9
  // global variable
10
10
  let appStore = null;
@@ -35,27 +35,7 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
35
35
  preloadedState: initialState,
36
36
  enhancers
37
37
  });
38
- let hotModule = null;
39
-
40
- try {
41
- var _module;
42
-
43
- hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
44
- } catch (err) {
45
- var _import$meta;
46
-
47
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
48
- // @ts-ignore
49
- // block:start
50
- hotModule = (_import$meta = import.meta) === null || _import$meta === void 0 ? void 0 : _import$meta.webpackHot; // block:end
51
- }
52
-
53
- if (hotModule) {
54
- hotModule.accept('./reducers', () => {
55
- forceReducerReload(baseStore);
56
- });
57
- }
58
-
38
+ enableHotReloading(baseStore);
59
39
  return baseStore;
60
40
  };
61
41
 
@@ -0,0 +1,23 @@
1
+ import { forceReducerReload } from 'redux-injectors'; // eslint-disable-next-line @typescript-eslint/ban-types
2
+
3
+ export const enableHotReloading = baseStore => {
4
+ let hotModule = null;
5
+
6
+ try {
7
+ var _module;
8
+
9
+ hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
10
+ } catch (err) {
11
+ var _import$meta;
12
+
13
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14
+ // @ts-ignore
15
+ hotModule = (_import$meta = import.meta) === null || _import$meta === void 0 ? void 0 : _import$meta.webpackHot;
16
+ }
17
+
18
+ if (hotModule) {
19
+ hotModule.accept('./reducers', () => {
20
+ forceReducerReload(baseStore);
21
+ });
22
+ }
23
+ };
@@ -1,17 +1,17 @@
1
1
  import _jsx from "@babel/runtime/helpers/jsx";
2
2
  import _styled from "styled-components";
3
3
 
4
- var _GlobalStyle, _MediaBreakpoint, _WindowSize, _HTMLWaitMessage;
4
+ var _GlobalStyle, _MediaBreakpoint, _WindowSize, _DefaultWaitMessage, _ErrorToast;
5
5
 
6
6
  import { MediaBreakpoint } from "../media-breakpoint/index.js";
7
7
  import { WindowSize } from "../window-size/index.js";
8
- import { HTMLWaitMessage } from "../modals/wait-message/html-wait-message.js";
8
+ import { ErrorToast } from "../error-toast/index.js";
9
+ import { WaitMessage as DefaultWaitMessage } from "../modals/wait-message/index.js";
9
10
  import GlobalStyle from "./style.js";
10
11
  export const HostedApp = ({
12
+ WaitMessage,
11
13
  children
12
- }) => /*#__PURE__*/_jsx(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/_jsx(GlobalStyle, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/_jsx(MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/_jsx(WindowSize, {})), _HTMLWaitMessage || (_HTMLWaitMessage = /*#__PURE__*/_jsx(HTMLWaitMessage, {
13
- close: true
14
- })), children);
14
+ }) => /*#__PURE__*/_jsx(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/_jsx(GlobalStyle, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/_jsx(MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/_jsx(WindowSize, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/_jsx(DefaultWaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/_jsx(ErrorToast, {})), children);
15
15
 
16
16
  var _StyledDiv = /*#__PURE__*/_styled("div").withConfig({
17
17
  componentId: "sc-njn2ro-0"
@@ -3,24 +3,13 @@ import { Provider } from 'react-redux';
3
3
  import { ThemeProvider } from 'styled-components';
4
4
  import { Router } from 'react-router-dom';
5
5
  import { getDefaultTheme } from '@elliemae/pui-theme';
6
- import { useInjectSaga } from 'redux-injectors';
7
6
  import { isStandAloneGuest, isHost } from "../../utils/micro-frontend/index.js";
8
- import { waitMessage } from "../../sideeffect/wait-message/index.js";
9
- import { errorToast } from "../../sideeffect/error-toast/index.js";
10
7
  import { ErrorBoundary } from "../error-boundary/index.js";
11
8
  import { StandAloneApp } from "./stand-alone-app.js";
12
9
  import { HostedApp } from "./hosted-app.js";
13
10
  import { jsx as _jsx } from "react/jsx-runtime";
14
11
 
15
12
  const AppToRender = props => {
16
- useInjectSaga({
17
- key: 'waitMessage',
18
- saga: waitMessage
19
- });
20
- useInjectSaga({
21
- key: 'errorToast',
22
- saga: errorToast
23
- });
24
13
  const isParent = isStandAloneGuest() || isHost();
25
14
  return isParent ? /*#__PURE__*/_jsx(StandAloneApp, { ...props
26
15
  }) : /*#__PURE__*/_jsx(HostedApp, { ...props
@@ -6,7 +6,6 @@ export const InputMask = ({
6
6
  name,
7
7
  defaultValue = '',
8
8
  rules = {},
9
- mask,
10
9
  ...rest
11
10
  }) => /*#__PURE__*/_jsx2(Controller, {
12
11
  name: name,
@@ -0,0 +1 @@
1
+ export declare const enableHotReloading: (baseStore: {}) => void;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  declare type HostedAppProps = {
3
+ WaitMessage: React.ReactNode;
3
4
  children: React.ReactNode;
4
5
  };
5
- export declare const HostedApp: React.FC<HostedAppProps>;
6
+ export declare const HostedApp: ({ WaitMessage, children }: HostedAppProps) => JSX.Element;
6
7
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "2.21.2",
3
+ "version": "2.21.6",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -47,7 +47,7 @@
47
47
  "url": "http://git.elliemae.io/platform-ui/pui-app-sdk.git"
48
48
  },
49
49
  "engines": {
50
- "npm": ">=7",
50
+ "npm": ">=8",
51
51
  "node": ">=14"
52
52
  },
53
53
  "author": "ICE MT",
@@ -89,14 +89,14 @@
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@elliemae/app-react-dependencies": "^2.10.0",
92
- "@elliemae/ds-basic": "^2.2.2",
93
- "@elliemae/ds-button": "^2.2.2",
94
- "@elliemae/ds-form": "^2.2.2",
95
- "@elliemae/ds-loading-indicator": "^2.2.2",
96
- "@elliemae/ds-date-picker": "^2.2.2",
97
- "@elliemae/ds-modal": "^2.2.2",
98
- "@elliemae/ds-popperjs": "^2.2.2",
99
- "@elliemae/ds-toast": "^2.2.2",
92
+ "@elliemae/ds-basic": "^2.2.3",
93
+ "@elliemae/ds-button": "^2.2.3",
94
+ "@elliemae/ds-form": "^2.2.3",
95
+ "@elliemae/ds-loading-indicator": "^2.2.3",
96
+ "@elliemae/ds-date-picker": "^2.2.3",
97
+ "@elliemae/ds-modal": "^2.2.3",
98
+ "@elliemae/ds-popperjs": "^2.2.3",
99
+ "@elliemae/ds-toast": "^2.2.3",
100
100
  "@elliemae/em-ssf-guest": "^1.11.1",
101
101
  "@elliemae/pui-diagnostics": "^2.7.3",
102
102
  "@elliemae/pui-micro-frontend-base": "^1.10.1",
@@ -106,16 +106,16 @@
106
106
  "devDependencies": {
107
107
  "@elliemae/app-react-dependencies": "~2.10.0",
108
108
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.2.1",
109
- "@elliemae/ds-basic": "~2.2.2",
110
- "@elliemae/ds-button": "~2.2.2",
111
- "@elliemae/ds-form": "~2.2.2",
112
- "@elliemae/ds-loading-indicator": "~2.2.2",
113
- "@elliemae/ds-date-picker": "~2.2.2",
114
- "@elliemae/ds-modal": "~2.2.2",
115
- "@elliemae/ds-popperjs": "~2.2.2",
116
- "@elliemae/ds-toast": "~2.2.2",
109
+ "@elliemae/ds-basic": "~2.2.3",
110
+ "@elliemae/ds-button": "~2.2.3",
111
+ "@elliemae/ds-form": "~2.2.3",
112
+ "@elliemae/ds-loading-indicator": "~2.2.3",
113
+ "@elliemae/ds-date-picker": "~2.2.3",
114
+ "@elliemae/ds-modal": "~2.2.3",
115
+ "@elliemae/ds-popperjs": "~2.2.3",
116
+ "@elliemae/ds-toast": "~2.2.3",
117
117
  "@elliemae/em-ssf-guest": "~1.11.1",
118
- "@elliemae/pui-cli": "~5.25.1",
118
+ "@elliemae/pui-cli": "~5.26.2",
119
119
  "@elliemae/pui-diagnostics": "~2.7.3",
120
120
  "@elliemae/pui-e2e-test-sdk": "~6.10.0",
121
121
  "@elliemae/pui-micro-frontend-base": "~1.10.1",
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _reactRouterDom = require("react-router-dom");
4
-
5
- var _store = require("../store.js");
6
-
7
- /**
8
- * Test store addons
9
- */
10
- describe('createAppStore', () => {
11
- let store;
12
- beforeAll(() => {
13
- store = (0, _store.createAppStore)({}, _reactRouterDom.browserHistory);
14
- });
15
- describe('injectedReducers', () => {
16
- it('should contain an object for reducers', () => {
17
- expect(typeof store.injectedReducers).toBe('object');
18
- });
19
- });
20
- describe('injectedSagas', () => {
21
- it('should contain an object for sagas', () => {
22
- expect(typeof store.injectedSagas).toBe('object');
23
- });
24
- });
25
- describe('runSaga', () => {
26
- it('should contain a hook for `sagaMiddleware.run`', () => {
27
- expect(typeof store.runSaga).toBe('function');
28
- });
29
- });
30
- });
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.errorToast = errorToast;
7
-
8
- var _effects = require("redux-saga/effects");
9
-
10
- var _index = require("../../data/error/index.js");
11
-
12
- var _guest = require("../../utils/micro-frontend/guest.js");
13
-
14
- var _index2 = require("../../utils/micro-frontend/index.js");
15
-
16
- var _logRecords = require("../../utils/log-records.js");
17
-
18
- function* openErrorToast(action) {
19
- try {
20
- var _action$payload, _action$payload2;
21
-
22
- const microApp = yield (0, _effects.call)(_guest.CMicroAppGuest.getInstance.bind(_guest.CMicroAppGuest));
23
- const host = yield (0, _effects.call)(microApp.getHost.bind(microApp));
24
- const message = (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.description) || (action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.messageText);
25
- if (host && message) yield (0, _effects.call)(host.openErrorBanner.bind(host), message);
26
- } catch (ex) {
27
- (0, _index2.getLogger)().error({ ..._logRecords.logRecords.ERR_TOAST_OPEN_FAILED,
28
- exception: ex
29
- });
30
- }
31
- }
32
-
33
- function* errorToast() {
34
- yield (0, _effects.takeLatest)(_index.actions.set.type, openErrorToast);
35
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.waitMessage = waitMessage;
7
-
8
- var _effects = require("redux-saga/effects");
9
-
10
- var _actions = require("../../data/wait-message/actions.js");
11
-
12
- var _guest = require("../../utils/micro-frontend/guest.js");
13
-
14
- var _index = require("../../utils/micro-frontend/index.js");
15
-
16
- var _logRecords = require("../../utils/log-records.js");
17
-
18
- function* openWaitMessage() {
19
- try {
20
- const microApp = yield (0, _effects.call)(_guest.CMicroAppGuest.getInstance.bind(_guest.CMicroAppGuest));
21
- const host = yield (0, _effects.call)(microApp.getHost.bind(microApp));
22
- if (host) yield (0, _effects.call)(host.openWaitMessage.bind(host));
23
- } catch (ex) {
24
- (0, _index.getLogger)().error({ ..._logRecords.logRecords.WAIT_MSG_OPEN_FAILED,
25
- exception: ex
26
- });
27
- }
28
- }
29
-
30
- function* closeWaitMessage() {
31
- try {
32
- const microApp = yield (0, _effects.call)(_guest.CMicroAppGuest.getInstance.bind(_guest.CMicroAppGuest));
33
- const host = yield (0, _effects.call)(microApp.getHost.bind(microApp));
34
- if (host) yield (0, _effects.call)(host.closeWaitMessage.bind(host));
35
- } catch (ex) {
36
- (0, _index.getLogger)().error({ ..._logRecords.logRecords.WAIT_MSG_CLOSE_FAILED,
37
- exception: ex
38
- });
39
- }
40
- }
41
-
42
- function* waitMessage() {
43
- yield (0, _effects.takeLatest)(_actions.ACTIONS.OPEN, openWaitMessage);
44
- yield (0, _effects.takeLatest)(_actions.ACTIONS.CLOSE, closeWaitMessage);
45
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Test store addons
3
- */
4
- import { browserHistory } from 'react-router-dom';
5
- import { createAppStore } from "../store.js";
6
- describe('createAppStore', () => {
7
- let store;
8
- beforeAll(() => {
9
- store = createAppStore({}, browserHistory);
10
- });
11
- describe('injectedReducers', () => {
12
- it('should contain an object for reducers', () => {
13
- expect(typeof store.injectedReducers).toBe('object');
14
- });
15
- });
16
- describe('injectedSagas', () => {
17
- it('should contain an object for sagas', () => {
18
- expect(typeof store.injectedSagas).toBe('object');
19
- });
20
- });
21
- describe('runSaga', () => {
22
- it('should contain a hook for `sagaMiddleware.run`', () => {
23
- expect(typeof store.runSaga).toBe('function');
24
- });
25
- });
26
- });
@@ -1,24 +0,0 @@
1
- import { call, takeLatest } from 'redux-saga/effects';
2
- import { actions } from "../../data/error/index.js";
3
- import { CMicroAppGuest } from "../../utils/micro-frontend/guest.js";
4
- import { getLogger } from "../../utils/micro-frontend/index.js";
5
- import { logRecords } from "../../utils/log-records.js";
6
-
7
- function* openErrorToast(action) {
8
- try {
9
- var _action$payload, _action$payload2;
10
-
11
- const microApp = yield call(CMicroAppGuest.getInstance.bind(CMicroAppGuest));
12
- const host = yield call(microApp.getHost.bind(microApp));
13
- const message = (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.description) || (action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.messageText);
14
- if (host && message) yield call(host.openErrorBanner.bind(host), message);
15
- } catch (ex) {
16
- getLogger().error({ ...logRecords.ERR_TOAST_OPEN_FAILED,
17
- exception: ex
18
- });
19
- }
20
- }
21
-
22
- export function* errorToast() {
23
- yield takeLatest(actions.set.type, openErrorToast);
24
- }
@@ -1,34 +0,0 @@
1
- import { call, takeLatest } from 'redux-saga/effects';
2
- import { ACTIONS } from "../../data/wait-message/actions.js";
3
- import { CMicroAppGuest } from "../../utils/micro-frontend/guest.js";
4
- import { getLogger } from "../../utils/micro-frontend/index.js";
5
- import { logRecords } from "../../utils/log-records.js";
6
-
7
- function* openWaitMessage() {
8
- try {
9
- const microApp = yield call(CMicroAppGuest.getInstance.bind(CMicroAppGuest));
10
- const host = yield call(microApp.getHost.bind(microApp));
11
- if (host) yield call(host.openWaitMessage.bind(host));
12
- } catch (ex) {
13
- getLogger().error({ ...logRecords.WAIT_MSG_OPEN_FAILED,
14
- exception: ex
15
- });
16
- }
17
- }
18
-
19
- function* closeWaitMessage() {
20
- try {
21
- const microApp = yield call(CMicroAppGuest.getInstance.bind(CMicroAppGuest));
22
- const host = yield call(microApp.getHost.bind(microApp));
23
- if (host) yield call(host.closeWaitMessage.bind(host));
24
- } catch (ex) {
25
- getLogger().error({ ...logRecords.WAIT_MSG_CLOSE_FAILED,
26
- exception: ex
27
- });
28
- }
29
- }
30
-
31
- export function* waitMessage() {
32
- yield takeLatest(ACTIONS.OPEN, openWaitMessage);
33
- yield takeLatest(ACTIONS.CLOSE, closeWaitMessage);
34
- }
@@ -1,2 +0,0 @@
1
- import { ForkEffect } from 'redux-saga/effects';
2
- export declare function errorToast(): Generator<ForkEffect, void, unknown>;
@@ -1,2 +0,0 @@
1
- import { ForkEffect } from 'redux-saga/effects';
2
- export declare function waitMessage(): Generator<ForkEffect, void, unknown>;