-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cloud Security][Bug Fix] Fix for sorting issue on Posture score column on Group by resources findings table #156938
Conversation
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
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.
Please attach a video after the changes. the changes here only replace the property name as far as I can see, so I'm not completely sure why was the problem happening and how this has solved it. a video and explanation would be very helpful
@@ -149,7 +151,7 @@ const LatestFindingsByResource = ({ dataView }: FindingsBaseProps) => { | |||
})} | |||
setTableOptions={setTableOptions} | |||
sorting={{ | |||
sort: { field: 'compliance_score', direction: urlQuery.sortDirection }, | |||
sort: { field: 'compliance_score', direction: urlQuery.sort.direction }, |
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.
Hey @animehart, I'm not sure how this fix would change the sorting behavior. as far as I can tell, the only change is the properties names that we pass the value from. but the values should be the same, we just get it from sort.direction
instead of sortDirection
aren't we?
I might be missing something here so let me know.
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.
@JordanSh
https://user-images.githubusercontent.com/8703149/236698689-48a331a4-6749-4199-8bfc-627dbd2dd533.mov
so it seems like the table sorts from the direction field on sort field on urlQuery
the sortDirection on urlQuery doesn't seem to change nor do anything to the table
I tried removing it from urlQuery and it doesnt seem to be affecting the table ( I tried sorting it without sortDirection on urlQuery)
@@ -36,7 +37,8 @@ const getDefaultQuery = ({ | |||
query, | |||
filters, | |||
pageIndex: 0, | |||
sortDirection: 'asc', | |||
sortDirection: 'desc', |
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.
- Does this change effect the UX of the product? lower compliance scores should be displayed first by default unless the user re-sorts. can you please attach a video here and also for future PRs? it would be very helpful
- Do we still use
sortDirection
after your changes? it looks like the newsort
field should be sufficient isn't it? maybe we can removesortDirection
completely?
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.
@animehart page should start with ascending order - with the idea that the lower score is more relevant to see first when looking at mis configurations
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.
Please attach a video after the changes. the changes here only replace the property name as far as I can see, so I'm not completely sure why was the problem happening and how this has solved it. a video and explanation would be very helpful
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.
checked locally and it works now
- the default direction should be reverted back to ascending
@@ -36,7 +37,8 @@ const getDefaultQuery = ({ | |||
query, | |||
filters, | |||
pageIndex: 0, | |||
sortDirection: 'asc', | |||
sortDirection: 'desc', |
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.
@animehart page should start with ascending order - with the idea that the lower score is more relevant to see first when looking at mis configurations
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
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.
tested again, 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.
🚀
…mn on Group by resources findings table (elastic#156938) ## Summary This PR is for fixing the issue we have with sorting on posture score column on Group by resources findings table where clicking on the column doesn't do anything ## Before https://user-images.githubusercontent.com/8703149/236698942-04799955-1d2d-4bb8-931c-0ef1589b92f3.mov ## After https://user-images.githubusercontent.com/8703149/236698949-381d4264-54f9-4639-b541-2fb6fec2dbfa.mov (cherry picked from commit a92782c)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…e column on Group by resources findings table (#156938) (#157001) # Backport This will backport the following commits from `main` to `8.8`: - [[Cloud Security][Bug Fix] Fix for sorting issue on Posture score column on Group by resources findings table (#156938)](#156938) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Rickyanto Ang","email":"rickyangwyn@gmail.com"},"sourceCommit":{"committedDate":"2023-05-08T14:15:44Z","message":"[Cloud Security][Bug Fix] Fix for sorting issue on Posture score column on Group by resources findings table (#156938)\n\n## Summary\r\n\r\nThis PR is for fixing the issue we have with sorting on posture score\r\ncolumn on Group by resources findings table where clicking on the column\r\ndoesn't do anything\r\n\r\n## Before\r\n\r\n\r\nhttps://user-images.githubusercontent.com/8703149/236698942-04799955-1d2d-4bb8-931c-0ef1589b92f3.mov\r\n\r\n## After\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/8703149/236698949-381d4264-54f9-4639-b541-2fb6fec2dbfa.mov","sha":"a92782cb18a33822616d0f95a32bd1b2c5bf7bbb","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Cloud Security","v8.8.0","v8.9.0"],"number":156938,"url":"https://github.com/elastic/kibana/pull/156938","mergeCommit":{"message":"[Cloud Security][Bug Fix] Fix for sorting issue on Posture score column on Group by resources findings table (#156938)\n\n## Summary\r\n\r\nThis PR is for fixing the issue we have with sorting on posture score\r\ncolumn on Group by resources findings table where clicking on the column\r\ndoesn't do anything\r\n\r\n## Before\r\n\r\n\r\nhttps://user-images.githubusercontent.com/8703149/236698942-04799955-1d2d-4bb8-931c-0ef1589b92f3.mov\r\n\r\n## After\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/8703149/236698949-381d4264-54f9-4639-b541-2fb6fec2dbfa.mov","sha":"a92782cb18a33822616d0f95a32bd1b2c5bf7bbb"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156938","number":156938,"mergeCommit":{"message":"[Cloud Security][Bug Fix] Fix for sorting issue on Posture score column on Group by resources findings table (#156938)\n\n## Summary\r\n\r\nThis PR is for fixing the issue we have with sorting on posture score\r\ncolumn on Group by resources findings table where clicking on the column\r\ndoesn't do anything\r\n\r\n## Before\r\n\r\n\r\nhttps://user-images.githubusercontent.com/8703149/236698942-04799955-1d2d-4bb8-931c-0ef1589b92f3.mov\r\n\r\n## After\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/8703149/236698949-381d4264-54f9-4639-b541-2fb6fec2dbfa.mov","sha":"a92782cb18a33822616d0f95a32bd1b2c5bf7bbb"}}]}] BACKPORT--> Co-authored-by: Rickyanto Ang <rickyangwyn@gmail.com>
Summary
This PR is for fixing the issue we have with sorting on posture score column on Group by resources findings table where clicking on the column doesn't do anything
Before
Screen.Recording.2023-05-07.at.12.33.05.PM.mov
After
Screen.Recording.2023-05-07.at.12.34.08.PM.mov