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: add CheckboxTree component #1495

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from

Conversation

rohanm-crest
Copy link
Contributor

@rohanm-crest rohanm-crest commented Nov 29, 2024

Issue number: ADDON-76198

PR Type

What kind of change does this PR introduce?

  • Feature
  • Bug Fix
  • Refactoring (no functional or API changes)
  • Documentation Update
  • Maintenance (dependency updates, CI, etc.)

Summary

Changes

A new component CheckboxTree has been introduced to define hierarchical checkbox structures with support of search functionality.

User experience

User can use the new component for handling the list of checkboxes with better UI including the expanding/collapsing, grouping and searching within the checkbox list.

Screenshot 2024-12-13 at 3 39 25 PM

Checklist

If an item doesn't apply to your changes, leave it unchecked.

@rohanm-crest rohanm-crest changed the title feat: introduce the new CheckboxTree component feat: introduce the new checkboxtree component Nov 29, 2024
@rohanm-crest rohanm-crest force-pushed the feat/checkbox-tree-component branch from 7bacfa3 to f23a4c0 Compare December 4, 2024 06:20
@rohanm-crest rohanm-crest self-assigned this Dec 6, 2024
@rohanm-crest rohanm-crest marked this pull request as ready for review December 9, 2024 06:21
@rohanm-crest rohanm-crest requested review from a team as code owners December 9, 2024 06:21
soleksy-splunk
soleksy-splunk previously approved these changes Dec 11, 2024
ui/src/components/CheckboxTree/CheckboxTree.tsx Outdated Show resolved Hide resolved
ui/src/components/CheckboxTree/CheckboxTree.utils.ts Outdated Show resolved Hide resolved
ui/src/components/CheckboxTree/validation.ts Outdated Show resolved Hide resolved
@soleksy-splunk soleksy-splunk self-requested a review December 11, 2024 01:52
@soleksy-splunk
Copy link
Contributor

soleksy-splunk commented Dec 11, 2024

ahhh. miss-clicked into approval, unfortunately can't revoke it, pls address mentioned issues before proceeding.
Do not want to raise request changes to not block you when all ready.

@vtsvetkov-splunk vtsvetkov-splunk changed the title feat: introduce the new checkboxtree component feat: add CheckboxTree component Dec 13, 2024
data-indeterminate={isIndeterminate}
onChange={() => handleParentCheckboxForGroup(group.label, !isParentChecked)}
disabled={disabled || group.options?.disabled}
aria-label="custom checkbox for group"
Copy link
Contributor

Choose a reason for hiding this comment

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

The label is not correct since it does not reflect the real meaning for that checkbox

Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect to see the explanation what is this checkbox for.

`Select all ${group.label}`
`Deselect all ${group.label}`

Copy link
Contributor Author

@rohanm-crest rohanm-crest Dec 23, 2024

Choose a reason for hiding this comment

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

In this, we have 3 state:

  • select all
  • deselect all
  • indeterminate

but splunk don't have support for indeterminate, that's why I have added a custom checkbox so that we can use the upper 3 states for checkbox

data-indeterminate={isIndeterminate}
onChange={() => handleParentCheckboxForGroup(group.label, !isParentChecked)}
disabled={disabled || group.options?.disabled}
aria-label="custom checkbox for group"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect to see the explanation what is this checkbox for.

`Select all ${group.label}`
`Deselect all ${group.label}`

prisma: variables.contentColorMuted,
})};
}
`;
Copy link
Contributor

Choose a reason for hiding this comment

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

the amount of CSS we have to support and sync with splunk-ui, dark and light themes + enterprise, prisma and upcoming Magneto theme drives me crazy. And it is just for indeterminate view

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as splunk don't have support for indeterminate, we need that long CSS styling.
If we don't want this indeterminate feature, then we could remove this feature and also the long CSS. wdyt?

ui/src/components/CheckboxTree/types.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants