Repository navigation
Simple Payments: gutenberg block UI - #28169
Conversation
b3882eb to
53eecd6
Compare
|
I recorded a screencast that highlights a few issues I noticed: https://cloudup.com/cM30s7LEbQd
|
53eecd6 to
3873de1
Compare
|
@roccotripaldi FYI: I tried to register this block using import JetpackBlockType from 'gutenberg/extensions/presets/jetpack/utils/jetpack-block-type';
const SimplePaymentsBlock = new JetpackBlockType( 'simple-payments', {
// ...
} );
SimplePaymentsBlock.register(); |
41082c9 to
c0fe79e
Compare
|
This is pretty close to being ready. It's missing some error states that might be coming from the API but validations at the frontend already work. It's unclear to me if prices need to be limited to There might be some accessibility improvements we can still do. The block also loads even for simple plans; a mechanism to stop that happening is still in the works elsewhere. @brbrr which browser are you using? I couldn't replicate the alignment issue. |
|
Looks like there's a small bug where currency doesn't get set to default "USD" unless you change it to something else first. |
The idea was to trigger the error messages when we unfocus an unfilled block (kind of like a submit button with a form). Maybe when we refocus and start filling the fields, the message could/should disappear? |
| default: '', | ||
| }, | ||
| multiple: { | ||
| type: 'number', |
There was a problem hiding this comment.
Related: Automattic/jetpack#10402 (comment)
I'd like to isolate API concerns from component logic. Indicating this is a number is confusing, I'm happy to add toApi/fromApi as necessary.
11d63cf to
039d927
Compare
Maintain .js extension so diff is clearer.
This was causing a warning. defaultValue is for uncontrolled components. With the Gutenberg default attribute value, the currency should be correctly defined.
sirreal
left a comment
There was a problem hiding this comment.
I tested this on a Jetpack site with Automattic/jetpack#10402 and it's working nicely.
I want to confirm Simple Payments in the classic editor continue to work as expected with the default changes, then let's ship and iterate!
Seems to be caused by styles leaking in from Calypso-Gutenberg, opened an issue: #28309 |





Adds basic UI for Simple payments Gutenberg block.
Screenshots
UI:
UI screaming warnings:
Preview in editor:
End result at the site:
Todo / known issues
paypal.com>= 1.00view.scss— now it's just copied over from Jetpack plugin and we need very little from it for the previewTesting instructions
Test in Jetpack
Test in Calypso
Manual checking
Apply these patches and cross-test the block in different editors: