From 747910752d8473cffdcd8f5743a6b6ebdc668655 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Thu, 25 Jan 2024 11:38:04 +0100 Subject: [PATCH 1/2] OM-115: fix sidebar, layout adjustments --- src/components/RequireAuth.js | 43 +++++++++++-------- .../generics/MainMenuContribution.js | 16 ++++--- src/components/generics/Searcher.js | 5 +-- src/constants.js | 4 ++ src/pages/LoginPage.js | 11 +++-- 5 files changed, 48 insertions(+), 31 deletions(-) diff --git a/src/components/RequireAuth.js b/src/components/RequireAuth.js index d2341bde..2082db6d 100644 --- a/src/components/RequireAuth.js +++ b/src/components/RequireAuth.js @@ -27,6 +27,7 @@ import { useBoolean, useAuthentication } from "../helpers/hooks"; import FormControlLabel from '@material-ui/core/FormControlLabel'; import { Switch } from "@material-ui/core"; import { useTranslations } from "../helpers/i18n"; +import { DEFAULT } from "../constants"; export const APP_BAR_CONTRIBUTION_KEY = "core.AppBar"; export const MAIN_MENU_CONTRIBUTION_KEY = "core.MainMenu"; @@ -200,8 +201,16 @@ const useStyles = makeStyles((theme) => ({ })); const RequireAuth = (props) => { - const { children, logo, redirectTo, isSecondaryCalendar, setSecondaryCalendar, onEconomicDialogOpen, ...others } = props; - const [isOpen, setOpen] = useBoolean(); + const { + children, + logo, + whiteLogo, + redirectTo, + isSecondaryCalendar, + setSecondaryCalendar, + onEconomicDialogOpen, + ...others + } = props; const [isOpen, setOpen] = useBoolean(); const [isDrawerOpen, setDrawerOpen] = useBoolean(); const theme = useTheme(); const classes = useStyles(); @@ -214,6 +223,7 @@ const RequireAuth = (props) => { "allowSecondCalendar", false, ); + const isWorker = modulesManager.getConf("fe-insuree", "isWorker", DEFAULT.IS_WORKER); const isAppBarMenu = useMemo(() => theme.menu.variant.toUpperCase() === "APPBAR", [theme.menu.variant]); @@ -243,7 +253,7 @@ const RequireAuth = (props) => { @@ -313,18 +325,15 @@ const RequireAuth = (props) => {
- {!!calendarSwitch && - } - label={formatMessage("core.calendarSwitcher")} - labelPlacement="start" - /> - } + {!!calendarSwitch && ( + + } + label={formatMessage("core.calendarSwitcher")} + labelPlacement="start" + /> + )} ({ drawerHeading: { fontSize: theme.menu.drawer.fontSize, color: theme.menu.drawer.textColor, - paddingTop: theme.menu.drawer.fontSize / 2, }, drawerDivider: { // width: 100 @@ -68,22 +67,27 @@ const Accordion = withStyles({ expanded: {}, })(MuiAccordion); -const AccordionSummary = withStyles({ +const AccordionSummary = withStyles((theme) => ({ root: { - backgroundColor: "#006273", - + backgroundColor: theme.palette.primary.main, + color: theme.palette.secondary.main, minHeight: 56, "&$expanded": { minHeight: 56, }, }, content: { + margin: "0", + padding: "0", + alignItems: 'center', + justifyContent: 'start', "&$expanded": { - margin: "12px 0", + margin: "0", }, + color: theme.palette.secondary.main }, expanded: {}, -})(MuiAccordionSummary); +}))(MuiAccordionSummary); const AccordionDetails = withStyles((theme) => ({ root: { diff --git a/src/components/generics/Searcher.js b/src/components/generics/Searcher.js index f3ccfaf2..59f4a179 100644 --- a/src/components/generics/Searcher.js +++ b/src/components/generics/Searcher.js @@ -42,7 +42,6 @@ const styles = (theme) => ({ paperHeaderAction: { paddingInline: 5, }, - paperDivider: theme.paper.divider, tableHeaderAction: theme.table.headerAction, processing: { margin: theme.spacing(1), @@ -518,9 +517,7 @@ class Searcher extends Component { )} - - - + ({ container: { @@ -44,6 +44,7 @@ const LoginPage = ({ logo }) => { const auth = useAuthentication(); const [isAuthenticating, setAuthenticating] = useState(false); const showMPassProvider = modulesManager.getConf("fe-core", "LoginPage.showMPassProvider", false); + const isWorker = modulesManager.getConf("fe-insuree", "isWorker", DEFAULT.IS_WORKER); useEffect(() => { if (auth.isAuthenticated) { @@ -98,9 +99,11 @@ const LoginPage = ({ logo }) => { - - {formatMessage("appName")} - + {!isWorker && ( + + {formatMessage("appName")} + + )} {showMPassProvider ? ( <> From 74d98fa248b7be53a18afe303467986c16b933c5 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Thu, 25 Jan 2024 12:02:53 +0100 Subject: [PATCH 2/2] OM-115: add alt attribute --- src/components/RequireAuth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/RequireAuth.js b/src/components/RequireAuth.js index 2082db6d..7a31347f 100644 --- a/src/components/RequireAuth.js +++ b/src/components/RequireAuth.js @@ -253,7 +253,7 @@ const RequireAuth = (props) => {