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

Conversation

Projects
5 participants
@talldan
Copy link
Contributor

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 label Jul 13, 2018

@talldan talldan self-assigned this Jul 13, 2018

@talldan talldan referenced this pull request Jul 13, 2018

Closed

Add Archives block #5495

@talldan talldan force-pushed the add/archives-block branch from 82008dd to 31bccd8 Jul 13, 2018

this.toggleDisplayAsDropdown = this.toggleDisplayAsDropdown.bind( this );
}

toggleShowPostCounts() {

This comment has been minimized.

@Soean

This comment has been minimized.

@talldan

talldan Jul 16, 2018

Author Contributor

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>',

This comment has been minimized.

@Soean

Soean Jul 13, 2018

Member

div should be an 'ul'

This comment has been minimized.

@talldan

talldan Jul 16, 2018

Author Contributor

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 some commits Jul 13, 2018

Changes from PR #5495 squashed into single commit
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>
Use `Disabled` element to prevent interaction with Archives Block edi…
…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 force-pushed the add/archives-block branch from 31bccd8 to ad5aa1d Jul 16, 2018

@talldan talldan requested review from noisysocks and mcsf Jul 16, 2018

@talldan

This comment has been minimized.

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!

@mcsf

mcsf approved these changes Jul 16, 2018

Copy link
Contributor

mcsf left a comment

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.' ),

This comment has been minimized.

@mcsf

mcsf Jul 16, 2018

Contributor

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

2 checks passed

codecov/project 49.08% (-0.41%) compared to 8db4360
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mcsf mcsf deleted the add/archives-block branch Jul 16, 2018

@Soean Soean added this to the 3.3 milestone Jul 16, 2018

@afercia afercia added the Widgets label Jan 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment