kibana/x-pack/plugins/enterprise_search/common
Constance 034d76ef1e
[App Search] Hydrate AppLogic with more initial data, + set up role abilities & wrap routes/navigation in checks (#77693)
* [Setup] Fix onboarding var name

- I camelCased too hard 🤦‍♀️ should be just onboardingComplete per ent-search code

* [Cleanup] Remove role.ability.destroy array

- This was only being used for 'session'/canDestroySession, which no longer applies in a Kibana world
- The destroy property still remains in the API endpoint, but will be ignored/unused by our front-end (similar to the defunct `roles: {}` obj)

* Hydrate AppLogic with more app-wide data

- namely: account, myRole, configuredLimits, and ilmEnabled
- also port over setOnboardingComplete action because it's fairly small and will be used

- role/myRole changes:
  - This is a fairly opinionated change - open to thoughts!
  - Ditch the Role()/Ability() classes and useAbilities() hook in favor of just storing that data from the get-go in myRole
  - Remove unused fns from myRole (mostly those around the role obj, which is now always empty in SMAS)

- Type updates:
  - Move IRole to client-side only, and to describe the myRole value
  - IAccount.role should now only describe role data coming from the server-side

* Wrap App Search routes/navigation in ability checks

* Fix merged test

* PR feedback: Move myRole transformation to its own file

- Turns out Kea may or may not have been squashing some type errors! Moving to a separate file helped catch some type issues

* [Opinion] Move role-related types to role file

- Open to debate on this one, but it feels like it makes sense to keep all role related types in the same area.

+ keep export in main ./types file for convenience

* Product feedback: Remove canViewEngines

- there shouldn't be a scenario where a user isn't able to access any engines but can access the rest of the product

* Misc PR feedback

* Typescript feedback: use partials to account for default state

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-21 10:40:16 -07:00
..
__mocks__ [App Search] Hydrate AppLogic with more initial data, + set up role abilities & wrap routes/navigation in checks (#77693) 2020-09-21 10:40:16 -07:00
strip_trailing_slash
types [App Search] Hydrate AppLogic with more initial data, + set up role abilities & wrap routes/navigation in checks (#77693) 2020-09-21 10:40:16 -07:00
constants.ts [Enterprise Search] Add read-only mode interceptor and error handler (#77569) 2020-09-17 08:43:40 -07:00
version.ts [Enterprise Search] Add Workplace Search side navigation (#74894) 2020-08-14 15:28:34 -05:00