Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Choice and Conflict Resolution #795

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

User Choice and Conflict Resolution #795

wants to merge 16 commits into from

Conversation

noschiff
Copy link
Member

@noschiff noschiff commented Mar 5, 2023

Summary

FINALLY! Over two years in the making! This PR implements opt in/out, allowing the user to resolve conflicts when one course can fulfill one of multiple requirements. Thanks to all the hard work by @SamChou19815, @willespencer, @einc, @benjamin-shen, and @zachary0kent to make this happen! This PR also includes code for the remove and replace modal, but it's currently behind a feature flag.

Quick Background

We have an OPT OUT system that allows users to force an opt in.

Conflict resolution appears when we have (c,R) violation (one course to many potential reqs). The user opts out of requirements (removing edges in course-req graph) until it’s legal. We then store these choices inside “optOut”. We do not update arbitrary opt in through this. The underlying idea is, when there is a (c,R) violation, the user opts out of edges until the resulting graph is legal.

Users can force edges (force mapping from course to req) by arbitrary opt in to a requirement. Currently, this is done by the replace modal. Until we have replace modal, arbitraryOptIn is useless.

Required Reading

Remaining TODOs:

  • Implement replace & remove modal
  • Explore an undo to conflict resolution
  • Explore better ways for users to opt In

Test Plan

Read required reading. Add a course that could count towards multiple requirements, creating a conflict. Then, manually resolve them using the "FIX NOW" prompt and ensure that your changes persist.

willespencer and others added 15 commits September 26, 2022 19:31
* Rework modal to support CourseTaken type

* Write function to convert course types to roster

* Use courseID instead of uniqueId

* Open modal from warning with correct data sent

* Select pre-selected reqs when editing

* Preserve unselected reqs in modal

* Make selectable req order not matter, and refactor name

* Fix bug where editing conflicts does not change fulfillment

* Type fixes

* Fix course name when editing conflicts

* Fix icon styling bug on req bar

* Fix modal not opening from course

* Fix bug where fulfilled conflicts show up in sem plan

* Toggle requirements only when modal saved

Co-authored-by: Benjamin Shen <[email protected]>
…odel (#689)

* optin optout functions

* clean up

* minor changes

* flesh out functions

* refactor selectable

* deprecate getRelatedRequirementIdsForCourseOptOut

* reorder
…716)

* rename override-fulfillment-choices

* fix overridden fulfillments race condition

* remove toggle requirement choices function

* address comments in course conflict modal
* Changed delete button to gear

* Gear button

* Button now turns blue when hovered over

* Settings button opens the replace/remove modal

- still need to change the icons to the correct ones

* Minor changes to the remove/replace icons

* correct icons for edit menu

* Initial implementation of ReplaceCourseModal

* Turned the DeleteCourseModal into removes

* SlotMenu appears for incomplete subreqs

* Add ReplaceSlotMenu

* Replace Modal now opens

* Replace slot menu completed

* Added warning text

* Added slot menu for adding new classes

* Correct placeholder names

* Ran format

* Fixed delete modal

* Added methods

* fixing type errors

* Changes to address spring comments

* Address comments from fall

* Revert "Address comments from fall"

This reverts commit 5e4954f.

* Add replacement editor

* Fix bold text in delete course modal

* Fix reqdesc

* Run prettier

* Fix yearRange export

* Fix Cypress tests

- changed SelectedRequirementEditor back
- now need to fix ReplaceRequirementEditor to match design

* Made ReplaceCourseModal match designs

* Run prettier

* Update ReplaceRequirementEditor.vue

* Check if selected course is in schedule

* 0 courses case covered

* back button now shows search bar again

* 2+ courses case handled

* 1 course case handled

* Fix dropdown menu length for duplicates

* Fix arrow on drop down menu

* Run prettier

* Dropdown menu provides selected semesters

* Run prettier

* Clean up SelectSemesterDuplicate and fix bug

bug involving searching for course multiple times will add the semesters again

* Fix selection text

* Add documentation

* Add docstrings

* Cleanup css

* Changes to PR comments

* Finish PR comments

* Add feature flag names

* Add cypress test

- Add 2110 works

* Fix cypress tests

* Address review

* Remove unused SelectSemesterReplace

* change placeholder text to computed

* Remove courseSelectorKey

* Fix Placeholder Text

* Fix requirement checker warning

* Update ReplaceCourseModal.vue

* Update ReplaceCourseModal.vue

* Update ReplaceCourseModal.vue
* add transformers, refactor graph builder algorithm

* small fixes, rework graph builder from user data

* rename transformer to processor

* turn initial graph building step into first pipeline step

* clean up imports/exports

* fix bad import

* compute constraint violations from dangerous graph instead of safe graph

* small improvements, fix dangerous graph bug

* comments

* break down add basic user fulfillment choices into multiple steps

* address review comments

* further abstract processor

* rename processor to visitor, small fixes

* change copy-graph visitor to be default class
* add readonly graph definition

* format

* lint

* type check
@noschiff noschiff added the req structure Requirement computation and data structure. label Mar 5, 2023
@dti-github-bot
Copy link
Member

dti-github-bot commented Mar 5, 2023

[diff-counting] Significant lines: 2477. This diff might be too big! Developer leads are invited to review the code.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2023

Visit the preview URL for this PR (updated for commit 52d2494):

https://cornelldti-courseplan-dev--pr795-user-choice-kjte2db6.web.app

(expires Thu, 06 Apr 2023 18:40:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6d4e0437c4559ed895272bbd63991394f1e0e933

@noschiff noschiff changed the title User Choice and Opt In / Opt Out User Choice and Conflict Resolution Mar 7, 2023
* Removed conflicts feature flag and its references

* Only close add course modal on 'Add' click
@noschiff noschiff marked this pull request as ready for review March 7, 2023 18:55
@noschiff noschiff requested a review from a team as a code owner March 7, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
req structure Requirement computation and data structure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants