-
Notifications
You must be signed in to change notification settings - Fork 176
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
Replace search bar on Management > Groups #5445
Replace search bar on Management > Groups #5445
Conversation
Features: - Supports multiple query languages - Decouple the business logic of query languages of the search bar component - Ability of query language to interact with the search bar Query language implementations - AQL: custom implementation of the Wazuh Query Language. Include suggestions. - UIQL: simple implementation (as another example)
…ression used in the Wazuh manager API - Change the implementation of AQL query language to use the regular expression decomposition defined in the Wazuh manager API - Adapt the tests for the tokenizer and getting the suggestions - Enchance documentation of search bar - Add documentation of AQL query language - Add more fields and values for the use example in Agents section - Add description to the query language select input
…using the Search suggestion in AQL - Fixes a problem hidding the suggestion popover when using the Search suggestion in AQL - Fixes a problem of input text with undefined value - Minor fixes - Remove `syntax` property of SearchBar component - Add disableFocusTrap property to the custom EuiSuggestInput component to be forwarded to the EuiInputPopover - Replace the inputRef by a reference instead of a state and pass as a parameter in the query language run function - Move the rebuiding of input text when using some suggestion that changes the input to be done when a related suggestion was clicked instead of any suggestion (exclude Search).
implemenation - Add the ability to update the input of the search bar in the example implementation - Enhance the component documentation
- (AQL) Add the fields and an open operator group when there is no input text
link of query language displayed in the popover
- AQL enhancements: - documentation: - Enhance some descriptions - Enhance input processing - Remove intermetiate interface of EuiSuggestItem - Remove the intermediate interface of EuiSuggestItem. Now it is managed in the internal of query language instead of be built by the suggestion handler - Display suggestions when the input text is empty - Add the unifiedQuery field to the query language output - Adapt tests - Search Bar component: - Enhance documentation
- Remove UIQL - Add HAQL query language that is a high-level implementation of AQL - Add the query language interface - Add tests for tokenizer, get suggestions and transformSpecificQLToUnifiedQL method - Add documentation about the language - Syntax - Options - Workflow
- Add tests to HAQL and AQL query languages - Fix suggestions for HAQL when typing as first element a value entity. Now there are no suggestions because the field and operator_compare are missing. - Enhance documentation of HAQL and AQL - Removed unnecesary returns of suggestion handler in the example implementation of search bar on Agents section
- Rename query language HAQL to WQL - Update tests - Remove AQL usage from the implementation in the agents section
- Add more use cases to the test of WQL query language - Replace some literals by constants in the WQL query language implementation
…platform search bar
… is an implicit query
- WQL - add implicit query mode to WQL - enhance query language documentation - renamed transformUnifiedQuery to transformUQLToQL - now wraps the user input if this is defined and there a implicit query string - fix a problem with the value suggestions if there is a previous conjunction - add tests cases - update tests - AQL - enhance query language documentation - renamed transformUnifiedQuery to transformUQLToQL - add warning about the query language implementation is not updated to the last changes in the search bar component - update tests - Search Bar - renamed transformUnifiedQuery to transformUQLToQL
- Set a width for the syntax options popover - Unify the description in the suggestions of WQL example implementation - Update tests - Fix minor bugs in the WQL example implementation in Agents
- WQL - Enhance documentation - Add partial and "expanded" input validation - Add tests
…feat/4312-poc-search-bar-component-multiple-query-language-api-query-language-implementation
Fix an error when the last token in the input was a value and used a value suggestion whose label contains whitespaces, the value was not wrapped with quotes.
…uery-language-api-query-language-implementation
…uery-language-api-query-language-implementation
…the onChange handler
…earch term fields changed - Search bar: - Add a dependency to run the query language output - Adapt search bar documentation to the changes - WQL - Create a new parameter called `options` - Moved the `implicitFilter` and `searchTerm` settings to `options` - Update tests - Update documentation
⚫: none UI
Details 🟢 Management > Groups: For each suggested field, check the value suggestion display results or at least doesn't breakSafari - ⚫ 🟢 Management > Groups: Using a value suggested should allow to run the search🟢 Management > Groups: Type a term and run the search should search in each displayed fieldSafari - ⚫ 🟢 Management > Groups: Type a simple field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups: Type a complex field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups: Clicking on the Refresh button should refresh the dataChrome - 🟢 Firefox - 🟢 Safari - ⚫ 🟢 Management > Groups: Clicking on the Export formatted button should refresh export the data to CSVSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: For each suggested field, check the value suggestion display results or at least doesn't breakSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Using a value suggested should allow to run the searchSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Type a term and run the search should search in each displayed fieldBy default the agent
The field Firefox - 🟢 🟢 Management > Groups > {group_name} > Agents: Type a simple field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Type a complex field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Clicking on the Refresh button should refresh the dataChrome - 🟢 Firefox - 🟢 Safari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Clicking on the Export formatted button should refresh export the data to CSVSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: For each suggested field, check the value suggestion display results or at least doesn't breakSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Using a value suggested should allow to run the searchSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Type a term and run the search should search in each displayed fieldSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Type a simple field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Type a complex field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Clicking on the Refresh button should refresh the dataChrome - 🟢 Firefox - 🟢 Safari - ⚫ |
⚫: none UI
Details 🟢 Management > Groups: For each suggested field, check the value suggestion display results or at least doesn't breakSafari - ⚫ 🟢 Management > Groups: Using a value suggested should allow to run the searchSafari - ⚫ 🟢 Management > Groups: Type a term and run the search should search in each displayed fieldSafari - ⚫ 🟢 Management > Groups: Type a simple field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups: Type a complex field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups: Clicking on the Refresh button should refresh the dataSafari - ⚫ 🟢 Management > Groups: Clicking on the Export formatted button should refresh export the data to CSVSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: For each suggested field, check the value suggestion display results or at least doesn't breakSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Using a value suggested should allow to run the searchSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Type a term and run the search should search in each displayed fieldSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Type a simple field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Type a complex field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Clicking on the Refresh button should refresh the dataChrome - 🟢 Firefox - 🟢 Safari - ⚫ 🟢 Management > Groups > {group_name} > Agents: Clicking on the Export formatted button should refresh export the data to CSVSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: For each suggested field, check the value suggestion display results or at least doesn't breakSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Using a value suggested should allow to run the searchSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Type a term and run the search should search in each displayed fieldSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Type a simple field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Type a complex field search and this should returns the expected resultsSafari - ⚫ 🟢 Management > Groups > {group_name} > Files: Clicking on the Refresh button should refresh the dataChrome -🟢 Firefox - 🟢 Safari - ⚫ |
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.
TEST:✔️
CR:✔️
LGTM
…hub.com/wazuh/wazuh-kibana-app into feat/4312-search-bar-replace-management-groups
… input is analyzed due to this process is debounced
…hub.com/wazuh/wazuh-kibana-app into feat/4312-search-bar-replace-management-groups
…hub.com/wazuh/wazuh-kibana-app into feat/4312-search-bar-replace-management-groups
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.
Running a query without specific terms inside <group_name>/agents
is not correctly searching on the field os.name
…hub.com/wazuh/wazuh-kibana-app into feat/4312-search-bar-replace-management-groups
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
…o feat/4312-search-bar-replace-management-groups
|
Description
This pull request replaces the search bar and table components with TableWzAPI on Management > Groups
Affected sections:
Issues Resolved
#4312
Evidence
Management/Groups
![image](https://private-user-images.githubusercontent.com/34042064/238331896-26c31b1b-ce60-4ff1-9fb5-ebded91e4175.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5MDU3MjYsIm5iZiI6MTcyNDkwNTQyNiwicGF0aCI6Ii8zNDA0MjA2NC8yMzgzMzE4OTYtMjZjMzFiMWItY2U2MC00ZmYxLTlmYjUtZWJkZWQ5MWU0MTc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI5VDA0MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5ZWMwZWY0M2M1NWFkNWY5N2U0ZGRiZTAxYTllYmJjOTZlOTZhOTI3YTkyNmYxMTVhMjlkM2JiZmNhNWEzMjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xkCMqLYKVouwuixaU5IK83d5Cl8-SD7j-9AGeE02FKY)
![image](https://private-user-images.githubusercontent.com/34042064/238331970-0a7deee8-215f-4848-b055-832a8f02082e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5MDU3MjYsIm5iZiI6MTcyNDkwNTQyNiwicGF0aCI6Ii8zNDA0MjA2NC8yMzgzMzE5NzAtMGE3ZGVlZTgtMjE1Zi00ODQ4LWIwNTUtODMyYThmMDIwODJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI5VDA0MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkxNTNmNWFmOGJhZTQ0YzljNWFlNzU2ZjdjNDk3Njc0MzczMjRjY2E3NThkNDQ2MDUxOGZiYTMzNjk3ZjAzYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.AdJM9QW4o_VSi7ipwhJ80PtyVbpKtADmZ4rtoYqUDO8)
Management/Groups/Group/Agents
![image](https://private-user-images.githubusercontent.com/34042064/238343282-dda772d4-c6cb-44a5-8dc5-a49c9b7fb853.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5MDU3MjYsIm5iZiI6MTcyNDkwNTQyNiwicGF0aCI6Ii8zNDA0MjA2NC8yMzgzNDMyODItZGRhNzcyZDQtYzZjYi00NGE1LThkYzUtYTQ5YzliN2ZiODUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI5VDA0MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZlODZkNmJkMTQyNDhiN2ZkMzVlZmVjZGQ3ZGIwNzlhNDVkMWI0MDhjMTc1ZjI5MjJjMzc2NGRhZjE3ZTNjYzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9Pq0vp8GK0X--PahJ0id06G4O8bwk2wKwyXzTi_a9qQ)
![image](https://private-user-images.githubusercontent.com/34042064/238343339-afc94d38-052f-4fe7-a06e-f44f8a0087f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5MDU3MjYsIm5iZiI6MTcyNDkwNTQyNiwicGF0aCI6Ii8zNDA0MjA2NC8yMzgzNDMzMzktYWZjOTRkMzgtMDUyZi00ZmU3LWEwNmUtZjQ0ZjhhMDA4N2YyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI5VDA0MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3ZTRiOTliYTZjNGVkMmMyN2Q0NmE5MTZmZDhjMjUyMDNmNGE2ZWRkZGZlMDFlNDU0OTgyZTk4ZjgyYmQxODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.N3GwyzLRlLdsGOK2sLICxIxKObgrKZTJnrfUinZ3g24)
Management/Groups/Group/Files
![image](https://private-user-images.githubusercontent.com/34042064/238343388-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VkMWJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI5VDA0MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhOGNlMzczMDgwZGVhMzdmM2I5Nzc1MTNiMmJlNDdmY2I4Y2M2ZGIwZTkxYWY5NDBmOWViOWI0YmQ1M2QwNWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.z_9nbkk4goHjTPT-M4MRETIrda3WDSYXvg9Q5LsWWAg)
Table - Management > Groups
Suggestions:
Table - Management > Groups > {group_id} > Agents
Suggestions:
Table - Management > Groups > {group_id} > Files
Suggestions:
Test
Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable
UI
Details
⚫ Management > Groups: For each suggested field, check the value suggestion display results or at least doesn't brea
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups: Using a value suggested should allow to run the search
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups: Type a term and run the search should search in each displayed field
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups: Type a simple field search and this should returns the expected results
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups: Type a complex field search and this should returns the expected results
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups: Clicking on the Refresh button should refresh the data
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups: Clicking on the Export formatted button should refresh export the data to CSV
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: For each suggested field, check the value suggestion display results or at least doesn't break
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: Using a value suggested should allow to run the search
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: Type a term and run the search should search in each displayed field
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: Type a simple field search and this should returns the expected results
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: Type a complex field search and this should returns the expected results
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: Clicking on the Refresh button should refresh the data
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Agents: Clicking on the Export formatted button should refresh export the data to CSV
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: For each suggested field, check the value suggestion display results or at least doesn't break
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: Using a value suggested should allow to run the search
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: Type a term and run the search should search in each displayed field
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: Type a simple field search and this should returns the expected results
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: Type a complex field search and this should returns the expected results
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: Clicking on the Refresh button should refresh the data
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Management > Groups > {group_name} > Files: Clicking on the Export formatted button should refresh export the data to CSV
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
Check List
yarn test:jest