elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.73k stars 8.14k forks source link

[ENDPOINT][TECH DEBT] Unify Redux data structures for deletion request and creation request state #80138

Open efreeti opened 3 years ago

efreeti commented 3 years ago

The AsyncResourceState (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/management/pages/trusted_apps/state/async_resource_state.ts#L85) data structure was specifically designed for the purposes to represent async communication with remote server (whether you get data or post/put/delete data). It was used in all parts of trusted apps store except create request (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/management/pages/trusted_apps/state/trusted_apps_list_page_state.ts#L63). The data structures used for that seem to be of the same shape, so duplication seems to be redundant here. It would also be good to be consistent in this aspect.

elasticmachine commented 3 years ago

Pinging @elastic/endpoint-management (Team:Endpoint Management)

paul-tavares commented 3 years ago

I'm ok with this refactoring. Personally, I find the duplication in this case cleaner and code clearer to read than to crawl all of the generic types - but that is a personal preference.