props.onActiveInactiveClick(props.user)}
- />
-
-
- {props.user.infringementCount}
-
- {/*
- This person has {props.user.infringementCount} blue square{props.user.infringementCount !== 1 ? 's' : ''}
- */}
-
- {!canSeeReports ? (
-
- You don't have permission to view user reports
-
- ) : (
- ''
- )}
-
- {
- if (!canSeeReports) {
- event.preventDefault();
- return;
- }
+
+
+ {/* Left stack */}
+
+
+
- if (
- event.metaKey || event.ctrlKey ||
- event.shiftKey || event.altKey ||
- event.button !== 0
- ) {
- return;
- }
+
- event.preventDefault();
- history.push(`/peoplereport/${props.user._id}`);
- }}
- style={{
- textDecoration: 'none',
- opacity: canSeeReports ? 1 : 0.7,
- cursor: canSeeReports ? 'pointer' : 'not-allowed',
- display: 'inline-block',
- lineHeight: 0,
- padding: 0,
- }}
- title="Click to view user report"
- >
- 
-
+ {/* Center dot */}
+
+ props.onActiveInactiveClick(props.user)}
+ />
+
-
+ {/* Permission tooltip remains exactly the same */}
+ {!canSeeReports ? (
+
+ You don't have permission to view user reports
+
+ ) : (
+ ''
+ )}
+
+ {/* Right stack */}
+
{
+ to={`/peoplereport/${props.user._id}`}
+ onClick={event => {
if (!canSeeReports) {
- e.preventDefault();
+ event.preventDefault();
return;
}
+
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) {
+ return;
+ }
+
+ event.preventDefault();
+ history.push(`/peoplereport/${props.user._id}`);
}}
- target="_blank"
- rel="noopener noreferrer"
+ className={styles.iconLink}
+ title="Click to view user report"
>
-
+
-
-
- |
-
+
+ {
+ if (!canSeeReports) e.preventDefault();
+ }}
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+
+
+
+
+ |
+ {/* FIRST NAME */}
+
{editUser?.first ? (
- |
-
+
+ {/* LAST NAME */}
+ |
{editUser?.last ? (
- |
-
+
+ {/* ROLE */}
+ |
{editUser?.role && roles !== undefined ? (
<>
-
-
- {formData.role}
-
- >
+
+
+ {formData.role}
+
+ >
) : (
|
-
+ {/* TITLE */}
+ |
{editUser?.jobTitle ? (
-
- {formData.jobTitle}
+
+
+ {formData.jobTitle}
+
{
navigator.clipboard.writeText(formData.jobTitle);
@@ -343,8 +350,8 @@ const UserTableDataComponent = (props) => {
) : (
{
updateFormData({ ...formData, jobTitle: e.target.value });
@@ -352,15 +359,17 @@ const UserTableDataComponent = (props) => {
}}
/>
)}
-
|
-
+ {/* EMAIL */}
+ |
{editUser?.email ? (
- |
+
+ {/* WEEKLY HOURS */}
{editUser?.weeklycommittedHours ? (
{formData.weeklycommittedHours}
@@ -387,7 +400,7 @@ const UserTableDataComponent = (props) => {
{
const numericValue = Number(rawValue);
if (numericValue < 0) {
- toast.error('If negative hours worked, we’d all be on vacation already. Try again, and be sure weekly hours are set to zero or more.');
- return; // stop update
+ toast.error(
+ 'If negative hours worked, we’d all be on vacation already. Try again, and be sure weekly hours are set to zero or more.',
+ );
+ return;
}
updateFormData({
@@ -405,15 +420,13 @@ const UserTableDataComponent = (props) => {
weeklycommittedHours: numericValue,
});
- addUserInformation(
- 'weeklycommittedHours',
- numericValue,
- props.user._id
- );
+ addUserInformation('weeklycommittedHours', numericValue, props.user._id);
}}
/>
)}
|
+
+ {/* PAUSE/RESUME */}
{!canChangeUserStatus ? (
{
onClick={() => {
if (cantUpdateDevAdminDetails(props.user.email, props.authEmail)) {
// eslint-disable-next-line no-alert
- alert(
- 'STOP! YOU SHOULDN’T BE TRYING TO CHANGE THIS. Please reconsider your choices.',
- );
+ alert('STOP! YOU SHOULDN’T BE TRYING TO CHANGE THIS. Please reconsider your choices.');
return;
}
onReset(true);
- props.onPauseResumeClick(
- props.user,
- props.user.isActive ? UserStatus.Inactive : UserStatus.Active,
- );
+ props.onPauseResumeClick(props.user, props.user.isActive ? UserStatus.Inactive : UserStatus.Active);
}}
style={{
- ...darkMode ? { boxShadow: '0 0 0 0', fontWeight: 'bold' } : boxStyle,
- padding: '5px', // Added 2px padding
+ ...(darkMode ? { boxShadow: '0 0 0 0', fontWeight: 'bold' } : boxStyle),
+ padding: '5px',
}}
disabled={!canChangeUserStatus}
id={`btn-pause-profile-${props.user._id}`}
@@ -454,17 +462,20 @@ const UserTableDataComponent = (props) => {
{getButtonText()}
|
-
+
+ {/* REQUESTED TIME OFF */}
+ |
+
{props.timeOffRequests?.length > 0 && (
)}
|
+
+ {/* FINAL DAY */}
{!isCurrentUser && (
<>
@@ -506,11 +520,10 @@ const UserTableDataComponent = (props) => {
) : (
''
)}
- {
- // Update the user object in the parent state
props.onUserUpdate(updatedUser);
}}
id={`btn-final-day-${props.user._id}`}
@@ -519,21 +532,22 @@ const UserTableDataComponent = (props) => {
>
)}
|
+
+ {/* PAUSED UNTIL */}
- {props.user.isActive === false && props.user.reactivationDate
- ? formatDateLocal(props.user.reactivationDate)
- : ''}
+ {props.user.isActive === false && props.user.reactivationDate ? formatDateLocal(props.user.reactivationDate) : ''}
|
+
+ {/* START DATE */}
{editUser?.startDate ? (
-
- { props.user.startDate ? formatDateLocal(props.user.startDate) : 'N/A' }
- {/* {formData.startDate},{props.user.startDate} */}
-
+ {props.user.startDate ? formatDateLocal(props.user.startDate) : 'N/A'}
) : (
{
updateFormData({ ...formData, startDate: e.target.value });
@@ -542,17 +556,17 @@ const UserTableDataComponent = (props) => {
/>
)}
|
-
+
+ {/* END DATE */}
+ |
{editUser?.endDate ? (
- |
+
+ {/* ACTIONS */}
{checkPermissionsOnOwner() ? null : (
@@ -592,14 +610,15 @@ const UserTableDataComponent = (props) => {
props.onDeleteClick(props.user, 'archive');
}}
style={{
- ...darkMode ? { boxShadow: '0 0 0 0', fontWeight: 'bold' } : boxStyle,
- padding: '5px', // Added 2px padding
+ ...(darkMode ? { boxShadow: '0 0 0 0', fontWeight: 'bold' } : boxStyle),
+ padding: '5px',
}}
disabled={props.auth?.user.userid === props.user._id || !canDeleteUsers}
>
{DELETE}
+
{
|