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 Update Extension functionality #1592

Merged
merged 15 commits into from
Sep 22, 2022
Merged

Add Update Extension functionality #1592

merged 15 commits into from
Sep 22, 2022

Conversation

damianhxy
Copy link
Member

@damianhxy damianhxy commented Sep 18, 2022

Description

Adds update functionality to extensions, alongside several improvements

  • More meaningful flashes
  • Improved validation against creation of extensions with < 0 days (change days field to type number with min 0, add validation on backend)
  • Increase size of titles
  • Add message when no extensions exist
  • Add confirmation message for deletion of extensions
  • Prevent flatpickr from losing minDate after any changes (due to re-initialization of component)

To update extensions, instructors can either click on a student's email in the sidebar, or input the student's name/email as usual. Then,

  • The fields will auto-populate with the current extension details (will reset if we empty the name/email field)
  • A warning will appear

Motivation and Context

Currently, the only way to update an extension is to delete and re-create it, which can be error-prone. This PR adds the functionality to directly update an extension.

How Has This Been Tested?

  • Successfully create an extension
  • Successfully delete an extension (after acknowledging popup)
  • Input name of student with existing extension; fields autopopulate
  • Click email of student with existing extension in sidebar; fields autopopulate
  • Submitting updates an existing extension
  • Clearing name field also clears the other fields

No extensions screen
Screen Shot 2022-09-17 at 23 38 40

Deletion confirmation
Screen Shot 2022-09-17 at 23 39 08

Clicking on email / inputting name automatically populates fields and displays warning
Screen Shot 2022-09-17 at 23 39 23

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have run rubocop for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting

@damianhxy damianhxy changed the title Extensions improvements Add Update Extension functionality Sep 22, 2022
Copy link
Contributor

@michellexliu michellexliu left a comment

Choose a reason for hiding this comment

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

lgtm!

@damianhxy damianhxy merged commit d70e45d into master Sep 22, 2022
@damianhxy damianhxy deleted the update-extensions branch September 22, 2022 17:57
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.

2 participants