[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) |
| 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.
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.
@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)
| filters, | ||
| pageIndex: 0, | ||
| sortDirection: 'asc', | ||
| sortDirection: 'desc', |
There was a problem hiding this comment.
- 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
sortDirectionafter your changes? it looks like the newsortfield should be sufficient isn't it? maybe we can removesortDirectioncompletely?
There was a problem hiding this comment.
@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
kfirpeled
left a comment
There was a problem hiding this comment.
checked locally and it works now
- the default direction should be reverted back to ascending
| filters, | ||
| pageIndex: 0, | ||
| sortDirection: 'asc', | ||
| sortDirection: 'desc', |
There was a problem hiding this comment.
@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: |
…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