* Create reusable AnalyticsCards component
* Update EngineOverview to use new AnalyticsCards component
* Update Analytics overview with AnalyticsCards + data
* Update QueryDetail with AnalyticsCards + data
* Update Analytics overview with AnalyticsChart + data
- turns out we do need startDate after all for charts, so I added it back to types
* Update QueryDetail with AnalyticsChart + data
* [Polish] Dash click and no result lines to match standalone UI
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add getListeners to Kea test helpers
* Update TelemetryLogic to use new getListeners helper
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] fix users without access to Maps should not have the option to create them
* fix test message
* wrap add geo field trigger in show capabilities check
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove history params
We already replace the history.push functionality with KibanaLogic.values.navigateToUrl but the history object was still being passed around.
* Add org sources container tests
* Add tests for source router
* Clean up leftover history imports
* Add tests for SourcesRouter
* Quick refactor for cleaner existence check
Optional chaining FTW
* Refactor to simplify setInterval logic
This commit does a refactor to move the logic for polling for status to the logic file. In doing this I realized that we were intializing sources in the SourcesView, when we are actually already initializing sources in the components that use this, which are OrganizationSources and PrivateSources, the top-level containers.
Because of this, I was able to remove the useEffect entireley, as the flash messages are cleared between page transitions in Kibana and the initialization of the sources ahppens in the containers.
* Add tests for SourcesView
* Fix type issue
* [Feedback] Move generateEnginePath to its own standalone helper
- instead of living inside EngineLogic.values
- I forgot Kea lets us do this now!
* Update all components using generateEngineRouter to import helper directly
* Add a generatePath engineName helper to EngineLogic
* Create mockEngineValues reusable mock
* Update routes + EngineNav & EngineRouter to include ENGINE_PATH in all urls
- routes: remove get*Route fns in here as all routes should prefer to use generatePath from EngineLogic moving forward
- EngineRouter - add missing canViewEngineDocuments checks
- Engine tests - import base mock values + update tests to point directly at files to work around the auto mock
* Update AnalyticsRouter to use new routes+generatePath
* Update DocumentDetailLogic to use new generatePath
+ Misc cleanup:
- organize imports by shared > AS specific > docs specific
- move delete-specific const's to directly before they're used, since they're only used in one place
- deconstruct KibanaLogic.values
* Update all components using getEngineRoute to use new generatePath
+ misc import order cleanup - prefer shared > specific groupings
* [PR feedback] Change components that override the engineName param to just use default generatePath
* [PR feedback] Rename instances of EngineLogic's generatePath to generateEnginePath
* Add full source mocks
The overview page recieves heavily annotated source data for display. This extends the existing mocks
* Refactor for easier readability
Uses optional chaining. Hide whitespace changes for easier reviewing of this commit
* Remove conditionals
The false case will never be true here because the line above only renders when there is a summary. Around line 109:
```
{!!summary &&
```
* Refactor GroupsSummary to variable
It was challenging to test the null in the original implementation so I refactored to cloer match the way we do this in other places by making the conditional rendering inline, rather than `null` in a function.
* Remove unused const
* Add overview test-subj attrs
* Add overview unit tests
* Add tests for SourceAdded
* Move meta to shared mock
* Add tests for SourceContent
* Add tests for SourceInfoCard
* Move redirect logic from component to logic file
We had this weird callback passing to trigger a redirect and we are already redirecting in the logic file for other things so I simplified this to have the logic file do the redirecting and not have to pass the callback around, which is hard to test and unnecessary complexity.
Also using the KibanaLogic navigateToUrl instead of history.push
# Conflicts:
# x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts
* Add tests for SourceSettings
* Add tests for SourceSubNav
* I am the typo king
🤴🏼Prove me wrong.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix createRequest typing to correctly report errors if incorrect args are passed
+ simplify out generic which was causing problems w/ checking - I'd rather check for unnecessary args than hasValidData, which we're not using much anymore
* Update WS settings routes
* Update WS groups routes
* Update WS sources routes
When something causes an exception in `TaskRunner.markTaskAsRunning()` its execution fails, but this happens before we update the SO, which means that this failure does not count towards the `attempts` on the task. Task Manager will continue to try running this task for ever.
This PR increments the `attempts` when a failure occurs during `TaskRunner.markTaskAsRunning()` to ensure such a task doesn't continue to run to infinity.
Note that this fix will not affect `scheduled` tasks, as they are designed to _ignore_ their `attempts` and run for ever. In such a case this task will continue to consume Task Manager resources until canceled, but these failures will be logged and could be identified when needed.
Cleanup work
1. Replaced naive initialisation of `last_polling_delay`
2. Changes values in `delayOnClaimConflicts` unit tests to make the values less confusing (it was easy to misunderstand the worker count for being the percentage of workers
3. Added comment explaining the usage of modulo