@bigbinary/neeto-molecules 1.11.7 → 1.12.0
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/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/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 +1 -1
- package/src/translations/en.json +1 -0
- package/types/ConfigurePageSidebar.d.ts +40 -0
- package/types/Sidebar.d.ts +1 -0
package/dist/Sidebar.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
|
|
2
|
-
import React__default, { useState, forwardRef, useEffect
|
|
2
|
+
import React__default, { useState, forwardRef, useEffect } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
+
import { capitalize, truncate, isPresent, findBy, hyphenate, isNotPresent, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
4
5
|
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
5
6
|
import useLocalStorage from '@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage';
|
|
6
|
-
import { Typography, Input, Tooltip, Spinner, Avatar, Button
|
|
7
|
-
import {
|
|
8
|
-
import { useTranslation
|
|
9
|
-
import { Link,
|
|
7
|
+
import { Typography, Input, Tooltip, Spinner, Avatar, Button } from '@bigbinary/neetoui';
|
|
8
|
+
import { mergeDeepLeft, not, is } from 'ramda';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
10
11
|
import useFetchNeetoApps from '@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps';
|
|
11
|
-
import { NeetoIcon, Search, AppSwitcher as AppSwitcher$1,
|
|
12
|
+
import { NeetoIcon, Search, AppSwitcher as AppSwitcher$1, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
|
|
13
|
+
import { M as MY_PROFILE_URL, a as MY_ORGANIZATION_URL, g as getSidebarStateLocalStorageKey, D as DEFAULT_HELP_LINK_PROPS, f as filterByPermissions, C as CheckPointNavLinks, I as Items, S as SelectedLink } from './sidebar-a127705a.js';
|
|
12
14
|
import { n } from './inject-css-c86de496.js';
|
|
13
15
|
import { _ as _extends } from './extends-093996c9.js';
|
|
14
|
-
import { capitalize, isPresent, truncate, findBy, hyphenate, _findIndexBy, isNotPresent } from '@bigbinary/neeto-cist';
|
|
15
16
|
import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
|
|
16
17
|
import { t } from 'i18next';
|
|
17
18
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils/axios';
|
|
18
|
-
import { removeFromLocalStorage
|
|
19
|
+
import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
19
20
|
import { _ as _toConsumableArray } from './toConsumableArray-1cc38429.js';
|
|
20
21
|
import { _ as _defineProperty } from './defineProperty-549061a7.js';
|
|
21
22
|
import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
|
|
22
23
|
import KeyboardShortcuts from './KeyboardShortcuts.js';
|
|
23
24
|
import * as ProductTypefaceLogos from '@bigbinary/neeto-icons/typeface-logos';
|
|
24
25
|
import { Neeto } from '@bigbinary/neeto-icons/typeface-logos';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
26
|
+
import '@bigbinary/neeto-commons-frontend/constants';
|
|
27
|
+
import '@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint';
|
|
28
|
+
import '@bigbinary/neeto-filters-frontend';
|
|
29
|
+
import 'react-router-dom/cjs/react-router-dom.min';
|
|
30
|
+
import './MoreDropdown.js';
|
|
31
|
+
import '@bigbinary/neeto-commons-frontend/utils';
|
|
32
|
+
import '@bigbinary/neetoui/formik';
|
|
33
|
+
import 'yup';
|
|
33
34
|
import '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
|
|
34
35
|
import 'zustand';
|
|
35
36
|
import 'zustand/shallow';
|
|
@@ -40,18 +41,18 @@ import 'platform';
|
|
|
40
41
|
var Chevron = function Chevron(_ref) {
|
|
41
42
|
var style = _ref.style;
|
|
42
43
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
44
|
+
style: style,
|
|
43
45
|
height: "16",
|
|
44
46
|
viewBox: "0 0 16 16",
|
|
45
|
-
width: "16"
|
|
46
|
-
style: style
|
|
47
|
+
width: "16"
|
|
47
48
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
48
49
|
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",
|
|
49
50
|
fill: "currentColor"
|
|
50
51
|
}));
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
var css
|
|
54
|
-
n(css
|
|
54
|
+
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:16px}}.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}";
|
|
55
|
+
n(css,{});
|
|
55
56
|
|
|
56
57
|
var AppLink = function AppLink(_ref) {
|
|
57
58
|
var name = _ref.name,
|
|
@@ -147,9 +148,6 @@ var AppSwitcher = function AppSwitcher() {
|
|
|
147
148
|
}, /*#__PURE__*/React__default.createElement(Body, null));
|
|
148
149
|
};
|
|
149
150
|
|
|
150
|
-
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}";
|
|
151
|
-
n(css,{});
|
|
152
|
-
|
|
153
151
|
var AppSwitcherButton = function AppSwitcherButton() {
|
|
154
152
|
var _useTranslation = useTranslation(),
|
|
155
153
|
t = _useTranslation.t;
|
|
@@ -198,71 +196,6 @@ var AppSwitcherButton = function AppSwitcherButton() {
|
|
|
198
196
|
}, t("neetoMolecules.sidebar.productSwitcher"))));
|
|
199
197
|
};
|
|
200
198
|
|
|
201
|
-
var shouldShowWhatsNew = function shouldShowWhatsNew() {
|
|
202
|
-
var _window$globalProps, _window$globalProps$u;
|
|
203
|
-
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;
|
|
204
|
-
return window.location.hostname === "localhost" || currentUserEmail === "oliver@example.com" || (currentUserEmail === null || currentUserEmail === void 0 ? void 0 : currentUserEmail.endsWith("@bigbinary.com"));
|
|
205
|
-
};
|
|
206
|
-
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
207
|
-
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
208
|
-
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
209
|
-
var SUB_LINK_TYPES = {
|
|
210
|
-
SYSTEM_VIEW: "system_view",
|
|
211
|
-
SEGMENT: "segment"
|
|
212
|
-
};
|
|
213
|
-
var DEFAULT_HELP_LINK_PROPS = {
|
|
214
|
-
liveChatProps: {
|
|
215
|
-
label: t("neetoMolecules.sidebar.helpLinks.liveChat"),
|
|
216
|
-
icon: ChatEmpty,
|
|
217
|
-
"data-cy": "help-link-live-chat-button",
|
|
218
|
-
onClick: function onClick() {
|
|
219
|
-
var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
|
|
220
|
-
(_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();
|
|
221
|
-
(_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();
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
helpCenterProps: {
|
|
225
|
-
label: t("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
226
|
-
icon: Book,
|
|
227
|
-
"data-cy": "help-link-help-center-button",
|
|
228
|
-
href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
|
|
229
|
-
target: "_blank"
|
|
230
|
-
},
|
|
231
|
-
changelogProps: {
|
|
232
|
-
id: CHANGELOG_WIDGET_TRIGGER_ID,
|
|
233
|
-
label: t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
234
|
-
icon: Gift,
|
|
235
|
-
"data-cy": "help-link-changelog-button",
|
|
236
|
-
isVisible: shouldShowWhatsNew
|
|
237
|
-
},
|
|
238
|
-
keyboardShortcutProps: {
|
|
239
|
-
label: t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
240
|
-
icon: Keyboard,
|
|
241
|
-
"data-cy": "help-link-keyboard-shortcut-button"
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
246
|
-
var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
|
|
247
|
-
var targetUrl = new URL(subRoute, window.location.origin);
|
|
248
|
-
if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
var targetSearchParams = targetUrl.searchParams;
|
|
252
|
-
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
253
|
-
if (isPresent(currentBrowserUrl.searchParams.get("segment_id"))) {
|
|
254
|
-
return false;
|
|
255
|
-
}
|
|
256
|
-
return all(function (key) {
|
|
257
|
-
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
258
|
-
}, targetSearchKeys);
|
|
259
|
-
};
|
|
260
|
-
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
261
|
-
var _globalProps$user, _globalProps$user2;
|
|
262
|
-
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);
|
|
263
|
-
return "sidebarState-".concat(user);
|
|
264
|
-
};
|
|
265
|
-
|
|
266
199
|
var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
267
200
|
var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
|
|
268
201
|
return mergeDeepLeft(profileInfoOverrides, {
|
|
@@ -335,9 +268,9 @@ var ProfileSection = function ProfileSection(_ref, ref) {
|
|
|
335
268
|
};
|
|
336
269
|
var ProfileSection$1 = /*#__PURE__*/forwardRef(ProfileSection);
|
|
337
270
|
|
|
338
|
-
var _excluded$
|
|
339
|
-
function ownKeys$
|
|
340
|
-
function _objectSpread$
|
|
271
|
+
var _excluded$2 = ["onClick", "label", "icon"];
|
|
272
|
+
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; }
|
|
273
|
+
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(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; }
|
|
341
274
|
var LinkSection = function LinkSection(_ref) {
|
|
342
275
|
var links = _ref.links;
|
|
343
276
|
return /*#__PURE__*/React__default.createElement("ul", {
|
|
@@ -347,7 +280,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
347
280
|
label = _ref2.label,
|
|
348
281
|
_ref2$icon = _ref2.icon,
|
|
349
282
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
350
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded$
|
|
283
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded$2);
|
|
351
284
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
352
285
|
className: "neeto-molecules-profile-sublist__item",
|
|
353
286
|
key: idx
|
|
@@ -357,7 +290,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
357
290
|
iconPosition: "left",
|
|
358
291
|
iconSize: 18,
|
|
359
292
|
style: "text"
|
|
360
|
-
}, _objectSpread$
|
|
293
|
+
}, _objectSpread$2({
|
|
361
294
|
icon: icon,
|
|
362
295
|
label: label,
|
|
363
296
|
onClick: onClick
|
|
@@ -380,7 +313,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
380
313
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
381
314
|
className: classnames("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")
|
|
382
315
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
383
|
-
className: "
|
|
316
|
+
className: "left-0 top-0"
|
|
384
317
|
}, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
385
318
|
size: "large",
|
|
386
319
|
user: profileInfo
|
|
@@ -460,9 +393,9 @@ var HelpSection = function HelpSection(_ref, ref) {
|
|
|
460
393
|
};
|
|
461
394
|
var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
|
|
462
395
|
|
|
463
|
-
var _excluded$
|
|
464
|
-
function ownKeys$
|
|
465
|
-
function _objectSpread$
|
|
396
|
+
var _excluded$1 = ["label"];
|
|
397
|
+
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; }
|
|
398
|
+
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(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; }
|
|
466
399
|
var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
467
400
|
var helpLinkOverrides = _ref.helpLinkOverrides,
|
|
468
401
|
changesCount = _ref.changesCount;
|
|
@@ -473,7 +406,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
473
406
|
var _DEFAULT_HELP_LINK_PR, _DEFAULT_HELP_LINK_PR2, _DEFAULT_HELP_LINK_PR3;
|
|
474
407
|
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;
|
|
475
408
|
}).map(function (key) {
|
|
476
|
-
return _objectSpread$
|
|
409
|
+
return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
|
|
477
410
|
onClick: function onClick() {
|
|
478
411
|
return setIsOpen(true);
|
|
479
412
|
}
|
|
@@ -488,7 +421,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
488
421
|
className: "neeto-molecules-help-sublist"
|
|
489
422
|
}, helpLinks.map(function (_ref3, idx) {
|
|
490
423
|
var label = _ref3.label,
|
|
491
|
-
buttonProps = _objectWithoutProperties(_ref3, _excluded$
|
|
424
|
+
buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
|
|
492
425
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
493
426
|
className: "neeto-molecules-help-sublist__item",
|
|
494
427
|
key: idx
|
|
@@ -580,308 +513,27 @@ var Header = function Header(_ref) {
|
|
|
580
513
|
};
|
|
581
514
|
var Header$1 = /*#__PURE__*/React__default.memo(Header);
|
|
582
515
|
|
|
583
|
-
var _excluded
|
|
584
|
-
var CheckPointNavLinks = function CheckPointNavLinks(_ref) {
|
|
585
|
-
var checkpointKey = _ref.checkpointKey,
|
|
586
|
-
to = _ref.to,
|
|
587
|
-
children = _ref.children,
|
|
588
|
-
others = _objectWithoutProperties(_ref, _excluded$2);
|
|
589
|
-
var _useNavigationCheckpo = useNavigationCheckpoints(checkpointKey),
|
|
590
|
-
checkpoint = _useNavigationCheckpo[checkpointKey];
|
|
591
|
-
return /*#__PURE__*/React__default.createElement(NavLink, _extends({
|
|
592
|
-
to: checkpoint || to
|
|
593
|
-
}, others), children);
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
var DeleteAlert = function DeleteAlert(_ref) {
|
|
597
|
-
var isOpen = _ref.isOpen,
|
|
598
|
-
onClose = _ref.onClose,
|
|
599
|
-
segment = _ref.segment,
|
|
600
|
-
columns = _ref.columns;
|
|
601
|
-
var _useTranslation = useTranslation(),
|
|
602
|
-
t = _useTranslation.t;
|
|
603
|
-
var history = useHistory();
|
|
604
|
-
var _getQueryParams = getQueryParams(),
|
|
605
|
-
segmentId = _getQueryParams.segmentId;
|
|
606
|
-
var _useDestroySegment = useDestroySegment(),
|
|
607
|
-
deleteSegment = _useDestroySegment.mutate,
|
|
608
|
-
isDeleting = _useDestroySegment.isLoading;
|
|
609
|
-
var handleClearAll = function handleClearAll() {
|
|
610
|
-
var params = buildUrlFromFilters({
|
|
611
|
-
columns: columns,
|
|
612
|
-
filters: [],
|
|
613
|
-
isClearAll: true
|
|
614
|
-
});
|
|
615
|
-
history.push({
|
|
616
|
-
search: params
|
|
617
|
-
});
|
|
618
|
-
};
|
|
619
|
-
var handleDelete = function handleDelete() {
|
|
620
|
-
segment.id === segmentId && handleClearAll();
|
|
621
|
-
deleteSegment(segment.id, {
|
|
622
|
-
onSuccess: onClose
|
|
623
|
-
});
|
|
624
|
-
};
|
|
625
|
-
return /*#__PURE__*/React__default.createElement(Alert, {
|
|
626
|
-
isOpen: isOpen,
|
|
627
|
-
onClose: onClose,
|
|
628
|
-
isSubmitting: isDeleting,
|
|
629
|
-
submitButtonLabel: t("neetoMolecules.common.actions.delete"),
|
|
630
|
-
message: /*#__PURE__*/React__default.createElement(Trans, {
|
|
631
|
-
i18nKey: "neetoMolecules.sidebar.segments.deleteAlertMessage",
|
|
632
|
-
values: {
|
|
633
|
-
entity: segment.name
|
|
634
|
-
}
|
|
635
|
-
}),
|
|
636
|
-
title: t("neetoMolecules.common.deleteAlert.title", {
|
|
637
|
-
entity: t("neetoMolecules.sidebar.segments.segment", SINGULAR)
|
|
638
|
-
}),
|
|
639
|
-
onSubmit: handleDelete
|
|
640
|
-
});
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
var RENAME_SEGMENT_FORM_VALIDATION = yup.object().shape({
|
|
644
|
-
name: yup.string().trim().required(t("neetoMolecules.sidebar.segments.validations.nameIsRequired"))
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
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; }
|
|
648
|
-
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(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; }
|
|
649
|
-
var Rename = function Rename(_ref) {
|
|
650
|
-
var isOpen = _ref.isOpen,
|
|
651
|
-
setIsOpen = _ref.setIsOpen,
|
|
652
|
-
segment = _ref.segment;
|
|
653
|
-
var _useTranslation = useTranslation(),
|
|
654
|
-
t = _useTranslation.t;
|
|
655
|
-
var _useUpdateSegment = useUpdateSegment(),
|
|
656
|
-
updateSegment = _useUpdateSegment.mutate;
|
|
657
|
-
var inputRef = useRef();
|
|
658
|
-
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
659
|
-
var setSubmitting = _ref2.setSubmitting,
|
|
660
|
-
setFieldError = _ref2.setFieldError;
|
|
661
|
-
setSubmitting(true);
|
|
662
|
-
updateSegment({
|
|
663
|
-
id: segment.id,
|
|
664
|
-
payload: _objectSpread$1(_objectSpread$1({}, segment), values),
|
|
665
|
-
showToastr: false
|
|
666
|
-
}, {
|
|
667
|
-
onSuccess: function onSuccess() {
|
|
668
|
-
setIsOpen(false);
|
|
669
|
-
showThumbsUpToastr();
|
|
670
|
-
},
|
|
671
|
-
onSettled: function onSettled() {
|
|
672
|
-
setSubmitting(false);
|
|
673
|
-
},
|
|
674
|
-
onError: function onError(error) {
|
|
675
|
-
var _error$response, _error$response3, _error$response3$data;
|
|
676
|
-
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 422) {
|
|
677
|
-
var _error$response2, _error$response2$data;
|
|
678
|
-
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;
|
|
679
|
-
Toastr.error(errorMessage || t("neetoMolecules.common.somethingWentWrong"));
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
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);
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
};
|
|
686
|
-
return /*#__PURE__*/React__default.createElement(Pane, {
|
|
687
|
-
isOpen: isOpen,
|
|
688
|
-
initialFocusRef: inputRef,
|
|
689
|
-
onClose: function onClose() {
|
|
690
|
-
return setIsOpen(false);
|
|
691
|
-
}
|
|
692
|
-
}, /*#__PURE__*/React__default.createElement(Pane.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
|
|
693
|
-
"data-cy": "edit-pane-header",
|
|
694
|
-
style: "h2"
|
|
695
|
-
}, t("neetoMolecules.sidebar.segments.renameTitle"))), /*#__PURE__*/React__default.createElement(Form, {
|
|
696
|
-
className: "w-full",
|
|
697
|
-
formikProps: {
|
|
698
|
-
initialValues: {
|
|
699
|
-
name: segment.name
|
|
700
|
-
},
|
|
701
|
-
validateOnChange: true,
|
|
702
|
-
validateOnBlur: true,
|
|
703
|
-
validationSchema: RENAME_SEGMENT_FORM_VALIDATION,
|
|
704
|
-
onSubmit: handleSubmit
|
|
705
|
-
}
|
|
706
|
-
}, /*#__PURE__*/React__default.createElement(Pane.Body, null, /*#__PURE__*/React__default.createElement(Input$1, {
|
|
707
|
-
required: true,
|
|
708
|
-
className: "w-full",
|
|
709
|
-
"data-testid": "segment-name-input-field",
|
|
710
|
-
label: t("neetoMolecules.sidebar.segments.renameFieldLabel"),
|
|
711
|
-
name: "name",
|
|
712
|
-
ref: inputRef
|
|
713
|
-
})), /*#__PURE__*/React__default.createElement(Pane.Footer, {
|
|
714
|
-
className: "flex items-center space-x-2"
|
|
715
|
-
}, /*#__PURE__*/React__default.createElement(ActionBlock, {
|
|
716
|
-
cancelButtonProps: {
|
|
717
|
-
onClick: function onClick() {
|
|
718
|
-
return setIsOpen(false);
|
|
719
|
-
},
|
|
720
|
-
disabled: false,
|
|
721
|
-
className: "ml-2"
|
|
722
|
-
}
|
|
723
|
-
}))));
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
var Segment = function Segment(_ref) {
|
|
727
|
-
var dataCy = _ref.dataCy,
|
|
728
|
-
segment = _ref.segment,
|
|
729
|
-
label = _ref.label,
|
|
730
|
-
columns = _ref.columns;
|
|
731
|
-
var _useTranslation = useTranslation(),
|
|
732
|
-
t = _useTranslation.t;
|
|
733
|
-
var _useState = useState(false),
|
|
734
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
735
|
-
isDeleteAlertOpen = _useState2[0],
|
|
736
|
-
setIsDeleteAlertOpen = _useState2[1];
|
|
737
|
-
var _useState3 = useState(false),
|
|
738
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
739
|
-
isRenamePaneOpen = _useState4[0],
|
|
740
|
-
setIsRenamePaneOpen = _useState4[1];
|
|
741
|
-
var history = useHistory$1();
|
|
742
|
-
var _getQueryParams = getQueryParams(),
|
|
743
|
-
segmentId = _getQueryParams.segmentId;
|
|
744
|
-
var handleSelectSegment = function handleSelectSegment() {
|
|
745
|
-
var _segment$filters$;
|
|
746
|
-
history.push({
|
|
747
|
-
search: buildUrlFromSegment({
|
|
748
|
-
columns: columns,
|
|
749
|
-
filters: (_segment$filters$ = segment.filters[0]) === null || _segment$filters$ === void 0 ? void 0 : _segment$filters$.conditions,
|
|
750
|
-
id: segment.id
|
|
751
|
-
})
|
|
752
|
-
});
|
|
753
|
-
};
|
|
754
|
-
var dataCyPrefix = dataCy || hyphenate(label);
|
|
755
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("button", {
|
|
756
|
-
"data-cy": "".concat(dataCyPrefix, "-segment-link"),
|
|
757
|
-
className: classnames("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", {
|
|
758
|
-
active: segmentId === segment.id
|
|
759
|
-
}),
|
|
760
|
-
onClick: handleSelectSegment
|
|
761
|
-
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
762
|
-
className: "neeto-molecules-sidebar__link-sub-label neeto-molecules-sidebar-segment__label neeto-ui-flex-grow min-w-0",
|
|
763
|
-
component: "span",
|
|
764
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
|
|
765
|
-
style: "body2"
|
|
766
|
-
}, label), /*#__PURE__*/React__default.createElement(MoreDropdown, {
|
|
767
|
-
dropdownButtonProps: {
|
|
768
|
-
"data-testid": "segment-more-menu-".concat(dataCyPrefix),
|
|
769
|
-
className: "flex-shrink-0",
|
|
770
|
-
size: "small",
|
|
771
|
-
style: "secondary"
|
|
772
|
-
},
|
|
773
|
-
dropdownProps: {
|
|
774
|
-
position: "bottom-end",
|
|
775
|
-
strategy: "fixed",
|
|
776
|
-
autoWidth: true,
|
|
777
|
-
onClick: function onClick(e) {
|
|
778
|
-
e.stopPropagation();
|
|
779
|
-
}
|
|
780
|
-
},
|
|
781
|
-
menuItems: [{
|
|
782
|
-
label: t("neetoMolecules.common.actions.rename"),
|
|
783
|
-
onClick: function onClick(e) {
|
|
784
|
-
setIsRenamePaneOpen(true);
|
|
785
|
-
e.stopPropagation();
|
|
786
|
-
},
|
|
787
|
-
key: "edit-custom-segment-button"
|
|
788
|
-
}, {
|
|
789
|
-
label: t("neetoMolecules.common.actions.delete"),
|
|
790
|
-
onClick: function onClick(e) {
|
|
791
|
-
setIsDeleteAlertOpen(true);
|
|
792
|
-
e.stopPropagation();
|
|
793
|
-
},
|
|
794
|
-
key: "delete-custom-segment-button"
|
|
795
|
-
}]
|
|
796
|
-
})), /*#__PURE__*/React__default.createElement(DeleteAlert, {
|
|
797
|
-
columns: columns,
|
|
798
|
-
segment: segment,
|
|
799
|
-
isOpen: isDeleteAlertOpen,
|
|
800
|
-
onClose: function onClose() {
|
|
801
|
-
return setIsDeleteAlertOpen(false);
|
|
802
|
-
}
|
|
803
|
-
}), /*#__PURE__*/React__default.createElement(Rename, {
|
|
804
|
-
segment: segment,
|
|
805
|
-
isOpen: isRenamePaneOpen,
|
|
806
|
-
setIsOpen: setIsRenamePaneOpen
|
|
807
|
-
}));
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
var _excluded$1 = ["data-cy", "to", "label", "type", "count", "columns", "filters", "id", "isCountsLoading"];
|
|
811
|
-
var SubLink = function SubLink(_ref) {
|
|
812
|
-
var dataCy = _ref["data-cy"],
|
|
813
|
-
to = _ref.to,
|
|
814
|
-
label = _ref.label,
|
|
815
|
-
_ref$type = _ref.type,
|
|
816
|
-
type = _ref$type === void 0 ? SUB_LINK_TYPES.SYSTEM_VIEW : _ref$type,
|
|
817
|
-
count = _ref.count,
|
|
818
|
-
columns = _ref.columns,
|
|
819
|
-
filters = _ref.filters,
|
|
820
|
-
id = _ref.id,
|
|
821
|
-
isCountsLoading = _ref.isCountsLoading,
|
|
822
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
823
|
-
var segment = {
|
|
824
|
-
id: id,
|
|
825
|
-
name: label,
|
|
826
|
-
filters: filters
|
|
827
|
-
};
|
|
828
|
-
if (type === SUB_LINK_TYPES.SEGMENT) {
|
|
829
|
-
return /*#__PURE__*/React__default.createElement(Segment, {
|
|
830
|
-
columns: columns,
|
|
831
|
-
dataCy: dataCy,
|
|
832
|
-
label: label,
|
|
833
|
-
segment: segment
|
|
834
|
-
});
|
|
835
|
-
}
|
|
836
|
-
var dataCyPrefix = dataCy || hyphenate(label);
|
|
837
|
-
var renderCount = function renderCount(count) {
|
|
838
|
-
return count > 999 ? "999+" : count;
|
|
839
|
-
};
|
|
840
|
-
return /*#__PURE__*/React__default.createElement(CheckPointNavLinks, _extends({
|
|
841
|
-
to: to,
|
|
842
|
-
activeClassName: "active",
|
|
843
|
-
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
844
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link"),
|
|
845
|
-
isActive: function isActive() {
|
|
846
|
-
return isSubRouteActive(to, location);
|
|
847
|
-
}
|
|
848
|
-
}, otherProps), /*#__PURE__*/React__default.createElement(Typography, {
|
|
849
|
-
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
850
|
-
component: "span",
|
|
851
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
|
|
852
|
-
style: "body2"
|
|
853
|
-
}, label), /*#__PURE__*/React__default.createElement(Typography, {
|
|
854
|
-
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
855
|
-
component: "span",
|
|
856
|
-
"data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
|
|
857
|
-
style: "body2"
|
|
858
|
-
}, isCountsLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
859
|
-
className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
|
|
860
|
-
}) : renderCount(count)));
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
var _excluded = ["label", "to", "icon", "items", "isCountsLoading"];
|
|
516
|
+
var _excluded = ["label", "to", "icon", "items", "isConfigureNavLink", "isCountsLoading"];
|
|
864
517
|
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; }
|
|
865
518
|
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(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; }
|
|
866
519
|
var Links = function Links(_ref) {
|
|
867
520
|
var navLinks = _ref.navLinks,
|
|
868
|
-
isCountsLoadingDeprecated = _ref.isCountsLoading
|
|
869
|
-
|
|
870
|
-
t = _useTranslation.t;
|
|
521
|
+
isCountsLoadingDeprecated = _ref.isCountsLoading,
|
|
522
|
+
setSelectedNavLink = _ref.setSelectedNavLink;
|
|
871
523
|
var location = useLocation();
|
|
872
524
|
var _useState = useState(true),
|
|
873
525
|
_useState2 = _slicedToArray(_useState, 2),
|
|
874
526
|
isActiveLinkExpanded = _useState2[0],
|
|
875
527
|
setIsActiveLinkExpanded = _useState2[1];
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
return true;
|
|
882
|
-
});
|
|
883
|
-
var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
|
|
528
|
+
var handleNavLinkClick = function handleNavLinkClick(_ref2) {
|
|
529
|
+
var event = _ref2.event,
|
|
530
|
+
isActive = _ref2.isActive,
|
|
531
|
+
items = _ref2.items,
|
|
532
|
+
navLink = _ref2.navLink;
|
|
884
533
|
if (isNotPresent(items)) return;
|
|
534
|
+
if (navLink.isConfigureNavLink && isNotEmpty(navLink.items)) {
|
|
535
|
+
setSelectedNavLink(navLink);
|
|
536
|
+
}
|
|
885
537
|
if (isActive()) {
|
|
886
538
|
setIsActiveLinkExpanded(not);
|
|
887
539
|
event.preventDefault();
|
|
@@ -891,31 +543,34 @@ var Links = function Links(_ref) {
|
|
|
891
543
|
};
|
|
892
544
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
893
545
|
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
|
|
894
|
-
}, navLinks.filter(filterByPermissions).map(function (
|
|
895
|
-
var label =
|
|
896
|
-
to =
|
|
897
|
-
icon =
|
|
898
|
-
items =
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
546
|
+
}, navLinks.filter(filterByPermissions).map(function (navLink) {
|
|
547
|
+
var label = navLink.label,
|
|
548
|
+
to = navLink.to,
|
|
549
|
+
icon = navLink.icon,
|
|
550
|
+
items = navLink.items,
|
|
551
|
+
isConfigureNavLink = navLink.isConfigureNavLink,
|
|
552
|
+
_navLink$isCountsLoad = navLink.isCountsLoading,
|
|
553
|
+
isCountsLoading = _navLink$isCountsLoad === void 0 ? false : _navLink$isCountsLoad,
|
|
554
|
+
otherProps = _objectWithoutProperties(navLink, _excluded);
|
|
902
555
|
var IconSVG = icon;
|
|
903
556
|
var url = new URL(to, window.location.href);
|
|
904
557
|
var isActive = function isActive() {
|
|
905
558
|
return is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
906
559
|
};
|
|
907
560
|
var isMenuExpanded = isActive() && isActiveLinkExpanded && !isCountsLoadingDeprecated;
|
|
908
|
-
var firstSegmentIndex = _findIndexBy({
|
|
909
|
-
type: SUB_LINK_TYPES.SEGMENT
|
|
910
|
-
}, items);
|
|
911
561
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
912
|
-
key:
|
|
562
|
+
key: to
|
|
913
563
|
}, /*#__PURE__*/React__default.createElement(CheckPointNavLinks, _extends({
|
|
914
564
|
activeClassName: "active",
|
|
915
565
|
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
916
566
|
"data-testid": "navlink-".concat(hyphenate(label)),
|
|
917
567
|
onClick: function onClick(event) {
|
|
918
|
-
return handleNavLinkClick(
|
|
568
|
+
return handleNavLinkClick({
|
|
569
|
+
event: event,
|
|
570
|
+
isActive: isActive,
|
|
571
|
+
items: items,
|
|
572
|
+
navLink: navLink
|
|
573
|
+
});
|
|
919
574
|
}
|
|
920
575
|
}, _objectSpread({
|
|
921
576
|
isActive: isActive,
|
|
@@ -928,28 +583,16 @@ var Links = function Links(_ref) {
|
|
|
928
583
|
component: "span",
|
|
929
584
|
style: "body2",
|
|
930
585
|
weight: "normal"
|
|
931
|
-
}, label), items && /*#__PURE__*/React__default.createElement("span", {
|
|
586
|
+
}, label), items && !isConfigureNavLink && /*#__PURE__*/React__default.createElement("span", {
|
|
932
587
|
className: classnames("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
|
|
933
588
|
"neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
|
|
934
589
|
})
|
|
935
590
|
}, /*#__PURE__*/React__default.createElement(Down, {
|
|
936
591
|
size: 16
|
|
937
|
-
}))), items && isMenuExpanded && /*#__PURE__*/React__default.createElement(
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
},
|
|
941
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
942
|
-
key: subIndex
|
|
943
|
-
}, subIndex === firstSegmentIndex && /*#__PURE__*/React__default.createElement(Typography, {
|
|
944
|
-
className: "neeto-molecules-sidebar-segments-header neeto-ui-text-transform-capitalize neeto-ui-text-gray-600 py-2 uppercase",
|
|
945
|
-
style: "body3",
|
|
946
|
-
weight: "semibold"
|
|
947
|
-
}, t("neetoMolecules.sidebar.segments.segment", PLURAL)), /*#__PURE__*/React__default.createElement(SubLink, _extends({}, _objectSpread(_objectSpread({}, subItem), {}, {
|
|
948
|
-
isCountsLoading: isCountsLoading
|
|
949
|
-
}), {
|
|
950
|
-
columns: otherProps.columns
|
|
951
|
-
})));
|
|
952
|
-
})));
|
|
592
|
+
}))), items && !isConfigureNavLink && isMenuExpanded && /*#__PURE__*/React__default.createElement(Items, _objectSpread({
|
|
593
|
+
isCountsLoading: isCountsLoading,
|
|
594
|
+
items: items
|
|
595
|
+
}, otherProps)));
|
|
953
596
|
}));
|
|
954
597
|
};
|
|
955
598
|
|
|
@@ -968,6 +611,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
968
611
|
showAppSwitcher = _ref$showAppSwitcher === void 0 ? true : _ref$showAppSwitcher,
|
|
969
612
|
_ref$showFooter = _ref.showFooter,
|
|
970
613
|
showFooter = _ref$showFooter === void 0 ? true : _ref$showFooter;
|
|
614
|
+
var productName = globalProps$1.appName.substr(5).toLowerCase();
|
|
971
615
|
var _useState = useState(false),
|
|
972
616
|
_useState2 = _slicedToArray(_useState, 2),
|
|
973
617
|
isAppSwitcherOpen = _useState2[0],
|
|
@@ -976,6 +620,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
976
620
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
977
621
|
isSidebarPaneOpen = _useState4[0],
|
|
978
622
|
setIsSidebarPaneOpen = _useState4[1];
|
|
623
|
+
var _useState5 = useState({}),
|
|
624
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
625
|
+
selectedNavLink = _useState6[0],
|
|
626
|
+
setSelectedNavLink = _useState6[1];
|
|
979
627
|
var _useLocalStorage = useLocalStorage(getSidebarStateLocalStorageKey(), false),
|
|
980
628
|
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
|
981
629
|
isSidebarCollapsed = _useLocalStorage2[0],
|
|
@@ -987,6 +635,17 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
987
635
|
return window.innerWidth > 768;
|
|
988
636
|
};
|
|
989
637
|
var isSidebarClosed = isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen);
|
|
638
|
+
useEffect(function () {
|
|
639
|
+
var currentLink = navLinks.find(function (_ref2) {
|
|
640
|
+
var to = _ref2.to,
|
|
641
|
+
isActive = _ref2.isActive;
|
|
642
|
+
var url = new URL(to, window.location.href);
|
|
643
|
+
return is(Function, isActive) ? isActive() : location.pathname.startsWith(url.pathname);
|
|
644
|
+
});
|
|
645
|
+
if (isPresent(currentLink) && currentLink.isConfigureNavLink) {
|
|
646
|
+
setSelectedNavLink(currentLink);
|
|
647
|
+
}
|
|
648
|
+
}, []);
|
|
990
649
|
useEffect(function () {
|
|
991
650
|
isAppSwitcherOpen && setIsAppSwitcherOpen(false);
|
|
992
651
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1002,7 +661,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1002
661
|
return window.removeEventListener("resize", handleResize);
|
|
1003
662
|
};
|
|
1004
663
|
}, []);
|
|
1005
|
-
var
|
|
664
|
+
var handleGoBack = function handleGoBack(event) {
|
|
665
|
+
event.preventDefault();
|
|
666
|
+
setSelectedNavLink({});
|
|
667
|
+
};
|
|
1006
668
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1007
669
|
"data-testid": "sidebar-container",
|
|
1008
670
|
className: classnames("neeto-molecules-sidebar__wrapper", {
|
|
@@ -1012,16 +674,23 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1012
674
|
className: "neeto-molecules-sidebar__backdrop",
|
|
1013
675
|
onClick: function onClick() {
|
|
1014
676
|
setIsSidebarPaneOpen(false);
|
|
677
|
+
setSelectedNavLink({});
|
|
1015
678
|
}
|
|
1016
679
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1017
|
-
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",
|
|
1018
680
|
"data-cy": "sidebar-wrapper",
|
|
1019
|
-
"data-testid": "sidebar"
|
|
681
|
+
"data-testid": "sidebar",
|
|
682
|
+
className: classnames("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", {
|
|
683
|
+
"neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLink)
|
|
684
|
+
})
|
|
1020
685
|
}, /*#__PURE__*/React__default.createElement(Header$1, {
|
|
1021
686
|
customLogo: customLogo
|
|
1022
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
687
|
+
}), isPresent(selectedNavLink) ? /*#__PURE__*/React__default.createElement(SelectedLink, {
|
|
688
|
+
handleGoBack: handleGoBack,
|
|
689
|
+
navLink: selectedNavLink
|
|
690
|
+
}) : /*#__PURE__*/React__default.createElement(Links, {
|
|
1023
691
|
isCountsLoading: isCountsLoading,
|
|
1024
|
-
navLinks: navLinks
|
|
692
|
+
navLinks: navLinks,
|
|
693
|
+
setSelectedNavLink: setSelectedNavLink
|
|
1025
694
|
}), showFooter && /*#__PURE__*/React__default.createElement(Footer, {
|
|
1026
695
|
extraTopLinks: extraTopLinks,
|
|
1027
696
|
helpLinkOverrides: helpLinkOverrides,
|