Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion frontend/src/api/actions/positions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const positionsSelector = createSelector(

// Leave all the data alone, except replace the `instructor_ids` list
// with the full instructor data.
return positions.map(
return (positions || []).map(
({ instructor_ids, contract_template_id, ...rest }) => ({
...rest,
// When the instructor list references an instructor that we haven't loaded
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/active-session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ export function ActiveSessionDisplay(props: {
activeSession: Session | null;
setActiveSession: (session: Session | null) => void;
}) {
const { sessions = [], activeSession, setActiveSession } = props;
const { sessions: _sessions = [], activeSession, setActiveSession } = props;
// keep track of the dropdown visibility so that the filter can be cleared
// whenever the dropdown is invisible.
const [dropdownVisible, setDropdownVisible] = React.useState(false);
const activeSessionId = activeSession ? activeSession.id : null;
// Sort sessions in reverse chronological order (most recent first)
const sessions = React.useMemo(() => {
return [..._sessions].sort((a, b) => {
return +new Date(b.start_date) - +new Date(a.start_date);
});
}, [_sessions]);

let label = <span className="text-secondary me-2">Select a Session</span>;
if (activeSession != null) {
Expand Down
55 changes: 55 additions & 0 deletions frontend/src/views/admin/draft-matching/about-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,61 @@ export function AboutDialogButton() {
changed until the contract is withdrawn.
</td>
</tr>
<tr>
<td>
{[-1, 0, 1, 2, 3].map((level) => (
<div
key={level}
className="draft-matching-panel-group"
style={{ display: "inline-block" }}
>
<div className="assignments-table">
<div
className={`position level level-${level}`}
style={{
width: 30,
height: 40,
}}
>
{level}
</div>
</div>
</div>
))}
</td>
<td>
Applicant has indicated a preference of
-1/0/1/2/3 (3 = highest) for this position.
</td>
</tr>
<tr>
<td>
{[-1, 0, 1, 2, 3].map((level) => (
<div
key={level}
className="draft-matching-panel-group"
style={{ display: "inline-block" }}
>
<div className="assignments-table">
<div
className={`position level level-${level} already-assigned`}
style={{
width: 30,
height: 40,
}}
>
{level}
</div>
</div>
</div>
))}
</td>
<td>
Applicant has indicated a preference for
this position but is <b>already assigned</b>{" "}
to the position.
</td>
</tr>
</tbody>
</table>
</Modal.Body>
Expand Down
59 changes: 45 additions & 14 deletions frontend/src/views/admin/draft-matching/draft-matching.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
.panel.applicants-list {
padding: 5px;
display: block;

.applicant-pill {
display: inline-flex;
margin: 2px;
user-select: none;
}
.applicant-pill:active {
outline: 4px solid var(--primary);
outline-offset: 0px;
}
}

.assignments-table {
Expand Down Expand Up @@ -88,27 +78,46 @@
.active-drag-over {
outline: 2px dashed var(--primary);
}
.position,
.assignments {
--background: white;
}
.level {
transition: background-color 0.7s;
background-color: var(--background);
}
.level--1 {
background-color: gray;
--background: gray;
}
.level-1 {
background-color: rgb(85, 142, 58);
--background: rgb(85, 142, 58);
}
.level-2 {
background-color: rgb(56, 178, 0);
--background: rgb(56, 178, 0);
}
.level-3 {
background-color: rgb(71, 223, 0);
--background: rgb(71, 223, 0);
}
.level-undefined.already-assigned,
.level-0.already-assigned {
--background: rgb(238, 238, 238);
}
.already-assigned {
background: repeating-linear-gradient(
45deg,
var(--background),
var(--background) 15px,
color-mix(in srgb, var(--background) 50%, white) 15px,
color-mix(in srgb, var(--background) 50%, white) 30px
);
}
}
.applicant-pill.is-dragging {
opacity: 0.5;
}
.applicant-pill {
display: inline-flex;
user-select: none;
width: 200px;
gap: 2px;
margin: 2px;
Expand All @@ -117,6 +126,11 @@
display: flex;
flex-direction: row;
}
&:active,
&.active {
outline: 4px solid var(--primary);
outline-offset: 0px;
}

.applicant-actions {
display: flex;
Expand Down Expand Up @@ -289,3 +303,20 @@
}
}
}

.filters-dialog-body {
overflow-y: auto;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1em;

.compact-checkbox-options {
display: flex;
flex-wrap: wrap;
column-gap: 2em;
}
}

.filters-dialog-parent .modal-content {
max-height: 90vh;
}
Loading
Loading