-
Notifications
You must be signed in to change notification settings - Fork 187
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
base: master
Are you sure you want to change the base?
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 <38738725+guidomodarelli@users.noreply.github.com>
…' of https://github.com/wazuh/wazuh-kibana-app into enhancement/6959-extract-common-services-frontend-state
Co-authored-by: Guido Modarelli <38738725+guidomodarelli@users.noreply.github.com>
…to enhancement/6959-extract-common-services-frontend-state
…s for better clarity and type safety in creator.tsx
…type safety in state management functionalities
… robustness in state management functionality
…rror for better clarity in data source alerts handling
…r clearer messages in server host cluster info handling
…larity with explicit Error casting in server host state management
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.
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.
…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.
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