Some maintenance and minor fixes to state containers based on experience while working with them in #53582
Patch unit tests to use current "terminology" (e.g. "transition" vs "mutation")
Fix docs where "store" was used instead of "state container"
Allow to create state container without transition.
Fix freeze function to deeply freeze objects.
Restrict State to BaseState with extends object.
in set() function, make sure the flow goes through dispatch to make sure middleware see this update
Improve type inference for useTransition()
Improve type inference for createStateContainer().
Other issues noticed, but didn't fix in reasonable time:
Can't use addMiddleware without explicit type casting #54438
Transitions and Selectors allow any state, not bind to container's state #54439
* add unimplemented registerAppStatusUpdater & remove observers for apps and legacyApps
* adapt NavLinksService to use new application observables
* merge availableApps$ and availableLegacyApps$
* updating core docs
* adapt the navLink updating methods
* filters the inaccessible apps from availableApps$
* restrict access to navigateToApp depending on app status
* fixes due to merge
* add statusUpdater$ to AppBase
* export new types
* disable navlink depending on app status
* update generated doc
* update snapshots for disabled prop
* Address josh review
* Address review comments
* fix merge conflicts
* adapt changes due to merge
* update generated doc
* add comment and fix navlink url for custom url apps
* add AppNavLinkStatus type to split app/navlink states
* fix typo
* review comments and improvements
* add functional tests
* update generated docs and migration guide
* fix wrong type cast on AppsMenuProvider.readLinks
* properly type return of navigateToApp
* Initial role mappings UI
* apply design edits
* address PR feedback
* fix type cast for number field
* Update x-pack/legacy/plugins/security/public/views/management/role_mappings/edit_role_mapping/components/mapping_info_panel/mapping_info_panel.tsx
Co-Authored-By: Joe Portner <5295965+jportner@users.noreply.github.com>
* Cleanup FTR configuration, and handle role mapping 404 errors properly
* align naming of role mappings feature check
* Apply suggestions from code review
Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>
* add missing test assertions
* inlining feature check logic
* switch to using snapshot
* use href instead of onClick
* adding delete unit test
* consolidate href building
* unify page load error handling
* simplify initial loading state
* documenting unconditional catch blocks
* use nodes.info instead of transport.request
* Apply suggestions from code review
Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>
* move model out of LP into NP
* convert except_field_rule to except_any_rule
* docs, take 1
* update gif
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* allow read only user with no CRUD
* use ../../lib/kibana
* fix timeline-template
* add re-routing on page
* bug
* cleanup
* review I
* review II
* a pretty shameful bug I will live thanks Frank
* bug select rule
* only activate deactivate if user has the manage permission
* add permissions rule with manage api key
* bug on batch action for rules
* add permissions to write status on signal
* Added repository cleanup button. Added logic for spinner while loading, added new repository request, type and telemetry metric.
* Added additional bindings for server side to hit the cleanup endpoint.
* fix cleanup request
* Added data test subject to the code editors to differentiate them and fixed a broken inport of RepositoryCleanup.
* Added files for a component integration test. The tests are failing right now so we need to get those green. Added a functional test. Need to set up kbn-es to be able to set up a file repository before being able to run the functional tests.
* Added change to the way data-test-subjects were created for the repository list table so that columns can be individually identified. Added functional test to allow checking the details of repositories.
* Removed the jest tests for repository details until we get jest fixed.
* Fixed jest test to reflect updated test subjects.
* Made changes per feedback in PR comments.
* Fixed i10n issues using <FormattedMessage>. Removed reference to blueBird and used Promise.all(). Fixed all nits in PR comments.
* Added i10n fixes for header.
* Added i10n fixes for header.
* Added name parameter for i18n strings.
* Removed i18n string from JSON.stringify call since it's already a string.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
* wip
* update timelien select to design
* Rename label to design
Timeline Select match design with favorite
Now, you are able to add mutiple items for url and false positive
Add tm for Mitre Att&ck (tnaks Frank)
And match mitre selection to design
* cleanup with michael
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* share specific instances of some ui packages
* remove unnecessary eslint changes, every package will define deps anyway
* remove mentions of moment webpackShims in eslint resolver
* remove use of lodash
* list angular as dep for x-pack
* add operations as codeowner of shared-deps pkg
* [APM] Delay rendering invalid license notification
Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either).
* Show UI if license has not loaded
* converting mocha tests to jest
* adding a few lib tests
* adding more lib tests
* moving test files and adding autocomplete tests
* updating test definition
* fixing import and test definitions
* For the nodes listing page, do not fetch shard data for indices
* Optimize our shard queries for the index and node listing pages
* This change isn't necessary
* Rename file and function
* Use optimized query for ml jobs and es overview
* Apply to node/index detail page, and more renaming
* Unnecessary change
* Fix tests
* Add basic tests
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Fix Watcher regression in which a threshold watch's termOrder and hasTermsAgg properties weren't being passed to the serializeThresholdWatch function.
* Remove unused upstreamJson getter method from server models.
* Finish implementing snapshot count redux code.
* Replace GQL-powered Snapshot export with Redux/Rest-powered version.
* Add tests for Snapshot API call.
* Rename new test file from tsx to ts, it has no JSX.
* Rename outdated snapshot file.
* Update filter groups to use redux and add tags dropdown.
* Delete obsolete graphql filter bar query.
* Add fetch effect factory.
* Use generic fetch effect factory to avoid code redundancy.
* Infer isDisabled status from data for filter group buttons and disable when there are no items.
* Fix removal of overview filter from previous rebase.
* Rename generator-related functions from *saga to *effect.
* WIP trying to make filters filterable.
* WIP cleaning up.
* Delete obsolete API test.
* Add API test for filters endpoint.
* Remove obsolete fields from overview filters.
* Add functional testing attributes and delete a comment for filter popover.
* Update obsolete unit test snapshots and test props for filter popover.
* Fix broken types and delete obsolete test snapshots for filters api call.
* Modify filters endpoint to adhere to np routing contracts.
* Add functional test and associated helper functions for filters API.
* Remove obsolete resolver function for filter bar.
* Remove obsolete FilterBar type from graphql schema.
* Delete static types generated for obsolete GQL schema types.
* Delete obsolete fields from default filters state.
* Delete obsolete method from graphql schema.
* Add default values to unit test that requires complete app state mock.
* Extract helper logic to dedicated module.
* Finish working on adapter/helper tests.
* Add state field for overview page search query.
* Apply search kuery to filters.
* Simplify creation of overview filter fetch actions and API call.
* Add tests for overview filter action creators.
* Simplify api query parameterizaton.
* Improve a variable name.
* Update formatting of file.
* Improve a variable name.
* Improve a variable name.
* Simplify API endpoint typing.
* Clean up helper code and rename some functions/vars.
* Clean up parameterization of filter values.
* Move function from dedicated file back to calling file.
* Clean up naming in a function.
* Move function from dedicated file to caller's file.
* Modify interface of function return value.
* Have function throw error when it receives invalid input instead of returning empty object.
* Extract constant value to dedicated function value and remove parameter from function.
* Clean up object declarations.
* Rename a property.
* Fix issue where function was not handling empty input.
* Delete unnecessary snapshots.
* Add message to internal server error response.
* Fix broken type.
* Delete type that was added as a result of a merge error.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Adding placeholder for functionbeat telemetry in test fixture
* Adding placeholder for functionbeat telemetry expectation
* Adding placeholder for aggregating functionbeat telemetry per cluster
* Update test + fixture
* Updating code
Today, apps rely on AppState and GlobalState in the ui/state_management module to deal with internal (app) and shared (global) state. These classes give apps an ability to read/write state, when is then synced to the URL as well as sessionStorage. They also react to changes in the URL and automatically update state & emit events when changes occur.
This PR introduces new state synching utilities, which together with state containers src/plugins/kibana_utils/public/state_containers will be a replacement for AppState and GlobalState in New Platform.
* [ML] Display anomaly actual in chart tooltip when model plot enabled
* [ML] Fixes translations for chart tooltip fixes
* [ML] Edits to chart tooltip div following review
* add onAppLeave to AppMountParameters
* adapt legacy shims of app mount
* update generated doc
* returns properly typed AppLeaveAction from leave handler instead of raw strings
* add openConfirm to modal service and use it instead of window.confirm
* fix unit test
* update querystringinput snapshots
* add integration tests
* nits and review comments
* add functional tests
* Added max tree depth guard
Removed recursive normalizeTimes functions (one fewer iteration through the entire data structure)
Optimizied appliation of tree mutations by taking `if` out of tight loop
Cleaned up types
* Tidy up data being passed into store (and through immer)
* Fix max tree depth logic
* Remove immer from non-test code.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>