-
Notifications
You must be signed in to change notification settings - Fork 263
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
Create filters side panel for Nautobot 2.0 UI #3983
Create filters side panel for Nautobot 2.0 UI #3983
Conversation
<FiltersPanelContextProvider> | ||
<Layout> | ||
<NautobotRouter /> | ||
</Layout> | ||
</FiltersPanelContextProvider> |
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.
It feels inelegant to me that we are adding functionality that should be exclusive to the object-list view at this basic level of the UI. Is there any cleaner way to do this?
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.
Although it is exclusive to the object list view, filters panel is at the same time an upper-level layout element, which is actually higher in the node hierarchy than the object list view itself. It would be either required to restructure the root layout of the application, or filters panel, to make the two (object list view and filters panel) coupled more tightly. I'm not insisting on this implementation though, just pointing out that we would need to change some of the requirements in order to do so
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.
Would it make logical to provide a placeholder (GlobalState, CreateContext, etc.) so that each page can override it as needed?
The buttons that should be placed in the placeholder may then be provided by ObjectListView.
</NautobotGrid> | ||
</Box> | ||
|
||
<FiltersPanelContainer /> |
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.
Similarly, shouldn't this be only in ObjectList.js
rather than in GenericView.js
?
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.
ObjectList
view is lower in the tree structure, which rules out the possibility of filters panel to be a part of it. How I see it - currently the layout consists of these 4 fundamental elements: header, sidebar, main content and filters panel. So if we want to shuffle them, we need to change the root layout. Perhaps it would be a good idea, since you said filters panel is going to be used only on object list view anyway, but at the same time for now it is designed to be a top level layout element and if that needs to change, then let's do it outside of scope of this PR
I was initially asked to do a similar panel that Nautobot Cloud already has, but if you need something else, I'm happy to help. Just need to have a clear view on what does it have to look and beahve like. |
I think it's good as is, just needs an implementation review. Do you mind fixing the merge conflict? |
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.
Pulled it down and looks good!
What's Changed
The new Nautobot 2.0 UI gets filters side panel. Its title and conent are empty by default and have to be supplied with
title
andcontent
parameters touseFiltersPanel
hook. Optionally,useFiltersPanel
also acceptsid
parameter, which will be generated automatically if not given explicitly. The hook API is as follows:TODO
FiltersPanelContext
andFiltersPanelContextProvider
to manage filter panels in the UI applicationFiltersPanel
andFiltersPanelContainer
UI components for visual representationuseFiltersPanel
as well asuseFiltersPanelContext
as user-friendly API for the components aboveFiltersPanelContainer
component insideGenericView