The 'download shopping list' action on the parcels page now creates a pdf that only shows items which are in the list type of the parcel.
Screenshots / Videos
Before
After
Checklist
[x] The ticket is up-to-date - Please document any deviations from the original approach if there is any.
[x] I have documented the testing steps for QA
[x] I have self-reviewed this PR
[x] Make sure you've verified it works via npm run dev
[x] Make sure you've verified it works via npm run build and npm run start
[x] Make sure you've fixed all linting problems with npm run lint_fix
[x] Make sure you've tested via npm run test
AI generated change summary
The following is a summary of the changes in the PR generated by What The Diff.
Delete the command below if you don't want this to be generataed.
A New Way to Identify Lists Implemented
The code in the files fetch.ts, getParcelsData.ts and shoppingListPdfDataProps.ts was updated to include a new reference for ListName from "@/app/lists/ListDataview". This means the program will now be using a specific reference to identify various lists.
Changes to Shopping List PDF Representation
The ShoppingListPdf.tsx file has undergone several changes, aimed at using a new type of item representation, identified as ItemForPDF, instead of the previously used Item. This is an enhancement to provide more detailed or specific information in the shopping list PDF document.
Parcel Information Enhancement
The getParcelsData.ts was updated to include a new listType property in the ParcelInfo interface and the function prepareParcelInfo now sets this new property. This augments the parcel information with the type of list it associated with.
Filtering of Shopping List Data
The code to generate shopping list data (getShoppingListData.ts) has been revised. Now, it includes a new filtering function that extracts items based on the type of list they belong to.
Improved Item Interface and Shopping List PDF Data
The Item interface has been renamed and modified to ItemWithListType in shoppingListPdfDataProps.ts. Additionally, different types and functions were updated to use ItemForPDF or ItemWithListType instead of Item. This shift allows for a more precise representation of items in the shopping list PDF.
New Item Filtering Function
A newly added function filterItemsbyListType in shoppingListPdfDataProps.ts allows filtering an array of items based on a given list type, enabling more specific data handling based on list categories.
These adjustments overall improve how lists and items are represented and how shopping list data is generated and manipulated, making it more efficient and aligned with specific list types.
What's changed
The 'download shopping list' action on the parcels page now creates a pdf that only shows items which are in the list type of the parcel.
Screenshots / Videos
Checklist
npm run dev
npm run build
andnpm run start
npm run lint_fix
npm run test
AI generated change summary
The following is a summary of the changes in the PR generated by What The Diff. Delete the command below if you don't want this to be generataed.
A New Way to Identify Lists Implemented
fetch.ts
,getParcelsData.ts
andshoppingListPdfDataProps.ts
was updated to include a new reference forListName
from"@/app/lists/ListDataview"
. This means the program will now be using a specific reference to identify various lists.Changes to Shopping List PDF Representation
ShoppingListPdf.tsx
file has undergone several changes, aimed at using a new type of item representation, identified asItemForPDF
, instead of the previously usedItem
. This is an enhancement to provide more detailed or specific information in the shopping list PDF document.Parcel Information Enhancement
getParcelsData.ts
was updated to include a newlistType
property in theParcelInfo
interface and the functionprepareParcelInfo
now sets this new property. This augments the parcel information with the type of list it associated with.Filtering of Shopping List Data
getShoppingListData.ts
) has been revised. Now, it includes a new filtering function that extracts items based on the type of list they belong to.Improved Item Interface and Shopping List PDF Data
Item
interface has been renamed and modified toItemWithListType
inshoppingListPdfDataProps.ts
. Additionally, different types and functions were updated to useItemForPDF
orItemWithListType
instead ofItem
. This shift allows for a more precise representation of items in the shopping list PDF.New Item Filtering Function
filterItemsbyListType
inshoppingListPdfDataProps.ts
allows filtering an array of items based on a given list type, enabling more specific data handling based on list categories.These adjustments overall improve how lists and items are represented and how shopping list data is generated and manipulated, making it more efficient and aligned with specific list types.