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 Archives block #7949

Merged
merged 11 commits into from
Jul 16, 2018
Merged

Add Archives block #7949

merged 11 commits into from
Jul 16, 2018

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Jul 13, 2018

This PR is a continuation of #5495, moved to a local branch for easier collaboration. Props @miina for the bulk of the implementation.

Uses #5602

Continued archives block implementation from #1518 and #5495. Archive block implementation that uses similar output and filters as the archives widget. Has alignment toolbar within the block (left, center, right).

Screenshots:

Block toolbar:
screen shot 2018-05-01 at 2 23 23 pm
Inspector toolbar:
screen shot 2018-05-01 at 2 17 54 pm
Dropdown view:
archives-block-dropdown
List view:
archives-block-list

Fixes #1464.

@talldan talldan added the New Block Suggestion for a new block label Jul 13, 2018
@talldan talldan self-assigned this Jul 13, 2018
@talldan talldan added the [Status] In Progress Tracking issues with work in progress label Jul 13, 2018
@talldan talldan mentioned this pull request Jul 13, 2018
this.toggleDisplayAsDropdown = this.toggleDisplayAsDropdown.bind( this );
}

toggleShowPostCounts() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use just one toggle function for both attributes? See: https://github.com/WordPress/gutenberg/pull/7941/files#diff-4a7082059a72e724bea52a0a00c65773R35

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed this now to a functional component in ad5aa1d as per previous feedback on the old PR, so I don't think making them a single function would be workable now. On the plus side they're both one-liners now. :)

}

$block_content = sprintf(
'<div class="%1$s">%2$s</div>',
Copy link
Member

Choose a reason for hiding this comment

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

div should be an 'ul'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! It should be a ul when rendered as a list, and I've kept it as a div when rendered as a dropdown - 65025c1

talldan and others added 7 commits July 16, 2018 15:53
Co-authored-by: Pascal Birchler <hello@pascalbirchler.ch>
Co-authored-by: Miina Sikk <miina.sikk@gmail.com>
Co-authored-by: Weston Ruter <weston@xwp.co>
…tor view

Use of `pointer-events` to disable interaction was problematic. It
didn't disabled the dropdown version of the block and it doesn't prevent
keyboard interaction.

The Disabled component handles these situations.
@talldan talldan requested review from noisysocks and mcsf July 16, 2018 08:32
@talldan
Copy link
Contributor Author

talldan commented Jul 16, 2018

Hey @noisysocks & @mcsf - I think I've addressed all the review feedback from #5495 now. Would be great if one of you could look over may changes to make sure they're ok. Thanks!

Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

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

Tests well, looks good. Thanks for working on this, @talldan.

export const settings = {
title: __( 'Archives' ),

description: __( 'Display a monthly archive of your site’s Posts.' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, filter widget_archives_dropdown_args can change the periodic interval, meaning "monthly" may become inaccurate. However, I could see filtering as a more advanced feature, and sticking with "monthly" offers the benefit of conveying the basic idea of the block more clearly than e.g. "Display a periodic archive […]". Because of this, I don't mind sticking with the current copy.

@mcsf mcsf changed the title Changes from PR #5495 squashed into single commit Add Archives block Jul 16, 2018
@mcsf mcsf merged commit 4f93f21 into master Jul 16, 2018
@mcsf mcsf deleted the add/archives-block branch July 16, 2018 12:55
@Soean Soean added this to the 3.3 milestone Jul 16, 2018
@melchoyce melchoyce removed the [Status] In Progress Tracking issues with work in progress label Dec 14, 2018
@afercia afercia added the [Feature] Widgets Screen The block-based screen that replaced widgets.php. label Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Screen The block-based screen that replaced widgets.php. New Block Suggestion for a new block
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants