Skip to content

Products overview to standard overview page - #38

Merged
rensPols merged 9 commits into
mainfrom
products-overview-to-standard-overview-page
Sep 29, 2025
Merged

rensPols merged 9 commits into
mainfrom
products-overview-to-standard-overview-page

Conversation

@rensPols

Copy link
Copy Markdown
Member

Adds a basic implementation of the products overview page.
Depends on:

rensPols and others added 9 commits September 4, 2025 12:38
This commit introduces a new widget `ProductsOverviewSync` which is a stateful widget that wraps the `OverviewPage` widget.

It initializes `IdSetNotifier` for managing selected IDs and `VisibleColumnsNotifier` for managing visible columns.
This commit introduces the `ProductsOverview` widget, which fetches and displays product data from the `/api/v1/products/overview` endpoint.

Key changes:
- Created `ProductsOverview` stateful widget to manage product data fetching and display.
- Integrated `ProductsOverviewSync` to handle the presentation logic.
- Modified `/catalog/product` route to use `ProductsOverview`.
- Updated `IdSetNotifier` to allow `allIds` to be mutable.
- Adjusted `ProductsOverviewSync` to accept `visibleColumns` as a parameter.
- Added error handling for `selectedIds.addId` in `OverviewPageRow`.
- Removed mock data generation in `Product` widget, now fetching from API.
…get) and move ProductsOverview widget

The `ProductsOverview` widget has been moved from `lib/pages/catalog/product/home/widgets/products_overview.dart` to `lib/pages/catalog/product/home/products_overview.dart`.

Additionally, this commit removes a number of unused widgets related to product filtering and display:
- `BottomFilterMenu`
- `ColumnList`
- `DropdownButtonColumns`
- `DropdownButtonFilters`
- `DropdownButtonIcon`
- `FilterList`
- `IdFilter`
- `PriceFilter`
- `Product`
- `ProductHomeSynchronous`
- `ProductInfoWidget`
- `ProductItem`
- `ProductList`
- `ProductMiddleBar`
- `ProductSearch`
- `ProductTopBar`
- `ProductViewSize`
- `RemoveFilterButton`

The router configuration in `lib/router/routes/catalog.dart` has been updated to reflect the new location of `ProductsOverview`.
This commit renames the `VisibleColumnsNotifier` class to `ColumnsNotifier` for brevity and clarity.

The following files and classes have been updated to reflect this change:
- `lib/pages/catalog/product/home/products_overview.dart`
- `lib/pages/catalog/product/home/products_overview_sync.dart`
- `lib/widgets/overview_page/content/overview_page_content_header.dart`
- `lib/widgets/overview_page/content/overview_page_content.dart`
- `lib/pages/content/pages/pages_overview.dart`
- `lib/widgets/overview_page/visible_columns_selection/visible_columns_selection.dart`
- `lib/widgets/overview_page/visible_columns_selection/visible_column_selection.dart`
- `lib/widgets/overview_page/overview_page_header.dart`
- `lib/widgets/overview_page/overview_page.dart`
- `lib/widgets/overview_page/content/row/overview_page_row.dart`

The file `lib/widgets/overview_page/visible_columns_selection/visible_columns_notifier.dart` has been renamed to `lib/widgets/overview_page/visible_columns_selection/columns_notifier.dart`.
This commit refactors several widgets to use `ColumnsNotifier` instead of `List<OverviewPageColumnData>` for managing column data. This change allows for better state management and reactivity when columns are updated.

Key changes:
- Modified `ProductsOverviewSync`, `OverviewPageHeader`, `OverviewPage`, `VisibleColumnsSelection`, and `RetrieveOverviewPagePages` to accept `ColumnsNotifier` for their `columns` parameter.
- Updated `PagesOverview` to initialize `visibleColumns` with `ColumnsNotifier(columns: [])` and to pass `ColumnsNotifier` to `OverviewPage` and `getPagesRows`.
- Adjusted `getPagesRows` in `PagesOverview` and `getRows` in `ProductsOverview` to accept `ColumnsNotifier` and a new boolean parameter `updateColumns`. This boolean indicates if the column definitions should be fetched/updated.
- In `ProductsOverview`, the `getRows` method now fetches column definitions from the `/api/v1/products/overview?columns=1` endpoint when `updateColumns` is true and populates the `columns.value`. The product data is now extracted from the `products` key in the JSON response.
- `ColumnsNotifier` constructor parameter renamed from `visibleColumns` to `columns` for clarity.
…Info`

This commit updates the `ProductInfo` widget to accept `productId` as a `String` instead of an `int?`. This change aligns with the product ID format used in the API and simplifies the routing logic.

Key changes:
- Modified `ProductInfo` widget to require a non-nullable `String` for `productId`.
- Updated `getJsonProductData` method in `_ProductInfoState` to accept `String` for `productId`.
- Removed unnecessary type parsing for `productId` in the `/catalog/product/:selectedProduct` route in `lib/router/routes/catalog.dart`. The `productId` is now directly passed as a string from `state.pathParameters`.
This commit updates the `ProductsOverview` widget to navigate to the product details page when a row is clicked.

The `onSelect` callback in `OverviewPageRow` is now used to trigger navigation using `context.push('/catalog/product/$id')`.
This commit introduces a `getFilters` method to the `ProductsOverview` widget. This asynchronous method is intended to fetch filter configurations from the backend.

Additionally, the `ProductsOverviewSync` widget has been updated to accept a `getFilters` parameter, which will be passed down from `ProductsOverview`. Currently, `getFilters` in `ProductsOverview` returns an empty list as a placeholder.
@Moltensnor
Moltensnor self-requested a review September 26, 2025 10:12

@Moltensnor Moltensnor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This all looks good to me. Awaiting the PR on the engine before merging this one

@rensPols
rensPols merged commit 6b71750 into main Sep 29, 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.

2 participants