Skip to content

Conversation

@kertal
Copy link
Member

@kertal kertal commented Nov 25, 2019

Summary

Part of #46435

This PR migrates ui/saved_objects code to typescript, deangularizes it, converts to usage of native Promises and async/await, makes use of new platform services. Furthermore it extracts functions of the migrated saved_object.js, now saved_object.ts, that make the move to a new platform migrated service easier, the code more modular.

There's now an alternative to

import { SavedObjectProvider } from 'ui/saved_objects/saved_object';	

New:

import { createSavedObjectClass } from 'ui/saved_objects/saved_object';

It's now used in Discover, and will make the use of the 'global' Angular redundant (#49483).

Checklist

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

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately

@elasticmachine
Copy link
Contributor

💔 Build Failed

@kertal
Copy link
Member Author

kertal commented Nov 25, 2019

Jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@kertal kertal force-pushed the kertal-pr-2019-11-22-np-saved-object branch from 48be33a to e24bc6b Compare November 25, 2019 11:30
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@kertal kertal self-assigned this Nov 26, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kertal kertal changed the title New platform saved object migration Migrate saved object to typescript Nov 27, 2019
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Overall code LGTM, with the caveat that I don't have a ton of expertise on this area of Kibana. Might be worth getting another opinion before merging.

There's still plenty that will need to be done here to prep for NP migration, but I'm assuming you are intentionally keeping the scope of this PR to TypeScript, so I mainly focused on those areas.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@kertal kertal requested a review from a team December 10, 2019 12:41
@kertal kertal requested a review from flash1293 December 11, 2019 10:00
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 besides some small nits

}

export async function buildGlobalAngularServices() {
const injector = await chromeLegacy.dangerouslyGetActiveInjector();
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

public static fieldOrder = ['title', 'description'];
public static searchSource = true;

public id: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Those can be removed now because they are already defined in the base type

Copy link
Member Author

Choose a reason for hiding this comment

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

I adapted this change, since it makes sense, but had to revert, because for some reason inheritance doesn't work in this case (Functional tests were failing). could be because we don't inherit directly but generate the Class to inherit from. A pattern we should and will change.

return savedObject;
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
Copy link
Contributor

Choose a reason for hiding this comment

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

console log for debugging?

Copy link
Member Author

Choose a reason for hiding this comment

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

life saving during development, but now redundant! thx! removed

@bhavyarm
Copy link
Contributor

@kertal How do I test this PR please? Thanks!

@kertal
Copy link
Member Author

kertal commented Jan 29, 2020

@bhavyarm loading and saving saved searches, visualization, dashboard + timelion app. Also trying to edit these saved objects in management

@kibanamachine
Copy link
Contributor

💔 Build Failed

History

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

@elastic elastic deleted a comment from elasticmachine Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:NP Migration release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.6.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants