@elliemae/pui-app-sdk 2.20.0 → 2.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/analytics/appdynamics.js +3 -1
- package/dist/cjs/data/store.js +24 -41
- package/dist/cjs/data/tests/store.test1.js +30 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/route/page-view.js +4 -2
- package/dist/cjs/utils/micro-frontend/host.js +6 -6
- package/dist/cjs/utils/session.js +2 -2
- package/dist/cjs/utils/storybook/preview.js +7 -7
- package/dist/cjs/view/modals/session-expiry/index.js +4 -1
- package/dist/cjs/view/session-timeout/index.js +5 -1
- package/dist/es/analytics/appdynamics.js +3 -1
- package/dist/es/data/tests/store.test1.js +26 -0
- package/dist/es/index.js +1 -1
- package/dist/es/route/page-view.js +4 -2
- package/dist/es/utils/micro-frontend/host.js +8 -7
- package/dist/es/utils/session.js +2 -2
- package/dist/es/utils/storybook/preview.js +5 -7
- package/dist/es/view/modals/session-expiry/index.js +5 -2
- package/dist/es/view/session-timeout/index.js +5 -1
- package/dist/types/data/react-redux.d.ts +8 -8
- package/dist/types/data/tests/{store.test.d.ts → store.test1.d.ts} +0 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/session.d.ts +5 -2
- package/dist/types/utils/storybook/preview.d.ts +1 -0
- package/package.json +26 -26
|
@@ -28,7 +28,9 @@ const setAppDynamicsUserData = params => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
if (brum) {
|
|
31
|
-
|
|
31
|
+
var _brum$setCustomUserDa;
|
|
32
|
+
|
|
33
|
+
(_brum$setCustomUserDa = brum.setCustomUserData) === null || _brum$setCustomUserDa === void 0 ? void 0 : _brum$setCustomUserDa.call(brum, () => ({
|
|
32
34
|
userData
|
|
33
35
|
}));
|
|
34
36
|
}
|
package/dist/cjs/data/store.js
CHANGED
|
@@ -1,36 +1,16 @@
|
|
|
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
1
|
/* eslint-disable max-params */
|
|
21
|
-
|
|
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();
|
|
22
8
|
// global variable
|
|
23
9
|
let appStore = null;
|
|
24
|
-
|
|
25
|
-
const setStore = store => {
|
|
10
|
+
export const setStore = store => {
|
|
26
11
|
appStore = store;
|
|
27
12
|
};
|
|
28
|
-
|
|
29
|
-
exports.setStore = setStore;
|
|
30
|
-
|
|
31
|
-
const getStore = () => appStore;
|
|
32
|
-
|
|
33
|
-
exports.getStore = getStore;
|
|
13
|
+
export const getStore = () => appStore;
|
|
34
14
|
|
|
35
15
|
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
36
16
|
thunk: false
|
|
@@ -39,15 +19,15 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
39
19
|
const {
|
|
40
20
|
run: runSaga
|
|
41
21
|
} = sagaMiddleware;
|
|
42
|
-
const enhancers = [
|
|
43
|
-
createReducer
|
|
22
|
+
const enhancers = [createInjectorsEnhancer({
|
|
23
|
+
createReducer,
|
|
44
24
|
runSaga
|
|
45
25
|
})];
|
|
46
|
-
const baseStore =
|
|
26
|
+
const baseStore = configureStore({
|
|
47
27
|
reducer: rootReducer,
|
|
48
28
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
49
29
|
// @ts-ignore
|
|
50
|
-
middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat(
|
|
30
|
+
middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat(routerMiddleware(history)),
|
|
51
31
|
devTools: process.env.NODE_ENV !== 'production',
|
|
52
32
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
53
33
|
// @ts-ignore
|
|
@@ -57,25 +37,28 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
57
37
|
let hotModule = null;
|
|
58
38
|
|
|
59
39
|
try {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
+
}
|
|
64
47
|
|
|
65
48
|
if (hotModule) {
|
|
66
49
|
hotModule.accept('./reducers', () => {
|
|
67
|
-
|
|
50
|
+
forceReducerReload(baseStore);
|
|
68
51
|
});
|
|
69
52
|
}
|
|
70
53
|
|
|
71
54
|
return baseStore;
|
|
72
55
|
};
|
|
73
56
|
|
|
74
|
-
const createAppStore = (initialState = {}, history, middlewareConfig) => {
|
|
75
|
-
const sagaMiddleware = (
|
|
57
|
+
export const createAppStore = (initialState: RootState = ({} as RootState), history: History, middlewareConfig?: MiddlewareConfig) => {
|
|
58
|
+
const sagaMiddleware = createSagaMiddleware({});
|
|
76
59
|
const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
|
|
77
60
|
setStore(store);
|
|
78
61
|
return store;
|
|
79
62
|
};
|
|
80
|
-
|
|
81
|
-
|
|
63
|
+
export type AppStore = ReturnType<typeof createAppStore>;
|
|
64
|
+
export type AppDispatch = AppStore['dispatch'];
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -43,6 +43,7 @@ var _exportNames = {
|
|
|
43
43
|
setAppConfigValue: true,
|
|
44
44
|
setAppConfig: true,
|
|
45
45
|
getMicroFrontEndAppConfig: true,
|
|
46
|
+
getLogger: true,
|
|
46
47
|
loadAppConfig: true,
|
|
47
48
|
AppRoot: true,
|
|
48
49
|
ErrorBoundary: true,
|
|
@@ -379,6 +380,12 @@ Object.defineProperty(exports, "getHostAppDataByKey", {
|
|
|
379
380
|
return _store2.getHostAppDataByKey;
|
|
380
381
|
}
|
|
381
382
|
});
|
|
383
|
+
Object.defineProperty(exports, "getLogger", {
|
|
384
|
+
enumerable: true,
|
|
385
|
+
get: function () {
|
|
386
|
+
return _index8.getLogger;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
382
389
|
Object.defineProperty(exports, "getMicroFrontEndAppConfig", {
|
|
383
390
|
enumerable: true,
|
|
384
391
|
get: function () {
|
|
@@ -16,8 +16,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
const onPageView = pageTitle => {
|
|
17
17
|
try {
|
|
18
18
|
if (brum && pageTitle) {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
var _brum$setCustomVirtua, _brum$startVirtualPag;
|
|
20
|
+
|
|
21
|
+
(_brum$setCustomVirtua = brum.setCustomVirtualPageName) === null || _brum$setCustomVirtua === void 0 ? void 0 : _brum$setCustomVirtua.call(brum, pageTitle);
|
|
22
|
+
(_brum$startVirtualPag = brum.startVirtualPageMonitoringWithAutoEnd) === null || _brum$startVirtualPag === void 0 ? void 0 : _brum$startVirtualPag.call(brum, pageTitle);
|
|
21
23
|
}
|
|
22
24
|
} catch {// eslint-disable-next-line no-empty
|
|
23
25
|
}
|
|
@@ -41,6 +41,7 @@ var _appdynamics = require("../../analytics/appdynamics.js");
|
|
|
41
41
|
|
|
42
42
|
var _webAnalytics = require("../../analytics/web-analytics.js");
|
|
43
43
|
|
|
44
|
+
/* eslint-disable max-lines */
|
|
44
45
|
class CMicroAppHost {
|
|
45
46
|
constructor(params) {
|
|
46
47
|
(0, _defineProperty2.default)(this, "logger", void 0);
|
|
@@ -99,11 +100,11 @@ class CMicroAppHost {
|
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
getItem(key) {
|
|
102
|
-
return
|
|
103
|
+
return (0, _window.getWindow)().sessionStorage.getItem(key);
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
setItem(key, value) {
|
|
106
|
-
|
|
107
|
+
(0, _window.getWindow)().sessionStorage.setItem(key, value);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
getGuests() {
|
|
@@ -149,11 +150,11 @@ class CMicroAppHost {
|
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
getAuthToken() {
|
|
152
|
-
return
|
|
153
|
+
return (0, _window.getWindow)().sessionStorage.getItem('Authorization');
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
renewAuthToken() {
|
|
156
|
-
return
|
|
157
|
+
return (0, _window.getWindow)().sessionStorage.getItem('Authorization');
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
logout() {
|
|
@@ -185,8 +186,7 @@ class CMicroAppHost {
|
|
|
185
186
|
setSystemVersion(version = 'latest') {
|
|
186
187
|
window.emui.version = version;
|
|
187
188
|
this.props.systemVersion = version;
|
|
188
|
-
}
|
|
189
|
-
|
|
189
|
+
}
|
|
190
190
|
|
|
191
191
|
sendBAEvent(data) {
|
|
192
192
|
(0, _index3.sendBAEvent)({
|
|
@@ -23,12 +23,12 @@ let sessionExpiryWarningNotified = false;
|
|
|
23
23
|
let timerHandle;
|
|
24
24
|
let sessionExpiryWarningNotifiedAt;
|
|
25
25
|
|
|
26
|
-
const resetUserIdleTime = () => {
|
|
26
|
+
const resetUserIdleTime = (resetWarningModal = false) => {
|
|
27
27
|
sessionExpiryWarningNotified = false;
|
|
28
28
|
sessionExpiryWarningNotifiedAt = null;
|
|
29
29
|
lastUserActivityTimeStamp = Date.now();
|
|
30
30
|
Promise.resolve().then(() => {
|
|
31
|
-
resetListeners.forEach(listener => listener());
|
|
31
|
+
resetListeners.forEach(listener => listener(resetWarningModal));
|
|
32
32
|
}).catch(() => {});
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getParameters = exports.decorators = void 0;
|
|
6
|
+
exports.loaders = exports.getParameters = exports.decorators = void 0;
|
|
7
7
|
|
|
8
8
|
var _addonConsole = require("@storybook/addon-console");
|
|
9
9
|
|
|
@@ -21,11 +21,6 @@ var _history = require("../history.js");
|
|
|
21
21
|
|
|
22
22
|
require("@elliemae/ds-basic/css/dimsum.css");
|
|
23
23
|
|
|
24
|
-
(async () => {
|
|
25
|
-
// eslint-disable-next-line no-undef
|
|
26
|
-
await (0, _index.loadAppConfig)(__webpack_public_path__);
|
|
27
|
-
})();
|
|
28
|
-
|
|
29
24
|
const theme = (0, _puiTheme.getDefaultTheme)();
|
|
30
25
|
const store = (0, _store.createAppStore)({}, _history.browserHistory);
|
|
31
26
|
|
|
@@ -59,4 +54,9 @@ const getParameters = storyBookTheme => ({
|
|
|
59
54
|
|
|
60
55
|
exports.getParameters = getParameters;
|
|
61
56
|
const decorators = [consoleDecorator, appDecorator];
|
|
62
|
-
exports.decorators = decorators;
|
|
57
|
+
exports.decorators = decorators;
|
|
58
|
+
const loaders = [async () => {
|
|
59
|
+
// eslint-disable-next-line no-undef, camelcase
|
|
60
|
+
await (0, _index.loadAppConfig)(__webpack_public_path__ || './');
|
|
61
|
+
}];
|
|
62
|
+
exports.loaders = loaders;
|
|
@@ -35,10 +35,13 @@ const SessionExpiry = /*#__PURE__*/(0, _react.memo)(({
|
|
|
35
35
|
const [isOpen, setIsOpen] = (0, _react.useState)(open);
|
|
36
36
|
const timeLeft = (0, _customHooks.useTrackSessionExpiry)(warningNotifiedAt);
|
|
37
37
|
const dispatch = (0, _reactRedux.useAppDispatch)();
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
39
|
+
setIsOpen(open);
|
|
40
|
+
}, [open]);
|
|
38
41
|
|
|
39
42
|
const resetSession = () => {
|
|
40
43
|
setIsOpen(false);
|
|
41
|
-
(0, _session.resetUserIdleTime)();
|
|
44
|
+
(0, _session.resetUserIdleTime)(true);
|
|
42
45
|
dispatch(_actions.logout.cancel());
|
|
43
46
|
};
|
|
44
47
|
|
|
@@ -30,7 +30,11 @@ const SessionTimeout = () => {
|
|
|
30
30
|
setwarningNotifiedAt(sessionExpiryWarningNotifiedAt);
|
|
31
31
|
setSessionExpiryWarning(true);
|
|
32
32
|
});
|
|
33
|
-
const resetCb = (0, _session.subscribeToResetSession)(
|
|
33
|
+
const resetCb = (0, _session.subscribeToResetSession)(resetWarningModal => {
|
|
34
|
+
if (resetWarningModal === true) {
|
|
35
|
+
setSessionExpiryWarning(false);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
34
38
|
const sessionExpiredCb = (0, _session.subscribeToSessionExpiry)(() => {
|
|
35
39
|
dispatch(_actions.logout.confirm());
|
|
36
40
|
setSessionExpiryWarning(false);
|
|
@@ -12,7 +12,9 @@ export const setAppDynamicsUserData = params => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
if (brum) {
|
|
15
|
-
|
|
15
|
+
var _brum$setCustomUserDa;
|
|
16
|
+
|
|
17
|
+
(_brum$setCustomUserDa = brum.setCustomUserData) === null || _brum$setCustomUserDa === void 0 ? void 0 : _brum$setCustomUserDa.call(brum, () => ({
|
|
16
18
|
userData
|
|
17
19
|
}));
|
|
18
20
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
});
|
package/dist/es/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export { CMicroAppGuest } from "./utils/micro-frontend/guest.js";
|
|
|
24
24
|
export { CMicroAppHost } from "./utils/micro-frontend/host.js";
|
|
25
25
|
export { enableReactAppForHostIntegration } from "./utils/app-host-integration/react.js";
|
|
26
26
|
export { getAppConfigValue, setAppConfigValue, setAppConfig } from "./utils/app-config/config.js";
|
|
27
|
-
export { getMicroFrontEndAppConfig } from "./utils/micro-frontend/index.js";
|
|
27
|
+
export { getMicroFrontEndAppConfig, getLogger } from "./utils/micro-frontend/index.js";
|
|
28
28
|
export { loadAppConfig } from "./utils/app-config/index.js";
|
|
29
29
|
export { AppRoot } from "./view/app-root/index.js";
|
|
30
30
|
export { ErrorBoundary } from "./view/error-boundary/index.js";
|
|
@@ -3,8 +3,10 @@ import { pageViewEvent } from "../analytics/page-view-event.js";
|
|
|
3
3
|
export const onPageView = pageTitle => {
|
|
4
4
|
try {
|
|
5
5
|
if (brum && pageTitle) {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var _brum$setCustomVirtua, _brum$startVirtualPag;
|
|
7
|
+
|
|
8
|
+
(_brum$setCustomVirtua = brum.setCustomVirtualPageName) === null || _brum$setCustomVirtua === void 0 ? void 0 : _brum$setCustomVirtua.call(brum, pageTitle);
|
|
9
|
+
(_brum$startVirtualPag = brum.startVirtualPageMonitoringWithAutoEnd) === null || _brum$startVirtualPag === void 0 ? void 0 : _brum$startVirtualPag.call(brum, pageTitle);
|
|
8
10
|
}
|
|
9
11
|
} catch {// eslint-disable-next-line no-empty
|
|
10
12
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable max-lines */
|
|
2
4
|
import { publish, subscribe, unsubscribe } from 'pubsub-js';
|
|
3
5
|
import { getDefaultTheme } from '@elliemae/pui-theme';
|
|
4
6
|
import { getStore } from "../../data/store.js";
|
|
@@ -11,7 +13,7 @@ import { loadAppConfig } from "../app-config/index.js";
|
|
|
11
13
|
import { browserHistory } from "../history.js";
|
|
12
14
|
import { logger } from "./console-logger.js";
|
|
13
15
|
import { HOST_WINDOW_RESIZED, HOST_WINDOW_BREAKPOINT_CHANGED } from "../constants.js";
|
|
14
|
-
import { getCurrentBreakpoint, getViewportSize as getWindowViewportSize } from "../window.js";
|
|
16
|
+
import { getWindow, getCurrentBreakpoint, getViewportSize as getWindowViewportSize } from "../window.js";
|
|
15
17
|
import { sendBAEvent } from "../../analytics/index.js";
|
|
16
18
|
import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
|
|
17
19
|
import { updateBAEventParameters } from "../../analytics/web-analytics.js";
|
|
@@ -79,11 +81,11 @@ export class CMicroAppHost {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
getItem(key) {
|
|
82
|
-
return
|
|
84
|
+
return getWindow().sessionStorage.getItem(key);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
setItem(key, value) {
|
|
86
|
-
|
|
88
|
+
getWindow().sessionStorage.setItem(key, value);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
getGuests() {
|
|
@@ -129,11 +131,11 @@ export class CMicroAppHost {
|
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
getAuthToken() {
|
|
132
|
-
return
|
|
134
|
+
return getWindow().sessionStorage.getItem('Authorization');
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
renewAuthToken() {
|
|
136
|
-
return
|
|
138
|
+
return getWindow().sessionStorage.getItem('Authorization');
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
logout() {
|
|
@@ -165,8 +167,7 @@ export class CMicroAppHost {
|
|
|
165
167
|
setSystemVersion(version = 'latest') {
|
|
166
168
|
window.emui.version = version;
|
|
167
169
|
this.props.systemVersion = version;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
+
}
|
|
170
171
|
|
|
171
172
|
sendBAEvent(data) {
|
|
172
173
|
sendBAEvent({
|
package/dist/es/utils/session.js
CHANGED
|
@@ -10,12 +10,12 @@ const userInteractionEvents = ['click', 'scroll', 'keypress', 'touchstart'];
|
|
|
10
10
|
let sessionExpiryWarningNotified = false;
|
|
11
11
|
let timerHandle;
|
|
12
12
|
let sessionExpiryWarningNotifiedAt;
|
|
13
|
-
export const resetUserIdleTime = () => {
|
|
13
|
+
export const resetUserIdleTime = (resetWarningModal = false) => {
|
|
14
14
|
sessionExpiryWarningNotified = false;
|
|
15
15
|
sessionExpiryWarningNotifiedAt = null;
|
|
16
16
|
lastUserActivityTimeStamp = Date.now();
|
|
17
17
|
Promise.resolve().then(() => {
|
|
18
|
-
resetListeners.forEach(listener => listener());
|
|
18
|
+
resetListeners.forEach(listener => listener(resetWarningModal));
|
|
19
19
|
}).catch(() => {});
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -6,12 +6,6 @@ import { loadAppConfig } from "../app-config/index.js";
|
|
|
6
6
|
import { createTheme } from "./theme.js";
|
|
7
7
|
import { browserHistory } from "../history.js";
|
|
8
8
|
import '@elliemae/ds-basic/css/dimsum.css';
|
|
9
|
-
|
|
10
|
-
(async () => {
|
|
11
|
-
// eslint-disable-next-line no-undef
|
|
12
|
-
await loadAppConfig(__webpack_public_path__);
|
|
13
|
-
})();
|
|
14
|
-
|
|
15
9
|
const theme = getDefaultTheme();
|
|
16
10
|
const store = createAppStore({}, browserHistory);
|
|
17
11
|
const appDecorator = withAppDecorator.bind(null, theme, store);
|
|
@@ -41,4 +35,8 @@ export const getParameters = storyBookTheme => ({
|
|
|
41
35
|
hideEmpty: true
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
|
-
export const decorators = [consoleDecorator, appDecorator];
|
|
38
|
+
export const decorators = [consoleDecorator, appDecorator];
|
|
39
|
+
export const loaders = [async () => {
|
|
40
|
+
// eslint-disable-next-line no-undef, camelcase
|
|
41
|
+
await loadAppConfig(__webpack_public_path__ || './');
|
|
42
|
+
}];
|
|
@@ -2,7 +2,7 @@ import _jsx from "@babel/runtime/helpers/jsx";
|
|
|
2
2
|
|
|
3
3
|
var _p;
|
|
4
4
|
|
|
5
|
-
import { memo, useState } from 'react';
|
|
5
|
+
import { memo, useEffect, useState } from 'react';
|
|
6
6
|
import DSModal, { MODAL_SUB_TYPE_V2, MODAL_TYPE_V2 } from '@elliemae/ds-modal';
|
|
7
7
|
import { useAppDispatch } from "../../../data/react-redux.js";
|
|
8
8
|
import { logout } from "../../../data/logout/actions.js";
|
|
@@ -16,10 +16,13 @@ export const SessionExpiry = /*#__PURE__*/memo(({
|
|
|
16
16
|
const [isOpen, setIsOpen] = useState(open);
|
|
17
17
|
const timeLeft = useTrackSessionExpiry(warningNotifiedAt);
|
|
18
18
|
const dispatch = useAppDispatch();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setIsOpen(open);
|
|
21
|
+
}, [open]);
|
|
19
22
|
|
|
20
23
|
const resetSession = () => {
|
|
21
24
|
setIsOpen(false);
|
|
22
|
-
resetUserIdleTime();
|
|
25
|
+
resetUserIdleTime(true);
|
|
23
26
|
dispatch(logout.cancel());
|
|
24
27
|
};
|
|
25
28
|
|
|
@@ -15,7 +15,11 @@ export const SessionTimeout = () => {
|
|
|
15
15
|
setwarningNotifiedAt(sessionExpiryWarningNotifiedAt);
|
|
16
16
|
setSessionExpiryWarning(true);
|
|
17
17
|
});
|
|
18
|
-
const resetCb = subscribeToResetSession(
|
|
18
|
+
const resetCb = subscribeToResetSession(resetWarningModal => {
|
|
19
|
+
if (resetWarningModal === true) {
|
|
20
|
+
setSessionExpiryWarning(false);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
19
23
|
const sessionExpiredCb = subscribeToSessionExpiry(() => {
|
|
20
24
|
dispatch(logout.confirm());
|
|
21
25
|
setSessionExpiryWarning(false);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { TypedUseSelectorHook } from 'react-redux';
|
|
2
2
|
import { RootState } from './store';
|
|
3
|
-
export declare const useAppDispatch: () => import("redux
|
|
3
|
+
export declare const useAppDispatch: () => import("redux").Dispatch<{
|
|
4
|
+
payload: import("./wait-message/reducer").WaitMessageState;
|
|
5
|
+
type: string;
|
|
6
|
+
} | import("redux").AnyAction | {
|
|
7
|
+
payload: import("./breakpoint").Breakpoints;
|
|
8
|
+
type: string;
|
|
9
|
+
}> & import("redux-thunk").ThunkDispatch<import("redux").CombinedState<{
|
|
4
10
|
waitMessage: import("./wait-message/reducer").WaitMessageState;
|
|
5
11
|
error: import("./error").ErrorState;
|
|
6
12
|
breakpoint: import("./breakpoint").BreakpointState;
|
|
@@ -10,11 +16,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<i
|
|
|
10
16
|
error: import("./error").ErrorState;
|
|
11
17
|
breakpoint: import("./breakpoint").BreakpointState;
|
|
12
18
|
liveMessage: import("./live-message").LiveMessageState;
|
|
13
|
-
}>, undefined, import("redux").AnyAction
|
|
14
|
-
payload: import("./wait-message/reducer").WaitMessageState;
|
|
15
|
-
type: string;
|
|
16
|
-
} | import("redux").AnyAction | {
|
|
17
|
-
payload: import("./breakpoint").Breakpoints;
|
|
18
|
-
type: string;
|
|
19
|
-
}>;
|
|
19
|
+
}>, undefined, import("redux").AnyAction>;
|
|
20
20
|
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { CMicroAppGuest } from './utils/micro-frontend/guest';
|
|
|
23
23
|
export { CMicroAppHost } from './utils/micro-frontend/host';
|
|
24
24
|
export { enableReactAppForHostIntegration } from './utils/app-host-integration/react';
|
|
25
25
|
export { getAppConfigValue, setAppConfigValue, setAppConfig, } from './utils/app-config/config';
|
|
26
|
-
export { getMicroFrontEndAppConfig } from './utils/micro-frontend';
|
|
26
|
+
export { getMicroFrontEndAppConfig, getLogger } from './utils/micro-frontend';
|
|
27
27
|
export { loadAppConfig } from './utils/app-config';
|
|
28
28
|
export { AppRoot } from './view/app-root';
|
|
29
29
|
export { ErrorBoundary } from './view/error-boundary';
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
declare type WARNLISTENER = {
|
|
2
2
|
(sessionExpiryWarningNotifiedAt: number | null): void;
|
|
3
3
|
};
|
|
4
|
+
declare type RESETLISTENER = {
|
|
5
|
+
(resetWarningModal: unknown): void;
|
|
6
|
+
};
|
|
4
7
|
declare type LISTENER = {
|
|
5
8
|
(): void;
|
|
6
9
|
};
|
|
7
|
-
export declare const resetUserIdleTime: () => void;
|
|
10
|
+
export declare const resetUserIdleTime: (resetWarningModal?: unknown) => void;
|
|
8
11
|
export declare const stopSessionMonitoring: () => void;
|
|
9
12
|
export declare const initSessionMonitoring: () => void;
|
|
10
13
|
export declare const subscribeToSessionExpiryWarning: (onSessionExpiryWarn: WARNLISTENER) => () => void;
|
|
11
14
|
export declare const subscribeToSessionExpiry: (onSessionExpiry: LISTENER) => () => void;
|
|
12
|
-
export declare const subscribeToResetSession: (onResetListener:
|
|
15
|
+
export declare const subscribeToResetSession: (onResetListener: RESETLISTENER) => () => void;
|
|
13
16
|
export declare const trackActivity: (element: Document | null, cb: (...args: unknown[]) => void) => () => void;
|
|
14
17
|
export {};
|
|
@@ -22,3 +22,4 @@ export function getParameters(storyBookTheme: any): {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export const decorators: (((story: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => JSX.Element) | ((storyFn: any, context: any) => any))[];
|
|
25
|
+
export const loaders: (() => Promise<void>)[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-app-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.2",
|
|
4
4
|
"description": "ICE MT UI Platform Application SDK ",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"storybook:docs": "pui-cli storybook --docs",
|
|
73
73
|
"storybook:docs:build": "pui-cli storybook -b --docs",
|
|
74
74
|
"storybook:build": "pui-cli storybook -b",
|
|
75
|
-
"storybook:prod": "
|
|
75
|
+
"storybook:prod": "http-server -g -p 11000 demo",
|
|
76
76
|
"setup": "rimraf -r node_modules && rimraf package-lock.json && npm i",
|
|
77
77
|
"test": "pui-cli test -p",
|
|
78
78
|
"test:fix": "pui-cli test -f",
|
|
@@ -89,37 +89,37 @@
|
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@elliemae/app-react-dependencies": "^2.10.0",
|
|
92
|
-
"@elliemae/ds-basic": "^
|
|
93
|
-
"@elliemae/ds-button": "^
|
|
94
|
-
"@elliemae/ds-form": "^
|
|
95
|
-
"@elliemae/ds-loading-indicator": "^
|
|
96
|
-
"@elliemae/ds-date-picker": "^
|
|
97
|
-
"@elliemae/ds-modal": "^
|
|
98
|
-
"@elliemae/ds-popperjs": "^
|
|
99
|
-
"@elliemae/ds-toast": "^
|
|
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",
|
|
100
100
|
"@elliemae/em-ssf-guest": "^1.11.1",
|
|
101
|
-
"@elliemae/pui-diagnostics": "^2.7.
|
|
102
|
-
"@elliemae/pui-micro-frontend-base": "^1.10.
|
|
101
|
+
"@elliemae/pui-diagnostics": "^2.7.3",
|
|
102
|
+
"@elliemae/pui-micro-frontend-base": "^1.10.1",
|
|
103
103
|
"@elliemae/pui-theme": "^2.3.0",
|
|
104
|
-
"@elliemae/pui-user-monitoring": "^1.
|
|
104
|
+
"@elliemae/pui-user-monitoring": "^1.13.0"
|
|
105
105
|
},
|
|
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": "~
|
|
110
|
-
"@elliemae/ds-button": "~
|
|
111
|
-
"@elliemae/ds-form": "~
|
|
112
|
-
"@elliemae/ds-loading-indicator": "~
|
|
113
|
-
"@elliemae/ds-date-picker": "~
|
|
114
|
-
"@elliemae/ds-modal": "~
|
|
115
|
-
"@elliemae/ds-popperjs": "~
|
|
116
|
-
"@elliemae/ds-toast": "~
|
|
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",
|
|
117
117
|
"@elliemae/em-ssf-guest": "~1.11.1",
|
|
118
|
-
"@elliemae/pui-cli": "~5.
|
|
119
|
-
"@elliemae/pui-diagnostics": "~2.7.
|
|
120
|
-
"@elliemae/pui-e2e-test-sdk": "~6.
|
|
121
|
-
"@elliemae/pui-micro-frontend-base": "~1.10.
|
|
118
|
+
"@elliemae/pui-cli": "~5.25.1",
|
|
119
|
+
"@elliemae/pui-diagnostics": "~2.7.3",
|
|
120
|
+
"@elliemae/pui-e2e-test-sdk": "~6.10.0",
|
|
121
|
+
"@elliemae/pui-micro-frontend-base": "~1.10.1",
|
|
122
122
|
"@elliemae/pui-theme": "~2.3.0",
|
|
123
|
-
"@elliemae/pui-user-monitoring": "~1.
|
|
123
|
+
"@elliemae/pui-user-monitoring": "~1.13.0"
|
|
124
124
|
}
|
|
125
125
|
}
|