-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Dashboard] Deangularize Nav Bar #55443
Conversation
232eb7f
to
3fbeb0f
Compare
}; | ||
|
||
private services = this.props.kibana.services; | ||
private savedQueryService = this.services.data.query.savedQueries; | ||
public filterBarRef: Element | null = null; | ||
public filterBarWrapperRef: Element | null = null; | ||
|
||
public static getDerivedStateFromProps(nextProps: SearchBarProps, prevState: State) { |
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 was some very convoluted for updating state from props. I think a simpler version can be done in componentDidUpdate
.
@@ -63,13 +64,14 @@ export function TopNavMenu(props: TopNavMenuProps) { | |||
} | |||
|
|||
function renderLayout() { | |||
const className = props.noPadding ? undefined : 'kbnTopNavMenu'; |
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.
kbnTopNavMenu
has some top/bottom padding:
padding: $euiSizeS 0px $euiSizeXS; |
which, with the new DOM structure, was causing Dashboard in the fullscreen mode to have some empty space between the top of the screen and the first row of visualizations. We need to disable paddings in fullscreen mode.
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 the same problem should exist for visualize?
Can we implement it in the SCSS file in such a way that solves the problem for both?
8380ff8
to
5563f41
Compare
src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx
Outdated
Show resolved
Hide resolved
f58095d
to
cefc85c
Compare
Pinging @elastic/kibana-app (Team:KibanaApp) |
Jenkins, test this |
a4b0a6a
to
103a2f6
Compare
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.
Overall looks good.
There's a small regression with saved queries - on master, loading a saved query immediatelly applies it, while on your PR - you have to click "Update" to apply it.
It's not a blocker for this PR of course, but I would recommend using the default behaviors available in this PR, to delete saved query handling (as well as other default behaviors) from dashboard code.
@@ -490,11 +544,10 @@ export class DashboardAppController { | |||
}, | |||
queryFilter.getGlobalFilters() | |||
); | |||
// Making this method sync broke the updates. | |||
// Temporary fix, until we fix the complex state in this file. | |||
setTimeout(() => { | |||
queryFilter.setFilters(queryFilter.getGlobalFilters()); |
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.
Can you do a replace all of queryFilter
to filterManager
?
@@ -63,13 +64,14 @@ export function TopNavMenu(props: TopNavMenuProps) { | |||
} | |||
|
|||
function renderLayout() { | |||
const className = props.noPadding ? undefined : 'kbnTopNavMenu'; |
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 the same problem should exist for visualize?
Can we implement it in the SCSS file in such a way that solves the problem for both?
Not sure why I can't reply below the comment, but re: Visualize doesn't have fullscreen mode (where we're are hiding the top nav), so I don't think it should be an issue. |
Great catch. Looks like the watcher receives |
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.
@@ -254,6 +258,41 @@ export class DashboardAppController { | |||
}; | |||
}; | |||
|
|||
$scope.showFilterBar = () => |
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.
Do we need to put this on the scope? Seems like it not used anymore from within angular
@@ -441,22 +488,25 @@ export class DashboardAppController { | |||
} | |||
}; | |||
|
|||
$scope.updateQueryAndFetch = function({ query, dateRange }) { |
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.
Same here - seems like this is only used from within react
Fixing type for notifications service Fixing notifications service types Resolving all type errors Removing unnecessary watch Refactoring Do not show menu bar in fullscreen mode Fix flickering on FilterBar popover opening Removing directive from application Update navbar after saving new query Adding missing navbar update Clear query when clearing saved query Cleaning up convoluted search bar logic Fixing typecheck Removing dirty state tampering Renaming history > hashHistory Clear query bar when saved query cleared Fix filterStateManager Update navbar after updating filters Fixing issues after rebase Update dateRange from props Update props from query Replace hashHistory with history Replacing stateless TopNav component with the stateful one Fix type error
103a2f6
to
09a463f
Compare
💛 Build succeeded, but was flaky
History
To update your PR or re-run it, just comment with: |
Hey @lizozom and @flash1293 thanks for reviews. I am going to pause this for now until |
@majagrubic, it might be only my laptop, but it seems to me the rendering is less performant. |
* Clean up discover * Clean up visualize * Clean up dashboard * use-default-behaviors * ts * Discover interval changing * timerange for interval definition in editor * ts * Revert most of changes to dashboard app because of changes in #55443 * Fix spaces * Revert editor to scope PR! * typo * keep savedQuery state in create search bar * update saved query to save it with the state * revert all dashboard changes * saved queries * @kertal code review * fix applying filters from histogram * @Dosant code review * Merge changes from #56643 to handle saved query errors Fix bug where saved query clean does not reset query * change string path * if * Extract useFilterManager and useTimefilter * Split useSavedQuery and restore capability of changing saved query in URL * Added some tests * context view * Remove useMemo * spaces * Support filter intial values Improve useSavedQuery hook in terface Co-authored-by: Elastic Machine <[email protected]>
* Clean up discover * Clean up visualize * Clean up dashboard * use-default-behaviors * ts * Discover interval changing * timerange for interval definition in editor * ts * Revert most of changes to dashboard app because of changes in elastic#55443 * Fix spaces * Revert editor to scope PR! * typo * keep savedQuery state in create search bar * update saved query to save it with the state * revert all dashboard changes * saved queries * @kertal code review * fix applying filters from histogram * @Dosant code review * Merge changes from elastic#56643 to handle saved query errors Fix bug where saved query clean does not reset query * change string path * if * Extract useFilterManager and useTimefilter * Split useSavedQuery and restore capability of changing saved query in URL * Added some tests * context view * Remove useMemo * spaces * Support filter intial values Improve useSavedQuery hook in terface Co-authored-by: Elastic Machine <[email protected]>
* Clean up discover * Clean up visualize * Clean up dashboard * use-default-behaviors * ts * Discover interval changing * timerange for interval definition in editor * ts * Revert most of changes to dashboard app because of changes in #55443 * Fix spaces * Revert editor to scope PR! * typo * keep savedQuery state in create search bar * update saved query to save it with the state * revert all dashboard changes * saved queries * @kertal code review * fix applying filters from histogram * @Dosant code review * Merge changes from #56643 to handle saved query errors Fix bug where saved query clean does not reset query * change string path * if * Extract useFilterManager and useTimefilter * Split useSavedQuery and restore capability of changing saved query in URL * Added some tests * context view * Remove useMemo * spaces * Support filter intial values Improve useSavedQuery hook in terface Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
Removing Angular wrapper around Angular NavBar in Dashboard app. Some refactoring of existing logic to support the new DOM structure.
I've tested this in the following scenarios:
Some additional comments below to help review this
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorialsFor maintainers