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
fix(shortcode): load modal forms in form grid via AJAX #2951 #2955
Conversation
Earlier every grid item had form hidden using CSS, now the hidden form is instead fetched using AJAX.
|
@@ -263,3 +259,125 @@ | |||
.my-mfp-slide-bottom.mfp-removing.mfp-bg { | |||
opacity: 0; | |||
} | |||
|
|||
.white-popup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sidsector9 I feel these magnific styles should exist outside of the grid stylesheet within their own since likely these styles will be used in other places as well and finding them here seems difficult for developer who don't know. @kevinwhoffman what are your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Sid and I are going to meet and review ITCSS and I think reworking these class names and locations would be a good first task.
@Sidsector9 please reply to @ravinderk's query above asap. I'm also going to request a review by @ravinderk @kevinwhoffman also wants to do a call with @Sidsector9 regarding ITCSS. I'm moving this from the "Ready for QA" pipeline. |
Call Summary Result: We are fetching HTML of the form to show inside a popup. Till here, it works well. For example, I wasn't able to change the payment method because the radio buttons were not attached to the event handlers since they were loaded after the DOM was loaded. So I made a small change (see here), where I was able to make it work via event delegation. Then came another problem where the the CC number wasn't being formatted because @ravinderk and I concluded that the existing JS must be rewritten in a way that we don't miss out on anything while working on this feature OR we should only implement the |
It sounds like there will be a lot of hurdles in the way of making Give forms load entirely through AJAX. We also have to consider all of our add-ons' functionality and ensure that they get initiated correctly when the form does not exist on the page at load time. @ravinderk Can you please provide a story point estimate of what it would take to get Give forms to load via AJAX, including compatibility with each of our add-ons? |
Suggestion: Question:
|
@ravinderk - yes it's fine to switch the default |
Slack Call Summary Participants: @ravinderk @kevinwhoffman Set the default In the future, we may introduce a truly Remaining Tasks
|
This is a revert commit. The forms are shown/hidden instead of using AJAX to load the form.
display_style "modal" is changed to "modal_reveal"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DevinWalker @kevinwhoffman please review this pr and merge it. Working fine for me.
Review Findings@Sidsector9 it's working well but I found a plugin conflict with Currency Switcher add-ons. Please work with @emgk and @ravinderk to resolve the following:
See my video while I debugged for more info: https://goo.gl/6HT84Z After I finished recording I isolated the issue to the Currency Switcher add-on. |
Call SummaryParticipants: @emgk and @Sidsector9 |
@DevinWalker, 2/3 points you mentioned are being addressed below:
@emgk has fixed the bug in Currency Switcher add-on and that made the form load correclty
The feature image too loads correctly after the above said fix Kindly test this from your end and let me know if further improvements need to be done. |
# Conflicts: # assets/src/css/frontend/give-frontend.scss # assets/src/css/frontend/modal.scss # includes/shortcodes.php
@Sidsector9 I think do not care about #3030 issue for on form grid page. Currently auto open modal on basis of URL param does not work with a form with We have to work from the ground to make it compatible with @DevinWalker What do you think |
If you visit a URL directly with query parameters 'form-id' and 'payment-mode' for a form with display type 'button', the popup will pop up.
new fn give_get_donation_donor_email
Stop using Give_Payment and Give_Donor to improve performance on frontend
Stop using Give_Payment and Give_Donor to improve performance on frontend
…issue-2951 # Conflicts: # assets/src/css/frontend/modal.scss
Closes #2951
Phase - 1
All the forms were loaded and hidden via CSS on the form grid page.
Phase - 2
@kevinwhoffman suggested instead of loading every form at once, we should instead use AJAX and fetch only the form that is required. This will also speed up the load time of the form grid page.
After some research here and here, it was determined that implementing AJAX at the current stage of Give Core, it might break certain add-ons.
Phase - 3
This phase was reverting back to phase - 1 and making some additional fixes as suggested by @kevinwhoffman and @ravinderk here and here.
Future plans
We will be implementing this with Ajax after the Javascript files have been refactored to the requirements.
How Has This Been Tested?
Manually tested
Checklist: