Merge remote-tracking branch 'origin/product-procedures' into front-styles

This commit is contained in:
2026-04-03 09:41:17 +02:00
5 changed files with 33 additions and 78 deletions

View File

@@ -35,6 +35,10 @@
</div> </div>
<div v-if="toLangId !== settingStore.shopDefaultLanguage && !isTranslations" class="flex gap-7"> <div v-if="toLangId !== settingStore.shopDefaultLanguage && !isTranslations" class="flex gap-7">
<UButton color="info" variant="outline" v-if="!isEditing" @click="isTranslations = true">
<p>Change Text</p>
<UIcon name="material-symbols-light:stylus-note-sharp" class="text-7.5" />
</UButton>
<UButton @click="translateToSelectedLanguage" color="info" :loading="translating"> <UButton @click="translateToSelectedLanguage" color="info" :loading="translating">
Translate from Polish to {{langs.find(l => l.id === toLangId)?.name}} Translate from Polish to {{langs.find(l => l.id === toLangId)?.name}}
</UButton> </UButton>
@@ -60,13 +64,13 @@
<p class="text-red-500">{{ productStore.error }}</p> <p class="text-red-500">{{ productStore.error }}</p>
</div> </div>
<div v-else-if="productStore.productDescription" class="space-y-"> <div v-else-if="productStore.productDescription" class="space-y-7.5">
<div class="flex gap-6 h-full"> <div class="flex gap-6 h-full w-full">
<div <div
class="min-w-96 min-h-96 border border-(--border-light) dark:bg-gray-700 rounded-lg flex items-center justify-center"> class="min-w-96 min-h-96 border border-(--border-light) dark:bg-gray-700 rounded-lg flex items-center justify-center">
<span class="text-gray-500 dark:text-gray-400">Product Image</span> <span class="text-gray-500 dark:text-gray-400">Product Image</span>
</div> </div>
<div class="flex flex-col justify-between min-h-full"> <div class="flex flex-col justify-between min-h-full w-full">
<div> <div>
<div> <div>
<p v-if="!isTranslations" class="text-[25px] font-bold text-black dark:text-white"> <p v-if="!isTranslations" class="text-[25px] font-bold text-black dark:text-white">
@@ -75,7 +79,7 @@
<div class="" v-if="isTranslations"> <div class="" v-if="isTranslations">
<p>Title:</p> <p>Title:</p>
<UEditor v-slot="{ editor }" v-model="productStore.productDescription.name" content-type="html" <UEditor v-slot="{ editor }" v-model="productStore.productDescription.name" content-type="html"
:ui="{ base: 'p-8 sm:px-16' }" class="w-full border rounded-md border-(--border-light)" :ui="{ base: 'p-8 sm:px-16', root : 'pt-2' }" class="min-w-full border rounded-md border-(--border-light)"
placeholder="Write there ..."> placeholder="Write there ...">
<UEditorToolbar :editor="editor" :items="toolbarItems" class="sm:px-8"> <UEditorToolbar :editor="editor" :items="toolbarItems" class="sm:px-8">
<template #link> <template #link>
@@ -128,7 +132,7 @@
root: 'items-start!' root: 'items-start!'
}"> }">
<template #description> <template #description>
<div v-if="!isTranslations" class="flex justify-end items-center gap-3 mb-4"> <!-- <div v-if="!isTranslations" class="flex justify-end items-center gap-3 mb-4">
<UButton v-if="!isEditing" @click="activeTab === 'usage' ? enableEdit() : enableDescriptionEdit()" <UButton v-if="!isEditing" @click="activeTab === 'usage' ? enableEdit() : enableDescriptionEdit()"
class="flex items-center gap-2 m-2 cursor-pointer bg-(--accent-blue-light)! dark:bg-(--accent-blue-dark)!"> class="flex items-center gap-2 m-2 cursor-pointer bg-(--accent-blue-light)! dark:bg-(--accent-blue-dark)!">
<p class="text-white">Change Text</p> <p class="text-white">Change Text</p>
@@ -142,7 +146,7 @@
color="neutral" variant="outline" class="p-2.5 cursor-pointer"> color="neutral" variant="outline" class="p-2.5 cursor-pointer">
Cancel Cancel
</UButton> </UButton>
</div> </div> -->
<UEditor v-if="isTranslations" v-slot="{ editor }" v-model="productStore.productDescription.description" <UEditor v-if="isTranslations" v-slot="{ editor }" v-model="productStore.productDescription.description"
content-type="html" :ui="{ base: 'p-8 sm:px-16' }" class="w-full min-h-74" placeholder="Write there ..."> content-type="html" :ui="{ base: 'p-8 sm:px-16' }" class="w-full min-h-74" placeholder="Write there ...">
<UEditorToolbar :editor="editor" :items="toolbarItems" class="sm:px-8"> <UEditorToolbar :editor="editor" :items="toolbarItems" class="sm:px-8">
@@ -160,7 +164,8 @@
<UButton v-if="!isEditing" @click="enableEdit" <UButton v-if="!isEditing" @click="enableEdit"
class="flex items-center gap-2 m-2 cursor-pointer bg-(--accent-blue-light)! dark:bg-(--accent-blue-dark)!"> class="flex items-center gap-2 m-2 cursor-pointer bg-(--accent-blue-light)! dark:bg-(--accent-blue-dark)!">
<p class="text-(--text-sky-light) dark:text-(--text-sky-dark)">Change Text</p> <p class="text-(--text-sky-light) dark:text-(--text-sky-dark)">Change Text</p>
<UIcon name="material-symbols-light:stylus-note-sharp" class="text-[30px] text-(--text-sky-light) dark:text-(--text-sky-dark)" /> <UIcon name="material-symbols-light:stylus-note-sharp"
class="text-[30px] text-(--text-sky-light) dark:text-(--text-sky-dark)" />
</UButton> </UButton>
<UButton v-if="isEditing" @click="saveText" color="neutral" variant="outline" <UButton v-if="isEditing" @click="saveText" color="neutral" variant="outline"

View File

@@ -39,7 +39,7 @@ function adaptMenu(menu: NavigationMenuItem[]) {
adaptMenu(item.children); adaptMenu(item.children);
item.children.unshift({ item.children.unshift({
label: item.label, icon: 'i-lucide-book-open', popover: item.label, to: { label: item.label, icon: 'i-lucide-book-open', popover: item.label, to: {
name: 'customer-products-category', params: { name: 'admin-products-category', params: {
category_id: item.params.category_id, category_id: item.params.category_id,
link_rewrite: item.params.link_rewrite link_rewrite: item.params.link_rewrite
} }
@@ -47,7 +47,7 @@ function adaptMenu(menu: NavigationMenuItem[]) {
}) })
} else { } else {
item.to = { item.to = {
name: 'customer-products-category', params: { name: 'admin-products-category', params: {
category_id: item.params.category_id, category_id: item.params.category_id,
link_rewrite: item.params.link_rewrite link_rewrite: item.params.link_rewrite
} }

View File

@@ -6,8 +6,8 @@
<span class="text-xs text-gray-400"> <span class="text-xs text-gray-400">
Country/Currency Country/Currency
</span> </span>
<span class="font-medium dark:text-white text-black"> <span v-if="country" class="font-medium dark:text-white text-black">
{{ country?.name }} / {{ country?.ps_currency.iso_code }} {{ country?.name }} / {{ country?.ps_currency }}
</span> </span>
</div> </div>
</template> </template>

View File

@@ -16,6 +16,7 @@
</template> </template>
<template #default="{ state }"> <template #default="{ state }">
{{ menu }}
<UNavigationMenu :key="state" :items="menuItems" orientation="vertical" <UNavigationMenu :key="state" :items="menuItems" orientation="vertical"
:ui="{ link: 'p-1.5 overflow-hidden' }" /> :ui="{ link: 'p-1.5 overflow-hidden' }" />
</template> </template>
@@ -151,7 +152,7 @@ function getItems(state: 'collapsed' | 'expanded') {
] satisfies NavigationMenuItem[] ] satisfies NavigationMenuItem[]
} }
// zsdasdad //
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { currentLang } from '@/router/langs' import { currentLang } from '@/router/langs'
import { useFetchJson } from '@/composable/useFetchJson' import { useFetchJson } from '@/composable/useFetchJson'

View File

@@ -45,12 +45,7 @@ CREATE TABLE IF NOT EXISTS b2b_translations (
CREATE TABLE `b2b_roles` ( CREATE TABLE `b2b_roles` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(63) NULL, `name` VARCHAR(63) NULL
PRIMARY KEY (`id`)
);
CREATE UNIQUE INDEX `IX_b2b_roles_id`
ON `b2b_roles` (
`id` ASC
); );
CREATE TABLE b2b_permissions ( CREATE TABLE b2b_permissions (
@@ -76,8 +71,20 @@ CREATE TABLE b2b_role_permissions (
); );
CREATE TABLE `b2b_top_menu_roles` ( CREATE TABLE `b2b_top_menu_roles` (
`top_menu_id` BIGINT UNSIGNED NOT NULL, `top_menu_id` INT NOT NULL,
`role_id` BIGINT UNSIGNED NOT NULL `role_id` BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (`top_menu_id`, `role_id`),
CONSTRAINT fk_top_menu_roles_menu
FOREIGN KEY (`top_menu_id`)
REFERENCES `b2b_top_menu`(`menu_id`)
ON DELETE CASCADE,
CONSTRAINT fk_top_menu_roles_role
FOREIGN KEY (`role_id`)
REFERENCES `b2b_roles`(`id`)
ON DELETE CASCADE
); );
-- customers -- customers
@@ -216,15 +223,11 @@ CREATE TABLE b2b_specific_price (
is_active BOOLEAN DEFAULT TRUE is_active BOOLEAN DEFAULT TRUE
) ENGINE = InnoDB; ) ENGINE = InnoDB;
CREATE INDEX idx_b2b_scope ON b2b_specific_price(scope); CREATE INDEX idx_b2b_scope ON b2b_specific_price(scope);
CREATE INDEX idx_b2b_customer ON b2b_specific_price(b2b_id_customer);
CREATE INDEX idx_b2b_country ON b2b_specific_price(b2b_id_country);
CREATE INDEX idx_b2b_active_dates ON b2b_specific_price(is_active, valid_from, valid_till); CREATE INDEX idx_b2b_active_dates ON b2b_specific_price(is_active, valid_from, valid_till);
CREATE INDEX idx_b2b_lookup CREATE INDEX idx_b2b_lookup
ON b2b_specific_price ( ON b2b_specific_price (
scope, scope,
is_active, is_active,
b2b_id_customer,
b2b_id_country,
from_quantity from_quantity
); );
@@ -373,60 +376,6 @@ END$$
DELIMITER ; DELIMITER ;
CREATE TABLE b2b_specific_price_product (
b2b_specific_price_id BIGINT UNSIGNED,
id_product INT UNSIGNED,
PRIMARY KEY (b2b_specific_price_id, id_product),
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
FOREIGN KEY (id_product) REFERENCES ps_product(id_product) ON DELETE CASCADE
);
CREATE TABLE b2b_specific_price_category (
b2b_specific_price_id BIGINT UNSIGNED,
id_category INT UNSIGNED,
PRIMARY KEY (b2b_specific_price_id, id_category),
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
FOREIGN KEY (id_category) REFERENCES ps_category(id_category) ON DELETE CASCADE
);
CREATE TABLE b2b_specific_price_product_attribute (
b2b_specific_price_id BIGINT UNSIGNED,
id_product_attribute INT UNSIGNED,
PRIMARY KEY (b2b_specific_price_id, id_product_attribute),
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
FOREIGN KEY (id_product_attribute) REFERENCES ps_product_attribute(id_product_attribute) ON DELETE CASCADE
);
CREATE TABLE b2b_specific_price_customer (
b2b_specific_price_id BIGINT UNSIGNED,
b2b_id_customer BIGINT UNSIGNED,
PRIMARY KEY (b2b_specific_price_id, b2b_id_customer),
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
FOREIGN KEY (b2b_id_customer) REFERENCES b2b_customers(id) ON DELETE CASCADE
);
CREATE TABLE b2b_specific_price_country (
b2b_specific_price_id BIGINT UNSIGNED,
b2b_id_country BIGINT UNSIGNED,
PRIMARY KEY (b2b_specific_price_id, b2b_id_country),
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
FOREIGN KEY (b2b_id_country) REFERENCES b2b_countries(id) ON DELETE CASCADE
);
CREATE INDEX idx_b2b_product_rel
ON b2b_specific_price_product (id_product);
CREATE INDEX idx_b2b_category_rel
ON b2b_specific_price_category (id_category);
CREATE INDEX idx_b2b_product_attribute_rel
ON b2b_specific_price_product_attribute (id_product_attribute);
CREATE INDEX idx_bsp_customer
ON b2b_specific_price_customer (b2b_specific_price_id, b2b_id_customer);
CREATE INDEX idx_bsp_country
ON b2b_specific_price_country (b2b_specific_price_id, b2b_id_country);
-- +goose Down -- +goose Down
DROP TABLE IF EXISTS b2b_countries; DROP TABLE IF EXISTS b2b_countries;