Skip to content

Conversation

@sirQuail
Copy link
Contributor

Tests component for adding/editing trainee tests

2025-10-27.16-20-08.mp4

-shows all test entries of a student
-result icon depend on the grade result
-does not fully implement the edit and delete buttons yet
-matches the server-side test interface
added formatter from helperfunction `formHelper.ts`
Prompts a modal for adding/editing tests as described in #219
Will be used in the `TestsComponent` that will be created next.
uses testslist and testdetailsmodal components.
implements feature #219
not resetting form after submission
on a straight column in the Tests List component.
@HackYourFutures HackYourFutures temporarily deployed to dojo-frontend-testcompo-yba7e7 October 27, 2025 15:24 Inactive
@sirQuail sirQuail added the FE Frontend ticket label Oct 27, 2025
@stasel stasel requested a review from Copilot October 27, 2025 15:31
Copy link

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 test results management feature for trainee profiles, allowing users to add, edit, and view test results. The implementation builds upon previous work (#257) and addresses feature request #219.

Key changes:

  • Added a new TestsComponent for managing trainee test records with CRUD operations
  • Created TestDetailsModal for adding/editing test information including type, date, score, and result
  • Integrated the tests component into the Education Info section alongside the existing Strikes component

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
client/src/components/education/TestsComponent.tsx New component implementing test management with add, edit, and delete functionality
client/src/components/education/TestDetailsModal.tsx Modal form for creating and editing test records with validation
client/src/components/education/EducationInfo.tsx Integrated TestsComponent into the education section
client/src/components/education/TestsList.tsx Updated styling to remove gap property and add explicit width

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

};

/**
* Function to enable adding tests.
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The comment on line 74-76 is a duplicate of the comment on lines 67-69. The closeModal function comment should describe closing the modal, not 'enable adding tests'.

Suggested change
* Function to enable adding tests.
* Function to close the modal and reset related state.

Copilot uses AI. Check for mistakes.
<FormControl fullWidth>
<TextField
disabled={isLoading}
id={testFields?.date ? 'date' : 'dateEmpty'}
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The dynamic id attribute based on whether testFields.date exists is unnecessary and could cause issues with form handling and accessibility. The id should remain constant ('date') regardless of whether the field has a value.

Suggested change
id={testFields?.date ? 'date' : 'dateEmpty'}
id="date"

Copilot uses AI. Check for mistakes.
@sirQuail sirQuail changed the title Frontend/test component.tsx Frontend/trainee-tests-component Oct 27, 2025
@sirQuail sirQuail changed the title Frontend/trainee-tests-component Add trainee test component. Enabling viewing/editing/removing trainee tests Oct 27, 2025
@HackYourFutures HackYourFutures temporarily deployed to dojo-frontend-testcompo-yba7e7 October 28, 2025 10:31 Inactive
@stasel stasel merged commit ddc2ef4 into main Nov 7, 2025
1 of 2 checks passed
@stasel stasel deleted the frontend/TestComponent.tsx branch November 7, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FE Frontend ticket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants