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

Decouples saved objects management from legacy saved objects loaders #113031

Merged

Conversation

TinaHeiligers
Copy link
Contributor

Resolves #67607
The saved objects management plugin no longer supports legacy imports and the edit view has changed to a read-only view.

This PR handles the tech debt of removing the dependency on the loaders completely.

Checklist

For maintainers

@TinaHeiligers TinaHeiligers added Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes v8.0.0 backport:skip This commit does not require backporting labels Sep 23, 2021
@TinaHeiligers TinaHeiligers marked this pull request as ready for review September 23, 2021 21:43
@TinaHeiligers TinaHeiligers requested a review from a team as a code owner September 23, 2021 21:43
@@ -8,7 +8,6 @@

export { fetchExportByTypeAndSearch } from './fetch_export_by_type_and_search';
export { fetchExportObjects } from './fetch_export_objects';
export { canViewInApp } from './in_app_url';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced by class method in #112034

@@ -24,6 +23,5 @@ export { getDefaultTitle } from './get_default_title';
export { findObjects } from './find_objects';
export { bulkGetObjects } from './bulk_get_objects';
export { extractExportDetails, SavedObjectsExportResultDetails } from './extract_export_details';
export { createFieldList } from './create_field_list';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer used

import { getAllowedTypes } from './../lib';

interface MountParams {
core: CoreSetup<StartDependencies, SavedObjectsManagementPluginStart>;
serviceRegistry: ISavedObjectsManagementServiceRegistry;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use the raw saved objects directly now and don't need the client-side registry.

@@ -32,7 +32,6 @@ describe('Relationships', () => {
id: '1',
relationship: 'parent',
meta: {
editUrl: '/management/kibana/objects/savedSearches/1',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed these in #112034

@@ -80,8 +69,7 @@ export class SavedObjectsManagementPlugin
defaultMessage: 'Saved Objects',
}),
description: i18n.translate('savedObjectsManagement.objects.savedObjectsDescription', {
defaultMessage:
'Import, export, and manage your saved searches, visualizations, and dashboards.',
defaultMessage: 'Import, export, and manage your saved objects.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We support all registered saved object types and aren't restricted to those using the loaders anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to delete the key from the translation files for it to be picked for re-translation

{ "path": "../home/tsconfig.json" },
{ "path": "../kibana_react/tsconfig.json" },
{ "path": "../management/tsconfig.json" },
{ "path": "../visualizations/tsconfig.json" },
{ "path": "../saved_objects_tagging_oss/tsconfig.json" },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were indirectly inheriting the saved_objects_tagging_oss types from the visualizations plugin. With the visualizations dependency gone, we need to declare it explicitly.

Copy link
Contributor Author

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

self review

@TinaHeiligers
Copy link
Contributor Author

FYI @flash1293

@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -8,7 +8,7 @@
"server": true,
"ui": true,
"requiredPlugins": ["management", "data"],
"optionalPlugins": ["dashboard", "visualizations", "discover", "home", "savedObjectsTaggingOss", "spaces"],
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@@ -80,8 +69,7 @@ export class SavedObjectsManagementPlugin
defaultMessage: 'Saved Objects',
}),
description: i18n.translate('savedObjectsManagement.objects.savedObjectsDescription', {
defaultMessage:
'Import, export, and manage your saved searches, visualizations, and dashboards.',
defaultMessage: 'Import, export, and manage your saved objects.',
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to delete the key from the translation files for it to be picked for re-translation

Comment on lines 9 to 15
export interface ObjectField {
type: FieldType;
name: string;
value: any;
}

export type FieldType = 'text' | 'number' | 'boolean' | 'array' | 'json';
Copy link
Contributor

Choose a reason for hiding this comment

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

From a quick grep, I think ObjectField and FieldType are also no longer used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! This also means we can delete the whole file 😄

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) September 27, 2021 15:40
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
savedObjectsManagement 95 91 -4

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
savedObjectsManagement 91 85 -6

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
savedObjectsManagement 83.7KB 83.6KB -54.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
savedObjectsManagement 18.4KB 15.8KB -2.6KB
Unknown metric groups

API count

id before after diff
savedObjectsManagement 104 98 -6

References to deprecated APIs

id before after diff
savedObjectsManagement 27 17 -10

History

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

@TinaHeiligers TinaHeiligers merged commit 96379a5 into elastic:master Sep 27, 2021
@TinaHeiligers TinaHeiligers deleted the so-management/decouple-loaders branch September 27, 2021 17:37
lykkin pushed a commit to lykkin/kibana that referenced this pull request Sep 28, 2021
…lastic#113031)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decouple saved object management from SavedObjectLoader
3 participants