Closed jughosta closed 9 months ago
Currently, props from table components are being combined into SearchProps type and they remain optional https://github.com/elastic/kibana/blob/c97d4960bf995671c7053333236ae7ff47fcc7a4/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#L81-L82
SearchProps
and then we try to split them by casting types: https://github.com/elastic/kibana/blob/2bee02ffd088a2f3fd6a74f0b5efadf43a7085b2/src/plugins/discover/public/embeddable/saved_search_embeddable_component.tsx#L35 and https://github.com/elastic/kibana/blob/2bee02ffd088a2f3fd6a74f0b5efadf43a7085b2/src/plugins/discover/public/embeddable/saved_search_embeddable_component.tsx#L42
We can't reply on type casting as it suppresses errors in misconfigured props. We better have stricter type checking to prevent unexpected situations.
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)
Currently, props from table components are being combined into
SearchProps
type and they remain optional https://github.com/elastic/kibana/blob/c97d4960bf995671c7053333236ae7ff47fcc7a4/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#L81-L82and then we try to split them by casting types: https://github.com/elastic/kibana/blob/2bee02ffd088a2f3fd6a74f0b5efadf43a7085b2/src/plugins/discover/public/embeddable/saved_search_embeddable_component.tsx#L35 and https://github.com/elastic/kibana/blob/2bee02ffd088a2f3fd6a74f0b5efadf43a7085b2/src/plugins/discover/public/embeddable/saved_search_embeddable_component.tsx#L42
We can't reply on type casting as it suppresses errors in misconfigured props. We better have stricter type checking to prevent unexpected situations.