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/introducing abstract for list table of custom tables #2372

Conversation

dpanta94
Copy link
Member

@dpanta94 dpanta94 commented Jan 30, 2025

🎫 Ticket

ETP-956

🗒️ Description

Introduces an abstract that can be used for creating WP_LIst_Tables from data that resides in custom tables.
Also introduces a couple of custom table query methods to make pagination and searching easier.
The code changes are covered by tests and are being implemented in the waitlist feature.

The 2 tests that are failing are because they need this
merged to pass.

🎥 Artifacts

✔️ Checklist

  • Ran npm run changelog to add changelog file(s). More info here
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

Copy link
Contributor

@tec-bot tec-bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

[phpcs] reported by reviewdog 🐶
StellarWP.XSS.EscapeOutput.OutputNotEscaped
Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$input_id'

<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />


[phpcs] reported by reviewdog 🐶
WordPress.Security.EscapeOutput.OutputNotEscaped
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$input_id'.

<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />


[phpcs] reported by reviewdog 🐶
Generic.Arrays.DisallowLongArraySyntax.Found
Short array syntax must be used to define arrays

<?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>


[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine
Expected 1 space after the array opener in a single line array. Found: no spaces

<?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>


[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserSingleLine
Expected 1 space before the array closer in a single line array. Found: no spaces

<?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>


[phpcs] reported by reviewdog 🐶
Generic.CodeAnalysis.UnusedFunctionParameter.Found
The method parameter $args is never used

public static function get_total_items( array $args = [] ): int {

@dpanta94 dpanta94 added the code review Status: requires a code review. label Jan 30, 2025
@dpanta94 dpanta94 self-assigned this Jan 30, 2025
@dpanta94 dpanta94 requested a review from a team January 30, 2025 20:01
@dpanta94 dpanta94 marked this pull request as ready for review January 30, 2025 20:06
src/Tribe/Main.php Outdated Show resolved Hide resolved
dpanta94 and others added 3 commits January 30, 2025 22:20
Co-authored-by: Rafsun Chowdhury <rafsun.aiub@gmail.com>
Co-authored-by: Rafsun Chowdhury <rafsun.aiub@gmail.com>
@dpanta94 dpanta94 merged commit 60b45b3 into bucket/waitlists Jan 30, 2025
14 of 17 checks passed
@dpanta94 dpanta94 deleted the feat/introducing-abstract-for-list-table-of-custom-tables branch January 30, 2025 20:26
@dpanta94 dpanta94 removed the code review Status: requires a code review. label Feb 12, 2025
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.

3 participants