diff --git a/demand-capacity-mgmt-frontend/src/components/capacitygroup/CapacityGroupsList.tsx b/demand-capacity-mgmt-frontend/src/components/capacitygroup/CapacityGroupsList.tsx index f1a02dbd..dfbd3e63 100644 --- a/demand-capacity-mgmt-frontend/src/components/capacitygroup/CapacityGroupsList.tsx +++ b/demand-capacity-mgmt-frontend/src/components/capacitygroup/CapacityGroupsList.tsx @@ -26,6 +26,7 @@ import { Button, Col, Dropdown, Form, OverlayTrigger, Row, Tooltip } from 'react import { FaCopy, FaEllipsisV, FaEye, FaRedo } from 'react-icons/fa'; import { LuStar } from 'react-icons/lu'; import { CapacityGroupContext } from '../../contexts/CapacityGroupsContextProvider'; +import { CompanyContext } from '../../contexts/CompanyContextProvider'; import { FavoritesContext } from "../../contexts/FavoritesContextProvider"; import { useUser } from '../../contexts/UserContext'; import '../../index.css'; @@ -52,6 +53,7 @@ const CapacityGroupsList: React.FC = () => { const [sortOrder, setSortOrder] = useState('asc'); const [capacitygroupsPerPage, setcapacitygroupsPerPage] = useState(20); // Set the default value here const { addFavorite, fetchFavoritesByType, deleteFavorite } = useContext(FavoritesContext)!; + const { findCompanyByCompanyID } = useContext(CompanyContext)!; const [favoriteCapacityGroups, setFavoriteCapacityGroups] = useState([]); const handleSort = (column: string) => { @@ -247,6 +249,7 @@ const CapacityGroupsList: React.FC = () => {

{getUserGreeting(user)}!

+ {findCompanyByCompanyID(user?.companyID || '')?.companyName || ''}
@@ -254,8 +257,10 @@ const CapacityGroupsList: React.FC = () => {
-
diff --git a/demand-capacity-mgmt-frontend/src/components/dcm/AppComponent.tsx b/demand-capacity-mgmt-frontend/src/components/dcm/AppComponent.tsx index d18ccf56..5bd863f8 100644 --- a/demand-capacity-mgmt-frontend/src/components/dcm/AppComponent.tsx +++ b/demand-capacity-mgmt-frontend/src/components/dcm/AppComponent.tsx @@ -23,6 +23,7 @@ import React from 'react'; import { Route, Routes } from "react-router-dom"; import CapacityGroupsProvider from '../../contexts/CapacityGroupsContextProvider'; +import CompanyContextProvider from '../../contexts/CompanyContextProvider'; import DemandContextProvider from '../../contexts/DemandContextProvider'; import EventsContextProvider from '../../contexts/EventsContextProvider'; import FavoritesContextProvider from "../../contexts/FavoritesContextProvider"; @@ -53,10 +54,13 @@ const AppComponent: React.FC = () => { - - - - + + + + + + + diff --git a/demand-capacity-mgmt-frontend/src/components/demands/DemandManagement.tsx b/demand-capacity-mgmt-frontend/src/components/demands/DemandManagement.tsx index b573a69d..92bc8d81 100644 --- a/demand-capacity-mgmt-frontend/src/components/demands/DemandManagement.tsx +++ b/demand-capacity-mgmt-frontend/src/components/demands/DemandManagement.tsx @@ -353,8 +353,10 @@ const DemandManagement: React.FC = () => { onClick={() => setShowAddModal(true)}> New Material Demand )} -
diff --git a/demand-capacity-mgmt-frontend/src/components/pages/EventsPage.tsx b/demand-capacity-mgmt-frontend/src/components/pages/EventsPage.tsx index 47fdc5dc..a019bcab 100644 --- a/demand-capacity-mgmt-frontend/src/components/pages/EventsPage.tsx +++ b/demand-capacity-mgmt-frontend/src/components/pages/EventsPage.tsx @@ -199,8 +199,10 @@ function EventsPage() {
- {user?.role === 'ADMIN' && (
- {user?.role === 'SUPPLIER' && ( <> diff --git a/demand-capacity-mgmt-frontend/src/contexts/CompanyContextProvider.tsx b/demand-capacity-mgmt-frontend/src/contexts/CompanyContextProvider.tsx index 136ef58f..a1a59a31 100644 --- a/demand-capacity-mgmt-frontend/src/contexts/CompanyContextProvider.tsx +++ b/demand-capacity-mgmt-frontend/src/contexts/CompanyContextProvider.tsx @@ -39,6 +39,7 @@ export interface Company { interface CompanyContextData { companies: Company[]; topCompanies: Company[]; + findCompanyByCompanyID: (companyID: string) => Company | undefined; } export const CompanyContext = createContext(undefined); @@ -77,9 +78,13 @@ const CompanyContextProvider: React.FC> = (props) => }, [access_token]); + const findCompanyByCompanyID = (companyID: string | undefined): Company | undefined => { + return companies.find(company => company.id === companyID); + }; + return ( - + {props.children} ); diff --git a/demand-capacity-mgmt-frontend/src/index.css b/demand-capacity-mgmt-frontend/src/index.css index 78e2b64b..b1241652 100644 --- a/demand-capacity-mgmt-frontend/src/index.css +++ b/demand-capacity-mgmt-frontend/src/index.css @@ -318,6 +318,9 @@ code { } +.spin-on-hover:hover .button-content { + animation: spin 0.7s ease-in-out infinite; +} @keyframes spin { 0% { @@ -329,15 +332,17 @@ code { } } -.spin-on-hover { - animation: spin 1s ease-in-out; +.button-content { + display: inline-block; transform-origin: center; + /* Ensure the span takes the size of its content */ } -.spin-on-hover:hover { - animation: spin 1s ease-in-out infinite; +.icon { + /* Any specific styling for your icon */ } + /* Admin Panel */ .tabs-column { background-color: #f0f0f0;