Skip to content

Commit cc9b864

Browse files
Venkataramanan VenkateswaranVenkataramanan Venkateswaran
authored andcommitted
fix: build errors and resolve conflicts
1 parent 64ff12e commit cc9b864

File tree

1 file changed

+3
-162
lines changed

1 file changed

+3
-162
lines changed

src/components/LeaderBoard/Leaderboard.jsx

Lines changed: 3 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -317,37 +317,6 @@ function LeaderBoard({
317317
showTimeOffRequestModal(request);
318318
};
319319

320-
const manager = 'Manager';
321-
const adm = 'Administrator';
322-
const owner = 'Owner';
323-
324-
const handleDashboardAccess = item => {
325-
// check the logged in user is manager and if the dashboard is admin and owner
326-
if (loggedInUser.role === manager && [adm, owner].includes(item.role)) {
327-
// check the logged in user is admin and if dashboard is owner
328-
toast.error("Oops! You don't have the permission to access this user's dashboard!");
329-
} else if (loggedInUser.role === adm && [owner].includes(item.role)) {
330-
toast.error("Oops! You don't have the permission to access this user's dashboard!");
331-
}
332-
// check the logged in user isn't manager, administrator or owner and if they can access the dashboard
333-
else if (
334-
loggedInUser.role !== manager &&
335-
loggedInUser.role !== adm &&
336-
loggedInUser.role !== owner
337-
) {
338-
if ([manager, adm, owner].includes(item.role)) {
339-
// prevent access
340-
toast.error("Oops! You don't have the permission to access this user's dashboard!");
341-
} else {
342-
// allow access to the painel
343-
dashboardToggle(item);
344-
}
345-
} else {
346-
// allow access to the painel
347-
dashboardToggle(item);
348-
}
349-
};
350-
351320
// For Monthly and yearly anniversaries
352321
const [modalOpen, setModalOpen] = useState(false);
353322

@@ -818,72 +787,6 @@ function LeaderBoard({
818787

819788
return (
820789
<React.Fragment key={item.personId}>
821-
{/* First row - Status and Name only */}
822-
<tr
823-
className={`${
824-
darkMode ? 'dark-leaderboard-row' : 'light-leaderboard-row'
825-
} user-row-first`}
826-
data-user-id={item.personId}
827-
onMouseEnter={() => {
828-
document
829-
.querySelectorAll(`[data-user-id="${item.personId}"]`)
830-
.forEach(el => {
831-
el.classList.add('row-hover');
832-
});
833-
}}
834-
onMouseLeave={() => {
835-
document
836-
.querySelectorAll(`[data-user-id="${item.personId}"]`)
837-
.forEach(el => {
838-
el.classList.remove('row-hover');
839-
});
840-
}}
841-
>
842-
<td className="align-middle status-cell">
843-
<div>
844-
<Modal
845-
isOpen={isDashboardOpen === item.personId}
846-
toggle={dashboardToggle}
847-
className={darkMode ? 'text-light dark-mode' : ''}
848-
style={darkMode ? boxStyleDark : {}}
849-
>
850-
Jump to personal Dashboard
851-
</ModalHeader>
852-
<ModalBody className={darkMode ? 'bg-yinmn-blue' : ''}>
853-
<p className={darkMode ? 'text-light' : ''}>
854-
Are you sure you wish to view the dashboard for {item.name}?
855-
</p>
856-
</ModalBody>
857-
<ModalFooter className={darkMode ? 'bg-yinmn-blue' : ''}>
858-
<Button color="primary" onClick={() => showDashboard(item)}>
859-
Ok
860-
</Button>
861-
<Button color="danger" onClick={dashboardToggle}>
862-
Cancel
863-
</Button>
864-
</ModalFooter>
865-
</Modal>
866-
</div>
867-
<div
868-
style={{
869-
display: 'flex',
870-
alignItems: 'center',
871-
justifyContent: hasSummaryIndicatorPermission
872-
? 'space-between'
873-
: 'center',
874-
}}
875-
>
876-
{/* <Link to={`/dashboard/${item.personId}`}> */}
877-
<div
878-
role="button"
879-
tabIndex={0}
880-
onClick={() => {
881-
handleDashboardAccess(item);
882-
}}
883-
onKeyDown={e => {
884-
if (e.key === 'Enter') {
885-
handleDashboardAccess(item);
886-
}
887790
{/* Put the modal OUTSIDE the table rows to avoid JSX nesting issues */}
888791
<Modal
889792
isOpen={isDashboardOpen === item.personId}
@@ -1167,71 +1070,9 @@ function LeaderBoard({
11671070
>
11681071
{item.totaltime}
11691072
</span>
1170-
)}
1171-
</td>
1172-
<td className="align-middle">
1173-
<span title={mouseoverTextValue} id="Days left" style={{ color: 'red' }}>
1174-
{displayDaysLeft(item.endDate)}
1175-
</span>
1176-
</td>
1177-
<td className="align-middle">
1178-
<div
1179-
style={{
1180-
display: 'flex',
1181-
alignItems: 'center',
1182-
justifyContent: 'center',
1183-
}}
1184-
>
1185-
{hasTimeOff && (
1186-
<button
1187-
type="button"
1188-
onClick={() => {
1189-
const data = {
1190-
requests: [...allRequests[item.personId]],
1191-
name: item.name,
1192-
leaderboard: true,
1193-
};
1194-
handleTimeOffModalOpen(data);
1195-
}}
1196-
style={{ width: '35px', height: 'auto' }}
1197-
aria-label="View Time Off Requests"
1198-
>
1199-
<svg
1200-
xmlns="http://www.w3.org/2000/svg"
1201-
width="22"
1202-
height="19"
1203-
viewBox="0 0 448 512"
1204-
className="show-time-off-calender-svg"
1205-
>
1206-
<path d="M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zm64 80v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm128 0v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H336zM64 400v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H208zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H336c-8.8 0-16 7.2-16 16z" />
1207-
</svg>
1208-
</button>
1209-
)}
1210-
</div>
1211-
</td>
1212-
<td className="align-middle" id={`id${item.personId}`}>
1213-
<span title="Tangible time">{item.tangibletime}</span>
1214-
</td>
1215-
<td className="align-middle" aria-label="Description or purpose of the cell">
1216-
<Link
1217-
to={`/timelog/${item.personId}#currentWeek`}
1218-
title={`TangibleEffort: ${item.tangibletime} hours`}
1219-
>
1220-
<Progress value={item.barprogress} color={item.barcolor} />
1221-
</Link>
1222-
</td>
1223-
<td className="align-middle">
1224-
<span
1225-
title={mouseoverTextValue}
1226-
id="Total time"
1227-
className={
1228-
item.totalintangibletime_hrs > 0 ? 'leaderboard-totals-title' : null
1229-
}
1230-
>
1231-
{item.totaltime}
1232-
</span>
1233-
</td>
1234-
</tr>
1073+
</td>
1074+
</tr>
1075+
</React.Fragment>
12351076
);
12361077
})}
12371078
</tbody>

0 commit comments

Comments
 (0)