Skip to content

Add new TestType enum values and update tests dropdown UI#310

Merged
stasel merged 5 commits intomainfrom
copilot/add-test-enum-values
Mar 2, 2026
Merged

Add new TestType enum values and update tests dropdown UI#310
stasel merged 5 commits intomainfrom
copilot/add-test-enum-values

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

  • Add 7 new TestType enum values to backend and frontend
  • Update API docs (server/api.yaml) with new enum values (fix javaScriptjavascript)
  • Rename CoreEndTermInterviewCoreEndInterview in backend, frontend, and UI
  • Update frontend UI: dropdown always shows only the 7 new test types
  • Remove legacy test type conditional logic from dropdown (legacy types kept in enum for API/DB compatibility)
Original prompt

This section details on the original issue you should resolve

<issue_title>Add new test enum values</issue_title>
<issue_description>## Requirements

  1. Add a new values to TestType enum to both backend and frontend.
    • key: CoreMidTermInterview / value: core-mid-term-interview'
    • key: CoreEndTermInterview/ value:core-end-interview'`
    • key: FrontEndMidTermInterview / value: frontend-mid-term-interview'
    • key: BackEndMidTermInterview / value: backend-mid-term-interview'
    • key: CloudMidTermInterview / value: cloud-mid-term-interview'
    • key: DataMidTermInterview / value: data-mid-term-interview'
    • key: TesterMidTermInterview / value: tester-mid-term-interview'
  2. Update API docs (api.yml) with the new values
  3. Frontend: Add the enum values to the tests dropdown. And remove all existing value from the UI (keep them in the API for archive information and legacy support)</issue_description>

<agent_instructions>Make minimal required changes to fulfill the task.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: stasel <2033301+stasel@users.noreply.github.com>
@HackYourFutures HackYourFutures temporarily deployed to dojo-copilot-add-test-e-bfakdx March 2, 2026 10:44 Inactive
Copilot AI changed the title [WIP] Add new test enum values to backend and frontend Add new TestType enum values and update tests dropdown UI Mar 2, 2026
@stasel stasel marked this pull request as ready for review March 2, 2026 10:46
@stasel stasel self-requested a review as a code owner March 2, 2026 10:46
Copilot AI review requested due to automatic review settings March 2, 2026 10:46
ReactInterview = 'react-interview',
FinalProjectInterview = 'final-project-interview',
CoreMidTermInterview = 'core-mid-term-interview',
CoreEndTermInterview = 'core-end-interview',
Copy link
Member

Choose a reason for hiding this comment

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

I made a mistake in the ticket, can you please rename the key to CoreEndInterview

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in b0e3093 — renamed to CoreEndInterview in both backend and frontend enums.

<MenuItem value={TestType.ReactInterview}>React interview</MenuItem>
<MenuItem value={TestType.FinalProjectInterview}>Final project interview</MenuItem>
<MenuItem value={TestType.CoreMidTermInterview}>Core mid-term interview</MenuItem>
<MenuItem value={TestType.CoreEndTermInterview}>Core end-term interview</MenuItem>
Copy link
Member

Choose a reason for hiding this comment

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

change the caption to Core end interview

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in b0e3093 — caption is now Core end interview.

Copy link
Contributor

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

Adds seven new interview-type TestType enum values across the backend model, frontend types, and OpenAPI docs, and updates the test-type dropdown UI to show only the new options while keeping legacy values for archive/compatibility.

Changes:

  • Added 7 new TestType enum values in both server and client type definitions.
  • Updated server/api.yaml Test.type enum to include the 7 new values.
  • Updated TestDetailsModal test-type <Select> options to only show the new interview types.

Reviewed changes

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

File Description
server/src/models/Trainee.ts Extends backend TestType enum with 7 new interview types.
client/src/data/types/Trainee.ts Mirrors backend enum updates on the frontend type layer.
server/api.yaml Documents the new Test.type enum values in OpenAPI.
client/src/features/trainee-profile/education/tests/TestDetailsModal.tsx Replaces dropdown options to show only the new interview types.

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

…ow legacy types when editing old tests

Co-authored-by: stasel <2033301+stasel@users.noreply.github.com>
@HackYourFutures HackYourFutures temporarily deployed to dojo-copilot-add-test-e-bfakdx March 2, 2026 10:56 Inactive
Copy link
Member

@stasel stasel left a comment

Choose a reason for hiding this comment

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

There are two bugs:

Selection from the drop down no longer works.
When editing a legacy test, the default value in the dropdown is empty even though the existing value is rendered

…MenuItems

Co-authored-by: stasel <2033301+stasel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 2, 2026

There are two bugs:

Selection from the drop down no longer works....

Fixed in ede348b. Both bugs had the same root cause: MUI's <Select> uses React.Children to find a matching <MenuItem> for the current value, but React.Children doesn't traverse into React Fragments (<>…</>). That caused the selected value to render blank and onChange to not fire. Replaced the fragments with keyed arrays so MUI can properly traverse the children.

@HackYourFutures HackYourFutures temporarily deployed to dojo-copilot-add-test-e-bfakdx March 2, 2026 11:07 Inactive
Copy link
Member

@stasel stasel left a comment

Choose a reason for hiding this comment

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

Please remove all legacy tests from the UI (Keep them in the frontend UI).
If a user tries to edit a legacy test - it's ok to keep the drop down value empty and let it allow to select only new tests. There will be no future edits of a legacy test.

…ditional logic

Co-authored-by: stasel <2033301+stasel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 2, 2026

Please remove all legacy tests from the UI (Keep them in the frontend UI).
If a user tries to edit a legacy test - it's ok to keep the drop down value empty and let it allow to select only new tests. ...

Done in c4f4843 — removed all legacy conditional logic. The dropdown now always shows only the 7 new test types. Legacy values remain in the enum for API/DB compatibility but are no longer referenced in the UI.

@HackYourFutures HackYourFutures temporarily deployed to dojo-copilot-add-test-e-bfakdx March 2, 2026 11:21 Inactive
@stasel stasel merged commit 5489754 into main Mar 2, 2026
1 check passed
@stasel stasel deleted the copilot/add-test-enum-values branch March 2, 2026 11:37
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.

Add new test enum values

4 participants