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

Feature: include shortcode & block control support for v3 forms #7082

Merged
merged 56 commits into from
Nov 27, 2023

Conversation

JoshuaHungDinh
Copy link
Contributor

@JoshuaHungDinh JoshuaHungDinh commented Nov 1, 2023

Description

The main purpose of this PR is to provide better compatibility to our donation form block. We have lifted many of the donation form blocks original block files/functions into our DonationForm block directory and have updated the Edit function to properly handle both v2 and v3 forms.

With this PR we have removed most of the legacy v2 block files and are pulling the v3 Edit function into our original DonationForm block. With some minor changes we were able to get v2 forms working with the selector we were using for v3 forms. Our Donation Form Block now has block support for formFormat on v3 forms - while continuing to maintain the current v2 support we have.

Some changes worth mentioning in the PR:

  • We have combined all the inspector controls into a single block control file DonationFormBlockControls
  • We are using ServerSide rendering for all legacy forms, and a more updated approach on v3 forms.

Somethings to keep in mind:

  • Legacy template forms have their own set of block controls.
  • Other v2 forms have no block control support.
  • v3 has their own set of block controls.

Display styles for v3 forms

  • fullForm : displays on the current page.
  • newTab: opens new tab to fthe orm page.
  • modal: opens form in modal.

Affects

v3 forms made by shortcode and form block.

Visuals

Shortcode example:

Screen.Recording.2023-11-07.at.10.57.54.AM.mov

Donation form block example:

Screen.Recording.2023-11-07.at.8.28.24.PM.mov

Testing Instructions

  • Create 3 different shortcodes - one for each display style.
  • Test out the continue_button_title attribute.
  • View frontend to verify all 3 format styles display properly.
  • Create a page & use the donation form block.
  • Test out both a classic form renders properly. (No block controls).
  • Add another block and test that a legacy form displays properly, it should also have its own set of Block controls specifically for Legacy forms.
  • Add another block for both form templates of v3 and verify they display properly. v3 forms should also have their own set of v3 block controls. You will want to test them out. They controls are the same as the shortcode controls detailed in the PR.

Here are 3 examples of shortcodes used:
[give_form id="1672"]
[give_form id="1674" display_style="modal" continue_button_title='open modal']
[give_form id="1673" display_style="link" continue_button_title='reveal me']

Pre-review Checklist

  • Relevant @unreleased tags included in DocBlocks
  • Self Review of code and UX completed

@JoshuaHungDinh JoshuaHungDinh marked this pull request as ready for review November 1, 2023 00:35
@JoshuaHungDinh JoshuaHungDinh changed the title feature: include shortcode format support for v3 forms Feature: include shortcode format support for v3 forms Nov 7, 2023
@JoshuaHungDinh JoshuaHungDinh changed the title Feature: include shortcode format support for v3 forms Feature: include shortcode & block controls for v3 forms Nov 8, 2023
@JoshuaHungDinh JoshuaHungDinh changed the title Feature: include shortcode & block controls for v3 forms Feature: include shortcode & block control support for v3 forms Nov 8, 2023
@JoshuaHungDinh JoshuaHungDinh requested a review from alaca November 13, 2023 01:41
@JoshuaHungDinh
Copy link
Contributor Author

JoshuaHungDinh commented Nov 13, 2023

Nice job, @JoshuaHungDinh. I like how much cleanup you did, it looks much better now, but let's refactor this a bit more. I left a bunch of comments regarding that.

Thank you for all your help with this @alaca!

I made a couple of additional changes to address inconsistencies I noticed happening, mainly in my updated inspector control.

  1. Both the displayStyle and continueButtonTitle controls were displaying when updating the displayStyle on an applicable form then changing it to a classic template v2 form : 51452e2 + 72a3113 + 22f053e

  2. The edit donation form link was determining the page path based on the template, which did not account for classic v2 forms: a758dad.

  3. Include one button launch on legacy template display options : 75ed8da

  4. The link on the newTab display needed to be updated. It was previously using the iframe path: e072801

Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

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

Great job @JoshuaHungDinh! Let's move this to QA

@alaca alaca mentioned this pull request Nov 15, 2023
2 tasks
@JoshuaHungDinh JoshuaHungDinh merged commit 58e2f07 into develop Nov 27, 2023
20 checks passed
@JoshuaHungDinh JoshuaHungDinh deleted the fix/add-form-format-support-on-shortcode branch November 27, 2023 00: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.

3 participants