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

Add page navigation for the new feedback dashboard #28826

Merged
merged 21 commits into from
Feb 27, 2023

Conversation

ice9js
Copy link
Member

@ice9js ice9js commented Feb 8, 2023

Proposed changes:

This patch implements the page navigation component for the new feedback dashboard, building on top of #28791.
As we still haven't decided on the URL structure for the new app, nor do we have routing support, the <PageNavigation /> component reports the current selection by calling the provided onSelectPage function.

The component also has an expandedRange attribute which allows to control the range of the 'expanded' bit in the middle. I currently set it to 2 which works for all screen sizes, but we could come back to it later and make it switch depending on the current screen size, to include a little more when possible.

Note: This PR includes changes from the other PR mentioned above that hasn't been merged yet. The new commits start from 644f612.

Screenshot 2023-02-08 at 09 55 43

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

pcsBup-Pl-p2

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

Enable the new feedback dashboard with these filters:

add_filter( 'jetpack_contact_form_use_package', '__return_true' );
add_filter( 'jetpack_forms_dashboard_enable', '__return_true' );
  • Go to /wp-admin/admin.php?page=jetpack-forms.
  • There should be a page navigation component below the responses list.
  • Try clicking through the numbers or the previous/next buttons and make sure it works as expected.

Note the page navigation doesn't affect any content yet as we're not yet connected to the backend.

@ice9js ice9js self-assigned this Feb 8, 2023
@github-actions github-actions bot added [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Feb 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ⚠️ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: March 7, 2023.
  • Scheduled code freeze: February 28, 2023.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run

bin/jetpack-downloader test jetpack add/jetpack-forms-dashboard-page-navigation

to get started. More details: p9dueE-5Nn-p2

CGastrell
CGastrell previously approved these changes Feb 8, 2023
Copy link
Contributor

@CGastrell CGastrell left a comment

Choose a reason for hiding this comment

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

LGTM! A bit annoying that paging block changes width, but nothing we should be concerned at this point

@CGastrell CGastrell self-requested a review February 22, 2023 22:29
CGastrell
CGastrell previously approved these changes Feb 22, 2023
Copy link
Contributor

@CGastrell CGastrell left a comment

Choose a reason for hiding this comment

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

Works!

@ice9js ice9js added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Team Review labels Feb 22, 2023
import { useCallback } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { filter, flatten, map, range } from 'lodash';
import Gridicon from '../Gridicon';
Copy link
Member

Choose a reason for hiding this comment

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

Can we pull from the Jetpack component (@automattic/jetpack-components) instead of adding this copy here?

class Gridicon extends Component< GridiconProps > {

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can, I'll make the change. Main reason I did it was I noticed a bunch of packages duplicating this component, which also makes me wonder if there's any edge cases related to that? Regardless of the use case here.

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Feb 23, 2023
@ice9js ice9js added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Feb 24, 2023
@jeherve jeherve enabled auto-merge (squash) February 27, 2023 17:28
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Feb 27, 2023
@jeherve jeherve merged commit 4428eed into trunk Feb 27, 2023
@jeherve jeherve deleted the add/jetpack-forms-dashboard-page-navigation branch February 27, 2023 17:46
@github-actions github-actions bot added this to the jetpack/11.9 milestone Feb 27, 2023
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Feb 27, 2023
donnchawp pushed a commit that referenced this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[JS Package] Components [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants