From 9e837ba568abbe97cab9209956d4df97d678d5d6 Mon Sep 17 00:00:00 2001 From: Alexandr SaVBaD Waltz Date: Wed, 28 May 2025 15:35:42 +0300 Subject: [PATCH] Features: 1) Implement composables for posts, products, categories, languages, and user deposits with lazy loading and GraphQL integration; 2) Add standalone pages for blog, product, store, and profile with scoped SCSS styling; 3) Add reusable UI components including header, footer, input, button, and textarea; 4) Introduce forms for contact and deposit functionality with validation and localization support; 5) Create GraphQL fragments for users, products, categories, company, orders, languages, and wishlist for efficient data fetching; Fixes: 1) Correct missing semicolons in Pinia store definitions for cart, company, wishlist, and auth stores; 2) Refactor GraphQL queries to include fragments for improved modularity and readability; 3) Correct error handling in composables like `usePosts` and `useLanguages`; Extra: Enhanced App.vue to include dynamic company info and language fetching on mount; Added scoped styles for new components and pages. --- storefront/src/App.vue | 12 +- .../src/components/base/base-footer.vue | 19 ++ .../src/components/base/base-header.vue | 26 +++ .../src/components/forms/contact-form.vue | 88 +++++++ .../src/components/forms/deposit-form.vue | 65 ++++++ .../src/components/forms/login-form.vue | 16 +- .../components/forms/new-password-form.vue | 66 ++++++ .../src/components/forms/register-form.vue | 9 +- .../components/forms/reset-password-form.vue | 50 ++++ .../src/components/forms/update-form.vue | 104 +++++++++ storefront/src/components/ui/ui-button.vue | 12 +- storefront/src/components/ui/ui-checkbox.vue | 67 ++++++ storefront/src/components/ui/ui-input.vue | 22 +- storefront/src/components/ui/ui-textarea.vue | 90 ++++++++ storefront/src/composables/auth/index.js | 6 + storefront/src/composables/auth/useLogin.js | 50 ++-- storefront/src/composables/auth/useLogout.js | 34 +++ .../src/composables/auth/useNewPassword.js | 73 ++++++ .../src/composables/auth/usePasswordReset.js | 51 ++++ storefront/src/composables/auth/useRefresh.js | 36 ++- .../src/composables/auth/useRegister.js | 16 +- storefront/src/composables/blog/index.js | 1 + .../src/composables/blog/usePostBySlug.js | 24 ++ storefront/src/composables/blog/usePosts.js | 20 ++ .../src/composables/categories/index.js | 2 + .../composables/categories/useCategories.js | 20 ++ .../categories/useCategorybySlug.js | 24 ++ storefront/src/composables/company/index.js | 1 + .../src/composables/company/useCompanyInfo.js | 26 +++ storefront/src/composables/contact/index.js | 1 + .../src/composables/contact/useContactUs.js | 59 +++++ storefront/src/composables/languages/index.js | 2 + .../languages/useLanguageSwitch.js | 61 +++++ .../src/composables/languages/useLanguages.js | 33 +++ storefront/src/composables/orders/index.js | 1 + .../usePendingOrder.js} | 2 +- storefront/src/composables/products/index.js | 1 + .../composables/products/useProductBySlug.js | 24 ++ .../src/composables/products/useProducts.js | 53 +++++ storefront/src/composables/user/index.js | 3 + storefront/src/composables/user/useDeposit.js | 48 ++++ .../src/composables/user/useUserActivation.js | 59 +++++ .../src/composables/user/useUserUpdating.js | 120 ++++++++++ storefront/src/composables/utils/index.js | 1 + .../{auth => utils}/useMainClient.js | 8 +- storefront/src/composables/wishlist/index.js | 1 + .../useWishlist.js} | 2 +- storefront/src/config/index.js | 6 +- storefront/src/core/helpers/translations.js | 42 ++-- .../graphql/fragments/categories.fragment.js | 11 + .../src/graphql/fragments/company.fragment.js | 12 + .../graphql/fragments/languages.fragment.js | 9 + .../src/graphql/fragments/orders.fragment.js | 28 +++ .../graphql/fragments/products.fragment.js | 37 +++ .../src/graphql/fragments/user.fragment.js | 17 ++ .../graphql/fragments/wishlist.fragment.js | 16 ++ storefront/src/graphql/mutations/auth.js | 77 +------ storefront/src/graphql/mutations/cart.js | 217 +----------------- storefront/src/graphql/mutations/contact.js | 6 +- storefront/src/graphql/mutations/languages.js | 17 ++ storefront/src/graphql/mutations/user.js | 41 ++++ storefront/src/graphql/mutations/wishlist.js | 105 +-------- storefront/src/graphql/queries/blog.js | 29 +++ storefront/src/graphql/queries/categories.js | 15 +- storefront/src/graphql/queries/company.js | 9 +- storefront/src/graphql/queries/docs.js | 17 -- storefront/src/graphql/queries/languages.js | 6 +- storefront/src/graphql/queries/orders.js | 58 +---- storefront/src/graphql/queries/products.js | 79 +------ storefront/src/graphql/queries/wishlist.js | 39 +--- storefront/src/locales/en-gb.json | 34 +-- storefront/src/pages/blog-page.vue | 24 ++ storefront/src/pages/home-page.vue | 14 ++ storefront/src/pages/post-page.vue | 29 +++ storefront/src/pages/product-page.vue | 29 +++ storefront/src/pages/profile-page.vue | 19 ++ storefront/src/pages/store-page.vue | 28 +++ storefront/src/router/index.js | 112 ++++++++- storefront/src/stores/auth.js | 14 +- storefront/src/stores/cart.js | 4 +- storefront/src/stores/company.js | 4 +- storefront/src/stores/languages.js | 14 ++ storefront/src/stores/wishlist.js | 4 +- 83 files changed, 2048 insertions(+), 683 deletions(-) create mode 100644 storefront/src/components/base/base-footer.vue create mode 100644 storefront/src/components/base/base-header.vue create mode 100644 storefront/src/components/forms/contact-form.vue create mode 100644 storefront/src/components/forms/deposit-form.vue create mode 100644 storefront/src/components/forms/new-password-form.vue create mode 100644 storefront/src/components/forms/reset-password-form.vue create mode 100644 storefront/src/components/forms/update-form.vue create mode 100644 storefront/src/components/ui/ui-checkbox.vue create mode 100644 storefront/src/components/ui/ui-textarea.vue create mode 100644 storefront/src/composables/auth/index.js create mode 100644 storefront/src/composables/auth/useLogout.js create mode 100644 storefront/src/composables/auth/useNewPassword.js create mode 100644 storefront/src/composables/auth/usePasswordReset.js create mode 100644 storefront/src/composables/blog/index.js create mode 100644 storefront/src/composables/blog/usePostBySlug.js create mode 100644 storefront/src/composables/blog/usePosts.js create mode 100644 storefront/src/composables/categories/index.js create mode 100644 storefront/src/composables/categories/useCategories.js create mode 100644 storefront/src/composables/categories/useCategorybySlug.js create mode 100644 storefront/src/composables/company/index.js create mode 100644 storefront/src/composables/company/useCompanyInfo.js create mode 100644 storefront/src/composables/contact/index.js create mode 100644 storefront/src/composables/contact/useContactUs.js create mode 100644 storefront/src/composables/languages/index.js create mode 100644 storefront/src/composables/languages/useLanguageSwitch.js create mode 100644 storefront/src/composables/languages/useLanguages.js create mode 100644 storefront/src/composables/orders/index.js rename storefront/src/composables/{auth/useAuthOrder.js => orders/usePendingOrder.js} (93%) create mode 100644 storefront/src/composables/products/index.js create mode 100644 storefront/src/composables/products/useProductBySlug.js create mode 100644 storefront/src/composables/products/useProducts.js create mode 100644 storefront/src/composables/user/index.js create mode 100644 storefront/src/composables/user/useDeposit.js create mode 100644 storefront/src/composables/user/useUserActivation.js create mode 100644 storefront/src/composables/user/useUserUpdating.js create mode 100644 storefront/src/composables/utils/index.js rename storefront/src/composables/{auth => utils}/useMainClient.js (71%) create mode 100644 storefront/src/composables/wishlist/index.js rename storefront/src/composables/{auth/useAuthWishlist.js => wishlist/useWishlist.js} (93%) create mode 100644 storefront/src/graphql/fragments/categories.fragment.js create mode 100644 storefront/src/graphql/fragments/company.fragment.js create mode 100644 storefront/src/graphql/fragments/languages.fragment.js create mode 100644 storefront/src/graphql/fragments/orders.fragment.js create mode 100644 storefront/src/graphql/fragments/products.fragment.js create mode 100644 storefront/src/graphql/fragments/user.fragment.js create mode 100644 storefront/src/graphql/fragments/wishlist.fragment.js create mode 100644 storefront/src/graphql/mutations/languages.js create mode 100644 storefront/src/graphql/mutations/user.js create mode 100644 storefront/src/graphql/queries/blog.js delete mode 100644 storefront/src/graphql/queries/docs.js create mode 100644 storefront/src/pages/blog-page.vue create mode 100644 storefront/src/pages/post-page.vue create mode 100644 storefront/src/pages/product-page.vue create mode 100644 storefront/src/pages/profile-page.vue create mode 100644 storefront/src/pages/store-page.vue create mode 100644 storefront/src/stores/languages.js diff --git a/storefront/src/App.vue b/storefront/src/App.vue index 4b92bf5f..e9dfd165 100644 --- a/storefront/src/App.vue +++ b/storefront/src/App.vue @@ -1,12 +1,20 @@ + + \ No newline at end of file diff --git a/storefront/src/components/base/base-header.vue b/storefront/src/components/base/base-header.vue new file mode 100644 index 00000000..7bb95a87 --- /dev/null +++ b/storefront/src/components/base/base-header.vue @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file diff --git a/storefront/src/components/forms/contact-form.vue b/storefront/src/components/forms/contact-form.vue new file mode 100644 index 00000000..e3bb55d0 --- /dev/null +++ b/storefront/src/components/forms/contact-form.vue @@ -0,0 +1,88 @@ + + + + + \ No newline at end of file diff --git a/storefront/src/components/forms/deposit-form.vue b/storefront/src/components/forms/deposit-form.vue new file mode 100644 index 00000000..b023fc6b --- /dev/null +++ b/storefront/src/components/forms/deposit-form.vue @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/storefront/src/components/forms/login-form.vue b/storefront/src/components/forms/login-form.vue index aeda459f..861b22e4 100644 --- a/storefront/src/components/forms/login-form.vue +++ b/storefront/src/components/forms/login-form.vue @@ -1,5 +1,5 @@ diff --git a/storefront/src/components/forms/new-password-form.vue b/storefront/src/components/forms/new-password-form.vue new file mode 100644 index 00000000..07ffe618 --- /dev/null +++ b/storefront/src/components/forms/new-password-form.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/storefront/src/components/forms/register-form.vue b/storefront/src/components/forms/register-form.vue index 711cba31..2188c0af 100644 --- a/storefront/src/components/forms/register-form.vue +++ b/storefront/src/components/forms/register-form.vue @@ -1,5 +1,5 @@ + + \ No newline at end of file diff --git a/storefront/src/components/forms/update-form.vue b/storefront/src/components/forms/update-form.vue new file mode 100644 index 00000000..1d884a81 --- /dev/null +++ b/storefront/src/components/forms/update-form.vue @@ -0,0 +1,104 @@ + + + + + \ No newline at end of file diff --git a/storefront/src/components/ui/ui-button.vue b/storefront/src/components/ui/ui-button.vue index 967a2b14..163a3c00 100644 --- a/storefront/src/components/ui/ui-button.vue +++ b/storefront/src/components/ui/ui-button.vue @@ -1,5 +1,10 @@