-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Generic Forms #4561
Generic Forms #4561
Conversation
d76eb69
to
7aa1cd6
Compare
7aa1cd6
to
84d02ae
Compare
I'm still thinking about how to make it work with #4568 and have the store branding applied to the form whenever possible. The form per se doesn't have the connection to a store, but as custom forms are set up per store, it would work for those cases. However, we still would need something like a parameter for the generic forms, which will be used most of the times. It'd certainly be good to have that possibility, because otherwise the form as an intermediate step would miss the branding that the initial and checkout view have. |
fc06004
to
1abfd53
Compare
All forms are attached to a store. There is a "public" property on custom forms, which lets you use them without apps/pay requests, but the hardcoded ones are always set to false. That means the form always has a stored available to it |
1abfd53
to
e2a3569
Compare
0022167
to
1d6aa9e
Compare
Added the branding aspect to the non-public forms and cleaned up the views a bit. The test failures seem to be DB related, but at first glance I don't see what might be wrong … I cleaned up one field in the migration, but there are two errors remaining which look like they might be related to the recent blob changes — any idea @Kukks @NicolasDorier?
|
1d6aa9e
to
265b829
Compare
3dbbcc7
to
0620a7b
Compare
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.
tACK
7c406dc
to
b3a5b09
Compare
} | ||
|
||
public async Task<FormData?> GetForm(string storeId, string id) | ||
{ |
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.
if id
is null (as you did below), you should return null. Also make string id
nullable. You are actually passing a null potentially in some controller.
}, | ||
_ => null | ||
Currency = form.GetFieldByName("internal_currency")?.Value ?? store.GetStoreBlob().DefaultCurrency, | ||
Amount = string.IsNullOrEmpty(amt) ? null : decimal.Parse(amt, CultureInfo.InvariantCulture), |
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 like the idea, though why is it called internal_
?
Also maybe in later PR we can make this more generic such that the form can configure all fields of CreateInvoiceRequest.
I made a few minor observations, after it seems good to be merged. |
f37d058
to
faeef95
Compare
This re-adds the custom forms support and reactors things considerable as there were many bugs.
Things to note: