supernav-test 2.2.15 → 2.2.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/App.test.d.ts +1 -0
- package/dist/App.test.js +7 -0
- package/dist/LsacContainer.d.ts +4 -0
- package/dist/LsacContainer.js +14 -0
- package/dist/components/lsac-supernavbar/AuthWrapper.d.ts +4 -0
- package/dist/components/lsac-supernavbar/AuthWrapper.js +47 -0
- package/dist/components/lsac-supernavbar/LsacSidebar.d.ts +44 -0
- package/dist/components/lsac-supernavbar/LsacSidebar.js +35 -0
- package/dist/components/lsac-supernavbar/Store.d.ts +3 -0
- package/dist/components/lsac-supernavbar/Store.js +12 -0
- package/dist/components/lsac-supernavbar/actions/AuthActions.d.ts +8 -0
- package/dist/components/lsac-supernavbar/actions/AuthActions.js +22 -0
- package/dist/components/lsac-supernavbar/actions/SidebarActions.d.ts +23 -0
- package/dist/components/lsac-supernavbar/actions/SidebarActions.js +81 -0
- package/dist/components/lsac-supernavbar/components/Sidebar.d.ts +13 -0
- package/dist/components/lsac-supernavbar/components/Sidebar.js +193 -0
- package/dist/components/lsac-supernavbar/components/SidebarForm.d.ts +5 -0
- package/dist/components/lsac-supernavbar/components/SidebarForm.js +8 -0
- package/dist/components/lsac-supernavbar/components/SidebarMainLink.d.ts +14 -0
- package/dist/components/lsac-supernavbar/components/SidebarMainLink.js +60 -0
- package/dist/components/lsac-supernavbar/components/SidebarOption.d.ts +4 -0
- package/dist/components/lsac-supernavbar/components/SidebarOption.js +8 -0
- package/dist/components/lsac-supernavbar/components/SidebarSubMenu.d.ts +5 -0
- package/dist/components/lsac-supernavbar/components/SidebarSubMenu.js +68 -0
- package/dist/components/lsac-supernavbar/components/SidebarTab.d.ts +1 -0
- package/dist/components/lsac-supernavbar/components/SidebarTab.js +50 -0
- package/dist/components/lsac-supernavbar/components/Topnav.d.ts +14 -0
- package/dist/components/lsac-supernavbar/components/Topnav.js +76 -0
- package/dist/components/lsac-supernavbar/components/sidebar_submenus/CategorizedSubmenu.d.ts +9 -0
- package/dist/components/lsac-supernavbar/components/sidebar_submenus/CategorizedSubmenu.js +57 -0
- package/dist/components/lsac-supernavbar/components/sidebar_submenus/Marketplace.d.ts +5 -0
- package/dist/components/lsac-supernavbar/components/sidebar_submenus/Marketplace.js +7 -0
- package/dist/components/lsac-supernavbar/constants/SidebarConstants.d.ts +8 -0
- package/dist/components/lsac-supernavbar/constants/SidebarConstants.js +12 -0
- package/dist/components/lsac-supernavbar/constants/UtilityConstants.d.ts +15 -0
- package/dist/components/lsac-supernavbar/constants/UtilityConstants.js +21 -0
- package/dist/components/lsac-supernavbar/interfaces/Models.d.ts +65 -0
- package/dist/components/lsac-supernavbar/interfaces/Models.js +12 -0
- package/dist/components/lsac-supernavbar/interfaces/Redux.d.ts +7 -0
- package/dist/components/lsac-supernavbar/interfaces/Redux.js +2 -0
- package/dist/components/lsac-supernavbar/reducers/AuthReducer.d.ts +7 -0
- package/dist/components/lsac-supernavbar/reducers/AuthReducer.js +19 -0
- package/dist/components/lsac-supernavbar/reducers/RootReducer.d.ts +5 -0
- package/dist/components/lsac-supernavbar/reducers/RootReducer.js +10 -0
- package/dist/components/lsac-supernavbar/reducers/SidebarReducer.d.ts +17 -0
- package/dist/components/lsac-supernavbar/reducers/SidebarReducer.js +49 -0
- package/dist/components/lsac-supernavbar/resources/icomoon-library.json +1 -0
- package/dist/components/lsac-supernavbar/test/App.test.d.ts +1 -0
- package/dist/components/lsac-supernavbar/test/App.test.js +22 -0
- package/dist/components/lsac-supernavbar/util/SubmenuUtil.d.ts +9 -0
- package/dist/components/lsac-supernavbar/util/SubmenuUtil.js +112 -0
- package/dist/components/lsac-supernavbar/util/Util.d.ts +4 -0
- package/dist/components/lsac-supernavbar/util/Util.js +24 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17 -67
- package/dist/reportWebVitals.d.ts +3 -0
- package/dist/reportWebVitals.js +33 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +7 -0
- package/package.json +9 -4
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
const styles = require('../stylesheets/form.scss');
|
5
|
+
function SidebarForm(props) {
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'sidebar-form' }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'sidebar-header' }, { children: "Form Launched From Sidebar Action" }), void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'sidebar-form-body' }, { children: "Contents of the form" }), void 0)] }), void 0));
|
7
|
+
}
|
8
|
+
exports.default = SidebarForm;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { SidebarMenuTypes } from "../constants/SidebarConstants";
|
3
|
+
export interface SidebarMainLinkProps {
|
4
|
+
appContext?: string;
|
5
|
+
id: SidebarMenuTypes;
|
6
|
+
icon?: any;
|
7
|
+
label: string;
|
8
|
+
onClick: () => void;
|
9
|
+
click?: () => void;
|
10
|
+
selectedOption?: any;
|
11
|
+
subMenu: boolean;
|
12
|
+
}
|
13
|
+
declare function SidebarMainLink(props: SidebarMainLinkProps): JSX.Element;
|
14
|
+
export default SidebarMainLink;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
7
|
+
const react_1 = require("react");
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
9
|
+
const react_redux_1 = require("react-redux");
|
10
|
+
const SidebarActions_1 = require("../actions/SidebarActions");
|
11
|
+
const Models_1 = require("../interfaces/Models");
|
12
|
+
// import IconRight from '../static/images/sidebar-icons/rightIcon.svg';
|
13
|
+
const styles = require('../stylesheets/sidebar-main-link.scss');
|
14
|
+
function SidebarMainLink(props) {
|
15
|
+
const { icon, label, id, click, selectedOption, subMenu } = props;
|
16
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
17
|
+
const selectedSidebarOption = (0, react_redux_1.useSelector)((state) => state.sidebar.selectedSidebarOption);
|
18
|
+
const selected = id === selectedSidebarOption;
|
19
|
+
const apps = (0, react_redux_1.useSelector)((state) => { var _a; return ((_a = state.auth.userInfo) === null || _a === void 0 ? void 0 : _a.applications) || new Array(); });
|
20
|
+
const active = id === selectedOption;
|
21
|
+
const onClick = (0, react_1.useCallback)(() => {
|
22
|
+
if (id === 'marketplace') {
|
23
|
+
const marketplaceUrl = apps.filter((e) => e.attributes !== undefined && e.attributes !== null)
|
24
|
+
.filter((f) => Object.keys(f.attributes).length > 0)
|
25
|
+
.filter((e) => e.attributes['category'] !== undefined)
|
26
|
+
.filter((app) => app.attributes['category'].toLowerCase() === Models_1.SidebarCategory.MARKETPLACE)[0].url;
|
27
|
+
window.location.href = marketplaceUrl;
|
28
|
+
dispatch((0, SidebarActions_1.SetExpandSidebar)(false));
|
29
|
+
dispatch((0, SidebarActions_1.SetMinimalSidebar)(true));
|
30
|
+
}
|
31
|
+
else if (id === 'home') {
|
32
|
+
const home_url = apps.filter((e) => e.attributes !== undefined)
|
33
|
+
.filter((f) => Object.keys(f.attributes).length > 0)
|
34
|
+
.filter((e) => e.attributes['category'] !== undefined)
|
35
|
+
.filter((app) => app.attributes['category'].toLowerCase() === Models_1.SidebarCategory.MY_HOME)[0].url;
|
36
|
+
window.location.href = home_url;
|
37
|
+
dispatch((0, SidebarActions_1.SetExpandSidebar)(false));
|
38
|
+
dispatch((0, SidebarActions_1.SetMinimalSidebar)(true));
|
39
|
+
}
|
40
|
+
}, [id, dispatch]);
|
41
|
+
const onHover = (0, react_1.useCallback)((id) => {
|
42
|
+
dispatch((0, SidebarActions_1.SetSelectedSidebarOption)(id));
|
43
|
+
if (id === 'marketplace' || id === 'home') {
|
44
|
+
dispatch((0, SidebarActions_1.SetExpandSidebar)(false));
|
45
|
+
dispatch((0, SidebarActions_1.SetMinimalSidebar)(true));
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
dispatch((0, SidebarActions_1.SetExpandSidebar)(true));
|
49
|
+
dispatch((0, SidebarActions_1.SetMinimalSidebar)(false));
|
50
|
+
}
|
51
|
+
}, [id, dispatch]);
|
52
|
+
const iconRight = ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "icon-right" }, { children: (0, jsx_runtime_1.jsx)("div", { className: "icon-right-arrow" }, void 0) }), void 0));
|
53
|
+
if (subMenu) {
|
54
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('lsac-sidebar-main-link', { selected: selected }, { active: active }), onClick: onClick, onMouseOver: (e) => { onHover(id); }, title: label }, { children: [icon, iconRight] }), void 0));
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('lsac-sidebar-main-link', { selected: selected }, { active: active }), onClick: onClick, onMouseOver: (e) => { onHover(id); }, title: label }, { children: icon }), void 0));
|
58
|
+
}
|
59
|
+
}
|
60
|
+
exports.default = SidebarMainLink;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
function SidebarOption(props) {
|
5
|
+
const { label, onClick } = props;
|
6
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'lsac-sidebar-option', onClick: onClick }, { children: label }), void 0));
|
7
|
+
}
|
8
|
+
exports.default = SidebarOption;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
7
|
+
const react_1 = require("react");
|
8
|
+
const SidebarConstants_1 = require("../constants/SidebarConstants");
|
9
|
+
const CategorizedSubmenu_1 = __importDefault(require("./sidebar_submenus/CategorizedSubmenu"));
|
10
|
+
const Models_1 = require("../interfaces/Models");
|
11
|
+
const react_redux_1 = require("react-redux");
|
12
|
+
const SubmenuUtil_1 = __importDefault(require("../util/SubmenuUtil"));
|
13
|
+
function groupApplicationsByCategory(applications) {
|
14
|
+
return applications.reduce((memo, application) => {
|
15
|
+
const { category } = application;
|
16
|
+
const updatedGrouping = Object.assign({}, memo);
|
17
|
+
const { myApps, engagementApps, collaborationApps, managementApps } = updatedGrouping;
|
18
|
+
switch (category) {
|
19
|
+
case Models_1.SidebarCategory.COLLABORATION:
|
20
|
+
updatedGrouping.collaborationApps = [...collaborationApps, application];
|
21
|
+
break;
|
22
|
+
case Models_1.SidebarCategory.ENGAGEMENT:
|
23
|
+
updatedGrouping.engagementApps = [...engagementApps, application];
|
24
|
+
break;
|
25
|
+
case Models_1.SidebarCategory.MANAGEMENT:
|
26
|
+
updatedGrouping.managementApps = [...managementApps, application];
|
27
|
+
break;
|
28
|
+
case Models_1.SidebarCategory.MY_APPS:
|
29
|
+
updatedGrouping.myApps = [...myApps, application];
|
30
|
+
break;
|
31
|
+
default:
|
32
|
+
}
|
33
|
+
return updatedGrouping;
|
34
|
+
}, {
|
35
|
+
myApps: [],
|
36
|
+
engagementApps: [],
|
37
|
+
collaborationApps: [],
|
38
|
+
managementApps: [],
|
39
|
+
});
|
40
|
+
}
|
41
|
+
function getMenuForSelection(selection, groupedApps) {
|
42
|
+
const { myApps, engagementApps, collaborationApps, managementApps } = groupedApps;
|
43
|
+
const myAppsComponent = (0, jsx_runtime_1.jsx)(CategorizedSubmenu_1.default, { applications: myApps, title: 'My Apps', className: 'lsac-my-apps-pane' }, void 0);
|
44
|
+
switch (selection) {
|
45
|
+
case SidebarConstants_1.SidebarMenuTypes.MyApps:
|
46
|
+
return myAppsComponent;
|
47
|
+
case SidebarConstants_1.SidebarMenuTypes.Engagement:
|
48
|
+
return (0, jsx_runtime_1.jsx)(CategorizedSubmenu_1.default, { applications: engagementApps, title: 'Engagement', className: 'lsac-engagement-pane' }, void 0);
|
49
|
+
case SidebarConstants_1.SidebarMenuTypes.Collaboration:
|
50
|
+
return (0, jsx_runtime_1.jsx)(CategorizedSubmenu_1.default, { applications: collaborationApps, title: 'Collaboration', className: 'lsac-collaboration-pane' }, void 0);
|
51
|
+
case SidebarConstants_1.SidebarMenuTypes.Management:
|
52
|
+
return (0, jsx_runtime_1.jsx)(CategorizedSubmenu_1.default, { applications: managementApps, title: 'Administration', className: 'lsac-management-pane' }, void 0);
|
53
|
+
case SidebarConstants_1.SidebarMenuTypes.Home:
|
54
|
+
return null;
|
55
|
+
default:
|
56
|
+
return (0, jsx_runtime_1.jsx)("div", {}, void 0);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
function SidebarSubMenu(props) {
|
60
|
+
const selectedOption = (0, react_redux_1.useSelector)((state) => state.sidebar.selectedSidebarOption);
|
61
|
+
const localApps = (0, react_redux_1.useSelector)((state) => state.sidebar.localApplications);
|
62
|
+
const keycloakApps = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.auth.userInfo) === null || _a === void 0 ? void 0 : _a.applications; }) || [];
|
63
|
+
const applications = (0, react_1.useMemo)(() => [...localApps, ...(keycloakApps.map(SubmenuUtil_1.default.keycloakAppToApplication))], [localApps, keycloakApps]);
|
64
|
+
const groupedApps = (0, react_1.useMemo)(() => groupApplicationsByCategory(applications), [applications]);
|
65
|
+
const displayComponent = getMenuForSelection(selectedOption, groupedApps);
|
66
|
+
return displayComponent;
|
67
|
+
}
|
68
|
+
exports.default = SidebarSubMenu;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
7
|
+
const react_1 = __importDefault(require("react"));
|
8
|
+
function getDetailsFromType(type) {
|
9
|
+
let color;
|
10
|
+
let text;
|
11
|
+
let options;
|
12
|
+
switch (type) {
|
13
|
+
case 'apps':
|
14
|
+
color = '#2d7cb5';
|
15
|
+
text = 'My Apps';
|
16
|
+
options = [];
|
17
|
+
break;
|
18
|
+
case 'collaboration':
|
19
|
+
color = '#0f7a11';
|
20
|
+
text = 'Collaboration';
|
21
|
+
options = [];
|
22
|
+
break;
|
23
|
+
case 'management':
|
24
|
+
color = '#3c003c';
|
25
|
+
text = 'Management';
|
26
|
+
options = [];
|
27
|
+
break;
|
28
|
+
case 'marketplace':
|
29
|
+
color = '#9a521c';
|
30
|
+
text = 'Marketplace';
|
31
|
+
options = [];
|
32
|
+
break;
|
33
|
+
case 'engage':
|
34
|
+
color = '#34190a';
|
35
|
+
text = 'Engage';
|
36
|
+
options = [];
|
37
|
+
break;
|
38
|
+
default:
|
39
|
+
color = '#fff';
|
40
|
+
text = '';
|
41
|
+
options = [];
|
42
|
+
break;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
function SidebarTab({ type, selectedType }) {
|
46
|
+
const { color, text, options } = getDetailsFromType(type);
|
47
|
+
const identifier = `lsac-sidebar-tab-${type}`;
|
48
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: identifier }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'lsac-sidebar-tab-text' }, { children: text }), void 0) }), identifier));
|
49
|
+
}
|
50
|
+
const MemoizedSidebarTab = react_1.default.memo(SidebarTab);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { SidebarDisplayModes, TopnavDisplayModes } from "../constants/UtilityConstants";
|
3
|
+
interface Props {
|
4
|
+
extraTopNavComponent: any;
|
5
|
+
topNavHeight: string;
|
6
|
+
applicationTitle: string;
|
7
|
+
accountName: string;
|
8
|
+
accountSwitchUrl: string;
|
9
|
+
logoutUrl: string;
|
10
|
+
sidebarDisplayMode: SidebarDisplayModes;
|
11
|
+
topnavDisplayMode: TopnavDisplayModes;
|
12
|
+
}
|
13
|
+
declare function TopNav(props: Props): JSX.Element;
|
14
|
+
export default TopNav;
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
7
|
+
const react_1 = require("react");
|
8
|
+
const react_redux_1 = require("react-redux");
|
9
|
+
// import Hamburger from '../static/images/hamburger-icon.svg';
|
10
|
+
// import CloseHamburger from '../static/images/close-hamburger-icon.svg'
|
11
|
+
// import SaamaLogo from '../static/images/saama_logo.svg';
|
12
|
+
// import UserIcon from '../static/images/icon-user.svg';
|
13
|
+
const classnames_1 = __importDefault(require("classnames"));
|
14
|
+
const SidebarActions_1 = require("../actions/SidebarActions");
|
15
|
+
const react_bootstrap_1 = require("react-bootstrap");
|
16
|
+
const UtilityConstants_1 = require("../constants/UtilityConstants");
|
17
|
+
// icon imports
|
18
|
+
const icomoon_library_json_1 = __importDefault(require("../resources/icomoon-library.json"));
|
19
|
+
const icomoon_react_1 = __importDefault(require("icomoon-react"));
|
20
|
+
require('../stylesheets/topnav.scss');
|
21
|
+
require('../stylesheets/study-filter.scss');
|
22
|
+
require('../stylesheets/fontIcons.css');
|
23
|
+
function TopNav(props) {
|
24
|
+
const { extraTopNavComponent, topNavHeight, applicationTitle, accountName, accountSwitchUrl, logoutUrl, sidebarDisplayMode, topnavDisplayMode } = props;
|
25
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
26
|
+
const isMinimal = (0, react_redux_1.useSelector)((state) => state.sidebar.isMinimal);
|
27
|
+
const expanded = (0, react_redux_1.useSelector)((state) => state.sidebar.expanded);
|
28
|
+
const userName = (0, react_redux_1.useSelector)((state) => state.auth.userInfo && state.auth.userInfo.name);
|
29
|
+
const uiDevMode = (0, react_redux_1.useSelector)((state) => state.auth.uiDevMode);
|
30
|
+
const isLogoClickable = sidebarDisplayMode === UtilityConstants_1.SidebarDisplayModes.HIDDEN;
|
31
|
+
function handleToggleClick() {
|
32
|
+
// Don't handle click events if always showing the sidebar
|
33
|
+
if (!isLogoClickable) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
dispatch((0, SidebarActions_1.SetMinimalSidebar)(!isMinimal));
|
37
|
+
}
|
38
|
+
;
|
39
|
+
const extraStyle = {
|
40
|
+
height: topNavHeight,
|
41
|
+
};
|
42
|
+
// TODO - figure out what to do about logout
|
43
|
+
function logoutMenuClick() {
|
44
|
+
// Only handle logout when not in UI Dev mode
|
45
|
+
// if (!uiDevMode) {
|
46
|
+
// keycloak?.logout();
|
47
|
+
// }
|
48
|
+
}
|
49
|
+
const expandButtonClassnames = (0, classnames_1.default)('lsac-topnav-toggle', {
|
50
|
+
minimal: sidebarDisplayMode === UtilityConstants_1.SidebarDisplayModes.MINIMAL,
|
51
|
+
});
|
52
|
+
const userMenuClassnames = (0, classnames_1.default)('logout-menu', 'icon-userInfo', {
|
53
|
+
"click-disabled": uiDevMode
|
54
|
+
});
|
55
|
+
const showHamburger = () => {
|
56
|
+
let menuIcon;
|
57
|
+
if (isLogoClickable) {
|
58
|
+
// menuIcon = isMinimal || expanded ? <span className="close-hamburger-icon"><CloseHamburger /></span> : <Hamburger />
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
// menuIcon= <Hamburger />
|
62
|
+
}
|
63
|
+
return menuIcon;
|
64
|
+
};
|
65
|
+
// create a reference to the topNav toggle button
|
66
|
+
// use effect to send that reference to the Sidebar store upon rendering
|
67
|
+
const topNavToggleref = (0, react_1.useRef)(null);
|
68
|
+
(0, react_1.useEffect)(() => {
|
69
|
+
dispatch((0, SidebarActions_1.SetTopnavToggleref)(topNavToggleref));
|
70
|
+
}, [topNavToggleref]);
|
71
|
+
const expandButton = ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: expandButtonClassnames, ref: topNavToggleref }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: (0, classnames_1.default)('hamburger-logo', { clickable: isLogoClickable }, { disable: !isLogoClickable }), onClick: handleToggleClick }, { children: showHamburger() }), void 0), (0, jsx_runtime_1.jsx)("span", { className: (0, classnames_1.default)('saama-logo', { clickable: isLogoClickable }), onClick: handleToggleClick }, void 0), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: 'LSAC-logo' }, { children: ["Life Science ", (0, jsx_runtime_1.jsx)("br", {}, void 0), "Analytics Cloud"] }), void 0), !!applicationTitle ? (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "app-name" }, { children: applicationTitle }), void 0) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0)] }), void 0));
|
72
|
+
const content = topnavDisplayMode === UtilityConstants_1.TopnavDisplayModes.MINIMAL ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'top-nav-minimal header-logo', style: extraStyle }, { children: expandButton }), void 0))
|
73
|
+
: ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'top-nav', style: extraStyle }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'top-nav-row' }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'header-logo' }, { children: expandButton }), void 0), extraTopNavComponent, (0, jsx_runtime_1.jsx)("div", Object.assign({ className: userMenuClassnames, onClick: logoutMenuClick }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "user-icon" }, { children: (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown, { children: [(0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Toggle, Object.assign({ variant: "", id: "dropdown-basic" }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "account-name" }, { children: accountName }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "user-dropdown-contents" }, { children: (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown.Menu, { children: [(0, jsx_runtime_1.jsx)("span", { children: userName }, void 0), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "switch-account-link-wrapper" }, { children: (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown.Item, Object.assign({ href: accountSwitchUrl }, { children: [(0, jsx_runtime_1.jsx)(icomoon_react_1.default, { iconSet: icomoon_library_json_1.default, icon: "switch" }, void 0), " Switch Account"] }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "user-details-logout" }, { children: (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown.Item, Object.assign({ href: logoutUrl }, { children: [(0, jsx_runtime_1.jsx)(icomoon_react_1.default, { iconSet: icomoon_library_json_1.default, icon: "exit" }, void 0), "Logout"] }), void 0) }), void 0)] }, void 0) }), void 0)] }, void 0) }), void 0) }), void 0)] }), void 0) }), void 0));
|
74
|
+
return content;
|
75
|
+
}
|
76
|
+
exports.default = TopNav;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Application } from "../../interfaces/Models";
|
3
|
+
interface MyAppsProps {
|
4
|
+
title: string;
|
5
|
+
applications: Array<Application>;
|
6
|
+
className: string;
|
7
|
+
}
|
8
|
+
declare function CategorizedSubmenu(props: MyAppsProps): JSX.Element;
|
9
|
+
export default CategorizedSubmenu;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
7
|
+
const react_redux_1 = require("react-redux");
|
8
|
+
const SubmenuUtil_1 = __importDefault(require("../../util/SubmenuUtil"));
|
9
|
+
const SidebarActions_1 = require("../../actions/SidebarActions");
|
10
|
+
function CategorizedSubmenu(props) {
|
11
|
+
const Dispatch = (0, react_redux_1.useDispatch)();
|
12
|
+
const { title, applications, className } = props;
|
13
|
+
const showExpanded = (0, react_redux_1.useSelector)((state) => state.sidebar.showExpandedApps);
|
14
|
+
const selectedSidebarOption = (0, react_redux_1.useSelector)((state) => state.sidebar.selectedSidebarOption);
|
15
|
+
function setSelectedSidebarOption() {
|
16
|
+
Dispatch((0, SidebarActions_1.SetSelectedSidebarOption)(selectedSidebarOption));
|
17
|
+
}
|
18
|
+
;
|
19
|
+
function AppSequence(a, b) {
|
20
|
+
let x = (a.rank && a.rank.length > 0) ? parseInt(a.rank) : a.linkInfo.label.toUpperCase(), y = (b.rank && b.rank.length > 0) ? parseInt(b.rank) : b.linkInfo.label.toUpperCase();
|
21
|
+
return x == y ? 0 : x > y ? 1 : -1;
|
22
|
+
}
|
23
|
+
;
|
24
|
+
function getSortedAppsList() {
|
25
|
+
let appWithRank = [], appWithoutRank = [];
|
26
|
+
applications.filter((app) => app.attributes && !app.attributes['grouping']).forEach(app => {
|
27
|
+
if (app.rank && app.rank.length > 0) {
|
28
|
+
appWithRank.push(app);
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
appWithoutRank.push(app);
|
32
|
+
}
|
33
|
+
});
|
34
|
+
applications.filter((app) => app.attributes === undefined).forEach(app => {
|
35
|
+
appWithoutRank.push(app);
|
36
|
+
});
|
37
|
+
appWithRank = appWithRank.sort(AppSequence);
|
38
|
+
appWithoutRank = appWithoutRank.sort(AppSequence);
|
39
|
+
return [...appWithRank, ...appWithoutRank];
|
40
|
+
}
|
41
|
+
const appLinks = getSortedAppsList();
|
42
|
+
const toggleShowExpanded = () => {
|
43
|
+
Dispatch((0, SidebarActions_1.SetShowExpandedApps)(!showExpanded));
|
44
|
+
};
|
45
|
+
const expandedApps = title === 'My Apps' && applications.filter((app) => app.attributes['grouping']);
|
46
|
+
expandedApps && appLinks.splice(2, 0, expandedApps);
|
47
|
+
const rankedApps = appLinks.map((app, idx) => {
|
48
|
+
if (app.linkInfo) {
|
49
|
+
return SubmenuUtil_1.default.generateLink(app, idx);
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
return SubmenuUtil_1.default.generateSubApplications(app, toggleShowExpanded, showExpanded);
|
53
|
+
}
|
54
|
+
});
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: className }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'title' }, { children: title }), void 0), rankedApps] }), Math.random()));
|
56
|
+
}
|
57
|
+
exports.default = CategorizedSubmenu;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
function Marketplace(props) {
|
5
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'title' }, { children: "Marketplace" }), void 0) }, void 0));
|
6
|
+
}
|
7
|
+
exports.default = Marketplace;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SidebarMenuTypes = void 0;
|
4
|
+
var SidebarMenuTypes;
|
5
|
+
(function (SidebarMenuTypes) {
|
6
|
+
SidebarMenuTypes["Home"] = "home";
|
7
|
+
SidebarMenuTypes["MyApps"] = "my_apps";
|
8
|
+
SidebarMenuTypes["Management"] = "management";
|
9
|
+
SidebarMenuTypes["Collaboration"] = "collaboration";
|
10
|
+
SidebarMenuTypes["Marketplace"] = "marketplace";
|
11
|
+
SidebarMenuTypes["Engagement"] = "engagement";
|
12
|
+
})(SidebarMenuTypes = exports.SidebarMenuTypes || (exports.SidebarMenuTypes = {}));
|