-
Notifications
You must be signed in to change notification settings - Fork 4.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
Add "display post date" and "number of posts to show" Inspector options for Latest Posts block #1191
Conversation
ad79c59
to
a0a4a34
Compare
13bcbf6
to
211981a
Compare
Rebased to remove merge commit 13bcbf6 (and former |
blocks/library/latest-posts/index.js
Outdated
className="editor-latest-posts__input" | ||
onChange={ () => this.changePostsToShow( this.refs[ postToShowId ].value ) } | ||
/> | ||
</div> |
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.
Should we wait for this #1202 and use the common controls declared there?
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.
We should absolutely use the same controls everywhere, but whether this happens post merge or not I don't think is important. Should I open a separate ticket for making sure controls are all the same?
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.
The controls are merged, let's rebase this :)
So now this is waiting on #1278? |
I don't think it has to. IMO okay to merge so long as we remember to address issues after the fact. |
blocks/library/latest-posts/index.js
Outdated
let { poststoshow: postToShowNext } = nextProps.attributes; | ||
const { setAttributes } = this.props; | ||
|
||
postToShowNext = parseInt( postToShowNext ); |
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.
The parseInt
is a bit weird, we should get the JSON attributes PR merged soon :)
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.
Please always add the radix
. :)
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 think we should probably drop it since the JSON attributes are merged.
blocks/library/latest-posts/index.js
Outdated
className="editor-latest-posts__input" | ||
onChange={ () => this.changePostsToShow( this.refs[ postToShowId ].value ) } | ||
/> | ||
</div> |
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.
The controls are merged, let's rebase this :)
blocks/library/latest-posts/index.js
Outdated
}, | ||
|
||
edit: class extends wp.element.Component { | ||
edit: withInstanceId( class extends wp.element.Component { |
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.
We're moving way from wp.*
as much as we can in favor of import { Component } from 'element';
Rebasing... |
Props @jasmussen for design hints.
10eb4b4
to
ec84d3e
Compare
What else is left here? |
I think it's good to go, probably! |
@jasmussen Fixed padding issue that I missed. Should be good to go for now. There's a rule that's overly broad in Gutenberg: .gutenberg ul,
.gutenberg ol {
margin: 0;
padding: 0;
} I'm not sure why this is done, because now blocks are forced to overwrite it by adding a parent selector. |
Also adjusted the value: |
You're right, we should probably scope that UL code a bit. I can't recall the circumstances right now, but I think it's just basic CSS normalization. |
Okay, let's merge and iterate. |
Thanks for finishing this, I couldn't find time for it, sorry! |
When building the Latest Posts block, @jasmussen did a great design of some initial Inspector options. In this PR, we are implementing parts of it.
Testing
Looking like this as of now:
TODO