-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add frontend state service #7037
Add frontend state service #7037
Conversation
- Create state service based on AppState from main plugin - Create state containers - server_host - server_host_cluster_info - data_source_alerts - Add documentation for state service
- Remove unused methods: - AppState.setCreatedAt - AppState.getCreatedAt - AppState.getAPISelector - AppState.getPatternSelector - AppState.setPatternSelector (no-effect) - Remove usage of AppState.setPatternSelector because this has no effect in the current application
…bed when the plugin stops - Remove console.log - Dispatch new values when remove from the state containers
plugins/wazuh-core/public/services/state/containers/server-host-cluster-info.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/server-host-cluster-info.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/data-source-alerts.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/server-host-cluster-info.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/data-source-alerts.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/server-host.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/server-host-cluster-info.ts
Outdated
Show resolved
Hide resolved
plugins/wazuh-core/public/services/state/containers/data-source-alerts.ts
Outdated
Show resolved
Hide resolved
…to enhancement/6959-extract-common-services-frontend-state
Co-authored-by: Guido Modarelli <[email protected]>
…' of https://github.com/wazuh/wazuh-kibana-app into enhancement/6959-extract-common-services-frontend-state
Co-authored-by: Guido Modarelli <[email protected]>
…to enhancement/6959-extract-common-services-frontend-state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…to enhancement/6959-extract-common-services-frontend-state
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…to enhancement/6959-extract-common-services-frontend-state
ce72e83
Changes
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🟢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This pull request adds a
state
service to thewazuh-core
plugin and expose it in the plugin lifecycle methods.The
state
service manages the shared state of the Wazuh plugins and it is a HUB of state containers. Features:The state containers provides a mechanism to manage a specific state. For example, some data is stored in cookies, others could be managed in-memory, local storage, session storage.
Others plugins can register new state containers.
The service creates hooks and HOCs that are exposed through the plugin lifecycle.
The
state
services is based onAppState
old service:Issues Resolved
#6959
Check List
yarn test:jest