Header_UI_Enhancement #28

Merged
vikas.nale merged 6 commits from Header_UI_Enhancement into Feature_Task_Management 2025-04-18 11:38:58 +00:00
3 changed files with 33522 additions and 44084 deletions
Showing only changes of commit fdc20d948d - Show all commits

View File

@ -139,3 +139,15 @@
text-align: left; text-align: left;
padding-left: 60px; padding-left: 60px;
} }
.cusor-pointer {
cursor: pointer;
}
/* .apexcharts-toolbar {
z-index: 0 !important;
} */
.font-italic {
font-style: italic;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,22 @@
import getGreetingMessage from "../../utils/greetingHandler"; import getGreetingMessage from "../../utils/greetingHandler";
import { clearAllCache } from "../../slices/apiDataManager"; import { clearAllCache } from "../../slices/apiDataManager";
import AuthRepository from "../../repositories/AuthRepository"; import AuthRepository from "../../repositories/AuthRepository";
import {useDispatch, } from "react-redux"; import { useDispatch } from "react-redux";
import {changeMaster} from "../../slices/localVariablesSlice"; import { changeMaster } from "../../slices/localVariablesSlice";
import useMaster from "../../hooks/masterHook/useMaster"; import useMaster from "../../hooks/masterHook/useMaster";
import {useProfile} from "../../hooks/useProfile"; import { useProfile } from "../../hooks/useProfile";
import {useNavigate} from "react-router-dom"; import { useNavigate } from "react-router-dom";
import Avatar from "../../components/common/Avatar"; import Avatar from "../../components/common/Avatar";
const Header = () =>{ const Header = () => {
const {profile} = useProfile() const { profile } = useProfile();
const dispatch = useDispatch( changeMaster( "Job Role" ) ) const dispatch = useDispatch(changeMaster("Job Role"));
const {data, loading} = useMaster() const { data, loading } = useMaster();
const navigate = useNavigate() const navigate = useNavigate();
const getRole = (roles,joRoleId) => const getRole = (roles, joRoleId) => {
{ if (!Array.isArray(roles)) return "User";
if (!Array.isArray(roles)) return "User"; let role = roles.find((role) => role.id === joRoleId);
let role = roles.find( role => role.id === joRoleId )
return role ? role.name : "User"; return role ? role.name : "User";
} };
const handleLogout = (e) => { const handleLogout = (e) => {
e.preventDefault(); // Prevent default anchor behavior (e.g., page reload) e.preventDefault(); // Prevent default anchor behavior (e.g., page reload)
logout(); logout();
@ -46,7 +45,6 @@ const Header = () =>{
clearAllCache(); clearAllCache();
window.location.href = "/auth/login"; window.location.href = "/auth/login";
}); });
} catch (error) { } catch (error) {
console.error( console.error(
"Error during logout:", "Error during logout:",
@ -55,10 +53,9 @@ const Header = () =>{
} }
}; };
const handleProfilePage = () => {
const handleProfilePage = ()=>{ navigate(`/employee/${profile?.employeeInfo?.id}?for=account`);
navigate(`/employee/${profile?.employeeInfo?.id}?for=account`) };
}
return ( return (
<nav <nav
className="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme" className="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
@ -68,7 +65,6 @@ const Header = () =>{
<a <a
aria-label="toggle for sidebar" aria-label="toggle for sidebar"
className="nav-item nav-link px-0 me-xl-4" className="nav-item nav-link px-0 me-xl-4"
> >
<i className="bx bx-menu bx-sm"></i> <i className="bx bx-menu bx-sm"></i>
</a> </a>
@ -77,8 +73,481 @@ const Header = () =>{
className="navbar-nav-right d-flex align-items-center" className="navbar-nav-right d-flex align-items-center"
id="navbar-collapse" id="navbar-collapse"
> >
<marquee> {getGreetingMessage(profile?.employeeInfo?.firstName)}</marquee> {/* Search */}
<ul className="navbar-nav flex-row align-items-center ms-auto"> <div class="navbar-nav align-items-center">
<div class="nav-item navbar-search-wrapper mb-0">
<a
class="nav-item nav-link search-toggler px-0"
href="javascript:void(0);"
>
<span
class="d-inline-block text-body-secondary fw-normal"
id="autocomplete"
>
<div
class="aa-Autocomplete"
role="combobox"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="autocomplete-0-label"
>
<button
type="button"
class="aa-DetachedSearchButton"
title="Search"
id="autocomplete-0-label"
>
<div class="aa-DetachedSearchButtonIcon"></div>
<div class="aa-DetachedSearchButtonPlaceholder">
Search - <span className="font-italic">Comming Soon</span>
</div>
<div class="aa-DetachedSearchButtonQuery"></div>
</button>
</div>
</span>
</a>
</div>
</div>
{/* marquee */}
{/* <marquee>
{" "}
{getGreetingMessage(profile?.employeeInfo?.firstName)}
</marquee> */}
{/* icon list */}
<ul className="navbar-nav flex-row align-items-center ms-md-auto">
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
<a
class="nav-link dropdown-toggle hide-arrow"
href="javascript:void(0);"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<i class="icon-base bx bx-grid-alt icon-md"></i>
</a>
<div class="dropdown-menu dropdown-menu-end p-0">
<div class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3">
<h6 class="mb-0 me-auto">Shortcuts</h6>
<a
class="dropdown-shortcuts-add py-2 cusror-pointer"
data-bs-toggle="tooltip"
data-bs-placement="top"
aria-label="Add shortcuts"
data-bs-original-title="Add shortcuts"
>
<i class="icon-base bx bx-plus-circle text-heading"></i>
</a>
</div>
</div>
<div class="dropdown-shortcuts-list scrollable-container ps">
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-3">
<i class="icon-base bx bx-home icon-26px text-heading"></i>
</span>
<a href="/dashboard" class="stretched-link">
Dashboard
</a>
<small>User Dashboard</small>
</div>
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-3">
<i class="icon-base bx bx-building-house icon-26px text-heading"></i>
</span>
<a href="/projects" class="stretched-link">
Projects
</a>
<small>Projects List</small>
</div>
</div>
<div class="row row-bordered overflow-visible g-0">
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-3">
<i class="icon-base bx bx-user-check icon-26px text-heading"></i>
</span>
<a href="/activities/Attendance" class="stretched-link">
Attendance
</a>
<small>Manage Attendance</small>
</div>
<div class="dropdown-shortcuts-item col">
<span class="dropdown-shortcuts-icon rounded-circle mb-3">
<i class="icon-base bx bx-dumbbell icon-26px text-heading"></i>
</span>
<a href="/activities/task" class="stretched-link">
Task
</a>
<small>Work Allocations</small>
</div>
</div>
</div>
</div>
</li>
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-2 me-xl-0">
<a
class="nav-link dropdown-toggle hide-arrow cursor-pointer"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
<span class="position-relative">
<i class="icon-base bx bx-bell icon-lg"></i>
<span class="badge rounded-pill bg-danger badge-dot badge-notifications border"></span>
</span>
</a>
<ul class="dropdown-menu dropdown-menu-end p-0">
<li class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3">
<h6 class="mb-0 me-auto">Notification</h6>
<div class="d-flex align-items-center h6 mb-0">
<span class="badge bg-label-primary me-2">8 New</span>
<a
href="javascript:void(0)"
class="dropdown-notifications-all p-2"
data-bs-toggle="tooltip"
data-bs-placement="top"
aria-label="Mark all as read"
data-bs-original-title="Mark all as read"
>
<i class="icon-base bx bx-envelope-open text-heading"></i>
</a>
</div>
</div>
</li>
<li class="dropdown-notifications-list scrollable-container ps">
<ul class="list-group list-group-flush">
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img
src="../../assets/img/avatars/1.png"
alt=""
class="rounded-circle"
></img>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">Congratulation Lettie 🎉</h6>
<small class="mb-1 d-block text-body">
Won the monthly best seller gold badge
</small>
<small class="text-body-secondary">1h ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-danger">
CF
</span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">Charles Franklin</h6>
<small class="mb-1 d-block text-body">
Accepted your connection
</small>
<small class="text-body-secondary">12hr ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img
src="../../assets/img/avatars/2.png"
alt=""
class="rounded-circle"
></img>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">New Message </h6>
<small class="mb-1 d-block text-body">
You have new message from Natalie
</small>
<small class="text-body-secondary">1h ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-success">
<i class="icon-base bx bx-cart"></i>
</span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">Whoo! You have new order 🛒</h6>
<small class="mb-1 d-block text-body">
ACME Inc. made new order $1,154
</small>
<small class="text-body-secondary">1 day ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img
src="../../assets/img/avatars/9.png"
alt=""
class="rounded-circle"
></img>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">
Application has been approved 🚀
</h6>
<small class="mb-1 d-block text-body">
Your ABC project application has been approved.
</small>
<small class="text-body-secondary">2 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-success">
<i class="icon-base bx bx-pie-chart-alt"></i>
</span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">Monthly report is generated</h6>
<small class="mb-1 d-block text-body">
July monthly financial report is generated{" "}
</small>
<small class="text-body-secondary">3 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img
src="../../assets/img/avatars/5.png"
alt=""
class="rounded-circle"
></img>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">Send connection request</h6>
<small class="mb-1 d-block text-body">
Peter sent you connection request
</small>
<small class="text-body-secondary">4 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<img
src="../../assets/img/avatars/6.png"
alt=""
class="rounded-circle"
></img>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">New message from Jane</h6>
<small class="mb-1 d-block text-body">
Your have new message from Jane
</small>
<small class="text-body-secondary">5 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
<div class="d-flex">
<div class="flex-shrink-0 me-3">
<div class="avatar">
<span class="avatar-initial rounded-circle bg-label-warning">
<i class="icon-base bx bx-error"></i>
</span>
</div>
</div>
<div class="flex-grow-1">
<h6 class="small mb-0">CPU is running high</h6>
<small class="mb-1 d-block text-body">
CPU Utilization Percent is currently at 88.63%,
</small>
<small class="text-body-secondary">5 days ago</small>
</div>
<div class="flex-shrink-0 dropdown-notifications-actions">
<a
href="javascript:void(0)"
class="dropdown-notifications-read"
>
<span class="badge badge-dot"></span>
</a>
<a
href="javascript:void(0)"
class="dropdown-notifications-archive"
>
<span class="icon-base bx bx-x"></span>
</a>
</div>
</div>
</li>
</ul>
{/* <div class="ps__rail-x" style="left: 0px; bottom: 0px;">
<div
class="ps__thumb-x"
tabindex="0"
style="left: 0px; width: 0px;"
></div>
</div>
<div class="ps__rail-y" style="top: 0px; right: 0px;">
<div
class="ps__thumb-y"
tabindex="0"
style="top: 0px; height: 0px;"
></div>
</div> */}
</li>
<li class="border-top">
<div class="d-grid p-4">
<a
class="btn btn-primary btn-sm d-flex"
href="javascript:void(0);"
>
<small class="align-middle">View all notifications</small>
</a>
</div>
</li>
</ul>
</li>
<li className="nav-item navbar-dropdown dropdown-user dropdown"> <li className="nav-item navbar-dropdown dropdown-user dropdown">
<a <a
aria-label="dropdown profile avatar" aria-label="dropdown profile avatar"
@ -95,11 +564,7 @@ const Header = () =>{
</a> </a>
<ul className="dropdown-menu dropdown-menu-end"> <ul className="dropdown-menu dropdown-menu-end">
<li onClick={handleProfilePage}> <li onClick={handleProfilePage}>
<a <a aria-label="go to profile" className="dropdown-item">
aria-label="go to profile"
className="dropdown-item"
>
<div className="d-flex"> <div className="d-flex">
<div className="flex-shrink-0 me-3"> <div className="flex-shrink-0 me-3">
<div className="avatar avatar-online"> <div className="avatar avatar-online">
@ -110,8 +575,12 @@ const Header = () =>{
</div> </div>
</div> </div>
<div className="flex-grow-1"> <div className="flex-grow-1">
<span className="fw-medium d-block">{profile?.employeeInfo?.firstName}</span> <span className="fw-medium d-block">
<small className="text-muted">{ getRole(data,profile?.employeeInfo?.joRoleId)}</small> {profile?.employeeInfo?.firstName}
</span>
<small className="text-muted">
{getRole(data, profile?.employeeInfo?.joRoleId)}
</small>
</div> </div>
</div> </div>
</a> </a>
@ -119,11 +588,10 @@ const Header = () =>{
<li> <li>
<div className="dropdown-divider"></div> <div className="dropdown-divider"></div>
</li> </li>
<li onClick={handleProfilePage} > <li onClick={handleProfilePage}>
<a <a
aria-label="go to profile" aria-label="go to profile"
className="dropdown-item cusor-pointer" className="dropdown-item cusor-pointer"
> >
<i className="bx bx-user me-2"></i> <i className="bx bx-user me-2"></i>
<span className="align-middle">My Profile</span> <span className="align-middle">My Profile</span>
@ -131,9 +599,8 @@ const Header = () =>{
</li> </li>
<li> <li>
<a <a
aria-label="go to setting" aria-label="go to setting "
className="dropdown-item" className="dropdown-item cusor-pointer"
> >
<i className="bx bx-cog me-2"></i> <i className="bx bx-cog me-2"></i>
<span className="align-middle">Settings</span> <span className="align-middle">Settings</span>
@ -141,9 +608,8 @@ const Header = () =>{
</li> </li>
<li> <li>
<a <a
aria-label="go to billing" aria-label="go to billing "
className="dropdown-item" className="dropdown-item cusor-pointer"
> >
<span className="d-flex align-items-center align-middle"> <span className="d-flex align-items-center align-middle">
<i className="flex-shrink-0 bx bx-credit-card me-2"></i> <i className="flex-shrink-0 bx bx-credit-card me-2"></i>
@ -162,7 +628,7 @@ const Header = () =>{
<li> <li>
<a <a
aria-label="click to log out" aria-label="click to log out"
className="dropdown-item" className="dropdown-item cusor-pointer"
href="/logout" // Optional: Add this for accessibility, but it won't actually redirect href="/logout" // Optional: Add this for accessibility, but it won't actually redirect
onClick={handleLogout} onClick={handleLogout}
> >