-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Set Parent from Page Settings screen #19021
Set Parent from Page Settings screen #19021
Conversation
- ParentPageSettingsViewController can either have a "Cancel" button or "Back" button. - ParentPageSettingsViewController can be configured to set page.parentID locally or remotely. - ParentPageSettingsViewController cna be dismissed automatically when the user selects a page parent.
|
||
/// Provides an API to access the current parent of a page, and list of parent pages available for editing. | ||
/// | ||
@objc class ParentPagesController: NSObject { |
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 needed a way to access the parent pages that can be selected for a child page. So that I display them later in "Set Page" screen.
The good news is that this logic is already implemented in PageListTableViewHandler
. The bad news is that the class is tightly coupled with PageListViewController
's table view. So I couldn't re-use that class elsewhere.
The solution was to read PageListTableViewHandler
and extract only the code that fetches a page's parents available for editing. Then put that logic in a new class that I called ParentPagesController
. This class doesn't depend on any view and be used anywhere.
You can see how this class is used in PageSettingsViewController
.
Let me know what you think. 🙏
Issues
Closes #13150
Testing Instructions
TBD
Screen Recordings
Regression Notes
Potential unintended areas of impact
TBD
What I did to test those areas of impact (or what existing automated tests I relied on)
TBD
What automated tests I added (or what prevented me from doing so)
TBD
PR submission checklist:
RELEASE-NOTES.txt
if necessary.