Skip to content

Feature/product mocks update#543

Merged
michnowak merged 12 commits intomainfrom
feature/product-mocks-update
Jan 16, 2026
Merged

Feature/product mocks update#543
michnowak merged 12 commits intomainfrom
feature/product-mocks-update

Conversation

@michnowak
Copy link
Copy Markdown
Contributor

@michnowak michnowak commented Jan 15, 2026

What does this PR do?

  • My bugfix

Related Ticket(s)

  • Notion Ticket

Key Changes

  • How does the code change address the issue? Describe, at a high level, what was done to affect change.
  • What side effects does this change have? This is the most important question to answer, as it can point out problems where you are making too many changes in one commit or branch. One or two bullet points for related changes may be okay, but five or six are likely indicators of a commit that is doing too many things.

How to test

  • Create a detailed description of what you need to do to set this PR up. ie: Does it need migrations? Do you need to install something?
  • Create a step by step list of what the engineer needs to do to test.

Media (Loom or gif)

  • Insert media here (if applicable)

Summary by CodeRabbit

  • New Features

    • Action buttons on product details now show a localized "Coming soon" tooltip instead of navigating.
    • Product list adds a view-mode toggle (grid/list), leading filter items, and new labels: List view, Show/Hide more filters, No active filters.
    • Default pagination applied for product listings (offset 0, limit 12).
  • Refactor

    • Product list requests now consistently target physical products.
  • Chores

    • Mocked pages and header labels updated; permissions relaxed and some page titles adjusted per locale.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
o2s-docs Skipped Skipped Jan 15, 2026 9:32pm

Review with Vercel Agent

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 15, 2026

Walkthrough

Replaces product-details action links with coming-soon tooltips; adds FilterViewMode toggle and list view to ProductList, renames/extends product-list label keys, defaults product-list request type to PHYSICAL, adds pagination defaults in mocked mappers, and clears permissions in mocked CMS page fixtures.

Changes

Cohort / File(s) Summary
Product details UI
packages/blocks/product-details/src/frontend/ProductDetails.client.tsx
Replaced Link-based action buttons with TooltipHover + useTranslations(); buttons now show localized "coming soon" tooltip instead of navigation.
Product list UI & stories
packages/blocks/product-list/src/frontend/ProductList.client.tsx, packages/blocks/product-list/src/frontend/ProductList.client.stories.tsx
Added FilterViewModeToggle with isLeading flags; introduced viewMode state (grid
Labels & filter model / UI
packages/blocks/product-list/src/api-harmonization/product-list.model.ts, packages/framework/src/modules/cms/models/blocks/product-list.model.ts, packages/framework/src/utils/models/filters.ts, packages/ui/src/components/Filters/Filters.tsx
Renamed tableViewlistView; added showMoreFilters, hideMoreFilters, noActiveFilters; added optional isLeading?: boolean to FilterViewModeToggle; Filters now recognizes FilterViewModeToggle and animation code was removed.
CMS mappers & mocks
packages/integrations/contentful-cms/.../cms.product-list.mapper.ts, packages/integrations/strapi-cms/.../cms.product-list.mapper.ts, packages/integrations/mocked/src/modules/cms/mappers/blocks/..., packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/*.page.ts
Updated product-list mappers/mocks to include FilterViewModeToggle, set isLeading flags, replace tableView with listView and add new labels; cleared permissions arrays and updated page titles in mocked page fixtures.
Product list service
packages/blocks/product-list/src/api-harmonization/product-list.service.ts
getProductListBlock now hardcodes request type to 'PHYSICAL' (ignores incoming query.type).
Mocked product mappers / pagination
packages/integrations/mocked/src/modules/products/products.mapper.ts
mapProducts / mapRelatedProducts default offset=0, limit=12 and slice returned arrays to apply pagination.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant UI as ProductList.client
    participant Filters as FiltersSection
    participant API as ProductListService
    participant Renderer as DataList/ProductGrid

    User->>Filters: toggle viewMode / change filters
    Filters->>UI: onChange(viewMode / filters)
    UI->>API: fetch products (filters, type='PHYSICAL', offset/limit)
    API-->>UI: return product data (paged)
    UI->>Renderer: render DataList (list) or ProductGrid (grid)
    Renderer-->>User: display products
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • marcinkrasowski

Poem

🐰 Hopping through code with a curious tune,
Buttons now whisper "coming soon".
Grids and lists dance with a toggle so bright,
Mocks trimmed and paged for a tidy sight.
A rabbit applauds: "New views take flight!"

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely a template with placeholders and contains no actual implementation details, testing instructions, or meaningful information about the changes. Fill in all template sections with concrete details: describe what was changed and why, list side effects, provide specific setup and testing steps, and remove or complete all placeholder text.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Feature/product mocks update' is vague and generic, using non-descriptive terms that don't convey the actual scope of changes across multiple product list and detail components. Clarify the title to reflect the main change, such as 'Replace table view with list view and update product mock permissions' or 'Refactor product list view mode and update product page terminology'.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5095fb and 26edd64.

📒 Files selected for processing (6)
  • packages/integrations/mocked/src/modules/cms/mappers/blocks/cms.product-list.mapper.ts
  • packages/integrations/mocked/src/modules/cms/mappers/cms.header.mapper.ts
  • packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-details.page.ts
  • packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-list.page.ts
  • packages/integrations/mocked/src/modules/resources/mock/products.mock.ts
  • packages/ui/src/components/Filters/Filters.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-26T11:57:00.632Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 411
File: packages/framework/src/modules/cms/models/blocks/product-list.model.ts:29-46
Timestamp: 2025-11-26T11:57:00.632Z
Learning: In the framework layer (packages/framework/src/modules/cms/models/blocks/*.model.ts), block classes like ProductListBlock should NOT include explicit __typename discriminators. The __typename field is added at the API harmonization layer (packages/blocks/*/src/api-harmonization/*.model.ts) where it's needed for discriminated unions. The framework maintains normalized data models without these discriminators.

Applied to files:

  • packages/integrations/mocked/src/modules/cms/mappers/blocks/cms.product-list.mapper.ts
🧬 Code graph analysis (2)
packages/integrations/mocked/src/modules/cms/mappers/blocks/cms.product-list.mapper.ts (2)
packages/blocks/product-list/src/api-harmonization/product-list.model.ts (1)
  • ProductListBlock (7-32)
packages/framework/src/modules/cms/models/blocks/product-list.model.ts (1)
  • ProductListBlock (5-25)
packages/ui/src/components/Filters/Filters.tsx (3)
packages/ui/src/lib/utils.ts (1)
  • cn (5-7)
packages/framework/src/utils/models/filters.ts (1)
  • FilterItem (12-17)
packages/ui/src/components/Filters/FilterItem.tsx (1)
  • FilterItem (18-215)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: deploy-preview
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
packages/integrations/mocked/src/modules/cms/mappers/cms.header.mapper.ts (1)

265-272: PL nav label now matches catalog naming.
Looks consistent with the updated product-list terminology.

packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-list.page.ts (1)

1-23: SEO title updates look good; confirm permissions change is intended.
Permissions are now empty for all locales, which makes the mocked pages effectively public. Please verify this aligns with expected auth behavior in dev/tests.

Also applies to: 37-57, 71-91

packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-details.page.ts (1)

1-27: Parent SEO titles align with catalog naming; confirm access expectations.
Permissions are now empty for all locales. Please verify this is intended for mocked product-details pages.

Also applies to: 47-71, 91-115

packages/integrations/mocked/src/modules/cms/mappers/blocks/cms.product-list.mapper.ts (3)

3-102: Filter view toggle + leading flags look good; verify default view mode alignment.
The new FilterViewModeToggle defaults to value: 'grid'. Please confirm this matches the ProductList client’s initial view mode to avoid a UI/data mismatch.


105-205: DE localization updates are consistent.
Titles, leading flags, and labels align with the new catalog terminology.


207-306: PL localization updates are consistent.
Titles, leading flags, and labels align with the new catalog terminology.

packages/ui/src/components/Filters/Filters.tsx (2)

20-20: FilterViewModeToggle support wired in cleanly.
No issues.


196-228: Inline rendering simplification looks solid.
Direct isExpanded gating for other items is clear and readable.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/blocks/product-list/src/api-harmonization/product-list.service.ts`:
- Line 31: The code in product-list.service.ts hardcodes type: 'PHYSICAL' which
ignores any caller-provided value on GetProductListBlockQuery.query.type; either
use the incoming value (e.g., set type: query.type ?? 'PHYSICAL') so callers can
override it, or remove the optional type from GetProductListBlockQuery (and any
related callsites) to make the contract explicit; mirror the behavior used in
service-list.service.ts if you intend to accept caller types, and update typings
and/or documentation accordingly so the inconsistency is resolved.
🧹 Nitpick comments (3)
packages/integrations/mocked/src/modules/products/products.mapper.ts (2)

70-70: Inconsistent type coercion for offset.

The slice uses offset directly for the start index but wraps it in Number() for the end calculation. If offset comes from query parameters as a string (e.g., "5"), JavaScript's implicit coercion in slice() handles it, but this is fragile and inconsistent.

♻️ Suggested fix for consistent type handling
     return {
-        data: data.slice(offset, Number(offset) + Number(limit)),
+        data: data.slice(Number(offset), Number(offset) + Number(limit)),
         total: data.length,
     };

122-122: Same type coercion inconsistency as mapProducts.

Apply the same fix here for consistency.

♻️ Suggested fix
     return {
-        data: data.slice(offset, Number(offset) + Number(limit)),
+        data: data.slice(Number(offset), Number(offset) + Number(limit)),
         total: data.length,
     };
packages/blocks/product-details/src/frontend/ProductDetails.client.tsx (1)

19-26: Remove the unused routing prop from destructuring.

The routing prop is destructured on line 21 but never referenced in the component since Link-based navigation was replaced with TooltipHover. Remove it from the parameter destructuring and consider removing it from the ProductDetailsPureProps type definition if parent components can be updated accordingly.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0358e69 and 1e8732e.

⛔ Files ignored due to path filters (21)
  • packages/integrations/mocked/public/images/accesories_cable.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/accesories_drill.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/accesories_saw.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-004_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-004_1.png is excluded by !**/*.png
  • packages/integrations/mocked/public/images/prd-005_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-006_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-007_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-008_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-009_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-010_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-011_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-012_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-013_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-014_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-015_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-016_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-017_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-018_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-019_1.jpg is excluded by !**/*.jpg
  • packages/integrations/mocked/public/images/prd-020_1.jpg is excluded by !**/*.jpg
📒 Files selected for processing (6)
  • packages/blocks/product-details/src/frontend/ProductDetails.client.tsx
  • packages/blocks/product-list/src/api-harmonization/product-list.service.ts
  • packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-details.page.ts
  • packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-list.page.ts
  • packages/integrations/mocked/src/modules/products/products.mapper.ts
  • packages/integrations/mocked/src/modules/resources/mock/products.mock.ts
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-13T15:40:10.528Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 348
File: packages/blocks/notification-summary/src/frontend/NotificationSummary.renderer.tsx:1-15
Timestamp: 2025-11-13T15:40:10.528Z
Learning: In next-intl 3.0+, hook-style APIs like useLocale(), useTranslations(), and useFormatter() can be used in non-async Server Components without the 'use client' directive. The library provides server-optimized implementations automatically. Only async Server Components need to use the await-based APIs like getLocale() from next-intl/server.

Applied to files:

  • packages/blocks/product-details/src/frontend/ProductDetails.client.tsx
📚 Learning: 2025-12-03T12:34:20.707Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 419
File: apps/frontend/package.json:52-52
Timestamp: 2025-12-03T12:34:20.707Z
Learning: In the openselfservice repository, the application does not use Next.js cache components (use cache/cacheComponents), so next-intl compatibility limitations related to those experimental features are not a concern.

Applied to files:

  • packages/blocks/product-details/src/frontend/ProductDetails.client.tsx
📚 Learning: 2025-11-26T11:57:00.632Z
Learnt from: marcinkrasowski
Repo: o2sdev/openselfservice PR: 411
File: packages/framework/src/modules/cms/models/blocks/product-list.model.ts:29-46
Timestamp: 2025-11-26T11:57:00.632Z
Learning: In the framework layer (packages/framework/src/modules/cms/models/blocks/*.model.ts), block classes like ProductListBlock should NOT include explicit __typename discriminators. The __typename field is added at the API harmonization layer (packages/blocks/*/src/api-harmonization/*.model.ts) where it's needed for discriminated unions. The framework maintains normalized data models without these discriminators.

Applied to files:

  • packages/blocks/product-list/src/api-harmonization/product-list.service.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: deploy-preview
🔇 Additional comments (4)
packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-list.page.ts (1)

22-22: Permissions removed from mock pages.

Setting permissions: [] makes these product list pages accessible without role restrictions in the mocked environment. Ensure this aligns with testing requirements and doesn't inadvertently expose functionality that should remain protected during integration testing.

packages/integrations/mocked/src/modules/cms/mappers/mocks/pages/product-details.page.ts (1)

20-20: Permissions removed consistently with product-list mock.

The change is consistent with the parallel updates in product-list.page.ts. No concerns for mock data.

packages/blocks/product-details/src/frontend/ProductDetails.client.tsx (2)

167-182: LGTM - TooltipHover implementation for desktop action button.

The tooltip pattern correctly disables the action while providing user feedback. Using useTranslations() for the "coming soon" message ensures proper localization.


200-212: Consistent implementation for mobile action button.

The mobile tooltip mirrors the desktop implementation appropriately.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@vercel vercel Bot temporarily deployed to Preview – o2s-docs January 15, 2026 09:06 Inactive
@vercel vercel Bot temporarily deployed to Preview – o2s-docs January 15, 2026 09:13 Inactive
@vercel vercel Bot temporarily deployed to Preview – o2s-docs January 15, 2026 21:32 Inactive
@michnowak michnowak merged commit fd6bb5c into main Jan 16, 2026
9 checks passed
@michnowak michnowak deleted the feature/product-mocks-update branch January 16, 2026 08:22
@coderabbitai coderabbitai Bot mentioned this pull request Jan 16, 2026
1 task
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.

2 participants