@elliemae/pui-app-sdk 2.17.2 → 3.0.0-beta.4
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 +34 -30
- package/dist/cjs/analytics/index.js +32 -26
- package/dist/cjs/analytics/page-view-event.js +34 -34
- package/dist/cjs/analytics/user-session-event.js +34 -27
- package/dist/cjs/analytics/user-wait-event.js +31 -17
- package/dist/cjs/analytics/web-analytics.js +16 -19
- package/dist/cjs/api/auth/index.js +41 -39
- package/dist/cjs/api/helpers.js +33 -99
- package/dist/cjs/api/users/index.js +28 -16
- package/dist/cjs/communication/http-client/index.js +44 -48
- package/dist/cjs/communication/http-client/request-interceptor.js +28 -12
- package/dist/cjs/communication/http-client/response-interceptor.js +41 -38
- package/dist/cjs/communication/http-client/retry-axios.js +68 -122
- package/dist/cjs/communication/http-client/retry.js +42 -36
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +48 -56
- package/dist/cjs/data/auth/actions.js +17 -26
- package/dist/cjs/data/auth/reducer.js +30 -18
- package/dist/cjs/data/breakpoint/index.js +38 -32
- package/dist/cjs/data/error/index.js +33 -18
- package/dist/cjs/data/live-message/index.js +34 -25
- package/dist/cjs/data/logout/actions.js +12 -9
- package/dist/cjs/data/navigation-prompt/actions.js +12 -9
- package/dist/cjs/data/react-redux.js +29 -13
- package/dist/cjs/data/reducers.js +35 -23
- package/dist/cjs/data/saga.js +12 -9
- package/dist/cjs/data/store.js +52 -60
- package/dist/cjs/data/wait-message/actions.js +14 -13
- package/dist/cjs/data/wait-message/reducer.js +32 -24
- package/dist/cjs/index.js +189 -809
- package/dist/cjs/route/index.js +37 -32
- package/dist/cjs/route/page-view.js +30 -22
- package/dist/cjs/route/private-route/index.js +52 -60
- package/dist/cjs/sideeffect/auth/index.js +42 -30
- package/dist/cjs/sideeffect/error-toast/index.js +39 -26
- package/dist/cjs/sideeffect/wait-message/index.js +45 -29
- package/dist/cjs/typings/custom.d.js +0 -1
- package/dist/cjs/typings/elliemae.d.js +0 -1
- package/dist/cjs/typings/styled.d.js +19 -3
- package/dist/cjs/utils/app-config/config.js +33 -33
- package/dist/cjs/utils/app-config/index.js +42 -44
- package/dist/cjs/utils/app-host-integration/react.js +27 -14
- package/dist/cjs/utils/auth/helper.js +30 -18
- package/dist/cjs/utils/auth/index.js +76 -116
- package/dist/cjs/utils/await.js +3 -0
- package/dist/cjs/utils/constants.js +22 -21
- package/dist/cjs/utils/font-size.js +13 -14
- package/dist/cjs/utils/guest-with-service.js +11 -12
- package/dist/cjs/utils/helpers.js +15 -19
- package/dist/cjs/utils/history.js +29 -12
- package/dist/cjs/utils/log-records.js +38 -35
- package/dist/cjs/utils/micro-frontend/console-logger.js +39 -23
- package/dist/cjs/utils/micro-frontend/guest.js +80 -128
- package/dist/cjs/utils/micro-frontend/host.js +84 -124
- package/dist/cjs/utils/micro-frontend/index.js +60 -61
- package/dist/cjs/utils/micro-frontend/types.js +3 -5
- package/dist/cjs/utils/redact-pii.js +15 -17
- package/dist/cjs/utils/service-worker.js +36 -21
- package/dist/cjs/utils/session.js +64 -70
- package/dist/cjs/utils/storybook/main.js +32 -25
- package/dist/cjs/utils/storybook/manager.js +31 -16
- package/dist/cjs/utils/storybook/middleware.js +3 -7
- package/dist/cjs/utils/storybook/preview.js +57 -48
- package/dist/cjs/utils/storybook/theme.js +30 -14
- package/dist/cjs/utils/storybook/vite.js +6 -0
- package/dist/cjs/utils/storybook/webpack.js +21 -0
- package/dist/cjs/utils/testing/index.js +38 -50
- package/dist/cjs/utils/testing/render-with-redux.js +34 -27
- package/dist/cjs/utils/testing/render-with-router-redux.js +40 -37
- package/dist/cjs/utils/testing/render-with-router.js +34 -28
- package/dist/cjs/utils/testing/render-with-state-addons.js +40 -36
- package/dist/cjs/utils/types.js +3 -0
- package/dist/cjs/utils/url.js +12 -13
- package/dist/cjs/utils/web-storage.js +40 -30
- package/dist/cjs/utils/window.js +36 -28
- package/dist/cjs/view/app-root/hosted-app.js +35 -32
- package/dist/cjs/view/app-root/index.js +57 -62
- package/dist/cjs/view/app-root/stand-alone-app.js +38 -37
- package/dist/cjs/view/app-root/style.js +50 -12
- package/dist/cjs/view/error-boundary/default-error-template.js +10 -15
- package/dist/cjs/view/error-boundary/index.js +41 -43
- package/dist/cjs/view/error-toast/index.js +42 -32
- package/dist/cjs/view/fetch-host-app-data/index.js +34 -26
- package/dist/cjs/view/fetch-host-app-data/store.js +31 -24
- package/dist/cjs/view/fields/check-box/index.js +34 -39
- package/dist/cjs/view/fields/combo-box/index.js +37 -31
- package/dist/cjs/view/fields/connect-form.js +30 -15
- package/dist/cjs/view/fields/date-input/index.js +34 -26
- package/dist/cjs/view/fields/date-picker/index.js +34 -26
- package/dist/cjs/view/fields/form-item-layout/index.js +36 -30
- package/dist/cjs/view/fields/input-mask/index.js +35 -41
- package/dist/cjs/view/fields/large-text-box/index.js +34 -26
- package/dist/cjs/view/fields/radio/index.js +34 -30
- package/dist/cjs/view/fields/radio-group/index.js +32 -27
- package/dist/cjs/view/fields/text-box/index.js +34 -26
- package/dist/cjs/view/fields/watch-value.js +41 -35
- package/dist/cjs/view/form/index.js +41 -34
- package/dist/cjs/view/form/personal-info-section.js +56 -80
- package/dist/cjs/view/form/submit-button/index.js +34 -23
- package/dist/cjs/view/guest-unload-handlers/index.js +33 -22
- package/dist/cjs/view/header/center-region/index.js +61 -38
- package/dist/cjs/view/header/index.js +41 -35
- package/dist/cjs/view/header/logo-region/index.js +31 -23
- package/dist/cjs/view/header/nav-region/index.js +44 -30
- package/dist/cjs/view/header/nav-region/notification/index.js +28 -18
- package/dist/cjs/view/header/nav-region/user/index.js +28 -18
- package/dist/cjs/view/host-binding-events/index.js +10 -11
- package/dist/cjs/view/intro.stories.mdx +1 -1
- package/dist/cjs/view/live-message/index.js +33 -34
- package/dist/cjs/view/loadable/index.js +33 -27
- package/dist/cjs/view/login/index.js +36 -30
- package/dist/cjs/view/media-breakpoint/index.js +43 -34
- package/dist/cjs/view/message-to-host-app/index.js +31 -20
- package/dist/cjs/view/micro-app/app-factory/index.js +98 -134
- package/dist/cjs/view/micro-app/const.js +10 -7
- package/dist/cjs/view/micro-app/index.js +37 -27
- package/dist/cjs/view/micro-app/resources/manifest.js +41 -34
- package/dist/cjs/view/micro-app/resources/script.js +56 -53
- package/dist/cjs/view/micro-app/resources/style.js +44 -38
- package/dist/cjs/view/micro-app/types.js +3 -5
- package/dist/cjs/view/micro-app/use-app-will-render.js +58 -50
- package/dist/cjs/view/micro-app/utils.js +32 -21
- package/dist/cjs/view/micro-iframe-app/app.js +37 -39
- package/dist/cjs/view/micro-iframe-app/iframe/const.js +10 -7
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +51 -47
- package/dist/cjs/view/micro-iframe-app/index.js +36 -24
- package/dist/cjs/view/micro-iframe-app/types.js +3 -5
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +40 -36
- package/dist/cjs/view/modals/error/index.js +35 -28
- package/dist/cjs/view/modals/navigation-prompt/index.js +38 -37
- package/dist/cjs/view/modals/session-expiry/customHooks.js +40 -35
- package/dist/cjs/view/modals/session-expiry/index.js +45 -50
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +32 -18
- package/dist/cjs/view/modals/wait-message/index.js +50 -53
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +33 -21
- package/dist/cjs/view/render-with-delay/index.js +30 -19
- package/dist/cjs/view/render-with-host-data/index.js +35 -30
- package/dist/cjs/view/session-timeout/index.js +44 -35
- package/dist/cjs/view/storybook/decorator.js +32 -21
- package/dist/cjs/view/use-previous.js +29 -13
- package/dist/cjs/view/useMediaBreakpoints/index.js +34 -19
- package/dist/cjs/view/visually-hidden/index.js +41 -21
- package/dist/cjs/view/window-size/index.js +34 -22
- package/dist/es/analytics/appdynamics.js +14 -15
- package/dist/es/analytics/index.js +11 -17
- package/dist/es/analytics/page-view-event.js +12 -26
- package/dist/es/analytics/user-session-event.js +13 -15
- package/dist/es/analytics/user-wait-event.js +10 -6
- package/dist/es/analytics/web-analytics.js +12 -10
- package/dist/es/api/auth/index.js +22 -27
- package/dist/es/api/helpers.js +8 -81
- package/dist/es/api/users/index.js +7 -8
- package/dist/es/communication/http-client/index.js +24 -30
- package/dist/es/communication/http-client/request-interceptor.js +6 -3
- package/dist/es/communication/http-client/response-interceptor.js +20 -21
- package/dist/es/communication/http-client/retry-axios.js +45 -105
- package/dist/es/communication/http-client/retry.js +22 -25
- package/dist/es/communication/http-client/tests/index.test-disable.js +28 -47
- package/dist/es/data/auth/actions.js +13 -19
- package/dist/es/data/auth/reducer.js +9 -7
- package/dist/es/data/breakpoint/index.js +19 -21
- package/dist/es/data/error/index.js +11 -9
- package/dist/es/data/live-message/index.js +12 -16
- package/dist/es/data/logout/actions.js +9 -5
- package/dist/es/data/navigation-prompt/actions.js +9 -5
- package/dist/es/data/react-redux.js +7 -3
- package/dist/es/data/reducers.js +10 -7
- package/dist/es/data/saga.js +8 -5
- package/dist/es/data/store.js +26 -44
- package/dist/es/data/wait-message/actions.js +11 -9
- package/dist/es/data/wait-message/reducer.js +10 -10
- package/dist/es/index.js +183 -84
- package/dist/es/route/index.js +16 -19
- package/dist/es/route/page-view.js +9 -9
- package/dist/es/route/private-route/index.js +30 -38
- package/dist/es/sideeffect/auth/index.js +27 -14
- package/dist/es/sideeffect/error-toast/index.js +15 -14
- package/dist/es/sideeffect/wait-message/index.js +18 -14
- package/dist/es/typings/styled.d.js +1 -1
- package/dist/es/utils/app-config/config.js +11 -9
- package/dist/es/utils/app-config/index.js +21 -31
- package/dist/es/utils/app-host-integration/react.js +8 -6
- package/dist/es/utils/auth/helper.js +8 -4
- package/dist/es/utils/auth/index.js +59 -83
- package/dist/es/utils/constants.js +18 -13
- package/dist/es/utils/font-size.js +7 -3
- package/dist/es/utils/guest-with-service.js +6 -7
- package/dist/es/utils/helpers.js +10 -6
- package/dist/es/utils/history.js +7 -3
- package/dist/es/utils/log-records.js +34 -31
- package/dist/es/utils/micro-frontend/console-logger.js +17 -13
- package/dist/es/utils/micro-frontend/guest.js +52 -108
- package/dist/es/utils/micro-frontend/host.js +53 -89
- package/dist/es/utils/micro-frontend/index.js +39 -37
- package/dist/es/utils/micro-frontend/types.js +0 -1
- package/dist/es/utils/redact-pii.js +10 -11
- package/dist/es/utils/service-worker.js +14 -11
- package/dist/es/utils/session.js +47 -48
- package/dist/es/utils/storybook/manager.js +8 -5
- package/dist/es/utils/storybook/preview.js +30 -26
- package/dist/es/utils/storybook/theme.js +9 -6
- package/dist/es/utils/testing/index.js +14 -21
- package/dist/es/utils/testing/render-with-redux.js +13 -13
- package/dist/es/utils/testing/render-with-router-redux.js +19 -21
- package/dist/es/utils/testing/render-with-router.js +14 -16
- package/dist/es/utils/testing/render-with-state-addons.js +18 -18
- package/dist/es/utils/url.js +7 -3
- package/dist/es/utils/web-storage.js +21 -17
- package/dist/es/utils/window.js +18 -18
- package/dist/es/view/app-root/hosted-app.js +13 -17
- package/dist/es/view/app-root/index.js +34 -39
- package/dist/es/view/app-root/stand-alone-app.js +17 -19
- package/dist/es/view/app-root/style.js +30 -5
- package/dist/es/view/error-boundary/default-error-template.js +4 -5
- package/dist/es/view/error-boundary/index.js +20 -27
- package/dist/es/view/error-toast/index.js +21 -16
- package/dist/es/view/fetch-host-app-data/index.js +13 -13
- package/dist/es/view/fetch-host-app-data/store.js +10 -7
- package/dist/es/view/fields/check-box/index.js +16 -18
- package/dist/es/view/fields/combo-box/index.js +19 -19
- package/dist/es/view/fields/connect-form.js +8 -6
- package/dist/es/view/fields/date-input/index.js +16 -14
- package/dist/es/view/fields/date-picker/index.js +16 -14
- package/dist/es/view/fields/form-item-layout/index.js +15 -16
- package/dist/es/view/fields/input-mask/index.js +20 -14
- package/dist/es/view/fields/large-text-box/index.js +16 -14
- package/dist/es/view/fields/radio/index.js +16 -18
- package/dist/es/view/fields/radio-group/index.js +14 -15
- package/dist/es/view/fields/text-box/index.js +16 -14
- package/dist/es/view/fields/watch-value.js +19 -24
- package/dist/es/view/form/index.js +22 -22
- package/dist/es/view/form/personal-info-section.js +31 -52
- package/dist/es/view/form/submit-button/index.js +12 -10
- package/dist/es/view/guest-unload-handlers/index.js +11 -10
- package/dist/es/view/header/center-region/index.js +40 -23
- package/dist/es/view/header/index.js +19 -19
- package/dist/es/view/header/logo-region/index.js +9 -10
- package/dist/es/view/header/nav-region/index.js +22 -15
- package/dist/es/view/header/nav-region/notification/index.js +6 -7
- package/dist/es/view/header/nav-region/user/index.js +6 -7
- package/dist/es/view/host-binding-events/index.js +7 -3
- package/dist/es/view/intro.stories.mdx +1 -1
- package/dist/es/view/live-message/index.js +13 -23
- package/dist/es/view/loadable/index.js +12 -15
- package/dist/es/view/login/index.js +14 -18
- package/dist/es/view/media-breakpoint/index.js +19 -17
- package/dist/es/view/message-to-host-app/index.js +11 -10
- package/dist/es/view/micro-app/app-factory/index.js +67 -86
- package/dist/es/view/micro-app/const.js +4 -1
- package/dist/es/view/micro-app/index.js +13 -11
- package/dist/es/view/micro-app/resources/manifest.js +19 -19
- package/dist/es/view/micro-app/resources/script.js +36 -36
- package/dist/es/view/micro-app/resources/style.js +23 -22
- package/dist/es/view/micro-app/types.js +0 -1
- package/dist/es/view/micro-app/use-app-will-render.js +32 -28
- package/dist/es/view/micro-app/utils.js +12 -14
- package/dist/es/view/micro-iframe-app/app.js +15 -22
- package/dist/es/view/micro-iframe-app/iframe/const.js +4 -1
- package/dist/es/view/micro-iframe-app/iframe/index.js +27 -32
- package/dist/es/view/micro-iframe-app/index.js +11 -12
- package/dist/es/view/micro-iframe-app/types.js +0 -1
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +16 -21
- package/dist/es/view/modals/error/index.js +12 -10
- package/dist/es/view/modals/navigation-prompt/index.js +12 -16
- package/dist/es/view/modals/session-expiry/customHooks.js +13 -15
- package/dist/es/view/modals/session-expiry/index.js +16 -24
- package/dist/es/view/modals/wait-message/html-wait-message.js +10 -10
- package/dist/es/view/modals/wait-message/index.js +31 -39
- package/dist/es/view/modals/wait-message/wait-message-launcher.js +9 -8
- package/dist/es/view/render-with-delay/index.js +7 -10
- package/dist/es/view/render-with-host-data/index.js +11 -15
- package/dist/es/view/session-timeout/index.js +21 -12
- package/dist/es/view/storybook/decorator.js +9 -7
- package/dist/es/view/use-previous.js +6 -3
- package/dist/es/view/useMediaBreakpoints/index.js +11 -9
- package/dist/es/view/visually-hidden/index.js +19 -10
- package/dist/es/view/window-size/index.js +12 -11
- package/dist/types/data/store.d.ts +1 -1
- package/dist/types/utils/storybook/main.d.cts +49 -0
- package/dist/types/utils/storybook/{middleware.d.ts → middleware.d.cts} +0 -0
- package/dist/types/utils/storybook/preview.d.ts +2 -2
- package/dist/types/utils/storybook/vite.d.cts +4 -0
- package/dist/types/utils/storybook/webpack.d.cts +16 -0
- package/dist/types/utils/testing/render-with-redux.d.ts +1 -1
- package/dist/types/utils/testing/render-with-router-redux.d.ts +1 -1
- package/dist/types/utils/window.d.ts +1 -1
- package/dist/types/view/visually-hidden/index.d.ts +1 -3
- package/package.json +8 -6
- package/dist/cjs/api/users/index.endpoint.js +0 -14
- package/dist/cjs/communication/http-client/tests/hello.endpoint.js +0 -14
- package/dist/cjs/communication/http-client/tests/private.endpoint.js +0 -14
- package/dist/cjs/view/error-toast/index.stories.js +0 -128
- package/dist/cjs/view/fields/check-box/index.stories.js +0 -64
- package/dist/cjs/view/fields/check-box/set-value.stories.js +0 -83
- package/dist/cjs/view/fields/combo-box/index.stories.js +0 -65
- package/dist/cjs/view/fields/date-input/index.stories.js +0 -53
- package/dist/cjs/view/fields/date-input/index1.stories.js +0 -53
- package/dist/cjs/view/fields/date-picker/index.stories.js +0 -53
- package/dist/cjs/view/fields/form-item-layout/index.stories.js +0 -43
- package/dist/cjs/view/fields/input-mask/index.stories.js +0 -52
- package/dist/cjs/view/fields/large-text-box/index.stories.js +0 -47
- package/dist/cjs/view/fields/radio/index.stories.js +0 -60
- package/dist/cjs/view/fields/radio/set-value.stories.js +0 -81
- package/dist/cjs/view/fields/radio-group/index.stories.js +0 -85
- package/dist/cjs/view/fields/text-box/index.stories.js +0 -48
- package/dist/cjs/view/form/index.stories.js +0 -71
- package/dist/cjs/view/form/usecases.stories.js +0 -59
- package/dist/cjs/view/header/index.stories.js +0 -24
- package/dist/cjs/view/live-message/index.stories.js +0 -53
- package/dist/cjs/view/media-breakpoint/index.stories.js +0 -24
- package/dist/cjs/view/modals/error/index.stories.js +0 -36
- package/dist/cjs/view/modals/navigation-prompt/index.stories.js +0 -32
- package/dist/cjs/view/modals/session-expiry/index.stories.js +0 -30
- package/dist/cjs/view/modals/wait-message/index.stories.js +0 -47
- package/dist/cjs/view/session-timeout/index.stories.js +0 -28
- package/dist/es/api/users/index.endpoint.js +0 -14
- package/dist/es/communication/http-client/tests/hello.endpoint.js +0 -14
- package/dist/es/communication/http-client/tests/private.endpoint.js +0 -14
- package/dist/es/utils/storybook/main.js +0 -38
- package/dist/es/utils/storybook/middleware.js +0 -9
- package/dist/es/view/error-toast/index.stories.js +0 -108
- package/dist/es/view/fields/check-box/index.stories.js +0 -47
- package/dist/es/view/fields/check-box/set-value.stories.js +0 -65
- package/dist/es/view/fields/combo-box/index.stories.js +0 -48
- package/dist/es/view/fields/date-input/index.stories.js +0 -35
- package/dist/es/view/fields/date-input/index1.stories.js +0 -35
- package/dist/es/view/fields/date-picker/index.stories.js +0 -35
- package/dist/es/view/fields/form-item-layout/index.stories.js +0 -27
- package/dist/es/view/fields/input-mask/index.stories.js +0 -35
- package/dist/es/view/fields/large-text-box/index.stories.js +0 -30
- package/dist/es/view/fields/radio/index.stories.js +0 -43
- package/dist/es/view/fields/radio/set-value.stories.js +0 -63
- package/dist/es/view/fields/radio-group/index.stories.js +0 -68
- package/dist/es/view/fields/text-box/index.stories.js +0 -31
- package/dist/es/view/form/index.stories.js +0 -56
- package/dist/es/view/form/usecases.stories.js +0 -43
- package/dist/es/view/header/index.stories.js +0 -14
- package/dist/es/view/live-message/index.stories.js +0 -32
- package/dist/es/view/media-breakpoint/index.stories.js +0 -10
- package/dist/es/view/modals/error/index.stories.js +0 -21
- package/dist/es/view/modals/navigation-prompt/index.stories.js +0 -18
- package/dist/es/view/modals/session-expiry/index.stories.js +0 -18
- package/dist/es/view/modals/wait-message/index.stories.js +0 -33
- package/dist/es/view/session-timeout/index.stories.js +0 -13
- package/dist/types/utils/storybook/main.d.ts +0 -30
- package/dist/types/view/fields/date-input/index1.stories.d.ts +0 -24
package/dist/es/data/reducers.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { combineReducers } from
|
|
2
|
-
import { waitMessageReducer } from "./wait-message/reducer
|
|
3
|
-
import { errorReducer } from "./error
|
|
4
|
-
import { breakpointReducer } from "./breakpoint
|
|
5
|
-
import { liveMessageReducer } from "./live-message
|
|
6
|
-
|
|
1
|
+
import { combineReducers } from "@reduxjs/toolkit";
|
|
2
|
+
import { waitMessageReducer } from "./wait-message/reducer";
|
|
3
|
+
import { errorReducer } from "./error";
|
|
4
|
+
import { breakpointReducer } from "./breakpoint";
|
|
5
|
+
import { liveMessageReducer } from "./live-message";
|
|
6
|
+
const createReducer = (injectedReducers = {}) => {
|
|
7
7
|
const rootReducer = combineReducers({
|
|
8
8
|
waitMessage: waitMessageReducer,
|
|
9
9
|
error: errorReducer,
|
|
@@ -12,4 +12,7 @@ export const createReducer = (injectedReducers = {}) => {
|
|
|
12
12
|
...injectedReducers
|
|
13
13
|
});
|
|
14
14
|
return rootReducer;
|
|
15
|
-
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
createReducer
|
|
18
|
+
};
|
package/dist/es/data/saga.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
RestartOnRemount:
|
|
3
|
-
Daemon:
|
|
4
|
-
OnceTillUnmount:
|
|
5
|
-
};
|
|
1
|
+
const AllowedModes = {
|
|
2
|
+
RestartOnRemount: "RESTART_ON_REMOUNT",
|
|
3
|
+
Daemon: "DAEMON",
|
|
4
|
+
OnceTillUnmount: "ONCE_TILL_UNMOUNT"
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
AllowedModes
|
|
8
|
+
};
|
package/dist/es/data/store.js
CHANGED
|
@@ -1,67 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { routerMiddleware } from 'connected-react-router';
|
|
6
|
-
import createSagaMiddleware from 'redux-saga';
|
|
7
|
-
import { createReducer } from "./reducers.js";
|
|
1
|
+
import { configureStore } from "@reduxjs/toolkit";
|
|
2
|
+
import { createInjectorsEnhancer, forceReducerReload } from "redux-injectors";
|
|
3
|
+
import createSagaMiddleware from "redux-saga";
|
|
4
|
+
import { createReducer } from "./reducers";
|
|
8
5
|
const rootReducer = createReducer();
|
|
9
|
-
// global variable
|
|
10
6
|
let appStore = null;
|
|
11
|
-
|
|
7
|
+
const setStore = (store) => {
|
|
12
8
|
appStore = store;
|
|
13
9
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const enhancers = [createInjectorsEnhancer({
|
|
24
|
-
createReducer,
|
|
25
|
-
runSaga
|
|
26
|
-
})];
|
|
10
|
+
const getStore = () => appStore;
|
|
11
|
+
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = { thunk: false }) => {
|
|
12
|
+
const { run: runSaga } = sagaMiddleware;
|
|
13
|
+
const enhancers = [
|
|
14
|
+
createInjectorsEnhancer({
|
|
15
|
+
createReducer,
|
|
16
|
+
runSaga
|
|
17
|
+
})
|
|
18
|
+
];
|
|
27
19
|
const baseStore = configureStore({
|
|
28
20
|
reducer: rootReducer,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat(routerMiddleware(history)),
|
|
32
|
-
devTools: process.env.NODE_ENV !== 'production',
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34
|
-
// @ts-ignore
|
|
21
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware),
|
|
22
|
+
devTools: true,
|
|
35
23
|
preloadedState: initialState,
|
|
36
24
|
enhancers
|
|
37
25
|
});
|
|
38
26
|
let hotModule = null;
|
|
39
|
-
|
|
40
27
|
try {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
|
|
28
|
+
hotModule = module?.hot;
|
|
44
29
|
} catch (err) {
|
|
45
|
-
|
|
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
|
|
30
|
+
hotModule = import.meta?.webpackHot;
|
|
51
31
|
}
|
|
52
|
-
|
|
53
32
|
if (hotModule) {
|
|
54
|
-
hotModule.accept(
|
|
33
|
+
hotModule.accept("./reducers", () => {
|
|
55
34
|
forceReducerReload(baseStore);
|
|
56
35
|
});
|
|
57
36
|
}
|
|
58
|
-
|
|
59
37
|
return baseStore;
|
|
60
38
|
};
|
|
61
|
-
|
|
62
|
-
export const createAppStore = (initialState = {}, history, middlewareConfig) => {
|
|
39
|
+
const createAppStore = (initialState = {}, history, middlewareConfig) => {
|
|
63
40
|
const sagaMiddleware = createSagaMiddleware({});
|
|
64
41
|
const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
|
|
65
42
|
setStore(store);
|
|
66
43
|
return store;
|
|
67
|
-
};
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
createAppStore,
|
|
47
|
+
getStore,
|
|
48
|
+
setStore
|
|
49
|
+
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
OPEN:
|
|
3
|
-
CLOSE:
|
|
1
|
+
const ACTIONS = {
|
|
2
|
+
OPEN: "wait-message/OPEN",
|
|
3
|
+
CLOSE: "wait-message/CLOSE"
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
open: (message =
|
|
5
|
+
const waitMessage = {
|
|
6
|
+
open: (message = "loading...") => ({
|
|
7
7
|
type: ACTIONS.OPEN,
|
|
8
|
-
payload: {
|
|
9
|
-
message
|
|
10
|
-
}
|
|
8
|
+
payload: { message }
|
|
11
9
|
}),
|
|
12
10
|
close: () => ({
|
|
13
11
|
type: ACTIONS.CLOSE,
|
|
14
12
|
payload: null
|
|
15
13
|
})
|
|
16
|
-
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
ACTIONS,
|
|
17
|
+
waitMessage
|
|
18
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// The initial state of the App
|
|
5
|
-
export const initialState = {
|
|
1
|
+
import produce from "immer";
|
|
2
|
+
import { ACTIONS } from "./actions";
|
|
3
|
+
const initialState = {
|
|
6
4
|
isOpen: null,
|
|
7
|
-
message:
|
|
5
|
+
message: "loading..."
|
|
8
6
|
};
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line default-case
|
|
7
|
+
const waitMessageReducer = (state = initialState, action) => produce(state, (draft) => {
|
|
11
8
|
switch (action.type) {
|
|
12
9
|
case ACTIONS.OPEN:
|
|
13
10
|
draft.isOpen = true;
|
|
14
11
|
draft.message = action.payload.message;
|
|
15
12
|
break;
|
|
16
|
-
|
|
17
13
|
case ACTIONS.CLOSE:
|
|
18
14
|
draft.isOpen = false;
|
|
19
15
|
break;
|
|
20
16
|
}
|
|
21
|
-
});
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
initialState,
|
|
20
|
+
waitMessageReducer
|
|
21
|
+
};
|
package/dist/es/index.js
CHANGED
|
@@ -1,84 +1,183 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
import { isUserAuthorized, login, authorize } from "./utils/auth";
|
|
2
|
+
import { PrivateRoute } from "./route/private-route";
|
|
3
|
+
import { AppRoute } from "./route";
|
|
4
|
+
import { getHTTPClient, getAuthHTTPClient } from "./communication/http-client";
|
|
5
|
+
import { onAuthorizationFailure } from "./communication/http-client/response-interceptor";
|
|
6
|
+
import { auth } from "./data/auth/actions";
|
|
7
|
+
import { default as default2 } from "./utils/constants";
|
|
8
|
+
import { useAppDispatch, useAppSelector } from "./data/react-redux";
|
|
9
|
+
import { useInjectReducer, useInjectSaga } from "redux-injectors";
|
|
10
|
+
import { getAuthorizationHeader } from "./utils/auth/helper";
|
|
11
|
+
import { getRedirectUrl, removeDoubleSlash } from "./utils/url";
|
|
12
|
+
import { createAppStore } from "./data/store";
|
|
13
|
+
import { browserHistory, memoryHistory } from "./utils/history";
|
|
14
|
+
import { Themes } from "./utils/constants";
|
|
15
|
+
import { ACTIONS } from "./data/navigation-prompt/actions";
|
|
16
|
+
import { loadable } from "./view/loadable";
|
|
17
|
+
import { WaitMessage } from "./view/modals/wait-message";
|
|
18
|
+
import { SessionTimeout } from "./view/session-timeout";
|
|
19
|
+
import {
|
|
20
|
+
subscribeToSessionExpiryWarning,
|
|
21
|
+
subscribeToSessionExpiry,
|
|
22
|
+
resetUserIdleTime,
|
|
23
|
+
trackActivity
|
|
24
|
+
} from "./utils/session";
|
|
25
|
+
import { waitMessage } from "./data/wait-message/actions";
|
|
26
|
+
import { initServiceWorker } from "./utils/service-worker";
|
|
27
|
+
import { CMicroAppGuest } from "./utils/micro-frontend/guest";
|
|
28
|
+
import { CMicroAppHost } from "./utils/micro-frontend/host";
|
|
29
|
+
import { enableReactAppForHostIntegration } from "./utils/app-host-integration/react";
|
|
30
|
+
import {
|
|
31
|
+
getAppConfigValue,
|
|
32
|
+
setAppConfigValue,
|
|
33
|
+
setAppConfig
|
|
34
|
+
} from "./utils/app-config/config";
|
|
35
|
+
import { getMicroFrontEndAppConfig } from "./utils/micro-frontend";
|
|
36
|
+
import { loadAppConfig } from "./utils/app-config";
|
|
37
|
+
import { AppRoot } from "./view/app-root";
|
|
38
|
+
import { ErrorBoundary } from "./view/error-boundary";
|
|
39
|
+
import { isProd, isCIBuild } from "./utils/helpers";
|
|
40
|
+
import { listenStorageEvents, removeStorageEvents } from "./utils/web-storage";
|
|
41
|
+
import {
|
|
42
|
+
getHostAppDataByKey,
|
|
43
|
+
setHostAppData
|
|
44
|
+
} from "./view/fetch-host-app-data/store";
|
|
45
|
+
import { sendMessageToHost } from "./view/message-to-host-app";
|
|
46
|
+
import {
|
|
47
|
+
onGuestUnloadStart,
|
|
48
|
+
notifyGuestUnloadComplete
|
|
49
|
+
} from "./view/guest-unload-handlers";
|
|
50
|
+
import { renderWithHostData } from "./view/render-with-host-data";
|
|
51
|
+
import { fetchHostAppData } from "./view/fetch-host-app-data";
|
|
52
|
+
export * from "./utils/testing";
|
|
53
|
+
import { renderWithRouterRedux } from "./utils/testing/render-with-router-redux";
|
|
54
|
+
import { renderWithRedux } from "./utils/testing/render-with-redux";
|
|
55
|
+
import { renderWithRouter } from "./utils/testing/render-with-router";
|
|
56
|
+
import { RenderWithStateAddOns } from "./utils/testing/render-with-state-addons";
|
|
57
|
+
import { getApiActionCreator, getSelectField } from "./api/helpers";
|
|
58
|
+
import { getUser } from "./api/users";
|
|
59
|
+
import { useMediaBreakpoints } from "./view/useMediaBreakpoints";
|
|
60
|
+
import { withAppDecorator } from "./view/storybook/decorator";
|
|
61
|
+
import { Header } from "./view/header";
|
|
62
|
+
import { ErrorToast } from "./view/error-toast";
|
|
63
|
+
import { Form } from "./view/form";
|
|
64
|
+
import { ConnectForm } from "./view/fields/connect-form";
|
|
65
|
+
import { FormItemLayout } from "./view/fields/form-item-layout";
|
|
66
|
+
import { TextBox } from "./view/fields/text-box";
|
|
67
|
+
import { LargeTextBox } from "./view/fields/large-text-box";
|
|
68
|
+
import { InputMask, MASK_TYPES, MASK_PIPES } from "./view/fields/input-mask";
|
|
69
|
+
import { ComboBox } from "./view/fields/combo-box";
|
|
70
|
+
import { CheckBox } from "./view/fields/check-box";
|
|
71
|
+
import { Radio } from "./view/fields/radio";
|
|
72
|
+
import { RadioGroup } from "./view/fields/radio-group";
|
|
73
|
+
import { DateInput } from "./view/fields/date-input";
|
|
74
|
+
import { DatePicker } from "./view/fields/date-picker";
|
|
75
|
+
import { FormSubmitButton } from "./view/form/submit-button";
|
|
76
|
+
import { MediaBreakpoint } from "./view/media-breakpoint";
|
|
77
|
+
import { VisuallyHidden } from "./view/visually-hidden";
|
|
78
|
+
import { actions } from "./data/live-message";
|
|
79
|
+
import { actions as actions2 } from "./data/error";
|
|
80
|
+
import { actions as actions3 } from "./data/logout/actions";
|
|
81
|
+
import { MicroApp } from "./view/micro-app";
|
|
82
|
+
import { MicroIFrameApp } from "./view/micro-iframe-app";
|
|
83
|
+
import { getNavigationLinks } from "./view/micro-app/utils";
|
|
84
|
+
import { getStore } from "./data/store";
|
|
85
|
+
import { RegisterService } from "./utils/guest-with-service";
|
|
86
|
+
import { setAppDynamicsUserData } from "./analytics/appdynamics";
|
|
87
|
+
import { sendBAEvent } from "./analytics";
|
|
88
|
+
import { updateBAEventParameters } from "./analytics/web-analytics";
|
|
89
|
+
import { redactPii } from "./utils/redact-pii";
|
|
90
|
+
export {
|
|
91
|
+
AppRoot,
|
|
92
|
+
CMicroAppGuest,
|
|
93
|
+
CMicroAppHost,
|
|
94
|
+
CheckBox,
|
|
95
|
+
ComboBox,
|
|
96
|
+
ConnectForm,
|
|
97
|
+
DateInput,
|
|
98
|
+
DatePicker,
|
|
99
|
+
ErrorBoundary,
|
|
100
|
+
ErrorToast,
|
|
101
|
+
Form,
|
|
102
|
+
FormItemLayout,
|
|
103
|
+
FormSubmitButton,
|
|
104
|
+
Header,
|
|
105
|
+
InputMask,
|
|
106
|
+
LargeTextBox,
|
|
107
|
+
MASK_PIPES,
|
|
108
|
+
MASK_TYPES,
|
|
109
|
+
MediaBreakpoint,
|
|
110
|
+
MicroApp,
|
|
111
|
+
MicroIFrameApp,
|
|
112
|
+
ACTIONS as NavigationPromptActions,
|
|
113
|
+
PrivateRoute,
|
|
114
|
+
Radio,
|
|
115
|
+
RadioGroup,
|
|
116
|
+
RegisterService,
|
|
117
|
+
RenderWithStateAddOns,
|
|
118
|
+
AppRoute as Route,
|
|
119
|
+
SessionTimeout,
|
|
120
|
+
TextBox,
|
|
121
|
+
Themes,
|
|
122
|
+
VisuallyHidden,
|
|
123
|
+
WaitMessage,
|
|
124
|
+
actions as ariaLive,
|
|
125
|
+
auth,
|
|
126
|
+
authorize,
|
|
127
|
+
createAppStore as configureStore,
|
|
128
|
+
enableReactAppForHostIntegration,
|
|
129
|
+
actions2 as error,
|
|
130
|
+
fetchHostAppData,
|
|
131
|
+
getUser as fetchUserSettings,
|
|
132
|
+
getApiActionCreator,
|
|
133
|
+
getAppConfigValue,
|
|
134
|
+
getAuthHTTPClient,
|
|
135
|
+
getAuthorizationHeader,
|
|
136
|
+
getHTTPClient,
|
|
137
|
+
getHostAppDataByKey,
|
|
138
|
+
getMicroFrontEndAppConfig,
|
|
139
|
+
getNavigationLinks,
|
|
140
|
+
getRedirectUrl,
|
|
141
|
+
getSelectField,
|
|
142
|
+
getStore,
|
|
143
|
+
default2 as globalConstants,
|
|
144
|
+
browserHistory as history,
|
|
145
|
+
initServiceWorker,
|
|
146
|
+
isCIBuild,
|
|
147
|
+
isProd,
|
|
148
|
+
isUserAuthorized,
|
|
149
|
+
listenStorageEvents,
|
|
150
|
+
loadAppConfig,
|
|
151
|
+
loadable,
|
|
152
|
+
login,
|
|
153
|
+
actions3 as logout,
|
|
154
|
+
memoryHistory,
|
|
155
|
+
notifyGuestUnloadComplete,
|
|
156
|
+
onAuthorizationFailure,
|
|
157
|
+
onGuestUnloadStart,
|
|
158
|
+
redactPii,
|
|
159
|
+
removeDoubleSlash,
|
|
160
|
+
removeStorageEvents,
|
|
161
|
+
renderWithHostData,
|
|
162
|
+
renderWithRedux,
|
|
163
|
+
renderWithRouter,
|
|
164
|
+
renderWithRouterRedux,
|
|
165
|
+
resetUserIdleTime,
|
|
166
|
+
sendBAEvent,
|
|
167
|
+
sendMessageToHost,
|
|
168
|
+
setAppConfig,
|
|
169
|
+
setAppConfigValue,
|
|
170
|
+
setAppDynamicsUserData,
|
|
171
|
+
setHostAppData,
|
|
172
|
+
subscribeToSessionExpiry,
|
|
173
|
+
subscribeToSessionExpiryWarning,
|
|
174
|
+
trackActivity,
|
|
175
|
+
updateBAEventParameters,
|
|
176
|
+
useAppDispatch,
|
|
177
|
+
useAppSelector,
|
|
178
|
+
useInjectReducer,
|
|
179
|
+
useInjectSaga,
|
|
180
|
+
useMediaBreakpoints,
|
|
181
|
+
waitMessage as waitMessageAction,
|
|
182
|
+
withAppDecorator
|
|
183
|
+
};
|
package/dist/es/route/index.js
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export const AppRoute = ({
|
|
1
|
+
import { Helmet } from "react-helmet";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { Route } from "react-router-dom";
|
|
4
|
+
import { onPageView } from "./page-view";
|
|
5
|
+
const AppRoute = ({
|
|
10
6
|
component: Component,
|
|
11
7
|
render,
|
|
12
8
|
children,
|
|
13
|
-
pageTitle =
|
|
9
|
+
pageTitle = "ICE",
|
|
14
10
|
...rest
|
|
15
11
|
}) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const memoizedRender = useCallback(routeProps => render && typeof render === 'function' ? render(routeProps) : Component && /*#__PURE__*/_jsx(Component, { ...routeProps
|
|
12
|
+
const memoizedRender = useCallback((routeProps) => render && typeof render === "function" ? render(routeProps) : Component && /* @__PURE__ */ React.createElement(Component, {
|
|
13
|
+
...routeProps
|
|
19
14
|
}), [Component, render]);
|
|
20
|
-
return
|
|
21
|
-
|
|
15
|
+
return /* @__PURE__ */ React.createElement(Route, {
|
|
16
|
+
...rest,
|
|
17
|
+
render: (routeProps) => {
|
|
22
18
|
onPageView(pageTitle);
|
|
23
|
-
return
|
|
24
|
-
children: [_Helmet || (_Helmet = /*#__PURE__*/_jsx2(Helmet, {}, void 0, /*#__PURE__*/_jsx2("title", {}, void 0, pageTitle))), children || memoizedRender(routeProps)]
|
|
25
|
-
});
|
|
19
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Helmet, null, /* @__PURE__ */ React.createElement("title", null, pageTitle)), children || memoizedRender(routeProps));
|
|
26
20
|
}
|
|
27
21
|
});
|
|
28
|
-
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
AppRoute
|
|
25
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as brum from
|
|
2
|
-
import { pageViewEvent } from "../analytics/page-view-event
|
|
3
|
-
|
|
1
|
+
import * as brum from "@elliemae/pui-user-monitoring";
|
|
2
|
+
import { pageViewEvent } from "../analytics/page-view-event";
|
|
3
|
+
const onPageView = (pageTitle) => {
|
|
4
4
|
try {
|
|
5
5
|
if (brum && pageTitle) {
|
|
6
6
|
brum.setCustomVirtualPageName(pageTitle);
|
|
7
7
|
brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
|
|
8
8
|
}
|
|
9
|
-
} catch {
|
|
9
|
+
} catch {
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
11
|
+
pageViewEvent({ pageTitle });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
onPageView
|
|
15
|
+
};
|
|
@@ -1,53 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const key = 'auth';
|
|
13
|
-
export const PrivateRoute = ({
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useInjectReducer, useInjectSaga } from "redux-injectors";
|
|
3
|
+
import enums from "../../utils/constants";
|
|
4
|
+
import { RenderWithDelay } from "../../view/render-with-delay";
|
|
5
|
+
import { authReducer } from "../../data/auth/reducer";
|
|
6
|
+
import { authentication } from "../../sideeffect/auth";
|
|
7
|
+
import { Login } from "../../view/login";
|
|
8
|
+
import { isUserAuthorized } from "../../utils/auth";
|
|
9
|
+
import { AppRoute } from "../index";
|
|
10
|
+
const key = "auth";
|
|
11
|
+
const PrivateRoute = ({
|
|
14
12
|
component: Component,
|
|
15
13
|
render,
|
|
16
14
|
children,
|
|
17
15
|
clientId = enums.CLIENT_ID,
|
|
18
|
-
scope =
|
|
19
|
-
responseType =
|
|
16
|
+
scope = "loc",
|
|
17
|
+
responseType = "code",
|
|
20
18
|
...rest
|
|
21
19
|
}) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
reducer: authReducer
|
|
27
|
-
});
|
|
28
|
-
useInjectSaga({
|
|
29
|
-
key,
|
|
30
|
-
saga: authentication
|
|
31
|
-
});
|
|
32
|
-
const memoizedRender = useCallback(routeProps => render && typeof render === 'function' ? render(routeProps) : Component && /*#__PURE__*/_jsx(Component, { ...routeProps
|
|
20
|
+
useInjectReducer({ key, reducer: authReducer });
|
|
21
|
+
useInjectSaga({ key, saga: authentication });
|
|
22
|
+
const memoizedRender = useCallback((routeProps) => render && typeof render === "function" ? render(routeProps) : Component && /* @__PURE__ */ React.createElement(Component, {
|
|
23
|
+
...routeProps
|
|
33
24
|
}), [Component, render]);
|
|
34
|
-
return
|
|
35
|
-
|
|
25
|
+
return /* @__PURE__ */ React.createElement(AppRoute, {
|
|
26
|
+
...rest,
|
|
27
|
+
render: (routeProps) => {
|
|
36
28
|
const userAuthorized = isUserAuthorized();
|
|
37
|
-
|
|
38
29
|
if (userAuthorized) {
|
|
39
30
|
return children || memoizedRender(routeProps);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return /*#__PURE__*/_jsx2(RenderWithDelay, {
|
|
32
|
+
const getAuthComp = () => /* @__PURE__ */ React.createElement(Login, {
|
|
33
|
+
clientId,
|
|
34
|
+
scope,
|
|
35
|
+
responseType
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ React.createElement(RenderWithDelay, {
|
|
49
38
|
render: getAuthComp
|
|
50
39
|
});
|
|
51
40
|
}
|
|
52
41
|
});
|
|
53
|
-
};
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
PrivateRoute
|
|
45
|
+
};
|