-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: initial post type and block setup #1
Conversation
Sets up custom post types and Listing block prototype.
Instead of just registering a single Listing block and selecting the type in the parent post, this registers a separate block for each listing type (all of which use the same code).
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.
Left some comments, plus two general issues:
- When replacing a listing in the editor, the just-removed listing is not available to be picked
- After publishing the listing, the site at the permalink URL returns 404. Changing the permalink base in the setting did not fix this.
} | ||
} | ||
|
||
export default AutocompleteTokenField; |
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.
Suggestion: AutocompleteTokenField
could be distributed with newspack-components
.
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.
Good call—do we have documentation for adding components to the NPM package?
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.
It's a manual process – after the code is in assets/components
of newspack-plugin
(regular PR to master
) you just
$ npm version <type>
(docs)$ npm publish
What's your npm username, so I can add you as a maintainer?
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.
Username is dkoo
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've added you as a maintainer 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.
Thanks! I added the component to newspack-plugin
here: Automattic/newspack-plugin#674
Addresses pull request feedback and refactors post types config into a more DRY treatment.
This was kind of by design—the autocomplete search will only return results that aren't already in the current list, including the one you're replacing (I figured there should be no need to replace a post with the same post, since you can cancel if you decide you don't want to replace it).
I can't replicate this—can you try flushing permalinks manually and then refreshing the page? |
My bad, that's true :D
I did that, and still no dice. But it did work after deactivating & activating Yoast plugin – there might be some conflict there :/ |
Good to know—I might want to investigate that further in a different issue/PR, if that's okay? |
On a fresh site I could see no issues after installing Yoast, so that was probably something specific to my local setup. |
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# 1.0.0-alpha.1 (2021-07-19) ### Bug Fixes * avoid meta sync update error ([#95](#95)) ([cab16aa](cab16aa)) * do not register post-specific sidebars in widgets page ([#93](#93)) ([7716775](7716775)) * editor errors with reusable blocks ([#89](#89)) ([fdc46d3](fdc46d3)) * errors and bugs related to WP 5.8 ([#83](#83)) ([90da6c5](90da6c5)) * force alpha rebuild ([acc2075](acc2075)) * minor bug fixes ([#21](#21)) ([5f90bc7](5f90bc7)) * missing condition for block appender in list container ([#74](#74)) ([2c49896](2c49896)) * syncing attributes from curated list block to inner blocks ([#64](#64)) ([cdbc0bb](cdbc0bb)) * use synced attributes for ListContainer directly ([#73](#73)) ([f8641a7](f8641a7)) ### Features * add block patterns ([#23](#23)) ([a273a40](a273a40)) * bump max number of items per list from 20 to 50 ([#97](#97)) ([009deab](009deab)) * initial post type and block setup ([#1](#1)) ([47dc0c1](47dc0c1)) * listing taxonomies and query mode ([#6](#6)) ([528e1e5](528e1e5)) * more block patterns (real estate, classified ads) ([#84](#84)) ([a51f5af](a51f5af)) * new Curated List block, block pattern, and map functionality ([#3](#3)) ([9be6e7e](9be6e7e)) * remove borders and padding in editor to match front-end styles ([#14](#14)) ([6c47a17](6c47a17)) * v2 release (#85) ([748810d](748810d)), closes [#85](#85) [#40](#40) [#39](#39) [#32](#32) [#41](#41) [#49](#49) [#43](#43) [#56](#56) [#51](#51) [#57](#57) [#61](#61) [#67](#67) [#60](#60) [#70](#70) [#65](#65) [#71](#71) [#66](#66) [#58](#58) [#77](#77) [#81](#81) ### BREAKING CHANGES * This feature will deprecate existing custom taxonomies, so any existing terms for those taxonomies will be lost. To fix, we can convert terms from the deprecated taxonomies to standard post categories/tags via a migration script.
Sets up custom post types and Listing block prototype.
All Submissions:
Changes proposed in this Pull Request:
Sets up the custom post types and the Listing blocks needed to build a curated list. Also lays out an approach for programmatically registering post metadata for all listing types.
Wanted to get this prototype code reviewed before it gets too too big. Would gladly take feedback on the code structure and technical approaches outlined here, and/or any suggestions to improve the editor experience! Maybe also suggestions for unit tests that we should plan out before the plugin gets too big?
Not included in this PR:
How to test the changes in this Pull Request:
The plugin is installed with the code from this PR in this demo site, which you can use to test functionality if you don't have a local environment set up:
https://tricky-click.jurassic.ninja/wp-admin/
u:
demo
p:
jEx4k7B7w6ug
listings
.console.log( post.meta );
to line 166 of edit.js. You should see the email address and phone number fields logged under themeta
key here, so they may be displayed in a future PR.listings
. Verify that the public-facing pages for the Curated List and all singular listings still load.Other information: