@bigbinary/neeto-molecules 1.11.7 → 1.12.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/ConfigurePageSidebar.js +41 -0
- package/dist/ConfigurePageSidebar.js.map +1 -0
- package/dist/FloatingActionMenu.js +115 -43
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/Sidebar.js +95 -426
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/ConfigurePageSidebar.js +47 -0
- package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
- package/dist/cjs/FloatingActionMenu.js +115 -42
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/Sidebar.js +95 -427
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/sidebar-99f98b4d.js +490 -0
- package/dist/cjs/sidebar-99f98b4d.js.map +1 -0
- package/dist/sidebar-a127705a.js +457 -0
- package/dist/sidebar-a127705a.js.map +1 -0
- package/package.json +2 -2
- package/src/translations/en.json +1 -0
- package/types/ConfigurePageSidebar.d.ts +40 -0
- package/types/Sidebar.d.ts +1 -0
package/dist/cjs/Sidebar.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var slicedToArray = require('./slicedToArray-f320d9e7.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
6
7
|
var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
|
|
7
8
|
var useLocalStorage = require('@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage');
|
|
8
9
|
var neetoui = require('@bigbinary/neetoui');
|
|
@@ -11,9 +12,9 @@ var reactI18next = require('react-i18next');
|
|
|
11
12
|
var reactRouterDom = require('react-router-dom');
|
|
12
13
|
var useFetchNeetoApps = require('@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps');
|
|
13
14
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
15
|
+
var sidebar = require('./sidebar-99f98b4d.js');
|
|
14
16
|
var injectCss = require('./inject-css-80a5faa3.js');
|
|
15
17
|
var _extends = require('./extends-1b35a664.js');
|
|
16
|
-
var neetoCist = require('@bigbinary/neeto-cist');
|
|
17
18
|
var AppIcons = require('@bigbinary/neeto-icons/app-icons');
|
|
18
19
|
var i18next = require('i18next');
|
|
19
20
|
var axios = require('@bigbinary/neeto-commons-frontend/utils/axios');
|
|
@@ -23,14 +24,14 @@ var defineProperty = require('./defineProperty-886ed289.js');
|
|
|
23
24
|
var objectWithoutProperties = require('./objectWithoutProperties-2fed2d7d.js');
|
|
24
25
|
var KeyboardShortcuts = require('./KeyboardShortcuts.js');
|
|
25
26
|
var ProductTypefaceLogos = require('@bigbinary/neeto-icons/typeface-logos');
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
require('@bigbinary/neeto-commons-frontend/constants');
|
|
28
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint');
|
|
29
|
+
require('@bigbinary/neeto-filters-frontend');
|
|
30
|
+
require('react-router-dom/cjs/react-router-dom.min');
|
|
31
|
+
require('./MoreDropdown.js');
|
|
32
|
+
require('@bigbinary/neeto-commons-frontend/utils');
|
|
33
|
+
require('@bigbinary/neetoui/formik');
|
|
34
|
+
require('yup');
|
|
34
35
|
require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
|
|
35
36
|
require('zustand');
|
|
36
37
|
require('zustand/shallow');
|
|
@@ -64,23 +65,22 @@ var useLocalStorage__default = /*#__PURE__*/_interopDefaultLegacy(useLocalStorag
|
|
|
64
65
|
var useFetchNeetoApps__default = /*#__PURE__*/_interopDefaultLegacy(useFetchNeetoApps);
|
|
65
66
|
var AppIcons__namespace = /*#__PURE__*/_interopNamespace(AppIcons);
|
|
66
67
|
var ProductTypefaceLogos__namespace = /*#__PURE__*/_interopNamespace(ProductTypefaceLogos);
|
|
67
|
-
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
68
68
|
|
|
69
69
|
var Chevron = function Chevron(_ref) {
|
|
70
70
|
var style = _ref.style;
|
|
71
71
|
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
72
|
+
style: style,
|
|
72
73
|
height: "16",
|
|
73
74
|
viewBox: "0 0 16 16",
|
|
74
|
-
width: "16"
|
|
75
|
-
style: style
|
|
75
|
+
width: "16"
|
|
76
76
|
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
77
77
|
d: "M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z",
|
|
78
78
|
fill: "currentColor"
|
|
79
79
|
}));
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
var css
|
|
83
|
-
injectCss.n(css
|
|
82
|
+
var css = ".neeto-molecules-app-switcher__wrapper{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;justify-content:flex-start;max-width:100%;overflow-y:auto;padding:40px;position:relative;transition:all .3s;width:100%}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__wrapper{padding:32px}}@media screen and (max-width:768px){.neeto-molecules-app-switcher__wrapper{padding:0}}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(100%,1fr))}}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:32px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}@media only screen and (max-width:768px){.neeto-molecules-app-switcher__header{align-items:flex-start;flex-direction:column-reverse;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__header h1{font-size:24px}}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-app-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}";
|
|
83
|
+
injectCss.n(css,{});
|
|
84
84
|
|
|
85
85
|
var AppLink = function AppLink(_ref) {
|
|
86
86
|
var name = _ref.name,
|
|
@@ -176,9 +176,6 @@ var AppSwitcher = function AppSwitcher() {
|
|
|
176
176
|
}, /*#__PURE__*/React__default["default"].createElement(Body, null));
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:240px;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-1)}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:15px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:15px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}.neeto-molecules-sidebar-segments-header{padding-left:58px}";
|
|
180
|
-
injectCss.n(css,{});
|
|
181
|
-
|
|
182
179
|
var AppSwitcherButton = function AppSwitcherButton() {
|
|
183
180
|
var _useTranslation = reactI18next.useTranslation(),
|
|
184
181
|
t = _useTranslation.t;
|
|
@@ -227,71 +224,6 @@ var AppSwitcherButton = function AppSwitcherButton() {
|
|
|
227
224
|
}, t("neetoMolecules.sidebar.productSwitcher"))));
|
|
228
225
|
};
|
|
229
226
|
|
|
230
|
-
var shouldShowWhatsNew = function shouldShowWhatsNew() {
|
|
231
|
-
var _window$globalProps, _window$globalProps$u;
|
|
232
|
-
var currentUserEmail = (_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : (_window$globalProps$u = _window$globalProps.user) === null || _window$globalProps$u === void 0 ? void 0 : _window$globalProps$u.email;
|
|
233
|
-
return window.location.hostname === "localhost" || currentUserEmail === "oliver@example.com" || (currentUserEmail === null || currentUserEmail === void 0 ? void 0 : currentUserEmail.endsWith("@bigbinary.com"));
|
|
234
|
-
};
|
|
235
|
-
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
236
|
-
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
237
|
-
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
238
|
-
var SUB_LINK_TYPES = {
|
|
239
|
-
SYSTEM_VIEW: "system_view",
|
|
240
|
-
SEGMENT: "segment"
|
|
241
|
-
};
|
|
242
|
-
var DEFAULT_HELP_LINK_PROPS = {
|
|
243
|
-
liveChatProps: {
|
|
244
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.liveChat"),
|
|
245
|
-
icon: neetoIcons.ChatEmpty,
|
|
246
|
-
"data-cy": "help-link-live-chat-button",
|
|
247
|
-
onClick: function onClick() {
|
|
248
|
-
var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
|
|
249
|
-
(_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
|
|
250
|
-
(_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
helpCenterProps: {
|
|
254
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
255
|
-
icon: neetoIcons.Book,
|
|
256
|
-
"data-cy": "help-link-help-center-button",
|
|
257
|
-
href: "https://help.".concat(ramda.toLower(globalProps.appName), ".com/"),
|
|
258
|
-
target: "_blank"
|
|
259
|
-
},
|
|
260
|
-
changelogProps: {
|
|
261
|
-
id: CHANGELOG_WIDGET_TRIGGER_ID,
|
|
262
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
263
|
-
icon: neetoIcons.Gift,
|
|
264
|
-
"data-cy": "help-link-changelog-button",
|
|
265
|
-
isVisible: shouldShowWhatsNew
|
|
266
|
-
},
|
|
267
|
-
keyboardShortcutProps: {
|
|
268
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
269
|
-
icon: neetoIcons.Keyboard,
|
|
270
|
-
"data-cy": "help-link-keyboard-shortcut-button"
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
275
|
-
var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
|
|
276
|
-
var targetUrl = new URL(subRoute, window.location.origin);
|
|
277
|
-
if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
|
-
var targetSearchParams = targetUrl.searchParams;
|
|
281
|
-
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
282
|
-
if (neetoCist.isPresent(currentBrowserUrl.searchParams.get("segment_id"))) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
return ramda.all(function (key) {
|
|
286
|
-
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
287
|
-
}, targetSearchKeys);
|
|
288
|
-
};
|
|
289
|
-
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
290
|
-
var _globalProps$user, _globalProps$user2;
|
|
291
|
-
var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
|
|
292
|
-
return "sidebarState-".concat(user);
|
|
293
|
-
};
|
|
294
|
-
|
|
295
227
|
var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
296
228
|
var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
|
|
297
229
|
return ramda.mergeDeepLeft(profileInfoOverrides, {
|
|
@@ -302,14 +234,14 @@ var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
|
302
234
|
label: i18next.t("neetoMolecules.sidebar.myProfile"),
|
|
303
235
|
icon: neetoIcons.User,
|
|
304
236
|
onClick: function onClick() {
|
|
305
|
-
return window.open(MY_PROFILE_URL, "_blank");
|
|
237
|
+
return window.open(sidebar.MY_PROFILE_URL, "_blank");
|
|
306
238
|
},
|
|
307
239
|
"data-cy": "my-profile-button"
|
|
308
240
|
}, isOwner && {
|
|
309
241
|
label: i18next.t("neetoMolecules.sidebar.myOrganization"),
|
|
310
242
|
icon: neetoIcons.Settings,
|
|
311
243
|
onClick: function onClick() {
|
|
312
|
-
return window.open(MY_ORGANIZATION_URL, "_blank");
|
|
244
|
+
return window.open(sidebar.MY_ORGANIZATION_URL, "_blank");
|
|
313
245
|
},
|
|
314
246
|
"data-cy": "profile-organization-settings-button"
|
|
315
247
|
}].filter(Boolean),
|
|
@@ -318,7 +250,7 @@ var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
|
318
250
|
label: i18next.t("neetoMolecules.sidebar.logout"),
|
|
319
251
|
onClick: function onClick() {
|
|
320
252
|
axios.resetAuthTokens();
|
|
321
|
-
general.removeFromLocalStorage(getSidebarStateLocalStorageKey());
|
|
253
|
+
general.removeFromLocalStorage(sidebar.getSidebarStateLocalStorageKey());
|
|
322
254
|
// Directly attaching static "/logout" string should be safe as there are no dynamic values involved.
|
|
323
255
|
// eslint-disable-next-line xss/no-location-href-assign
|
|
324
256
|
window.location.href = "/logout";
|
|
@@ -364,9 +296,9 @@ var ProfileSection = function ProfileSection(_ref, ref) {
|
|
|
364
296
|
};
|
|
365
297
|
var ProfileSection$1 = /*#__PURE__*/React.forwardRef(ProfileSection);
|
|
366
298
|
|
|
367
|
-
var _excluded$
|
|
368
|
-
function ownKeys$
|
|
369
|
-
function _objectSpread$
|
|
299
|
+
var _excluded$2 = ["onClick", "label", "icon"];
|
|
300
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
301
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { defineProperty._defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
370
302
|
var LinkSection = function LinkSection(_ref) {
|
|
371
303
|
var links = _ref.links;
|
|
372
304
|
return /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
@@ -376,7 +308,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
376
308
|
label = _ref2.label,
|
|
377
309
|
_ref2$icon = _ref2.icon,
|
|
378
310
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
379
|
-
otherProps = objectWithoutProperties._objectWithoutProperties(_ref2, _excluded$
|
|
311
|
+
otherProps = objectWithoutProperties._objectWithoutProperties(_ref2, _excluded$2);
|
|
380
312
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
381
313
|
className: "neeto-molecules-profile-sublist__item",
|
|
382
314
|
key: idx
|
|
@@ -386,7 +318,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
386
318
|
iconPosition: "left",
|
|
387
319
|
iconSize: 18,
|
|
388
320
|
style: "text"
|
|
389
|
-
}, _objectSpread$
|
|
321
|
+
}, _objectSpread$2({
|
|
390
322
|
icon: icon,
|
|
391
323
|
label: label,
|
|
392
324
|
onClick: onClick
|
|
@@ -409,7 +341,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
409
341
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
410
342
|
className: classnames__default["default"]("neeto-ui-relative neeto-ui-flex neeto-ui-items-center neeto-ui-p-3 neeto-ui-bg-primary-100 neeto-molecules-profile-popup__top-section")
|
|
411
343
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
412
|
-
className: "
|
|
344
|
+
className: "left-0 top-0"
|
|
413
345
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Avatar, {
|
|
414
346
|
size: "large",
|
|
415
347
|
user: profileInfo
|
|
@@ -489,20 +421,20 @@ var HelpSection = function HelpSection(_ref, ref) {
|
|
|
489
421
|
};
|
|
490
422
|
var HelpSection$1 = /*#__PURE__*/React.forwardRef(HelpSection);
|
|
491
423
|
|
|
492
|
-
var _excluded$
|
|
493
|
-
function ownKeys$
|
|
494
|
-
function _objectSpread$
|
|
424
|
+
var _excluded$1 = ["label"];
|
|
425
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
426
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { defineProperty._defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
495
427
|
var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
496
428
|
var helpLinkOverrides = _ref.helpLinkOverrides,
|
|
497
429
|
changesCount = _ref.changesCount;
|
|
498
430
|
var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
|
|
499
431
|
_KeyboardShortcuts$us2 = slicedToArray._slicedToArray(_KeyboardShortcuts$us, 2),
|
|
500
432
|
setIsOpen = _KeyboardShortcuts$us2[1];
|
|
501
|
-
var helpLinks = Object.keys(DEFAULT_HELP_LINK_PROPS).filter(function (key) {
|
|
433
|
+
var helpLinks = Object.keys(sidebar.DEFAULT_HELP_LINK_PROPS).filter(function (key) {
|
|
502
434
|
var _DEFAULT_HELP_LINK_PR, _DEFAULT_HELP_LINK_PR2, _DEFAULT_HELP_LINK_PR3;
|
|
503
|
-
return (_DEFAULT_HELP_LINK_PR = (_DEFAULT_HELP_LINK_PR2 = (_DEFAULT_HELP_LINK_PR3 = DEFAULT_HELP_LINK_PROPS[key]).isVisible) === null || _DEFAULT_HELP_LINK_PR2 === void 0 ? void 0 : _DEFAULT_HELP_LINK_PR2.call(_DEFAULT_HELP_LINK_PR3)) !== null && _DEFAULT_HELP_LINK_PR !== void 0 ? _DEFAULT_HELP_LINK_PR : true;
|
|
435
|
+
return (_DEFAULT_HELP_LINK_PR = (_DEFAULT_HELP_LINK_PR2 = (_DEFAULT_HELP_LINK_PR3 = sidebar.DEFAULT_HELP_LINK_PROPS[key]).isVisible) === null || _DEFAULT_HELP_LINK_PR2 === void 0 ? void 0 : _DEFAULT_HELP_LINK_PR2.call(_DEFAULT_HELP_LINK_PR3)) !== null && _DEFAULT_HELP_LINK_PR !== void 0 ? _DEFAULT_HELP_LINK_PR : true;
|
|
504
436
|
}).map(function (key) {
|
|
505
|
-
return _objectSpread$
|
|
437
|
+
return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, sidebar.DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
|
|
506
438
|
onClick: function onClick() {
|
|
507
439
|
return setIsOpen(true);
|
|
508
440
|
}
|
|
@@ -517,7 +449,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
517
449
|
className: "neeto-molecules-help-sublist"
|
|
518
450
|
}, helpLinks.map(function (_ref3, idx) {
|
|
519
451
|
var label = _ref3.label,
|
|
520
|
-
buttonProps = objectWithoutProperties._objectWithoutProperties(_ref3, _excluded$
|
|
452
|
+
buttonProps = objectWithoutProperties._objectWithoutProperties(_ref3, _excluded$1);
|
|
521
453
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
522
454
|
className: "neeto-molecules-help-sublist__item",
|
|
523
455
|
key: idx
|
|
@@ -609,308 +541,27 @@ var Header = function Header(_ref) {
|
|
|
609
541
|
};
|
|
610
542
|
var Header$1 = /*#__PURE__*/React__default["default"].memo(Header);
|
|
611
543
|
|
|
612
|
-
var _excluded
|
|
613
|
-
var CheckPointNavLinks = function CheckPointNavLinks(_ref) {
|
|
614
|
-
var checkpointKey = _ref.checkpointKey,
|
|
615
|
-
to = _ref.to,
|
|
616
|
-
children = _ref.children,
|
|
617
|
-
others = objectWithoutProperties._objectWithoutProperties(_ref, _excluded$2);
|
|
618
|
-
var _useNavigationCheckpo = useRegisterNavigationCheckpoint.useNavigationCheckpoints(checkpointKey),
|
|
619
|
-
checkpoint = _useNavigationCheckpo[checkpointKey];
|
|
620
|
-
return /*#__PURE__*/React__default["default"].createElement(reactRouterDom.NavLink, _extends._extends({
|
|
621
|
-
to: checkpoint || to
|
|
622
|
-
}, others), children);
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
var DeleteAlert = function DeleteAlert(_ref) {
|
|
626
|
-
var isOpen = _ref.isOpen,
|
|
627
|
-
onClose = _ref.onClose,
|
|
628
|
-
segment = _ref.segment,
|
|
629
|
-
columns = _ref.columns;
|
|
630
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
631
|
-
t = _useTranslation.t;
|
|
632
|
-
var history = reactRouterDom.useHistory();
|
|
633
|
-
var _getQueryParams = general.getQueryParams(),
|
|
634
|
-
segmentId = _getQueryParams.segmentId;
|
|
635
|
-
var _useDestroySegment = neetoFiltersFrontend.useDestroySegment(),
|
|
636
|
-
deleteSegment = _useDestroySegment.mutate,
|
|
637
|
-
isDeleting = _useDestroySegment.isLoading;
|
|
638
|
-
var handleClearAll = function handleClearAll() {
|
|
639
|
-
var params = neetoFiltersFrontend.buildUrlFromFilters({
|
|
640
|
-
columns: columns,
|
|
641
|
-
filters: [],
|
|
642
|
-
isClearAll: true
|
|
643
|
-
});
|
|
644
|
-
history.push({
|
|
645
|
-
search: params
|
|
646
|
-
});
|
|
647
|
-
};
|
|
648
|
-
var handleDelete = function handleDelete() {
|
|
649
|
-
segment.id === segmentId && handleClearAll();
|
|
650
|
-
deleteSegment(segment.id, {
|
|
651
|
-
onSuccess: onClose
|
|
652
|
-
});
|
|
653
|
-
};
|
|
654
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
655
|
-
isOpen: isOpen,
|
|
656
|
-
onClose: onClose,
|
|
657
|
-
isSubmitting: isDeleting,
|
|
658
|
-
submitButtonLabel: t("neetoMolecules.common.actions.delete"),
|
|
659
|
-
message: /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
660
|
-
i18nKey: "neetoMolecules.sidebar.segments.deleteAlertMessage",
|
|
661
|
-
values: {
|
|
662
|
-
entity: segment.name
|
|
663
|
-
}
|
|
664
|
-
}),
|
|
665
|
-
title: t("neetoMolecules.common.deleteAlert.title", {
|
|
666
|
-
entity: t("neetoMolecules.sidebar.segments.segment", constants.SINGULAR)
|
|
667
|
-
}),
|
|
668
|
-
onSubmit: handleDelete
|
|
669
|
-
});
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
var RENAME_SEGMENT_FORM_VALIDATION = yup__namespace.object().shape({
|
|
673
|
-
name: yup__namespace.string().trim().required(i18next.t("neetoMolecules.sidebar.segments.validations.nameIsRequired"))
|
|
674
|
-
});
|
|
675
|
-
|
|
676
|
-
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
677
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { defineProperty._defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
678
|
-
var Rename = function Rename(_ref) {
|
|
679
|
-
var isOpen = _ref.isOpen,
|
|
680
|
-
setIsOpen = _ref.setIsOpen,
|
|
681
|
-
segment = _ref.segment;
|
|
682
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
683
|
-
t = _useTranslation.t;
|
|
684
|
-
var _useUpdateSegment = neetoFiltersFrontend.useUpdateSegment(),
|
|
685
|
-
updateSegment = _useUpdateSegment.mutate;
|
|
686
|
-
var inputRef = React.useRef();
|
|
687
|
-
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
688
|
-
var setSubmitting = _ref2.setSubmitting,
|
|
689
|
-
setFieldError = _ref2.setFieldError;
|
|
690
|
-
setSubmitting(true);
|
|
691
|
-
updateSegment({
|
|
692
|
-
id: segment.id,
|
|
693
|
-
payload: _objectSpread$1(_objectSpread$1({}, segment), values),
|
|
694
|
-
showToastr: false
|
|
695
|
-
}, {
|
|
696
|
-
onSuccess: function onSuccess() {
|
|
697
|
-
setIsOpen(false);
|
|
698
|
-
utils.showThumbsUpToastr();
|
|
699
|
-
},
|
|
700
|
-
onSettled: function onSettled() {
|
|
701
|
-
setSubmitting(false);
|
|
702
|
-
},
|
|
703
|
-
onError: function onError(error) {
|
|
704
|
-
var _error$response, _error$response3, _error$response3$data;
|
|
705
|
-
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 422) {
|
|
706
|
-
var _error$response2, _error$response2$data;
|
|
707
|
-
var errorMessage = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.error;
|
|
708
|
-
neetoui.Toastr.error(errorMessage || t("neetoMolecules.common.somethingWentWrong"));
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
setFieldError("name", (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.error);
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
};
|
|
715
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
|
|
716
|
-
isOpen: isOpen,
|
|
717
|
-
initialFocusRef: inputRef,
|
|
718
|
-
onClose: function onClose() {
|
|
719
|
-
return setIsOpen(false);
|
|
720
|
-
}
|
|
721
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
722
|
-
"data-cy": "edit-pane-header",
|
|
723
|
-
style: "h2"
|
|
724
|
-
}, t("neetoMolecules.sidebar.segments.renameTitle"))), /*#__PURE__*/React__default["default"].createElement(formik.Form, {
|
|
725
|
-
className: "w-full",
|
|
726
|
-
formikProps: {
|
|
727
|
-
initialValues: {
|
|
728
|
-
name: segment.name
|
|
729
|
-
},
|
|
730
|
-
validateOnChange: true,
|
|
731
|
-
validateOnBlur: true,
|
|
732
|
-
validationSchema: RENAME_SEGMENT_FORM_VALIDATION,
|
|
733
|
-
onSubmit: handleSubmit
|
|
734
|
-
}
|
|
735
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
736
|
-
required: true,
|
|
737
|
-
className: "w-full",
|
|
738
|
-
"data-testid": "segment-name-input-field",
|
|
739
|
-
label: t("neetoMolecules.sidebar.segments.renameFieldLabel"),
|
|
740
|
-
name: "name",
|
|
741
|
-
ref: inputRef
|
|
742
|
-
})), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, {
|
|
743
|
-
className: "flex items-center space-x-2"
|
|
744
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.ActionBlock, {
|
|
745
|
-
cancelButtonProps: {
|
|
746
|
-
onClick: function onClick() {
|
|
747
|
-
return setIsOpen(false);
|
|
748
|
-
},
|
|
749
|
-
disabled: false,
|
|
750
|
-
className: "ml-2"
|
|
751
|
-
}
|
|
752
|
-
}))));
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
var Segment = function Segment(_ref) {
|
|
756
|
-
var dataCy = _ref.dataCy,
|
|
757
|
-
segment = _ref.segment,
|
|
758
|
-
label = _ref.label,
|
|
759
|
-
columns = _ref.columns;
|
|
760
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
761
|
-
t = _useTranslation.t;
|
|
762
|
-
var _useState = React.useState(false),
|
|
763
|
-
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
764
|
-
isDeleteAlertOpen = _useState2[0],
|
|
765
|
-
setIsDeleteAlertOpen = _useState2[1];
|
|
766
|
-
var _useState3 = React.useState(false),
|
|
767
|
-
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
768
|
-
isRenamePaneOpen = _useState4[0],
|
|
769
|
-
setIsRenamePaneOpen = _useState4[1];
|
|
770
|
-
var history = reactRouterDom_min.useHistory();
|
|
771
|
-
var _getQueryParams = general.getQueryParams(),
|
|
772
|
-
segmentId = _getQueryParams.segmentId;
|
|
773
|
-
var handleSelectSegment = function handleSelectSegment() {
|
|
774
|
-
var _segment$filters$;
|
|
775
|
-
history.push({
|
|
776
|
-
search: neetoFiltersFrontend.buildUrlFromSegment({
|
|
777
|
-
columns: columns,
|
|
778
|
-
filters: (_segment$filters$ = segment.filters[0]) === null || _segment$filters$ === void 0 ? void 0 : _segment$filters$.conditions,
|
|
779
|
-
id: segment.id
|
|
780
|
-
})
|
|
781
|
-
});
|
|
782
|
-
};
|
|
783
|
-
var dataCyPrefix = dataCy || neetoCist.hyphenate(label);
|
|
784
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
785
|
-
"data-cy": "".concat(dataCyPrefix, "-segment-link"),
|
|
786
|
-
className: classnames__default["default"]("neeto-molecules-sidebar-segment neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none mb-0 w-full py-1", {
|
|
787
|
-
active: segmentId === segment.id
|
|
788
|
-
}),
|
|
789
|
-
onClick: handleSelectSegment
|
|
790
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
791
|
-
className: "neeto-molecules-sidebar__link-sub-label neeto-molecules-sidebar-segment__label neeto-ui-flex-grow min-w-0",
|
|
792
|
-
component: "span",
|
|
793
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
|
|
794
|
-
style: "body2"
|
|
795
|
-
}, label), /*#__PURE__*/React__default["default"].createElement(MoreDropdown, {
|
|
796
|
-
dropdownButtonProps: {
|
|
797
|
-
"data-testid": "segment-more-menu-".concat(dataCyPrefix),
|
|
798
|
-
className: "flex-shrink-0",
|
|
799
|
-
size: "small",
|
|
800
|
-
style: "secondary"
|
|
801
|
-
},
|
|
802
|
-
dropdownProps: {
|
|
803
|
-
position: "bottom-end",
|
|
804
|
-
strategy: "fixed",
|
|
805
|
-
autoWidth: true,
|
|
806
|
-
onClick: function onClick(e) {
|
|
807
|
-
e.stopPropagation();
|
|
808
|
-
}
|
|
809
|
-
},
|
|
810
|
-
menuItems: [{
|
|
811
|
-
label: t("neetoMolecules.common.actions.rename"),
|
|
812
|
-
onClick: function onClick(e) {
|
|
813
|
-
setIsRenamePaneOpen(true);
|
|
814
|
-
e.stopPropagation();
|
|
815
|
-
},
|
|
816
|
-
key: "edit-custom-segment-button"
|
|
817
|
-
}, {
|
|
818
|
-
label: t("neetoMolecules.common.actions.delete"),
|
|
819
|
-
onClick: function onClick(e) {
|
|
820
|
-
setIsDeleteAlertOpen(true);
|
|
821
|
-
e.stopPropagation();
|
|
822
|
-
},
|
|
823
|
-
key: "delete-custom-segment-button"
|
|
824
|
-
}]
|
|
825
|
-
})), /*#__PURE__*/React__default["default"].createElement(DeleteAlert, {
|
|
826
|
-
columns: columns,
|
|
827
|
-
segment: segment,
|
|
828
|
-
isOpen: isDeleteAlertOpen,
|
|
829
|
-
onClose: function onClose() {
|
|
830
|
-
return setIsDeleteAlertOpen(false);
|
|
831
|
-
}
|
|
832
|
-
}), /*#__PURE__*/React__default["default"].createElement(Rename, {
|
|
833
|
-
segment: segment,
|
|
834
|
-
isOpen: isRenamePaneOpen,
|
|
835
|
-
setIsOpen: setIsRenamePaneOpen
|
|
836
|
-
}));
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
var _excluded$1 = ["data-cy", "to", "label", "type", "count", "columns", "filters", "id", "isCountsLoading"];
|
|
840
|
-
var SubLink = function SubLink(_ref) {
|
|
841
|
-
var dataCy = _ref["data-cy"],
|
|
842
|
-
to = _ref.to,
|
|
843
|
-
label = _ref.label,
|
|
844
|
-
_ref$type = _ref.type,
|
|
845
|
-
type = _ref$type === void 0 ? SUB_LINK_TYPES.SYSTEM_VIEW : _ref$type,
|
|
846
|
-
count = _ref.count,
|
|
847
|
-
columns = _ref.columns,
|
|
848
|
-
filters = _ref.filters,
|
|
849
|
-
id = _ref.id,
|
|
850
|
-
isCountsLoading = _ref.isCountsLoading,
|
|
851
|
-
otherProps = objectWithoutProperties._objectWithoutProperties(_ref, _excluded$1);
|
|
852
|
-
var segment = {
|
|
853
|
-
id: id,
|
|
854
|
-
name: label,
|
|
855
|
-
filters: filters
|
|
856
|
-
};
|
|
857
|
-
if (type === SUB_LINK_TYPES.SEGMENT) {
|
|
858
|
-
return /*#__PURE__*/React__default["default"].createElement(Segment, {
|
|
859
|
-
columns: columns,
|
|
860
|
-
dataCy: dataCy,
|
|
861
|
-
label: label,
|
|
862
|
-
segment: segment
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
var dataCyPrefix = dataCy || neetoCist.hyphenate(label);
|
|
866
|
-
var renderCount = function renderCount(count) {
|
|
867
|
-
return count > 999 ? "999+" : count;
|
|
868
|
-
};
|
|
869
|
-
return /*#__PURE__*/React__default["default"].createElement(CheckPointNavLinks, _extends._extends({
|
|
870
|
-
to: to,
|
|
871
|
-
activeClassName: "active",
|
|
872
|
-
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
873
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link"),
|
|
874
|
-
isActive: function isActive() {
|
|
875
|
-
return isSubRouteActive(to, location);
|
|
876
|
-
}
|
|
877
|
-
}, otherProps), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
878
|
-
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
879
|
-
component: "span",
|
|
880
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
|
|
881
|
-
style: "body2"
|
|
882
|
-
}, label), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
883
|
-
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
884
|
-
component: "span",
|
|
885
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
|
|
886
|
-
style: "body2"
|
|
887
|
-
}, isCountsLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
888
|
-
className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
|
|
889
|
-
}) : renderCount(count)));
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
var _excluded = ["label", "to", "icon", "items", "isCountsLoading"];
|
|
544
|
+
var _excluded = ["label", "to", "icon", "items", "isConfigureNavLink", "isCountsLoading"];
|
|
893
545
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
894
546
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { defineProperty._defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
895
547
|
var Links = function Links(_ref) {
|
|
896
548
|
var navLinks = _ref.navLinks,
|
|
897
|
-
isCountsLoadingDeprecated = _ref.isCountsLoading
|
|
898
|
-
|
|
899
|
-
t = _useTranslation.t;
|
|
549
|
+
isCountsLoadingDeprecated = _ref.isCountsLoading,
|
|
550
|
+
setSelectedNavLink = _ref.setSelectedNavLink;
|
|
900
551
|
var location = reactRouterDom.useLocation();
|
|
901
552
|
var _useState = React.useState(true),
|
|
902
553
|
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
903
554
|
isActiveLinkExpanded = _useState2[0],
|
|
904
555
|
setIsActiveLinkExpanded = _useState2[1];
|
|
905
|
-
var
|
|
906
|
-
var
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
return true;
|
|
911
|
-
});
|
|
912
|
-
var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
|
|
556
|
+
var handleNavLinkClick = function handleNavLinkClick(_ref2) {
|
|
557
|
+
var event = _ref2.event,
|
|
558
|
+
isActive = _ref2.isActive,
|
|
559
|
+
items = _ref2.items,
|
|
560
|
+
navLink = _ref2.navLink;
|
|
913
561
|
if (neetoCist.isNotPresent(items)) return;
|
|
562
|
+
if (navLink.isConfigureNavLink && neetoCist.isNotEmpty(navLink.items)) {
|
|
563
|
+
setSelectedNavLink(navLink);
|
|
564
|
+
}
|
|
914
565
|
if (isActive()) {
|
|
915
566
|
setIsActiveLinkExpanded(ramda.not);
|
|
916
567
|
event.preventDefault();
|
|
@@ -920,31 +571,34 @@ var Links = function Links(_ref) {
|
|
|
920
571
|
};
|
|
921
572
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
922
573
|
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
|
|
923
|
-
}, navLinks.filter(filterByPermissions).map(function (
|
|
924
|
-
var label =
|
|
925
|
-
to =
|
|
926
|
-
icon =
|
|
927
|
-
items =
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
574
|
+
}, navLinks.filter(sidebar.filterByPermissions).map(function (navLink) {
|
|
575
|
+
var label = navLink.label,
|
|
576
|
+
to = navLink.to,
|
|
577
|
+
icon = navLink.icon,
|
|
578
|
+
items = navLink.items,
|
|
579
|
+
isConfigureNavLink = navLink.isConfigureNavLink,
|
|
580
|
+
_navLink$isCountsLoad = navLink.isCountsLoading,
|
|
581
|
+
isCountsLoading = _navLink$isCountsLoad === void 0 ? false : _navLink$isCountsLoad,
|
|
582
|
+
otherProps = objectWithoutProperties._objectWithoutProperties(navLink, _excluded);
|
|
931
583
|
var IconSVG = icon;
|
|
932
584
|
var url = new URL(to, window.location.href);
|
|
933
585
|
var isActive = function isActive() {
|
|
934
586
|
return ramda.is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
935
587
|
};
|
|
936
588
|
var isMenuExpanded = isActive() && isActiveLinkExpanded && !isCountsLoadingDeprecated;
|
|
937
|
-
var firstSegmentIndex = neetoCist._findIndexBy({
|
|
938
|
-
type: SUB_LINK_TYPES.SEGMENT
|
|
939
|
-
}, items);
|
|
940
589
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
941
|
-
key:
|
|
942
|
-
}, /*#__PURE__*/React__default["default"].createElement(CheckPointNavLinks, _extends._extends({
|
|
590
|
+
key: to
|
|
591
|
+
}, /*#__PURE__*/React__default["default"].createElement(sidebar.CheckPointNavLinks, _extends._extends({
|
|
943
592
|
activeClassName: "active",
|
|
944
593
|
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
945
594
|
"data-testid": "navlink-".concat(neetoCist.hyphenate(label)),
|
|
946
595
|
onClick: function onClick(event) {
|
|
947
|
-
return handleNavLinkClick(
|
|
596
|
+
return handleNavLinkClick({
|
|
597
|
+
event: event,
|
|
598
|
+
isActive: isActive,
|
|
599
|
+
items: items,
|
|
600
|
+
navLink: navLink
|
|
601
|
+
});
|
|
948
602
|
}
|
|
949
603
|
}, _objectSpread({
|
|
950
604
|
isActive: isActive,
|
|
@@ -957,28 +611,16 @@ var Links = function Links(_ref) {
|
|
|
957
611
|
component: "span",
|
|
958
612
|
style: "body2",
|
|
959
613
|
weight: "normal"
|
|
960
|
-
}, label), items && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
614
|
+
}, label), items && !isConfigureNavLink && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
961
615
|
className: classnames__default["default"]("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
|
|
962
616
|
"neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
|
|
963
617
|
})
|
|
964
618
|
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Down, {
|
|
965
619
|
size: 16
|
|
966
|
-
}))), items && isMenuExpanded && /*#__PURE__*/React__default["default"].createElement(
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
},
|
|
970
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
971
|
-
key: subIndex
|
|
972
|
-
}, subIndex === firstSegmentIndex && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
973
|
-
className: "neeto-molecules-sidebar-segments-header neeto-ui-text-transform-capitalize neeto-ui-text-gray-600 py-2 uppercase",
|
|
974
|
-
style: "body3",
|
|
975
|
-
weight: "semibold"
|
|
976
|
-
}, t("neetoMolecules.sidebar.segments.segment", constants.PLURAL)), /*#__PURE__*/React__default["default"].createElement(SubLink, _extends._extends({}, _objectSpread(_objectSpread({}, subItem), {}, {
|
|
977
|
-
isCountsLoading: isCountsLoading
|
|
978
|
-
}), {
|
|
979
|
-
columns: otherProps.columns
|
|
980
|
-
})));
|
|
981
|
-
})));
|
|
620
|
+
}))), items && !isConfigureNavLink && isMenuExpanded && /*#__PURE__*/React__default["default"].createElement(sidebar.Items, _objectSpread({
|
|
621
|
+
isCountsLoading: isCountsLoading,
|
|
622
|
+
items: items
|
|
623
|
+
}, otherProps)));
|
|
982
624
|
}));
|
|
983
625
|
};
|
|
984
626
|
|
|
@@ -997,6 +639,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
997
639
|
showAppSwitcher = _ref$showAppSwitcher === void 0 ? true : _ref$showAppSwitcher,
|
|
998
640
|
_ref$showFooter = _ref.showFooter,
|
|
999
641
|
showFooter = _ref$showFooter === void 0 ? true : _ref$showFooter;
|
|
642
|
+
var productName = initializers.globalProps.appName.substr(5).toLowerCase();
|
|
1000
643
|
var _useState = React.useState(false),
|
|
1001
644
|
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
1002
645
|
isAppSwitcherOpen = _useState2[0],
|
|
@@ -1005,7 +648,11 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1005
648
|
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
1006
649
|
isSidebarPaneOpen = _useState4[0],
|
|
1007
650
|
setIsSidebarPaneOpen = _useState4[1];
|
|
1008
|
-
var
|
|
651
|
+
var _useState5 = React.useState({}),
|
|
652
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
653
|
+
selectedNavLink = _useState6[0],
|
|
654
|
+
setSelectedNavLink = _useState6[1];
|
|
655
|
+
var _useLocalStorage = useLocalStorage__default["default"](sidebar.getSidebarStateLocalStorageKey(), false),
|
|
1009
656
|
_useLocalStorage2 = slicedToArray._slicedToArray(_useLocalStorage, 2),
|
|
1010
657
|
isSidebarCollapsed = _useLocalStorage2[0],
|
|
1011
658
|
setIsSidebarCollapsed = _useLocalStorage2[1];
|
|
@@ -1016,6 +663,17 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1016
663
|
return window.innerWidth > 768;
|
|
1017
664
|
};
|
|
1018
665
|
var isSidebarClosed = isLargerScreen() ? isSidebarCollapsed : ramda.not(isSidebarPaneOpen);
|
|
666
|
+
React.useEffect(function () {
|
|
667
|
+
var currentLink = navLinks.find(function (_ref2) {
|
|
668
|
+
var to = _ref2.to,
|
|
669
|
+
isActive = _ref2.isActive;
|
|
670
|
+
var url = new URL(to, window.location.href);
|
|
671
|
+
return ramda.is(Function, isActive) ? isActive() : location.pathname.startsWith(url.pathname);
|
|
672
|
+
});
|
|
673
|
+
if (neetoCist.isPresent(currentLink) && currentLink.isConfigureNavLink) {
|
|
674
|
+
setSelectedNavLink(currentLink);
|
|
675
|
+
}
|
|
676
|
+
}, []);
|
|
1019
677
|
React.useEffect(function () {
|
|
1020
678
|
isAppSwitcherOpen && setIsAppSwitcherOpen(false);
|
|
1021
679
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1031,7 +689,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1031
689
|
return window.removeEventListener("resize", handleResize);
|
|
1032
690
|
};
|
|
1033
691
|
}, []);
|
|
1034
|
-
var
|
|
692
|
+
var handleGoBack = function handleGoBack(event) {
|
|
693
|
+
event.preventDefault();
|
|
694
|
+
setSelectedNavLink({});
|
|
695
|
+
};
|
|
1035
696
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1036
697
|
"data-testid": "sidebar-container",
|
|
1037
698
|
className: classnames__default["default"]("neeto-molecules-sidebar__wrapper", {
|
|
@@ -1041,16 +702,23 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1041
702
|
className: "neeto-molecules-sidebar__backdrop",
|
|
1042
703
|
onClick: function onClick() {
|
|
1043
704
|
setIsSidebarPaneOpen(false);
|
|
705
|
+
setSelectedNavLink({});
|
|
1044
706
|
}
|
|
1045
707
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1046
|
-
className: "neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden",
|
|
1047
708
|
"data-cy": "sidebar-wrapper",
|
|
1048
|
-
"data-testid": "sidebar"
|
|
709
|
+
"data-testid": "sidebar",
|
|
710
|
+
className: classnames__default["default"]("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", {
|
|
711
|
+
"neeto-molecules-sidebar--focus-mode": neetoCist.isPresent(selectedNavLink)
|
|
712
|
+
})
|
|
1049
713
|
}, /*#__PURE__*/React__default["default"].createElement(Header$1, {
|
|
1050
714
|
customLogo: customLogo
|
|
1051
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
|
715
|
+
}), neetoCist.isPresent(selectedNavLink) ? /*#__PURE__*/React__default["default"].createElement(sidebar.SelectedLink, {
|
|
716
|
+
handleGoBack: handleGoBack,
|
|
717
|
+
navLink: selectedNavLink
|
|
718
|
+
}) : /*#__PURE__*/React__default["default"].createElement(Links, {
|
|
1052
719
|
isCountsLoading: isCountsLoading,
|
|
1053
|
-
navLinks: navLinks
|
|
720
|
+
navLinks: navLinks,
|
|
721
|
+
setSelectedNavLink: setSelectedNavLink
|
|
1054
722
|
}), showFooter && /*#__PURE__*/React__default["default"].createElement(Footer, {
|
|
1055
723
|
extraTopLinks: extraTopLinks,
|
|
1056
724
|
helpLinkOverrides: helpLinkOverrides,
|