@revenexx/cover 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/app/api/account.ts +8 -0
- package/app/api/categories.ts +3 -0
- package/app/api/checkout.ts +6 -0
- package/app/api/images.ts +4 -0
- package/app/api/markets.ts +3 -0
- package/app/api/product.ts +3 -0
- package/app/api/products.ts +4 -0
- package/app/api/search.ts +4 -0
- package/app/app.config.ts +29 -0
- package/app/assets/css/cover.css +25 -0
- package/app/components/account/AccountMenu.vue +30 -0
- package/app/components/account/AccountShell.vue +18 -0
- package/app/components/account/AccountSidebar.vue +90 -0
- package/app/components/account/address/AccountAddressCard.vue +287 -0
- package/app/components/account/carts/AccountCartsTable.vue +284 -0
- package/app/components/account/dashboard/AccountDashboard.vue +351 -0
- package/app/components/account/directorder/AccountDirectOrder.vue +512 -0
- package/app/components/account/governance/AccountApprovalLimitsTable.vue +221 -0
- package/app/components/account/governance/AccountCostCenterDetail.vue +276 -0
- package/app/components/account/governance/AccountCostCentersTable.vue +252 -0
- package/app/components/account/governance/AccountRequisitionDetail.vue +295 -0
- package/app/components/account/governance/AccountRequisitionsTable.vue +255 -0
- package/app/components/account/governance/AccountWorkflowDetail.vue +215 -0
- package/app/components/account/governance/AccountWorkflowsTable.vue +168 -0
- package/app/components/account/governance/GovernanceApprovalLimitModal.vue +183 -0
- package/app/components/account/governance/GovernanceCostCenterModal.vue +188 -0
- package/app/components/account/governance/GovernanceWorkflowModal.vue +191 -0
- package/app/components/account/orderlists/AccountOrderListDetail.vue +349 -0
- package/app/components/account/orderlists/AccountOrderListsTable.vue +352 -0
- package/app/components/account/orders/AccountOrderDetail.vue +376 -0
- package/app/components/account/orders/AccountOrdersTable.vue +281 -0
- package/app/components/account/preferences/AccountPreferences.vue +50 -0
- package/app/components/auth/AuthForgotPasswordPanel.vue +88 -0
- package/app/components/auth/AuthLoginPanel.vue +103 -0
- package/app/components/auth/AuthLoginTeaser.vue +24 -0
- package/app/components/auth/AuthPageHeader.vue +21 -0
- package/app/components/auth/AuthRegisterPanel.vue +431 -0
- package/app/components/auth/AuthRegisterTeaser.vue +24 -0
- package/app/components/auth/AuthResetPasswordPanel.vue +115 -0
- package/app/components/cart/CartButton.vue +42 -0
- package/app/components/cart/actions/CartCostCenterModal.vue +110 -0
- package/app/components/cart/actions/CartExportModal.vue +82 -0
- package/app/components/cart/actions/CartPositionTextsModal.vue +92 -0
- package/app/components/cart/actions/CartSaveToListModal.vue +177 -0
- package/app/components/cart/actions/CartWorkflowPickerModal.vue +64 -0
- package/app/components/cart/drawer/CartDrawer.vue +49 -0
- package/app/components/cart/item/CartItem.vue +318 -0
- package/app/components/cart/manage/CartNameModal.vue +68 -0
- package/app/components/cart/position/CartPosition.vue +369 -0
- package/app/components/cart/quickadd/CartQuickAdd.vue +145 -0
- package/app/components/cart/recommend/CartCrossSell.vue +102 -0
- package/app/components/cart/recommend/CartRecommendCard.vue +59 -0
- package/app/components/cart/recommend/CartReorderStrip.vue +108 -0
- package/app/components/cart/requisition/CartRequisitionGroup.vue +74 -0
- package/app/components/cart/skeleton/CartSkeleton.vue +18 -0
- package/app/components/cart/summary/CartSummary.vue +25 -0
- package/app/components/cart/summary/CartSummaryBreakdown.vue +35 -0
- package/app/components/cart/switcher/CartSwitcher.vue +147 -0
- package/app/components/cart/target/CartTargetModal.vue +129 -0
- package/app/components/cart/view/CartApprovalsPanel.vue +89 -0
- package/app/components/cart/view/CartListHeader.vue +86 -0
- package/app/components/cart/view/CartPositionList.vue +94 -0
- package/app/components/cart/view/CartSummaryPanel.vue +254 -0
- package/app/components/cart/view/CartView.vue +310 -0
- package/app/components/category/info/CategoryPrice.vue +47 -0
- package/app/components/category/info/CategorySku.vue +15 -0
- package/app/components/category/info/CategoryStock.vue +25 -0
- package/app/components/category/list/CategoryItemCount.vue +27 -0
- package/app/components/category/list/CategoryListPagination.vue +81 -0
- package/app/components/category/skeleton/CategoryDetailSkeleton.vue +12 -0
- package/app/components/category/skeleton/CategoryListSkeleton.vue +65 -0
- package/app/components/category/view/CategoryViewToggle.vue +33 -0
- package/app/components/category/view/GridView.vue +78 -0
- package/app/components/category/view/ListView.vue +80 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationView.vue +289 -0
- package/app/components/checkout/form/CheckoutSchemaForm.vue +72 -0
- package/app/components/checkout/onepage/CheckoutAddressPickerModal.vue +260 -0
- package/app/components/checkout/onepage/CheckoutAddressSection.vue +186 -0
- package/app/components/checkout/onepage/CheckoutDeliverySection.vue +158 -0
- package/app/components/checkout/onepage/CheckoutGate.vue +67 -0
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +154 -0
- package/app/components/checkout/onepage/CheckoutNotesSection.vue +62 -0
- package/app/components/checkout/onepage/CheckoutOnePageView.vue +77 -0
- package/app/components/checkout/onepage/CheckoutPaymentSection.vue +181 -0
- package/app/components/checkout/onepage/CheckoutSectionTitle.vue +18 -0
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +211 -0
- package/app/components/checkout/onepage/CheckoutWorkflowPanel.vue +38 -0
- package/app/components/layout/AppLogo.vue +21 -0
- package/app/components/layout/footer/Footer.vue +148 -0
- package/app/components/layout/header/AppBar.vue +75 -0
- package/app/components/layout/header/CategoryNav.vue +93 -0
- package/app/components/layout/header/HeaderActionItem.vue +81 -0
- package/app/components/layout/header/LocaleSwitcher.vue +123 -0
- package/app/components/layout/header/MainNav.vue +61 -0
- package/app/components/layout/header/MobileMenu.vue +81 -0
- package/app/components/layout/header/TopBar.vue +63 -0
- package/app/components/listing/ListingView.vue +227 -0
- package/app/components/product/detail/ProductDetailAddToCart.vue +188 -0
- package/app/components/product/detail/ProductDetailDescription.vue +20 -0
- package/app/components/product/detail/ProductDetailImageGallery.vue +58 -0
- package/app/components/product/detail/ProductDetailPricing.vue +108 -0
- package/app/components/product/detail/ProductDetailSaveToList.vue +291 -0
- package/app/components/product/detail/ProductDetailSpecifications.vue +33 -0
- package/app/components/product/detail/ProductDetailStock.vue +36 -0
- package/app/components/search/filter/SearchFacets.vue +256 -0
- package/app/components/search/filter/SearchFacetsDrawer.vue +58 -0
- package/app/components/ui/AppShell.vue +7 -0
- package/app/components/ui/debug/PiniaStateCard.vue +106 -0
- package/app/components/ui/feedback/EmptyState.vue +30 -0
- package/app/components/ui/feedback/ErrorBoundary.vue +44 -0
- package/app/components/ui/feedback/NotFound.vue +34 -0
- package/app/components/ui/forms/CountrySelection.vue +14 -0
- package/app/components/ui/forms/FormKitDatePicker.vue +124 -0
- package/app/components/ui/forms/PasswordInput.vue +136 -0
- package/app/components/ui/forms/SearchInput.vue +213 -0
- package/app/components/ui/table/TableSortButton.vue +51 -0
- package/app/components/ui/table/TableToolbar.vue +66 -0
- package/app/composables/useAccount.ts +27 -0
- package/app/composables/useAccountAddresses.ts +116 -0
- package/app/composables/useAccountOrders.ts +18 -0
- package/app/composables/useAppUrl.ts +38 -0
- package/app/composables/useAuthStore.ts +202 -0
- package/app/composables/useB2BContext.ts +23 -0
- package/app/composables/useCartActions.ts +25 -0
- package/app/composables/useCartCalculation.ts +90 -0
- package/app/composables/useCartSelection.ts +46 -0
- package/app/composables/useCartStore.ts +837 -0
- package/app/composables/useCartSummaryFormatting.ts +28 -0
- package/app/composables/useCategories.ts +29 -0
- package/app/composables/useCheckoutOnePage.ts +438 -0
- package/app/composables/useCheckoutProfileSource.ts +8 -0
- package/app/composables/useCheckoutSchema.ts +28 -0
- package/app/composables/useDataTable.ts +14 -0
- package/app/composables/useFormValidation.ts +29 -0
- package/app/composables/useIcons.ts +17 -0
- package/app/composables/useLocalePreferences.ts +45 -0
- package/app/composables/useMarkets.ts +15 -0
- package/app/composables/useProduct.ts +89 -0
- package/app/composables/useProductCard.ts +8 -0
- package/app/composables/useProductCardActions.ts +106 -0
- package/app/composables/useProductImage.ts +12 -0
- package/app/composables/useProductListing.ts +210 -0
- package/app/composables/useProductUrl.ts +17 -0
- package/app/composables/useProducts.ts +130 -0
- package/app/composables/useSearch.ts +12 -0
- package/app/composables/useThemeStore.ts +81 -0
- package/app/composables/useViewMode.ts +18 -0
- package/app/config/countries.ts +74 -0
- package/app/config/icons.ts +283 -0
- package/app/config/navigation.ts +191 -0
- package/app/config/palette.ts +13 -0
- package/app/config/themes.ts +20 -0
- package/app/formkit.config.ts +50 -0
- package/app/interfaces/account/address-list.ts +34 -0
- package/app/interfaces/account/order-list.ts +47 -0
- package/app/interfaces/account/order-lists.ts +35 -0
- package/app/interfaces/account/profile.ts +17 -0
- package/app/interfaces/account.ts +3 -0
- package/app/interfaces/address.ts +9 -0
- package/app/interfaces/auth.ts +104 -0
- package/app/interfaces/b2b.ts +234 -0
- package/app/interfaces/cart-calculation.ts +131 -0
- package/app/interfaces/cart-item.ts +45 -0
- package/app/interfaces/checkout-draft.ts +4 -0
- package/app/interfaces/checkout.ts +43 -0
- package/app/interfaces/delivery.ts +13 -0
- package/app/interfaces/market.ts +24 -0
- package/app/interfaces/payment.ts +19 -0
- package/app/interfaces/persisted-cart.ts +10 -0
- package/app/interfaces/product-detail.ts +54 -0
- package/app/interfaces/product-list.ts +33 -0
- package/app/interfaces/search-facets.ts +14 -0
- package/app/interfaces/validation.ts +14 -0
- package/app/layouts/default.vue +78 -0
- package/app/layouts/focus.vue +80 -0
- package/app/plugins/formkit-locale.client.ts +23 -0
- package/app/shared/constants.ts +1 -0
- package/app/validations/companyName.ts +18 -0
- package/app/validations/emailFormat.ts +10 -0
- package/app/validations/formValidationConfig.ts +50 -0
- package/app/validations/maxLength.ts +12 -0
- package/app/validations/minLength.ts +9 -0
- package/app/validations/optionalCompanyName.ts +23 -0
- package/app/validations/passwordsMatch.ts +5 -0
- package/app/validations/phoneNumber.ts +19 -0
- package/app/validations/required.ts +11 -0
- package/app/validations/termsRequired.ts +4 -0
- package/app/validations/types.ts +10 -0
- package/app/validations/zipCode.ts +15 -0
- package/i18n/locales/de/account.json +458 -0
- package/i18n/locales/de/auth.json +155 -0
- package/i18n/locales/de/cart.json +263 -0
- package/i18n/locales/de/checkout.json +217 -0
- package/i18n/locales/de/common.json +80 -0
- package/i18n/locales/de/cover.json +33 -0
- package/i18n/locales/de/order.json +1 -0
- package/i18n/locales/de/product.json +71 -0
- package/i18n/locales/de/search.json +54 -0
- package/i18n/locales/de/validation.json +12 -0
- package/i18n/locales/en/account.json +458 -0
- package/i18n/locales/en/auth.json +155 -0
- package/i18n/locales/en/cart.json +263 -0
- package/i18n/locales/en/checkout.json +217 -0
- package/i18n/locales/en/common.json +80 -0
- package/i18n/locales/en/cover.json +33 -0
- package/i18n/locales/en/order.json +1 -0
- package/i18n/locales/en/product.json +71 -0
- package/i18n/locales/en/search.json +54 -0
- package/i18n/locales/en/validation.json +12 -0
- package/nuxt.config.ts +109 -0
- package/package.json +65 -0
- package/public/img/product-placeholder.svg +8 -0
- package/public/templates/direct-order-template.csv +3 -0
- package/public/templates/direct-order-template.xlsx +0 -0
- package/server/api/account/address/[id].delete.ts +51 -0
- package/server/api/account/address/[id].put.ts +83 -0
- package/server/api/account/address/index.post.ts +60 -0
- package/server/api/account/addresses.get.ts +25 -0
- package/server/api/account/context.get.ts +16 -0
- package/server/api/account/governance/[domain]/[id].put.ts +57 -0
- package/server/api/account/governance/[domain].post.ts +111 -0
- package/server/api/account/order-lists/[id].delete.ts +22 -0
- package/server/api/account/order-lists/[id].get.ts +17 -0
- package/server/api/account/order-lists/[id].put.ts +46 -0
- package/server/api/account/order-lists/index.get.ts +14 -0
- package/server/api/account/order-lists/index.post.ts +38 -0
- package/server/api/account/orders/[id].get.ts +35 -0
- package/server/api/account/orders.get.ts +35 -0
- package/server/api/account/profile.get.ts +56 -0
- package/server/api/account/profile.put.ts +128 -0
- package/server/api/account/requisitions/[id].get.ts +15 -0
- package/server/api/account/requisitions.get.ts +23 -0
- package/server/api/auth/login.post.ts +37 -0
- package/server/api/auth/logout.post.ts +4 -0
- package/server/api/auth/me.get.ts +3 -0
- package/server/api/auth/personas.get.ts +7 -0
- package/server/api/auth/recovery.post.ts +32 -0
- package/server/api/auth/recovery.put.ts +37 -0
- package/server/api/auth/register.post.ts +126 -0
- package/server/api/cart/calculate.post.ts +25 -0
- package/server/api/cart/export.post.ts +81 -0
- package/server/api/cart/index.delete.ts +10 -0
- package/server/api/cart/index.get.ts +10 -0
- package/server/api/cart/sync.post.ts +14 -0
- package/server/api/carts/[id]/activate.post.ts +18 -0
- package/server/api/carts/[id]/index.delete.ts +18 -0
- package/server/api/carts/[id]/index.put.ts +19 -0
- package/server/api/carts/[id]/items.post.ts +21 -0
- package/server/api/carts/index.get.ts +14 -0
- package/server/api/carts/index.post.ts +14 -0
- package/server/api/categories/[slug].get.ts +22 -0
- package/server/api/categories/index.get.ts +11 -0
- package/server/api/checkout/profile.get.ts +21 -0
- package/server/api/checkout/schema/[key].get.ts +19 -0
- package/server/api/checkout/session.post.ts +8 -0
- package/server/api/images/detail/[filename].get.ts +18 -0
- package/server/api/images/list/[filename].get.ts +17 -0
- package/server/api/markets.get.ts +9 -0
- package/server/api/orders/index.post.ts +376 -0
- package/server/api/payment/methods.post.ts +65 -0
- package/server/api/product/[id].get.ts +29 -0
- package/server/api/products/[id].get.ts +30 -0
- package/server/api/products/index.get.ts +21 -0
- package/server/api/requisitions/index.post.ts +67 -0
- package/server/api/shipping/rates.post.ts +70 -0
- package/server/api/themes/index.get.ts +9 -0
- package/server/api/typesense/drop.get.ts +22 -0
- package/server/api/typesense/health.get.ts +9 -0
- package/server/api/typesense/search.post.ts +199 -0
- package/server/api/typesense/seed.get.ts +112 -0
- package/server/api/typesense/suggest.post.ts +69 -0
- package/server/config/account/organization.json +146 -0
- package/server/config/account/personas.json +169 -0
- package/server/config/account/user.json +8 -0
- package/server/config/account/workflows.json +19 -0
- package/server/data/account/address-list.json +103 -0
- package/server/data/account/order-list.json +491 -0
- package/server/data/account/order-lists.json +149 -0
- package/server/data/account/profile.json +9 -0
- package/server/data/account/registration-requests.json +3 -0
- package/server/data/account/requisitions.json +686 -0
- package/server/data/categories.json +186 -0
- package/server/data/forms/checkout/add-address.json +24 -0
- package/server/data/list/5137-1.png +0 -0
- package/server/data/list/5498-1.png +0 -0
- package/server/data/list/5498-2.png +0 -0
- package/server/data/list/5498-3.png +0 -0
- package/server/data/list/5498-4.png +0 -0
- package/server/data/list/5498-5.png +0 -0
- package/server/data/list/5498-6.png +0 -0
- package/server/data/list/5519-1.png +0 -0
- package/server/data/list/5713-1.png +0 -0
- package/server/data/list/5789-1.png +0 -0
- package/server/data/list/5930-1.png +0 -0
- package/server/data/list/6127-1.png +0 -0
- package/server/data/list/6234-1.png +0 -0
- package/server/data/list/6238-1.png +0 -0
- package/server/data/list/6246-1.png +0 -0
- package/server/data/list/6270-1.png +0 -0
- package/server/data/list/6330-1.png +0 -0
- package/server/data/list/6336-1.png +0 -0
- package/server/data/list/6360-1.png +0 -0
- package/server/data/list/6363-1.png +0 -0
- package/server/data/list/6375-1.png +0 -0
- package/server/data/list/6385-1.png +0 -0
- package/server/data/list/6413-1.png +0 -0
- package/server/data/list/6418-1.png +0 -0
- package/server/data/list/6465-1.png +0 -0
- package/server/data/list/6477-1.png +0 -0
- package/server/data/list/6509-1.png +0 -0
- package/server/data/list/6545-1.png +0 -0
- package/server/data/list/6548-1.png +0 -0
- package/server/data/list/6566-1.png +0 -0
- package/server/data/list/6581-1.png +0 -0
- package/server/data/list/6609-1.png +0 -0
- package/server/data/list/6611-1.png +0 -0
- package/server/data/list/6641-1.png +0 -0
- package/server/data/list/6659-1.png +0 -0
- package/server/data/list/6662-1.png +0 -0
- package/server/data/list/6689-1.png +0 -0
- package/server/data/list/6698-1.png +0 -0
- package/server/data/list/6701-1.png +0 -0
- package/server/data/list/6752-1.png +0 -0
- package/server/data/list/6755-1.png +0 -0
- package/server/data/list/6837-1.png +0 -0
- package/server/data/list/6841-1.png +0 -0
- package/server/data/list/6844-1.png +0 -0
- package/server/data/list/6846-1.png +0 -0
- package/server/data/list/6886-1.png +0 -0
- package/server/data/list/6895-1.png +0 -0
- package/server/data/list/6897-1.png +0 -0
- package/server/data/list/6919-1.png +0 -0
- package/server/data/list/6977-1.png +0 -0
- package/server/data/list/6983-1.png +0 -0
- package/server/data/list/6984-1.png +0 -0
- package/server/data/list/6985-1.png +0 -0
- package/server/data/list/6986-1.png +0 -0
- package/server/data/list/6989-1.png +0 -0
- package/server/data/list/6995-1.png +0 -0
- package/server/data/list/6998-1.png +0 -0
- package/server/data/markets.json +24 -0
- package/server/data/product-detail.json +2450 -0
- package/server/data/product-list.json +2450 -0
- package/server/data/themes.json +8 -0
- package/server/interfaces/account.ts +20 -0
- package/server/interfaces/auth.ts +32 -0
- package/server/interfaces/b2bContext.ts +23 -0
- package/server/interfaces/cart.ts +46 -0
- package/server/interfaces/cartCalculation.ts +17 -0
- package/server/interfaces/category.ts +12 -0
- package/server/interfaces/checkoutProfile.ts +5 -0
- package/server/interfaces/log.ts +3 -0
- package/server/interfaces/market.ts +10 -0
- package/server/interfaces/product.ts +21 -0
- package/server/interfaces/schema.ts +20 -0
- package/server/interfaces/theme.ts +10 -0
- package/server/services/ApiAuthService.ts +138 -0
- package/server/services/ApiCartService.ts +254 -0
- package/server/services/ApiCategoryService.ts +25 -0
- package/server/services/ApiMarketService.ts +71 -0
- package/server/services/ApiProductService.ts +53 -0
- package/server/services/LocalFileCategoryService.ts +23 -0
- package/server/services/LocalFileCheckoutProfileService.ts +117 -0
- package/server/services/LocalFileProductService.ts +128 -0
- package/server/services/LocalFileSchemaService.ts +70 -0
- package/server/services/LocalFileThemeService.ts +18 -0
- package/server/services/LogService.ts +28 -0
- package/server/services/MockAccountService.ts +58 -0
- package/server/services/MockAuthService.ts +105 -0
- package/server/services/MockB2BContextService.ts +149 -0
- package/server/services/MockCartCalculationService.ts +395 -0
- package/server/services/MockMarketService.ts +18 -0
- package/server/services/SdkAccountService.ts +56 -0
- package/server/services/SdkAuthService.ts +83 -0
- package/server/services/SessionCartService.ts +31 -0
- package/server/utils/accountService.ts +30 -0
- package/server/utils/authCookie.ts +13 -0
- package/server/utils/authService.ts +43 -0
- package/server/utils/b2bService.ts +49 -0
- package/server/utils/cartService.ts +59 -0
- package/server/utils/categoryService.ts +19 -0
- package/server/utils/checkoutProfileService.ts +9 -0
- package/server/utils/checkoutSession.ts +38 -0
- package/server/utils/coverData.ts +84 -0
- package/server/utils/governanceStore.ts +38 -0
- package/server/utils/i18n.ts +76 -0
- package/server/utils/inventoryService.ts +14 -0
- package/server/utils/liveCatalog.ts +234 -0
- package/server/utils/liveInventories.ts +76 -0
- package/server/utils/liveOrders.ts +139 -0
- package/server/utils/livePrices.ts +93 -0
- package/server/utils/locale.ts +39 -0
- package/server/utils/logService.ts +19 -0
- package/server/utils/marketService.ts +24 -0
- package/server/utils/orderService.ts +14 -0
- package/server/utils/paymentService.ts +14 -0
- package/server/utils/priceService.ts +14 -0
- package/server/utils/productService.ts +28 -0
- package/server/utils/productsSchema.ts +30 -0
- package/server/utils/revenexxApi.ts +136 -0
- package/server/utils/schemaService.ts +25 -0
- package/server/utils/serviceMode.ts +70 -0
- package/server/utils/shippingService.ts +14 -0
- package/server/utils/shopSdk.ts +88 -0
- package/server/utils/themeService.ts +16 -0
- package/server/utils/typesense.ts +27 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ResetPasswordFormState } from "../../interfaces/auth";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Password reset panel in the focus-page design. Confirms the recovery
|
|
6
|
+
* (userId + secret from the mail link) via the auth store; the consuming
|
|
7
|
+
* page handles success feedback and navigation via the success emit.
|
|
8
|
+
*/
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
userId: string;
|
|
11
|
+
secret: string;
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits<{
|
|
15
|
+
(e: "success"): void;
|
|
16
|
+
}>();
|
|
17
|
+
|
|
18
|
+
const { t } = useI18n();
|
|
19
|
+
const localePath = useLocalePath();
|
|
20
|
+
const auth = useAuthStore();
|
|
21
|
+
const { loading, error } = storeToRefs(auth);
|
|
22
|
+
|
|
23
|
+
const invalidLink = computed(() => !props.userId || !props.secret);
|
|
24
|
+
|
|
25
|
+
const state = reactive<ResetPasswordFormState>({
|
|
26
|
+
password: "",
|
|
27
|
+
passwordConfirm: "",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const { validate } = useFormValidation<ResetPasswordFormState>("resetPassword");
|
|
31
|
+
|
|
32
|
+
async function onSubmit(): Promise<void> {
|
|
33
|
+
try {
|
|
34
|
+
await auth.confirmRecovery(props.userId, props.secret, state.password);
|
|
35
|
+
emit("success");
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// error is set on the store and rendered by UAlert
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div class="bg-elevated py-6 px-8 rounded-lg">
|
|
45
|
+
<h2 class="text-xl font-semibold text-highlighted">
|
|
46
|
+
{{ t('auth.resetPassword.title') }}
|
|
47
|
+
</h2>
|
|
48
|
+
|
|
49
|
+
<UAlert
|
|
50
|
+
v-if="invalidLink"
|
|
51
|
+
class="mt-6"
|
|
52
|
+
color="error"
|
|
53
|
+
variant="soft"
|
|
54
|
+
:title="t('auth.resetPassword.errors.invalidLink')"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<UForm
|
|
58
|
+
v-else
|
|
59
|
+
:state="state"
|
|
60
|
+
:validate="validate"
|
|
61
|
+
class="space-y-4 pt-6"
|
|
62
|
+
@submit="onSubmit"
|
|
63
|
+
>
|
|
64
|
+
<UFormField
|
|
65
|
+
:label="t('auth.resetPassword.fields.password')"
|
|
66
|
+
name="password"
|
|
67
|
+
required
|
|
68
|
+
>
|
|
69
|
+
<UiFormsPasswordInput
|
|
70
|
+
v-model="state.password"
|
|
71
|
+
autocomplete="new-password"
|
|
72
|
+
:placeholder="t('auth.resetPassword.fields.passwordPlaceholder')"
|
|
73
|
+
show-strength
|
|
74
|
+
/>
|
|
75
|
+
</UFormField>
|
|
76
|
+
|
|
77
|
+
<UFormField
|
|
78
|
+
:label="t('auth.resetPassword.fields.passwordConfirm')"
|
|
79
|
+
name="passwordConfirm"
|
|
80
|
+
required
|
|
81
|
+
>
|
|
82
|
+
<UiFormsPasswordInput
|
|
83
|
+
v-model="state.passwordConfirm"
|
|
84
|
+
autocomplete="new-password"
|
|
85
|
+
:placeholder="t('auth.resetPassword.fields.passwordConfirmPlaceholder')"
|
|
86
|
+
/>
|
|
87
|
+
</UFormField>
|
|
88
|
+
|
|
89
|
+
<UAlert
|
|
90
|
+
v-if="error"
|
|
91
|
+
color="error"
|
|
92
|
+
variant="soft"
|
|
93
|
+
:title="t(error)"
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<UButton
|
|
97
|
+
type="submit"
|
|
98
|
+
color="primary"
|
|
99
|
+
variant="solid"
|
|
100
|
+
block
|
|
101
|
+
:loading="loading"
|
|
102
|
+
:label="t('auth.resetPassword.submit')"
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<div class="text-center">
|
|
106
|
+
<NuxtLink
|
|
107
|
+
:to="localePath('/login')"
|
|
108
|
+
class="text-sm text-primary hover:underline"
|
|
109
|
+
>
|
|
110
|
+
{{ t('auth.forgotPassword.backToLogin') }}
|
|
111
|
+
</NuxtLink>
|
|
112
|
+
</div>
|
|
113
|
+
</UForm>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { icon } = useIcons();
|
|
3
|
+
|
|
4
|
+
const { t } = useI18n();
|
|
5
|
+
const cart = useCartStore();
|
|
6
|
+
const { itemCount } = storeToRefs(cart);
|
|
7
|
+
const { openCart } = cart;
|
|
8
|
+
const { to, isCartOrCheckoutPage } = useAppUrl();
|
|
9
|
+
|
|
10
|
+
// On the cart page the mini-cart drawer is disabled (it would just mirror
|
|
11
|
+
// the page) — the button links to the cart instead of opening the drawer.
|
|
12
|
+
const cartTo = computed(() => (isCartOrCheckoutPage.value ? to("/cart") : undefined));
|
|
13
|
+
|
|
14
|
+
const cartLabel = computed(() =>
|
|
15
|
+
t("nav.cartButton", itemCount.value, { count: itemCount.value }),
|
|
16
|
+
);
|
|
17
|
+
const positionsLabel = computed(() =>
|
|
18
|
+
t("header.cartPositions", itemCount.value, { count: itemCount.value }),
|
|
19
|
+
);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="relative">
|
|
24
|
+
<LayoutHeaderActionItem
|
|
25
|
+
:icon="icon('orders')"
|
|
26
|
+
:label="t('header.cart')"
|
|
27
|
+
:aria-label="cartLabel"
|
|
28
|
+
:title="positionsLabel"
|
|
29
|
+
:to="cartTo"
|
|
30
|
+
@click="openCart"
|
|
31
|
+
/>
|
|
32
|
+
<UBadge
|
|
33
|
+
v-if="itemCount > 0"
|
|
34
|
+
:label="String(itemCount)"
|
|
35
|
+
color="primary"
|
|
36
|
+
variant="solid"
|
|
37
|
+
size="xs"
|
|
38
|
+
class="absolute top-0 left-7 xl:left-auto xl:-right-1 min-w-4 h-4 flex items-center justify-center px-1
|
|
39
|
+
pointer-events-none"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Cost center picker for one or many positions (spec: Kostenstellen
|
|
4
|
+
* bearbeiten). Full-text search over code and name, the currently
|
|
5
|
+
* assigned cost center sorts first, "no cost center" only when the
|
|
6
|
+
* organization does not require one.
|
|
7
|
+
*/
|
|
8
|
+
const open = defineModel<boolean>("open", { default: false });
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
lineKeys: string[];
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const { icon } = useIcons();
|
|
15
|
+
const { t } = useI18n();
|
|
16
|
+
const cart = useCartStore();
|
|
17
|
+
const { settings, costCenters } = useB2BContext();
|
|
18
|
+
|
|
19
|
+
const query = ref("");
|
|
20
|
+
const selectedId = ref<string | null>(null);
|
|
21
|
+
|
|
22
|
+
const NONE = "__none__";
|
|
23
|
+
|
|
24
|
+
const currentId = computed(() => {
|
|
25
|
+
const items = cart.items.filter(i => props.lineKeys.includes(cart.keyOf(i)));
|
|
26
|
+
const ids = new Set(items.map(i => i.costCenterId ?? NONE));
|
|
27
|
+
return ids.size === 1 ? [...ids][0]! : null;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
watch(open, (isOpen) => {
|
|
31
|
+
if (isOpen) {
|
|
32
|
+
query.value = "";
|
|
33
|
+
selectedId.value = currentId.value;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const filtered = computed(() => {
|
|
38
|
+
const q = query.value.trim().toLowerCase();
|
|
39
|
+
const list = costCenters.value.filter(cc =>
|
|
40
|
+
!q || cc.code.toLowerCase().includes(q) || cc.label.toLowerCase().includes(q),
|
|
41
|
+
);
|
|
42
|
+
// Currently assigned cost center always sorts first (spec).
|
|
43
|
+
return [...list].sort((a, b) =>
|
|
44
|
+
Number(b.id === currentId.value) - Number(a.id === currentId.value),
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const allowNone = computed(() => !settings.value?.costCenters.required);
|
|
49
|
+
|
|
50
|
+
function apply(): void {
|
|
51
|
+
if (selectedId.value === null) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
cart.setCostCenter(
|
|
55
|
+
props.lineKeys,
|
|
56
|
+
selectedId.value === NONE ? undefined : selectedId.value,
|
|
57
|
+
);
|
|
58
|
+
open.value = false;
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<UModal
|
|
64
|
+
v-model:open="open"
|
|
65
|
+
:title="t('cart.costCenter.title', lineKeys.length, { count: lineKeys.length })"
|
|
66
|
+
>
|
|
67
|
+
<template #body>
|
|
68
|
+
<div class="space-y-3">
|
|
69
|
+
<UInput
|
|
70
|
+
v-model="query"
|
|
71
|
+
:icon="icon('search')"
|
|
72
|
+
:placeholder="t('cart.costCenter.searchPlaceholder')"
|
|
73
|
+
class="w-full"
|
|
74
|
+
/>
|
|
75
|
+
<URadioGroup
|
|
76
|
+
v-model="selectedId"
|
|
77
|
+
:items="[
|
|
78
|
+
...filtered.map(cc => ({
|
|
79
|
+
value: cc.id,
|
|
80
|
+
label: `${cc.code} — ${cc.label}`,
|
|
81
|
+
})),
|
|
82
|
+
...(allowNone ? [{ value: NONE, label: t('cart.costCenter.none') }] : []),
|
|
83
|
+
]"
|
|
84
|
+
/>
|
|
85
|
+
<p
|
|
86
|
+
v-if="filtered.length === 0"
|
|
87
|
+
class="text-sm text-muted"
|
|
88
|
+
>
|
|
89
|
+
{{ t('cart.costCenter.noResults', { query }) }}
|
|
90
|
+
</p>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
<template #footer>
|
|
94
|
+
<UButton
|
|
95
|
+
color="neutral"
|
|
96
|
+
variant="ghost"
|
|
97
|
+
tabindex="0"
|
|
98
|
+
:label="t('cart.item.cancel')"
|
|
99
|
+
@click="open = false"
|
|
100
|
+
/>
|
|
101
|
+
<UButton
|
|
102
|
+
color="primary"
|
|
103
|
+
tabindex="0"
|
|
104
|
+
:disabled="selectedId === null"
|
|
105
|
+
:label="t('cart.costCenter.apply')"
|
|
106
|
+
@click="apply"
|
|
107
|
+
/>
|
|
108
|
+
</template>
|
|
109
|
+
</UModal>
|
|
110
|
+
</template>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Cart export (spec: Warenkorb exportieren) — CSV download with the
|
|
4
|
+
* standardized column structure; XLSX follows once a writer is decided.
|
|
5
|
+
*/
|
|
6
|
+
const open = defineModel<boolean>("open", { default: false });
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
const { locale } = useI18n();
|
|
10
|
+
const toast = useToast();
|
|
11
|
+
const { icon } = useIcons();
|
|
12
|
+
const cart = useCartStore();
|
|
13
|
+
|
|
14
|
+
const exporting = ref(false);
|
|
15
|
+
|
|
16
|
+
async function exportCsv(): Promise<void> {
|
|
17
|
+
exporting.value = true;
|
|
18
|
+
try {
|
|
19
|
+
const csv = await $fetch<string>("/api/cart/export", {
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers: { "x-locale": locale.value },
|
|
22
|
+
body: { items: cart.items },
|
|
23
|
+
});
|
|
24
|
+
const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
|
|
25
|
+
const url = URL.createObjectURL(blob);
|
|
26
|
+
const link = document.createElement("a");
|
|
27
|
+
link.href = url;
|
|
28
|
+
link.download = "cart-export.csv";
|
|
29
|
+
link.click();
|
|
30
|
+
URL.revokeObjectURL(url);
|
|
31
|
+
open.value = false;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
toast.add({
|
|
35
|
+
title: t("cart.export.error"),
|
|
36
|
+
color: "error",
|
|
37
|
+
icon: icon("error"),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
exporting.value = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<UModal
|
|
48
|
+
v-model:open="open"
|
|
49
|
+
:title="t('cart.export.title')"
|
|
50
|
+
>
|
|
51
|
+
<template #body>
|
|
52
|
+
<p class="text-sm text-muted">
|
|
53
|
+
{{ t('cart.export.description') }}
|
|
54
|
+
</p>
|
|
55
|
+
</template>
|
|
56
|
+
<template #footer>
|
|
57
|
+
<UButton
|
|
58
|
+
color="neutral"
|
|
59
|
+
variant="ghost"
|
|
60
|
+
tabindex="0"
|
|
61
|
+
:label="t('cart.item.cancel')"
|
|
62
|
+
@click="open = false"
|
|
63
|
+
/>
|
|
64
|
+
<UButton
|
|
65
|
+
color="primary"
|
|
66
|
+
tabindex="0"
|
|
67
|
+
:loading="exporting"
|
|
68
|
+
:label="t('cart.export.csv')"
|
|
69
|
+
@click="exportCsv"
|
|
70
|
+
/>
|
|
71
|
+
<UTooltip :text="t('cart.export.xlsxSoon')">
|
|
72
|
+
<UButton
|
|
73
|
+
color="primary"
|
|
74
|
+
variant="soft"
|
|
75
|
+
tabindex="0"
|
|
76
|
+
disabled
|
|
77
|
+
:label="t('cart.export.xlsx')"
|
|
78
|
+
/>
|
|
79
|
+
</UTooltip>
|
|
80
|
+
</template>
|
|
81
|
+
</UModal>
|
|
82
|
+
</template>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CART_POSITION_TEXT_COUNT } from "../../../interfaces/cart-item";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Position texts and own article number editor (spec: Positionstexte und
|
|
6
|
+
* eigene Artikelnummer). The own article number is per-position only and
|
|
7
|
+
* therefore hidden in bulk mode.
|
|
8
|
+
*/
|
|
9
|
+
const open = defineModel<boolean>("open", { default: false });
|
|
10
|
+
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
lineKeys: string[];
|
|
13
|
+
}>();
|
|
14
|
+
|
|
15
|
+
const { t } = useI18n();
|
|
16
|
+
const cart = useCartStore();
|
|
17
|
+
const { role } = useB2BContext();
|
|
18
|
+
|
|
19
|
+
const isBulk = computed(() => props.lineKeys.length > 1);
|
|
20
|
+
|
|
21
|
+
const texts = ref<string[]>([]);
|
|
22
|
+
const customSku = ref("");
|
|
23
|
+
|
|
24
|
+
watch(open, (isOpen) => {
|
|
25
|
+
if (!isOpen) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const items = cart.items.filter(i => props.lineKeys.includes(cart.keyOf(i)));
|
|
29
|
+
const first = items[0];
|
|
30
|
+
texts.value = Array.from(
|
|
31
|
+
{ length: CART_POSITION_TEXT_COUNT },
|
|
32
|
+
(_, i) => (!isBulk.value ? first?.positionTexts?.[i] ?? "" : ""),
|
|
33
|
+
);
|
|
34
|
+
customSku.value = !isBulk.value ? first?.customSku ?? "" : "";
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function save(): void {
|
|
38
|
+
cart.setPositionDetails(props.lineKeys, {
|
|
39
|
+
positionTexts: texts.value,
|
|
40
|
+
...(isBulk.value ? {} : { customSku: customSku.value }),
|
|
41
|
+
});
|
|
42
|
+
open.value = false;
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<UModal
|
|
48
|
+
v-model:open="open"
|
|
49
|
+
:title="t('cart.positionTexts.title', lineKeys.length, { count: lineKeys.length })"
|
|
50
|
+
>
|
|
51
|
+
<template #body>
|
|
52
|
+
<div class="space-y-3">
|
|
53
|
+
<UFormField
|
|
54
|
+
v-if="role && !isBulk"
|
|
55
|
+
:label="t('cart.positionTexts.customSku')"
|
|
56
|
+
>
|
|
57
|
+
<UInput
|
|
58
|
+
v-model="customSku"
|
|
59
|
+
class="w-full"
|
|
60
|
+
:placeholder="t('cart.positionTexts.customSkuPlaceholder')"
|
|
61
|
+
/>
|
|
62
|
+
</UFormField>
|
|
63
|
+
<UFormField
|
|
64
|
+
v-for="index in CART_POSITION_TEXT_COUNT"
|
|
65
|
+
:key="index"
|
|
66
|
+
:label="t('cart.positionTexts.textLabel', { index })"
|
|
67
|
+
>
|
|
68
|
+
<UInput
|
|
69
|
+
v-model="texts[index - 1]"
|
|
70
|
+
class="w-full"
|
|
71
|
+
maxlength="80"
|
|
72
|
+
/>
|
|
73
|
+
</UFormField>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
<template #footer>
|
|
77
|
+
<UButton
|
|
78
|
+
color="neutral"
|
|
79
|
+
variant="ghost"
|
|
80
|
+
tabindex="0"
|
|
81
|
+
:label="t('cart.item.cancel')"
|
|
82
|
+
@click="open = false"
|
|
83
|
+
/>
|
|
84
|
+
<UButton
|
|
85
|
+
color="primary"
|
|
86
|
+
tabindex="0"
|
|
87
|
+
:label="t('cart.positionTexts.save')"
|
|
88
|
+
@click="save"
|
|
89
|
+
/>
|
|
90
|
+
</template>
|
|
91
|
+
</UModal>
|
|
92
|
+
</template>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { OrderList, OrderListKind, OrderListPosition } from "../../../interfaces/account/order-lists";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Saves positions to a shopping or label list (account order lists BFF).
|
|
6
|
+
* The whole position is saved — article, quantity, texts, cost center.
|
|
7
|
+
*/
|
|
8
|
+
const open = defineModel<boolean>("open", { default: false });
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
lineKeys: string[];
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const { icon } = useIcons();
|
|
15
|
+
const { t } = useI18n();
|
|
16
|
+
const toast = useToast();
|
|
17
|
+
const cart = useCartStore();
|
|
18
|
+
const authStore = useAuthStore();
|
|
19
|
+
|
|
20
|
+
type Mode = "existing" | "new";
|
|
21
|
+
|
|
22
|
+
const kind = ref<OrderListKind>("shopping");
|
|
23
|
+
const mode = ref<Mode>("existing");
|
|
24
|
+
const listName = ref("");
|
|
25
|
+
const selectedListId = ref<string | null>(null);
|
|
26
|
+
const saving = ref(false);
|
|
27
|
+
|
|
28
|
+
const { data: lists, refresh } = useFetch<OrderList[]>("/api/account/order-lists", {
|
|
29
|
+
key: "account-order-lists",
|
|
30
|
+
server: false,
|
|
31
|
+
lazy: true,
|
|
32
|
+
immediate: false,
|
|
33
|
+
default: () => [],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const ownLists = computed(() =>
|
|
37
|
+
(lists.value ?? []).filter(l => l.owner.id === authStore.user?.$id && l.kind === kind.value),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
watch(open, async (isOpen) => {
|
|
41
|
+
if (!isOpen) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
listName.value = "";
|
|
45
|
+
await refresh();
|
|
46
|
+
const first = ownLists.value[0];
|
|
47
|
+
selectedListId.value = first?.id ?? null;
|
|
48
|
+
mode.value = first ? "existing" : "new";
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
watch(kind, () => {
|
|
52
|
+
const first = ownLists.value[0];
|
|
53
|
+
selectedListId.value = first?.id ?? null;
|
|
54
|
+
mode.value = first ? "existing" : "new";
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const canSave = computed(() =>
|
|
58
|
+
mode.value === "existing" ? Boolean(selectedListId.value) : listName.value.trim().length > 0,
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
function selectedPositions(): OrderListPosition[] {
|
|
62
|
+
return cart.items
|
|
63
|
+
.filter(i => props.lineKeys.includes(cart.keyOf(i)))
|
|
64
|
+
.map(i => ({
|
|
65
|
+
id: i.id,
|
|
66
|
+
sku: i.sku,
|
|
67
|
+
name: i.name,
|
|
68
|
+
...(i.image ? { image: i.image } : {}),
|
|
69
|
+
quantity: i.quantity,
|
|
70
|
+
...(i.unit ? { unit: i.unit } : {}),
|
|
71
|
+
price: i.price,
|
|
72
|
+
...(typeof i.taxRate === "number" ? { taxRate: i.taxRate } : {}),
|
|
73
|
+
...(i.costCenterId ? { costCenterId: i.costCenterId } : {}),
|
|
74
|
+
...(i.positionTexts ? { positionTexts: i.positionTexts } : {}),
|
|
75
|
+
...(i.customSku ? { customSku: i.customSku } : {}),
|
|
76
|
+
...(i.categorySlug ? { categorySlug: i.categorySlug } : {}),
|
|
77
|
+
...(i.subcategorySlug ? { subcategorySlug: i.subcategorySlug } : {}),
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function save(): Promise<void> {
|
|
82
|
+
const positions = selectedPositions();
|
|
83
|
+
saving.value = true;
|
|
84
|
+
try {
|
|
85
|
+
let name: string;
|
|
86
|
+
if (mode.value === "existing" && selectedListId.value) {
|
|
87
|
+
const target = ownLists.value.find(l => l.id === selectedListId.value);
|
|
88
|
+
await $fetch(`/api/account/order-lists/${selectedListId.value}`, {
|
|
89
|
+
method: "PUT",
|
|
90
|
+
body: { appendPositions: positions },
|
|
91
|
+
});
|
|
92
|
+
name = target?.name ?? "";
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
name = listName.value.trim();
|
|
96
|
+
await $fetch("/api/account/order-lists", {
|
|
97
|
+
method: "POST",
|
|
98
|
+
body: { name, kind: kind.value, public: false, positions },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
toast.add({
|
|
102
|
+
title: t("cart.saveToList.success", positions.length, { count: positions.length, list: name }),
|
|
103
|
+
color: "success",
|
|
104
|
+
icon: icon("success"),
|
|
105
|
+
duration: 2500,
|
|
106
|
+
});
|
|
107
|
+
open.value = false;
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
toast.add({ title: t("orderLists.error"), color: "error", icon: icon("error") });
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
saving.value = false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<template>
|
|
119
|
+
<UModal
|
|
120
|
+
v-model:open="open"
|
|
121
|
+
:title="t('cart.saveToList.title', lineKeys.length, { count: lineKeys.length })"
|
|
122
|
+
>
|
|
123
|
+
<template #body>
|
|
124
|
+
<div class="space-y-4">
|
|
125
|
+
<URadioGroup
|
|
126
|
+
v-model="kind"
|
|
127
|
+
:items="[
|
|
128
|
+
{ value: 'shopping', label: t('cart.saveToList.shoppingList') },
|
|
129
|
+
{ value: 'label', label: t('cart.saveToList.labelList') },
|
|
130
|
+
]"
|
|
131
|
+
orientation="horizontal"
|
|
132
|
+
/>
|
|
133
|
+
<URadioGroup
|
|
134
|
+
v-model="mode"
|
|
135
|
+
:items="[
|
|
136
|
+
{ value: 'existing', label: t('cart.saveToList.existing'), disabled: ownLists.length === 0 },
|
|
137
|
+
{ value: 'new', label: t('cart.saveToList.new') },
|
|
138
|
+
]"
|
|
139
|
+
orientation="horizontal"
|
|
140
|
+
/>
|
|
141
|
+
<USelect
|
|
142
|
+
v-if="mode === 'existing'"
|
|
143
|
+
v-model="selectedListId"
|
|
144
|
+
:items="ownLists.map(l => ({ value: l.id, label: l.name }))"
|
|
145
|
+
class="w-full"
|
|
146
|
+
:placeholder="t('cart.saveToList.selectPlaceholder')"
|
|
147
|
+
/>
|
|
148
|
+
<UInput
|
|
149
|
+
v-else
|
|
150
|
+
v-model="listName"
|
|
151
|
+
class="w-full"
|
|
152
|
+
:placeholder="t('cart.saveToList.namePlaceholder')"
|
|
153
|
+
/>
|
|
154
|
+
<p class="text-xs text-muted">
|
|
155
|
+
{{ t('cart.saveToList.hint') }}
|
|
156
|
+
</p>
|
|
157
|
+
</div>
|
|
158
|
+
</template>
|
|
159
|
+
<template #footer>
|
|
160
|
+
<UButton
|
|
161
|
+
color="neutral"
|
|
162
|
+
variant="ghost"
|
|
163
|
+
tabindex="0"
|
|
164
|
+
:label="t('cart.item.cancel')"
|
|
165
|
+
@click="open = false"
|
|
166
|
+
/>
|
|
167
|
+
<UButton
|
|
168
|
+
color="primary"
|
|
169
|
+
tabindex="0"
|
|
170
|
+
:disabled="!canSave"
|
|
171
|
+
:loading="saving"
|
|
172
|
+
:label="t('cart.saveToList.save')"
|
|
173
|
+
@click="save"
|
|
174
|
+
/>
|
|
175
|
+
</template>
|
|
176
|
+
</UModal>
|
|
177
|
+
</template>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ApprovalWorkflow } from "../../../interfaces/b2b";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Workflow selection when a requester belongs to several workflows
|
|
6
|
+
* (spec: CTA für Anforderer, Auswahl-Modal).
|
|
7
|
+
*/
|
|
8
|
+
const open = defineModel<boolean>("open", { default: false });
|
|
9
|
+
|
|
10
|
+
defineProps<{
|
|
11
|
+
workflows: ApprovalWorkflow[];
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits<{
|
|
15
|
+
(e: "select", workflowId: string): void;
|
|
16
|
+
}>();
|
|
17
|
+
|
|
18
|
+
const { t } = useI18n();
|
|
19
|
+
const selectedId = ref<string | null>(null);
|
|
20
|
+
|
|
21
|
+
function stepSummary(workflow: ApprovalWorkflow): string {
|
|
22
|
+
const orderers = workflow.steps
|
|
23
|
+
.filter(step => step.type === "order")
|
|
24
|
+
.flatMap(step => step.users.map(u => u.name));
|
|
25
|
+
return t("cart.workflow.stepSummary", {
|
|
26
|
+
steps: workflow.steps.length,
|
|
27
|
+
orderers: orderers.join(", "),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<UModal
|
|
34
|
+
v-model:open="open"
|
|
35
|
+
:title="t('cart.workflow.pickTitle')"
|
|
36
|
+
>
|
|
37
|
+
<template #body>
|
|
38
|
+
<URadioGroup
|
|
39
|
+
v-model="selectedId"
|
|
40
|
+
:items="workflows.map(wf => ({
|
|
41
|
+
value: wf.id,
|
|
42
|
+
label: wf.name,
|
|
43
|
+
description: stepSummary(wf),
|
|
44
|
+
}))"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
<template #footer>
|
|
48
|
+
<UButton
|
|
49
|
+
color="neutral"
|
|
50
|
+
variant="ghost"
|
|
51
|
+
tabindex="0"
|
|
52
|
+
:label="t('cart.item.cancel')"
|
|
53
|
+
@click="open = false"
|
|
54
|
+
/>
|
|
55
|
+
<UButton
|
|
56
|
+
color="primary"
|
|
57
|
+
tabindex="0"
|
|
58
|
+
:disabled="!selectedId"
|
|
59
|
+
:label="t('cart.workflow.continue')"
|
|
60
|
+
@click="selectedId && emit('select', selectedId)"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
63
|
+
</UModal>
|
|
64
|
+
</template>
|