In schedule generator, only allow courses matching requirement to be added #948
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently, in the schedule generator, if you select e.g. the "Mathematics" requirement you can still click add any school course to the "requirement block", even if it would not fulfill the Mathematics requirement. With the introduction of this PR, that issue is resolved — you can now only add courses to a requirement that actually fulfill that requirement.
Test Plan
Go to the builder page and pick a requirement.
Verify that only courses which would fulfill that requirement show up in the modal.
Note that this behavior does not apply for the "No Requirement" requirement block, as would be expected.
Notes
We still have the UI oddity where you can select which requirement to match a course to if there are multiple options.
Or it could say 'not automatically fulfilling any requirement'. I think we should just get rid of this stuff in the modal as it is not relevant to schedule generator (though very relevant to the base dashboard).
Also, please note that the FWS example in the test plan will not show you any FWSes if you type in 'FWS'. This is because the migration script for this semester hasn't seemed to have actually found / counted FWS courses. If you look at the Fall 24 brochure, you'll notice that the FA24 specific courses (ones that don't happen in other semesters) do not show up in any new course modals. This is not an issue with this PR but rather with our typed course JSON consistency.