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

[NP] Move saved object modal into new platform #56383

Merged
merged 23 commits into from
Feb 6, 2020

Conversation

maryia-lapata
Copy link
Contributor

@maryia-lapata maryia-lapata commented Jan 30, 2020

Fixes #55423.

The functionality around the save modal for saved objects was moved into a new NP plugin saved_objects:

  • src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx was removed;
  • src/plugins/kibana_react/public/saved_objects and src/legacy/ui/public/saved_objects/show_saved_object_save_modal.tsx were moved into new plugin src/plgins/saved_objects.

Dev Docs

SavedObjectSaveModal, showSaveModal and SaveResult from ui/saved_objects, and SavedObjectFinderUi, SavedObjectMetaData and OnSaveProps from src/plugins/kibana_react/public were moved to a new plugin src/plugins/saved_objects.

Also now showSaveModal requires the second argument - I18nContext:

import { showSaveModal } from 'src/plugins/saved_objects/public';
...

showSaveModal(saveModal, npStart.core.i18n.Context);

# Conflicts:
#	src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js
This reverts commit f2f9f5e.
This reverts commit d0f0ea6.

# Conflicts:
#	src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js
import { useKibana } from '../context';

// TODO the typings for EuiListGroup are incorrect - maxWidth is missing. This can be removed when the types are adjusted
const FixedEuiListGroup = (EuiListGroup as any) as React.FunctionComponent<
Copy link
Contributor Author

Choose a reason for hiding this comment

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

EuiListGroup already contains maxWidth, so, I think, we can remove the wrapper FixedEuiListGroup.

@@ -0,0 +1 @@
@import './save_modal';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flash1293 I don't see that the styles from src/plugins/saved_objects are imported automatically. Maybe do you know how I can load them?

Copy link
Contributor

Choose a reason for hiding this comment

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

@flash1293 Should be able to help with adding this file to the SASS compiler, but currently this line is wrong. There is no save_modal.scss file in this folder. The import needs to point to the index file within that folder instead.

Suggested change
@import './save_modal';
@import './save_modal/index';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cchaos Nice catch! thanks.
Since styles can't move to the new platform at the moment, I left its import in ui/saved_objects for now.

@maryia-lapata maryia-lapata marked this pull request as ready for review February 3, 2020 12:59
@maryia-lapata maryia-lapata requested a review from a team February 3, 2020 12:59
@maryia-lapata maryia-lapata requested review from a team as code owners February 3, 2020 12:59
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 once green. Can you add a dev doc section about the updated paths to import those?

@maryia-lapata maryia-lapata added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. and removed release_note:skip Skip the PR/issue when compiling release notes labels Feb 4, 2020
@maryia-lapata
Copy link
Contributor Author

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

Tested and overall LGTM.
Added a couple of structural comments.

src/plugins/saved_objects/public/saved_object_finder.tsx Outdated Show resolved Hide resolved
src/plugins/saved_objects/public/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

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

Canvas changes look good 👍 Nice work on this

# Conflicts:
#	src/legacy/core_plugins/visualizations/public/np_ready/public/wizard/search_selection/search_selection.tsx
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@maryia-lapata maryia-lapata merged commit f4f5b04 into elastic:master Feb 6, 2020
@maryia-lapata maryia-lapata deleted the save-object-modal branch February 6, 2020 16:56
maryia-lapata added a commit that referenced this pull request Feb 7, 2020
* 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]>

Co-authored-by: Elastic Machine <[email protected]>
@flash1293 flash1293 added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Feb 10, 2020
@elasticmachine
Copy link
Contributor

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

majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Feb 10, 2020
* 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]>
majagrubic pushed a commit that referenced this pull request Feb 11, 2020
…56428)

* [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]>
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 <[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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:NP Migration Feature:Saved Objects release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. 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.

Move saved object modal into new platform
9 participants