@redhat-cloud-services/frontend-components-config-utilities 2.0.0 → 2.0.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.
Files changed (131) hide show
  1. package/federated-modules.js +1 -1
  2. package/package.json +1 -1
  3. package/repos/insights-chrome-build/58231b16fdee45a03a4ee3cf94a9f2c3 +0 -73
  4. package/repos/insights-chrome-build/app.info.deps.json +0 -1
  5. package/repos/insights-chrome-build/app.info.json +0 -14
  6. package/repos/insights-chrome-build/index.html +0 -29
  7. package/repos/insights-chrome-build/js/00e10699d4604274.woff2 +0 -0
  8. package/repos/insights-chrome-build/js/03be9971fdd08ef3.woff2 +0 -0
  9. package/repos/insights-chrome-build/js/05294d67f8e33aab.woff2 +0 -0
  10. package/repos/insights-chrome-build/js/091b27e83c831713.woff2 +0 -0
  11. package/repos/insights-chrome-build/js/0d54864d782470c6.woff +0 -0
  12. package/repos/insights-chrome-build/js/0d5f5f4e3bbf47e1.woff2 +0 -0
  13. package/repos/insights-chrome-build/js/1039d3d8000f2c4b.woff +0 -0
  14. package/repos/insights-chrome-build/js/13f6558f31b2ee0f.woff2 +0 -0
  15. package/repos/insights-chrome-build/js/1412957e204a8a1a.woff +0 -0
  16. package/repos/insights-chrome-build/js/17802e9fb8c2dd3c.woff +0 -0
  17. package/repos/insights-chrome-build/js/1be1bd18c67d1ac8.woff +0 -0
  18. package/repos/insights-chrome-build/js/26409b4397ab88cc.woff2 +0 -0
  19. package/repos/insights-chrome-build/js/278473d290fcbf3b.woff2 +0 -0
  20. package/repos/insights-chrome-build/js/2a96d5b208c56fa6.woff +0 -0
  21. package/repos/insights-chrome-build/js/2baac3a5d7ab7a15.woff2 +0 -0
  22. package/repos/insights-chrome-build/js/316d3d41de174f24.woff +0 -0
  23. package/repos/insights-chrome-build/js/3239d74dcb174610.woff2 +0 -0
  24. package/repos/insights-chrome-build/js/326f107b61d32769.woff +0 -0
  25. package/repos/insights-chrome-build/js/49ee635c956449ea.woff2 +0 -0
  26. package/repos/insights-chrome-build/js/4ace320f5eaa7ee9.woff2 +0 -0
  27. package/repos/insights-chrome-build/js/4b0d8eeb01c2f27e.woff2 +0 -0
  28. package/repos/insights-chrome-build/js/4df2ca3d94d759b3.svg +0 -515
  29. package/repos/insights-chrome-build/js/52f482efb5487bba.woff2 +0 -0
  30. package/repos/insights-chrome-build/js/64b9a14b3398824f.woff2 +0 -0
  31. package/repos/insights-chrome-build/js/66309a34eac8b284.woff2 +0 -0
  32. package/repos/insights-chrome-build/js/6e30b223886d1eef.woff2 +0 -0
  33. package/repos/insights-chrome-build/js/6fb4e4e104bb886f.woff2 +0 -0
  34. package/repos/insights-chrome-build/js/703c721f27900006.woff +0 -0
  35. package/repos/insights-chrome-build/js/79c835ddc356c3ef.woff +0 -0
  36. package/repos/insights-chrome-build/js/7a0809e40bf8e79a.woff +0 -0
  37. package/repos/insights-chrome-build/js/7a9fb47c5b35e50d.woff2 +0 -0
  38. package/repos/insights-chrome-build/js/7bb3ddb0583cc7a5.woff +0 -0
  39. package/repos/insights-chrome-build/js/7bf300b28414f3ad.woff +0 -0
  40. package/repos/insights-chrome-build/js/7d9b027229967149.woff2 +0 -0
  41. package/repos/insights-chrome-build/js/81245ab8c867ea09.woff +0 -0
  42. package/repos/insights-chrome-build/js/830dcb2cc707ae4c.woff +0 -0
  43. package/repos/insights-chrome-build/js/835112a9ba0d676e.woff +0 -0
  44. package/repos/insights-chrome-build/js/8f3e80eba644e3ec.svg +0 -33
  45. package/repos/insights-chrome-build/js/8f765508913b945e.woff2 +0 -0
  46. package/repos/insights-chrome-build/js/91bbac2b6e0eb739.woff +0 -0
  47. package/repos/insights-chrome-build/js/96971d99ef5f2ef7.woff2 +0 -0
  48. package/repos/insights-chrome-build/js/_c74b-_e0c3-_9cf0-_3467-_8add-_2900-_a7bc-_70d9-_eea3-_8afc-_d73e-_1a3c-_2385-_85ca-_5c4f-_0f-35898c0.b3f9836f62184986.js +0 -943
  49. package/repos/insights-chrome-build/js/_c74b-_e0c3-_9cf0-_3467-_8add-_2900-_a7bc-_70d9-_eea3-_8afc-_d73e-_1a3c-_2385-_85ca-_5c4f-_0f-35898c1.b3f9836f62184986.js +0 -943
  50. package/repos/insights-chrome-build/js/a14c79bac597c758.woff +0 -0
  51. package/repos/insights-chrome-build/js/a86c2bca47a21ff0.woff2 +0 -0
  52. package/repos/insights-chrome-build/js/ad4d1e278d4d13cb.woff +0 -0
  53. package/repos/insights-chrome-build/js/ajs-destination.b3f9836f62184986.js +0 -594
  54. package/repos/insights-chrome-build/js/auto-track.b3f9836f62184986.js +0 -122
  55. package/repos/insights-chrome-build/js/b0ebda5f4f12f761.woff2 +0 -0
  56. package/repos/insights-chrome-build/js/b97a3321aaf7e87a.woff2 +0 -0
  57. package/repos/insights-chrome-build/js/ba04b02b7da08f3d.woff2 +0 -0
  58. package/repos/insights-chrome-build/js/bb85876a67d3e7e7.woff2 +0 -0
  59. package/repos/insights-chrome-build/js/bbe18aee9c88166d.woff +0 -0
  60. package/repos/insights-chrome-build/js/c3ab7be4146884a3.woff2 +0 -0
  61. package/repos/insights-chrome-build/js/c49edc34d14553e4.woff +0 -0
  62. package/repos/insights-chrome-build/js/c8b06bb52b20081e.woff2 +0 -0
  63. package/repos/insights-chrome-build/js/c99e50723fcf0166.woff +0 -0
  64. package/repos/insights-chrome-build/js/cb827f53cc6d6dcf.woff2 +0 -0
  65. package/repos/insights-chrome-build/js/cd1824ff99b9ef33.woff2 +0 -0
  66. package/repos/insights-chrome-build/js/ce63a8f6be94c7cd.woff2 +0 -0
  67. package/repos/insights-chrome-build/js/chrome-root.b3f9836f62184986.js +0 -43326
  68. package/repos/insights-chrome-build/js/chrome.b3f9836f62184986.js +0 -33007
  69. package/repos/insights-chrome-build/js/d004dc9f8c955767.woff2 +0 -0
  70. package/repos/insights-chrome-build/js/d19c89c249d7f751.woff2 +0 -0
  71. package/repos/insights-chrome-build/js/d2a095f5996e5014.woff2 +0 -0
  72. package/repos/insights-chrome-build/js/d2ce043298f5c972.woff +0 -0
  73. package/repos/insights-chrome-build/js/d2cf7e795db09bc7.woff +0 -0
  74. package/repos/insights-chrome-build/js/d6083bde9a964ab4.svg +0 -96
  75. package/repos/insights-chrome-build/js/dd18fb6c0b7048e8.woff2 +0 -0
  76. package/repos/insights-chrome-build/js/df8a52d2494e1e03.woff2 +0 -0
  77. package/repos/insights-chrome-build/js/e5c7a27047a83d24.woff2 +0 -0
  78. package/repos/insights-chrome-build/js/e693e4f9d9c75499.woff2 +0 -0
  79. package/repos/insights-chrome-build/js/e8ec1c41a82bd354.woff +0 -0
  80. package/repos/insights-chrome-build/js/f66882bad34e5c9f.woff +0 -0
  81. package/repos/insights-chrome-build/js/f830d4d01f5e4497.woff +0 -0
  82. package/repos/insights-chrome-build/js/fed-mods.json +0 -15
  83. package/repos/insights-chrome-build/js/legacyVideos.b3f9836f62184986.js +0 -41
  84. package/repos/insights-chrome-build/js/main.b3f9836f62184986.css +0 -51216
  85. package/repos/insights-chrome-build/js/node_modules_hoist-non-react-statics_dist_hoist-non-react-statics_cjs_js.b3f9836f62184986.js +0 -323
  86. package/repos/insights-chrome-build/js/node_modules_lodash_isEqual_js.b3f9836f62184986.js +0 -48
  87. package/repos/insights-chrome-build/js/node_modules_patternfly_react-icons_dist_js_icons_bars-icon_js-node_modules_patternfly_react--0a3495.b3f9836f62184986.js +0 -242
  88. package/repos/insights-chrome-build/js/queryString.b3f9836f62184986.js +0 -128
  89. package/repos/insights-chrome-build/js/quick-start.b3f9836f62184986.js +0 -47
  90. package/repos/insights-chrome-build/js/remoteMiddleware.b3f9836f62184986.js +0 -87
  91. package/repos/insights-chrome-build/js/schemaFilter.b3f9836f62184986.js +0 -111
  92. package/repos/insights-chrome-build/js/src_bootstrap_tsx-src_moduleOverrides_unfetch_ts-node_modules_redhat-cloud-services_frontend--275e6e.b3f9836f62184986.css +0 -27041
  93. package/repos/insights-chrome-build/js/src_bootstrap_tsx-src_moduleOverrides_unfetch_ts-node_modules_redhat-cloud-services_frontend--275e6e.b3f9836f62184986.js +0 -20468
  94. package/repos/insights-chrome-build/js/src_components_Debugger_index_ts.b3f9836f62184986.css +0 -52
  95. package/repos/insights-chrome-build/js/src_components_Debugger_index_ts.b3f9836f62184986.js +0 -512
  96. package/repos/insights-chrome-build/js/src_components_FavoriteServices_EmptyState_tsx-src_hooks_useFavoritedServices_ts.b3f9836f62184986.css +0 -8664
  97. package/repos/insights-chrome-build/js/src_components_FavoriteServices_EmptyState_tsx-src_hooks_useFavoritedServices_ts.b3f9836f62184986.js +0 -5098
  98. package/repos/insights-chrome-build/js/src_components_FavoriteServices_LandingNavFavorites_tsx-src_utils_common_ts.b3f9836f62184986.css +0 -8662
  99. package/repos/insights-chrome-build/js/src_components_FavoriteServices_LandingNavFavorites_tsx-src_utils_common_ts.b3f9836f62184986.js +0 -898
  100. package/repos/insights-chrome-build/js/src_components_NotEntitledModal_index_tsx.b3f9836f62184986.css +0 -30
  101. package/repos/insights-chrome-build/js/src_components_NotEntitledModal_index_tsx.b3f9836f62184986.js +0 -237
  102. package/repos/insights-chrome-build/js/src_components_QuickstartsCatalogRoute_index_ts.b3f9836f62184986.js +0 -106
  103. package/repos/insights-chrome-build/js/src_components_Stratosphere_ProductSelection_tsx.b3f9836f62184986.css +0 -17513
  104. package/repos/insights-chrome-build/js/src_components_Stratosphere_ProductSelection_tsx.b3f9836f62184986.js +0 -335
  105. package/repos/insights-chrome-build/js/src_moduleOverrides_chart-utils-override_js-src_pdf_DownloadButton_tsx-webpack_sharing_consum-3a44a6.b3f9836f62184986.js +0 -91
  106. package/repos/insights-chrome-build/js/tsub-middleware.b3f9836f62184986.js +0 -6836
  107. package/repos/insights-chrome-build/js/vendors-node_modules_buffer_index_js-node_modules_lodash__baseFlatten_js-node_modules_lodash_-1de864.b3f9836f62184986.js +0 -2552
  108. package/repos/insights-chrome-build/js/vendors-node_modules_hoist-non-react-statics_dist_hoist-non-react-statics_cjs_js-node_modules-c053fb.b3f9836f62184986.js +0 -1761
  109. package/repos/insights-chrome-build/js/vendors-node_modules_inherits_inherits_browser_js-node_modules_lodash__baseMerge_js-node_modu-5ed1a1.b3f9836f62184986.js +0 -1113
  110. package/repos/insights-chrome-build/js/vendors-node_modules_lodash__baseForOwn_js-node_modules_lodash__baseIteratee_js-node_modules_-167437.b3f9836f62184986.js +0 -1289
  111. package/repos/insights-chrome-build/js/vendors-node_modules_lodash__baseIsEqual_js.b3f9836f62184986.js +0 -3148
  112. package/repos/insights-chrome-build/js/vendors-node_modules_openshift_dynamic-plugin-sdk_dist_index_js.b3f9836f62184986.js +0 -17197
  113. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_quickstarts_dist_index_es_js.b3f9836f62184986.js +0 -13149
  114. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-charts_dist_esm_components_ChartUtils_chart-theme_js-no-998b15.b3f9836f62184986.js +0 -166192
  115. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-core_dist_esm_components_Button_Button_js-node_modules_-6763c7.b3f9836f62184986.js +0 -6274
  116. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-core_dist_esm_index_js.b3f9836f62184986.js +0 -33678
  117. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-core_next_components_Select_Select_js-node_modules_patt-da466d.b3f9836f62184986.js +0 -4946
  118. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-icons_dist_esm_icons_bell-slash-icon_js-node_modules_pa-6de3ff.b3f9836f62184986.js +0 -74388
  119. package/repos/insights-chrome-build/js/vendors-node_modules_patternfly_react-icons_dist_esm_icons_star-icon_js-node_modules_axios_in-5a9fd5.b3f9836f62184986.js +0 -2881
  120. package/repos/insights-chrome-build/js/vendors-node_modules_prop-types_index_js.b3f9836f62184986.js +0 -649
  121. package/repos/insights-chrome-build/js/vendors-node_modules_react-redux_es_index_js.b3f9836f62184986.js +0 -2337
  122. package/repos/insights-chrome-build/js/vendors-node_modules_react-router-dom_dist_index_js.b3f9836f62184986.js +0 -6691
  123. package/repos/insights-chrome-build/js/vendors-node_modules_react_jsx-runtime_js.b3f9836f62184986.js +0 -1250
  124. package/repos/insights-chrome-build/js/vendors-node_modules_redhat-cloud-services_chrome_esm_index_js.b3f9836f62184986.js +0 -708
  125. package/repos/insights-chrome-build/js/vendors-node_modules_redhat-cloud-services_frontend-components-utilities_esm_interceptors_int-b5fffe.b3f9836f62184986.js +0 -21636
  126. package/repos/insights-chrome-build/js/vendors-node_modules_scalprum_core_dist_esm_index_js.b3f9836f62184986.js +0 -363
  127. package/repos/insights-chrome-build/js/vendors-node_modules_scalprum_react-core_dist_esm_index_js.b3f9836f62184986.js +0 -762
  128. package/repos/insights-chrome-build/js/vendors-node_modules_segment_analytics_js-video-plugins_dist_index_umd_js.b3f9836f62184986.js +0 -13
  129. package/repos/insights-chrome-build/js/vendors-node_modules_tslib_tslib_es6_js.b3f9836f62184986.js +0 -258
  130. package/repos/insights-chrome-build/js/vendors-node_modules_unleash_proxy-client-react_dist_index_browser_js.b3f9836f62184986.js +0 -1821
  131. package/repos/insights-chrome-build/silent-check-sso.html +0 -7
@@ -1,898 +0,0 @@
1
- "use strict";
2
- (self["webpackChunkinsights_chrome"] = self["webpackChunkinsights_chrome"] || []).push([["src_components_FavoriteServices_LandingNavFavorites_tsx-src_utils_common_ts"],{
3
-
4
- /***/ "./src/components/FavoriteServices/LandingNavFavorites.scss":
5
- /*!******************************************************************!*\
6
- !*** ./src/components/FavoriteServices/LandingNavFavorites.scss ***!
7
- \******************************************************************/
8
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
-
10
- __webpack_require__.r(__webpack_exports__);
11
- // extracted by mini-css-extract-plugin
12
-
13
-
14
- /***/ }),
15
-
16
- /***/ "./src/components/FavoriteServices/LandingNavFavorites.tsx":
17
- /*!*****************************************************************!*\
18
- !*** ./src/components/FavoriteServices/LandingNavFavorites.tsx ***!
19
- \*****************************************************************/
20
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
21
-
22
- __webpack_require__.r(__webpack_exports__);
23
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
25
- /* harmony export */ });
26
- /* harmony import */ var _patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @patternfly/react-core */ "webpack/sharing/consume/default/@patternfly/react-core/@patternfly/react-core");
27
- /* harmony import */ var _patternfly_react_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__);
28
- /* harmony import */ var _patternfly_react_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @patternfly/react-icons */ "./node_modules/@patternfly/react-icons/dist/esm/icons/star-icon.js");
29
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react/react?88de");
30
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
31
- /* harmony import */ var _hooks_useFavoritedServices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hooks/useFavoritedServices */ "./src/hooks/useFavoritedServices.ts");
32
- /* harmony import */ var _FavoriteServices_EmptyState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FavoriteServices/EmptyState */ "./src/components/FavoriteServices/EmptyState.tsx");
33
- /* harmony import */ var _hooks_useBundle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useBundle */ "./src/hooks/useBundle.ts");
34
- /* harmony import */ var _LandingNavFavorites_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./LandingNavFavorites.scss */ "./src/components/FavoriteServices/LandingNavFavorites.scss");
35
- /* harmony import */ var _ChromeLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ChromeLink */ "./src/components/ChromeLink/index.ts");
36
- function _arrayLikeToArray(arr, len) {
37
- if (len == null || len > arr.length) len = arr.length;
38
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
39
- return arr2;
40
- }
41
- function _arrayWithHoles(arr) {
42
- if (Array.isArray(arr)) return arr;
43
- }
44
- function _iterableToArrayLimit(arr, i) {
45
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
46
- if (_i == null) return;
47
- var _arr = [];
48
- var _n = true;
49
- var _d = false;
50
- var _s, _e;
51
- try {
52
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
53
- _arr.push(_s.value);
54
- if (i && _arr.length === i) break;
55
- }
56
- } catch (err) {
57
- _d = true;
58
- _e = err;
59
- } finally{
60
- try {
61
- if (!_n && _i["return"] != null) _i["return"]();
62
- } finally{
63
- if (_d) throw _e;
64
- }
65
- }
66
- return _arr;
67
- }
68
- function _nonIterableRest() {
69
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
70
- }
71
- function _slicedToArray(arr, i) {
72
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
73
- }
74
- function _unsupportedIterableToArray(o, minLen) {
75
- if (!o) return;
76
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
77
- var n = Object.prototype.toString.call(o).slice(8, -1);
78
- if (n === "Object" && o.constructor) n = o.constructor.name;
79
- if (n === "Map" || n === "Set") return Array.from(n);
80
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
81
- }
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
- var LandingNavFavorites = function() {
91
- var favoritedServices = (0,_hooks_useFavoritedServices__WEBPACK_IMPORTED_MODULE_2__["default"])();
92
- var _useState = _slicedToArray((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), 2), page = _useState[0], setPage = _useState[1];
93
- var _React_useState = _slicedToArray(react__WEBPACK_IMPORTED_MODULE_1___default().useState(4), 2), perPage = _React_useState[0], setPerPage = _React_useState[1];
94
- var onSetPage = function(_event, newPage) {
95
- setPage(newPage);
96
- };
97
- var onPerPageSelect = function(_event, newPerPage, newPage) {
98
- setPerPage(newPerPage);
99
- setPage(newPage);
100
- };
101
- var getBundle = function(href) {
102
- return _hooks_useBundle__WEBPACK_IMPORTED_MODULE_4__.bundleMapping[href.split("/")[1]];
103
- };
104
- var buildFavorites = function() {
105
- return favoritedServices.slice((page - 1) * perPage, page * perPage).map(function(favorite, index) {
106
- return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.GalleryItem, {
107
- key: index
108
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChromeLink__WEBPACK_IMPORTED_MODULE_6__["default"], {
109
- href: favorite.pathname,
110
- className: "chr-c-favorite-service__tile"
111
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Card, {
112
- isFullHeight: true,
113
- isFlat: true,
114
- isSelectableRaised: true
115
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
116
- className: "pf-u-p-lg pf-u-pt-xl"
117
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.TextContent, {
118
- className: "pf-u-text-align-center"
119
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Text, {
120
- component: "p",
121
- className: "pf-u-mb-sm"
122
- }, favorite.name), /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Text, {
123
- component: "p",
124
- className: "pf-u-font-size-xs"
125
- }, getBundle(favorite.pathname)))))));
126
- });
127
- };
128
- return /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Flex, null, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.FlexItem, null, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.TextContent, null, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Text, {
129
- component: _patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.TextVariants.h2,
130
- className: "pf-u-display-inline pf-u-pr-lg"
131
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Icon, {
132
- className: "pf-u-mr-sm",
133
- status: "warning"
134
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_icons__WEBPACK_IMPORTED_MODULE_7__.StarIcon, null)), "My favorite services"), /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Text, {
135
- component: _patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.TextVariants.p,
136
- className: "pf-u-display-inline"
137
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChromeLink__WEBPACK_IMPORTED_MODULE_6__["default"], {
138
- href: "/allservices"
139
- }, "View all services")))), /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.FlexItem, {
140
- align: {
141
- default: "alignRight"
142
- }
143
- }, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Pagination, {
144
- perPageComponent: "button",
145
- isCompact: true,
146
- variant: "top",
147
- itemCount: favoritedServices.length,
148
- page: page,
149
- perPage: perPage,
150
- onPerPageSelect: onPerPageSelect,
151
- onSetPage: onSetPage,
152
- widgetId: "favorites-cards-pagination",
153
- className: "chr-c-pagination-landing-favorites"
154
- }))), favoritedServices.length === 0 ? /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_FavoriteServices_EmptyState__WEBPACK_IMPORTED_MODULE_3__["default"], null) : /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_patternfly_react_core__WEBPACK_IMPORTED_MODULE_0__.Gallery, {
155
- hasGutter: true
156
- }, buildFavorites())));
157
- };
158
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LandingNavFavorites);
159
-
160
-
161
- /***/ }),
162
-
163
- /***/ "./src/hooks/useBundle.ts":
164
- /*!********************************!*\
165
- !*** ./src/hooks/useBundle.ts ***!
166
- \********************************/
167
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
168
-
169
- __webpack_require__.r(__webpack_exports__);
170
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
171
- /* harmony export */ "bundleMapping": () => (/* binding */ bundleMapping),
172
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
173
- /* harmony export */ "getUrl": () => (/* binding */ getUrl),
174
- /* harmony export */ "isAnsible": () => (/* binding */ isAnsible)
175
- /* harmony export */ });
176
- var isAnsible = function(sections) {
177
- return sections.includes("ansible") && sections.includes("insights") ? 1 : 0;
178
- };
179
- function getUrl(type) {
180
- if ([
181
- "/",
182
- "/beta",
183
- "/beta/",
184
- "/preview",
185
- "/preview/"
186
- ].includes(window.location.pathname)) {
187
- return "landing";
188
- }
189
- var sections = window.location.pathname.split("/");
190
- if ([
191
- "beta",
192
- "preview"
193
- ].includes(sections[1])) {
194
- return type === "bundle" ? sections[2] : sections[3 + isAnsible(sections)];
195
- }
196
- return type === "bundle" ? sections[1] : sections[2 + isAnsible(sections)];
197
- }
198
- var bundleMapping = {
199
- "application-services": "Application and Data Services",
200
- openshift: "OpenShift",
201
- ansible: "Ansible Automation Platform",
202
- insights: "Red Hat Insights",
203
- edge: "Edge management",
204
- settings: "Settings",
205
- landing: "Home",
206
- allservices: "Home",
207
- iam: "Identity & Access Management",
208
- internal: "Internal",
209
- quay: "Quay.io"
210
- };
211
- var useBundle = function() {
212
- var bundleId = getUrl("bundle");
213
- return {
214
- bundleId: bundleId,
215
- bundleTitle: bundleMapping[bundleId] || bundleId
216
- };
217
- };
218
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useBundle);
219
-
220
-
221
- /***/ }),
222
-
223
- /***/ "./src/utils/common.ts":
224
- /*!*****************************!*\
225
- !*** ./src/utils/common.ts ***!
226
- \*****************************/
227
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
228
-
229
- __webpack_require__.r(__webpack_exports__);
230
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
231
- /* harmony export */ "BLOCK_CLEAR_GATEWAY_ERROR": () => (/* binding */ BLOCK_CLEAR_GATEWAY_ERROR),
232
- /* harmony export */ "DEFAULT_SSO_ROUTES": () => (/* binding */ DEFAULT_SSO_ROUTES),
233
- /* harmony export */ "ITLess": () => (/* binding */ ITLess),
234
- /* harmony export */ "LOGIN_SCOPES_STORAGE_KEY": () => (/* binding */ LOGIN_SCOPES_STORAGE_KEY),
235
- /* harmony export */ "chromeServiceStaticPathname": () => (/* binding */ chromeServiceStaticPathname),
236
- /* harmony export */ "chunkLoadErrorRefreshKey": () => (/* binding */ chunkLoadErrorRefreshKey),
237
- /* harmony export */ "createReduxListener": () => (/* binding */ createReduxListener),
238
- /* harmony export */ "deleteLocalStorageItems": () => (/* binding */ deleteLocalStorageItems),
239
- /* harmony export */ "findNavLeafPath": () => (/* binding */ findNavLeafPath),
240
- /* harmony export */ "generateRoutesList": () => (/* binding */ generateRoutesList),
241
- /* harmony export */ "getChromeStaticPathname": () => (/* binding */ getChromeStaticPathname),
242
- /* harmony export */ "getEnv": () => (/* binding */ getEnv),
243
- /* harmony export */ "getEnvDetails": () => (/* binding */ getEnvDetails),
244
- /* harmony export */ "getRouterBasename": () => (/* binding */ getRouterBasename),
245
- /* harmony export */ "getSection": () => (/* binding */ getSection),
246
- /* harmony export */ "getWindow": () => (/* binding */ getWindow),
247
- /* harmony export */ "highlightItems": () => (/* binding */ highlightItems),
248
- /* harmony export */ "isBeta": () => (/* binding */ isBeta),
249
- /* harmony export */ "isExpandableNav": () => (/* binding */ isExpandableNav),
250
- /* harmony export */ "isGlobalFilterAllowed": () => (/* binding */ isGlobalFilterAllowed),
251
- /* harmony export */ "isProd": () => (/* binding */ isProd),
252
- /* harmony export */ "isValidAccountNumber": () => (/* binding */ isValidAccountNumber),
253
- /* harmony export */ "lastActive": () => (/* binding */ lastActive),
254
- /* harmony export */ "levelArray": () => (/* binding */ levelArray),
255
- /* harmony export */ "loadFEOFedModules": () => (/* binding */ loadFEOFedModules),
256
- /* harmony export */ "loadFedModules": () => (/* binding */ loadFedModules),
257
- /* harmony export */ "noop": () => (/* binding */ noop),
258
- /* harmony export */ "pageAllowsUnentitled": () => (/* binding */ pageAllowsUnentitled),
259
- /* harmony export */ "pageRequiresAuthentication": () => (/* binding */ pageRequiresAuthentication),
260
- /* harmony export */ "trustarcScriptSetup": () => (/* binding */ trustarcScriptSetup),
261
- /* harmony export */ "updateDocumentTitle": () => (/* binding */ updateDocumentTitle)
262
- /* harmony export */ });
263
- /* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/get */ "./node_modules/lodash/get.js");
264
- /* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_0__);
265
- /* harmony import */ var lodash_flatMap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/flatMap */ "./node_modules/lodash/flatMap.js");
266
- /* harmony import */ var lodash_flatMap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_flatMap__WEBPACK_IMPORTED_MODULE_1__);
267
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
268
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);
269
- /* harmony import */ var _hooks_useBundle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/useBundle */ "./src/hooks/useBundle.ts");
270
- function _arrayLikeToArray(arr, len) {
271
- if (len == null || len > arr.length) len = arr.length;
272
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
273
- return arr2;
274
- }
275
- function _arrayWithHoles(arr) {
276
- if (Array.isArray(arr)) return arr;
277
- }
278
- function _arrayWithoutHoles(arr) {
279
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
280
- }
281
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
282
- try {
283
- var info = gen[key](arg);
284
- var value = info.value;
285
- } catch (error) {
286
- reject(error);
287
- return;
288
- }
289
- if (info.done) {
290
- resolve(value);
291
- } else {
292
- Promise.resolve(value).then(_next, _throw);
293
- }
294
- }
295
- function _asyncToGenerator(fn) {
296
- return function() {
297
- var self = this, args = arguments;
298
- return new Promise(function(resolve, reject) {
299
- var gen = fn.apply(self, args);
300
- function _next(value) {
301
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
302
- }
303
- function _throw(err) {
304
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
305
- }
306
- _next(undefined);
307
- });
308
- };
309
- }
310
- function _defineProperty(obj, key, value) {
311
- if (key in obj) {
312
- Object.defineProperty(obj, key, {
313
- value: value,
314
- enumerable: true,
315
- configurable: true,
316
- writable: true
317
- });
318
- } else {
319
- obj[key] = value;
320
- }
321
- return obj;
322
- }
323
- function _iterableToArray(iter) {
324
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
325
- }
326
- function _iterableToArrayLimit(arr, i) {
327
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
328
- if (_i == null) return;
329
- var _arr = [];
330
- var _n = true;
331
- var _d = false;
332
- var _s, _e;
333
- try {
334
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
335
- _arr.push(_s.value);
336
- if (i && _arr.length === i) break;
337
- }
338
- } catch (err) {
339
- _d = true;
340
- _e = err;
341
- } finally{
342
- try {
343
- if (!_n && _i["return"] != null) _i["return"]();
344
- } finally{
345
- if (_d) throw _e;
346
- }
347
- }
348
- return _arr;
349
- }
350
- function _nonIterableRest() {
351
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
352
- }
353
- function _nonIterableSpread() {
354
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
355
- }
356
- function _objectSpread(target) {
357
- for(var i = 1; i < arguments.length; i++){
358
- var source = arguments[i] != null ? arguments[i] : {};
359
- var ownKeys = Object.keys(source);
360
- if (typeof Object.getOwnPropertySymbols === "function") {
361
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
362
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
363
- }));
364
- }
365
- ownKeys.forEach(function(key) {
366
- _defineProperty(target, key, source[key]);
367
- });
368
- }
369
- return target;
370
- }
371
- function ownKeys(object, enumerableOnly) {
372
- var keys = Object.keys(object);
373
- if (Object.getOwnPropertySymbols) {
374
- var symbols = Object.getOwnPropertySymbols(object);
375
- if (enumerableOnly) {
376
- symbols = symbols.filter(function(sym) {
377
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
378
- });
379
- }
380
- keys.push.apply(keys, symbols);
381
- }
382
- return keys;
383
- }
384
- function _objectSpreadProps(target, source) {
385
- source = source != null ? source : {};
386
- if (Object.getOwnPropertyDescriptors) {
387
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
388
- } else {
389
- ownKeys(Object(source)).forEach(function(key) {
390
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
391
- });
392
- }
393
- return target;
394
- }
395
- function _slicedToArray(arr, i) {
396
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
397
- }
398
- function _toConsumableArray(arr) {
399
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
400
- }
401
- var _typeof = function(obj) {
402
- "@swc/helpers - typeof";
403
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
404
- };
405
- function _unsupportedIterableToArray(o, minLen) {
406
- if (!o) return;
407
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
408
- var n = Object.prototype.toString.call(o).slice(8, -1);
409
- if (n === "Object" && o.constructor) n = o.constructor.name;
410
- if (n === "Map" || n === "Set") return Array.from(n);
411
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
412
- }
413
- var __generator = undefined && undefined.__generator || function(thisArg, body) {
414
- var f, y, t, g, _ = {
415
- label: 0,
416
- sent: function() {
417
- if (t[0] & 1) throw t[1];
418
- return t[1];
419
- },
420
- trys: [],
421
- ops: []
422
- };
423
- return(g = {
424
- next: verb(0),
425
- "throw": verb(1),
426
- "return": verb(2)
427
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
428
- return this;
429
- }), g);
430
- function verb(n) {
431
- return function(v) {
432
- return step([
433
- n,
434
- v
435
- ]);
436
- };
437
- }
438
- function step(op) {
439
- if (f) throw new TypeError("Generator is already executing.");
440
- while(_)try {
441
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
442
- if (y = 0, t) op = [
443
- op[0] & 2,
444
- t.value
445
- ];
446
- switch(op[0]){
447
- case 0:
448
- case 1:
449
- t = op;
450
- break;
451
- case 4:
452
- _.label++;
453
- return {
454
- value: op[1],
455
- done: false
456
- };
457
- case 5:
458
- _.label++;
459
- y = op[1];
460
- op = [
461
- 0
462
- ];
463
- continue;
464
- case 7:
465
- op = _.ops.pop();
466
- _.trys.pop();
467
- continue;
468
- default:
469
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
470
- _ = 0;
471
- continue;
472
- }
473
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
474
- _.label = op[1];
475
- break;
476
- }
477
- if (op[0] === 6 && _.label < t[1]) {
478
- _.label = t[1];
479
- t = op;
480
- break;
481
- }
482
- if (t && _.label < t[2]) {
483
- _.label = t[2];
484
- _.ops.push(op);
485
- break;
486
- }
487
- if (t[2]) _.ops.pop();
488
- _.trys.pop();
489
- continue;
490
- }
491
- op = body.call(thisArg, _);
492
- } catch (e) {
493
- op = [
494
- 6,
495
- e
496
- ];
497
- y = 0;
498
- } finally{
499
- f = t = 0;
500
- }
501
- if (op[0] & 5) throw op[1];
502
- return {
503
- value: op[0] ? op[1] : void 0,
504
- done: true
505
- };
506
- }
507
- };
508
-
509
-
510
-
511
-
512
- var DEFAULT_SSO_ROUTES = {
513
- prod: {
514
- url: [
515
- "access.redhat.com",
516
- "prod.foo.redhat.com",
517
- "cloud.redhat.com",
518
- "console.redhat.com"
519
- ],
520
- sso: "https://sso.redhat.com/auth",
521
- portal: "https://access.redhat.com"
522
- },
523
- qa: {
524
- url: [
525
- "qa.foo.redhat.com",
526
- "qa.cloud.redhat.com",
527
- "qa.console.redhat.com"
528
- ],
529
- sso: "https://sso.qa.redhat.com/auth",
530
- portal: "https://access.qa.redhat.com"
531
- },
532
- ci: {
533
- url: [
534
- "ci.foo.redhat.com",
535
- "ci.cloud.redhat.com",
536
- "ci.console.redhat.com"
537
- ],
538
- sso: "https://sso.qa.redhat.com/auth",
539
- portal: "https://access.qa.redhat.com"
540
- },
541
- qaprodauth: {
542
- url: [
543
- "qaprodauth.foo.redhat.com",
544
- "qaprodauth.cloud.redhat.com",
545
- "qaprodauth.console.redhat.com"
546
- ],
547
- sso: "https://sso.redhat.com/auth",
548
- portal: "https://access.redhat.com"
549
- },
550
- stage: {
551
- url: [
552
- "stage.foo.redhat.com",
553
- "cloud.stage.redhat.com",
554
- "console.stage.redhat.com",
555
- "fetest.stage.redhat.com"
556
- ],
557
- sso: "https://sso.stage.redhat.com/auth",
558
- portal: "https://access.stage.redhat.com"
559
- },
560
- frh: {
561
- url: [
562
- "console.stage.openshiftusgov.com"
563
- ],
564
- sso: "https://ocm-ra-stage-domain.auth-fips.us-gov-west-1.amazoncognito.com/login",
565
- portal: "https://console.stage.openshiftusgov.com"
566
- },
567
- frhStage: {
568
- url: [
569
- "ephem.outsrights.cc"
570
- ],
571
- sso: "https://stage-gov-console.auth.us-east-1.amazoncognito.com/login",
572
- portal: "https://ephem.outsrights.cc/"
573
- },
574
- dev: {
575
- url: [
576
- "dev.foo.redhat.com",
577
- "console.dev.redhat.com"
578
- ],
579
- sso: "https://sso.redhat.com/auth",
580
- portal: "https://access.redhat.com"
581
- }
582
- };
583
- var LOGIN_SCOPES_STORAGE_KEY = "@chrome/login-scopes";
584
- var chunkLoadErrorRefreshKey = "ChunkLoadErrorRefreshed";
585
- var BLOCK_CLEAR_GATEWAY_ERROR = "BLOCK_CLEAR_GATEWAY_ERROR";
586
- function getWindow() {
587
- return window;
588
- }
589
- function isValidAccountNumber(num) {
590
- if (!num) return false;
591
- if (num === -1) return false;
592
- if (num === "-1") return false;
593
- return Number.isInteger(Number(num));
594
- }
595
- function getSection() {
596
- var sections = getWindow().location.pathname.split("/");
597
- if (sections[1] === "beta") {
598
- return sections[2] || "";
599
- }
600
- return sections[1];
601
- }
602
- function pageAllowsUnentitled() {
603
- var pathname = getWindow().location.pathname;
604
- if (pathname === "/" || pathname === "/beta" || pathname === "/beta/" || pathname === "/preview" || pathname === "/preview/" || pathname.indexOf("/openshift") === 0 || pathname.indexOf("/beta/openshift") === 0 || pathname.indexOf("/preview/openshift") === 0 || pathname.indexOf("/security") === 0 || pathname.indexOf("/beta/security") === 0 || pathname.indexOf("/preview/security") === 0 || pathname.indexOf("/application-services") === 0 || pathname.indexOf("/beta/application-services") === 0 || pathname.indexOf("/preview/application-services") === 0 || pathname.indexOf("/hac") === 0 || pathname.indexOf("/beta/hac") === 0 || pathname.indexOf("/preview/hac") === 0 || pathname.indexOf("/ansible/ansible-dashboard/trial") === 0 || pathname.indexOf("/beta/ansible/ansible-dashboard/trial") === 0 || pathname.indexOf("/preview/ansible/ansible-dashboard/trial") === 0 || // allow tenants with no account numbers: RHCLOUD-21396
605
- pathname.match(/\/connect\//)) {
606
- return true;
607
- }
608
- return false;
609
- }
610
- function pageRequiresAuthentication() {
611
- var section = getSection();
612
- if (section === "insights" || section === "cost-management" || section === "apps" || section === "ansible" || section === "migrations" || section === "subscriptions" || section === "openshift" || section === "settings" || section === "user-preferences" || section === "internal" || section === "application-services") {
613
- return true;
614
- }
615
- return false;
616
- }
617
- /**
618
- * Creates a redux listener that watches the state on given path (e.g. chrome.appNav) and calls
619
- * the given function when the state on the given path changes.
620
- *
621
- * The function is called with two parameters: current state value on the path, store reference
622
- */ function createReduxListener(store, path, fn) {
623
- var previous = undefined;
624
- return function() {
625
- var state = store.getState();
626
- var current = lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(state, path);
627
- if (current !== previous) {
628
- previous = current;
629
- fn(current, store);
630
- }
631
- };
632
- }
633
- function deleteLocalStorageItems(keys) {
634
- keys.map(function(key) {
635
- return localStorage.removeItem(key);
636
- });
637
- }
638
- function lastActive(searchString, fallback) {
639
- return Object.keys(localStorage).reduce(function(acc, curr) {
640
- if (curr.includes(searchString)) {
641
- try {
642
- var accDate;
643
- try {
644
- var _JSON_parse;
645
- var localStorageDate = localStorage.getItem(acc);
646
- accDate = localStorageDate ? new Date((_JSON_parse = JSON.parse(localStorageDate)) === null || _JSON_parse === void 0 ? void 0 : _JSON_parse.expires) : new Date();
647
- } catch (e) {
648
- accDate = new Date();
649
- }
650
- var currObj = JSON.parse(localStorage.getItem(curr) || "");
651
- return accDate >= new Date(currObj.expires) ? acc : curr;
652
- } catch (e) {
653
- return acc;
654
- }
655
- }
656
- return acc;
657
- }, fallback);
658
- }
659
- function getEnv() {
660
- var _Object_entries_find;
661
- return ((_Object_entries_find = Object.entries(DEFAULT_SSO_ROUTES).find(function(param) {
662
- var _param = _slicedToArray(param, 2), url = _param[1].url;
663
- return url.includes(location.hostname);
664
- })) === null || _Object_entries_find === void 0 ? void 0 : _Object_entries_find[0]) || "qa";
665
- }
666
- function getEnvDetails() {
667
- var _Object_entries_find;
668
- return (_Object_entries_find = Object.entries(DEFAULT_SSO_ROUTES).find(function(param) {
669
- var _param = _slicedToArray(param, 2), url = _param[1].url;
670
- return url.includes(location.hostname);
671
- })) === null || _Object_entries_find === void 0 ? void 0 : _Object_entries_find[1];
672
- }
673
- function isProd() {
674
- return location.host === "cloud.redhat.com" || location.host === "console.redhat.com" || location.host.includes("prod.foo.redhat.com");
675
- }
676
- function isBeta(pathname) {
677
- var previewFragment = (pathname !== null && pathname !== void 0 ? pathname : window.location.pathname).split("/")[1];
678
- return [
679
- "beta",
680
- "preview"
681
- ].includes(previewFragment);
682
- }
683
- function getRouterBasename(pathname) {
684
- var previewFragment = (pathname !== null && pathname !== void 0 ? pathname : window.location.pathname).split("/")[1];
685
- return isBeta(pathname) ? "/".concat(previewFragment) : "/";
686
- }
687
- function ITLess() {
688
- return getEnv() === "frh" || getEnv() === "frhStage";
689
- }
690
- function updateDocumentTitle(title) {
691
- var noSuffix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
692
- var titleSuffix = "| ".concat((0,_hooks_useBundle__WEBPACK_IMPORTED_MODULE_3__["default"])().bundleTitle);
693
- if (typeof title === "undefined") {
694
- return;
695
- }
696
- if (typeof title === "string") {
697
- document.title = title.includes(titleSuffix) || noSuffix ? title : "".concat(title, " ").concat(titleSuffix);
698
- } else {
699
- console.warn("Title is not a string. Got ".concat(typeof title === "undefined" ? "undefined" : _typeof(title), " instead."));
700
- }
701
- }
702
- var activateChild = function(hrefMatch, childRoutes) {
703
- var hasActiveChild = false;
704
- var routes = childRoutes.map(function(item) {
705
- // If expandable traverse children again
706
- if (item.expandable) {
707
- var nestedResult = activateChild(hrefMatch, item.routes || []);
708
- // mark active if nested child is active
709
- if (nestedResult.active) {
710
- hasActiveChild = true;
711
- }
712
- return _objectSpreadProps(_objectSpread({}, item), {
713
- active: nestedResult.active,
714
- routes: nestedResult.routes
715
- });
716
- }
717
- var active = item.href === hrefMatch;
718
- if (active) {
719
- hasActiveChild = true;
720
- }
721
- return _objectSpreadProps(_objectSpread({}, item), {
722
- active: active
723
- });
724
- });
725
- return {
726
- active: hasActiveChild,
727
- routes: routes
728
- };
729
- };
730
- function mutateSchema(hrefMatch, navItems) {
731
- return navItems.map(function(item) {
732
- var href = item.href, routes = item.routes, _$navItems = item.navItems;
733
- if (!href && _$navItems) {
734
- return _objectSpreadProps(_objectSpread({}, item), {
735
- navItems: mutateSchema(hrefMatch, _$navItems)
736
- });
737
- }
738
- if (!href && routes) {
739
- return _objectSpread({}, item, activateChild(hrefMatch, routes));
740
- }
741
- if (href) {
742
- return _objectSpreadProps(_objectSpread({}, item), {
743
- active: item.href === hrefMatch
744
- });
745
- }
746
- return item;
747
- });
748
- }
749
- var highlightItems = function(pathname, navItems, sortedLinks) {
750
- var cleanPathname = pathname.replace(/\/$/, "");
751
- var segmentsCount = cleanPathname.split("/").length + 1;
752
- var matchedLink = sortedLinks.find(function(href) {
753
- var segmentedHref = href.replace(/\/$/, "").split("/").slice(0, segmentsCount).join("/");
754
- return cleanPathname.includes(segmentedHref);
755
- });
756
- return mutateSchema((matchedLink === null || matchedLink === void 0 ? void 0 : matchedLink.replace(/\/$/, "")) || "", navItems);
757
- };
758
- var levelArray = function(navItems) {
759
- return lodash_flatMap__WEBPACK_IMPORTED_MODULE_1___default()(navItems, function(param) {
760
- var href = param.href, routes = param.routes, _$navItems = param.navItems;
761
- if (!href && _$navItems) {
762
- return levelArray(_$navItems);
763
- }
764
- if (!href && routes) {
765
- return levelArray(routes);
766
- }
767
- if (href) {
768
- return [
769
- href
770
- ];
771
- }
772
- return [];
773
- });
774
- };
775
- // eslint-disable-next-line @typescript-eslint/no-empty-function
776
- function noop() {}
777
- var trustarcScriptSetup = function() {
778
- var trustarcScript = document.createElement("script");
779
- trustarcScript.id = "trustarc";
780
- if (location.host === "console.redhat.com") {
781
- trustarcScript.src = "//static.redhat.com/libs/redhat/marketing/latest/trustarc/trustarc.js";
782
- } else {
783
- trustarcScript.src = "//static.redhat.com/libs/redhat/marketing/latest/trustarc/trustarc.stage.js";
784
- }
785
- document.body.appendChild(trustarcScript);
786
- };
787
- var CHROME_SERVICE_BASE = "/api/chrome-service/v1";
788
- var chromeServiceStaticPathname = {
789
- beta: {
790
- stage: "/static/beta/stage",
791
- prod: "/static/beta/prod"
792
- },
793
- stable: {
794
- stage: "/static/stable/stage",
795
- prod: "/static/stable/prod"
796
- }
797
- };
798
- function getChromeStaticPathname(type) {
799
- var stableEnv = isBeta() ? "beta" : "stable";
800
- var prodEnv = isProd() ? "prod" : "stage";
801
- return "".concat(CHROME_SERVICE_BASE).concat(chromeServiceStaticPathname[stableEnv][prodEnv], "/").concat(type);
802
- }
803
- var fedModulesheaders = {
804
- "Cache-Control": "no-cache",
805
- Pragma: "no-cache",
806
- Expires: "0"
807
- };
808
- var loadFEOFedModules = function() {
809
- return axios__WEBPACK_IMPORTED_MODULE_2___default().get("".concat(window.location.origin).concat(isBeta() ? "/beta" : "", "/config/chrome/fed-modules.json?ts=").concat(Date.now()), {
810
- headers: fedModulesheaders
811
- });
812
- };
813
- var loadFedModules = function() {
814
- var _ref = _asyncToGenerator(function() {
815
- return __generator(this, function(_state) {
816
- return [
817
- 2,
818
- axios__WEBPACK_IMPORTED_MODULE_2___default().get("".concat(getChromeStaticPathname("modules"), "/fed-modules.json"), {
819
- headers: fedModulesheaders
820
- })
821
- ];
822
- });
823
- });
824
- return function loadFedModules() {
825
- return _ref.apply(this, arguments);
826
- };
827
- }();
828
- var generateRoutesList = function(modules) {
829
- return Object.entries(modules).reduce(function(acc, param) {
830
- var _param = _slicedToArray(param, 2), scope = _param[0], _param_ = _param[1], dynamic = _param_.dynamic, manifestLocation = _param_.manifestLocation, isFedramp = _param_.isFedramp, _param__modules = _param_.modules, _$modules = _param__modules === void 0 ? [] : _param__modules;
831
- return _toConsumableArray(acc).concat(_toConsumableArray(_$modules.map(function(param) {
832
- var module = param.module, routes = param.routes;
833
- return /**Clean up this map function */ routes.map(function(route) {
834
- return {
835
- scope: scope,
836
- module: module,
837
- isFedramp: typeof route === "string" ? isFedramp : route.isFedramp,
838
- path: typeof route === "string" ? route : route.pathname,
839
- manifestLocation: manifestLocation,
840
- dynamic: typeof dynamic === "boolean" ? dynamic : typeof route === "string" ? true : route.dynamic,
841
- exact: typeof route === "string" ? false : route.exact,
842
- props: typeof route === "object" ? route.props : undefined
843
- };
844
- });
845
- }).flat()));
846
- }, []).sort(function(a, b) {
847
- return a.path.length < b.path.length ? 1 : -1;
848
- });
849
- };
850
- var isGlobalFilterAllowed = function() {
851
- if ((0,_hooks_useBundle__WEBPACK_IMPORTED_MODULE_3__.getUrl)("bundle") === "insights") {
852
- return true;
853
- }
854
- return (0,_hooks_useBundle__WEBPACK_IMPORTED_MODULE_3__.getUrl)("bundle") === "ansible" && [
855
- "inventory",
856
- "drift",
857
- "advisor"
858
- ].includes((0,_hooks_useBundle__WEBPACK_IMPORTED_MODULE_3__.getUrl)("app"));
859
- };
860
- function isExpandableNav(item) {
861
- return !!item.expandable;
862
- }
863
- function isActiveLeaf(item) {
864
- return typeof (item === null || item === void 0 ? void 0 : item.href) === "string" && (item === null || item === void 0 ? void 0 : item.active) === true;
865
- }
866
- function findNavLeafPath(navItems) {
867
- var matcher = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : isActiveLeaf;
868
- var leaf;
869
- // store the parent nodes
870
- var leafPath = [];
871
- var index = 0;
872
- while(leaf === undefined && index < navItems.length){
873
- var item = navItems[index];
874
- index += 1;
875
- if (item && isExpandableNav(item)) {
876
- var _ref = findNavLeafPath(item.routes, matcher) || {}, activeItem = _ref.activeItem, _$navItems = _ref.navItems;
877
- if (activeItem) {
878
- var // append parent nodes of an active item
879
- _leafPath;
880
- leaf = activeItem;
881
- (_leafPath = leafPath).push.apply(_leafPath, [
882
- item
883
- ].concat(_toConsumableArray(_$navItems)));
884
- }
885
- } else if (matcher(item) && (item === null || item === void 0 ? void 0 : item.href)) {
886
- leaf = item;
887
- }
888
- }
889
- return {
890
- activeItem: leaf,
891
- navItems: leafPath
892
- };
893
- }
894
-
895
-
896
- /***/ })
897
-
898
- }]);