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 hidden form field #1728

Merged
merged 14 commits into from
Jul 25, 2023
Merged

Add hidden form field #1728

merged 14 commits into from
Jul 25, 2023

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Jun 22, 2023

Closes #.

Summary

Add a field that is hidden from the client. Its function is to collect data from URLs to save metadata along with the submission.

URL example: http://localhost:10007/496/form-hidden-field/?test=123

Screenshots

Editor

image

Inspector

image

Frontend

image

Submission

image


Test instructions


Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Jun 22, 2023
@pirate-bot
Copy link
Contributor

pirate-bot commented Jun 22, 2023

E2E Summary

Typing

Test Average Time (ms) Standard Deviation (ms) Median Time (ms) Quantile for soft limit (%) Quantile for hard limit (%)
Typing 60.77 7.79 58.98 57.89 (60ms) 100 (80ms)
Values above 60ms "0 - 65.23, 1 - 62.11, 4 - 69.35, 7 - 60.59, 9 - 79.63, 10 - 60.49, 12 - 76.11, 13 - 68.41"

@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review June 22, 2023 13:49
@pirate-bot
Copy link
Contributor

pirate-bot commented Jun 22, 2023

Bundle Size Diff

Package Old Size New Size Diff
Animations 192.38 KB 192.38 KB 0 B (0.00%)
Blocks 1.35 MB 1.35 MB 4.01 KB (0.29%)
CSS 6.9 KB 6.9 KB 0 B (0.00%)
Dashboard 44.4 KB 44.4 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 232.29 KB 238.92 KB 6.63 KB (2.85%)

@pirate-bot
Copy link
Contributor

pirate-bot commented Jun 22, 2023

Plugin build for 5517b71 is ready 🛎️!

Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

Apart from mentioned, few things:

  • The Block doesn't appear in the select list, nor the select list appear inside the block
Screenshot 2023-06-23 at 8 56 06 AM
  • If you click on Back to the Form button, it generates console errors.

@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Jun 23, 2023
Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

Just a minor change and it should be good to go for QA.

@rodica-andronache
Copy link

rodica-andronache commented Jul 14, 2023

@Soare-Robert-Daniel

@HardeepAsrani HardeepAsrani changed the base branch from development to next July 14, 2023 15:01
@Soare-Robert-Daniel Soare-Robert-Daniel changed the title feat: add hidden form field Add hidden form field Jul 17, 2023
@Soare-Robert-Daniel
Copy link
Contributor Author

I could not reproduce the fatal error.

@rodica-andronache
Copy link

@Soare-Robert-Daniel I've tried again, and the fatal error is still happening for me. Maybe this video could help to see the exact steps I take ( the fatal error occurs after activating the license ) https://www.loom.com/share/62a6e77daaee48f09755eac2f562b008?sid=7619d799-4994-4b09-ba58-fc0541fc90e1
Let me know if there is something else I can share to help out. Thank you!

@HardeepAsrani
Copy link
Member

@Soare-Robert-Daniel I think it's because of the wrong name of the file: https://github.com/Codeinwp/otter-blocks/blob/feat/form-hidden-field/plugins/otter-pro/inc/render/class-form-hidden-block.pnp.php

It's class-form-hidden-block.pnp.php at this moment.

@Soare-Robert-Daniel
Copy link
Contributor Author

@HardeepAsrani thanks for info 🙏 . It seams that local tools did not find anything strange with that odd name.

Testing instance

 Admin area URL: https://fiveact.s4-tastewp.com/wp-admin 
 Username: robertino 
 Password: pZ8pJCocVZI 

@rodica-andronache
Copy link

@Soare-Robert-Daniel the error is gone now 🚀 but the hidden field value is not saved in the Submissions and does not appear in the Email, for me.
If you need it, I can share on slack the details to my site where I've tested.

@rodica-andronache
Copy link

@Soare-Robert-Daniel everything's working well 🚀

@HardeepAsrani HardeepAsrani merged commit 77e60c5 into next Jul 25, 2023
11 checks passed
@HardeepAsrani HardeepAsrani deleted the feat/form-hidden-field branch July 25, 2023 03:09
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 2.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants