Skip to content

Conversation

gabrielhan23
Copy link

No description provided.

gabrielhan23 and others added 15 commits February 27, 2025 01:10
* initial table

* table css work

* table css work

* front end table searching and select data logic

* front end table searching and select data logic

* search filter works

* im done fr now fixed select glitch and styled input and buttons slightly

* finished front end table

* functions and dropdown basics

* touchups for front end filtering integration and css

* copy button works and table header structure

* fixed filtering bugs and css for action buttons

* fixed weird double copy bug

* fixed filter copy bug

* finished coord interface

---------

Co-authored-by: Heidi Chan <[email protected]>
…eley/csm_web into feat/coord-interface/integration
This reverts commit 5bc7521.
Copy link

cypress bot commented Sep 7, 2025

csm_web    Run #426

Run Properties:  status check passed Passed #426  •  git commit 56de0bbd2c: Feat/coord interface/integration
Project csm_web
Branch Review feat/coord-interface/integration
Run status status check passed Passed #426
Run duration 01m 47s
Commit git commit 56de0bbd2c: Feat/coord interface/integration
Committer gabrielhan23
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 42
View all changes introduced in this branch ↗︎

@gabrielhan23 gabrielhan23 requested a review from Copilot September 7, 2025 22:30
Copilot

This comment was marked as outdated.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a coordinator interface integration that allows coordinators to view and manage students and mentors in their courses. The implementation includes backend API endpoints for coordinator data access, frontend React components for displaying tabular data with filtering capabilities, and routing updates to support the new coordinator views.

  • Adds backend API endpoints for coordinator authentication and data retrieval
  • Implements React-based coordinator interface with search and filtering functionality
  • Integrates coordinator view access through existing course interface

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
csm_web/scheduler/views/coord.py New coordinator API views with authentication and data serialization
csm_web/scheduler/serializers.py Added coordinator-specific serializers and docstring updates
csm_web/scheduler/models.py Added mentor family field, section day_time property, and pylint disable comments
csm_web/frontend/src/components/coord_interface/*.tsx React components for coordinator table interface with filtering and search
csm_web/frontend/src/utils/queries/coord.tsx API query utilities for coordinator data
csm_web/scheduler/urls.py URL routing for coordinator endpoints
csm_web/frontend/src/components/App.tsx Added coordinator routes to main app

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


export const getCoordData = async (courseId: number, isStudents: boolean) => {
// query disabled when id undefined
if (isNaN(courseId!)) {
Copy link
Preview

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-null assertion operator ! is used on courseId which is already typed as number. This assertion is unnecessary and could mask potential runtime errors if courseId is actually undefined.

Suggested change
if (isNaN(courseId!)) {
if (isNaN(courseId)) {

Copilot uses AI. Check for mistakes.

setSearch([]);
setSelected([]);
setAllSelected(false);
const checkbox = document.getElementById("checkcheck") as HTMLInputElement;
Copy link
Preview

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The element ID 'checkcheck' doesn't match the actual checkbox ID which should be 'checkcheck' (from CheckBox component). This should be consistent with the CheckBox component's ID generation pattern.

Copilot uses AI. Check for mistakes.

Comment on lines +127 to +133
if (field in row) {
const value = row[field as keyof typeof row];
if (filter.includes("+")) {
return value != null ? value.toString() >= filter.slice(0, -1) : false;
}
return value != null ? value.toString().includes(filter) : false;
}
Copy link
Preview

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String comparison using >= for filtering (line 131) will perform lexicographic comparison rather than numeric comparison. For numeric fields like numUnexcused or numStudents, this should use Number(value) >= Number(filter.slice(0, -1)).

Copilot uses AI. Check for mistakes.

</tr>
</thead>
<tbody>
{searchData.length === 0 ? <div className="no-data">No data found...</div> : null}
Copy link
Preview

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A <div> element cannot be a direct child of <tbody>. This should be wrapped in a <tr><td colSpan={columnCount}> structure to be valid HTML.

Suggested change
{searchData.length === 0 ? <div className="no-data">No data found...</div> : null}
{searchData.length === 0 ? (
<tr>
<td className="no-data" colSpan={6}>No data found...</td>
</tr>
) : null}

Copilot uses AI. Check for mistakes.

)
if not is_coord:
raise PermissionDenied(
"You do not have permission to view the coordinator view."
Copy link
Preview

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message references 'view the coordinator view' which is redundant and unclear. It should be more specific, such as 'You do not have permission to delete sections for this course.'

Suggested change
"You do not have permission to view the coordinator view."
"You do not have permission to delete sections for this course."

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants