-
Notifications
You must be signed in to change notification settings - Fork 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
Post Editor: add new Copy Post functionality #7320
Conversation
simpler explanation of what a domain name actually is.
avoid issues with font rendering across browser and OS.
state on other inputs.
Editor: Refactor page templates to use Redux state
* Removed `push-notifications-ab-test` feature flag from production. * Removed references to `push-notifications-ab-test` feature flag. * Removed `pushNotificationsPreferences` abtest -- PNs for everybody now. * Fix logic for when PN nudge is shown.
* First-view: Use config with paths for determining active view * Wire up enable flag * Update tests to account for config/path-based FVs * Fix linting errors * Fix tab linting errors
…y one site (#7314) * Clean up and add test for only one site * Factor sites popover to class method * Skip site list popover if user only has one site
* Add entry for signup theme preview abtest * Tweak variation names, percentages * Replace flag logic with abtest logic * Fix lint * Remove config flag * Fix lib/abtest import * Remove explicit allowExistingUsers
Added PostSelector component. It uses the internal state to avoid cluttering the global one with changes only relevant to the actual Copy Post functionality. Added updateCurrentPost(), aka the Copy Post function. It still uses Flux, waiting for Posts to fully migrate to Redux. Notable issues: - post.content cannot be updated, either via PostActions.edit() or PostActions.editRawContent(); - post.categories are updated (according to the taxonomy checkboxes changing as expected), but then break the Save Post action, as apparently they don't have .map() anymore; manually touching the category checkboxes fixes the Save action (restoring post.categories.map() ?).
import PostActions from 'lib/posts/actions'; | ||
import PostSelector from 'my-sites/post-selector'; | ||
|
||
module.exports = React.createClass( { |
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 be consistent with your module import/export syntax. Specifically, I'd recommend using
export default
instead ofmodule.exports
- I've been discouraging folks from using
React.createClass
, as looking through the React core meeting notes it becomes very obvious that it's a discouraged feature. Consider instead theReact.Component
class or, if your component doesn't need lifecycle or state, a pure stateless function 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.
Regarding both your annotations: I actually had to refrain myself from using export
and class
and stateless components, as the few Calypso files I opened to understand Calypso's conventions didn't use them!
I'll update the files as soon as possible!
The Copy Post functionality will allow users to choose an existing post and use it as a template for a new one.
Title, content, taxonomies, custom fields and everything else will be copied into the draft, ready to be modified as needed.
My initial approach is to add a new accordion in the editor drawer, containing a searcheable list of all posts. Through it, users can find an existing post, select it and use it as a template for the current draft.
Test live: https://calypso.live/?branch=add/copy-post