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

Blocks: introduce new Podcast Episodes block #14928

Merged
merged 3 commits into from
Mar 11, 2020
Merged

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Mar 9, 2020

Changes proposed in this Pull Request:

  • Adds scaffolding for a Podcast Episodes block. Implementation to follow in separate PRs.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

  • paYJgx-sH-p2

Testing instructions:

  • Check out the PR and build extensions.
  • Make sure there is a Podcast Episodes (beta) block in the block selector.
  • Insert in to the editor and make sure it doesn't break the editor or the frontend.

Proposed changelog entry for your changes:

  • Introduces a beta Podcasts Episodes block.

@jeherve jeherve added [Status] In Progress [Type] Feature Request [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack labels Mar 9, 2020
@jeherve
Copy link
Member Author

jeherve commented Mar 9, 2020

@marekhrabe I'll let you take that one from there!

@jeherve jeherve added the [Status] Needs Product Review Consider posting about this on an internal P2 for discussion label Mar 9, 2020
@jetpackbot
Copy link

jetpackbot commented Mar 9, 2020

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: April 7, 2020.
Scheduled code freeze: March 31, 2020

Generated by 🚫 dangerJS against 1b6ba78

@jeherve
Copy link
Member Author

jeherve commented Mar 9, 2020

Adding the "Needs Product Review" as a reminder that it'd be great if you could publish about this new block, its target deadline, and its deployment strategy as explained here:
p1HpG7-8wI-p2

Thank you!

@obenland
Copy link
Member

obenland commented Mar 9, 2020

I've probably done too much here already, but it works on the front-end, building on the RSS block and re-using Core's audio playlist scripts. The editor preview needs attention.

It's very much possible this will not be the route we'll end up taking, so let me know what you think, or rip it out and start over :)

@@ -0,0 +1,12 @@
const urlValidator = url => ! url || url.startsWith( 'http' );
Copy link
Member

@simison simison Mar 10, 2020

Choose a reason for hiding this comment

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

You could look at isUrl() from @wordpress/url: https://github.com/WordPress/gutenberg/blob/03e3c05eca3ee66b99655e79d2939dafe27a46e3/packages/url/src/is-url.js#L16 or using new URL() native JS API.

$rss = fetch_feed( $attributes['url'] );

if ( is_wp_error( $rss ) ) {
return '<div class="components-placeholder"><div class="notice notice-error"><strong>' . __( 'RSS Error:', 'jetpack' ) . '</strong> ' . $rss->get_error_message() . '</div></div>';
Copy link
Member

Choose a reason for hiding this comment

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

Remember to HTML escape the error.

@WunderBart WunderBart force-pushed the add/podcast-episodes-block branch from 84b296b to 8862522 Compare March 10, 2020 14:21
@WunderBart
Copy link
Member

WunderBart commented Mar 10, 2020

I've rebased this branch and removed extra commits to be picked up in follow-up PRs as described in this comment (see also p1583833360124800-slack-ajax). For the removed stuff, I created two separate branches with it:

I've tested this one locally and it looks good to me, as far as the scaffolding task is concerned:

Picker Placeholder
Screenshot 2020-03-10 15 23 03 Screenshot 2020-03-10 15 22 54

Copy link
Member Author

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

The tests are currently failing because the scaffolding introduces variables you can use to build your block, but haven't yet. I'd recommend removing them or adding comments so the tests can pass. You can add those back later on as you build your PRs.

  6:23  error  'withNotices' is defined but never used              no-unused-vars
  16:2   error  'attributes' is defined but never used               no-unused-vars
  20:2   error  'setAttributes' is defined but never used            no-unused-vars
  27:10  error  'notice' is assigned a value but never used          no-unused-vars
  27:18  error  'setNotice' is assigned a value but never used       no-unused-vars
  30:8   error  'setErrorNotice' is assigned a value but never used  no-unused-vars

@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello jeherve! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D40115-code before merging this PR. Thank you!

@obenland obenland marked this pull request as ready for review March 10, 2020 16:50
@obenland obenland requested a review from a team March 10, 2020 16:50
@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] In Progress labels Mar 10, 2020
@WunderBart WunderBart removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Mar 10, 2020
@WunderBart WunderBart force-pushed the add/podcast-episodes-block branch from 9f20ab5 to 1b6ba78 Compare March 10, 2020 17:13
@obenland
Copy link
Member

@Automattic/jetpack-crew When you get a chance, I'd love to get this in early so we can start to rebase and continue with follow up PRs. Thank you!

@jeherve
Copy link
Member Author

jeherve commented Mar 11, 2020

When you get a chance, I'd love to get this in early so we can start to rebase and continue with follow up PRs. Thank you!

I'll take a look in a bit. To speed things up, this may help:

  1. Have someone on your team reviewing, testing, and accepting the changes.
  2. Add the "Needs Review" label so the PR gets on our radar.

For more info about this: p1583857050271600-slack-ajax

@jeherve jeherve added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Mar 11, 2020
@jeherve jeherve added this to the 8.4 milestone Mar 11, 2020
@github-actions
Copy link
Contributor

Howdy! The Jetpack team has disappeared for a few days to a secret island lair to concoct new ways to make Jetpack one hundred billion percent better. As a result, your Pull Request may not be reviewed right away. Do not worry, we will be back next week to look at your work! Thank you for your understanding.

@jeherve
Copy link
Member Author

jeherve commented Mar 11, 2020

No worries about this ^

This is Hack week for us, but I'll take a look at the PR anyway.

Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Screenshot 2020-03-11 at 10 12 55

Tested and it worked for me.

Some minor suggestions for wording tweaks but may not be needed. Will defer to Jetpack Crew on this one.

extensions/blocks/podcast-episodes/edit.js Show resolved Hide resolved
extensions/blocks/podcast-episodes/edit.js Show resolved Hide resolved
extensions/blocks/podcast-episodes/edit.js Show resolved Hide resolved
Copy link
Member Author

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This should be good to ship as is, so y'all can start iterating on this.

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! [Block] Podcast Player and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Mar 11, 2020
Copy link
Member

@zinigor zinigor left a comment

Choose a reason for hiding this comment

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

The code looks good, keeping in mind that it's just a scaffold for the real thing. Let's merge!

@zinigor zinigor merged commit c274402 into master Mar 11, 2020
@zinigor zinigor deleted the add/podcast-episodes-block branch March 11, 2020 11:39
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Mar 11, 2020
@jeherve jeherve added [Status] Has Changelog and removed [Status] Needs Changelog [Status] Needs Product Review Consider posting about this on an internal P2 for discussion labels Mar 20, 2020
jeherve added a commit that referenced this pull request Mar 20, 2020
jeherve added a commit that referenced this pull request Mar 31, 2020
* Initial changelog entry

* Changelog: add #14904

* Changelog: add #14910

* Changelog: add #14913

* Changelog: add #14916

* Changelog: add #14922

* Changelog: add #14924

* Changelog: add #14925

* Changelog: add #14928

* Changelog: add #14840

* Changelog: add #14841

* Changelog: add #14842

* Changelog: add #14826

* Changelog: add #14835

* Changelog: add #14859

* Changelog: add #14884

* Changelog: add #14888

* Changelog: add #14817

* Changelog: add #14814

* Changelog: add #14819

* Changelog;: add #14797

* Changelog: add #14798

* Changelog: add #14802

* Changelog: add #13676

* Changelog: add #13744

* Changelog: add #13777

* Changelog: add #14446

* Changelog: add #14739

* Changelog: add #14770

* Changelog: add #14784

* Changelog: add #14897

* Changelog: add #14898

* Changelog: add #14968

* Changelog: add #14985

* Changelog: add #15044

* Changelog: add #15052

* Update to remove Podcast since it remains in Beta

* Changelog: add #14803

* Changelog: add #15028

* Changelog: add #15065

* Changelog:add #14886

* Changelog: add #15118

* Changelog: add #14990

* Changelog: add #14528

* Changelog: add #15120

* Changelog: add #15126

* Changelog: add #15049

* Chanegelog: add #14852

* Changelog: add #15090

* Changelog: add #15138

* Changelog: add #15124

* Changelog:add #15055

* Changelog: add #15017

* Changelog: add #15109

* Changelog: add #15145

* Changelog:add #15096

* Changelog:add #15153

* Changelog: add #15133

* Changelog: add #14960

* Changelog: add #15127

* Changelog: add #15056

* Copy current changelog to changelog archive.

* Clarify changelog description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Podcast Player [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack Touches WP.com Files [Type] Feature Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants