Skip to content
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

Merged
merged 7 commits into from
Feb 11, 2020

Conversation

majagrubic
Copy link
Contributor

@majagrubic majagrubic commented Jan 30, 2020

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 adds Create New button as a child of SavedObjectFinder component.

Screenshot 2020-01-31 at 10 12 47

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic majagrubic marked this pull request as ready for review January 31, 2020 20:02
@majagrubic majagrubic requested a review from a team as a code owner January 31, 2020 20:02
@majagrubic majagrubic added v8.0.0 v7.6.0 v7.7.0 release_note:roadmap Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed v7.6.0 labels Jan 31, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@majagrubic majagrubic requested a review from a team January 31, 2020 20:03
@majagrubic majagrubic force-pushed the add-flyout branch 2 times, most recently from 498c8ff to 59d36b6 Compare January 31, 2020 21:54
@@ -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(
Copy link
Contributor Author

@majagrubic majagrubic Jan 31, 2020

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.

@lizozom
Copy link
Contributor

lizozom commented Feb 2, 2020

@elasticmachine merge upstream

Copy link
Contributor

@lizozom lizozom left a 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

@flash1293 flash1293 left a 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)
Screenshot 2020-02-03 at 12 02 24

@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();
Copy link
Contributor

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.

@lizozom
Copy link
Contributor

lizozom commented Feb 3, 2020

@flash1293 @majagrubic sorry, it does work.
Testing this, I actually didn't realize this was the menu!
I thought it was just a tooltip, especially with the arrow pointing down on the button.

IMO such a menu has to open down, and not up. 👍 on @flash1293 comment

@ryankeairns

Copy link
Contributor

@lizozom lizozom left a 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

@ryankeairns
Copy link
Contributor

Thanks for making this change, Maja!

+1 to opening the popover down. Specifically, anchorPosition="downRight" since this is along the right edge of the screen.

Related, can we now add Lens to this menu?

@flash1293
Copy link
Contributor

@ryankeairns Lens is part of the "Visualization" option - if you click it you will get the grid with all visualization types including Lens:
Screenshot 2020-02-03 at 16 57 22

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.

@ryankeairns
Copy link
Contributor

ryankeairns commented Feb 3, 2020

@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.

@majagrubic majagrubic requested review from a team as code owners February 10, 2020 10:36
Maja Grubic and others added 5 commits February 10, 2020 10:52
* 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 <elasticmachine@users.noreply.github.com>
@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic majagrubic force-pushed the add-flyout branch 2 times, most recently from bf2a763 to 4e83f58 Compare February 10, 2020 11:23
Maja Grubic added 2 commits February 10, 2020 11:24
Removing faulty rebase imports

Fixing unresolved conflict

Removing faulty merge files

Removing faulty import

Readd accidentally added file
@majagrubic
Copy link
Contributor Author

majagrubic commented Feb 10, 2020

Thanks everyone. I've addressed your comments and fixed the popup.
Screenshot 2020-02-10 at 10 14 50

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@lizozom lizozom left a 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

@majagrubic majagrubic merged commit 7b6db2a into elastic:master Feb 11, 2020
@majagrubic majagrubic deleted the add-flyout branch February 11, 2020 18:10
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 11, 2020
* 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)
  ...
majagrubic pushed a commit that referenced this pull request Feb 12, 2020
…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 <elasticmachine@users.noreply.github.com>

* 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 <mary.lopato@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Maryia Lapata <mary.lopato@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants