-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature/constrain parent pages #21
Conversation
Love this feature! |
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.
Great! There a couple of typo's.
The only thing I am missing is an empty state, when non of the pages has marked the page type in their allowedParents.
E.g. in the following configuration. You cannot create a child content page of a content page:
allowedParents: {
'contentPage': ['homePage'],
}
This is a valid case, so we should support this in the UI as well
@tstikvoort Good catch! In the empty state, it now disables the button and shows this tooltip: |
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.
Very nice! I think we can slightly improve the empty state text and then this can be merged 👍
const tooltipContent = isAddPageButtonDisabled ? ( | ||
<Box padding={1}> | ||
<Text muted size={1}> | ||
The allowed parents configuration prevents this document type from being a parent to any other document. |
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 think this text is just a little bit too technical for the average content editor. We can't assume the use case of why it is configured to not contain child pages, so my suggestion is to just keep it simple. Maybe something like This page cannot contain any child pages.
or something similar?
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.
This is one that I had been debating myself as well for longer than I would like to admit.. As, on the one hand, I don't want to get too technical. But on the other hand, I want to make it informative enough as well that people know what's up. Furthermore, I tried to avoid the word "child", as this empty state is a result of an allowed parent config. How informative do you think the tooltip will need to be?
This PR expands the tree config with an option to define, for each document type, which types of documents they can have as parents.
This feature has been implemented in three areas: