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
Editor: Allow parent page to be removed. #896
Conversation
</label> | ||
</FormLabel> | ||
<FormLabel> | ||
<FormCheckbox ref="topLevel" checked={ ! this.props.parent } onChange={ this.updatePageParent } /> |
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.
We should use a toggle for these singular controls.
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.
👍
In 002239f use of the toggle, and styling that is currently seen in "Post Status" was added: @folletto I believe we might have originally gone that route with the Add Category screen too, and I seem to think we did not go that way due to the nature of checkboxes/multi-select. Here though, that approach could work with the radios. I kind of like this toggle approach myself. |
The item inside the list has two big advantages:
Unless there's a big technical issue, we should really try to get it inside the list. :) |
@timmyc I'd get the top level toggle in so we have something and then look at including it within the list, since it won't be as trivial. |
Sounds like a good plan @mtias |
Agreed 👍 |
Quick notes from a quick test sesh:
|
@jkudish I can't seem to re-create the issue above where you select a page, then click the top level toggle and the old selection is persisted. Additionally I'm not seeing the newly created page being shown as an option in the selector. I suppose there might be a brief moment when the post-edit-store does not yet have an ID for the post - and possibly a new As for the draft save failure - I added an extra check to |
I just re-tested. Looking better. I can no longer repro 2/3 of the bugs from above. I can still repro this one:
This time I got it by editing a published page which had a parent page and reverting it to a draft. One other bug I just noticed, though maybe it's for a separate PR: the previewed permalink of a page with a parent should be updated to reflect its page parent. If I have a |
The slug thing is a definite regression - that was working at one point during the great slug explorations of 2015. I will spawn an issue for that. As for the page being shown as an option in the parent list - I finally was able to reproduce this. I had to let the editor site idle for a few minutes for this to happen though. But it appears another component polls the post-list-store:
The key with this request is it does not include Though, this bug would be fixed by #708 since each component would have their own |
@jkudish mind taking one last look at this - well no additional commits but I created a new issue to track the parent slug bit - and explained the other issue you were seeing above. |
}, | ||
|
||
render() { | ||
return ( | ||
<AccordionSection className="editor-page-parent"> | ||
<label> | ||
<FormLabel> | ||
<span className="editor-page-parent__label-text">{ this.translate( 'Parent Page' ) }</span> |
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.
Unrelated to this pull request, but seems like we could move the className
to the <FormLabel>
component and have it work just as well.
e0f5536
to
29213e6
Compare
Yes, few pages don't require the box nor search. Same with few categories. |
Editor: Allow parent page to be removed.
Fixes #741
Currently in the editor there is no way to remove a page parent if one is currently set. This branch adds a checkbox above the Parent Page Selector, much like we show in the Add Category screen, to allow removing the parent page option, or setting it back to a "Top level page.".
To Test