Skip to content

Commit

Permalink
Merge branch 'develop' into feature-2620/approval-stats-by-supervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
ocielliottc committed Oct 11, 2024
2 parents c52d950 + 64736d8 commit 2ad42b0
Showing 1 changed file with 42 additions and 77 deletions.
119 changes: 42 additions & 77 deletions web-ui/src/components/reviews/TeamReviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -956,59 +956,6 @@ const TeamReviews = ({ onBack, periodId }) => {
<Root className="team-reviews">
<div className={classes.headerContainer}>
<Typography variant="h4">{period?.name ?? ''} Team Reviews</Typography>
{period && isAdmin && (
<div>
{canUpdate && (
<Tooltip
title={
period.reviewStatus === ReviewStatus.OPEN
? 'Archive'
: 'Unarchive'
}
>
<IconButton
onClick={toggleReviewPeriod}
aria-label={
period.reviewStatus === ReviewStatus.OPEN
? 'Archive'
: 'Unarchive'
}
>
{period.reviewStatus === ReviewStatus.OPEN ? (
<Archive />
) : (
<Unarchive />
)}
</IconButton>
</Tooltip>
)}

{selectHasDeleteReviewPeriodPermission(state) && (
<Tooltip title="Delete">
<IconButton
onClick={confirmDelete}
edge="end"
aria-label="Delete"
>
<Delete />
</IconButton>
</Tooltip>
)}

{approvalMode && (
<FormControlLabel
control={
<Switch
checked={showAll}
onChange={() => setShowAll(b => !b)}
/>
}
label="Show All"
sx={{ marginLeft: '0.5rem' }}
/>
)}
</div>
)}
</div>

<ReviewPeriodStepper
Expand Down Expand Up @@ -1060,31 +1007,49 @@ const TeamReviews = ({ onBack, periodId }) => {
)}

{approvalMode && (
<div id="approval-row">
<TextField
className="name-search-field"
label="Name"
placeholder="Search by member name"
variant="outlined"
value={nameQuery}
onChange={event => setNameQuery(event.target.value)}
InputProps={{
endAdornment: (
<InputAdornment position="end" color="gray">
<Search />
</InputAdornment>
)
}}
/>
{canUpdate && (
<div>
<Button onClick={() => setConfirmApproveAllOpen(true)}>
Approve All
</Button>
<Button onClick={unapproveAll}>Unapprove All</Button>
<div id="approval-row" style={{ display: 'flex', alignItems: 'center' }}>
{/* Wrapper div for TextField and Switch */}
<div style={{ display: 'flex', alignItems: 'center', flexGrow: 1 }}>
<TextField
className="name-search-field"
label="Name"
placeholder="Search by member name"
variant="outlined"
value={nameQuery}
onChange={event => setNameQuery(event.target.value)}
InputProps={{
endAdornment: (
<InputAdornment position="end" color="gray">
<Search />
</InputAdornment>
)
}}
style={{ flexGrow: 1, maxWidth: '400px' }}
/>
{/* Add the Switch right next to the TextField */}
{period && isAdmin && (
<FormControlLabel
control={
<Switch
checked={showAll}
onChange={() => setShowAll(b => !b)}
/>
}
label="Show All"
sx={{ marginLeft: '0.5rem' }}
/>
)}
</div>
)}
</div>
{/* Button aligned to the right */}
{canUpdate && (
<div style={{ marginLeft: 'auto' }}>
<Button onClick={() => setConfirmApproveAllOpen(true)}>
Approve All
</Button>
<Button onClick={unapproveAll}>Unapprove All</Button>
</div>
)}
</div>
)}

{canUpdate && (
Expand Down

0 comments on commit 2ad42b0

Please sign in to comment.