Open drewdaemon opened 7 months ago
Pinging @elastic/kibana-visualizations (Team:Visualizations)
Pinging @elastic/kibana-presentation (Team:Presentation)
Pinging @elastic/appex-sharedux (Team:SharedUX)
it's an effort in and of itself.
@drewdaemon can you give some context on this? Do you know the LOE of this task?
@tsullivan I'm not sure on LOE. I don't think it's too bad, mostly splitting the interface into a client-side and a server-side version and importing them in the correct places.
It's just a typing inconsistency I noticed. I had to add a bunch of conditionals to check that "managed" was defined on the client when really it is always defined, the type just suggests that it isn't.
The root saved object
managed
prop is declared as optional in core's server-side types to allow core to set the default offalse
.https://github.com/elastic/kibana/blob/main/packages/core/saved-objects/core-saved-objects-common/src/server_types.ts#L111
However, by the time the SO is retrieved from the API,
managed
will always be present. But, we have allowed the optional nature of the saved object type to permeate both content management server code and Kibana client code.https://github.com/elastic/kibana/blob/main/packages/kbn-content-management-utils/src/types.ts#L203
We should update the types to accurately depict the fact that
managed
is always present once a saved object is retrieved. I started down this path in https://github.com/elastic/kibana/pull/175062, but it's an effort in and of itself.