Introduce a new `_filters` constant in `_data.ts` that defines various filter objects for invoices and related data. Update `filter-service.ts` to import `_filters` and define the `Filter` type. Implement `getFiltersAsync` function to asynchronously retrieve the filter data.
Updated the `Filter` type to include `id` and `label` properties. Removed the `dataType` property and replaced it with a `type` property that utilizes the `Type` type. This enhances the filter's structure by providing unique identification and standardizing data type representation.
Introduced a new `Type` definition with five string values: 'BOOLEAN', 'DATE', 'VARCHAR', 'INTEGER', and 'DECIMAL'. Added a `Filter` type that includes a `name` property and a `dataType` property of type `Type`.
Updated the `Product` type in `product-service.ts` to include an optional `url` property. Modified the `Link` component in `product-item.tsx` to use this new `url` for navigation, defaulting to '/404' if not provided. This enhances product item display by making product names clickable.
Updated the `getProducts` function in `product-service.ts` to `getProductsAsync` to reflect its asynchronous nature. Adjusted the import in `products-view.tsx` accordingly and modified the `useEffect` hook in `ProductsView` to utilize the new function, ensuring proper handling of asynchronous requests.
Modified the `Product` type to make `status` and `coverUrl` optional, and added a new `version` property for improved flexibility. Updated the `getProducts` function to reflect these changes. In the `ProductItem` component, added a new `Label` to display the product's version and ensured a default image is used if `coverUrl` is not provided. Updated rendering logic to conditionally show both status and version.
Updated the `Product` type in `product-service.ts` to make `price`, `colors`, and `priceSale` optional. Removed hardcoded values from the `getProducts` function, allowing for more flexible product creation. Enhanced the `ProductItem` component to safely access the `colors` property using optional chaining, defaulting to an empty array if undefined.
Replaced `ProductItemProps` with a new `Product` type in `product-service.ts`, which includes properties like `id`, `name`, `price`, `status`, and `coverUrl`. Updated the `getProducts` function to return `Promise<Product[]>` instead of `Promise<ProductItemProps[]>`. Modified the `ProductItem` component in `product-item.tsx` to accept the new `Product` type. Adjusted `products-view.tsx` to import `Product` and manage the state as `Array<Product>`.
Moved `ProductItemProps` from `product-item.tsx` to `product-service.ts` for centralized access. Updated `product-item.tsx` to import the type from the new location. Adjusted imports in `products-view.tsx` to streamline dependencies and reduce redundancy. This improves code organization and maintains a single source of truth for the `ProductItemProps` type.
Updated `products-view.tsx` to use `useEffect` for fetching products from an API and manage them with a new state variable. Modified rendering logic to display fetched products instead of a mocked list.
Created/modified `product-service.ts` to include the `getProducts` function, simulating an API call that returns an array of product objects.
Modified the `src` attribute of an `<img>` element in `app.tsx` to replace the previous image with a new icon located at "/assets/images/dd-button-icon.webp". This change enhances the visual representation of the application by using a more relevant image.
Updated the `App` component in `app.tsx` to include a new floating action button (Fab) linking to Digital Data. The button now features a transparent background and no box shadow, along with an image for improved visual representation. The `useScrollToTop` function remains unchanged but has a more streamlined implementation.