From fe7dafe680eac00aa1e229634d4cb2d8726edcb5 Mon Sep 17 00:00:00 2001 From: Arina Yakovenko Date: Wed, 15 Apr 2026 12:47:10 +0200 Subject: [PATCH] fix: migrations --- .air.toml | 2 +- app/service/emailService/email.go | 2 +- bo/components.d.ts | 3 +- bo/src/App.vue | 14 +- bo/src/components/admin/FavoriteProducts.vue | 7 +- bo/src/components/admin/PageProducts.vue | 7 +- .../admin/ProductDetailView copy.vue | 7 +- bo/src/components/admin/ProductDetailView.vue | 7 +- bo/src/components/admin/UsersList.vue | 7 +- bo/src/components/admin/UsersSearch.vue | 7 +- .../customer-management/Profile.vue | 8 +- bo/src/components/customer/CartDetails.vue | 7 +- bo/src/components/customer/PageAddresses.vue | 14 +- bo/src/components/customer/PageCarts.vue | 7 +- bo/src/components/customer/PageOrders.vue | 7 +- bo/src/components/customer/PageProduct.vue | 7 +- bo/src/components/customer/PageProducts.vue | 7 +- .../customer/PageProfileDetails.vue | 7 +- .../customer/PageProfileDetailsAddInfo.vue | 7 +- bo/src/components/customer/PageStatistic.vue | 7 +- .../customer/StorageFileBrowser.vue | 7 +- bo/src/components/inner/CategoryMenu.vue | 9 +- bo/src/layouts/management.vue | 6 +- bo/src/router/index.ts | 29 ++- bo/src/views/CategoryView.vue | 42 ---- bo/src/views/HomeView.vue | 7 +- bo/src/views/RepoChartView.vue | 7 +- bo/src/views/StorageView.vue | 1 - i18n/migrations/20260302163100_routes.sql | 218 +++++++++++++++--- .../20260302163123_create_tables_data.sql | 21 +- 30 files changed, 292 insertions(+), 196 deletions(-) delete mode 100644 bo/src/views/CategoryView.vue diff --git a/.air.toml b/.air.toml index c274c62..e70a5fd 100644 --- a/.air.toml +++ b/.air.toml @@ -28,7 +28,7 @@ tmp_dir = "tmp" rerun = false rerun_delay = 500 send_interrupt = false - stop_on_error = false + stop_on_error = true [color] app = "" diff --git a/app/service/emailService/email.go b/app/service/emailService/email.go index 2c92117..ae3288d 100644 --- a/app/service/emailService/email.go +++ b/app/service/emailService/email.go @@ -153,6 +153,6 @@ func (s *EmailService) newUserAdminNotificationTemplate(userEmail, userName, bas // newUserAdminNotificationTemplate returns the HTML template for admin notification func (s *EmailService) newOrderPlacedTemplate(userID uint) string { buf := bytes.Buffer{} - emails.EmailNewOrderPlacedWrapper(view.EmailLayout[view.EmailNewOrderPlacedData]{LangID: constdata.ADMIN_NOTIFICATION_LANGUAGE, Data: view.EmailNewOrderPlacedData{UserID: userID}}).Render(context.Background(), &buf) + // emails.EmailNewOrderPlacedWrapper(view.EmailLayout[view.EmailNewOrderPlacedData]{LangID: constdata.ADMIN_NOTIFICATION_LANGUAGE, Data: view.EmailNewOrderPlacedData{UserID: userID}}).Render(context.Background(), &buf) return buf.String() } diff --git a/bo/components.d.ts b/bo/components.d.ts index 361fcb7..274bb33 100644 --- a/bo/components.d.ts +++ b/bo/components.d.ts @@ -11,7 +11,6 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - ButtonGoToProfile: typeof import('./src/components/customer-management/ButtonGoToProfile.vue')['default'] CartDetails: typeof import('./src/components/customer/CartDetails.vue')['default'] CategoryMenu: typeof import('./src/components/inner/CategoryMenu.vue')['default'] copy: typeof import('./src/components/admin/ProductDetailView copy.vue')['default'] @@ -45,7 +44,7 @@ declare module 'vue' { TopBar: typeof import('./src/components/TopBar.vue')['default'] TopBarLogin: typeof import('./src/components/TopBarLogin.vue')['default'] UAlert: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Alert.vue')['default'] - UAvatar: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Avatar.vue')['default'] + UApp: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/App.vue')['default'] UButton: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Button.vue')['default'] UCard: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Card.vue')['default'] UCheckbox: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Checkbox.vue')['default'] diff --git a/bo/src/App.vue b/bo/src/App.vue index 8596791..c09672a 100644 --- a/bo/src/App.vue +++ b/bo/src/App.vue @@ -1,15 +1,25 @@ diff --git a/bo/src/components/admin/FavoriteProducts.vue b/bo/src/components/admin/FavoriteProducts.vue index 669e96e..cb14bc1 100644 --- a/bo/src/components/admin/FavoriteProducts.vue +++ b/bo/src/components/admin/FavoriteProducts.vue @@ -1,12 +1,9 @@ + \ No newline at end of file diff --git a/bo/src/components/admin/PageProducts.vue b/bo/src/components/admin/PageProducts.vue index dbbd60a..095f638 100644 --- a/bo/src/components/admin/PageProducts.vue +++ b/bo/src/components/admin/PageProducts.vue @@ -1,6 +1,5 @@ + \ No newline at end of file + \ No newline at end of file diff --git a/bo/src/components/customer/CartDetails.vue b/bo/src/components/customer/CartDetails.vue index 4fef8a8..498752e 100644 --- a/bo/src/components/customer/CartDetails.vue +++ b/bo/src/components/customer/CartDetails.vue @@ -1,6 +1,5 @@ + \ No newline at end of file diff --git a/bo/src/components/customer/PageProduct.vue b/bo/src/components/customer/PageProduct.vue index 4a992d6..ad7c3e8 100644 --- a/bo/src/components/customer/PageProduct.vue +++ b/bo/src/components/customer/PageProduct.vue @@ -1,6 +1,5 @@ + \ No newline at end of file diff --git a/bo/src/views/HomeView.vue b/bo/src/views/HomeView.vue index 08cec22..b653373 100644 --- a/bo/src/views/HomeView.vue +++ b/bo/src/views/HomeView.vue @@ -1,9 +1,6 @@ + home View + \ No newline at end of file diff --git a/bo/src/views/RepoChartView.vue b/bo/src/views/RepoChartView.vue index c94fdc0..b8783a7 100644 --- a/bo/src/views/RepoChartView.vue +++ b/bo/src/views/RepoChartView.vue @@ -15,7 +15,6 @@ import { useAuthStore } from '@/stores/customer/auth' import { i18n } from '@/plugins/02_i18n' import type { TableColumn } from '@nuxt/ui' import { useI18n } from 'vue-i18n' -import Default from '@/layouts/default.vue' ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale) @@ -182,8 +181,7 @@ const columns = computed[]>(() => [ \ No newline at end of file + \ No newline at end of file diff --git a/bo/src/views/StorageView.vue b/bo/src/views/StorageView.vue index d055ed7..0a85dbe 100644 --- a/bo/src/views/StorageView.vue +++ b/bo/src/views/StorageView.vue @@ -7,6 +7,5 @@ \ No newline at end of file diff --git a/i18n/migrations/20260302163100_routes.sql b/i18n/migrations/20260302163100_routes.sql index 989c896..2ee9aec 100644 --- a/i18n/migrations/20260302163100_routes.sql +++ b/i18n/migrations/20260302163100_routes.sql @@ -10,17 +10,6 @@ CREATE TABLE IF NOT EXISTS b2b_routes ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; --- INSERT IGNORE INTO b2b_routes --- (name, path, component, meta, active) --- VALUES --- ('root', '', '', '{"trans": "route.root"}', 0), --- ('home', '', '/views/HomeView.vue', '{"trans": "route.home"}', 1), --- ('login', 'login', '/views/LoginView.vue', '{"guest":true}', 1), --- ('register', 'register', '/views/RegisterView.vue', '{"guest":true}', 1), --- ('password-recovery', 'password-recovery', '/views/PasswordRecoveryView.vue', '{"guest":true}', 1), --- ('reset-password', 'reset-password', '/views/ResetPasswordView.vue', '{"guest":true}', 1), --- ('verify-email', 'verify-email', '/views/VerifyEmailView.vue', '{"guest":true}', 1); - INSERT IGNORE INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (1, 'root', '', '', '{"trans": "route.root"}', 0), (2, 'home', '', '/views/HomeView.vue', '{"trans": "route.home"}', 1), @@ -29,16 +18,59 @@ INSERT IGNORE INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `act (5, 'password-recovery', 'password-recovery', '/views/PasswordRecoveryView.vue', '{"guest":true}', 1), (6, 'reset-password', 'reset-password', '/views/ResetPasswordForm.vue', '{"guest":true}', 1), (7, 'verify-email', 'verify-email', '/views/VerifyEmailView.vue', '{"guest":true}', 1), -(8, 'category', 'category/:category_id-:link_rewrite', '/views/CategoryView.vue', '{"guest":true}', 1), (9, 'admin-products-category', 'products/:category_id-:link_rewrite', '/components/admin/PageProducts.vue', '{ - "guest": true +"guest":true, +"name": "Products Category" }', 1), -(10, 'customer-addresses', 'addresses', '/components/customer/PageAddresses.vue', '{"guest":true}', 1), -(11, 'customer-carts', 'carts', '/components/customer/PageCarts.vue', '{"guest":true}', 1), -(12, 'customer-orders', 'orders', '/components/customer/PageOrders.vue', '{"guest":true}', 1), -(13, 'customer-statistic', 'statistic', '/components/customer/PageStatistic.vue', '{"guest":true}', 1), -(14, 'customer-product-details', 'products/:product_id/:link_rewrite', '/components/admin/ProductDetailView.vue', '{"guest":true}', 1), -(15, 'admin-products', 'products', '/components/admin/PageProducts.vue', '{"guest":true}', 1); +(10, 'customer-addresses', 'addresses', '/components/customer/PageAddresses.vue', '{ +"guest":true, +"name": "Addresses" +}', 1), +(11, 'customer-cart', 'cart/:id', '/components/customer/PageCart.vue', '{ +"guest":true, +"name": "Cart" +}', 1), +(12, 'customer-orders', 'orders', '/components/customer/PageOrders.vue', '{ +"guest":true, +"name": "Order" +}', 1), +(13, 'customer-statistic', 'statistic', '/components/customer/PageStatistic.vue', '{ +"guest":true, +"name": "Statistic" +} +', 1), +(14, 'admin-product-details', 'products/:product_id', '/components/admin/ProductDetailView.vue', '{ +"guest":true, +"name": "Products" +} +', 1), +(15, 'admin-products', 'products', '/components/admin/PageProducts.vue', '{ +"guest":true, +"name": "Products" +} +', 1), +(16, 'admin-users-list', 'users-list', '/components/admin/UsersList.vue', '{ +"guest":true, +"name": "Client List" +} +', 1), +(17, 'customer-management-profile', ':user_id/profile', '/components/customer-management/Profile.vue', '{ +"guest":true, +"name": "Profile" +} +', 1), +(18, 'admin-users-search', 'users-search', '/components/admin/UsersSearch.vue', '{ +"guest":true, +"name": "Search Clients" +} +', 1), +(19, 'customer-storage-file', 'file-storage', '/components/customer/StorageFileBrowser.vue', '{ +"guest":true, +"name": "File Storage" +}', 1), +(20, 'customer-products', 'products', '/components/customer/PageProducts.vue', '{ "guest":true, "name": "Products" }', 1), +(21, 'customer-product-details', 'products/:product_id', '/components/customer/PageProduct.vue', '{ "guest":true, "name": "Products" }', 1), +(22, 'customer-page-carts', 'carts', '/components/customer/PageCarts.vue', '{ "guest":true, "name": "Carts" }', 1); CREATE TABLE IF NOT EXISTS b2b_top_menu ( menu_id INT AUTO_INCREMENT NOT NULL, @@ -71,21 +103,6 @@ INSERT IGNORE INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `a }, "icon" : "quill:list" }', 1, '{"route":{"name":"admin-products","params":{"locale":""}}}', 1, 1), -(3, '{ - "name": "customer-carts", - "trans": { - "pl": { - "label": "Carts" - }, - "en": { - "label": "Carts" - }, - "de": { - "label": "Carts" - } - }, - "icon" : "proicons:cart" -}', 1, '{"route":{"name":"customer-carts","params":{"locale":""}}}', 1, 1), (4, '{ "name": "customer-addresses", "trans": { @@ -138,7 +155,138 @@ INSERT IGNORE INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `a } } }', 1, 1), -(9, '{"name":"carts","trans":{"pl":{"label":"Koszyki"},"en":{"label":"Carts"},"de":{"label":"Warenkörbe"}}}', 3, '{"route":{"name":"home","params":{"locale":""}}}', 1, 1); +(10, '{ + "name": "customer-storage-file", + "trans": { + "pl": { + "label": "File Storage" + }, + "en": { + "label": "File Storage" + }, + "de": { + "label": "File Storage" + } + }, + "icon": "carbon:volume-file-storage" +}', 1, '{ + "route": { + "name": "customer-storage-file", + "params": { + "locale": "" + } + } +}', 1, 1), +(12, '{ + "name": "admin-users-list", + "trans": { + "pl": { + "label": "Client List" + }, + "en": { + "label": "Client List" + }, + "de": { + "label": "Client List" + } + }, + "icon": "tdesign:user-list" +}', 1, '{ + "route": { + "name": "admin-users-list", + "params": { + "locale": "" + } + } +}', 1, 1), +(13, '{ + "name": "admin-users-search", + "trans": { + "pl": { + "label": "Search Clients" + }, + "en": { + "label": "Search Clients" + }, + "de": { + "label": "Search Clients" + } + }, + "icon": "material-symbols:search" +}', 1, '{ + "route": { + "name": "admin-users-search", + "params": { + "locale": "" + } + } +}', 1, 1), +(14, '{ + "name": "customer-management-profile", + "trans": { + "pl": { + "label": "Profile" + }, + "en": { + "label": "Profile" + }, + "de": { + "label": "Profile" + } + }, + "icon": "akar-icons:statistic-up" +}', 1, '{ + "route": { + "name": "customer-management-profile", + "params": { + "locale": "" + } + } +}', 1, 1), +(15, '{ + "name": "customer-products", + "trans": { + "pl": { + "label": "Products" + }, + "en": { + "label": "Products" + }, + "de": { + "label": "Products" + } + }, + "icon": "akar-icons:statistic-up" +}', 1, '{ + "route": { + "name": "customer-products", + "params": { + "locale": "" + } + } +}', 1, 1), +(16, '{ + "name": "customer-page-carts", + "trans": { + "pl": { + "label": "Carts" + }, + "en": { + "label": "Carts" + }, + "de": { + "label": "Carts" + } + }, + "icon": "proicons:cart1" +}', 1, '{ + "route": { + "name": "customer-page-carts", + "params": { + "locale": "" + } + } +}', 1, 1); -- +goose Down diff --git a/i18n/migrations/20260302163123_create_tables_data.sql b/i18n/migrations/20260302163123_create_tables_data.sql index 94c1233..fce9709 100644 --- a/i18n/migrations/20260302163123_create_tables_data.sql +++ b/i18n/migrations/20260302163123_create_tables_data.sql @@ -95,5 +95,24 @@ INSERT INTO `b2b_route_roles` (`route_id`, `role_id`) VALUES (7, '1'), (7, '2'), (7, '3'), -(7, '4'); +(7, '4'), +(9, '2'), +(9, '3'), +(10, '1'), +(11, '1'), +(12, '1'), +(13, '1'), +(14, '2'), +(14, '3'), +(15, '2'), +(15, '3'), +(16, '2'), +(16, '3'), +(17, '1'), +(18, '2'), +(18, '3'), +(19, '1'), +(20, '1'), +(21, '1'), +(22, '1'); -- +goose Down \ No newline at end of file