-
Notifications
You must be signed in to change notification settings - Fork 16
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
BUGFIX: Layout changes for creation dialog #82
Merged
Sebobo
merged 7 commits into
Flowpack:master
from
grebaldi:bugfix/68/layoutChangesForCreationDialog
Jul 29, 2021
Merged
BUGFIX: Layout changes for creation dialog #82
Sebobo
merged 7 commits into
Flowpack:master
from
grebaldi:bugfix/68/layoutChangesForCreationDialog
Jul 29, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So, the condition to determine whether the selection screen is currently being shown inside the NodeCreationDialog is a little flimsy right now... This commit is just checking, whether the NodeCreationDialog is open, because we can assume that if `componentDidMount` of `MediaSelectionScreen` is being called while the dialog is open, the component definitely must be rendered within the dialog, since the dialog is modal and thus prevents all other interaction from happening. Using this solution, we might have more than 1 instance of `MediaSelectionScreen` at once - one in a SecondaryInspector screen and one in the NodeCreationDialog. These two do not interfere (verified by manual testing). This only works because the condition happens to have the implication described above. This commmit also prevents the left side bar of the Neos UI from closing, when the `MediaSelectionScreen` is being rendered within the NodeCreationDialog. Additionally, the padding around the `MediaSelectionScreen` is removed, since the NodeCreationDialog already provides sufficient padding.
grebaldi
force-pushed
the
bugfix/68/layoutChangesForCreationDialog
branch
from
July 18, 2021 16:27
4a8f5b9
to
026b6f6
Compare
This changes the grid layout for the BottomBar as well as its positioning when rendered in the NodeCreationDialog. The BottomBar is positioned in a way that makes it look as if it is part of the dialog. The grid layout is adjusted, so that each column takes up as much space as is needed, as opposed to the left-most and right-most columns reserving 350px worth of space.
This adjusts the height of the ListView if rendered inside the NodeCreationDialog, so that it doesn't overflow the height of the reserved space for secondary editors. Doing so prevents a second scrollbar from appearing when users switch to the ListView.
The App Layout gets a different height when being rendered inside the NodeCreationDialog. The height is calculated in a way that it compensates for the padding provided by the NodeCreationDialog for secondary editors.
This removes the left padding from the Pagination list which made it appear slightly off-center.
This commit creates a (partial) workaround for the issue described in neos/neos-ui#2925. It adds a custom decorator component for the Neos UI Dialog that sets the attribute `data-ignore_click_outside="true"` on the dialog container. This solution is crude and relies on a deprecated ReactDOM-API. But for the time being, it'll at least make the inner dialogs usable in most cases. Once neos/neos-ui#2925 is fixed, this solution should be removed.
This commit addresses two problems: 1. The styles for the Lightbox component were missing from the Plugin.css bundle. This was solved by including the main bundle for the Neos.Ui as well. 2. The Lightbox was constrained to the area of the NodeCreationDialog reserved for secondary editors. This was solved by creating a separate Lightbox container on-demand when the Lightbox is rendered inside the NodeCreationDialog.
grebaldi
force-pushed
the
bugfix/68/layoutChangesForCreationDialog
branch
from
July 18, 2021 18:18
026b6f6
to
07d93d7
Compare
grebaldi
changed the title
WIP: Layout changes for creation dialog
Layout changes for creation dialog
Jul 18, 2021
grebaldi
changed the title
Layout changes for creation dialog
BUGFIX: Layout changes for creation dialog
Jul 18, 2021
The |
Awesome, works and looks really nice :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements adjustments in order to integrate the new Media UI seamlessly as a secondary editor within the NodeCreationDialog (implemented in neos/neos-ui#2870).
The changes made consist of slight CSS changes as well as some fixes for compatibility issues:
Make MediaUiProvider aware of NodeCreationDialog
First of all, the MediaUiProvider needed the information that it is being used within the NodeCreationDialog. The condition to determine this however is a little flimsy right now, due to current limitations of the Main UI.
This PR is checking, whether the NodeCreationDialog is open, because we can assume that if
componentDidMount
ofMediaSelectionScreen
is being called while the dialog is open, the component definitely must be rendered within the dialog, since the dialog is modal and thus prevents all other interaction from happening.We might have more than 1 instance of
MediaSelectionScreen
at once - one in a SecondaryInspector screen andone in the NodeCreationDialog. With the solution in this PR, these two do not interfere (verified by manual testing). This only works because the condition happens to have the implication described above.
Furthermore, this PR prevents the left side bar of the Neos UI from closing, when the
MediaSelectionScreen
is being rendered within the NodeCreationDialog. Also, the padding around theMediaSelectionScreen
is removed, since the NodeCreationDialog already provides sufficient padding.Notes for the future
Editor
-components know, whether they are being rendered inside the NodeCreationDialogAdjust BottomBar for NodeCreationDialog
The BottomBar is positioned in a way that makes it look as if it is part of the dialog.
The grid layout is adjusted, so that each column takes up as much space as is needed, as opposed to the left-most and right-most columns reserving 350px worth of space.
Adjust ListView for NodeCreationDialog
The height of the ListView is adjusted, so that it doesn't overflow the height of the reserved space for secondary editors. Doing so prevents a second scrollbar from appearing when users switch to the ListView.
Adjust App Layout to NodeCreationDialog
The height of the App Layout is calculated in a way that it compensates for the bottom bar and the padding provided by the NodeCreationDialog for secondary editors.
Remove default left padding from Pagination list
To adjust the Pagination list better to a more narrow bottom bar, I removed the default left padding of the
<ol>
:I assumed, that the padding wasn't intentional to begin with, so I put no condition to that. The padding is gone for all cases.
Prevent any media ui action from closing the NodeCreationDialog accidentally
This one's a bit tricky. Basically, Neos.Ui can't actually stack dialogs on top of each other. It happens to work optically, but due to the click-outside handling of the Neos.Ui Dialog Component, each dialog stacked on top of another one will close immediately when interacted with.
I opened an issue in Neos.Ui with some more info: neos/neos-ui#2925
So, the workaround I implemented to address this is probably a little questionable. It adds a custom decorator component for the Neos UI Dialog that sets the attribute
data-ignore_click_outside="true"
on the dialog container, so that it is excluded from click-outside handling. Clicking on the second overlay still closes both dialogs though.This solution is crude and relies on a deprecated ReactDOM-API (
ReactDOM.findDOMNode
to be exact - I had to put aeslint-disable-line
at that as well...). But for the time being, it'll at least make the inner dialogs usable in most cases.Notes for the future
Make AssetPreview compatible with NodeCreationDialog
This addresses two problems:
Notes for the Future
node_modules
toPublic
. Not sure what's the best choice of action here 😅closes: #68