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

DOM manipulation removal #170

Merged
merged 21 commits into from
Nov 11, 2020
Merged

DOM manipulation removal #170

merged 21 commits into from
Nov 11, 2020

Conversation

willespencer
Copy link
Member

@willespencer willespencer commented Nov 6, 2020

Summary

Remove most of the existing bad DOM Manipulation code in the codebase and replace it with event handling per issue #10. This will make it much easier in the future to see and change how data flows between components.

  • Removed almost all instances of document.getElementByID or .innerHTML that grabs and manipulates data poorly, especially in opening/closing modals
  • Removed almost all $parent references.
  • Removed other outdated/duplicated code and comments (2 <semester>s, NewCustomCourse.vue, etc.)
  • Add code that allows you to click outside of modals to close them without DOM Manipulation (see Monday)
  • Refactor the add course modal to avoid using DOM Manipulation in Modal.vue, NewCourse.vue, and OnboardingTransfer.vue (waiting for @hahnbeelee's work to be finished before messing around with this file, will take significant more work than these other elements, see Monday)
  • Refactor the direction of the triple dot menu on semesters (still need a better solution for this, see Monday)
  • Refactor createCourse so it is not called with $parent (@SamChou19815 do you want to take this?)

Test Plan

Ensure that everything works on the site compared to master (https://cornelldti-courseplan-dev.web.app/) with the exception of clicking outside of modals closing them.

Check if all of the following modals can be opened, closed, and used as expected

  • Add Course
  • New Semester
  • Edit Semester
  • Delete Semester

Notes

The rest of the DOM Manipulation should be removed so it is not duplicated in the future like it has been since CoursePlan started.

Breaking Changes

As specified above, just clicking outside of modals.

@SamChou19815
Copy link
Contributor

@willespencer when do you think it will be ready? I might want to touch some of the files soon.

Copy link
Member Author

@willespencer willespencer left a comment

Choose a reason for hiding this comment

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

@SamChou19815 I'll get it ready for review by the dev meeting!

@dti-github-bot
Copy link
Member

dti-github-bot commented Nov 10, 2020

[diff-counting] Significant lines: 242.

@willespencer willespencer changed the title Dom manipulation removal DOM manipulation removal Nov 10, 2020
@dti-github-bot
Copy link
Member

[deployment-bot] Deployed to https://cornell-dti.github.io/course-plan/170/index.html

@willespencer willespencer linked an issue Nov 10, 2020 that may be closed by this pull request
@SamChou19815
Copy link
Contributor

@willespencer I think it's better for this PR to stop here. It's already start to get big and is blocking some other refactors I plan to do.

Copy link
Member Author

@willespencer willespencer left a comment

Choose a reason for hiding this comment

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

@SamChou19815 Agreed! Just making sure I document the remaining issues and things I have figured tried/figured out in this PR and on Monday, and then I'll mark it ready to review 😄.

@willespencer willespencer marked this pull request as ready for review November 10, 2020 22:59
@willespencer willespencer requested a review from a team as a code owner November 10, 2020 22:59
package-lock.json Outdated Show resolved Hide resolved
Copy link
Contributor

@SamChou19815 SamChou19815 left a comment

Choose a reason for hiding this comment

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

tested the features and they all seem to work

@willespencer willespencer merged commit 2325cb2 into master Nov 11, 2020
@willespencer willespencer deleted the dom-manipulation-removal branch November 11, 2020 17:26
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.

Bad DOM Manipulation Code
3 participants