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(atomic-commerce): products-per-page #4107

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

louis-bompart
Copy link
Collaborator

  • refactor:PageGuard to be "generic" (result->page)
  • refactor: PageGuard for atomic-per-page
  • fix: page # label interpolation
  • feat: atomic-commerce-products-per-page
  • tests: e2e for ☝️

@developer-experience-bot
Copy link
Contributor

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 204.9 204.9 0
commerce 293.1 293.1 0
search 372.4 372.4 0
insight 352.4 352.4 0
product-listing 266.9 266.9 0
product-recommendation 170.8 170.8 0
recommendation 217.8 217.8 0
ssr 365.2 365.2 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
product-recommendation 0 10 0
product-listing 0 13 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
product-recommendation : missing SSR support
product-listing : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

Copy link
Contributor

@y-lakhdar y-lakhdar left a comment

Choose a reason for hiding this comment

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

Something is wrong with the URL management.
Whenever the search page loads with the #perPage= attribute in the URL, 2 search queries are triggered.
The second being the value in the perPage value from the URL
image

However, when first loading a listing page, the perPage value does not have any effect on the component.

@y-lakhdar
Copy link
Contributor

also Jira number?

});

test('should render the component with the right choice selected', async ({
productsPerPage,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should update the tests to also execute the assertions on a listing page

await expect(productsPerPage.label().first()).toBeVisible();
await expect(productsPerPage.choice(25)).toBeChecked();
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a test to ensure only a search query is fired

styleUrl: 'atomic-commerce-products-per-page.pcss',
shadow: true,
})
export class AtomicResultsPerPage implements InitializableComponent<Bindings> {
Copy link
Member

Choose a reason for hiding this comment

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

There's too much copy paste between this and atomic-results-per-page.

The most important thing will be to extract functional components for everything visual (ie: all renderXYZ() function) at the very least. This is mandatory to make sure parts, styling (css classes), i18n strings, and how things behave for end users stays consistent.

Then there's some other utility type function (ie: the validateXYZ() functions, or code that control end user focus for accessibility) can be shared exactly one to one, and so we should aim to refactor and extract those.

In general however, those utility function are "less important" to refactor, if compared to the rendering code itself.

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

3 participants