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(datagrid): custom select all #1720

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

valentin-mladenov
Copy link
Contributor

@valentin-mladenov valentin-mladenov commented Feb 28, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If applicable, have a visual design approval

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Datagrid is using internal select all algorithm only.

Issue Number: CDE-2588

What is the new behavior?

Providing a projected clrCheckbox can leverage a custom implementation of that logic.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Contributor

github-actions bot commented Feb 28, 2025

👋 @valentin-mladenov,

  • 🙏 The Clarity team thanks you for opening a pull request
  • 🎉 The build for this PR has succeeded
  • 🔍 The PR is now ready for review
  • 🍿 In the meantime, view a preview of this PR
  • 🖐 You can always follow up here. If you're a VMware employee, you can also reach us on our internal Clarity Support space

Thank you,

🤖 Clarity Release Bot

@valentin-mladenov valentin-mladenov requested a review from a team March 4, 2025 09:23
@valentin-mladenov valentin-mladenov marked this pull request as ready for review March 4, 2025 09:23
Copy link
Contributor

@Jinnie Jinnie left a comment

Choose a reason for hiding this comment

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

Would be nice to have it covered in Storybook too. And spawn a Jira for the website if we don't have one.
The rest looks good.

Copy link
Member

@kevinbuhmann kevinbuhmann left a comment

Choose a reason for hiding this comment

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

Please update the PR summary. It provides basically no information about this change.

Comment on lines +44 to +46
<clr-checkbox-wrapper class="clr-dg-custom-select-all">
<input clrCheckbox type="checkbox" (click)="toggleSelectAllRows()" />
</clr-checkbox-wrapper>
Copy link
Member

Choose a reason for hiding this comment

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

There is no label for this checkbox. I don't think applications should be required to provide that or to explicitly provide the checkbox elements. I will propose a different implementation.

Copy link
Member

@kevinbuhmann kevinbuhmann Mar 4, 2025

Choose a reason for hiding this comment

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

See #1724 for an alternative solution. I think it would be better to provide a clrDgCustomSelectAll event instead of requiring applications is provide a separate checkbox element and anything else needed for that. That will prevent applications from missing the required label for the checkbox.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's move this disscussion in JIRA.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no label for this checkbox. Label is not required for the checkbox.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinbuhmann there is better solution than one provided in #1724 , but let's first settle on a best approach.

Copy link
Member

@kevinbuhmann kevinbuhmann Mar 5, 2025

Choose a reason for hiding this comment

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

Label is not required for the checkbox.

What? A label is required for all checkboxes. It needs the label for screen readers.

@@ -22,7 +22,10 @@
*ngIf="selection.selectionType === SELECTION_TYPE.Multi"
(keydown.space)="toggleAllSelected($event)"
Copy link
Member

Choose a reason for hiding this comment

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

This is broken with custom select all.

Copy link
Member

Choose a reason for hiding this comment

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

I fixed this in my proposed implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants