From a46c118ed602da934d55c4778624e60c9c94de63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C4=99dryga=C5=82?= Date: Tue, 16 Apr 2024 09:43:08 +0200 Subject: [PATCH 01/10] chore: version bump --- .github/workflows/docker-image.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c1d49be0..3c5209d5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -8,6 +8,7 @@ on: - develop - hotfix/* - release/* + - feature/v* jobs: run: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 9af93291..702d30ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "store-admin", - "version": "6.0.4", + "version": "6.1.0-dev", "private": true, "description": "Admin panel for Heseya Store API", "author": "Heseya", From fced7dd136e167495e337f0635806c34dc47ae40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C4=99dryga=C5=82?= Date: Tue, 16 Apr 2024 10:53:34 +0200 Subject: [PATCH 02/10] feat: added logo for a shipping method --- package.json | 2 +- .../modules/orders/ShippingMethodForm.vue | 2 +- .../modules/shippingMethods/Form.vue | 134 +++++++++++------- src/views/settings/ShippingMethods.vue | 48 +++++-- yarn.lock | 8 +- 5 files changed, 131 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index 702d30ff..58a65d6a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "postinstall": "patch-package" }, "dependencies": { - "@heseya/store-core": "6.0.0", + "@heseya/store-core": "6.1.0-dev.2", "@sentry/tracing": "^7.6.0", "@sentry/vue": "^7.6.0", "ant-design-vue": "^1.7.8", diff --git a/src/components/modules/orders/ShippingMethodForm.vue b/src/components/modules/orders/ShippingMethodForm.vue index 34a3a41a..779e8751 100644 --- a/src/components/modules/orders/ShippingMethodForm.vue +++ b/src/components/modules/orders/ShippingMethodForm.vue @@ -20,7 +20,7 @@ - +
-
- + - - {{ $t(`shippingTypes.${shippingType}`) }} - - -
- + :media="form.logo || undefined" + :file-name="$t('form.logo').toString()" + @upload="changeMedia" + /> -
- - - - - -
+
+
+ + + {{ $t(`shippingTypes.${shippingType}`) }} + + +
+ -
- - - {{ method.name }} - - -
+
+ + + + + +
-
- - - - +
+ + + {{ method.name }} + + +
+ +
+ + + + +
+

@@ -193,6 +208,7 @@ { "pl": { "form": { + "logo": "logo metody dostawy", "shippingType": "Typ dostawy", "paymentMethods": "Dostępne metody płatności", "public": "Widoczność metody dostawy", @@ -216,6 +232,7 @@ }, "en": { "form": { + "logo": "shipping method logo", "shippingType": "Shipping type", "paymentMethods": "Available payment methods", "public": "Shipping method visibility", @@ -249,12 +266,14 @@ import { ShippingMethodCreateDto, AddressDto, ShippingType, + CdnMedia, } from '@heseya/store-core' import ModalForm from '@/components/form/ModalForm.vue' import SwitchInput from '@/components/form/SwitchInput.vue' import FlexInput from '@/components/layout/FlexInput.vue' import AutocompleteInput from '@/components/AutocompleteInput.vue' +import MediaUploadInput from '@/components/modules/media/MediaUploadInput.vue' import PriceRangesForm from './PriceRangesForm.vue' import ShippingPointForm from './ShippingPoint.vue' @@ -263,6 +282,8 @@ import ShippingPointsGrid from './ShippingPointsGrid.vue' import { DEFAULT_ADDRESS_FORM } from '@/consts/addressConsts' import CountriesSelect from '@/components/CountriesSelect.vue' +type ShippingMethodForm = ShippingMethodCreateDto & { logo?: CdnMedia | null } + export default defineComponent({ name: 'ShippingMethodsForm', components: { @@ -275,10 +296,11 @@ export default defineComponent({ ShippingPointForm, ShippingPointsGrid, CountriesSelect, + MediaUploadInput, }, props: { value: { - type: Object as PropType, + type: Object as PropType, required: true, }, countries: { @@ -299,10 +321,10 @@ export default defineComponent({ }), computed: { form: { - get(): ShippingMethodCreateDto { + get(): ShippingMethodForm { return this.value }, - set(value: ShippingMethodCreateDto) { + set(value: ShippingMethodForm) { this.$emit('input', value) }, }, @@ -349,12 +371,26 @@ export default defineComponent({ removePoint(index: number) { this.form.shipping_points?.splice(index, 1) }, + changeMedia(media: CdnMedia | null) { + this.form.logo = media ?? undefined + this.form.logo_id = media?.id || null + }, }, }) diff --git a/yarn.lock b/yarn.lock index 59658316..a8374ec7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1224,10 +1224,10 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@heseya/store-core@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@heseya/store-core/-/store-core-6.0.0.tgz#6845c7cba623f829eef091af28586a87c3739761" - integrity sha512-FmXuWoZpHsowV82NFYVTXcsJv9Z25SWdBZSWyTadn15fIzVsx8vAblTGdX6XuDaImdqtu8mvEAvVM+i5VLlnQw== +"@heseya/store-core@6.1.0-dev.2": + version "6.1.0-dev.2" + resolved "https://registry.yarnpkg.com/@heseya/store-core/-/store-core-6.1.0-dev.2.tgz#0ea20b59dc3e4ae07548f93e50516138083607c2" + integrity sha512-eSOLXB8Kw5r7IZExV84z15SJeEMSwanT1TnZeGWsempGstN1XK6TsrPIutT4Yq041BYQUyj0MuPy6woSd6FtOw== dependencies: flat "^5.0.2" form-data "^4.0.0" From a6940f5ab953d315793fea7bba5859f72f6929ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C4=99dryga=C5=82?= Date: Tue, 16 Apr 2024 11:46:17 +0200 Subject: [PATCH 03/10] feat: changed shipping methods list --- src/views/settings/ShippingMethods.vue | 44 +++++++++++--------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/views/settings/ShippingMethods.vue b/src/views/settings/ShippingMethods.vue index c3ca4027..a8f3c053 100644 --- a/src/views/settings/ShippingMethods.vue +++ b/src/views/settings/ShippingMethods.vue @@ -23,16 +23,15 @@ draggable @click="openModal(method.id)" > + +