Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
44b54de
refactor: removed some comments, reintegrated endpoint calls to finis…
AnthonyWeathers Jun 12, 2026
fa5a99d
refactor: removed unused commented code and changed the success toast…
AnthonyWeathers Jun 19, 2026
e161e20
refactor: handled sonar issues
AnthonyWeathers Jun 19, 2026
9ac9515
refactor: modified test file to fix issues caused by code changes
AnthonyWeathers Jun 19, 2026
af6eaab
refactor: made slight changes to fix prop validation issues
AnthonyWeathers Jun 19, 2026
543a2ca
chore: merged development to resolve merge conflict
AnthonyWeathers Jun 19, 2026
2cd0c42
refactor: resolved two remaining prop validation issues
AnthonyWeathers Jun 21, 2026
2607336
chore: merged development for latest changes
AnthonyWeathers Jun 22, 2026
e20a316
refactor: changes made by Jae's suggestion and slight styling additio…
AnthonyWeathers Jun 29, 2026
296a073
refactor: addressed sonar issue
AnthonyWeathers Jun 30, 2026
59dc683
chore: merged development to resolve yarn lock conflict
AnthonyWeathers Jun 30, 2026
5fddc79
refactor: removed unused classes involving some global darkmode styling
AnthonyWeathers Jul 5, 2026
52ffe3b
refactor: changed prop drilling to using redux connect for map state …
AnthonyWeathers Jul 13, 2026
026aca9
Merge branch 'development' into Anthony/Continuation-For-PR#3917-Role…
AnthonyWeathers Jul 13, 2026
57832cd
refactor: addressed hovering over a change log row makes text not vis…
AnthonyWeathers Jul 14, 2026
bfe8482
refactor: resolved sonar nested ternary issue
AnthonyWeathers Jul 16, 2026
e8c30ad
refactor: merged development
AnthonyWeathers Jul 16, 2026
fa8ec9e
refactor: removed authUser value from test file due to being unneeded…
AnthonyWeathers Jul 16, 2026
a35e2ad
refactor: removed other instances of unneeded authUser object in test…
AnthonyWeathers Jul 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -797,53 +797,3 @@
.email-template-editor .d-flex {
align-items: center;
}

/* Dark Mode - Add/Edit Variable Modal */
:global(body.bm-dashboard-dark) :global(.modal-content) {
background-color: #1a2a3a;
color: #e0e0e0;
border-color: #2e5061;
}

:global(body.bm-dashboard-dark) :global(.modal-header) {
background-color: #1a2a3a;
border-bottom-color: #2e5061;
color: #e0e0e0;
}

:global(body.bm-dashboard-dark) :global(.modal-body) {
background-color: #1a2a3a;
color: #e0e0e0;
}

:global(body.bm-dashboard-dark) :global(.modal-footer) {
background-color: #1a2a3a;
border-top-color: #2e5061;
}

:global(body.bm-dashboard-dark) :global(.modal-body) :global(.form-control),
:global(body.bm-dashboard-dark) :global(.modal-body) :global(.form-select) {
background-color: #0d1f2d;
color: #e0e0e0;
border-color: #2e5061;
}

:global(body.bm-dashboard-dark) :global(.modal-body) :global(label),
:global(body.bm-dashboard-dark) :global(.modal-body) :global(.col-form-label) {
color: #e0e0e0;
}

:global(body.bm-dashboard-dark) :global(.modal-title),
:global(body.bm-dashboard-dark) :global(.modal-header) :global(.btn-close) {
color: #e0e0e0;
filter: invert(1);
}

/* Dark Mode - Type Selection Modal ListGroup */
:global(body.bm-dashboard-dark) :global(.list-group-item) {
background-color: #0d1f2d;
color: #e0e0e0;
border-color: #2e5061;
}


Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ function PermissionChangeLogTable({ changeLogs, darkMode, roleNamesToHighlight =
</div>
);
};

const darkHighLight = shouldHighlight => {
const darkClass = shouldHighlight ? styles['dark-highlight-row'] : styles.darkModeRow;
const lightClass = shouldHighlight ? styles['highlight-row'] : '';

return darkMode ? darkClass : lightClass;
};

return (
<>
<div className={styles['table-responsive']}>
Expand All @@ -128,7 +136,7 @@ function PermissionChangeLogTable({ changeLogs, darkMode, roleNamesToHighlight =
const nameValue = log?.individualName ? formatName(log.individualName) : log.roleName;
const shouldHighlight = roleSet.has(normalize(nameValue));
return (
<tr key={log._id} className={shouldHighlight ? styles['highlight-row'] : ''}>
<tr key={log._id} className={darkHighLight(shouldHighlight)}>
<td className={`${styles['permission-change-log-table--cell']} ${bgYinmnBlue}`}>
{`${formatDate(log.logDateTime)} ${formattedAmPmTime(log.logDateTime)}`}
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
background-color: #b2ebf2;
}

.darkModeRow:hover {
background-color: #1c2541 !important;
}

.dark-highlight-row {
background-color: #012758;
border-left: 4px solid #007281;
transition: background 0.2s ease;
}

.dark-highlight-row:hover {
background-color: #12328a;
}

.permission-change-log-table {
border-collapse: 'collapse';
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import hasPermission from '~/utils/permissions';
import { ENDPOINTS } from '~/utils/URL';
import TimeZoneDropDown from '../TimeZoneDropDown';
import styles from './BasicInformationTab.module.css';
import RoleChangePermissionsModal from '~/components/UserProfile/RoleChangePermissionsModal';


export const Name = props => {
Expand Down Expand Up @@ -494,6 +495,7 @@ const BasicInformationTab = props => {
const [timeZoneFilter, setTimeZoneFilter] = useState('');
const [desktopDisplay, setDesktopDisplay] = useState(window.innerWidth > 1024);
const [errorOccurred, setErrorOccurred] = useState(false);
const [showRolePermsModal, setShowRolePermsModal] = useState(false);
const dispatch = useDispatch();
const rolesAllowedToEditStatusFinalDay = ['Administrator', 'Owner'];
const canEditStatus = dispatch(hasPermission('interactWithPauseUserButton'));
Expand Down Expand Up @@ -723,43 +725,16 @@ const BasicInformationTab = props => {
</Col>
<Col md={desktopDisplay ? '6' : ''} className={darkMode ? 'bg-yinmn-blue' : ''}>
{canEditRole ? (
<FormGroup>
<select
id="role"
name="role"
className={`form-control ${darkMode ? 'bg-darkmode-liblack border-0 text-light' : ''}`}
value={userProfile.role || ''} // make sure this is a string
onChange={e => {
const newRole = e.target.value;
setUserProfile({
...userProfile,
role: newRole,
permissions: { ...userProfile.permissions, frontPermissions: [] },
});
}}
<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
<Button
color="primary"
style={darkMode ? boxStyleDark : boxStyle}
onClick={() => setShowRolePermsModal(true)}
>
{/* Optional placeholder when no role selected */}
{!userProfile.role && <option value="">Select role</option>}

{(roles || [])
.map(r => (typeof r === 'string' ? r : r.roleName)) // normalize
.filter(Boolean)
.map(roleName => {
if (roleName === 'Owner') return null; // skip Owner in this list
return (
<option key={roleName} value={roleName}>
{roleName}
</option>
);
})}

{canAddDeleteEditOwners && (
<option value="Owner" style={desktopDisplay ? { marginLeft: '5px' } : {}}>
Owner
</option>
)}
</select>
</FormGroup>
Manage Role & Permissions
</Button>
</div>

) : (
<p className={`text-right ${darkMode ? 'text-light' : ''}`}>{userProfile.role}</p>
)}
Expand Down Expand Up @@ -1047,6 +1022,16 @@ const BasicInformationTab = props => {
</>
)}
</div>
<RoleChangePermissionsModal
isOpen={showRolePermsModal}
onClose={() => setShowRolePermsModal(false)}
roles={roles}
userProfile={userProfile}
setUserProfile={setUserProfile}
loadUserProfile={loadUserProfile}
desktopDisplay={desktopDisplay}
canAddDeleteEditOwners={canAddDeleteEditOwners}
/>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@

:global(.bg-yinmn-blue) .dark-label-col {
background-color: #1c2541 !important;
}
}

.darkModeText {
color: white;
}
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ let testProps= {
handleUserProfile:vi.fn(),
roles:['Admin','Owner','Volunteer','Manager'],
canEditRole:true,

};


Expand Down Expand Up @@ -505,7 +504,7 @@ it('Test case 9: Renders the role component with a combo box when canEditRole
</Provider>,
);
expect(screen.getByText("Role")).toBeInTheDocument(); // Label
expect(screen.getByRole('combobox')).toBeInTheDocument(); // combo box
expect(screen.getByRole('button', { name: 'Manage Role & Permissions' })).toBeInTheDocument(); // Role Modal button
});
it('Test case 10 : Does not render a combo box for role component when canEditRole is false', () => {
testProps.canEditRole=false;
Expand Down
Loading
Loading