-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Add panel flyout] Moving create new to the top of SavedObjectFinder #56428
Conversation
@elasticmachine merge upstream |
Pinging @elastic/kibana-app (Team:KibanaApp) |
498c8ff
to
59d36b6
Compare
@@ -101,14 +109,14 @@ test('selecting embeddable in "Create new ..." list calls createNewEmbeddable()' | |||
}; | |||
const container = new HelloWorldContainer(input, { getEmbeddableFactory } as any); | |||
const onClose = jest.fn(); | |||
const component = mount<AddPanelFlyout>( | |||
const component = mount( |
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'm not super convinced this test is useful anymore. It tests interaction between components, which is what functional tests are better suited for. But leaving it here for now.
@elasticmachine merge upstream |
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.
After merging upstream, and pulling down the changes, the button doesn't do anything.
I'm also really surprised the tests are passing. 🤔
// @ts-ignore | ||
import { findTestSubject } from '@elastic/eui/lib/test'; | ||
|
||
// eslint-disable-next-line | ||
import { coreMock } from '../../../../../../../../core/public/mocks'; | ||
// @ts-ignore |
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 we please remove this // @ts-ignore
and use TypeScript casting instead, if needed.
expect(wrapper.find(EuiPopover).length).toEqual(1); | ||
const menuPanel = wrapper.find(EuiContextMenuPanel); | ||
expect(menuPanel.length).toEqual(1); | ||
// @ts-ignore |
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.
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.
LGTM, it seems to work fine for me.
@lizozom The button should open a popover with a single entry "Visualization" - works on my machine (TM)
@majagrubic I'm not sure whether I like the fact that it opens the popover to the top, as a user I would have expected to open to the bottom. Like this it kind of looks like a tooltip, not like context menu. Just my 2 cents, cc @cchaos
} | ||
|
||
const wrapper = shallow(<SavedObjectFinderCreateNew menuItems={items} />); | ||
expect(wrapper).toMatchSnapshot(); |
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.
Nit: Do we really need the snapshot test here? Seems like the code below is already validating the output quite well.
@flash1293 @majagrubic sorry, it does work. IMO such a menu has to open down, and not up. 👍 on @flash1293 comment |
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 LGTM
Assuming UX + ts issues are addressed
Thanks for making this change, Maja! +1 to opening the popover down. Specifically, Related, can we now add Lens to this menu? |
@ryankeairns Lens is part of the "Visualization" option - if you click it you will get the grid with all visualization types including Lens: I realize this isn't ideal because it adds another click till the user can work on their visualization, +1 for showing Lens in this menu directly. I think that's worth a second PR though. |
@flash1293 of course, my mistake! I agree we should both consider adding it and doing so as a follow up PR. I'll create an issue. |
2e656bb
to
64b36aa
Compare
* Move saved object modal into new platform * Fix TS * Revert "Fix TS" This reverts commit f2f9f5e. * Revert "Move saved object modal into new platform" This reverts commit d0f0ea6. # Conflicts: # src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js * Move save_object_save_modal * Move show_saved_object_save_modal.tsx * Move save_object_finder.tsx * Remove unused export * Pass I18nContext to showSaveModal * Update i18n ids * Fix map save * Refactoring * Load styles * Revert importing styles * Update snapshot * Update snapshot * Structural refactoring * Fix path Co-authored-by: Elastic Machine <[email protected]>
@elasticmachine merge upstream |
bf2a763
to
4e83f58
Compare
Removing faulty rebase imports Fixing unresolved conflict Removing faulty merge files Removing faulty import Readd accidentally added file
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
Thanks for fixing that UI!
Tested and LGTM
* master: (27 commits) Include actions new platform plugin for codeowners (elastic#57252) [APM][docs] 7.6 documentation updates (elastic#57124) Expressions refactor (elastic#54342) [ML] New Platform server shim: update annotation routes to use new platform router (elastic#57067) Remove injected ui app vars from Canvas (elastic#56190) update max_anomaly_score route schema to handle possible undefined values (elastic#57339) [Add panel flyout] Moving create new to the top of SavedObjectFinder (elastic#56428) Add mock of a legacy ui api to re-enable Canvas storybook (elastic#56673) [monitoring] Removes noisy event received log (elastic#57275) Remove use of copied MANAGEMENT_BREADCRUMBS and use `setBreadcrumbs` from management section's mount (elastic#57324) Advanced Settings management app to kibana platform plugin (elastic#56931) [ML] New Platform server shim: update recognize modules routes to use new platform router (elastic#57206) [ML] Fix overall stats for saved search on the Data Visualizer page (elastic#57312) [ML] [NP] Removing ui imports (elastic#56358) [SIEM] Fixes failing Cypress tests (elastic#57202) Create observability CODEOWNERS reference (elastic#57109) fix results service schema (elastic#57217) don't register a wrapper if browser side function exists. (elastic#57196) Ui Actions explorer example (elastic#57006) Fix update alert API to still work when AAD is out of sync (elastic#57039) ...
…56428) (#57360) * [Add panel flyout] Moving create new to the top of SavedObjectFinder * [Add panel flyout] Moving create new to the top of SavedObjectFinder * Fixing failing unit test * Readd missing test * [NP] Move saved object modal into new platform (#56383) * Move saved object modal into new platform * Fix TS * Revert "Fix TS" This reverts commit f2f9f5e. * Revert "Move saved object modal into new platform" This reverts commit d0f0ea6. # Conflicts: # src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js * Move save_object_save_modal * Move show_saved_object_save_modal.tsx * Move save_object_finder.tsx * Remove unused export * Pass I18nContext to showSaveModal * Update i18n ids * Fix map save * Refactoring * Load styles * Revert importing styles * Update snapshot * Update snapshot * Structural refactoring * Fix path Co-authored-by: Elastic Machine <[email protected]> * Applying PR comments Removing faulty rebase imports Fixing unresolved conflict Removing faulty merge files Removing faulty import Readd accidentally added file * Removing unnecessary eslint-ignore Co-authored-by: Maryia Lapata <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Maryia Lapata <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
To draw more attention to the "Create New" button in add panel flyout on the dashboard, we want to move this button from the bottom to the top, as explored in this prototype:
https://www.figma.com/file/EwodWYRUIjbNvYoi9G4Hnh/Lensboard?node-id=611%3A0
This PR removes the footer in the
AddPanelFlyout
and addsCreate New
button as a child ofSavedObjectFinder
component.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