kibana/x-pack/plugins/enterprise_search/common
Constance fd3b3eb8cd
[App Search] Refactor AppLogic to initialize data via props rather than action (#92841)
* [Misc cleanup] Move Access type to common

- it was being duplicated in server/check_access and InitialAppData

+ add mock access data to DEFAULT_INITIAL_APP_DATA
+ update server/ tests to account for access in DEFAULT_INITIAL_APP_DATA

* Update AppSearchConfigured to pass props to AppLogic vs calling initializeAppData

+ update tests to rerender a wrapper rather than doing {...DEFAULT_INITIAL_APP_DATA} repeatedly

* Update AppLogic to set values from props rather than a listener

- main goal of this PR is to prevent the flash of state between mount and initializeX being called

- note: I recommend turning off whitespace changes in the test file

* Update AppLogic typing so that app data is always expected

- which it should be in any case in a production environment

- note: I could have changed InitialAppData to remove the ? optional notation, but decided on this route instead since InitialAppData affects more than just App Search (e.g. server, WS), and I didn't want this to have potential far-reaching side effects

* Update type scenarios where AppLogic values were previously thought potentially undefined

- which is mostly just configuredLimits it looks like

* [PR feedback] Type name
2021-03-02 11:25:01 -08:00
..
__mocks__ [App Search] Refactor AppLogic to initialize data via props rather than action (#92841) 2021-03-02 11:25:01 -08:00
strip_slashes Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
types [App Search] Refactor AppLogic to initialize data via props rather than action (#92841) 2021-03-02 11:25:01 -08:00
constants.ts [App Search] Standardize table pagination logic/UX (#92293) 2021-02-23 10:41:35 -08:00