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: added Pagination for Wishlist #893

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

khanSoliheen
Copy link

No description provided.

Copy link

vercel bot commented Apr 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shopware-frontends-docs ✅ Ready (Inspect) Visit Preview Jun 5, 2024 11:32am

Copy link

codspeed-hq bot commented Apr 26, 2024

CodSpeed Performance Report

Merging #893 will not alter performance

Comparing khanSoliheen:paginationForWishlistOrderHistoryPage (7ecc7ce) with main (72e122b)

Summary

✅ 9 untouched benchmarks

@BrocksiNet BrocksiNet changed the title addedPaginationForWishlistChangesFewVariableNames feat: added Pagination for Wishlist Apr 30, 2024
Copy link
Collaborator

@mkucmus mkucmus left a comment

Choose a reason for hiding this comment

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

hey, looks really good 🙌🏼

👉🏼 Could you please adjust the tests because they are failing

@BrocksiNet
Copy link
Collaborator

hey, looks really good 🙌🏼

👉🏼 Could you please adjust the tests because they are failing

@kstala maybe you can help here? Would be nice to get this merged.

@BrocksiNet
Copy link
Collaborator

BrocksiNet commented May 16, 2024

@mkucmus, @kstala, and @khanSoliheen, I fixed the Test for the useWishlist composable.

Now, we have 100% coverage for the useWishlist composable. 🎉

Can be tested here: https://frontends-demo-h3h90r2m2-shopware-frontends.vercel.app/

Copy link
Collaborator

@patzick patzick left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Few suggestions for the API of composables + ts-ignore to be removed from tests :)

/**
* Current page number
*/
getCurrentPage: ComputedRef<number>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's computed property, not getter function, we should rename it

Suggested change
getCurrentPage: ComputedRef<number>;
currentPage: ComputedRef<number>;

/**
* total pages count
*/
getTotalPagesCount: ComputedRef<number>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Suggested change
getTotalPagesCount: ComputedRef<number>;
totalPagesCount: ComputedRef<number>;

@@ -27,10 +30,11 @@ export type UseSyncWishlistReturn = {
/**
* Wishlist items count
*/
count: ComputedRef<number>;
totalWishlistItemsCount: Ref<number>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm afraid that is an unnecessary breaking change; why do you feel the need to change it?

Also it should be a computed property

@@ -89,14 +96,13 @@ export function useSyncWishlist(): UseSyncWishlistReturn {
}

const items = computed(() => _wishlistItems.value);
const count = computed(() => items.value.length);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Count could just show totalWishlistItemsCount value here

Comment on lines +48 to +49
// @ts-ignore
canSyncWishlist: { value: false },
Copy link
Collaborator

Choose a reason for hiding this comment

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

ts-ignore is not a solution, useUser doesn't have canSyncWishlist so shouldn't be in the mock

Suggested change
// @ts-ignore
canSyncWishlist: { value: false },

});
vi.mocked(useSyncWishlist).mockReturnValue({
getWishlistProducts: () => undefined,
// @ts-ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

same - no ts-ignore, we need to make sure types are correct in composables

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.

[FEATURE] Add pagination for wishlist page
4 participants