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

Refactors feedback form. #770

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Refactors feedback form. #770

merged 1 commit into from
Nov 2, 2023

Conversation

justinlittman
Copy link
Contributor

@justinlittman justinlittman commented Nov 1, 2023

  • Uses client-side validation
  • Gets rid of jquery
  • Cleans up views on the assumption that only single use of feedback form

closes #766

end

protected

def validate
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This validation is now client-side.

@@ -1,5 +1,4 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import "controllers"
import 'bootstrap';
import 'feedback_form';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Goodbye.

export default class extends Controller {
static targets = ['form']

connect() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only remaining JS that is necessary.

@@ -1 +1,53 @@
<%= render 'shared/feedback_forms/form' %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged the many feedback form partials.

@@ -1,7 +1,6 @@
# Pin npm packages by running ./bin/importmap

pin "application", preload: true
pin "jquery", to: "https://ga.jspm.io/npm:[email protected]/dist/jquery.js"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Goodbye.

@justinlittman justinlittman marked this pull request as ready for review November 2, 2023 11:23
@justinlittman
Copy link
Contributor Author

@amyehodge approved.

@jcoyne jcoyne merged commit 1680f6f into main Nov 2, 2023
1 check passed
@jcoyne jcoyne deleted the t766-feedback branch November 2, 2023 11:43
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.

Refactor: Rewrite feedback form JS as a stimulus controller (without jQuery)
2 participants