@commercetools-frontend/application-shell 21.23.10 → 21.24.1
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/application-entry-point-47d5c548.cjs.dev.js +116 -0
- package/dist/application-entry-point-5619d5aa.cjs.prod.js +99 -0
- package/dist/application-entry-point-dc726674.esm.js +101 -0
- package/dist/{box-dd9e7e68.esm.js → box-4395623b.esm.js} +1 -3
- package/dist/{box-fdb2ccb6.cjs.dev.js → box-6b5be9a9.cjs.dev.js} +1 -3
- package/dist/{box-d849ea03.cjs.prod.js → box-8850277f.cjs.prod.js} +1 -3
- package/dist/{cart-ad0aba9b.cjs.prod.js → cart-0698b97d.cjs.prod.js} +1 -3
- package/dist/{cart-b92f3a8e.cjs.dev.js → cart-41f0b7bc.cjs.dev.js} +1 -3
- package/dist/{cart-167fea3b.esm.js → cart-a49faf67.esm.js} +1 -3
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +49 -68
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +49 -68
- package/dist/commercetools-frontend-application-shell.esm.js +39 -58
- package/dist/configure-apollo-942ef373.cjs.prod.js +922 -0
- package/dist/configure-apollo-a6f03ff8.cjs.dev.js +930 -0
- package/dist/configure-apollo-cc0b1668.esm.js +873 -0
- package/dist/{connected-square-4743b7de.esm.js → connected-square-3cac6bd7.esm.js} +1 -3
- package/dist/connected-square-47233754.cjs.dev.js +32 -0
- package/dist/connected-square-b2e25621.cjs.prod.js +32 -0
- package/dist/{constants-69249abd.esm.js → constants-7f04db3f.esm.js} +9 -9
- package/dist/{constants-88fb9ef8.cjs.prod.js → constants-e6409334.cjs.prod.js} +8 -8
- package/dist/{constants-c2d56f3d.cjs.dev.js → constants-e6f058e5.cjs.dev.js} +8 -8
- package/dist/declarations/src/apollo-links/utils.d.ts +2 -2
- package/dist/declarations/src/components/application-entry-point/application-entry-point.d.ts +4 -4
- package/dist/declarations/src/components/application-shell/application-shell.d.ts +7 -15
- package/dist/declarations/src/components/application-shell-authenticated/application-shell-authenticated.d.ts +21 -0
- package/dist/declarations/src/components/application-shell-provider/application-shell-provider.d.ts +6 -7
- package/dist/declarations/src/components/application-shell-provider/use-coerced-environment-values.d.ts +1 -23
- package/dist/declarations/src/components/authenticated/authenticated.d.ts +2 -2
- package/dist/declarations/src/components/authenticated/oidc-callback.async.d.ts +6 -0
- package/dist/declarations/src/components/authenticated/oidc-callback.d.ts +2 -2
- package/dist/declarations/src/components/configure-intl-provider/configure-intl-provider.d.ts +1 -1
- package/dist/declarations/src/components/error-apologizer/index.d.ts +6 -1
- package/dist/declarations/src/components/fetch-project/fetch-project.d.ts +4 -4
- package/dist/declarations/src/components/fetch-user/fetch-user.d.ts +3 -3
- package/dist/declarations/src/components/inject-reducers/inject-reducers.d.ts +1 -1
- package/dist/declarations/src/components/navbar/index.d.ts +100 -1
- package/dist/declarations/src/components/navbar/loading-navbar.d.ts +5 -0
- package/dist/declarations/src/components/navbar/menu-items.d.ts +99 -0
- package/dist/declarations/src/components/navbar/navbar.d.ts +6 -15
- package/dist/declarations/src/components/project-container/index.d.ts +78 -1
- package/dist/declarations/src/components/project-container/project-container.d.ts +6 -8
- package/dist/declarations/src/components/quick-access/butler-command/butler-command.d.ts +1 -1
- package/dist/declarations/src/components/quick-access/index.d.ts +2 -2
- package/dist/declarations/src/components/quick-access/types.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-login/index.d.ts +6 -0
- package/dist/declarations/src/components/redirect-to-logout/index.d.ts +5 -0
- package/dist/declarations/src/components/redirect-to-project-create/index.d.ts +6 -1
- package/dist/declarations/src/components/requests-in-flight-loader/index.d.ts +6 -1
- package/dist/declarations/src/components/route-catch-all/index.d.ts +3 -1
- package/dist/declarations/src/components/setup-flop-flip-provider/setup-flop-flip-provider.d.ts +3 -3
- package/dist/declarations/src/components/suspended-route/suspended-route.d.ts +1 -1
- package/dist/declarations/src/components/user-settings-menu/index.d.ts +12 -1
- package/dist/declarations/src/components/version-tracker/index.d.ts +6 -1
- package/dist/declarations/src/hooks/apollo-hooks/apollo-hooks.d.ts +1 -1
- package/dist/declarations/src/test-utils/test-utils.d.ts +2 -2
- package/dist/declarations/src/types/generated/mc.d.ts +3 -3
- package/dist/declarations/src/utils/get-mc-origin/get-mc-origin.d.ts +2 -0
- package/dist/declarations/src/utils/get-mc-origin/index.d.ts +1 -0
- package/dist/error-apologizer-c336db61.cjs.dev.js +56 -0
- package/dist/error-apologizer-c55ec6f7.cjs.prod.js +56 -0
- package/dist/error-apologizer-f8772b68.esm.js +42 -0
- package/dist/gear-2890f7fb.cjs.prod.js +32 -0
- package/dist/{gear-8418cd46.esm.js → gear-300dd24c.esm.js} +1 -3
- package/dist/gear-e8014c5a.cjs.dev.js +32 -0
- package/dist/get-mc-origin-314b77a2.cjs.dev.js +57 -0
- package/dist/get-mc-origin-5df60933.esm.js +50 -0
- package/dist/get-mc-origin-7968e04f.cjs.prod.js +57 -0
- package/dist/heart-000a023d.cjs.prod.js +32 -0
- package/dist/{heart-48c28091.esm.js → heart-dded66b4.esm.js} +1 -3
- package/dist/heart-f21b7d39.cjs.dev.js +32 -0
- package/dist/index-3765c4c9.cjs.prod.js +2870 -0
- package/dist/index-3fdf5681.esm.js +2970 -0
- package/dist/index-b9b8b690.cjs.dev.js +3054 -0
- package/dist/{list-with-search-c154a56e.esm.js → list-with-search-a3302710.esm.js} +1 -3
- package/dist/list-with-search-a5b72b33.cjs.prod.js +32 -0
- package/dist/list-with-search-ee796e9e.cjs.dev.js +32 -0
- package/dist/navbar-08a76df9.cjs.dev.js +670 -0
- package/dist/navbar-5384b0c3.esm.js +650 -0
- package/dist/navbar-c02843fb.cjs.prod.js +649 -0
- package/dist/oidc-0638d0c8.cjs.dev.js +67 -0
- package/dist/oidc-10fa96f0.esm.js +59 -0
- package/dist/oidc-540a091a.cjs.prod.js +67 -0
- package/dist/oidc-callback-152dc622.esm.js +240 -0
- package/dist/oidc-callback-784c3a39.cjs.prod.js +251 -0
- package/dist/oidc-callback-dc8682c0.cjs.dev.js +254 -0
- package/dist/paperclip-23d1e69c.cjs.prod.js +32 -0
- package/dist/{paperclip-18785dda.esm.js → paperclip-a61112e8.esm.js} +1 -3
- package/dist/paperclip-d653c134.cjs.dev.js +32 -0
- package/dist/plugin-0ee6aee4.cjs.dev.js +32 -0
- package/dist/{plugin-53c047bb.esm.js → plugin-3d353a5b.esm.js} +1 -3
- package/dist/plugin-7e57f237.cjs.prod.js +32 -0
- package/dist/project-container-6f0ea904.cjs.dev.js +387 -0
- package/dist/project-container-b6b2f6b2.esm.js +368 -0
- package/dist/project-container-bf8678e2.cjs.prod.js +369 -0
- package/dist/{project-expired-d8eaa253.esm.js → project-expired-6b9b6feb.esm.js} +47 -68
- package/dist/{project-expired-adce523b.cjs.dev.js → project-expired-9d71c314.cjs.dev.js} +47 -68
- package/dist/{project-expired-576a8329.cjs.prod.js → project-expired-d75d9e84.cjs.prod.js} +47 -68
- package/dist/{project-not-found-9a9753f2.cjs.dev.js → project-not-found-4b5b9479.cjs.prod.js} +42 -61
- package/dist/{project-not-found-8208c8f1.esm.js → project-not-found-c4634d60.esm.js} +42 -61
- package/dist/{project-not-found-daa5200b.cjs.prod.js → project-not-found-c977dbb0.cjs.dev.js} +42 -61
- package/dist/{project-not-initialized-4aeafe19.cjs.dev.js → project-not-initialized-4d0badf3.cjs.prod.js} +47 -68
- package/dist/{project-not-initialized-3408e87f.esm.js → project-not-initialized-a2f7b46e.esm.js} +47 -68
- package/dist/{project-not-initialized-5b416bcf.cjs.prod.js → project-not-initialized-e1533577.cjs.dev.js} +47 -68
- package/dist/{project-suspended-d3a6001d.cjs.dev.js → project-suspended-9027fc60.cjs.prod.js} +44 -63
- package/dist/{project-suspended-dc9ace34.cjs.prod.js → project-suspended-9e084c21.cjs.dev.js} +44 -63
- package/dist/{project-suspended-a7edc962.esm.js → project-suspended-f3d78447.esm.js} +44 -63
- package/dist/{quick-access-f42a8e0a.cjs.prod.js → quick-access-517ad7e1.cjs.prod.js} +573 -957
- package/dist/quick-access-82e1c9aa.esm.js +1907 -0
- package/dist/quick-access-8b2b678f.cjs.dev.js +1937 -0
- package/dist/redirect-to-login-1b892ab5.esm.js +147 -0
- package/dist/redirect-to-login-2be0e5db.cjs.prod.js +149 -0
- package/dist/redirect-to-login-64230f67.cjs.dev.js +149 -0
- package/dist/redirect-to-logout-15810ffb.cjs.dev.js +151 -0
- package/dist/redirect-to-logout-17e4ba2c.cjs.prod.js +151 -0
- package/dist/redirect-to-logout-80e772d1.esm.js +138 -0
- package/dist/redirect-to-project-create-048efa71.cjs.prod.js +61 -0
- package/dist/redirect-to-project-create-052f293e.esm.js +52 -0
- package/dist/redirect-to-project-create-f0e7b35e.cjs.dev.js +61 -0
- package/dist/{gear-28ff4f04.cjs.dev.js → redirector-0d98f9df.cjs.dev.js} +44 -5
- package/dist/redirector-47a6be71.esm.js +58 -0
- package/dist/{gear-6f8c30e3.cjs.prod.js → redirector-77ce2f5c.cjs.prod.js} +44 -5
- package/dist/requests-in-flight-loader-5329586b.esm.js +129 -0
- package/dist/requests-in-flight-loader-88f14402.cjs.dev.js +144 -0
- package/dist/requests-in-flight-loader-a7bc4e12.cjs.prod.js +144 -0
- package/dist/rocket-3e3f0a98.cjs.prod.js +32 -0
- package/dist/{rocket-ba116b5e.esm.js → rocket-4b088727.esm.js} +1 -3
- package/dist/rocket-95b6858d.cjs.dev.js +32 -0
- package/dist/route-catch-all-01cf0095.esm.js +41 -0
- package/dist/route-catch-all-3b490df1.cjs.prod.js +43 -0
- package/dist/route-catch-all-9ac99936.cjs.dev.js +43 -0
- package/dist/{service-page-project-switcher-49afafeb.cjs.prod.js → service-page-project-switcher-39dcfee8.cjs.prod.js} +5 -7
- package/dist/{service-page-project-switcher-866b2139.cjs.dev.js → service-page-project-switcher-7698339b.cjs.dev.js} +6 -8
- package/dist/{service-page-project-switcher-365c4c10.esm.js → service-page-project-switcher-fd30959b.esm.js} +6 -8
- package/dist/{speedometer-c1b94505.esm.js → speedometer-08a11d5a.esm.js} +1 -3
- package/dist/speedometer-2881cef6.cjs.prod.js +32 -0
- package/dist/speedometer-54f872f2.cjs.dev.js +32 -0
- package/dist/{star-da9123e0.esm.js → star-15244db1.esm.js} +1 -3
- package/dist/star-52bf7a64.cjs.dev.js +32 -0
- package/dist/star-f8502efb.cjs.prod.js +32 -0
- package/dist/tag-multi-1d1553b6.cjs.dev.js +32 -0
- package/dist/{tag-multi-c650b738.esm.js → tag-multi-3be995ac.esm.js} +1 -3
- package/dist/tag-multi-f9acb1c2.cjs.prod.js +32 -0
- package/dist/tree-structure-4650688d.cjs.dev.js +32 -0
- package/dist/{tree-structure-6af6fc3a.esm.js → tree-structure-c8753526.esm.js} +1 -3
- package/dist/tree-structure-f24ee3f6.cjs.prod.js +32 -0
- package/dist/use-applications-menu-4abb5796.esm.js +172 -0
- package/dist/use-applications-menu-68d83733.cjs.dev.js +188 -0
- package/dist/use-applications-menu-6b872b83.cjs.prod.js +188 -0
- package/dist/use-is-served-by-proxy-2b4916e5.cjs.dev.js +42 -0
- package/dist/use-is-served-by-proxy-499bfa16.esm.js +39 -0
- package/dist/use-is-served-by-proxy-51e76976.cjs.prod.js +42 -0
- package/dist/{user-filled-41729d77.esm.js → user-filled-2dc4e79e.esm.js} +1 -3
- package/dist/user-filled-2e6cb25e.cjs.dev.js +32 -0
- package/dist/user-filled-815b49a0.cjs.prod.js +32 -0
- package/dist/user-settings-menu-79d4cb1e.cjs.dev.js +523 -0
- package/dist/user-settings-menu-7bf6f146.cjs.prod.js +496 -0
- package/dist/user-settings-menu-ad7c27f0.esm.js +497 -0
- package/dist/version-tracker-20bb239d.esm.js +101 -0
- package/dist/version-tracker-69607d15.cjs.dev.js +107 -0
- package/dist/version-tracker-80e0f8f6.cjs.prod.js +107 -0
- package/dist/world-973090a5.cjs.dev.js +32 -0
- package/dist/{world-d91df1ee.esm.js → world-c5ea311a.esm.js} +1 -3
- package/dist/world-e1f9dbf8.cjs.prod.js +32 -0
- package/package.json +27 -27
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -3
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -3
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -3
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +182 -215
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +182 -215
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +173 -206
- package/dist/application-entry-point-307baa50.cjs.prod.js +0 -1225
- package/dist/application-entry-point-3e14d46d.cjs.dev.js +0 -1250
- package/dist/application-entry-point-8d923438.esm.js +0 -1180
- package/dist/connected-square-abf36852.cjs.prod.js +0 -34
- package/dist/connected-square-ac52014f.cjs.dev.js +0 -34
- package/dist/declarations/src/components/application-shell/helpers.d.ts +0 -1
- package/dist/heart-33cd94c6.cjs.prod.js +0 -34
- package/dist/heart-fb31cf30.cjs.dev.js +0 -34
- package/dist/index-284fb405.esm.js +0 -4809
- package/dist/index-37414a3f.cjs.prod.js +0 -4643
- package/dist/index-ea32a85e.cjs.dev.js +0 -4888
- package/dist/list-with-search-34cd926c.cjs.dev.js +0 -34
- package/dist/list-with-search-a0b22169.cjs.prod.js +0 -34
- package/dist/oidc-1c91f5ee.cjs.prod.js +0 -67
- package/dist/oidc-5b2e4f8f.cjs.dev.js +0 -67
- package/dist/oidc-77749f1b.esm.js +0 -59
- package/dist/paperclip-2cd45b86.cjs.dev.js +0 -34
- package/dist/paperclip-b1b806ab.cjs.prod.js +0 -34
- package/dist/plugin-7cb7827e.cjs.dev.js +0 -34
- package/dist/plugin-e97ae3e6.cjs.prod.js +0 -34
- package/dist/quick-access-457a9f41.esm.js +0 -2290
- package/dist/quick-access-d553524e.cjs.dev.js +0 -2321
- package/dist/rocket-37c1aa11.cjs.dev.js +0 -34
- package/dist/rocket-b2dbda7f.cjs.prod.js +0 -34
- package/dist/speedometer-13b393fb.cjs.dev.js +0 -34
- package/dist/speedometer-1e69fd13.cjs.prod.js +0 -34
- package/dist/star-ab4be629.cjs.prod.js +0 -34
- package/dist/star-e165111e.cjs.dev.js +0 -34
- package/dist/tag-multi-5f498a7d.cjs.dev.js +0 -34
- package/dist/tag-multi-fb817131.cjs.prod.js +0 -34
- package/dist/tree-structure-779fcc36.cjs.prod.js +0 -34
- package/dist/tree-structure-ed6cdff8.cjs.dev.js +0 -34
- package/dist/user-filled-384a2eaf.cjs.prod.js +0 -34
- package/dist/user-filled-53d2eae0.cjs.dev.js +0 -34
- package/dist/world-12528632.cjs.prod.js +0 -34
- package/dist/world-6471d9f6.cjs.dev.js +0 -34
- /package/dist/declarations/src/components/{application-shell → redirect-to-login}/redirect-to-login.d.ts +0 -0
- /package/dist/declarations/src/components/{application-shell → redirect-to-logout}/redirect-to-logout.d.ts +0 -0
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
2
|
-
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
3
|
-
import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
|
|
4
|
-
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
5
|
-
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
6
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
7
|
-
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
8
|
-
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
9
|
-
import _flagsInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/flags';
|
|
10
1
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
11
2
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
12
3
|
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
@@ -14,61 +5,65 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
14
5
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
15
6
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
16
7
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
9
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
|
+
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
11
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
12
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
13
|
+
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
14
|
+
import _flagsInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/flags';
|
|
15
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
17
16
|
import { createElement, Suspense } from 'react';
|
|
18
17
|
import _pt from 'prop-types';
|
|
19
|
-
import { Router } from 'react-router-dom';
|
|
20
|
-
import invariant from 'tiny-invariant';
|
|
21
18
|
import { ApolloProvider } from '@apollo/client/react';
|
|
22
19
|
import { MockedProvider } from '@apollo/client/testing';
|
|
20
|
+
import { TestProviderFlopFlip } from '@flopflip/react-broadcast';
|
|
23
21
|
import * as rtl from '@testing-library/react';
|
|
24
22
|
export * from '@testing-library/react';
|
|
25
23
|
import * as rtlHooks from '@testing-library/react-hooks';
|
|
26
24
|
import { createMemoryHistory } from 'history';
|
|
27
25
|
import { IntlProvider } from 'react-intl';
|
|
28
|
-
import { TestProviderFlopFlip } from '@flopflip/react-broadcast';
|
|
29
26
|
import { Provider } from 'react-redux';
|
|
30
|
-
import {
|
|
27
|
+
import { Router } from 'react-router-dom';
|
|
28
|
+
import invariant from 'tiny-invariant';
|
|
29
|
+
import { entryPointUriPathToPermissionKeys } from '@commercetools-frontend/application-config/ssr';
|
|
31
30
|
import { ApplicationContextProvider } from '@commercetools-frontend/application-shell-connectors';
|
|
32
|
-
import {
|
|
31
|
+
import { createEnhancedHistory } from '@commercetools-frontend/browser-history';
|
|
33
32
|
import { DOMAINS } from '@commercetools-frontend/constants';
|
|
33
|
+
import { NotificationProviderForCustomComponent, NotificationsList } from '@commercetools-frontend/react-notifications';
|
|
34
34
|
import { createTestMiddleware } from '@commercetools-frontend/sdk/test-utils';
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
35
|
+
import { A as ApplicationEntryPoint } from '../../dist/application-entry-point-dc726674.esm.js';
|
|
36
|
+
import { o as createReduxStore, d as createApolloClient } from '../../dist/configure-apollo-cc0b1668.esm.js';
|
|
37
37
|
import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
|
|
38
|
+
import '@commercetools-frontend/application-components';
|
|
39
|
+
import '@commercetools-frontend/permissions';
|
|
38
40
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
39
41
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
40
42
|
import '@babel/runtime-corejs3/core-js-stable/reflect/has';
|
|
41
|
-
import 'lodash/mapValues';
|
|
42
43
|
import '@reduxjs/toolkit';
|
|
43
|
-
import '
|
|
44
|
+
import 'lodash/mapValues';
|
|
44
45
|
import 'omit-empty-es';
|
|
46
|
+
import 'redux-thunk';
|
|
45
47
|
import '@commercetools-frontend/notifications';
|
|
46
48
|
import '@commercetools-frontend/sdk';
|
|
47
|
-
import '../../dist/constants-69249abd.esm.js';
|
|
48
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
49
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
50
|
-
import 'redux-logger';
|
|
51
|
-
import 'react-dom';
|
|
52
|
-
import '@commercetools-uikit/loading-spinner';
|
|
53
49
|
import '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
54
50
|
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
51
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
55
52
|
import '@commercetools-frontend/sentry';
|
|
53
|
+
import '../../dist/constants-7f04db3f.esm.js';
|
|
54
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
55
|
+
import 'redux-logger';
|
|
56
56
|
import '@babel/runtime-corejs3/core-js-stable/url';
|
|
57
57
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
58
58
|
import '@apollo/client';
|
|
59
59
|
import 'apollo-link-logger';
|
|
60
|
-
import '@babel/runtime-corejs3/core-js-stable/array/from';
|
|
61
|
-
import '@babel/runtime-corejs3/core-js-stable/symbol';
|
|
62
|
-
import '@babel/runtime-corejs3/core-js/get-iterator-method';
|
|
63
|
-
import '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
64
60
|
import '@apollo/client/link/error';
|
|
61
|
+
import '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
65
62
|
import '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
66
63
|
import '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
67
64
|
import '@commercetools/http-user-agent';
|
|
68
65
|
import 'uuid';
|
|
69
|
-
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
70
66
|
import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
|
|
71
|
-
import '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
72
67
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
73
68
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
74
69
|
import '@babel/runtime-corejs3/helpers/assertThisInitialized';
|
|
@@ -76,18 +71,16 @@ import '@babel/runtime-corejs3/helpers/inherits';
|
|
|
76
71
|
import '@babel/runtime-corejs3/helpers/possibleConstructorReturn';
|
|
77
72
|
import '@babel/runtime-corejs3/helpers/getPrototypeOf';
|
|
78
73
|
import '@babel/runtime-corejs3/helpers/wrapNativeSuper';
|
|
79
|
-
import '@babel/runtime-corejs3/
|
|
74
|
+
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
80
75
|
import '@apollo/client/link/retry';
|
|
81
|
-
import '@commercetools-frontend/permissions';
|
|
82
|
-
import '@commercetools-frontend/application-components';
|
|
83
76
|
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
const _excluded = ["children"],
|
|
78
|
+
_excluded2 = ["children"];
|
|
86
79
|
|
|
87
80
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
88
81
|
|
|
89
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
90
|
-
|
|
82
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context9, _context10; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context9 = ownKeys(Object(source), !0)).call(_context9, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context10 = ownKeys(Object(source))).call(_context10, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
83
|
+
const defaultProject = {
|
|
91
84
|
key: 'test-with-big-data',
|
|
92
85
|
version: 43,
|
|
93
86
|
name: 'Test with big data',
|
|
@@ -117,7 +110,7 @@ var defaultProject = {
|
|
|
117
110
|
allAppliedMenuVisibilities: []
|
|
118
111
|
}
|
|
119
112
|
};
|
|
120
|
-
|
|
113
|
+
const defaultUser = {
|
|
121
114
|
id: 'user-id-1',
|
|
122
115
|
email: 'sheldon.cooper@caltech.edu',
|
|
123
116
|
createdAt: '2020-01-01T12:29:33.916Z',
|
|
@@ -139,7 +132,7 @@ var defaultUser = {
|
|
|
139
132
|
launchdarklyTrackingTeam: undefined,
|
|
140
133
|
launchdarklyTrackingTenant: 'gcp-eu'
|
|
141
134
|
};
|
|
142
|
-
|
|
135
|
+
const defaultEnvironment = {
|
|
143
136
|
applicationId: '__local',
|
|
144
137
|
applicationName: 'my-app',
|
|
145
138
|
entryPointUriPath: 'random-entry-point',
|
|
@@ -151,81 +144,69 @@ var defaultEnvironment = {
|
|
|
151
144
|
servedByProxy: false
|
|
152
145
|
};
|
|
153
146
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
});
|
|
158
|
-
};
|
|
147
|
+
const LoadingFallback = () => jsx(Fragment, {
|
|
148
|
+
children: 'Loading...'
|
|
149
|
+
});
|
|
159
150
|
|
|
160
151
|
LoadingFallback.displayName = 'LoadingFallback'; // For backwards compatibility we need to denormalize the given `permissions` option
|
|
161
152
|
// (which is now deprecated) to `allAppliedPermissions`, in order to pass the value
|
|
162
153
|
// to the `project` prop in the application context provider.
|
|
163
154
|
|
|
164
|
-
|
|
155
|
+
const denormalizePermissions = permissions => {
|
|
165
156
|
var _context;
|
|
166
157
|
|
|
167
158
|
if (!permissions) return [];
|
|
168
|
-
return _reduceInstanceProperty(_context = _Object$keys(permissions)).call(_context,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
name: permissionKey,
|
|
173
|
-
value: permissions[permissionKey]
|
|
174
|
-
}]);
|
|
175
|
-
}, []);
|
|
159
|
+
return _reduceInstanceProperty(_context = _Object$keys(permissions)).call(_context, (allAppliedPermissions, permissionKey) => [...allAppliedPermissions, {
|
|
160
|
+
name: permissionKey,
|
|
161
|
+
value: permissions[permissionKey]
|
|
162
|
+
}], []);
|
|
176
163
|
}; // For backwards compatibility we need to denormalize the given `actionRights` option
|
|
177
164
|
// (which is now deprecated) to `allAppliedActionRights`, in order to pass the value
|
|
178
165
|
// to the `project` prop in the application context provider.
|
|
179
166
|
|
|
180
167
|
|
|
181
|
-
|
|
182
|
-
var
|
|
168
|
+
const denormalizeActionRights = actionRights => {
|
|
169
|
+
var _context2;
|
|
183
170
|
|
|
184
171
|
if (!actionRights) return [];
|
|
185
|
-
return _reduceInstanceProperty(
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
name: actionRightKey,
|
|
194
|
-
value: actionRights[actionRightGroup][actionRightKey]
|
|
195
|
-
}]);
|
|
196
|
-
}, [])));
|
|
172
|
+
return _reduceInstanceProperty(_context2 = _Object$keys(actionRights)).call(_context2, (allAppliedActionRights, actionRightGroup) => {
|
|
173
|
+
var _context3;
|
|
174
|
+
|
|
175
|
+
return [...allAppliedActionRights, ..._reduceInstanceProperty(_context3 = _Object$keys(actionRights[actionRightGroup])).call(_context3, (allActionRightsByGroup, actionRightKey) => [...allActionRightsByGroup, {
|
|
176
|
+
group: actionRightGroup,
|
|
177
|
+
name: actionRightKey,
|
|
178
|
+
value: actionRights[actionRightGroup][actionRightKey]
|
|
179
|
+
}], [])];
|
|
197
180
|
}, []);
|
|
198
181
|
}; // For backwards compatibility we need to denormalize the given `dataFences` option
|
|
199
182
|
// (which is now deprecated) to `allAppliedDataFences`, in order to pass the value
|
|
200
183
|
// to the `project` prop in the application context provider.
|
|
201
184
|
|
|
202
185
|
|
|
203
|
-
|
|
204
|
-
var
|
|
186
|
+
const denormalizeDataFences = dataFences => {
|
|
187
|
+
var _context4;
|
|
205
188
|
|
|
206
189
|
if (!dataFences) return [];
|
|
207
|
-
return _reduceInstanceProperty(
|
|
208
|
-
var
|
|
190
|
+
return _reduceInstanceProperty(_context4 = _Object$keys(dataFences)).call(_context4, (allAppliedDataFences, dataFenceGroupKey) => {
|
|
191
|
+
var _context5;
|
|
209
192
|
|
|
210
193
|
switch (dataFenceGroupKey) {
|
|
211
194
|
case 'store':
|
|
212
|
-
return
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
return
|
|
216
|
-
var
|
|
217
|
-
|
|
218
|
-
return
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}, [])));
|
|
228
|
-
}, [])));
|
|
195
|
+
return [...allAppliedDataFences, ..._reduceInstanceProperty(_context5 = _Object$keys(dataFences.store)).call(_context5, (allResources, resourceType) => {
|
|
196
|
+
var _context6;
|
|
197
|
+
|
|
198
|
+
return [...allResources, ..._reduceInstanceProperty(_context6 = _Object$keys(dataFences.store[resourceType])).call(_context6, (allPermissions, permissionKey) => {
|
|
199
|
+
var _context7;
|
|
200
|
+
|
|
201
|
+
return [...allPermissions, ..._mapInstanceProperty(_context7 = _valuesInstanceProperty(dataFences.store[resourceType][permissionKey])).call(_context7, value => ({
|
|
202
|
+
__typename: 'StoreDataFence',
|
|
203
|
+
type: 'store',
|
|
204
|
+
value,
|
|
205
|
+
group: resourceType,
|
|
206
|
+
name: permissionKey
|
|
207
|
+
}))];
|
|
208
|
+
}, [])];
|
|
209
|
+
}, [])];
|
|
229
210
|
|
|
230
211
|
default:
|
|
231
212
|
return allAppliedDataFences;
|
|
@@ -233,24 +214,18 @@ var denormalizeDataFences = function denormalizeDataFences(dataFences) {
|
|
|
233
214
|
}, []);
|
|
234
215
|
};
|
|
235
216
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
value: true
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
};
|
|
217
|
+
const mapResourceAccessToAppliedPermissions = resourceAccesses => _mapInstanceProperty(resourceAccesses).call(resourceAccesses, resourceAccess => ({
|
|
218
|
+
name: "can".concat(resourceAccess),
|
|
219
|
+
value: true
|
|
220
|
+
}));
|
|
244
221
|
|
|
245
|
-
|
|
246
|
-
return wrapper ? /*#__PURE__*/createElement(wrapper, null, children) : children;
|
|
247
|
-
};
|
|
222
|
+
const wrapIfNeeded = (children, wrapper) => wrapper ? /*#__PURE__*/createElement(wrapper, null, children) : children;
|
|
248
223
|
|
|
249
|
-
|
|
224
|
+
const ApolloProviderWrapper = props => {
|
|
250
225
|
var _props$apolloClient, _apolloClient$cache$a;
|
|
251
226
|
|
|
252
|
-
|
|
253
|
-
|
|
227
|
+
const apolloClient = (_props$apolloClient = props.apolloClient) !== null && _props$apolloClient !== void 0 ? _props$apolloClient : createApolloClient();
|
|
228
|
+
const enableApolloMocks = Boolean(props.mocks && props.mocks.length > 0);
|
|
254
229
|
|
|
255
230
|
if (!enableApolloMocks) {
|
|
256
231
|
return (// eslint-disable-next-line testing-library/no-node-access
|
|
@@ -289,7 +264,7 @@ ApolloProviderWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
289
264
|
} : {};
|
|
290
265
|
|
|
291
266
|
function createApplicationProviders() {
|
|
292
|
-
|
|
267
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
293
268
|
_ref$disableAutomatic = _ref.disableAutomaticEntryPointRoutes,
|
|
294
269
|
disableAutomaticEntryPointRoutes = _ref$disableAutomatic === void 0 ? false : _ref$disableAutomatic,
|
|
295
270
|
_ref$disableRoutePerm = _ref.disableRoutePermissionCheck,
|
|
@@ -308,76 +283,72 @@ function createApplicationProviders() {
|
|
|
308
283
|
_ref$dataLocale = _ref.dataLocale,
|
|
309
284
|
dataLocale = _ref$dataLocale === void 0 ? 'en' : _ref$dataLocale;
|
|
310
285
|
|
|
311
|
-
|
|
312
|
-
|
|
286
|
+
const mergedUser = user === null ? undefined : _objectSpread(_objectSpread({}, defaultUser), user);
|
|
287
|
+
const mergedProject = project === null ? undefined : _objectSpread(_objectSpread({}, defaultProject), project);
|
|
313
288
|
|
|
314
|
-
|
|
289
|
+
const mergedEnvironment = _objectSpread(_objectSpread({}, defaultEnvironment), environment); // Provide default permissions to render the application route.
|
|
315
290
|
|
|
316
291
|
|
|
317
292
|
if (mergedProject) {
|
|
318
293
|
if (mergedProject.allAppliedPermissions.length === 0) {
|
|
319
|
-
|
|
294
|
+
const defaultPermissionKeys = entryPointUriPathToPermissionKeys(mergedEnvironment.entryPointUriPath);
|
|
320
295
|
mergedProject.allAppliedPermissions = mapResourceAccessToAppliedPermissions([defaultPermissionKeys.View]);
|
|
321
296
|
}
|
|
322
297
|
}
|
|
323
298
|
|
|
324
|
-
|
|
299
|
+
let initialRoute = route;
|
|
325
300
|
|
|
326
301
|
if (!route && mergedProject) {
|
|
327
|
-
var
|
|
302
|
+
var _context8;
|
|
328
303
|
|
|
329
|
-
initialRoute = _concatInstanceProperty(
|
|
304
|
+
initialRoute = _concatInstanceProperty(_context8 = "/".concat(mergedProject.key, "/")).call(_context8, mergedEnvironment.entryPointUriPath);
|
|
330
305
|
}
|
|
331
306
|
|
|
332
|
-
|
|
307
|
+
const memoryHistory = history !== null && history !== void 0 ? history : createEnhancedHistory(createMemoryHistory({
|
|
333
308
|
initialEntries: [initialRoute || '/']
|
|
334
309
|
}));
|
|
335
310
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
} : undefined,
|
|
362
|
-
children: disableAutomaticEntryPointRoutes ? undefined : // eslint-disable-next-line testing-library/no-node-access
|
|
363
|
-
props.children
|
|
364
|
-
})
|
|
311
|
+
const ApplicationProviders = props => jsx(IntlProvider, {
|
|
312
|
+
locale: locale,
|
|
313
|
+
children: jsx(ApolloProviderWrapper, {
|
|
314
|
+
apolloClient: apolloClient,
|
|
315
|
+
mocks: mocks,
|
|
316
|
+
children: jsx(TestProviderFlopFlip, {
|
|
317
|
+
flags: flags,
|
|
318
|
+
children: jsx(ApplicationContextProvider, {
|
|
319
|
+
user: mergedUser,
|
|
320
|
+
project: mergedProject,
|
|
321
|
+
environment: mergedEnvironment,
|
|
322
|
+
projectDataLocale: dataLocale,
|
|
323
|
+
children: jsx(Router, {
|
|
324
|
+
history: memoryHistory,
|
|
325
|
+
children: jsx(Suspense, {
|
|
326
|
+
fallback: jsx(LoadingFallback, {}),
|
|
327
|
+
children: jsx(ApplicationEntryPoint, {
|
|
328
|
+
environment: mergedEnvironment,
|
|
329
|
+
disableRoutePermissionCheck: disableRoutePermissionCheck,
|
|
330
|
+
render: disableAutomaticEntryPointRoutes ? // eslint-disable-next-line testing-library/no-node-access
|
|
331
|
+
() => jsx(Fragment, {
|
|
332
|
+
children: props.children
|
|
333
|
+
}) : undefined,
|
|
334
|
+
children: disableAutomaticEntryPointRoutes ? undefined : // eslint-disable-next-line testing-library/no-node-access
|
|
335
|
+
props.children
|
|
365
336
|
})
|
|
366
337
|
})
|
|
367
338
|
})
|
|
368
339
|
})
|
|
369
340
|
})
|
|
370
|
-
})
|
|
371
|
-
};
|
|
341
|
+
})
|
|
342
|
+
});
|
|
372
343
|
|
|
373
344
|
ApplicationProviders.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
374
345
|
children: _pt.node.isRequired
|
|
375
346
|
} : {};
|
|
376
347
|
return {
|
|
377
|
-
ApplicationProviders
|
|
378
|
-
mergedUser
|
|
379
|
-
mergedProject
|
|
380
|
-
mergedEnvironment
|
|
348
|
+
ApplicationProviders,
|
|
349
|
+
mergedUser,
|
|
350
|
+
mergedProject,
|
|
351
|
+
mergedEnvironment,
|
|
381
352
|
history: memoryHistory
|
|
382
353
|
};
|
|
383
354
|
} // Inspired by
|
|
@@ -385,20 +356,20 @@ function createApplicationProviders() {
|
|
|
385
356
|
|
|
386
357
|
|
|
387
358
|
function renderApp(ui) {
|
|
388
|
-
|
|
359
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
389
360
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
361
|
+
const _createApplicationPro = createApplicationProviders(options),
|
|
362
|
+
ApplicationProviders = _createApplicationPro.ApplicationProviders,
|
|
363
|
+
mergedUser = _createApplicationPro.mergedUser,
|
|
364
|
+
mergedProject = _createApplicationPro.mergedProject,
|
|
365
|
+
mergedEnvironment = _createApplicationPro.mergedEnvironment,
|
|
366
|
+
history = _createApplicationPro.history; // eslint-disable-next-line testing-library/render-result-naming-convention
|
|
396
367
|
|
|
397
368
|
|
|
398
|
-
|
|
369
|
+
const rendered = rtl.render(ui, _objectSpread(_objectSpread({}, options), {}, {
|
|
399
370
|
// eslint-disable-next-line react/display-name
|
|
400
|
-
wrapper:
|
|
401
|
-
|
|
371
|
+
wrapper: _ref2 => {
|
|
372
|
+
let children = _ref2.children,
|
|
402
373
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
403
374
|
|
|
404
375
|
return jsx(ApplicationProviders, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -410,7 +381,7 @@ function renderApp(ui) {
|
|
|
410
381
|
// adding `history` to the returned utilities to allow us
|
|
411
382
|
// to reference it in our tests (just try to avoid using
|
|
412
383
|
// this to test implementation details).
|
|
413
|
-
history
|
|
384
|
+
history,
|
|
414
385
|
// Adding user, project & environment so tests know about the merge results
|
|
415
386
|
// Note that these objects do not resemble the application context, they are
|
|
416
387
|
// only intended to communicate the test setup back to the tests.
|
|
@@ -421,7 +392,7 @@ function renderApp(ui) {
|
|
|
421
392
|
}
|
|
422
393
|
|
|
423
394
|
function createReduxProviders() {
|
|
424
|
-
|
|
395
|
+
let _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
425
396
|
_ref3$store = _ref3.store,
|
|
426
397
|
store = _ref3$store === void 0 ? undefined : _ref3$store,
|
|
427
398
|
_ref3$storeState = _ref3.storeState,
|
|
@@ -429,9 +400,7 @@ function createReduxProviders() {
|
|
|
429
400
|
_ref3$sdkMocks = _ref3.sdkMocks,
|
|
430
401
|
sdkMocks = _ref3$sdkMocks === void 0 ? [] : _ref3$sdkMocks,
|
|
431
402
|
_ref3$mapNotification = _ref3.mapNotificationToComponent,
|
|
432
|
-
mapNotificationToComponent = _ref3$mapNotification === void 0 ?
|
|
433
|
-
return null;
|
|
434
|
-
} : _ref3$mapNotification;
|
|
403
|
+
mapNotificationToComponent = _ref3$mapNotification === void 0 ? () => null : _ref3$mapNotification;
|
|
435
404
|
|
|
436
405
|
!!(store && storeState) ? process.env.NODE_ENV !== "production" ? invariant(false, '@commercetools-frontend/application-shell/test-utils: You provided both `store` and `storeState`. Please provide only one of them.') : invariant(false) : void 0;
|
|
437
406
|
!!(store && sdkMocks.length > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, '@commercetools-frontend/application-shell/test-utils: You provided both `store` and `sdkMocks`. Please provide only one of them.') : invariant(false) : void 0; // Determine the redux store to use in tests.
|
|
@@ -445,37 +414,35 @@ function createReduxProviders() {
|
|
|
445
414
|
// responses. We further initialize the store with the provided storeState.
|
|
446
415
|
// If storeState is undefined, then the defaults kick in anyways.
|
|
447
416
|
|
|
448
|
-
|
|
417
|
+
const reduxStore = (() => {
|
|
449
418
|
if (store) return store;
|
|
450
419
|
if (sdkMocks.length === 0) return createReduxStore(storeState);
|
|
451
|
-
|
|
420
|
+
const testingMiddleware = createTestMiddleware(sdkMocks);
|
|
452
421
|
return createReduxStore(storeState, [testingMiddleware]);
|
|
453
|
-
}();
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
children:
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}), props.children]
|
|
468
|
-
})
|
|
422
|
+
})();
|
|
423
|
+
|
|
424
|
+
const ReduxProviders = props => jsx(NotificationProviderForCustomComponent, {
|
|
425
|
+
mapNotificationToComponent: mapNotificationToComponent,
|
|
426
|
+
children: jsx(Provider, {
|
|
427
|
+
store: reduxStore,
|
|
428
|
+
children: jsxs("div", {
|
|
429
|
+
children: [jsx(NotificationsList, {
|
|
430
|
+
domain: DOMAINS.GLOBAL
|
|
431
|
+
}), jsx(NotificationsList, {
|
|
432
|
+
domain: DOMAINS.PAGE
|
|
433
|
+
}), jsx(NotificationsList, {
|
|
434
|
+
domain: DOMAINS.SIDE
|
|
435
|
+
}), props.children]
|
|
469
436
|
})
|
|
470
|
-
})
|
|
471
|
-
};
|
|
437
|
+
})
|
|
438
|
+
});
|
|
472
439
|
|
|
473
440
|
ReduxProviders.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
474
441
|
children: _pt.node.isRequired
|
|
475
442
|
} : {};
|
|
476
443
|
return {
|
|
477
|
-
ReduxProviders
|
|
478
|
-
reduxStore
|
|
444
|
+
ReduxProviders,
|
|
445
|
+
reduxStore
|
|
479
446
|
};
|
|
480
447
|
} // Test setup for rendering with Redux
|
|
481
448
|
// We expose a sophisticated function because we plan to get rid of Redux
|
|
@@ -483,17 +450,17 @@ function createReduxProviders() {
|
|
|
483
450
|
|
|
484
451
|
|
|
485
452
|
function renderAppWithRedux(ui) {
|
|
486
|
-
|
|
453
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
487
454
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
455
|
+
const _createReduxProviders = createReduxProviders(options),
|
|
456
|
+
ReduxProviders = _createReduxProviders.ReduxProviders,
|
|
457
|
+
reduxStore = _createReduxProviders.reduxStore; // eslint-disable-next-line testing-library/render-result-naming-convention
|
|
491
458
|
|
|
492
459
|
|
|
493
|
-
|
|
460
|
+
const rendered = renderApp(ui, _objectSpread(_objectSpread({}, options), {}, {
|
|
494
461
|
// eslint-disable-next-line react/display-name
|
|
495
|
-
wrapper:
|
|
496
|
-
|
|
462
|
+
wrapper: _ref4 => {
|
|
463
|
+
let children = _ref4.children,
|
|
497
464
|
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
498
465
|
|
|
499
466
|
return jsx(ReduxProviders, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -510,24 +477,24 @@ function renderAppWithRedux(ui) {
|
|
|
510
477
|
}
|
|
511
478
|
|
|
512
479
|
function renderHook(callback) {
|
|
513
|
-
|
|
480
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
514
481
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
482
|
+
const _createReduxProviders2 = createReduxProviders(options),
|
|
483
|
+
ReduxProviders = _createReduxProviders2.ReduxProviders,
|
|
484
|
+
reduxStore = _createReduxProviders2.reduxStore;
|
|
518
485
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
486
|
+
const _createApplicationPro2 = createApplicationProviders(options),
|
|
487
|
+
ApplicationProviders = _createApplicationPro2.ApplicationProviders,
|
|
488
|
+
mergedUser = _createApplicationPro2.mergedUser,
|
|
489
|
+
mergedProject = _createApplicationPro2.mergedProject,
|
|
490
|
+
mergedEnvironment = _createApplicationPro2.mergedEnvironment,
|
|
491
|
+
history = _createApplicationPro2.history; // eslint-disable-next-line testing-library/render-result-naming-convention
|
|
525
492
|
|
|
526
493
|
|
|
527
|
-
|
|
494
|
+
const rendered = rtlHooks.renderHook(callback, _objectSpread(_objectSpread({}, options), {}, {
|
|
528
495
|
// eslint-disable-next-line react/display-name
|
|
529
|
-
wrapper:
|
|
530
|
-
|
|
496
|
+
wrapper: _ref5 => {
|
|
497
|
+
let children = _ref5.children;
|
|
531
498
|
return jsx(ApplicationProviders, {
|
|
532
499
|
children: jsx(ReduxProviders, {
|
|
533
500
|
children: wrapIfNeeded(children, options.wrapper)
|
|
@@ -537,15 +504,15 @@ function renderHook(callback) {
|
|
|
537
504
|
}));
|
|
538
505
|
return _objectSpread(_objectSpread({}, rendered), {}, {
|
|
539
506
|
store: reduxStore,
|
|
540
|
-
history
|
|
507
|
+
history,
|
|
541
508
|
user: mergedUser,
|
|
542
509
|
project: mergedProject,
|
|
543
510
|
environment: mergedEnvironment
|
|
544
511
|
});
|
|
545
512
|
} // re-export everything
|
|
546
513
|
|
|
547
|
-
|
|
548
|
-
renderHook
|
|
514
|
+
const hooks = _objectSpread(_objectSpread({}, rtlHooks), {}, {
|
|
515
|
+
renderHook
|
|
549
516
|
});
|
|
550
517
|
|
|
551
518
|
export { denormalizeActionRights, denormalizeDataFences, denormalizePermissions, hooks, mapResourceAccessToAppliedPermissions, renderApp, renderAppWithRedux };
|