Skip to content

Commit d2224a1

Browse files
Merge pull request #61 from heseya/MPT-2768
reward_images
2 parents 2fba743 + 3ce91c0 commit d2224a1

5 files changed

Lines changed: 31 additions & 12 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "store-admin",
3-
"version": "7.0.3",
3+
"version": "7.0.4",
44
"private": true,
55
"description": "Admin panel for Heseya Store API",
66
"author": "Heseya",
@@ -19,7 +19,7 @@
1919
"postinstall": "patch-package"
2020
},
2121
"dependencies": {
22-
"@heseya/store-core": "7.1.0-beta.3",
22+
"@heseya/store-core": "7.1.0-beta.5",
2323
"@sentry/tracing": "^7.6.0",
2424
"@sentry/vue": "^7.6.0",
2525
"ant-design-vue": "^1.7.8",

src/components/AutocompleteInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default defineComponent({
8181
props: {
8282
value: {
8383
type: [String, Object, Array] as PropType<
84-
UUID | AutocompleteBaseItem | UUID[] | AutocompleteBaseItem[]
84+
UUID | AutocompleteBaseItem | UUID[] | AutocompleteBaseItem[] | null
8585
>,
8686
default: () => [],
8787
},

src/components/modules/products/view/ProductBasicDetails.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/>
3434
<AppTextarea
3535
v-if="!loading"
36-
v-model="form.safety_information"
36+
v-model="formSafetyInformation"
3737
:label="$t('form.safetyInformation').toString()"
3838
:disabled="disabled"
3939
/>
@@ -45,7 +45,6 @@
4545
prop-mode="id"
4646
mode="single"
4747
:disabled="disabled"
48-
:rules="{ required: form.manufacturer_id }"
4948
class="sale-configurator__autocomplete"
5049
>
5150
<template #option="manufacturer">
@@ -137,6 +136,14 @@ export default defineComponent({
137136
this.form.translations[this.editedLang].description_short = value
138137
},
139138
},
139+
formSafetyInformation: {
140+
get() {
141+
return this.form.safety_information || undefined
142+
},
143+
set(value: string) {
144+
this.form.safety_information = value
145+
},
146+
},
140147
},
141148
142149
methods: {

src/views/products/View.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@
158158
<h2 class="product-page__subtitle">{{ $t('galleryTitle') }}</h2>
159159
<Gallery ref="gallery" v-model="form.gallery" :disabled="!canModify" />
160160
</Card>
161+
<Card class="product-page__rewards">
162+
<h2 class="product-page__subtitle">{{ $t('rewardImagesTitle') }}</h2>
163+
<Gallery ref="gallery" v-model="form.reward_images" :disabled="!canModify" />
164+
</Card>
161165
</form>
162166
</ValidationObserver>
163167
</div>
@@ -170,6 +174,7 @@
170174
"titleNew": "Nowy produkt",
171175
"baseFormTitle": "Informacje podstawowe",
172176
"galleryTitle": "Zdjęcia i wideo produktu",
177+
"rewardImagesTitle": "Wyróżnienia produktu",
173178
"deleteConfirm": "Czy na pewno chcesz usunąć ten produkt?",
174179
"nav": {
175180
"goTo": "Przejdź do produktu"
@@ -266,6 +271,7 @@ const EMPTY_FORM: ProductComponentForm = {
266271
order: null,
267272
schemas: [],
268273
gallery: [],
274+
reward_images: [],
269275
tags: [],
270276
seo: undefined,
271277
attributes: [],
@@ -276,6 +282,8 @@ const EMPTY_FORM: ProductComponentForm = {
276282
published: [],
277283
translations: {},
278284
banner: null,
285+
safety_information: undefined,
286+
manufacturer_id: undefined,
279287
}
280288
281289
export default defineComponent({
@@ -439,6 +447,7 @@ export default defineComponent({
439447
...this.form,
440448
order: this.form.order || 0,
441449
media: this.form.gallery.map(({ id }) => id),
450+
reward_images: this.form.reward_images.map(({ id }) => id),
442451
tags: this.form.tags.map(({ id }) => id),
443452
schemas: this.form.schemas.map(({ id }) => id),
444453
related_sets: this.form.related_sets.map(({ id }) => id),
@@ -525,15 +534,15 @@ export default defineComponent({
525534
526535
.product-page {
527536
display: grid;
528-
grid-template-rows: auto;
537+
grid-template-rows: auto max-content;
529538
grid-gap: 14px;
530539
align-items: start;
531540
grid-template-columns: 1fr;
532-
grid-template-areas: 'visibility' 'gallery' 'main';
541+
grid-template-areas: 'visibility' 'gallery' 'rewards' 'main';
533542
534543
@media ($viewport-7) {
535544
grid-template-columns: 2.6fr 1fr;
536-
grid-template-areas: 'main visibility' 'main gallery' 'main .';
545+
grid-template-areas: 'main visibility' 'main gallery' 'main rewards' 'main .';
537546
}
538547
539548
&__main {
@@ -545,6 +554,9 @@ export default defineComponent({
545554
&__gallery {
546555
grid-area: gallery;
547556
}
557+
&__rewards {
558+
grid-area: rewards;
559+
}
548560
549561
&__subtitle {
550562
font-size: 1em;

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,10 +1224,10 @@
12241224
dependencies:
12251225
"@hapi/hoek" "^9.0.0"
12261226

1227-
"@heseya/store-core@7.1.0-beta.3":
1228-
version "7.1.0-beta.3"
1229-
resolved "https://registry.yarnpkg.com/@heseya/store-core/-/store-core-7.1.0-beta.3.tgz#25aa447242ee5b8cc91cbe97a80ac09f130671e3"
1230-
integrity sha512-J7loGuyVig0aFmFy2M6s65pwmsHAJUVdPThRxNS31izFHBcZySkWFROeWTUzr7qn2bTFMAK4GdRrd7WJEyEzUg==
1227+
"@heseya/store-core@7.1.0-beta.5":
1228+
version "7.1.0-beta.5"
1229+
resolved "https://registry.yarnpkg.com/@heseya/store-core/-/store-core-7.1.0-beta.5.tgz#26059425d252a8e5816a3c87a0fcf8ccc7c3412f"
1230+
integrity sha512-2oqNwj4yWED9vbtgIXzroOwz5n6hYhZqNSiCPm+4MZj1BiryDK0zxCaAMv8z1upZxmosYf7IQ7Apf0NRgFehcQ==
12311231
dependencies:
12321232
flat "^5.0.2"
12331233
form-data "^4.0.0"

0 commit comments

Comments
 (0)