Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-vue-storefront-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
NPM_PASS: ${{ secrets.CLOUD_PASSWORD }}
NPM_REGISTRY: https://registrynpm.storefrontcloud.io

VSF_STORE_URL: '' # TODO
VSF_STORE_URL: ''

VSF_MAGENTO_BASE_URL: https://magento2-instance.vuestorefront.io/
VSF_MAGENTO_GRAPHQL_URL: https://magento2-instance.vuestorefront.io/graphql
Expand Down
1 change: 0 additions & 1 deletion packages/api-client/src/api/applyCouponToCart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ApplyCouponToCartMutationVariables,
} from '../../types/GraphQL';
import applyCouponToCartMutation from './applyCouponToCart';
// @TODO : Add Mutation FROM CodeGEN
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not think that this is important


/**
* Applies a coupon to a given card
Expand Down
1 change: 0 additions & 1 deletion packages/composables/nuxt/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import cookie from '@vue-storefront/magento/nuxt/cookie';

const moduleOptions = JSON.parse('<%= JSON.stringify(options) %>');

// TODO should be moved to THEME and expose consistent cookie management API
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By default, all todos in composable package are abandoned

Copy link
Contributor

Choose a reason for hiding this comment

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

this is already done anyway

export default integrationPlugin(({
app, res, req, integration,
}) => {
Expand Down
1 change: 0 additions & 1 deletion packages/composables/src/composables/useCart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ const factoryParams: UseCartFactoryParams<Cart, CartItem, Product> = {
.addVirtualProductsToCart
.cart as unknown as Cart;
default:
// todo implement other options
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

already done

// @ts-ignore
// eslint-disable-next-line no-underscore-dangle
throw new Error(`Product Type ${product.__typename} not supported in add to cart yet`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const factoryParams: UseExternalCheckoutFactoryParams = {

if (externalCheckout.enable) {
if (userToken && cartToken) {
// @TODO: Implements Multiple Store
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are going to work on the external checkout in dedicated tasks

/* if (Object.keys(externalCheckout.stores).length) {

} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const factoryParams: UseWishlistFactoryParams<any, any, any> = {

return bundleProductData?.addProductsToWishlist?.wishlist ?? {};
default:
// todo implement other options
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

obsolete

// @ts-ignore
// eslint-disable-next-line no-underscore-dangle
throw new Error(`Product Type ${product.__typename} not supported in add to wishlist yet`);
Expand Down
1 change: 0 additions & 1 deletion packages/composables/src/getters/cartGetters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const getItemPrice = (product: CartItem): AgnosticPrice => {
special: specialPrice || 0,
// @ts-ignore
credit: Math.round(specialPrice / 10),
// @TODO: Who set this installment value?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By default, all todos in composable package are abandoned

installment: Math.round((specialPrice * 1.1046) / 10),
discountPercentage: 100 - Math.round((specialPrice / regularPrice) * 100),
total: product.prices?.row_total?.value,
Expand Down
1 change: 0 additions & 1 deletion packages/composables/src/getters/productGetters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ export const getFormattedPrice = (price: number) => {
return null;
}

// TODO get correct data from api
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By default, all todos in composable package are abandoned

const locale = 'en';
const country = 'en';
const currency = 'USD';
Expand Down
3 changes: 1 addition & 2 deletions packages/theme/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
class="sf-header--has-mobile-search"
:class="{ 'header-on-top': isSearchOpen }"
>
<!-- TODO: add mobile view buttons after SFUI team PR -->
<template #logo>
<HeaderLogo />
</template>
Expand Down Expand Up @@ -185,7 +184,7 @@ export default defineComponent({
if (app.$device.isDesktop) {
await loadCartTotalQty();
// eslint-disable-next-line promise/catch-or-return
await loadWishlistItemsCount({});
await loadWishlistItemsCount();
}
});

Expand Down
1 change: 0 additions & 1 deletion packages/theme/components/BottomNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<template>
<!-- TODO: create logic with isActive prop for BottomNavigationItems -->
<div class="smartphone-only">
<SfBottomNavigation class="navigation-bottom">
<SfBottomNavigationItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ export default defineComponent({
const isShippingMethodStepCompleted = computed(
() => state.value?.method_code && !isLoading.value,
);
/**
* @TODO: Do not run the setShippingMethodsOnCart mutation on in-store pickup orders.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not really understand this [05.2021]

* Instead, specify the pickup_location_code attribute in the setShippingAddressesOnCart mutation.
*/

const selectShippingMethod = async (method: AvailableShippingMethod) => {
const shippingData = {
carrier_code: method.carrier_code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ import {
import useWishlist from '~/modules/wishlist/composables/useWishlist';
import { useUser } from '~/modules/customer/composables/useUser';
import SvgImage from '~/components/General/SvgImage.vue';
import type { Product } from '~/modules/wishlist/composables/useWishlist/useWishlist';

export default defineComponent({
name: 'SearchResults',
Expand All @@ -186,16 +185,14 @@ export default defineComponent({
},
setup(props) {
const { isAuthenticated } = useUser();
const { isInWishlist, addItem, removeItem } = useWishlist();
const { isInWishlist, addOrRemoveItem } = useWishlist();

const th = useUiHelpers();
const isSearchOpen = ref(props.visible);
const products = computed(() => props.result?.products);

const addItemToWishlist = async (product: Product) => {
await (isInWishlist({ product })
? removeItem({ product })
: addItem({ product }));
const addItemToWishlist = async (product) => {
await addOrRemoveItem({ product });
};

const { getMagentoImage, imageSizes } = useImage();
Expand Down
20 changes: 13 additions & 7 deletions packages/theme/components/LoginModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ extend('password', {

type Form = {
username?: string,
email?: string,
firstName?: string,
lastName?: string,
password?: string,
email: string,
firstname: string,
lastname: string,
password: string,
recaptchaInstance?: string,
};

Expand All @@ -344,9 +344,15 @@ export default defineComponent({
SfBar,
},
setup() {
const emptyFormData = {
firstname: '',
lastname: '',
email: '',
password: '',
};
const { isLoginModalOpen, toggleLoginModal } = useUiState();
const isSubscribed = ref(false);
const form = ref<Form>({});
const form = ref<Form>(emptyFormData);
const isLogin = ref(true);
const createAccount = ref(false);
const rememberMe = ref(false);
Expand Down Expand Up @@ -389,7 +395,7 @@ export default defineComponent({

watch(isLoginModalOpen, () => {
if (isLoginModalOpen) {
form.value = {};
form.value = emptyFormData;
resetErrorValues();
}
});
Expand All @@ -412,7 +418,7 @@ export default defineComponent({
toggleLoginModal();
};

const handleForm = (fn: typeof register) => async () => {
const handleForm = (fn: typeof register | typeof login) => async () => {
resetErrorValues();

if (isRecaptchaEnabled.value) {
Expand Down
8 changes: 3 additions & 5 deletions packages/theme/components/NewProducts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
:score-rating="productGetters.getAverageRating(product)"
:reviews-count="productGetters.getTotalReviews(product)"
:is-in-wishlist="isInWishlist({ product })"
:is-added-to-cart="isInCart({ product })"
:is-added-to-cart="isInCart(product)"
:wishlist-icon="isAuthenticated ? 'heart' : ''"
:is-in-wishlist-icon="isAuthenticated ? 'heart_fill' : ''"
@click:wishlist="addItemToWishlist(product)"
Expand Down Expand Up @@ -98,7 +98,7 @@ export default defineComponent({
setup() {
const { isAuthenticated } = useUser();
const { getProductList, loading } = useProduct();
const { isInWishlist, addItem, removeItem } = useWishlist();
const { isInWishlist, addOrRemoveItem } = useWishlist();
const { addItemToCart, isInCart } = useAddToCart();
const products = ref([]);

Expand All @@ -108,9 +108,7 @@ export default defineComponent({
})));

const addItemToWishlist = async (product) => {
await (isInWishlist({ product })
? removeItem({ product })
: addItem({ product }));
await addOrRemoveItem({ product });
};

const { getMagentoImage, imageSizes } = useImage();
Expand Down
11 changes: 0 additions & 11 deletions packages/theme/composables/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,6 @@ export interface AgnosticRateCount {
count: number;
}

// TODO - remove this interface
export enum AgnosticOrderStatus {
Open = 'Open',
Pending = 'Pending',
Confirmed = 'Confirmed',
Shipped = 'Shipped',
Complete = 'Complete',
Cancelled = 'Cancelled',
Refunded = 'Refunded',
}

export interface FacetInterface {
type: string;
id: string;
Expand Down
2 changes: 0 additions & 2 deletions packages/theme/composables/useApi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export interface UseApiInterface {
*/
query: Request;

// TODO: Add code sample
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have the task for this M2-352


/**
* Executes received GraphQL Mutation with optional variables and headers and
* returns the result.
Expand Down
4 changes: 0 additions & 4 deletions packages/theme/composables/useExternalCheckout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export function useExternalCheckout(): UseExternalCheckoutInterface {

if (externalCheckout.enable) {
if (userToken && cartToken) {
// @TODO: Implements Multiple Store
/* if (Object.keys(externalCheckout.stores).length) {

} */
window.location.replace(`${externalCheckout.cmsUrl}${externalCheckout.syncUrlPath}/token/${userToken}/cart/${cartToken}`);
return '';
}
Expand Down
2 changes: 0 additions & 2 deletions packages/theme/getters/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export interface WishlistGetters<WISHLIST, WISHLIST_ITEM> {
getItemSku: (wishlistItem: WISHLIST_ITEM) => string;
getTotals: (wishlist: WISHLIST) => AgnosticTotals;
getTotalItems: (wishlist: WISHLIST) => number;
getFormattedPrice: (price: number) => string;
[getterName: string]: (element: any, options?: any) => unknown;
}

Expand All @@ -82,7 +81,6 @@ export interface CartGetters<CART, CART_ITEM> {
getTotals: (cart: CART) => AgnosticTotals;
getShippingPrice: (cart: CART) => number;
getTotalItems: (cart: CART) => number;
getFormattedPrice: (price: number) => string;
// @deprecated - use getDiscounts instead
getCoupons: (cart: CART) => AgnosticCoupon[];
getDiscounts: (cart: CART) => AgnosticDiscount[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const useProductsWithCommonProductCardProps = (products: Ref<Product[]>)
title: getName(product),
link,
style: { '--index': index }, // used for transition animation
isAddedToCart: isInCart({ product }),
isAddedToCart: isInCart(product),
...imageProps,
...wishlistProps,
...priceProps,
Expand Down
1 change: 0 additions & 1 deletion packages/theme/modules/catalog/pages/category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ import type { EntityUrl } from '~/modules/GraphQL/types';
import { useTraverseCategory } from '~/modules/catalog/category/helpers/useTraverseCategory';
import CategoryBreadcrumbs from '~/modules/catalog/category/components/breadcrumbs/CategoryBreadcrumbs.vue';

// TODO(addToCart qty, horizontal): https://github.com/vuestorefront/storefront-ui/issues/1606
export default defineComponent({
name: 'CategoryPage',
components: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
:score-rating="productGetters.getAverageRating(product)"
:reviews-count="productGetters.getTotalReviews(product)"
:is-in-wishlist="isInWishlist({ product })"
:is-added-to-cart="isInCart({ product })"
:is-added-to-cart="isInCart(product)"
:wishlist-icon="isAuthenticated ? 'heart' : ''"
:is-in-wishlist-icon="isAuthenticated ? 'heart_fill' : ''"
@click:wishlist="addItemToWishlist(product)"
Expand Down Expand Up @@ -125,7 +125,7 @@ export default defineComponent({
},
setup(props) {
const { isAuthenticated } = useUser();
const { isInWishlist, addItem, removeItem } = useWishlist();
const { isInWishlist, addOrRemoveItem } = useWishlist();
const { addItemToCart, isInCart } = useAddToCart();

const mappedProducts = computed(() => props.products.map((product) => ({
Expand All @@ -134,10 +134,8 @@ export default defineComponent({
isInWishlist: isInWishlist({ product }),
})));

const addItemToWishlist = async (product: Product) => {
await (isInWishlist({ product })
? removeItem({ product })
: addItem({ product }));
const addItemToWishlist = async (product) => {
await addOrRemoveItem({ product });
};

const { getMagentoImage, imageSizes } = useImage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default defineComponent({
const { productGallery, imageSizes } = useProductGallery(product);
const { activeTab, setActiveTab, openNewReviewTab } = useProductTabs();
const { isAuthenticated } = useUser();
const { addItem: addItemToWishlist, isInWishlist } = useWishlist();
const { addOrRemoveItem, isInWishlist } = useWishlist();
const productShortDescription = computed(
() => props.product?.short_description?.html || '',
);
Expand All @@ -205,7 +205,7 @@ export default defineComponent({

return {
addItem,
addItemToWishlist,
addItemToWishlist: addOrRemoveItem,
averageRating,
canAddToCart,
isAuthenticated,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default defineComponent({
const { activeTab, setActiveTab, openNewReviewTab } = useProductTabs();

const { isAuthenticated } = useUser();
const { addItem: addItemToWishlist, isInWishlist } = useWishlist();
const { addOrRemoveItem, isInWishlist } = useWishlist();
const { app } = useContext();

const productShortDescription = computed(
Expand Down Expand Up @@ -282,7 +282,7 @@ export default defineComponent({
};
return {
addItem,
addItemToWishlist,
addItemToWishlist: addOrRemoveItem,
canAddToCart,
configurableOptions,
updateProductConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default defineComponent({
const { activeTab, setActiveTab, openNewReviewTab } = useProductTabs();

const { isAuthenticated } = useUser();
const { addItem: addItemToWishlist, isInWishlist } = useWishlist();
const { addOrRemoveItem, isInWishlist } = useWishlist();
const basePrice = ref(0);
const openTab = ref(1);

Expand All @@ -184,13 +184,13 @@ export default defineComponent({
);

const productPrice = computed(() => getGroupedProductPriceCommand(props.product));
const productSpecialPrice = 0; // TODO add logic for special price calculation;
const productSpecialPrice = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will be addressed M2-603

const totalReviews = computed(() => getTotalReviews(props.product));
const averageRating = computed(() => getAverageRating(props.product));

return {
addItem,
addItemToWishlist,
addItemToWishlist: addOrRemoveItem,
averageRating,
basePrice,
canAddToCart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default defineComponent({
const { addItem, loading: isCartLoading, canAddToCart } = useCart();
const { productGallery, imageSizes } = useProductGallery(product);
const { isAuthenticated } = useUser();
const { addItem: addItemToWishlist, isInWishlist } = useWishlist();
const { addOrRemoveItem, isInWishlist } = useWishlist();
const { activeTab, setActiveTab, openNewReviewTab } = useProductTabs();

const productShortDescription = computed(
Expand All @@ -189,7 +189,7 @@ export default defineComponent({

return {
addItem,
addItemToWishlist,
addItemToWishlist: addOrRemoveItem,
averageRating,
totalReviews,
canAddToCart,
Expand Down
Loading