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

refactor: Use filterEmptyItem for table columns to improve readability. #2815

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

agatha197
Copy link
Contributor

@agatha197 agatha197 commented Nov 5, 2024

Refactored image list column definitions to use conditional expressions with filterEmptyItem

This PR simplifies the column definitions in CustomizedImageList and ImageList components by:

  • Replacing spread operator and conditional arrays with boolean expressions
  • Using filterEmptyItem to remove falsy column definitions
  • Maintaining the same functionality while reducing code complexity

Checklist:

  • Documentation
  • Test case(s) to demonstrate the difference of before/after

The changes make the code more maintainable by:

  1. Eliminating nested conditional arrays
  2. Making column visibility logic more explicit
  3. Keeping column definitions flat and easier to read

The functionality remains identical for users, with no changes to the UI or behavior.

Copy link

graphite-app bot commented Nov 5, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the size:XL 500~ LoC label Nov 5, 2024
@agatha197 agatha197 added this to the 24.09 milestone Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 4.86% 349/7185
🔴 Branches 4.44% 220/4959
🔴 Functions 2.81% 67/2382
🔴 Lines 4.75% 334/7027

Test suite run success

96 tests passing in 12 suites.

Report generated by 🧪jest coverage report action from f758c59

Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM! 🚢

Copy link

graphite-app bot commented Nov 6, 2024

Merge activity

…ity. (#2815)

Refactored image list column definitions to use conditional expressions with filterEmptyItem

This PR simplifies the column definitions in CustomizedImageList and ImageList components by:
- Replacing spread operator and conditional arrays with boolean expressions
- Using filterEmptyItem to remove falsy column definitions
- Maintaining the same functionality while reducing code complexity

**Checklist:**
- [ ] Documentation
- [ ] Test case(s) to demonstrate the difference of before/after

The changes make the code more maintainable by:
1. Eliminating nested conditional arrays
2. Making column visibility logic more explicit
3. Keeping column definitions flat and easier to read

The functionality remains identical for users, with no changes to the UI or behavior.
@graphite-app graphite-app bot merged commit f758c59 into main Nov 6, 2024
6 checks passed
@graphite-app graphite-app bot deleted the refactor/use-filterEmptyItem branch November 6, 2024 04:41
@agatha197 agatha197 mentioned this pull request Nov 6, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL 500~ LoC type:refactor Refactoring current implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants