diff --git a/backend-packages.json b/backend-packages.json index fa9c1905b6..be3b68c833 100644 --- a/backend-packages.json +++ b/backend-packages.json @@ -1,11 +1,10 @@ { "ManifestVersion": "2.0", - "PlatformVersion": "3.915.0", - "ThemeB2BVue": "https://github.com/VirtoCommerce/vc-frontend/releases/download/2.21.0/vc-theme-b2b-vue-2.21.0.zip", + "PlatformVersion": "3.917.0", "PlatformImage": "ghcr.io/virtocommerce/platform", - "PlatformImageTag": "3.887.8", + "PlatformImageTag": "3.917.0", "PlatformAssetUrl": "", - "BundleVersion": "11.0.3", + "ModuleSources": ["https://raw.githubusercontent.com/VirtoCommerce/vc-modules/master/modules_v3.json"], "Sources": [ { "Name": "AzureBlob", @@ -13,8 +12,16 @@ "ServiceUri": "https://vc3prerelease.blob.core.windows.net", "Modules": [ { - "Id": "VirtoCommerce.PageBuilderModule", - "BlobName": "VirtoCommerce.PageBuilderModule_3.828.0-alpha.745-dev.zip" + "BlobName": "VirtoCommerce.PageBuilderModule_3.830.0-pr-90-ddb3.zip" + }, + { + "BlobName": "VirtoCommerce.XFrontend_3.800.0-pr-1-34c4.zip" + }, + { + "BlobName": "VirtoCommerce.Xapi_3.928.0-pr-54-c535.zip" + }, + { + "BlobName": "VirtoCommerce.XPickup_3.803.0-pr-3-174e.zip" } ] }, @@ -23,56 +30,56 @@ "ModuleSources": ["https://raw.githubusercontent.com/VirtoCommerce/vc-modules/master/modules_v3.json"], "Modules": [ { - "Id": "VirtoCommerce.ApplicationInsights", - "Version": "3.806.0" + "Id": "VirtoCommerce.Contentful", + "Version": "3.805.0" }, { - "Id": "VirtoCommerce.Assets", - "Version": "3.813.0" + "Id": "VirtoCommerce.NativePaymentMethods", + "Version": "3.802.0" }, { - "Id": "VirtoCommerce.AuthorizeNetPayment", - "Version": "3.805.0" + "Id": "VirtoCommerce.MarketingExperienceApi", + "Version": "3.901.0" }, { - "Id": "VirtoCommerce.AvalaraTax", - "Version": "3.804.0" + "Id": "VirtoCommerce.Skyflow", + "Version": "3.901.0" }, { - "Id": "VirtoCommerce.AzureAD", - "Version": "3.804.0" + "Id": "VirtoCommerce.CyberSourcePayment", + "Version": "3.802.0" }, { - "Id": "VirtoCommerce.AzureBlobAssets", - "Version": "3.811.0" + "Id": "VirtoCommerce.FileExperienceApi", + "Version": "3.905.0" }, { - "Id": "VirtoCommerce.AzureSearch", - "Version": "3.808.0" + "Id": "VirtoCommerce.AvalaraTax", + "Version": "3.804.0" }, { - "Id": "VirtoCommerce.BackInStock", - "Version": "3.804.0" + "Id": "VirtoCommerce.WhiteLabeling", + "Version": "3.908.0" }, { - "Id": "VirtoCommerce.BuilderIO", - "Version": "3.805.0" + "Id": "VirtoCommerce.XRecommend", + "Version": "3.904.0" }, { - "Id": "VirtoCommerce.BulkActionsModule", - "Version": "3.804.0" + "Id": "VirtoCommerce.XOrder", + "Version": "3.913.0" }, { - "Id": "VirtoCommerce.Cart", - "Version": "3.839.0" + "Id": "VirtoCommerce.SqlQueries", + "Version": "3.801.0" }, { - "Id": "VirtoCommerce.Catalog", - "Version": "3.902.0" + "Id": "VirtoCommerce.OpenSearch", + "Version": "3.801.0" }, { - "Id": "VirtoCommerce.CatalogCsvImportModule", - "Version": "3.816.0" + "Id": "VirtoCommerce.OpenIdConnectModule", + "Version": "3.802.0" }, { "Id": "VirtoCommerce.CatalogPersonalization", @@ -83,248 +90,240 @@ "Version": "3.808.0" }, { - "Id": "VirtoCommerce.Content", - "Version": "3.830.0" + "Id": "VirtoCommerce.Orders", + "Version": "3.862.0" }, { - "Id": "VirtoCommerce.Contentful", + "Id": "VirtoCommerce.CatalogCsvImportModule", + "Version": "3.816.0" + }, + { + "Id": "VirtoCommerce.PriceExportImport", "Version": "3.805.0" }, { - "Id": "VirtoCommerce.Contracts", - "Version": "3.905.0" + "Id": "VirtoCommerce.Inventory", + "Version": "3.814.0" }, { - "Id": "VirtoCommerce.Core", - "Version": "3.822.0" + "Id": "VirtoCommerce.News", + "Version": "3.812.0" }, { - "Id": "VirtoCommerce.Customer", - "Version": "3.845.0" + "Id": "VirtoCommerce.Cart", + "Version": "3.839.0" }, { "Id": "VirtoCommerce.CustomerExportImport", "Version": "3.814.0" }, { - "Id": "VirtoCommerce.CustomerReviews", - "Version": "3.906.0" + "Id": "VirtoCommerce.Pricing", + "Version": "3.821.0" }, { - "Id": "VirtoCommerce.CyberSourcePayment", - "Version": "3.802.0" + "Id": "VirtoCommerce.DynamicAssociationsModule", + "Version": "3.810.0" }, { - "Id": "VirtoCommerce.Datatrans", - "Version": "3.800.0" + "Id": "VirtoCommerce.XCatalog", + "Version": "3.941.0" }, { - "Id": "VirtoCommerce.DynamicAssociationsModule", - "Version": "3.810.0" + "Id": "VirtoCommerce.Contracts", + "Version": "3.905.0" }, { - "Id": "VirtoCommerce.ElasticAppSearch", - "Version": "3.815.0" + "Id": "VirtoCommerce.BackInStock", + "Version": "3.804.0" }, { - "Id": "VirtoCommerce.ElasticSearch", - "Version": "3.806.0" + "Id": "VirtoCommerce.OrderManagement", + "Version": "3.807.0" }, { - "Id": "VirtoCommerce.ElasticSearch8", - "Version": "3.822.0" + "Id": "VirtoCommerce.Marketing", + "Version": "3.823.0" }, { - "Id": "VirtoCommerce.EventBus", + "Id": "VirtoCommerce.GDPR", "Version": "3.808.0" }, { - "Id": "VirtoCommerce.Export", - "Version": "3.807.0" + "Id": "VirtoCommerce.Datatrans", + "Version": "3.800.0" }, { - "Id": "VirtoCommerce.FileExperienceApi", - "Version": "3.905.0" + "Id": "VirtoCommerce.AuthorizeNetPayment", + "Version": "3.805.0" }, { - "Id": "VirtoCommerce.FileSystemAssets", - "Version": "3.805.0" + "Id": "VirtoCommerce.Quote", + "Version": "3.912.0" }, { - "Id": "VirtoCommerce.GDPR", - "Version": "3.808.0" + "Id": "VirtoCommerce.CustomerReviews", + "Version": "3.906.0" }, { - "Id": "VirtoCommerce.GoogleEcommerceAnalytics", - "Version": "4.805.0" + "Id": "VirtoCommerce.ElasticSearch", + "Version": "3.806.0" }, { - "Id": "VirtoCommerce.GoogleSSO", - "Version": "3.803.0" + "Id": "VirtoCommerce.PushMessages", + "Version": "3.905.0" }, { - "Id": "VirtoCommerce.ImageTools", + "Id": "VirtoCommerce.Return", "Version": "3.812.0" }, { - "Id": "VirtoCommerce.Inventory", - "Version": "3.814.0" + "Id": "VirtoCommerce.ShipStation", + "Version": "3.802.0" }, { - "Id": "VirtoCommerce.Loyalty", - "Version": "3.800.0" + "Id": "VirtoCommerce.Sitemaps", + "Version": "3.820.0" }, { - "Id": "VirtoCommerce.LuceneSearch", - "Version": "3.805.0" + "Id": "VirtoCommerce.Subscription", + "Version": "3.811.0" }, { - "Id": "VirtoCommerce.Marketing", - "Version": "3.823.0" + "Id": "VirtoCommerce.TaskManagement", + "Version": "3.905.0" }, { - "Id": "VirtoCommerce.MarketingExperienceApi", - "Version": "3.901.0" + "Id": "VirtoCommerce.Pages", + "Version": "3.810.0" }, { - "Id": "VirtoCommerce.NativePaymentMethods", - "Version": "3.802.0" + "Id": "VirtoCommerce.XCMS", + "Version": "3.903.0" }, { - "Id": "VirtoCommerce.News", - "Version": "3.812.0" + "Id": "VirtoCommerce.BuilderIO", + "Version": "3.806.0" }, { "Id": "VirtoCommerce.Notifications", - "Version": "3.827.0" + "Version": "3.830.0" }, { - "Id": "VirtoCommerce.OpenIdConnectModule", - "Version": "3.802.0" + "Id": "VirtoCommerce.XCart", + "Version": "3.949.0" }, { - "Id": "VirtoCommerce.OpenSearch", - "Version": "3.801.0" + "Id": "VirtoCommerce.ProfileExperienceApiModule", + "Version": "3.925.0" }, { - "Id": "VirtoCommerce.OrderManagement", + "Id": "VirtoCommerce.ApplicationInsights", "Version": "3.807.0" }, { - "Id": "VirtoCommerce.Orders", - "Version": "3.862.0" - }, - { - "Id": "VirtoCommerce.Pages", - "Version": "3.809.0" - }, - { - "Id": "VirtoCommerce.Payment", - "Version": "3.810.0" + "Id": "VirtoCommerce.Assets", + "Version": "3.815.0" }, { - "Id": "VirtoCommerce.PriceExportImport", + "Id": "VirtoCommerce.AzureAD", "Version": "3.805.0" }, { - "Id": "VirtoCommerce.Pricing", - "Version": "3.821.0" + "Id": "VirtoCommerce.Core", + "Version": "3.824.0" }, { - "Id": "VirtoCommerce.ProfileExperienceApiModule", - "Version": "3.923.0" + "Id": "VirtoCommerce.EventBus", + "Version": "3.809.0" }, { - "Id": "VirtoCommerce.PushMessages", - "Version": "3.905.0" + "Id": "VirtoCommerce.GoogleSSO", + "Version": "3.804.0" }, { - "Id": "VirtoCommerce.Quote", - "Version": "3.912.0" + "Id": "VirtoCommerce.Search", + "Version": "3.821.0" }, { - "Id": "VirtoCommerce.Return", - "Version": "3.812.0" + "Id": "VirtoCommerce.Seo", + "Version": "3.811.0" }, { - "Id": "VirtoCommerce.Search", - "Version": "3.819.0" + "Id": "VirtoCommerce.AzureBlobAssets", + "Version": "3.812.0" }, { - "Id": "VirtoCommerce.Seo", + "Id": "VirtoCommerce.AzureSearch", "Version": "3.809.0" }, { - "Id": "VirtoCommerce.Shipping", - "Version": "3.815.0" - }, - { - "Id": "VirtoCommerce.ShipStation", - "Version": "3.801.0" + "Id": "VirtoCommerce.BulkActionsModule", + "Version": "3.805.0" }, { - "Id": "VirtoCommerce.Sitemaps", - "Version": "3.819.0" + "Id": "VirtoCommerce.WebHooks", + "Version": "3.811.0" }, { - "Id": "VirtoCommerce.Skyflow", - "Version": "3.901.0" + "Id": "VirtoCommerce.ElasticAppSearch", + "Version": "3.816.0" }, { - "Id": "VirtoCommerce.SqlQueries", - "Version": "3.801.0" + "Id": "VirtoCommerce.ElasticSearch8", + "Version": "3.824.0" }, { - "Id": "VirtoCommerce.Store", - "Version": "3.822.0" + "Id": "VirtoCommerce.Export", + "Version": "3.808.0" }, { - "Id": "VirtoCommerce.Subscription", - "Version": "3.810.0" + "Id": "VirtoCommerce.FileSystemAssets", + "Version": "3.806.0" }, { - "Id": "VirtoCommerce.TaskManagement", - "Version": "3.904.0" + "Id": "VirtoCommerce.ImageTools", + "Version": "3.813.0" }, { - "Id": "VirtoCommerce.Tax", - "Version": "3.805.0" + "Id": "VirtoCommerce.LuceneSearch", + "Version": "3.806.0" }, { - "Id": "VirtoCommerce.WebHooks", - "Version": "3.809.0" + "Id": "VirtoCommerce.Store", + "Version": "3.823.0" }, { - "Id": "VirtoCommerce.WhiteLabeling", - "Version": "3.908.0" + "Id": "VirtoCommerce.Catalog", + "Version": "3.904.0" }, { - "Id": "VirtoCommerce.Xapi", - "Version": "3.926.0" + "Id": "VirtoCommerce.GoogleEcommerceAnalytics", + "Version": "4.806.0" }, { - "Id": "VirtoCommerce.XCart", - "Version": "3.947.0" + "Id": "VirtoCommerce.Customer", + "Version": "3.846.0" }, { - "Id": "VirtoCommerce.XCatalog", - "Version": "3.941.0" + "Id": "VirtoCommerce.Content", + "Version": "3.833.0" }, { - "Id": "VirtoCommerce.XCMS", - "Version": "3.902.0" + "Id": "VirtoCommerce.Payment", + "Version": "3.811.0" }, { - "Id": "VirtoCommerce.XOrder", - "Version": "3.913.0" + "Id": "VirtoCommerce.Shipping", + "Version": "3.816.0" }, { - "Id": "VirtoCommerce.XPickup", - "Version": "3.802.0" + "Id": "VirtoCommerce.Tax", + "Version": "3.807.0" }, { - "Id": "VirtoCommerce.XRecommend", - "Version": "3.904.0" + "Id": "VirtoCommerce.Loyalty", + "Version": "3.800.0" } ] } diff --git a/client-app/modules/back-in-stock/index.ts b/client-app/modules/back-in-stock/index.ts index c8c13fa238..c7e8bc946c 100644 --- a/client-app/modules/back-in-stock/index.ts +++ b/client-app/modules/back-in-stock/index.ts @@ -2,8 +2,8 @@ import { defineAsyncComponent } from "vue"; import { useNavigations } from "@/core/composables"; import { useModuleSettings } from "@/core/composables/useModuleSettings"; import { useUser } from "@/shared/account/composables"; -import { useCustomProductComponents } from "@/shared/common/composables"; -import { CUSTOM_PRODUCT_COMPONENT_IDS } from "@/shared/common/constants"; +import { useExtensionRegistry } from "@/shared/common/composables/extensionRegistry/useExtensionRegistry"; +import { EXTENSION_NAMES } from "@/shared/common/constants"; import { loadModuleLocale } from "../utils"; import { MODULE_ID, ENABLED_KEY } from "./constants"; import type { MenuType } from "@/core/types"; @@ -17,7 +17,7 @@ const BackInStockButton = defineAsyncComponent(() => import("./components/back-i const { isEnabled } = useModuleSettings(MODULE_ID); const { mergeMenuSchema } = useNavigations(); -const { registerComponent } = useCustomProductComponents(); +const { register } = useExtensionRegistry(); const route: RouteRecordRaw = { path: "back-in-stock", @@ -64,16 +64,17 @@ export function init(router: Router, i18n: I18n) { } if (isAuthenticated.value && isEnabled(ENABLED_KEY)) { mergeMenuSchema(menuItems); - registerComponent({ - id: CUSTOM_PRODUCT_COMPONENT_IDS.CARD_BUTTON, + register("productCard", EXTENSION_NAMES.productCard.cardButton, { component: BackInStockButton, - shouldRender: (product, options) => - !product.availabilityData.isInStock && (options?.forceProductAsVariation === true || !product.hasVariations), + condition: (product) => !product.availabilityData?.isInStock && !product.hasVariations, }); - registerComponent({ - id: CUSTOM_PRODUCT_COMPONENT_IDS.PAGE_SIDEBAR_BUTTON, + register("productPage", EXTENSION_NAMES.productPage.sidebarButton, { component: BackInStockButton, - shouldRender: (product) => !product.availabilityData.isInStock && !product.hasVariations, + condition: (product) => !product.availabilityData?.isInStock && !product.hasVariations, + }); + register("productPage", EXTENSION_NAMES.productPage.variationItemButton, { + component: BackInStockButton, + condition: (product) => !product.availabilityData?.isInStock, }); } } diff --git a/client-app/modules/push-messages/index.ts b/client-app/modules/push-messages/index.ts index ad2fa3f1cc..5a984309d7 100644 --- a/client-app/modules/push-messages/index.ts +++ b/client-app/modules/push-messages/index.ts @@ -7,15 +7,11 @@ import { MODULE_ID_PUSH_MESSAGES } from "@/core/constants/modules"; import { loadModuleLocale } from "@/modules/utils"; import { ROUTES } from "@/router/routes/constants"; import { useUser } from "@/shared/account/composables/useUser"; -import { useCustomHeaderLinkComponents } from "@/shared/layout/composables/useCustomHeaderLinkComponents"; -import { useCustomMobileHeaderComponents } from "@/shared/layout/composables/useCustomMobileHeaderComponents"; -import { useCustomMobileMenuLinkComponents } from "@/shared/layout/composables/useCustomMobileMenuLinkComponents"; +import { useExtensionRegistry } from "@/shared/common/composables/extensionRegistry/useExtensionRegistry"; import { pushMessagesTypePolices } from "./api/graphql/typePolices"; import { PUSH_MESSAGES_MODULE_ENABLED_KEY, PUSH_MESSAGES_MODULE_FCM_ENABLED_KEY } from "./constants"; import type { MenuType } from "@/core/types"; import type { I18n } from "@/i18n"; -import type { ElementType } from "@/shared/layout/composables/useCustomHeaderLinkComponents"; -import type { ElementType as HeaderElementType } from "@/shared/layout/composables/useCustomMobileHeaderComponents"; import type { DeepPartial } from "utility-types"; import type { Router, RouteRecordRaw } from "vue-router"; @@ -67,17 +63,17 @@ const menuItems: DeepPartial = { const Notifications = () => import("@/modules/push-messages/pages/notifications.vue"); const PushMessage = () => import("@/modules/push-messages/pages/push-message.vue"); -const menuLinkCustomElement: ElementType = { +const menuLinkCustomElement = { id: "push-messages", component: defineAsyncComponent(() => import("./components/link-push-messages.vue")), }; -const menuLinkCustomElementMobile: ElementType = { +const menuLinkCustomElementMobile = { id: "push-messages", component: defineAsyncComponent(() => import("./components/link-push-messages-mobile.vue")), }; -const headerWidgetCustomElementMobile: HeaderElementType = { +const headerWidgetCustomElementMobile = { id: "push-messages", component: defineAsyncComponent(() => import("./components/push-messages-mobile.vue")), }; @@ -108,9 +104,7 @@ export async function init(router: Router, i18n: I18n) { if (isModuleEnabled) { const { mergeMenuSchema } = useNavigations(); - const { registerCustomLinkComponent } = useCustomHeaderLinkComponents(); - const { registerCustomLinkComponent: registerCustomMobileLinkComponent } = useCustomMobileMenuLinkComponents(); - const { registerCustomComponent: registerCustomMobileHeaderComponent } = useCustomMobileHeaderComponents(); + const { register } = useExtensionRegistry(); const route: RouteRecordRaw = { path: "notifications", name: "Notifications", @@ -120,9 +114,17 @@ export async function init(router: Router, i18n: I18n) { cache.policies.addTypePolicies(pushMessagesTypePolices); mergeMenuSchema(menuItems); void loadModuleLocale(i18n, "push-messages"); - registerCustomLinkComponent(menuLinkCustomElement); - registerCustomMobileLinkComponent(menuLinkCustomElementMobile); - registerCustomMobileHeaderComponent(headerWidgetCustomElementMobile); + + register("headerMenu", "push-messages", { + component: menuLinkCustomElement.component, + }); + register("mobileMenu", "push-messages", { + component: menuLinkCustomElementMobile.component, + }); + register("mobileHeader", "push-messages", { + component: headerWidgetCustomElementMobile.component, + }); + router.addRoute("Account", route); // NOTE: This route must be added before any asynchronous calls. Delaying it can cause a 404 error if accessed prematurely. } diff --git a/client-app/shared/catalog/components/product-card.vue b/client-app/shared/catalog/components/product-card.vue index 9368f6dd7b..0999c8ad65 100644 --- a/client-app/shared/catalog/components/product-card.vue +++ b/client-app/shared/catalog/components/product-card.vue @@ -64,15 +64,12 @@ :single-line="viewMode === 'grid'" /> -
- @@ -117,8 +114,7 @@ import { useShortCart } from "@/shared/cart/composables"; import { useConfigurableProduct } from "@/shared/catalog/composables"; import { useProductVariationProperties } from "@/shared/catalog/composables/useProductVariationProperties"; import { PRODUCT_VARIATIONS_LAYOUT_PROPERTY_VALUES } from "@/shared/catalog/constants/product"; -import { useCustomProductComponents } from "@/shared/common/composables"; -import { CUSTOM_PRODUCT_COMPONENT_IDS } from "@/shared/common/constants"; +import { EXTENSION_NAMES } from "@/shared/common/constants"; import CountInCart from "./count-in-cart.vue"; import InStock from "./in-stock.vue"; import Price from "./price.vue"; @@ -139,7 +135,6 @@ const variations = toRef(props, "variations"); const { cart } = useShortCart(); const { configuredLineItem, loading: configuredLineItemLoading } = useConfigurableProduct(product.value.id); -const { getComponent, isComponentRegistered, shouldRenderComponent, getComponentProps } = useCustomProductComponents(); const { variationResult } = useProductVariationProperties(computed(() => variations.value ?? [])); const isDigital = computed(() => props.product.productType === ProductType.Digital); diff --git a/client-app/shared/catalog/components/product/variations-default.vue b/client-app/shared/catalog/components/product/variations-default.vue index b2cfbf1781..137f2e4f99 100644 --- a/client-app/shared/catalog/components/product/variations-default.vue +++ b/client-app/shared/catalog/components/product/variations-default.vue @@ -16,16 +16,11 @@ with-properties show-placed-price > - @@ -56,8 +51,7 @@ import { PropertyType } from "@/core/api/graphql/types"; import { useBrowserTarget } from "@/core/composables"; import { getPropertiesGroupedByName } from "@/core/utilities"; import { PRODUCT_VARIATIONS_LAYOUT_PROPERTY_NAME } from "@/shared/catalog/constants/product"; -import { useCustomProductComponents } from "@/shared/common/composables"; -import { CUSTOM_PRODUCT_COMPONENT_IDS } from "@/shared/common/constants"; +import { EXTENSION_NAMES } from "@/shared/common/constants"; import CountInCart from "../count-in-cart.vue"; import InStock from "../in-stock.vue"; import type { Product } from "@/core/api/graphql/types"; @@ -81,8 +75,6 @@ const pageNumber = toRef(props, "pageNumber"); const { browserTarget } = useBrowserTarget(); -const { isComponentRegistered, getComponent, shouldRenderComponent, getComponentProps } = useCustomProductComponents(); - function getProperties(variation: Product) { return Object.values( getPropertiesGroupedByName(sortBy(variation.properties, ["displayOrder", "name"]) ?? [], PropertyType.Variation), diff --git a/client-app/shared/catalog/components/product/variations-table.vue b/client-app/shared/catalog/components/product/variations-table.vue index c470c1bf54..527f3a6106 100644 --- a/client-app/shared/catalog/components/product/variations-table.vue +++ b/client-app/shared/catalog/components/product/variations-table.vue @@ -72,16 +72,11 @@ - @@ -101,8 +96,7 @@ import { useI18n } from "vue-i18n"; import { PropertyType } from "@/core/api/graphql/types"; import { MAX_DISPLAY_IN_STOCK_QUANTITY } from "@/core/constants"; import { getPropertyValue, getPropertiesGroupedByName } from "@/core/utilities"; -import { useCustomProductComponents } from "@/shared/common/composables"; -import { CUSTOM_PRODUCT_COMPONENT_IDS } from "@/shared/common/constants"; +import { EXTENSION_NAMES } from "@/shared/common/constants"; import CountInCart from "../count-in-cart.vue"; import type { Product } from "@/core/api/graphql/types"; import type { ISortInfo } from "@/core/types"; @@ -133,8 +127,6 @@ const props = defineProps(); const { t } = useI18n(); -const { isComponentRegistered, getComponent, shouldRenderComponent, getComponentProps } = useCustomProductComponents(); - const variations = computed(() => props.variations); const productProperties = computed(() => { const properties: IProductProperties[] = []; diff --git a/client-app/shared/common/composables/index.ts b/client-app/shared/common/composables/index.ts index 520bac9a93..cabb59a8b6 100644 --- a/client-app/shared/common/composables/index.ts +++ b/client-app/shared/common/composables/index.ts @@ -1,3 +1,2 @@ -export * from "./useCustomProductComponents"; export * from "./useGoogleMaps"; export * from "./useSlugInfo"; diff --git a/client-app/shared/common/composables/useCustomProductComponents.ts b/client-app/shared/common/composables/useCustomProductComponents.ts deleted file mode 100644 index 37929195b0..0000000000 --- a/client-app/shared/common/composables/useCustomProductComponents.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { createGlobalState } from "@vueuse/core"; -import { shallowRef } from "vue"; -import { Logger } from "@/core/utilities"; -import type { Product } from "@/core/api/graphql/types"; -import type { DefineComponent } from "vue"; - -export type ElementType = { - id: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - component: DefineComponent<{ product: Product }, Record, any>; - shouldRender?: (product: Product, options?: ProductComponentOptions) => boolean; - props?: Record; -}; - -export type ProductComponentOptions = { - forceProductAsVariation: boolean; -}; - -function _useCustomProductComponents() { - const customProductComponents = shallowRef<{ [key: string]: ElementType }>({}); - - function registerComponent(element: ElementType) { - if (!customProductComponents.value[element.id]) { - customProductComponents.value[element.id] = element; - } else { - Logger.warn(`useCustomProductComponents: Custom product component with id ${element.id} already registered`); - } - } - - function getComponent(id: string) { - return customProductComponents.value[id]?.component; - } - - function isComponentRegistered(id: string) { - return customProductComponents.value[id] !== undefined; - } - - function shouldRenderComponent(id: string, product: Product, options?: ProductComponentOptions) { - return typeof customProductComponents.value[id]?.shouldRender === "function" - ? customProductComponents.value[id]?.shouldRender(product, options) - : true; - } - - function getComponentProps(id: string) { - return customProductComponents.value[id]?.props; - } - - return { - registerComponent, - getComponent, - isComponentRegistered, - shouldRenderComponent, - getComponentProps, - }; -} - -export const useCustomProductComponents = createGlobalState(_useCustomProductComponents); diff --git a/client-app/shared/common/constants/customProductComponents.ts b/client-app/shared/common/constants/customProductComponents.ts deleted file mode 100644 index 59b42d1c96..0000000000 --- a/client-app/shared/common/constants/customProductComponents.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const CUSTOM_PRODUCT_COMPONENT_IDS = { - CARD_BUTTON: "card-button", - PAGE_SIDEBAR_BUTTON: "page-sidebar-button", -}; diff --git a/client-app/shared/common/constants/extensionPointsNames.ts b/client-app/shared/common/constants/extensionPointsNames.ts index 0f8dc9cae7..0387ddbb49 100644 --- a/client-app/shared/common/constants/extensionPointsNames.ts +++ b/client-app/shared/common/constants/extensionPointsNames.ts @@ -14,6 +14,7 @@ export const EXTENSION_NAMES = merge({}, INITIAL_EXTENSION_NAMES, { }, productPage: { sidebarButton: "sidebar-button", + variationItemButton: "variation-item-button", }, paymentPage: { paymentMethods: "payment-methods", diff --git a/client-app/shared/common/constants/index.ts b/client-app/shared/common/constants/index.ts index 45805303e9..d2bc564807 100644 --- a/client-app/shared/common/constants/index.ts +++ b/client-app/shared/common/constants/index.ts @@ -1 +1 @@ -export * from "./customProductComponents"; +export * from "./extensionPointsNames"; diff --git a/client-app/shared/layout/components/header/_internal/bottom-header.vue b/client-app/shared/layout/components/header/_internal/bottom-header.vue index 2dd45e0aa3..ec2365ddd2 100644 --- a/client-app/shared/layout/components/header/_internal/bottom-header.vue +++ b/client-app/shared/layout/components/header/_internal/bottom-header.vue @@ -42,7 +42,9 @@
  • - + + +
@@ -79,7 +81,6 @@ import { useRoute, useRouter } from "vue-router"; import { useNavigations, useWhiteLabeling } from "@/core/composables"; import { useUser } from "@/shared/account/composables/useUser"; import { SearchBar } from "@/shared/layout"; -import { useCustomHeaderLinkComponents } from "@/shared/layout/composables/useCustomHeaderLinkComponents"; import CatalogMenu from "./catalog-menu.vue"; import type { StyleValue } from "vue"; import LinkDefault from "@/shared/layout/components/header/_internal/link-components/link-default.vue"; @@ -94,7 +95,6 @@ const router = useRouter(); const { organization } = useUser(); const { logoUrl } = useWhiteLabeling(); const { catalogMenuItems, desktopMainMenuItems } = useNavigations(); -const { customLinkComponents } = useCustomHeaderLinkComponents(); const bottomHeader = ref(null); const catalogMenuElement = shallowRef(null); diff --git a/client-app/shared/layout/components/header/_internal/mobile-header.vue b/client-app/shared/layout/components/header/_internal/mobile-header.vue index 162186703f..aed9642dbc 100644 --- a/client-app/shared/layout/components/header/_internal/mobile-header.vue +++ b/client-app/shared/layout/components/header/_internal/mobile-header.vue @@ -53,7 +53,7 @@ - + (QueryParamName.SearchPhrase); const mobileMenuVisible = ref(false); diff --git a/client-app/shared/layout/components/header/_internal/mobile-menu/menus/default-menu.vue b/client-app/shared/layout/components/header/_internal/mobile-menu/menus/default-menu.vue index 229a27f455..0658b703b0 100644 --- a/client-app/shared/layout/components/header/_internal/mobile-menu/menus/default-menu.vue +++ b/client-app/shared/layout/components/header/_internal/mobile-menu/menus/default-menu.vue @@ -1,34 +1,31 @@