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

fix: add clickOnRowToSelect option to table #2604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arjunlalb
Copy link
Contributor

Description

With various usecases of table, it is not always required to select a row when its clicked on. There are usecases that just needs some action to be done on a row click instead of toggling its selection status.

To enable this, this PR introduces a boolean control in the table component.

Testing

Tested manually.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@arjunlalb arjunlalb requested a review from a team as a code owner January 5, 2024 05:11
Copy link

github-actions bot commented Jan 5, 2024

Test Results

    4 files  ±0    317 suites  ±0   32m 47s ⏱️ +15s
1 143 tests ±0  1 143 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 153 runs  ±0  1 153 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9b591ce. ± Comparison against base commit cf7c36a.

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (d9db405) 81.74% compared to head (9b591ce) 81.74%.
Report is 1 commits behind head on main.

Files Patch % Lines
projects/components/src/table/table.component.ts 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2604   +/-   ##
=======================================
  Coverage   81.74%   81.74%           
=======================================
  Files         929      929           
  Lines       20845    20856   +11     
  Branches     3145     3153    +8     
=======================================
+ Hits        17039    17049   +10     
  Misses       3665     3665           
- Partials      141      142    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -342,6 +342,9 @@ export class TableComponent
@Input()
public selectionMode?: TableSelectionMode = TableSelectionMode.Single;

@Input()
public clickOnRowToSelect?: boolean = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

We have TableSelectionMode.None but we're not using that anywhere in the table component.
can we use that instead of creating a new component?

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

Successfully merging this pull request may close these issues.

None yet

2 participants