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

Add support for custom classes #505

Merged
merged 37 commits into from
Dec 4, 2023
Merged

Add support for custom classes #505

merged 37 commits into from
Dec 4, 2023

Conversation

psvenk
Copy link
Member

@psvenk psvenk commented Sep 21, 2023

Closes #423. Create a new dialog box for creating a custom class that is accessible from the search results box.

MaximoMachado and others added 29 commits September 20, 2023 17:53
Eliminate the customClasses prop in favor of adding custom classes
directly from the dialog. This means that custom classes are
backwards-compatible with existing roads (and interoperable with
FireRoad), and all of the state is stored via conventional mechanisms in
the road file/object.
Re-style the button, refactor form validation, re-word strings in dialog
box
Use CSS classes (which now have !important, to override the default
styling of the buttons) to get colors.
@psvenk
Copy link
Member Author

psvenk commented Sep 23, 2023

At this point, these are the remaining outstanding issues:

  • (3254958) Make sure that units/hours calculations are always working (particularly when a custom subject has the same name as a catalog subject; one use case for this is adding a special subject as a custom subject to keep its actual name)
  • Allow editing a custom subject by clicking on it
    • (2f11e46) Trigger adapted dialog box
    • (631db93) Ensure that form is properly populated consistently
    • (5961c97) Edit the subject on save

After these are resolved, this PR should be ready to merge.

Make custom subject status override whether or not the subject ID is in
the catalog (for units/hours calculation), suppress old ID and warnings
for custom subjects
The dialog box is now triggered, but the form fields are not
consistently populated (due to race conditions) and the actual subject
is not updated on save.
@eiis1000
Copy link

eiis1000 commented Dec 2, 2023

Assuming that currently creating a custom subject with desired content works, can the "edit custom subject by clicking on it" functionality be split out into a separate PR so that this minimum viable feature can be merged? It's been a while since this was requested and having makeable, uneditable, but deletable custom subjects is much better than no custom subjects at all.

Clearing the form before repopulating it is unnecessary (setting the
values overwrites the previous values anyway) and created a race
condition.
@psvenk
Copy link
Member Author

psvenk commented Dec 3, 2023

@eiis1000 Thanks for bumping this, and I'm really sorry about the delay on this PR. I looked at the remaining points and they turned out to be rather simple, so this should be ready for review/merge. I'll try to get someone to review this in the next week or so before merging. (Or, that person could be you!)

@HPoincare
Copy link

HPoincare commented Dec 3, 2023

Possible changes:

  • Add description box for custom subjects
  • (d4511d1) Fix bug where clicking on a custom subject and not saving changes prevents the ability to change the details of that subject again (unless moved to seperate semester)
  • (648b38d) Add auto-coloring based on first 1-2 digits entered in "short code" before the period

This fixes a bug where a dialog for editing a class cannot be opened
twice if it was dismissed the first time by clicking outside.
Change the default from a gray color to the color corresponding to the
course number of a subject.
@psvenk psvenk merged commit 224b536 into master Dec 4, 2023
@psvenk psvenk deleted the custom-classes-2 branch December 4, 2023 00:19
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 custom classes
4 participants