Skip to content
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

SO Management: revert incorrect sorting on tags column #139999

Merged
merged 3 commits into from
Sep 8, 2022

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Sep 5, 2022

Summary

Fix #138591

In short: Fix the incorrect sorting that was added to the SOM table's tags column in #132525

In long: The GetTableColumnDefinition tagging API returns a column definition that is sortable by default. However this sorting logic only works for browser-side paginations:

sortable: serverPaging
? false
: (object: SavedObject) => {
const { tags } = getTagsFromReferences(object.references, cache.getState());
tags.sort(byNameTagSorter);
return tags.length ? tags[0].name : undefined;
},

#132525 added sorting to the SOM table, and, by doing that, enabled the sorting capability for the tags column. However when performing server-side paging, the sortable logic of the column is just ignored, and the value of the column just sent to the server.

Add to that that this tags column cannot be converted to a proper ES sort term, and we're forced to set the tags column back to non-sortable, which is what this PR does.

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes Feature:Saved Objects Management backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.5.0 labels Sep 5, 2022
@pgayvallet pgayvallet marked this pull request as ready for review September 5, 2022 11:07
@pgayvallet pgayvallet requested a review from a team as a code owner September 5, 2022 11:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
savedObjectsTaggingOss 46 47 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
savedObjectsManagement 83.8KB 83.8KB +17.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
savedObjectsTagging 17.9KB 17.9KB +28.0B
Unknown metric groups

API count

id before after diff
savedObjectsTaggingOss 91 94 +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pgayvallet pgayvallet merged commit 5c9a11a into elastic:main Sep 8, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 8, 2022
)

* SO Management: revert incorrect sorting on `tags` column

* remove incorrect comment

(cherry picked from commit 5c9a11a)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 8, 2022
…140283)

* SO Management: revert incorrect sorting on `tags` column

* remove incorrect comment

(cherry picked from commit 5c9a11a)

Co-authored-by: Pierre Gayvallet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.4.2 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Unable find saved objects" error is shown on sorting of Tags on 'Saved Objects' page
5 participants