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

feat: sort table by visible text #1205

Merged
merged 8 commits into from
Jun 4, 2024

Conversation

soleksy-splunk
Copy link
Contributor

@soleksy-splunk soleksy-splunk commented May 23, 2024

Issue number: ADDON-59778

Summary

[UCC UI] Add support for sorting functionality when custom mapping is used in global config file

Changes

Sorting functionality works on mapped text not on keys.

User experience

Right now if user will sort by mapped property it will be displayed correctly.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

ui/src/components/table/TableWrapper.tsx Outdated Show resolved Hide resolved
ui/src/components/table/TableWrapper.tsx Outdated Show resolved Hide resolved
ui/src/components/table/TableWrapper.tsx Outdated Show resolved Hide resolved
ui/src/components/table/TableWrapper.tsx Outdated Show resolved Hide resolved
ui/src/components/table/TableWrapper.tsx Outdated Show resolved Hide resolved
ui/src/components/table/TableWrapper.tsx Outdated Show resolved Hide resolved
@soleksy-splunk soleksy-splunk marked this pull request as ready for review May 28, 2024 10:21
@soleksy-splunk soleksy-splunk requested a review from a team as a code owner May 28, 2024 10:21

export const ROW_DATA = [
{
name: 'aaaaaa',
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

ui/src/components/table/tests/TableWrapper.test.tsx Outdated Show resolved Hide resolved
@soleksy-splunk soleksy-splunk requested a review from a team as a code owner June 3, 2024 12:11
const allCustomTextsDesc = document.querySelectorAll('[data-column="custom_text"]');
const mappedTextDesc = Array.from(allCustomTextsDesc).map((el: Node) => el.textContent);

expect(mappedTextDesc).toMatchSnapshot();
Copy link
Collaborator

Choose a reason for hiding this comment

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

From my point of view, inline snapshots are more useful here. You don't have to jump to another file to see what is there, and the size is not big

Copy link
Member

@artemrys artemrys left a comment

Choose a reason for hiding this comment

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

LGTM and on more file is moved to TS :)

@artemrys artemrys merged commit 8561e0f into develop Jun 4, 2024
60 of 61 checks passed
@artemrys artemrys deleted the feat/add-table-sorting-for-custom-mapping branch June 4, 2024 20:39
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants