sixseconds-modules 1.6.10 → 1.6.12
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/README.md +0 -50
- package/dist/components/header/index.d.ts +1 -1
- package/dist/components/header/type.d.ts +1 -0
- package/dist/components/header/userProfile.d.ts +2 -1
- package/dist/index.cjs.js +14 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +15 -12
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import React__default, { createElement, useState, Component, useEffect } from "react";
|
|
16
|
-
import { styled, AppBar, Box, Avatar, ClickAwayListener, Stack, Typography,
|
|
16
|
+
import { styled, AppBar, Box, Avatar, ClickAwayListener, Stack, Typography, useMediaQuery, Dialog, Button, MenuItem, Link, Grid, Container, Badge, IconButton } from "@mui/material";
|
|
17
17
|
import MenuIcon from "@mui/icons-material/Menu";
|
|
18
18
|
import CheckIcon from "@mui/icons-material/Check";
|
|
19
19
|
import axios from "axios";
|
|
@@ -4255,8 +4255,15 @@ function formatDateUtil(dateString, flag, formatDate = MAIN_DATE_FORMAT) {
|
|
|
4255
4255
|
const dateTime = hooks.utc(dateString).local();
|
|
4256
4256
|
return dateString ? formatTwoValues(dateTime.format(formatDate), dateTime.format(MAIN_TIME_FORMAT)) : "";
|
|
4257
4257
|
}
|
|
4258
|
-
const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) => {
|
|
4258
|
+
const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions, router }) => {
|
|
4259
4259
|
const [state, setState] = useState({ toggles: { userProfile: false } });
|
|
4260
|
+
const handleRedirection2 = (appName, url2) => {
|
|
4261
|
+
if (router && appName === APP_NAMES.sso) {
|
|
4262
|
+
router.push(url2);
|
|
4263
|
+
} else {
|
|
4264
|
+
window.open(url2, "_blank");
|
|
4265
|
+
}
|
|
4266
|
+
};
|
|
4260
4267
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4261
4268
|
/* @__PURE__ */ jsxs(
|
|
4262
4269
|
Box,
|
|
@@ -4309,9 +4316,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) =>
|
|
|
4309
4316
|
direction: "row",
|
|
4310
4317
|
spacing: 1,
|
|
4311
4318
|
alignItems: "center",
|
|
4312
|
-
|
|
4313
|
-
href: SSO_ROUTES(userData?.appName).viewProfile,
|
|
4314
|
-
target: userData?.appName === APP_NAMES.sso ? "_self" : "_blank",
|
|
4319
|
+
onClick: () => handleRedirection2(userData?.appName, SSO_ROUTES().viewProfile),
|
|
4315
4320
|
sx: { color: "#1A1919", cursor: "pointer", textDecoration: "none" },
|
|
4316
4321
|
children: [
|
|
4317
4322
|
/* @__PURE__ */ jsx(SVG.CheckedPerson, {}),
|
|
@@ -4336,9 +4341,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) =>
|
|
|
4336
4341
|
direction: "row",
|
|
4337
4342
|
spacing: 1,
|
|
4338
4343
|
alignItems: "center",
|
|
4339
|
-
|
|
4340
|
-
href: SSO_ROUTES(userData?.appName).editProfile,
|
|
4341
|
-
target: userData?.appName === APP_NAMES.sso ? "_self" : "_blank",
|
|
4344
|
+
onClick: () => handleRedirection2(userData?.appName, SSO_ROUTES().editProfile),
|
|
4342
4345
|
sx: { color: "#1A1919", textDecoration: "none" },
|
|
4343
4346
|
children: [
|
|
4344
4347
|
/* @__PURE__ */ jsx(SVG.UserEdit, {}),
|
|
@@ -4363,9 +4366,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) =>
|
|
|
4363
4366
|
direction: "row",
|
|
4364
4367
|
spacing: 1,
|
|
4365
4368
|
alignItems: "center",
|
|
4366
|
-
|
|
4367
|
-
href: SSO_ROUTES(userData?.appName).changePasswordDialog,
|
|
4368
|
-
target: userData?.appName === APP_NAMES.sso ? "_self" : "_blank",
|
|
4369
|
+
onClick: () => handleRedirection2(userData?.appName, SSO_ROUTES().changePasswordDialog),
|
|
4369
4370
|
sx: { cursor: "pointer", textDecoration: "none" },
|
|
4370
4371
|
children: [
|
|
4371
4372
|
/* @__PURE__ */ jsx(SVG.CheckedPerson, {}),
|
|
@@ -5261,7 +5262,7 @@ const AppMenus = ({ menuItems, setInitialState, t: t2, appName }) => {
|
|
|
5261
5262
|
Grid,
|
|
5262
5263
|
{
|
|
5263
5264
|
component: Link,
|
|
5264
|
-
href:
|
|
5265
|
+
href: item.link + appName === APP_NAMES.sso ? "" : `?source=${appName}`,
|
|
5265
5266
|
target: item.type === "tab" ? "_self" : "_blank",
|
|
5266
5267
|
item: true,
|
|
5267
5268
|
md: 4,
|
|
@@ -5311,6 +5312,7 @@ const AppMenus = ({ menuItems, setInitialState, t: t2, appName }) => {
|
|
|
5311
5312
|
)) }) }) });
|
|
5312
5313
|
};
|
|
5313
5314
|
const Header = ({
|
|
5315
|
+
router,
|
|
5314
5316
|
frontCustomComponent,
|
|
5315
5317
|
endCustomComponents,
|
|
5316
5318
|
userData,
|
|
@@ -5463,6 +5465,7 @@ const Header = ({
|
|
|
5463
5465
|
Boolean(userData?.fullName) && /* @__PURE__ */ jsx(
|
|
5464
5466
|
UserProfile,
|
|
5465
5467
|
{
|
|
5468
|
+
router,
|
|
5466
5469
|
t,
|
|
5467
5470
|
userData,
|
|
5468
5471
|
initialState: state,
|