-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Gift cards/add recipient #2412
Gift cards/add recipient #2412
Commits on Mar 17, 2023
-
Gift cards/add recipient add template (#102)
Implement the recipient form for gift card product
Configuration menu - View commit details
-
Copy full SHA for c49fbe9 - Browse repository at this point
Copy the full SHA c49fbe9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e61dbff - Browse repository at this point
Copy the full SHA e61dbffView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc5dead - Browse repository at this point
Copy the full SHA bc5deadView commit details -
Configuration menu - View commit details
-
Copy full SHA for e3f0cb5 - Browse repository at this point
Copy the full SHA e3f0cb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89d3e65 - Browse repository at this point
Copy the full SHA 89d3e65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41467d2 - Browse repository at this point
Copy the full SHA 41467d2View commit details -
feat(#51542) Set the hidden control field in one of two ways
1. As a hidden form field with a value of "if_present". This will be used by clients without javascript. The 'if_present' flag gives a hint to the backend to only validate email addresses if one is given, blank values are acceptable 2. As a checkbox. This is a progressive enhancement which replaces the hidden field in 1 when javascript is enabled. The value sent to the backend will be on when the checkbox is checked. No field at all will be sent when it is unchecked. The backend will treat blank email as an error if the value is 'on' The control field is used by the backend to enable the send to recipient feature validation and processing. It must be present for the feature to do anything. We only need it to be present if the user has elected to fill out the form.
Configuration menu - View commit details
-
Copy full SHA for fa1d844 - Browse repository at this point
Copy the full SHA fa1d844View commit details -
Remove nested form elements from buy button snippets
This was a good idea but unfortunately it doesn't work with liquid rendering flow, we need the passed in elements to render within the inner liquid context
Configuration menu - View commit details
-
Copy full SHA for a7884a1 - Browse repository at this point
Copy the full SHA a7884a1View commit details -
fix(#51542): wrap dummy form in product form class
The dummy form is generated because we want to use properties from the liquid product from drop. It doesn't serve any actual purpose in the html. Normally product forms are wrapped in a <product-form> custom element which have some styling applied. We don't want to do that because the custom element also adds a bunch of js that we don't want. Instead we just use a div with the class.
Configuration menu - View commit details
-
Copy full SHA for 64488ef - Browse repository at this point
Copy the full SHA 64488efView commit details -
feat(#51543): Correct checkbox bahvior in all cases
When js is disabled the form displays with no checkbox When js is enabled the form is hidden at page load and the checkbox is unhidden and enabled This works well but is susceptible to content flashes as the form is first shown then quickly hidden. Probably unacceptable. An obvious solution would be to check the checkbox by default which would mean there is no need to hide the form on load. A more extreme solution is to use a noscript tag to completely sever the link between the two sets of markup. I don't like this solution as it bloats the source but it does neatly take care of the content flash
Configuration menu - View commit details
-
Copy full SHA for 247a4e9 - Browse repository at this point
Copy the full SHA 247a4e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9380e0 - Browse repository at this point
Copy the full SHA e9380e0View commit details -
feat(#51731): Change the label on the recipient email field depending…
… on wether the client has JS enabled
Configuration menu - View commit details
-
Copy full SHA for b9f5486 - Browse repository at this point
Copy the full SHA b9f5486View commit details -
feat(#51542): Error formatting for no js recipient form
When we read errors out of the flash state we want them displayed nicely inline on the recipient form. We can do this by ripping off the pattern frolm customer registration. There are a few styles which have been implemented as specific .customer styles which should really be a generic class but not a huge issue to just use the customer class in our form as well
Configuration menu - View commit details
-
Copy full SHA for 1e9763f - Browse repository at this point
Copy the full SHA 1e9763fView commit details -
This is important as the field names we get from the backend are lower case and we use them to dynamically build selectors
Configuration menu - View commit details
-
Copy full SHA for 49d19d5 - Browse repository at this point
Copy the full SHA 49d19d5View commit details -
Restore buy buttons to their own block
We tried to simplify things by having the recipient form be part of the main product form but it didn't work. We can just use the html form attribute to reassign inputs from a different form to the main product form. Messy from a source view but nicer from a visual editor POV.
Configuration menu - View commit details
-
Copy full SHA for 793406a - Browse repository at this point
Copy the full SHA 793406aView commit details -
This attempts to standardise error handling between liquid and javasc…
…ript Liquid errors already render nicely next to the fields they belong to. We'd eventually like the same behaviour in JS. That will require tweaking the backend error payload a bit but is otherwise achievable. We first have to disable the existing product form error handling as this appears next to the buy buttons Instead we publish the error response on the pub/sub bus and display the error at the top of the recipient form. We have liquid render the error container so it looks roughly the same regardless of whether the error is rendered by liquid or JS. Next step will be to break the error message down into fields on the backend and unpack the messages on the FE. Co-authored-by: Frederic Ma <frederic.ma@shopify.com>
Configuration menu - View commit details
-
Copy full SHA for 1bb0d96 - Browse repository at this point
Copy the full SHA 1bb0d96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 617fc7f - Browse repository at this point
Copy the full SHA 617fc7fView commit details -
add error handling for name and message.
There is no validation on these fields yet but there will be
Configuration menu - View commit details
-
Copy full SHA for f92b3d4 - Browse repository at this point
Copy the full SHA f92b3d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 16f7fb2 - Browse repository at this point
Copy the full SHA 16f7fb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 70040ec - Browse repository at this point
Copy the full SHA 70040ecView commit details -
Since this was introduced the markup has changed to introduce an extra form wrapper which takes care of what this was trying to achieve
Configuration menu - View commit details
-
Copy full SHA for 84d8e85 - Browse repository at this point
Copy the full SHA 84d8e85View commit details -
remove input field styling from form element
Was throwing the alignment out
Configuration menu - View commit details
-
Copy full SHA for 46e9e2b - Browse repository at this point
Copy the full SHA 46e9e2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 517d99c - Browse repository at this point
Copy the full SHA 517d99cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 57cb5a7 - Browse repository at this point
Copy the full SHA 57cb5a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 053cf8e - Browse repository at this point
Copy the full SHA 053cf8eView commit details -
Co-authored-by: Ludo <ludo.segura@shopify.com>
Configuration menu - View commit details
-
Copy full SHA for d624c4b - Browse repository at this point
Copy the full SHA d624c4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 701e107 - Browse repository at this point
Copy the full SHA 701e107View commit details -
Split up errors into their respective fields
This mirrors what liquid does to render errors.
Configuration menu - View commit details
-
Copy full SHA for 73a7cd3 - Browse repository at this point
Copy the full SHA 73a7cd3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec25e91 - Browse repository at this point
Copy the full SHA ec25e91View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbcb62f - Browse repository at this point
Copy the full SHA fbcb62fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17defb7 - Browse repository at this point
Copy the full SHA 17defb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab74e9b - Browse repository at this point
Copy the full SHA ab74e9bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c29e433 - Browse repository at this point
Copy the full SHA c29e433View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8cea7f - Browse repository at this point
Copy the full SHA a8cea7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for aa7b4e5 - Browse repository at this point
Copy the full SHA aa7b4e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e94ecf0 - Browse repository at this point
Copy the full SHA e94ecf0View commit details -
Read localised field labels from DOM
Previously we were building error messages using the unlocaised field key
Configuration menu - View commit details
-
Copy full SHA for cd8f958 - Browse repository at this point
Copy the full SHA cd8f958View commit details -
Save default error message header and restore it when needed
This is important as the error reporter has to deal with two different types of errors: * Normal simple product form errors such as adding too many of a varient to cart. These display as a single sentence in the error header, replacing the original liquid rendered header. * Gift card recipient errors which arrive as a map of field => error message. These are disgned to mimic the original liquid layout of the page and as such should use the original liquid header, even if it has been previusly replaced by a simple product error
Configuration menu - View commit details
-
Copy full SHA for b61ae4a - Browse repository at this point
Copy the full SHA b61ae4aView commit details -
add period after error message
This matches how we do it in liquid
Configuration menu - View commit details
-
Copy full SHA for 9543809 - Browse repository at this point
Copy the full SHA 9543809View commit details -
Configuration menu - View commit details
-
Copy full SHA for 722bfee - Browse repository at this point
Copy the full SHA 722bfeeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a2a92f - Browse repository at this point
Copy the full SHA 4a2a92fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e698fc0 - Browse repository at this point
Copy the full SHA e698fc0View commit details -
Use single line if expressions
I think the saved few characters are a false economy but it seems to be the style
Configuration menu - View commit details
-
Copy full SHA for c251a19 - Browse repository at this point
Copy the full SHA c251a19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 091373d - Browse repository at this point
Copy the full SHA 091373dView commit details -
* terse if/else, albeit with an extra assignment * remove uneeded form assignment * replace a span with a div
Configuration menu - View commit details
-
Copy full SHA for b470d20 - Browse repository at this point
Copy the full SHA b470d20View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9f50d6 - Browse repository at this point
Copy the full SHA f9f50d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b656d7a - Browse repository at this point
Copy the full SHA b656d7aView commit details -
Add aria-labelledby attributes to form
This is still not perfect, voiceover on mac will read out: {aria-labelledby} {placeholder}, edit text {label} e.g Recipient's Email Email, edit text Email I'm not sure it should use the placeholder like that. Ultimately the issue is that we use two labels for the field, perhaps we should scrap that approach and just use one label?
Configuration menu - View commit details
-
Copy full SHA for fe869bb - Browse repository at this point
Copy the full SHA fe869bbView commit details -
Various whitespace and stylistic fixes
Co-authored-by: Ludo <ludo.segura@shopify.com>
Configuration menu - View commit details
-
Copy full SHA for 6aa7f56 - Browse repository at this point
Copy the full SHA 6aa7f56View commit details -
Configuration menu - View commit details
-
Copy full SHA for f753c47 - Browse repository at this point
Copy the full SHA f753c47View commit details -
remove gift card recipient form block
this has been replaced by a snippet
Configuration menu - View commit details
-
Copy full SHA for 2a81400 - Browse repository at this point
Copy the full SHA 2a81400View commit details -
Remove leading labels from fields
We felt that extra labels might be redundant. MEant I also had to rejig the spacing of the form but I think it's come out ok. Also emilinated the massive gap under error list.
Configuration menu - View commit details
-
Copy full SHA for d30acab - Browse repository at this point
Copy the full SHA d30acabView commit details -
* Add elipses on field labels at short widths * Move max chars message to bottom of textarea * Add aria-label to textarea which contains the max chars description
Configuration menu - View commit details
-
Copy full SHA for ff95e95 - Browse repository at this point
Copy the full SHA ff95e95View commit details -
use plaeholder instead of label as error key
This is because the label is now a bit wordy to use as an error key
Configuration menu - View commit details
-
Copy full SHA for e562f4e - Browse repository at this point
Copy the full SHA e562f4eView commit details -
Dynamically calculate available space for label
Co-authored-by: Ludo <ludo.segura@shopify.com>
Configuration menu - View commit details
-
Copy full SHA for fd30c0d - Browse repository at this point
Copy the full SHA fd30c0dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 405e665 - Browse repository at this point
Copy the full SHA 405e665View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92380a6 - Browse repository at this point
Copy the full SHA 92380a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69b07ee - Browse repository at this point
Copy the full SHA 69b07eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cd7e6c - Browse repository at this point
Copy the full SHA 7cd7e6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fd63f7 - Browse repository at this point
Copy the full SHA 5fd63f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1a3246 - Browse repository at this point
Copy the full SHA f1a3246View commit details -
Configuration menu - View commit details
-
Copy full SHA for c9b9283 - Browse repository at this point
Copy the full SHA c9b9283View commit details
Commits on Mar 20, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e192755 - Browse repository at this point
Copy the full SHA e192755View commit details -
Configuration menu - View commit details
-
Copy full SHA for 149b323 - Browse repository at this point
Copy the full SHA 149b323View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0204dfe - Browse repository at this point
Copy the full SHA 0204dfeView commit details
Commits on Mar 21, 2023
-
Update snippets/gift-card-recipient-form.liquid
Co-authored-by: Ludo <ludo.segura@shopify.com>
Configuration menu - View commit details
-
Copy full SHA for 8e29538 - Browse repository at this point
Copy the full SHA 8e29538View commit details -
Update snippets/gift-card-recipient-form.liquid
Co-authored-by: Ludo <ludo.segura@shopify.com>
Configuration menu - View commit details
-
Copy full SHA for f578763 - Browse repository at this point
Copy the full SHA f578763View commit details -
Configuration menu - View commit details
-
Copy full SHA for e720fba - Browse repository at this point
Copy the full SHA e720fbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for d305bac - Browse repository at this point
Copy the full SHA d305bacView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cecb78 - Browse repository at this point
Copy the full SHA 4cecb78View commit details