From 472ba2b5000ed520f7fef83683e813cb59454fcf Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Tue, 17 Dec 2024 15:29:01 +0900 Subject: [PATCH 01/35] feat: extend VcImage component --- client-app/ui-kit/components/atoms/image/vc-image.vue | 7 ++++++- client-app/ui-kit/utilities/images.ts | 7 +++++++ client-app/ui-kit/utilities/index.ts | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 client-app/ui-kit/utilities/images.ts diff --git a/client-app/ui-kit/components/atoms/image/vc-image.vue b/client-app/ui-kit/components/atoms/image/vc-image.vue index 6119709c74..4178b13fa6 100644 --- a/client-app/ui-kit/components/atoms/image/vc-image.vue +++ b/client-app/ui-kit/components/atoms/image/vc-image.vue @@ -15,6 +15,7 @@ import { computed, inject, ref, watch } from "vue"; import { NO_IMAGE_URL } from "@/core/constants"; import { configInjectionKey } from "@/core/injection-keys"; import { appendSuffixToFilename } from "@/core/utilities"; +import { loadImage, isFilenameOnly } from "../../../utilities"; export interface IProps { lazy?: boolean; @@ -41,7 +42,11 @@ const originalEnabled = ref(false); const preparedSrc = computed(() => { if (fallbackEnabled.value || !props.src) { - return props.fallbackSrc; + return isFilenameOnly(props.fallbackSrc) ? loadImage(props.fallbackSrc) : props.fallbackSrc; + } + + if (isFilenameOnly(props.src)) { + return loadImage(props.src); } const sizeSuffix = props.sizeSuffix ? cfg?.image_thumbnails_suffixes?.[props.sizeSuffix] : ""; diff --git a/client-app/ui-kit/utilities/images.ts b/client-app/ui-kit/utilities/images.ts new file mode 100644 index 0000000000..2dc6002b73 --- /dev/null +++ b/client-app/ui-kit/utilities/images.ts @@ -0,0 +1,7 @@ +export function loadImage(fileName: string): string { + return new URL(`/client-app/assets/images/${fileName}`, import.meta.url).href; +} + +export function isFilenameOnly(src: string): boolean { + return /^[^/]+(\.[a-zA-Z0-9]+)?$/.test(src); +} diff --git a/client-app/ui-kit/utilities/index.ts b/client-app/ui-kit/utilities/index.ts index 5385d26e77..12e46a01bc 100644 --- a/client-app/ui-kit/utilities/index.ts +++ b/client-app/ui-kit/utilities/index.ts @@ -1,3 +1,4 @@ export * from "./file"; export * from "./file-size"; +export * from "./images"; export * from "./price"; From 32a13eacaab7c5edb5a31d35c3b1df1f3d77ecce Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Tue, 17 Dec 2024 15:33:57 +0900 Subject: [PATCH 02/35] feat: move no-image.svg --- .../{public/static/images/common => assets/images}/no-image.svg | 0 client-app/core/constants/images.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename client-app/{public/static/images/common => assets/images}/no-image.svg (100%) diff --git a/client-app/public/static/images/common/no-image.svg b/client-app/assets/images/no-image.svg similarity index 100% rename from client-app/public/static/images/common/no-image.svg rename to client-app/assets/images/no-image.svg diff --git a/client-app/core/constants/images.ts b/client-app/core/constants/images.ts index 496b922391..f71887ecd0 100644 --- a/client-app/core/constants/images.ts +++ b/client-app/core/constants/images.ts @@ -1 +1 @@ -export const NO_IMAGE_URL = "/static/images/common/no-image.svg"; +export const NO_IMAGE_URL = "no-image.svg"; From 103259a491b4c84607b0c749b933e0d3cd34a7a2 Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Tue, 17 Dec 2024 15:37:13 +0900 Subject: [PATCH 03/35] feat: move VcFile images --- .../msword.svg => assets/images/file-application-msword.svg} | 0 .../pdf.svg => assets/images/file-application-pdf.svg} | 0 .../images/file-application-vnd.ms-excel.svg} | 0 .../zip.svg => assets/images/file-application-zip.svg} | 0 .../icons/file/error.svg => assets/images/file-error.svg} | 0 .../icons/file/file.svg => assets/images/file-file.svg} | 0 .../file/image/jpeg.svg => assets/images/file-image-jpeg.svg} | 0 .../file/image/png.svg => assets/images/file-image-png.svg} | 0 client-app/ui-kit/components/molecules/file/vc-file.vue | 4 ++-- 9 files changed, 2 insertions(+), 2 deletions(-) rename client-app/{public/static/icons/file/application/msword.svg => assets/images/file-application-msword.svg} (100%) rename client-app/{public/static/icons/file/application/pdf.svg => assets/images/file-application-pdf.svg} (100%) rename client-app/{public/static/icons/file/application/vnd.ms-excel.svg => assets/images/file-application-vnd.ms-excel.svg} (100%) rename client-app/{public/static/icons/file/application/zip.svg => assets/images/file-application-zip.svg} (100%) rename client-app/{public/static/icons/file/error.svg => assets/images/file-error.svg} (100%) rename client-app/{public/static/icons/file/file.svg => assets/images/file-file.svg} (100%) rename client-app/{public/static/icons/file/image/jpeg.svg => assets/images/file-image-jpeg.svg} (100%) rename client-app/{public/static/icons/file/image/png.svg => assets/images/file-image-png.svg} (100%) diff --git a/client-app/public/static/icons/file/application/msword.svg b/client-app/assets/images/file-application-msword.svg similarity index 100% rename from client-app/public/static/icons/file/application/msword.svg rename to client-app/assets/images/file-application-msword.svg diff --git a/client-app/public/static/icons/file/application/pdf.svg b/client-app/assets/images/file-application-pdf.svg similarity index 100% rename from client-app/public/static/icons/file/application/pdf.svg rename to client-app/assets/images/file-application-pdf.svg diff --git a/client-app/public/static/icons/file/application/vnd.ms-excel.svg b/client-app/assets/images/file-application-vnd.ms-excel.svg similarity index 100% rename from client-app/public/static/icons/file/application/vnd.ms-excel.svg rename to client-app/assets/images/file-application-vnd.ms-excel.svg diff --git a/client-app/public/static/icons/file/application/zip.svg b/client-app/assets/images/file-application-zip.svg similarity index 100% rename from client-app/public/static/icons/file/application/zip.svg rename to client-app/assets/images/file-application-zip.svg diff --git a/client-app/public/static/icons/file/error.svg b/client-app/assets/images/file-error.svg similarity index 100% rename from client-app/public/static/icons/file/error.svg rename to client-app/assets/images/file-error.svg diff --git a/client-app/public/static/icons/file/file.svg b/client-app/assets/images/file-file.svg similarity index 100% rename from client-app/public/static/icons/file/file.svg rename to client-app/assets/images/file-file.svg diff --git a/client-app/public/static/icons/file/image/jpeg.svg b/client-app/assets/images/file-image-jpeg.svg similarity index 100% rename from client-app/public/static/icons/file/image/jpeg.svg rename to client-app/assets/images/file-image-jpeg.svg diff --git a/client-app/public/static/icons/file/image/png.svg b/client-app/assets/images/file-image-png.svg similarity index 100% rename from client-app/public/static/icons/file/image/png.svg rename to client-app/assets/images/file-image-png.svg diff --git a/client-app/ui-kit/components/molecules/file/vc-file.vue b/client-app/ui-kit/components/molecules/file/vc-file.vue index 447974a5de..ce41596782 100644 --- a/client-app/ui-kit/components/molecules/file/vc-file.vue +++ b/client-app/ui-kit/components/molecules/file/vc-file.vue @@ -126,12 +126,12 @@ const icon = computed(() => { if (isFailedFile(props.file)) { fileName = "error"; } else if (Object.keys(ContentType).includes(contentType as ContentType)) { - fileName = ContentType[contentType as ContentType] || "file"; + fileName = ContentType[contentType as ContentType]?.replace("/", "-") || "file"; } else { fileName = "file"; } - return `/static/icons/file/${fileName}.svg`; + return `file-${fileName}.svg`; }); const fileSize = computed(() => getFileSize(props.file.size)); From 5b8d82af382150c927503ab8705c0a0e925f26f4 Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Tue, 17 Dec 2024 15:38:28 +0900 Subject: [PATCH 04/35] feat: move role images --- .../org-employee.svg => assets/images/role-org-employee.svg} | 0 .../images/role-org-maintainer.svg} | 0 .../images/role-purchasing-agent.svg} | 0 .../store-admin.svg => assets/images/role-store-admin.svg} | 0 .../images/role-store-manager.svg} | 0 client-app/shared/company/components/role-icon.vue | 4 +--- 6 files changed, 1 insertion(+), 3 deletions(-) rename client-app/{public/static/images/account/roles/org-employee.svg => assets/images/role-org-employee.svg} (100%) rename client-app/{public/static/images/account/roles/org-maintainer.svg => assets/images/role-org-maintainer.svg} (100%) rename client-app/{public/static/images/account/roles/purchasing-agent.svg => assets/images/role-purchasing-agent.svg} (100%) rename client-app/{public/static/images/account/roles/store-admin.svg => assets/images/role-store-admin.svg} (100%) rename client-app/{public/static/images/account/roles/store-manager.svg => assets/images/role-store-manager.svg} (100%) diff --git a/client-app/public/static/images/account/roles/org-employee.svg b/client-app/assets/images/role-org-employee.svg similarity index 100% rename from client-app/public/static/images/account/roles/org-employee.svg rename to client-app/assets/images/role-org-employee.svg diff --git a/client-app/public/static/images/account/roles/org-maintainer.svg b/client-app/assets/images/role-org-maintainer.svg similarity index 100% rename from client-app/public/static/images/account/roles/org-maintainer.svg rename to client-app/assets/images/role-org-maintainer.svg diff --git a/client-app/public/static/images/account/roles/purchasing-agent.svg b/client-app/assets/images/role-purchasing-agent.svg similarity index 100% rename from client-app/public/static/images/account/roles/purchasing-agent.svg rename to client-app/assets/images/role-purchasing-agent.svg diff --git a/client-app/public/static/images/account/roles/store-admin.svg b/client-app/assets/images/role-store-admin.svg similarity index 100% rename from client-app/public/static/images/account/roles/store-admin.svg rename to client-app/assets/images/role-store-admin.svg diff --git a/client-app/public/static/images/account/roles/store-manager.svg b/client-app/assets/images/role-store-manager.svg similarity index 100% rename from client-app/public/static/images/account/roles/store-manager.svg rename to client-app/assets/images/role-store-manager.svg diff --git a/client-app/shared/company/components/role-icon.vue b/client-app/shared/company/components/role-icon.vue index 5749c9d55f..b2f5acc413 100644 --- a/client-app/shared/company/components/role-icon.vue +++ b/client-app/shared/company/components/role-icon.vue @@ -1,8 +1,6 @@ From 3798bd49d70ea4629c4cb3f8ef42ca49f8478c1e Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Tue, 17 Dec 2024 15:39:58 +0900 Subject: [PATCH 05/35] feat: move select-payment, select-shipping --- .../icons/placeholders => assets/images}/select-payment.svg | 0 .../icons/placeholders => assets/images}/select-shipping.svg | 0 client-app/pages/account/checkout-defaults.vue | 4 ++-- client-app/pages/account/order-payment.vue | 2 +- .../shared/checkout/components/billing-details-section.vue | 2 +- .../shared/checkout/components/shipping-details-section.vue | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename client-app/{public/static/icons/placeholders => assets/images}/select-payment.svg (100%) rename client-app/{public/static/icons/placeholders => assets/images}/select-shipping.svg (100%) diff --git a/client-app/public/static/icons/placeholders/select-payment.svg b/client-app/assets/images/select-payment.svg similarity index 100% rename from client-app/public/static/icons/placeholders/select-payment.svg rename to client-app/assets/images/select-payment.svg diff --git a/client-app/public/static/icons/placeholders/select-shipping.svg b/client-app/assets/images/select-shipping.svg similarity index 100% rename from client-app/public/static/icons/placeholders/select-shipping.svg rename to client-app/assets/images/select-shipping.svg diff --git a/client-app/pages/account/checkout-defaults.vue b/client-app/pages/account/checkout-defaults.vue index b14f11ee2e..a85061ee5f 100644 --- a/client-app/pages/account/checkout-defaults.vue +++ b/client-app/pages/account/checkout-defaults.vue @@ -39,7 +39,7 @@ {{ $t("common.placeholders.select_payment_method") }} @@ -82,7 +82,7 @@ {{ $t("common.placeholders.select_delivery_method") }} diff --git a/client-app/pages/account/order-payment.vue b/client-app/pages/account/order-payment.vue index e436e3276a..a063e06c11 100644 --- a/client-app/pages/account/order-payment.vue +++ b/client-app/pages/account/order-payment.vue @@ -183,7 +183,7 @@ diff --git a/client-app/pages/cart.vue b/client-app/pages/cart.vue index 716f13e53f..f1b0eb6bba 100644 --- a/client-app/pages/cart.vue +++ b/client-app/pages/cart.vue @@ -5,8 +5,8 @@ v-else-if="!cart?.items?.length" :title="$t('pages.cart.title')" :description="$t('pages.cart.empty_cart_description')" - image="/static/images/errors/emptyCart.webp" - mobile-image="/static/images/errors/emptyCartMobile.webp" + image="emptyCart.webp" + mobile-image="emptyCartMobile.webp" :breadcrumbs="breadcrumbs" >