@ozdao/martyrs 0.2.563 → 0.2.565
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abac-BPl9Bmf9.js +1527 -0
- package/dist/builder.js +51 -39
- package/dist/{common.schema-GFSlNJo7.js → common.schema-DswiUXKB.js} +1 -1
- package/dist/community.server.js +48 -9
- package/dist/core.server.js +6 -4
- package/dist/{crud-C7FSTUes.js → crud-q1ye5IhV.js} +7 -7
- package/dist/events.server.js +3 -3
- package/dist/gallery.server.js +2 -2
- package/dist/inventory.server.js +4 -6
- package/dist/{main-CmjWiDVF.js → main-B9o1iBAZ.js} +1279 -1287
- package/dist/marketplace.server.js +1 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js +33 -42
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -1
- package/dist/martyrs/src/components/EditImages/{EditImages.vue.js → EditImages.vue2.js} +2 -2
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js.map +1 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -2
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
- package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Tree/Tree.vue.js +6 -3
- package/dist/martyrs/src/components/Tree/Tree.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/auth.client.js +10 -7
- package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +12 -12
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js +116 -0
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +180 -0
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -0
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +3 -3
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/locales/en.js +45 -0
- package/dist/martyrs/src/modules/core/locales/en.js.map +1 -1
- package/dist/martyrs/src/modules/core/locales/ru.js +45 -0
- package/dist/martyrs/src/modules/core/locales/ru.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js +9 -0
- package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue.js → Filters.vue2.js} +2 -2
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/mixins/mixins.js +1 -2
- package/dist/martyrs/src/modules/core/views/mixins/mixins.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/router/addRoutes.js +6 -1
- package/dist/martyrs/src/modules/core/views/router/addRoutes.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/store/marketplace.js +0 -16
- package/dist/martyrs/src/modules/marketplace/views/store/marketplace.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +4 -4
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/pages/Notifications.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js +3 -0
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js +15 -2
- package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +9 -6
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +4 -3
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +11 -2
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +11 -8
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +210 -60
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +3 -3
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.js +11 -12
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
- package/dist/notifications.server.js +0 -3
- package/dist/orders.server.js +5 -6
- package/dist/organizations.server.js +9 -10
- package/dist/products.server.js +27 -26
- package/dist/{queryProcessor-CBQgZycY.js → queryProcessor-C_5Iipam.js} +4 -1
- package/dist/rents.server.js +2 -3
- package/dist/spots.server.js +1 -1
- package/dist/style.css +38 -23
- package/dist/{web-cNKIl_cL.js → web-BF3ijvEr.js} +1 -1
- package/package.json +1 -1
- package/src/builder/modes/ssr.rspack.dev.js +4 -3
- package/src/builder/rspack/rspack.config.api.js +15 -4
- package/src/builder/rspack/rspack.config.base.js +3 -3
- package/src/builder/rspack/rspack.config.ssr.client.js +28 -28
- package/src/builder/templates/page.js +2 -2
- package/src/components/Button/Button.vue +50 -37
- package/src/components/FieldPhone/FieldPhone.vue +1 -1
- package/src/components/Loader/Loader.vue +1 -1
- package/src/components/Tree/Tree.vue +6 -3
- package/src/modules/PROCESS.md +0 -0
- package/src/modules/TASKS.MD +17 -0
- package/src/modules/auth/auth.client.js +11 -7
- package/src/modules/auth/views/components/pages/SignIn.vue +1 -1
- package/src/modules/auth/views/router/auth.router.js +94 -0
- package/src/modules/auth/views/router/users.router.js +153 -0
- package/src/modules/backoffice/components/partials/Sidebar.vue +7 -7
- package/src/modules/community/community.server.js +8 -0
- package/src/modules/community/policies/blog.policies.js +55 -0
- package/src/modules/community/routes/blog.routes.js +1 -1
- package/src/modules/community/routes/comments.routes.js +1 -1
- package/src/modules/community/routes/reactions.routes.js +1 -4
- package/src/modules/core/controllers/classes/abac/abac.adapter.express.js +206 -124
- package/src/modules/core/controllers/classes/abac/abac.adapter.ws.js +203 -50
- package/src/modules/core/controllers/classes/abac/abac.core.js +127 -36
- package/src/modules/core/controllers/classes/abac/abac.fields.js +144 -179
- package/src/modules/core/controllers/classes/abac/abac.js +201 -10
- package/src/modules/core/controllers/classes/abac/abac.policies.js +147 -57
- package/src/modules/core/controllers/classes/crud/crud.policies.js +5 -5
- package/src/modules/core/controllers/policies/core.policies.js +5 -2
- package/src/modules/core/controllers/utils/queryProcessor.js +4 -1
- package/src/modules/core/core.server.js +1 -0
- package/src/modules/core/locales/en.js +45 -0
- package/src/modules/core/locales/ru.js +45 -0
- package/src/modules/core/models/schemas/common.schema.js +1 -1
- package/src/modules/core/views/classes/i18n.manager.js +13 -0
- package/src/modules/core/views/components/sections/filters/FilterPrice.vue +81 -0
- package/src/modules/core/views/mixins/mixins.js +1 -2
- package/src/modules/core/views/router/addRoutes.js +6 -1
- package/src/modules/events/routes/events.routes.js +1 -1
- package/src/modules/inventory/components/pages/InventoryEdit.vue +3 -3
- package/src/modules/inventory/policies/inventory.policies.js +1 -1
- package/src/modules/inventory/routes/inventory.routes.js +1 -1
- package/src/modules/marketplace/marketplace.router.js +66 -0
- package/src/modules/marketplace/views/components/layouts/Marketplace.vue +363 -0
- package/src/modules/marketplace/views/components/pages/Catalog.vue +73 -0
- package/src/modules/marketplace/views/store/marketplace.js +0 -16
- package/src/modules/music/controllers/stream.controller.js +1 -1
- package/src/modules/music/music.server.js +1 -1
- package/src/modules/music/policies/music.policies.js +3 -2
- package/src/modules/music/router/library.router.js +26 -0
- package/src/modules/music/router/music.router.js +176 -0
- package/src/modules/notifications/components/elements/NotificationBadge.vue +5 -6
- package/src/modules/notifications/notifications.server.js +1 -3
- package/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue +5 -0
- package/src/modules/orders/orders.server.js +0 -1
- package/src/modules/organizations/components/blocks/CardOrganization.vue +2 -2
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +2 -2
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +2 -2
- package/src/modules/organizations/policies/organizations.policies.js +12 -6
- package/src/modules/organizations/routes/organizations.routes.js +1 -3
- package/src/modules/products/components/blocks/CardCategory.vue +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +16 -2
- package/src/modules/products/components/pages/Categories.vue +9 -6
- package/src/modules/products/components/pages/CategoryEdit.vue +8 -4
- package/src/modules/products/components/pages/Product.vue +11 -5
- package/src/modules/products/components/sections/SectionProduct.vue +11 -7
- package/src/modules/products/controllers/categories.controller.js +32 -27
- package/src/modules/products/routes/categories.routes.js +1 -1
- package/src/modules/rents/controllers/routes/rents.routes.js +1 -1
- package/src/modules/rents/views/components/pages/RentsEdit.vue +208 -49
- package/src/modules/spots/components/pages/Map.vue +2 -2
- package/dist/abac-DYoheWuc.js +0 -1031
- package/dist/core.abac-DUPBnlk6.js +0 -298
- package/dist/core.logger-C3q8A9dl.js +0 -51
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/auth.router.js +0 -342
- package/dist/martyrs/src/modules/auth/auth.router.js.map +0 -1
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +0 -1
- package/src/modules/auth/auth.router.js +0 -262
- package/src/modules/core/controllers/classes/abac/v2/abac-core-fixed.js +0 -313
- package/src/modules/core/controllers/classes/abac/v2/abac-express-fixed.js +0 -276
- package/src/modules/core/controllers/classes/abac/v2/abac-fields-fixed.js +0 -425
- package/src/modules/core/controllers/classes/abac/v2/abac-main-fixed.js +0 -295
- package/src/modules/core/controllers/classes/abac/v2/abac-policies-fixed.js +0 -316
- package/src/modules/core/controllers/classes/abac/v2/abac-ws-fixed.js +0 -237
- package/src/modules/core/controllers/classes/core.abac.js +0 -310
- package/src/modules/core/controllers/classes/core.crud.js +0 -89
- package/src/modules/governance/reactcode/eslint.config.js +0 -28
|
@@ -41,8 +41,7 @@ const _sfc_main = {
|
|
|
41
41
|
setup(__props) {
|
|
42
42
|
const props = __props;
|
|
43
43
|
useRouter();
|
|
44
|
-
const useNotifications = inject("useNotifications")
|
|
45
|
-
const { notifications, unreadCount, loading, markAllAsRead, getNotifications } = useNotifications ? useNotifications() : {
|
|
44
|
+
const useNotifications = inject("useNotifications", () => ({
|
|
46
45
|
notifications: ref([]),
|
|
47
46
|
unreadCount: ref(0),
|
|
48
47
|
loading: ref(false),
|
|
@@ -50,7 +49,8 @@ const _sfc_main = {
|
|
|
50
49
|
},
|
|
51
50
|
getNotifications: () => {
|
|
52
51
|
}
|
|
53
|
-
};
|
|
52
|
+
}));
|
|
53
|
+
const { notifications, unreadCount, loading, markAllAsRead, getNotifications } = useNotifications();
|
|
54
54
|
const isOpen = ref(false);
|
|
55
55
|
const recentNotifications = computed(() => {
|
|
56
56
|
return notifications.value.slice().sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt)).slice(0, props.maxNotifications);
|
|
@@ -135,7 +135,7 @@ const _sfc_main = {
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
const NotificationBadge = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
138
|
+
const NotificationBadge = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1dbe1152"]]);
|
|
139
139
|
export {
|
|
140
140
|
NotificationBadge as default
|
|
141
141
|
};
|
package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBadge.vue.js","sources":["../../../../../../../src/modules/notifications/components/elements/NotificationBadge.vue"],"sourcesContent":["<template>\n <div class=\"notification-badge-container\">\n <button \n class=\"i-medium notification-button\"\n @click=\"toggleNotifications\"\n :aria-label=\"unreadCount > 0 ? `${unreadCount} unread notifications` : 'No unread notifications'\"\n >\n <IconBell class=\"notification-icon i-medium\" :fill=\"fill\"/>\n <div \n v-if=\"unreadCount > 0\" \n class=\"button-counter flex flex-center\"\n >\n <span>{{ unreadCount > 99 ? '99+' : unreadCount }}</span>\n </div>\n </button>\n \n <Popup\n title=\"Notifications\"\n @close-popup=\"closeNotifications\"\n :isPopupOpen=\"isOpen\"\n align=\"center right\"\n class=\"bg-white h-min-100 w-100 w-max-30r pd-medium\"\n >\n <div class=\"cols-1 gap-thin o-y-scroll\">\n <div v-if=\"loading\" class=\"notifications-loading\">\n Loading...\n </div>\n \n <div v-else-if=\"notifications.length === 0\" class=\"notifications-empty\">\n No notifications\n </div>\n \n <div v-else class=\"flex-column flex gap-thin\">\n <notification-item \n v-for=\"notification in recentNotifications\" \n :key=\"notification._id\" \n :notification=\"notification\"\n @click=\"handleNotificationClick(notification)\"\n />\n\n <div class=\"flex-nowrap flex gap-thin\">\n <button \n v-if=\"unreadCount > 0\"\n class=\"w-100 bg-second t-white radius-small button\" \n @click=\"markAllAsRead\"\n >\n Mark all read\n </button>\n\n <router-link class=\"w-100 bg-black t-white radius-small button\" to=\"/notifications\" @click=\"closeNotifications\">\n View all \n </router-link>\n </div>\n\n </div>\n\n </div>\n </Popup>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, onMounted, inject } from 'vue';\nimport { useRouter } from 'vue-router';\n\nimport Popup from '@martyrs/src/components/Popup/Popup.vue';\n\nimport NotificationItem from '../blocks/NotificationItem.vue';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport IconBell from '@martyrs/src/modules/icons/entities/IconBell.vue';\n\nconst props = defineProps({\n maxNotifications: {\n type: Number,\n default: 10\n },\n fill: {\n type: String,\n default: 'rgb(var(--white))'\n }\n});\n\n// Get router and notification functionality\nconst router = useRouter();\n\n// Check if notifications module is loaded
|
|
1
|
+
{"version":3,"file":"NotificationBadge.vue.js","sources":["../../../../../../../src/modules/notifications/components/elements/NotificationBadge.vue"],"sourcesContent":["<template>\n <div class=\"notification-badge-container\">\n <button \n class=\"i-medium notification-button\"\n @click=\"toggleNotifications\"\n :aria-label=\"unreadCount > 0 ? `${unreadCount} unread notifications` : 'No unread notifications'\"\n >\n <IconBell class=\"notification-icon i-medium\" :fill=\"fill\"/>\n <div \n v-if=\"unreadCount > 0\" \n class=\"button-counter flex flex-center\"\n >\n <span>{{ unreadCount > 99 ? '99+' : unreadCount }}</span>\n </div>\n </button>\n \n <Popup\n title=\"Notifications\"\n @close-popup=\"closeNotifications\"\n :isPopupOpen=\"isOpen\"\n align=\"center right\"\n class=\"bg-white h-min-100 w-100 w-max-30r pd-medium\"\n >\n <div class=\"cols-1 gap-thin o-y-scroll\">\n <div v-if=\"loading\" class=\"notifications-loading\">\n Loading...\n </div>\n \n <div v-else-if=\"notifications.length === 0\" class=\"notifications-empty\">\n No notifications\n </div>\n \n <div v-else class=\"flex-column flex gap-thin\">\n <notification-item \n v-for=\"notification in recentNotifications\" \n :key=\"notification._id\" \n :notification=\"notification\"\n @click=\"handleNotificationClick(notification)\"\n />\n\n <div class=\"flex-nowrap flex gap-thin\">\n <button \n v-if=\"unreadCount > 0\"\n class=\"w-100 bg-second t-white radius-small button\" \n @click=\"markAllAsRead\"\n >\n Mark all read\n </button>\n\n <router-link class=\"w-100 bg-black t-white radius-small button\" to=\"/notifications\" @click=\"closeNotifications\">\n View all \n </router-link>\n </div>\n\n </div>\n\n </div>\n </Popup>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, onMounted, inject } from 'vue';\nimport { useRouter } from 'vue-router';\n\nimport Popup from '@martyrs/src/components/Popup/Popup.vue';\n\nimport NotificationItem from '../blocks/NotificationItem.vue';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport IconBell from '@martyrs/src/modules/icons/entities/IconBell.vue';\n\nconst props = defineProps({\n maxNotifications: {\n type: Number,\n default: 10\n },\n fill: {\n type: String,\n default: 'rgb(var(--white))'\n }\n});\n\n// Get router and notification functionality\nconst router = useRouter();\n\n// Check if notifications module is loaded, provide fallback if not\nconst useNotifications = inject('useNotifications', () => ({\n notifications: ref([]),\n unreadCount: ref(0),\n loading: ref(false),\n markAllAsRead: () => {},\n getNotifications: () => {}\n}));\n\nconst { notifications, unreadCount, loading, markAllAsRead, getNotifications } = useNotifications();\n\n// Local state\nconst isOpen = ref(false);\n\n// Computed properties\nconst recentNotifications = computed(() => {\n return notifications.value\n .slice()\n .sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt))\n .slice(0, props.maxNotifications);\n});\n\n// Methods\nconst toggleNotifications = () => {\n isOpen.value = !isOpen.value;\n};\n\nconst closeNotifications = () => {\n isOpen.value = false;\n};\n\nconst handleNotificationClick = (notification) => {\n isOpen.value = false;\n \n if (notification._id) {\n // Handle in store\n actions.handleNotificationAction({\n notificationId: notification._id,\n ...notification.metadata\n });\n }\n};\n\n// Lifecycle hooks\nonMounted(() => {\n // Load notifications when component mounts\n const userId = auth.state.user._id;\n if (userId) {\n getNotifications(userId);\n }\n});\n</script>\n\n<style scoped>\n.notification-badge-container {\n position: relative;\n display: inline-block;\n}\n\n.notification-button {\n background: none;\n border: none;\n cursor: pointer;\n position: relative;\n font-size: 1.2rem;\n}\n\n.notification-icon {\n font-size: 1.4rem;\n}\n\n.button-counter {\n position: absolute;\n right: -8px;\n bottom: -8px;\n background: rgb(var(--fourth));\n color: rgb(var(--white));\n height: 16px;\n border-radius: 16px;\n width: 16px;\n font-weight: 500;\n text-align: center;\n line-height: 16px;\n font-size: 10px;\n}\n\n\n.notifications-loading,\n.notifications-empty {\n padding: 24px;\n text-align: center;\n color: rgb(var(--text-light));\n}\n</style>"],"names":["auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,UAAM,QAAQ;AAYC,cAAS;AAGxB,UAAM,mBAAmB,OAAO,oBAAoB,OAAO;AAAA,MACzD,eAAe,IAAI,EAAE;AAAA,MACrB,aAAa,IAAI,CAAC;AAAA,MAClB,SAAS,IAAI,KAAK;AAAA,MAClB,eAAe,MAAM;AAAA,MAAC;AAAA,MACtB,kBAAkB,MAAM;AAAA,MAAC;AAAA,IAC3B,EAAE;AAEF,UAAM,EAAE,eAAe,aAAa,SAAS,eAAe,iBAAgB,IAAK,iBAAgB;AAGjG,UAAM,SAAS,IAAI,KAAK;AAGxB,UAAM,sBAAsB,SAAS,MAAM;AACzC,aAAO,cAAc,MAClB,MAAK,EACL,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,SAAS,IAAI,IAAI,KAAK,EAAE,SAAS,CAAC,EAC5D,MAAM,GAAG,MAAM,gBAAgB;AAAA,IACpC,CAAC;AAGD,UAAM,sBAAsB,MAAM;AAChC,aAAO,QAAQ,CAAC,OAAO;AAAA,IACzB;AAEA,UAAM,qBAAqB,MAAM;AAC/B,aAAO,QAAQ;AAAA,IACjB;AAEA,UAAM,0BAA0B,CAAC,iBAAiB;AAChD,aAAO,QAAQ;AAEf,UAAI,aAAa,KAAK;AAEpB,gBAAQ,yBAAyB;AAAA,UAC/B,gBAAgB,aAAa;AAAA,UAC7B,GAAG,aAAa;AAAA,QACtB,CAAK;AAAA,MACH;AAAA,IACF;AAGA,cAAU,MAAM;AAEd,YAAM,SAASA,MAAW,KAAK;AAC/B,UAAI,QAAQ;AACV,yBAAiB,MAAM;AAAA,MACzB;AAAA,IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, ref, createElementBlock, openBlock, createVNode, createElementVNode, unref, createBlock, createCommentVNode } from "vue";
|
|
2
2
|
import { useRoute } from "vue-router";
|
|
3
|
-
import _sfc_main$1 from "../../../../components/Tab/Tab.
|
|
3
|
+
import _sfc_main$1 from "../../../../components/Tab/Tab.vue2.js";
|
|
4
4
|
import NotificationsList from "../sections/NotificationsList.vue.js";
|
|
5
5
|
import NotificationPreferences from "../sections/NotificationPreferences.vue.js";
|
|
6
6
|
const _hoisted_1 = { class: "notifications-page pd-small" };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ref, createBlock, openBlock, mergeProps, unref, isRef, withCtx, createVNode, createElementVNode, createElementBlock, createCommentVNode, toDisplayString, Fragment, renderList, resolveDynamicComponent } from "vue";
|
|
2
2
|
import { useI18n } from "vue-i18n";
|
|
3
|
+
import { i18nManager } from "../../../core/views/classes/i18n.manager.js";
|
|
4
|
+
import locales from "../../locales/index.js";
|
|
3
5
|
import _sfc_main$1 from "../../../../components/FieldBig/FieldBig.vue.js";
|
|
4
6
|
import _sfc_main$2 from "../../../../components/Popup/Popup.vue.js";
|
|
5
7
|
import _sfc_main$9 from "../../../icons/socials/facebook.vue.js";
|
|
@@ -73,6 +75,7 @@ const _sfc_main = {
|
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
77
|
setup(__props) {
|
|
78
|
+
i18nManager.register("orders", locales);
|
|
76
79
|
const store = useStore();
|
|
77
80
|
const props = __props;
|
|
78
81
|
const { t, tm } = useI18n({
|
package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldSubscribeNewsletter.vue.js","sources":["../../../../../../../src/modules/orders/components/elements/FieldSubscribeNewsletter.vue"],"sourcesContent":["<template>\n <FieldBig \n :input=\"email\" \n :typingSpeed=\"typingSpeed\"\n :loopTyping=\"loopTyping\"\n :enableTyping=\"enableTyping\"\n :placeholder=\"props.placeholder || t('orders.newsletter.placeholder')\"\n :action=\"props.action === false ? '' : props.action || t('orders.newsletter.action')\"\n :name=\"fieldName\"\n :id=\"fieldId\"\n @update:input=\"email = $event\"\n @action=\"sendApplication\"\n :showLoader=\"true\"\n :showSuccess=\"false\"\n :callbackDelay=\"100\"\n v-bind=\"$attrs\"\n >\n <Popup\n :isPopupOpen=\"isSuccessPopupOpen\"\n @close-popup=\"isSuccessPopupOpen = false\"\n align=\"center center\"\n class=\"bg-white t-black pd-big radius-big\"\n >\n <div class=\"t-center\">\n <h3 class=\"mn-b-medium\">{{ props.successTitle || t('orders.newsletter.success.title') }}</h3>\n <p class=\"t-transp mn-b-medium\">{{ props.successSubtitle || t('orders.newsletter.success.subtitle') }}</p>\n \n <div v-if=\"(props.socials || tm('orders.newsletter.socials')) && (props.socials || tm('orders.newsletter.socials')).length\" class=\"flex flex-wrap flex-h-center gap-regular\">\n <a\n v-for=\"social in (props.socials || tm('orders.newsletter.socials'))\"\n :key=\"social.name\"\n :href=\"social.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"hover-scale-1 bg-light radius-small pd-thin transition-all\"\n >\n <component\n :is=\"socialIcons[social.icon]\"\n class=\"i-medium\"\n :fill=\"'rgb(var(--dark))'\"\n />\n </a>\n </div>\n </div>\n </Popup>\n </FieldBig>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue'\nimport { useI18n } from 'vue-i18n'\n\nimport FieldBig from '@martyrs/src/components/FieldBig/FieldBig.vue'\nimport Popup from '@martyrs/src/components/Popup/Popup.vue'\n\nimport IconFacebook from '@martyrs/src/modules/icons/socials/facebook.vue'\nimport IconInstagram from '@martyrs/src/modules/icons/socials/instagram.vue'\nimport IconTelegram from '@martyrs/src/modules/icons/socials/telegram.vue'\nimport IconTwitter from '@martyrs/src/modules/icons/socials/twitter.vue'\nimport IconYoutube from '@martyrs/src/modules/icons/socials/youtube.vue'\nimport IconLinkedin from '@martyrs/src/modules/icons/socials/linkedin.vue'\nimport IconWhatsapp from '@martyrs/src/modules/icons/socials/whatsapp.vue'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport applications from '@martyrs/src/modules/orders/store/applications.js'\n\nconst store = useStore()\n\nconst props = defineProps({\n // Тексты компонента\n title: {\n type: String,\n default: null\n },\n subtitle: {\n type: String,\n default: null\n },\n placeholder: {\n type: String,\n default: null\n },\n action: {\n type: String,\n default: null\n },\n successTitle: {\n type: String,\n default: null\n },\n successSubtitle: {\n type: String,\n default: null\n },\n socials: {\n type: Array,\n default: null\n },\n // Настройки поля\n typingSpeed: {\n type: Number,\n default: 75\n },\n loopTyping: {\n type: Boolean,\n default: false\n },\n enableTyping: {\n type: Boolean,\n default: false\n },\n fieldName: {\n type: String,\n default: 'newsletter-email'\n },\n fieldId: {\n type: String,\n default: null\n }\n})\n\n// Используем только глобальную локализацию\nconst { t, tm } = useI18n({\n useScope: 'global'\n})\n\nlet email = ref('')\nlet isSuccessPopupOpen = ref(false)\n\nconst socialIcons = {\n facebook: IconFacebook,\n instagram: IconInstagram,\n telegram: IconTelegram,\n twitter: IconTwitter,\n youtube: IconYoutube,\n linkedin: IconLinkedin,\n whatsapp: IconWhatsapp\n}\n\n// Функция валидации email\nfunction validateEmail(email) {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n return emailRegex.test(email)\n}\n\nfunction showSuccessPopup() {\n isSuccessPopupOpen.value = true\n}\n\nasync function sendApplication() {\n // Валидация email перед отправкой\n if (!email.value || !email.value.trim()) {\n store.core.setError({ message: t('validation.email.required') || 'Email is required' })\n return Promise.reject(new Error('Email is required'))\n }\n\n if (!validateEmail(email.value.trim())) {\n store.core.setError({ message: t('validation.email.invalid') || 'Invalid email format' })\n return Promise.reject(new Error('Invalid email format'))\n }\n\n gtag('event', 'subscribe_newsletter', {\n 'event_category': 'conversion',\n 'event_label': 'Subscribe Newsletter'\n });\n\n try {\n let application = {\n type: 'newsletter',\n contacts: {\n email: email.value.trim()\n }\n };\n\n // Используем публичный API для создания заявки\n const response = await fetch(`${process.env.API_URL}/api/applications/public`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(application)\n });\n\n if (!response.ok) {\n throw new Error('Failed to create application');\n }\n\n const result = await response.json();\n\n showSuccessPopup()\n return Promise.resolve(result);\n } catch (error) {\n console.log(error)\n store.core.setError(error)\n return Promise.reject(error);\n }\n}\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":["IconFacebook","IconInstagram","IconTelegram","IconTwitter","IconYoutube","IconLinkedin","IconWhatsapp","email"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldSubscribeNewsletter.vue.js","sources":["../../../../../../../src/modules/orders/components/elements/FieldSubscribeNewsletter.vue"],"sourcesContent":["<template>\n <FieldBig \n :input=\"email\" \n :typingSpeed=\"typingSpeed\"\n :loopTyping=\"loopTyping\"\n :enableTyping=\"enableTyping\"\n :placeholder=\"props.placeholder || t('orders.newsletter.placeholder')\"\n :action=\"props.action === false ? '' : props.action || t('orders.newsletter.action')\"\n :name=\"fieldName\"\n :id=\"fieldId\"\n @update:input=\"email = $event\"\n @action=\"sendApplication\"\n :showLoader=\"true\"\n :showSuccess=\"false\"\n :callbackDelay=\"100\"\n v-bind=\"$attrs\"\n >\n <Popup\n :isPopupOpen=\"isSuccessPopupOpen\"\n @close-popup=\"isSuccessPopupOpen = false\"\n align=\"center center\"\n class=\"bg-white t-black pd-big radius-big\"\n >\n <div class=\"t-center\">\n <h3 class=\"mn-b-medium\">{{ props.successTitle || t('orders.newsletter.success.title') }}</h3>\n <p class=\"t-transp mn-b-medium\">{{ props.successSubtitle || t('orders.newsletter.success.subtitle') }}</p>\n \n <div v-if=\"(props.socials || tm('orders.newsletter.socials')) && (props.socials || tm('orders.newsletter.socials')).length\" class=\"flex flex-wrap flex-h-center gap-regular\">\n <a\n v-for=\"social in (props.socials || tm('orders.newsletter.socials'))\"\n :key=\"social.name\"\n :href=\"social.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"hover-scale-1 bg-light radius-small pd-thin transition-all\"\n >\n <component\n :is=\"socialIcons[social.icon]\"\n class=\"i-medium\"\n :fill=\"'rgb(var(--dark))'\"\n />\n </a>\n </div>\n </div>\n </Popup>\n </FieldBig>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { i18nManager } from '@martyrs/src/modules/core/views/classes/i18n.manager.js'\nimport locales from '@martyrs/src/modules/orders/locales/index.js'\n\nimport FieldBig from '@martyrs/src/components/FieldBig/FieldBig.vue'\nimport Popup from '@martyrs/src/components/Popup/Popup.vue'\n\nimport IconFacebook from '@martyrs/src/modules/icons/socials/facebook.vue'\nimport IconInstagram from '@martyrs/src/modules/icons/socials/instagram.vue'\nimport IconTelegram from '@martyrs/src/modules/icons/socials/telegram.vue'\nimport IconTwitter from '@martyrs/src/modules/icons/socials/twitter.vue'\nimport IconYoutube from '@martyrs/src/modules/icons/socials/youtube.vue'\nimport IconLinkedin from '@martyrs/src/modules/icons/socials/linkedin.vue'\nimport IconWhatsapp from '@martyrs/src/modules/icons/socials/whatsapp.vue'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport applications from '@martyrs/src/modules/orders/store/applications.js'\n\n// Регистрируем переводы модуля при использовании компонента\ni18nManager.register('orders', locales)\n\nconst store = useStore()\n\nconst props = defineProps({\n // Тексты компонента\n title: {\n type: String,\n default: null\n },\n subtitle: {\n type: String,\n default: null\n },\n placeholder: {\n type: String,\n default: null\n },\n action: {\n type: String,\n default: null\n },\n successTitle: {\n type: String,\n default: null\n },\n successSubtitle: {\n type: String,\n default: null\n },\n socials: {\n type: Array,\n default: null\n },\n // Настройки поля\n typingSpeed: {\n type: Number,\n default: 75\n },\n loopTyping: {\n type: Boolean,\n default: false\n },\n enableTyping: {\n type: Boolean,\n default: false\n },\n fieldName: {\n type: String,\n default: 'newsletter-email'\n },\n fieldId: {\n type: String,\n default: null\n }\n})\n\n// Используем только глобальную локализацию\nconst { t, tm } = useI18n({\n useScope: 'global'\n})\n\nlet email = ref('')\nlet isSuccessPopupOpen = ref(false)\n\nconst socialIcons = {\n facebook: IconFacebook,\n instagram: IconInstagram,\n telegram: IconTelegram,\n twitter: IconTwitter,\n youtube: IconYoutube,\n linkedin: IconLinkedin,\n whatsapp: IconWhatsapp\n}\n\n// Функция валидации email\nfunction validateEmail(email) {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n return emailRegex.test(email)\n}\n\nfunction showSuccessPopup() {\n isSuccessPopupOpen.value = true\n}\n\nasync function sendApplication() {\n // Валидация email перед отправкой\n if (!email.value || !email.value.trim()) {\n store.core.setError({ message: t('validation.email.required') || 'Email is required' })\n return Promise.reject(new Error('Email is required'))\n }\n\n if (!validateEmail(email.value.trim())) {\n store.core.setError({ message: t('validation.email.invalid') || 'Invalid email format' })\n return Promise.reject(new Error('Invalid email format'))\n }\n\n gtag('event', 'subscribe_newsletter', {\n 'event_category': 'conversion',\n 'event_label': 'Subscribe Newsletter'\n });\n\n try {\n let application = {\n type: 'newsletter',\n contacts: {\n email: email.value.trim()\n }\n };\n\n // Используем публичный API для создания заявки\n const response = await fetch(`${process.env.API_URL}/api/applications/public`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(application)\n });\n\n if (!response.ok) {\n throw new Error('Failed to create application');\n }\n\n const result = await response.json();\n\n showSuccessPopup()\n return Promise.resolve(result);\n } catch (error) {\n console.log(error)\n store.core.setError(error)\n return Promise.reject(error);\n }\n}\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":["IconFacebook","IconInstagram","IconTelegram","IconTwitter","IconYoutube","IconLinkedin","IconWhatsapp","email"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,gBAAY,SAAS,UAAU,OAAO;AAEtC,UAAM,QAAQ,SAAQ;AAEtB,UAAM,QAAQ;AAsDd,UAAM,EAAE,GAAG,GAAE,IAAK,QAAQ;AAAA,MACxB,UAAU;AAAA,IACZ,CAAC;AAED,QAAI,QAAQ,IAAI,EAAE;AAClB,QAAI,qBAAqB,IAAI,KAAK;AAElC,UAAM,cAAc;AAAA,MAClB,UAAUA;AAAAA,MACV,WAAWC;AAAAA,MACX,UAAUC;AAAAA,MACV,SAASC;AAAAA,MACT,SAASC;AAAAA,MACT,UAAUC;AAAAA,MACV,UAAUC;AAAAA,IACZ;AAGA,aAAS,cAAcC,QAAO;AAC5B,YAAM,aAAa;AACnB,aAAO,WAAW,KAAKA,MAAK;AAAA,IAC9B;AAEA,aAAS,mBAAmB;AAC1B,yBAAmB,QAAQ;AAAA,IAC7B;AAEA,mBAAe,kBAAkB;AAE/B,UAAI,CAAC,MAAM,SAAS,CAAC,MAAM,MAAM,QAAQ;AACvC,cAAM,KAAK,SAAS,EAAE,SAAS,EAAE,2BAA2B,KAAK,oBAAmB,CAAE;AACtF,eAAO,QAAQ,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAAA,MACtD;AAEA,UAAI,CAAC,cAAc,MAAM,MAAM,KAAI,CAAE,GAAG;AACtC,cAAM,KAAK,SAAS,EAAE,SAAS,EAAE,0BAA0B,KAAK,uBAAsB,CAAE;AACxF,eAAO,QAAQ,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAAA,MACzD;AAEA,WAAK,SAAS,wBAAwB;AAAA,QACpC,kBAAkB;AAAA,QAClB,eAAe;AAAA,MACnB,CAAG;AAED,UAAI;AACF,YAAI,cAAc;AAAA,UAChB,MAAM;AAAA,UACN,UAAU;AAAA,YACR,OAAO,MAAM,MAAM,KAAI;AAAA,UAC/B;AAAA,QACA;AAGI,cAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,IAAI,OAAO,4BAA4B;AAAA,UAC7E,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,gBAAgB;AAAA,UACxB;AAAA,UACM,MAAM,KAAK,UAAU,WAAW;AAAA,QACtC,CAAK;AAED,YAAI,CAAC,SAAS,IAAI;AAChB,gBAAM,IAAI,MAAM,8BAA8B;AAAA,QAChD;AAEA,cAAM,SAAS,MAAM,SAAS,KAAI;AAElC,yBAAgB;AAChB,eAAO,QAAQ,QAAQ,MAAM;AAAA,MAC/B,SAAS,OAAO;AACd,gBAAQ,IAAI,KAAK;AACjB,cAAM,KAAK,SAAS,KAAK;AACzB,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { getCurrentInstance, computed, ref, onMounted, createElementBlock, openB
|
|
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _sfc_main$2 from "../../../../components/Button/Button.vue2.js";
|
|
5
|
-
import _sfc_main$3 from "../../../../components/Tab/Tab.
|
|
5
|
+
import _sfc_main$3 from "../../../../components/Tab/Tab.vue2.js";
|
|
6
6
|
import _sfc_main$4 from "../../../../components/Popup/Popup.vue.js";
|
|
7
7
|
import _sfc_main$1 from "../../../../components/Block/Block.vue.js";
|
|
8
8
|
import _sfc_main$5 from "../../../../components/Feed/Feed.vue.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, computed, onMounted, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, createVNode, unref, withCtx, createElementVNode, toDisplayString, Fragment, renderList } from "vue";
|
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
|
3
3
|
import { useGlobalMixins } from "../../../core/views/mixins/mixins.js";
|
|
4
|
-
/* empty css
|
|
4
|
+
/* empty css */
|
|
5
5
|
import _sfc_main$2 from "../../../../components/Block/Block.vue.js";
|
|
6
6
|
import { state, actions, getters } from "../../store/orders.js";
|
|
7
7
|
import { state as state$1 } from "../../../auth/views/store/auth.js";
|
|
@@ -10,7 +10,7 @@ import _sfc_main$2 from "../../../../components/Radio/Radio.vue.js";
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
|
-
/* empty css
|
|
13
|
+
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
15
|
import CardSpot from "../../../spots/components/blocks/CardSpot.vue.js";
|
|
16
16
|
import { useStore } from "../../../core/views/store/core.store.js";
|
|
@@ -74,7 +74,7 @@ const _sfc_main = {
|
|
|
74
74
|
return (_ctx, _cache) => {
|
|
75
75
|
return openBlock(), createElementBlock("div", {
|
|
76
76
|
class: "o-hidden pos-relative cursor-pointer bg-light",
|
|
77
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$router.push(
|
|
77
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$router.push("/organizations/" + __props.organization._id))
|
|
78
78
|
}, [
|
|
79
79
|
createElementVNode("div", _hoisted_1, [
|
|
80
80
|
__props.organization.profile.photo && __props.organization.profile.photo.length > 0 ? (openBlock(), createElementBlock("img", {
|
package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardOrganization.vue.js","sources":["../../../../../../../src/modules/organizations/components/blocks/CardOrganization.vue"],"sourcesContent":["<template>\n <div
|
|
1
|
+
{"version":3,"file":"CardOrganization.vue.js","sources":["../../../../../../../src/modules/organizations/components/blocks/CardOrganization.vue"],"sourcesContent":["<template>\n <div\n class=\"o-hidden pos-relative cursor-pointer bg-light \"\n @click=\"$router.push('/organizations/' + organization._id)\"\n >\n <div class=\"h-4r flex pos-relative\">\n\n <img loading=\"lazy\" \n v-if=\"organization.profile.photo && organization.profile.photo.length > 0\"\n :src=\"(FILE_SERVER_URL || '') + organization.profile.photo\" \n class=\"h-4r w-4r radius-extra bg-white\" \n style=\"flex: 0 1 auto\"\n />\n\n <PlaceholderOrganizationPic\n v-else\n class=\"w-4r h-max radius-medium\"\n style=\"flex: 0 1 auto\"\n />\n \n <div class=\"pos-relative w-100 flex-h-center flex flex-column flex-child-1 flex-child mn-l-thin w-100\">\n \n <!-- <Text :text=\"organization.profile.name ? organization.profile.name : ''\" :maxLen=\"18\" class=\"h3 d-block\"/> -->\n <p class=\"h4 t-truncate w-100\">{{organization.profile.name}}</p>\n <!-- RATING -->\n <!-- <div v-if=\"showRating && organization.rating\" class=\"w-max star-container flex-v-center flex\">\n <img loading=\"lazy\" \n v-for=\"i in 5\"\n class=\"i-small mn-r-thin\"\n :src=\"i <= organization.rating.median ? '/icons/star.svg' : '/icons/star-stroke.svg'\"\n >\n\n <span class=\"p-small t-semi mn-r-thin\">{{organization.rating.median}}</span>\n <span class=\"p-small\">({{organization.rating.amount}})</span>\n </div> -->\n\n <div v-if=\"showFollowers || showTags\" class=\"mn-t-micro gap-micro flex-nowrap flex\">\n\n <Chips \n v-if=\"showTags && organization.profile.tags?.length > 0\" \n :chips=\"organization.profile.tags.slice(0,3)\"\n class=\"pos-relative t-trimmed\"\n >\n <div v-if=\"showFollowers\" class=\"t-truncate pos-relative p-regular mn-r-nano d-inline-block w-max pd-b-micro pd-t-micro pd-r-thin pd-l-thin radius-small t-medium bg-white\">\n <p class=\"t-truncate\">{{organization.numberOfSubscribers}} followers</p>\n\n <ButtonToggleMembership\n v-if=\"\n user?._id \n && organization.owner !== user._id\n \"\n :user=\"user._id\"\n :type=\"'organization'\" \n :role=\"'subscriber'\" \n :target=\"organization._id\" \n :status=\"organization.isSubscriber\" \n :text=\"{create: '+', remove: '-'}\"\n @updateMembership=\"event => emits('updateMembership', event, 'isSubscriber', 'numberOfSubscribers')\"\n class=\"i-medium\" \n />\n </div>\n </Chips>\n </div>\n\n </div>\n\n </div>\n\n\n <div \n v-if=\"showProducts && organization.products\" \n class=\"mn-b-small t-nowrap mn-t-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium\"\n >\n <IconTime class=\"i-medium t-transp mn-r-micro\"/>\n <span class=\"mn-r-micro\">\n {{\n organization.distance ? \n organization.distance > 50 ? \n '3-5 days' : \n Math.ceil((5 + 5 + 3 * organization.distance) / 5) * 5 \n + '-' \n + Math.ceil((15 + 5 + 3 * organization.distance) / 5) * 5 \n + ' MIN' : 'Unavailable' \n }} \n </span>\n\n <span v-if=\"organization.distance && organization.distance < 50\" class=\"t-transp t-grey mn-r-micro\">|</span>\n <span v-if=\"organization.distance && organization.distance < 50\" class=\"mn-r-thin\">{{organization.distance ? organization.distance.toFixed(1) + 'KM' : ''}}</span>\n <!-- <span class=\"mn-r-thin\">{{organization.nearestSpotDistance}}</span> -->\n <!-- <IconPrice class=\"i-medium mn-r-micro\"/> -->\n <!-- <span class=\"mn-r-thin\">{{returnCurrency()}}500 </span> -->\n <IconShopcart class=\"i-medium t-transp mn-r-micro\"/>\n <span class=\"mn-r-thin\"> {{organization.products.length}} products</span>\n </div>\n\n <div v-if=\"showProducts && organization.products?.length > 0\" class=\"w-100 o-scroll scroll-hide radius-medium\">\n <div class=\"w-max flex-nowrap flex gap-thin\">\n <CardOrderItem\n @click.stop=\"$router.push(`/organizations/${organization._id}/products/${product._id}`)\"\n v-for=\"product in organization.products.slice(0,5)\"\n :key=\"product._id\"\n :editable=\"false\"\n :productId=\"product._id\"\n :variantId=\"product.variants?.[0]?._id\"\n :images=\"product.images\"\n :name=\"product.name\"\n :quantity=\"product.variants?.[0]?.quantity || 1\"\n :unit=\"product.variants?.[0]?.unit\"\n :dates=\"product.date\"\n :listing=\"product.listing\"\n :price=\"product.variants?.[0]?.price\"\n class=\"pd-thin w-15r radius-medium bg-white\"\n\n />\n <button class=\"pd-thin w-15r radius-medium bg-main button\">\n View menu\n </button>\n </div>\n </div>\n\n </div>\n</template>\n\n<script setup>\n import { ref } from 'vue'\n import { useRouter } from 'vue-router'\n import CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue';\n\n import Text from '@martyrs/src/components/Text/Text.vue'\n import Chips from '@martyrs/src/components/Chips/Chips.vue'\n\n import PlaceholderOrganizationPic from '@martyrs/src/modules/icons/placeholders/PlaceholderOrganizationPic.vue'\n\n import IconPrice from '@martyrs/src/modules/icons/entities/IconPrice.vue'\n import IconShopcart from '@martyrs/src/modules/icons/entities/IconShopcart.vue'\n import IconTime from '@martyrs/src/modules/icons/entities/IconTime.vue'\n\n import ButtonToggleMembership from '@martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue'\n\n const props = defineProps({\n // Model\n user: String,\n organization: Object,\n // View\n showProducts: {\n type: Boolean,\n default: false\n },\n showFollowers: {\n type: Boolean,\n default: true\n },\n showRating: {\n type: Boolean,\n default: false\n },\n showFeatured: {\n type: Boolean,\n default: true\n },\n showTags: {\n type: Boolean,\n default: true\n },\n });\n\n const emits = defineEmits(['updateMembership'])\n\n const router = useRouter();\n</script>\n\n<style>\n\n.t-trimmed {\n font-size: 0;\n}\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsKE,UAAM,QAAQ;AAEC,cAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import "vue-i18n";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
import _sfc_main$1 from "../../../../components/Dropdown/Dropdown.vue.js";
|
|
7
7
|
import _sfc_main$7 from "../../../../components/Chips/Chips.vue.js";
|
|
8
|
-
/* empty css
|
|
8
|
+
/* empty css */
|
|
9
9
|
import "../../../../components/Menu/MenuItem.vue.js";
|
|
10
10
|
import _sfc_main$6 from "../../../icons/entities/IconFollowing.vue.js";
|
|
11
11
|
import _sfc_main$5 from "../../../icons/navigation/IconEdit.vue.js";
|
package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, onMounted, createElementBlock, openBlock, createVNode, withCtx, createBlock, createCommentVNode, unref, createElementVNode } from "vue";
|
|
2
|
-
import _sfc_main$1 from "../../../../components/Menu/Menu.
|
|
2
|
+
import _sfc_main$1 from "../../../../components/Menu/Menu.vue2.js";
|
|
3
3
|
import _sfc_main$2 from "../../../../components/Menu/MenuItem.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import _sfc_main$4 from "../../../icons/entities/IconProducts.vue.js";
|
|
@@ -3,7 +3,7 @@ import { useRoute, useRouter } from "vue-router";
|
|
|
3
3
|
import "vue-i18n";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import _sfc_main$2 from "../../../../components/FieldTags/BlockTags.vue.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
import Field from "../../../../components/Field/Field.vue.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
import _sfc_main$1 from "../../../../components/SelectMulti/SelectMulti.vue2.js";
|
|
@@ -34,7 +34,7 @@ const _sfc_main = {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
function redirectTo() {
|
|
37
|
-
router.replace(
|
|
37
|
+
router.replace("/organizations/" + state.current._id);
|
|
38
38
|
}
|
|
39
39
|
return (_ctx, _cache) => {
|
|
40
40
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationEdit.vue.js","sources":["../../../../../../../src/modules/organizations/components/pages/OrganizationEdit.vue"],"sourcesContent":["<template>\n<div class=\"for-transition pd-thin\">\n \n <h3 class=\"mn-b-small\">Type of group</h3>\n <p class=\"mn-b-thin\">Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.</p>\n \n <SelectMulti\n v-model=\"organization.state.current.types\"\n :options=\"['public','exclusive','hidden']\"\n :multiple=\"false\"\n :taggable=\"false\"\n placeholder=\"Type to search or add type of organization\"\n class=\"mn-b-semi bg-light pd-medium radius-small\" \n />\n\n\n <h3 class=\"mn-b-small\">Profile</h3>\n\n <div class=\"mn-b-thin radius-small w-100 h-10r bg-light flex-center flex-column flex\">\n <UploadImage \n v-model:photo=\"organization.state.current.profile.photo\"\n :uploadPath=\"'organizations/' + organization.state.current._id + '/avatars'\"\n class=\"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra\" \n />\n <h4>Upload photo</h4>\n </div>\n\n <Field \n v-model:field=\"organization.state.current.profile.name\" \n placeholder=\"Name of organization\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n\n <Field \n v-model:field=\"organization.state.current.profile.description\" \n placeholder=\"Brief description of your group\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <BlockTags\n @tags-changed=\"newTags => organization.state.current.profile.tags = newTags\"\n :tags=\"organization.state.current.profile.tags\"\n class=\"mn-b-small\"\n />\n\n <h3 class=\"mn-b-small\">Contacts</h3>\n <Field \n v-model:field=\"organization.state.current.contacts.email\"\n label=\"Email\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.contacts.website\"\n label=\"Website\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.contacts.phone\"\n label=\"Phone\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.contacts.address\"\n label=\"Address\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n\n <h3 class=\"mn-b-small\">Socials</h3>\n <p class=\"mn-b-thin\">Please provide only the username for social media profiles, without full links.</p>\n\n <Field \n v-model:field=\"organization.state.current.socials.instagram\"\n label=\"Instagram\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.twitter\"\n label=\"Twitter\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.facebook\"\n label=\"Facebook\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.telegram\"\n label=\"Telegram\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.youtube\"\n label=\"Youtube\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n \n \n <Button :submit=\"onSubmit\" :callback=\"redirectTo\" class=\"bg-main w-100 mn-b-thin\">Save</Button>\n <!-- <Button :submit=\"onDelete\" :callback=\"redirectDash\" class=\"mn-b-thin bg-fourth\">Delete</Button> -->\n\n</div>\n\n</template>\n\n<script setup>\n import { onMounted, computed } from 'vue';\n\n import { useRoute, useRouter } from 'vue-router';\n\n import Breadcrumbs from '@martyrs/src/components/Breadcrumbs/Breadcrumbs.vue'\n import BlockTags from '@martyrs/src/components/FieldTags/BlockTags.vue'\n import Tab from '@martyrs/src/components/Tab/Tab.vue';\n import Field from '@martyrs/src/components/Field/Field.vue';\n import Select from '@martyrs/src/components/Select/Select.vue';\n import SelectMulti from '@martyrs/src/components/SelectMulti/SelectMulti.vue'\n import UploadImage from '@martyrs/src/components/UploadImage/UploadImage.vue';\n import Button from '@martyrs/src/components/Button/Button.vue';\n import Popup from '@martyrs/src/components/Popup/Popup.vue';\n\n import * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\n import * as organization from '@martyrs/src/modules/organizations/store/organizations.js';\n import membershipsStore from '@martyrs/src/modules/organizations/store/memberships.store.js';\n\n const route = useRoute()\n const router = useRouter()\n\n organization.actions.reset();\n\n onMounted(async()=>{\n if (route.params._id) {\n await organization.actions.read({ _id: route.params._id });\n } \n })\n \n const organizationData = computed(() => organization.state.current)\n\n async function onSubmit() {\n if (route.params._id) {\n await organization.actions.update(route.params._id, organizationData.value)\n } else {\n await organization.actions.create(organization.state.current, auth.state.user._id)\n }\n }\n\n async function onDelete() {\n if (route.params._id) {\n await organization.actions.remove(route.params._id)\n router.push(
|
|
1
|
+
{"version":3,"file":"OrganizationEdit.vue.js","sources":["../../../../../../../src/modules/organizations/components/pages/OrganizationEdit.vue"],"sourcesContent":["<template>\n<div class=\"for-transition pd-thin\">\n \n <h3 class=\"mn-b-small\">Type of group</h3>\n <p class=\"mn-b-thin\">Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.</p>\n \n <SelectMulti\n v-model=\"organization.state.current.types\"\n :options=\"['public','exclusive','hidden']\"\n :multiple=\"false\"\n :taggable=\"false\"\n placeholder=\"Type to search or add type of organization\"\n class=\"mn-b-semi bg-light pd-medium radius-small\" \n />\n\n\n <h3 class=\"mn-b-small\">Profile</h3>\n\n <div class=\"mn-b-thin radius-small w-100 h-10r bg-light flex-center flex-column flex\">\n <UploadImage \n v-model:photo=\"organization.state.current.profile.photo\"\n :uploadPath=\"'organizations/' + organization.state.current._id + '/avatars'\"\n class=\"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra\" \n />\n <h4>Upload photo</h4>\n </div>\n\n <Field \n v-model:field=\"organization.state.current.profile.name\" \n placeholder=\"Name of organization\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n\n <Field \n v-model:field=\"organization.state.current.profile.description\" \n placeholder=\"Brief description of your group\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <BlockTags\n @tags-changed=\"newTags => organization.state.current.profile.tags = newTags\"\n :tags=\"organization.state.current.profile.tags\"\n class=\"mn-b-small\"\n />\n\n <h3 class=\"mn-b-small\">Contacts</h3>\n <Field \n v-model:field=\"organization.state.current.contacts.email\"\n label=\"Email\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.contacts.website\"\n label=\"Website\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.contacts.phone\"\n label=\"Phone\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.contacts.address\"\n label=\"Address\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n\n <h3 class=\"mn-b-small\">Socials</h3>\n <p class=\"mn-b-thin\">Please provide only the username for social media profiles, without full links.</p>\n\n <Field \n v-model:field=\"organization.state.current.socials.instagram\"\n label=\"Instagram\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.twitter\"\n label=\"Twitter\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.facebook\"\n label=\"Facebook\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.telegram\"\n label=\"Telegram\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n <Field \n v-model:field=\"organization.state.current.socials.youtube\"\n label=\"Youtube\" \n placeholder=\"\" \n class=\"mn-b-thin bg-light pd-medium radius-small\" \n />\n \n \n <Button :submit=\"onSubmit\" :callback=\"redirectTo\" class=\"bg-main w-100 mn-b-thin\">Save</Button>\n <!-- <Button :submit=\"onDelete\" :callback=\"redirectDash\" class=\"mn-b-thin bg-fourth\">Delete</Button> -->\n\n</div>\n\n</template>\n\n<script setup>\n import { onMounted, computed } from 'vue';\n\n import { useRoute, useRouter } from 'vue-router';\n\n import Breadcrumbs from '@martyrs/src/components/Breadcrumbs/Breadcrumbs.vue'\n import BlockTags from '@martyrs/src/components/FieldTags/BlockTags.vue'\n import Tab from '@martyrs/src/components/Tab/Tab.vue';\n import Field from '@martyrs/src/components/Field/Field.vue';\n import Select from '@martyrs/src/components/Select/Select.vue';\n import SelectMulti from '@martyrs/src/components/SelectMulti/SelectMulti.vue'\n import UploadImage from '@martyrs/src/components/UploadImage/UploadImage.vue';\n import Button from '@martyrs/src/components/Button/Button.vue';\n import Popup from '@martyrs/src/components/Popup/Popup.vue';\n\n import * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\n import * as organization from '@martyrs/src/modules/organizations/store/organizations.js';\n import membershipsStore from '@martyrs/src/modules/organizations/store/memberships.store.js';\n\n const route = useRoute()\n const router = useRouter()\n\n organization.actions.reset();\n\n onMounted(async()=>{\n if (route.params._id) {\n await organization.actions.read({ _id: route.params._id });\n } \n })\n \n const organizationData = computed(() => organization.state.current)\n\n async function onSubmit() {\n if (route.params._id) {\n await organization.actions.update(route.params._id, organizationData.value)\n } else {\n await organization.actions.create(organization.state.current, auth.state.user._id)\n }\n }\n\n async function onDelete() {\n if (route.params._id) {\n await organization.actions.remove(route.params._id)\n router.push('/organizations/' + route.params._id)\n }\n }\n\n function redirectTo () {\n router.replace('/organizations/' + organization.state.current._id);\n }\n</script>"],"names":["organization.actions","organization.state","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;AAmIE,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExBA,YAAqB,MAAK;AAE1B,cAAU,YAAS;AACjB,UAAI,MAAM,OAAO,KAAK;AACpB,cAAMA,QAAqB,KAAK,EAAE,KAAK,MAAM,OAAO,KAAK;AAAA,MAC3D;AAAA,IACF,CAAC;AAED,UAAM,mBAAmB,SAAS,MAAMC,MAAmB,OAAO;AAElE,mBAAe,WAAW;AACxB,UAAI,MAAM,OAAO,KAAK;AACpB,cAAMD,QAAqB,OAAO,MAAM,OAAO,KAAK,iBAAiB,KAAK;AAAA,MAC5E,OAAO;AACL,cAAMA,QAAqB,OAAOC,MAAmB,SAASC,QAAW,KAAK,GAAG;AAAA,MACnF;AAAA,IACF;AASA,aAAS,aAAc;AACrB,aAAO,QAAQ,oBAAoBD,MAAmB,QAAQ,GAAG;AAAA,IACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, watch, createElementBlock, openBlock, createCommentVNode, createVNode, createElementVNode, Transition, withCtx, unref, Fragment, renderList, isMemoSame, createBlock } from "vue";
|
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
|
3
|
-
import _sfc_main$1 from "../../../../components/Tab/Tab.
|
|
3
|
+
import _sfc_main$1 from "../../../../components/Tab/Tab.vue2.js";
|
|
4
4
|
import _sfc_main$2 from "../../../../components/Feed/Feed.vue.js";
|
|
5
5
|
import { state } from "../../../auth/views/store/auth.js";
|
|
6
6
|
import { actions } from "../../store/organizations.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, withAsyncContext, watch, createElementBlock, openBlock, createElementVNode, createBlock, Fragment, renderList, normalizeClass } from "vue";
|
|
2
2
|
import { useRouter, useRoute } from "vue-router";
|
|
3
3
|
import "../../../../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js";
|
|
4
|
-
/* empty css
|
|
4
|
+
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
@@ -6,7 +6,7 @@ import _sfc_main$2 from "../../../icons/navigation/IconDelete.vue.js";
|
|
|
6
6
|
const _hoisted_1 = { class: "flex-v-center bg-light pd-small radius-small flex-column flex" };
|
|
7
7
|
const _hoisted_2 = { class: "w-100 flex-v-center flex-nowrap gap-thin flex" };
|
|
8
8
|
const _hoisted_3 = ["src"];
|
|
9
|
-
const _hoisted_4 = { class: "my-handle
|
|
9
|
+
const _hoisted_4 = { class: "my-handle t-truncate w-100 w-max-100 mn-r-auto" };
|
|
10
10
|
const _sfc_main = {
|
|
11
11
|
__name: "CardCategory",
|
|
12
12
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardCategory.vue.js","sources":["../../../../../../../src/modules/products/components/blocks/CardCategory.vue"],"sourcesContent":["<template>\n <div class=\"flex-v-center bg-light pd-small radius-small flex-column flex\">\n <div class=\"w-100 flex-v-center flex-nowrap gap-thin flex\">\n <img v-if=\"category.photo\" class=\"i-big radius-small object-fit-contain bg-white\" :src=\"(FILE_SERVER_URL || '') + category.photo\"/>\n <h4 class=\"my-handle
|
|
1
|
+
{"version":3,"file":"CardCategory.vue.js","sources":["../../../../../../../src/modules/products/components/blocks/CardCategory.vue"],"sourcesContent":["<template>\n <div class=\"flex-v-center bg-light pd-small radius-small flex-column flex\">\n <div class=\"w-100 flex-v-center flex-nowrap gap-thin flex\">\n <img v-if=\"category.photo\" class=\"i-big radius-small object-fit-contain bg-white\" :src=\"(FILE_SERVER_URL || '') + category.photo\"/>\n <h4 class=\"my-handle t-truncate w-100 w-max-100 mn-r-auto\">{{category.name}}</h4>\n\n <router-link\n v-if=\"access\"\n :to=\"{\n name: route.meta.context === 'backoffice' ? 'BackofficeCategoryEdit' : 'Organization_CategoryEdit',\n params: {\n _id: route.params._id,\n category: category._id\n }\n }\"\n class=\"\n i-medium\n cursor-pointer\n card-page-actions\n radius-extra pd-micro bg-second\n flex-child-default\n \"\n >\n <IconEdit\n class=\"w-100 h-100\"\n classes=\"fill-white\"\n />\n </router-link>\n\n <button\n v-if=\"access\"\n @click=\"deleteCategory(category)\"\n class=\"\n i-medium\n cursor-pointer \n card-page-actions\n radius-extra pd-micro bg-second\n flex-child-default\n \"\n >\n <IconDelete\n class=\"w-100 h-100\"\n :fill=\"'white'\"\n />\n </button>\n </div>\n\n <!-- <p v-if=\" category.children.length > 0\" class=\"w-100\">Subcategories:</p> -->\n <!-- <CardCategory\n v-for=\"(subcategory,index) in category.children\"\n :key=\"subcategory._id\"\n :category=\"subcategory\" \n class=\"pd-l-small bg-white w-100\"\n /> -->\n\n </div>\n</template>\n\n\n<script setup>\nimport { toRef, onMounted, defineEmits } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\n\nimport CardCategory from './CardCategory.vue'\n\nimport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\nimport IconAdd from '@martyrs/src/modules/icons/navigation/IconAdd.vue'\nimport IconDelete from '@martyrs/src/modules/icons/navigation/IconDelete.vue'\n\n\nconst props = defineProps({\n category: Object,\n access: {\n type: Boolean,\n default: false\n }\n});\n\nconst emits = defineEmits(['delete']);\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst deleteCategory = (category) => {\n emits('delete', category);\n};\n\n</script>\n\n\n\n<style lang=\"scss\">\n.card-title {\n .card-page-actions {\n display: none;\n }\n\n &:hover {\n .card-page-actions {\n display: block;\n }\n }\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA8EA,UAAM,QAAQ;AAEd,UAAM,QAAQ,SAAQ;AACP,cAAS;AAExB,UAAM,iBAAiB,CAAC,aAAa;AACnC,YAAM,UAAU,QAAQ;AAAA,IAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, createElementVNode, withCtx, createVNode, renderSlot, toDisplayString } from "vue";
|
|
1
|
+
import { computed, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, createElementVNode, withCtx, createVNode, renderSlot, toDisplayString } from "vue";
|
|
2
2
|
import { useI18n } from "vue-i18n";
|
|
3
|
+
import { useRoute } from "vue-router";
|
|
3
4
|
import _sfc_main$1 from "../../../icons/navigation/IconEdit.vue.js";
|
|
4
5
|
import _sfc_main$4 from "../../../icons/actions/IconShopcartAdd.vue.js";
|
|
5
6
|
import _sfc_main$2 from "../elements/THC.vue.js";
|
|
@@ -60,13 +61,25 @@ const _sfc_main = {
|
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
setup(__props) {
|
|
64
|
+
const route = useRoute();
|
|
65
|
+
const props = __props;
|
|
63
66
|
const { t } = useI18n();
|
|
67
|
+
const editPath = computed(() => {
|
|
68
|
+
if (route.meta.context === "backoffice") {
|
|
69
|
+
return `/backoffice/products/${props.product._id}/edit`;
|
|
70
|
+
}
|
|
71
|
+
if (route.meta.context === "organization" || props.organization) {
|
|
72
|
+
const orgId = props.organization || route.params._id;
|
|
73
|
+
return `/organizations/${orgId}/products/${props.product._id}/edit`;
|
|
74
|
+
}
|
|
75
|
+
return `/products/${props.product._id}/edit`;
|
|
76
|
+
});
|
|
64
77
|
return (_ctx, _cache) => {
|
|
65
78
|
const _component_router_link = resolveComponent("router-link");
|
|
66
79
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
67
80
|
__props.access ? (openBlock(), createBlock(_component_router_link, {
|
|
68
81
|
key: 0,
|
|
69
|
-
to:
|
|
82
|
+
to: editPath.value,
|
|
70
83
|
class: "z-index-2 cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"
|
|
71
84
|
}, {
|
|
72
85
|
default: withCtx(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardProduct.vue.js","sources":["../../../../../../../src/modules/products/components/blocks/CardProduct.vue"],"sourcesContent":["<template>\n\t<div \n\t\tclass=\"\n\t\t\tradius-medium \n\t\t\tcols-1\n\t\t\to-hidden\n\t\t\tpos-relative\n\t\t\"\n\t>\n\t\t<!-- Edit Button -->\n\t\t<router-link\n\t\t\tv-if=\"access\"\n :to=\"
|
|
1
|
+
{"version":3,"file":"CardProduct.vue.js","sources":["../../../../../../../src/modules/products/components/blocks/CardProduct.vue"],"sourcesContent":["<template>\n\t<div \n\t\tclass=\"\n\t\t\tradius-medium \n\t\t\tcols-1\n\t\t\to-hidden\n\t\t\tpos-relative\n\t\t\"\n\t>\n\t\t<!-- Edit Button -->\n\t\t<router-link\n\t\t\tv-if=\"access\"\n :to=\"editPath\"\n class=\"\n \tz-index-2\n cursor-pointer \n pos-absolute pos-t-regular pos-r-regular\n radius-extra pd-thin bg-second\n \"\n >\n <IconEdit\n class=\"i-medium\"\n classes=\"fill-white\"\n />\n </router-link>\n\n\t\t<!-- Product Image Sqaure -->\n\t\t<div \n\t\t\tclass=\"o-hidden d-flex pd-thin pd-b-zero radius-medium o-hidden w-100 pos-relative aspect-1x1\"\n\t\t>\n\t\t\t<div class=\"w-100 h-100 pos-relative\">\n\t\t\t\t<!-- Image Wrappers -->\n\t\t\t\t<img loading=\"lazy\" \n\t\t\t\t\tv-if=\"product.images?.[0]\" \n\t\t\t\t\t:src=\"(FILE_SERVER_URL || '') + (product.images?.[0] || '').split('/').slice(0, -1).join('/') + '/thumbnail_' + (product.images?.[0] || '').split('/').pop()\"\n\t\t\t\t\tclass=\"pos-absolute object-fit-cover radius-small h-max-100 h-100 w-100\"\n\t\t\t\t>\n\n\t\t\t\t<PlaceholderImage\n\t\t\t\t\tv-else\n\t\t\t\t\tclass=\"radius-medium h-100 w-100\"\n\t\t\t\t/>\n\t\t\t\t<span v-if=\"product.available <= 0 && product.listing !== 'rent'\" class=\"pos-absolute bg-white t-black pd-thin radius-medium p-small t-medium pos-t-medium pos-l-medium\">Out of Stock</span>\n\t\t\t\t<THC v-if=\"product.attributes?.length > 0 && product.attributes[1]?.name === 'THC'\" :product=\"product\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Product Info Start -->\n\t\t<div class=\"pd-small cols-1 t-left\">\n\t\t\t<!-- Detail -->\n\t\t\t<p\n\t\t\t\tv-if=\"product.attributes?.length > 0\"\n\t\t\t\tclass=\"t-semi t-transp p-small mn-b-thin\"\n\t\t\t>\n\t\t\t\t{{product.attributes[0]?.value}}\n\t\t\t</p>\n\t\t\t<!-- Name -->\n\t\t\t<span style=\" hyphens: auto;\" class=\"word-break t-truncate p-regular mn-b-micro w-100 w-max-100 \">\n\t\t\t\t{{product.name}}\n\t\t\t</span>\n\n\t\t\t<p \n\t\t\t\tv-if=\"product.description && !product.translations && product.listing !== 'rent'\" \n\t\t\t\tclass=\"mn-b-small t-transp p-small\"\n\t\t\t>\n\t\t\t\t{{product.description.substring(0, 99)}}...\n\t\t\t</p>\n\n\t\t\t<slot></slot>\n\n\t\t\t<div v-if=\"product.variants?.length > 0\" class=\"flex-v-center flex-nowrap flex\">\n\t\t\t\t<Price \n\t\t\t\t\t:product=\"product\" \n\t\t\t\t\tsize=\"small\" \n\t\t\t\t\tclass=\"bg-white h-100 p-regular flex flex-center pd-thin radius-small mn-r-auto\" \n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t<button\n\t\t\t\t\tv-if=\"showAddToCart\"\n\t\t class=\"\n\t\t cursor-pointer \n\t\t radius-extra pd-thin bg-main\n\t\t \"\n\t\t >\n\t\t <IconShopcartAdd\n\t\t\t\t\t\tclass=\"icon-button-main i-medium\"\n\t\t\t\t\t/>\n\t\t </button>\n\t\t </div>\n\t\t</div>\n\n\t</div>\n\n</template>\n\n\n<script setup=\"props\">\n\timport {computed } from 'vue'\n\timport { useI18n } from 'vue-i18n'\n\timport { useRoute } from 'vue-router'\n\n\timport IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'\n\timport IconShopcartAdd from '@martyrs/src/modules/icons/actions/IconShopcartAdd.vue'\n\n\timport THC from '@martyrs/src/modules/products/components/elements/THC.vue'\n\timport Price from '@martyrs/src/modules/products/components/elements/Price.vue'\n\n\timport PlaceholderImage from '@martyrs/src/modules/icons/placeholders/PlaceholderImage.vue'\n\n\tconst route = useRoute()\n\n\tconst props = defineProps({\n\t\tproduct: {\n\t\t\ttype: Object\n\t\t},\n\t\taccess: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t},\n\t\torganization: {\n\t\t\ttype: String\n\t\t},\n\t\tshowAddToCart: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true\n\t\t},\n\t\tuser: {\n\t\t\ttype: [Object, String]\n\t\t},\n\t\ttype: {\n\t\t\ttype: Object\n\t\t}\n\t})\n\n const { t } = useI18n()\n\n\tconst editPath = computed(() => {\n\t\tif (route.meta.context === 'backoffice') {\n\t\t\treturn `/backoffice/products/${props.product._id}/edit`\n\t\t}\n\t\tif (route.meta.context === 'organization' || props.organization) {\n\t\t\tconst orgId = props.organization || route.params._id\n\t\t\treturn `/organizations/${orgId}/products/${props.product._id}/edit`\n\t\t}\n\t\treturn `/products/${props.product._id}/edit`\n\t})\n</script>\n\n<style lang=\"scss\">\n.word-break {\n width: 100%; \n overflow: auto;\n overflow-wrap: break-word;\n word-break: break-all;\n white-space: -moz-pre-wrap;\n white-space: -hp-pre-wrap;\n white-space: -o-pre-wrap;\n white-space: -pre-wrap; \n white-space: pre-wrap; \n white-space: pre-line; \n word-wrap: break-word;\n}\n</style>\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6GC,UAAM,QAAQ,SAAQ;AAEtB,UAAM,QAAQ;AAuBb,UAAM,EAAE,EAAC,IAAK,QAAO;AAEtB,UAAM,WAAW,SAAS,MAAM;AAC/B,UAAI,MAAM,KAAK,YAAY,cAAc;AACxC,eAAO,wBAAwB,MAAM,QAAQ,GAAG;AAAA,MACjD;AACA,UAAI,MAAM,KAAK,YAAY,kBAAkB,MAAM,cAAc;AAChE,cAAM,QAAQ,MAAM,gBAAgB,MAAM,OAAO;AACjD,eAAO,kBAAkB,KAAK,aAAa,MAAM,QAAQ,GAAG;AAAA,MAC7D;AACA,aAAO,aAAa,MAAM,QAAQ,GAAG;AAAA,IACtC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, reactive, onUnmounted, onMounted, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, createElementVNode, withCtx,
|
|
1
|
+
import { ref, reactive, onUnmounted, onMounted, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, createElementVNode, withCtx, unref, createTextVNode, createVNode, isRef } from "vue";
|
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
|
3
3
|
import { useStore } from "../../../core/views/store/core.store.js";
|
|
4
4
|
import { state } from "../../../auth/views/store/auth.js";
|
|
@@ -124,7 +124,8 @@ const _sfc_main = {
|
|
|
124
124
|
}, {
|
|
125
125
|
default: withCtx(() => [
|
|
126
126
|
_cache[3] || (_cache[3] = createElementVNode("h2", { class: "mn-r-auto" }, " Categories ", -1)),
|
|
127
|
-
|
|
127
|
+
unref(hasAccess)(unref(route).params._id, "products", "edit", state.accesses, state.access.roles) ? (openBlock(), createBlock(_component_router_link, {
|
|
128
|
+
key: 0,
|
|
128
129
|
to: {
|
|
129
130
|
name: unref(route).meta.context === "backoffice" ? "BackofficeCategoryAdd" : "Organization_CategoryAdd",
|
|
130
131
|
params: {
|
|
@@ -137,7 +138,7 @@ const _sfc_main = {
|
|
|
137
138
|
createTextVNode(" Add New ")
|
|
138
139
|
])),
|
|
139
140
|
_: 1
|
|
140
|
-
}, 8, ["to"])
|
|
141
|
+
}, 8, ["to"])) : createCommentVNode("", true)
|
|
141
142
|
]),
|
|
142
143
|
_: 1
|
|
143
144
|
})) : createCommentVNode("", true),
|
|
@@ -156,8 +157,9 @@ const _sfc_main = {
|
|
|
156
157
|
state: state$1
|
|
157
158
|
},
|
|
158
159
|
options: {
|
|
159
|
-
|
|
160
|
-
tree: true
|
|
160
|
+
owner: unref(route).params._id,
|
|
161
|
+
tree: true,
|
|
162
|
+
limit: 20
|
|
161
163
|
},
|
|
162
164
|
sort: unref(sort),
|
|
163
165
|
"onUpdate:sort": _cache[0] || (_cache[0] = ($event) => isRef(sort) ? sort.value = $event : sort = $event),
|
|
@@ -173,6 +175,7 @@ const _sfc_main = {
|
|
|
173
175
|
items: state$1.all,
|
|
174
176
|
state: state$1.all,
|
|
175
177
|
"parent-id": null,
|
|
178
|
+
dragndrop: unref(hasAccess)(unref(route).params._id, "products", "edit", state.accesses, state.access.roles),
|
|
176
179
|
onUpdate: updateCategoriesOrder
|
|
177
180
|
}, {
|
|
178
181
|
default: withCtx(({ item }) => [
|
|
@@ -183,7 +186,7 @@ const _sfc_main = {
|
|
|
183
186
|
}, null, 8, ["category", "access"])
|
|
184
187
|
]),
|
|
185
188
|
_: 1
|
|
186
|
-
}, 8, ["items", "state"])) : createCommentVNode("", true)
|
|
189
|
+
}, 8, ["items", "state", "dragndrop"])) : createCommentVNode("", true)
|
|
187
190
|
]),
|
|
188
191
|
_: 1
|
|
189
192
|
}, 8, ["store", "options", "sort", "items"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Categories.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Categories.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin bg-white\">\n <Block v-if=\"!MOBILE_APP\" \n class=\"radius-medium mn-b-thin mobile:flex-wrap flex-nowrap flex-v-center flex\"\n >\n <h2 class=\"mn-r-auto\">\n Categories\n </h2>\n\n <router-link\n :to=\"{\n name: route.meta.context === 'backoffice' ? 'BackofficeCategoryAdd' : 'Organization_CategoryAdd',\n params: {\n _id: $route.params._id\n }\n }\"\n class=\"uppercase t-medium pd-small radius-medium bg-white nav-link\"\n >\n Add New\n </router-link>\n </Block>\n\n <div class=\"rows-1\">\n <Feed\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'Currently, there are no products available.'\n }\n }\"\n :store=\"{\n read: (options) => categories.actions.read(options),\n state: categories.state\n }\"\n :options=\"{\n
|
|
1
|
+
{"version":3,"file":"Categories.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Categories.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin bg-white\">\n <Block v-if=\"!MOBILE_APP\" \n class=\"radius-medium mn-b-thin mobile:flex-wrap flex-nowrap flex-v-center flex\"\n >\n <h2 class=\"mn-r-auto\">\n Categories\n </h2>\n\n <router-link\n v-if=\"hasAccess(route.params._id, 'products', 'edit', auth.state.accesses, auth.state.access.roles)\"\n :to=\"{\n name: route.meta.context === 'backoffice' ? 'BackofficeCategoryAdd' : 'Organization_CategoryAdd',\n params: {\n _id: $route.params._id\n }\n }\"\n class=\"uppercase t-medium pd-small radius-medium bg-white nav-link\"\n >\n Add New\n </router-link>\n </Block>\n\n <div class=\"rows-1\">\n <Feed\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'Currently, there are no products available.'\n }\n }\"\n :store=\"{\n read: (options) => categories.actions.read(options),\n state: categories.state\n }\"\n :options=\"{\n owner: route.params._id,\n tree: true,\n limit: 20\n }\"\n v-model:sort=\"sort\"\n v-model:items=\"categories.state.all\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <Tree\n v-if=\"items\"\n :items=\"categories.state.all\"\n :state=\"categories.state.all\"\n :parent-id=\"null\"\n :dragndrop=\"hasAccess(route.params._id, 'products', 'edit', auth.state.accesses, auth.state.access.roles)\"\n @update=\"updateCategoriesOrder\"\n v-slot=\"{ item }\"\n >\n <CardCategory \n :category=\"item\" \n :access=\"hasAccess(route.params._id, 'products', 'edit', auth.state.accesses, auth.state.access.roles)\"\n @delete=\"deleteCategory\" \n />\n </Tree>\n </Feed>\n </div>\n </div>\n</template>\n\n<script setup>\n import { onMounted, onUnmounted, computed, ref,reactive } from 'vue';\n import { useRoute, useRouter } from 'vue-router';\n\n import { useStore } from '@martyrs/src/modules/core/views/store/core.store.js';\n import * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\n import * as categories from '@martyrs/src/modules/products/store/categories.js';\n import { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js';\n\n const route = useRoute();\n const router = useRouter();\n const store = useStore();\n const { hasAccess } = useGlobalMixins();\n\n import Button from \"@martyrs/src/components/Button/Button.vue\";\n import Block from '@martyrs/src/components/Block/Block.vue';\n import Feed from '@martyrs/src/components/Feed/Feed.vue'\n import Tree from \"@martyrs/src/components/Tree/Tree.vue\";\n \n import CardCategory from '@martyrs/src/modules/products/components/blocks/CardCategory.vue';\n\n import IconPlus from '@martyrs/src/modules/icons/navigation/IconPlus.vue'\n\n let search = ref(null)\n\n let sort = reactive({\n param: 'order',\n order: 'asc',\n options: [{\n label: 'Order',\n value: 'order'\n },{\n label: 'Name',\n value: 'name'\n },{\n label: 'Date',\n value: 'createdAt'\n }]\n })\n\n store.core.state.navigation_bar.actions = [{\n component: IconPlus,\n props: {\n fill: \"rgb(var(--main))\"\n },\n condition: () => auth.state.user && auth.state.user._id,\n action: () => {\n const routeName = route.meta.context === 'backoffice' ? 'BackofficeCategoryAdd' : 'Organization_CategoryAdd';\n route.params._id ? router.push({ name: routeName, params: { _id: route.params._id} }) : router.push({ name: routeName });\n }\n }],\n\n onUnmounted(() => {\n store.core.state.navigation_bar.actions = [];\n });\n\n onMounted(async () => {\n \n });\n\n // Функция для сбора затронутых категорий при drag-n-drop\n function collectAffectedCategories(eventData) {\n const result = {\n movedCategory: null,\n affectedCategories: []\n };\n \n console.log('collectAffectedCategories - eventData:', eventData);\n \n // Проверяем, что это объект от Tree компонента с полной информацией\n if (eventData && eventData.movedItem) {\n // Если категория переместилась между уровнями\n if (eventData.movedItem._id) {\n result.movedCategory = {\n _id: eventData.movedItem._id,\n newParent: eventData.parentId // Используем parentId из события (null для корня)\n };\n }\n \n // Собираем все категории текущего уровня с их новым порядком\n const items = eventData.items || [];\n console.log('Level items:', items);\n \n items.forEach((item, index) => {\n result.affectedCategories.push({\n _id: item._id,\n order: index\n });\n });\n } else if (eventData && eventData._id) {\n // Fallback для старого формата (простой объект категории)\n result.movedCategory = {\n _id: eventData._id,\n newParent: eventData.parent || null\n };\n \n // Пытаемся найти категории того же уровня\n const parentId = eventData.parent;\n const sameLevel = parentId \n ? categories.state.all.find(c => c._id === parentId)?.children || []\n : categories.state.all;\n \n sameLevel.forEach((item, index) => {\n result.affectedCategories.push({\n _id: item._id,\n order: index\n });\n });\n } else {\n // Если нет данных о перемещении, собираем корневые категории\n console.log('No event data, collecting root level categories');\n categories.state.all.forEach((item, index) => {\n result.affectedCategories.push({\n _id: item._id,\n order: index\n });\n });\n }\n \n console.log('collectAffectedCategories - result:', result);\n \n return result;\n }\n\n // Функция для обновления порядка категорий\n async function updateCategoriesOrder(event) {\n console.log('updateCategoriesOrder called with event:', event);\n \n try {\n const data = collectAffectedCategories(event);\n \n // ОДИН КОНСОЛЬ ЛОГ НА ФРОНТЕНДЕ - ЧТО ОТПРАВЛЯЕМ\n console.log('📤 FRONTEND SENDING:', JSON.stringify(data, null, 2));\n await categories.actions.updateOrder(data);\n console.log('Categories order updated successfully');\n } catch (error) {\n console.error('Error updating categories order:', error);\n throw error;\n }\n }\n\n async function deleteCategory(category) {\n // Запрашиваем подтверждение у пользователя\n const isConfirmed = confirm(`Are you sure you want to delete the category \"${category.name}\"?`);\n \n // Если пользователь подтвердил удаление, продолжаем процесс\n if (isConfirmed) {\n await categories.actions.delete(category._id);\n }\n }\n</script>\n\n<style lang=\"scss\">\n</style>"],"names":["IconPlus","auth.state","categories.state","categories.actions"],"mappings":";;;;;;;;;;;;;;;;;;AA8EE,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AACxB,UAAM,QAAQ,SAAQ;AACtB,UAAM,EAAE,UAAS,IAAK,gBAAe;AAWxB,QAAI,IAAI;AAErB,QAAI,OAAO,SAAS;AAAA,MAClB,OAAO;AAAA,MACP,OAAO;AAAA,MACP,SAAS,CAAC;AAAA,QACR,OAAO;AAAA,QACP,OAAO;AAAA,MACb,GAAM;AAAA,QACA,OAAO;AAAA,QACP,OAAO;AAAA,MACb,GAAM;AAAA,QACA,OAAO;AAAA,QACP,OAAO;AAAA,MACb,CAAK;AAAA,IACL,CAAG;AAED,UAAM,KAAK,MAAM,eAAe,UAAU,CAAC;AAAA,MACzC,WAAWA;AAAAA,MACX,OAAO;AAAA,QACL,MAAM;AAAA,MACZ;AAAA,MACI,WAAW,MAAMC,MAAW,QAAQA,MAAW,KAAK;AAAA,MACpD,QAAQ,MAAM;AACZ,cAAM,YAAY,MAAM,KAAK,YAAY,eAAe,0BAA0B;AAClF,cAAM,OAAO,MAAM,OAAO,KAAK,EAAE,MAAM,WAAW,QAAQ,EAAE,KAAK,MAAM,OAAO,IAAG,GAAG,IAAI,OAAO,KAAK,EAAE,MAAM,WAAW;AAAA,MACzH;AAAA,IACJ,CAAG,GAED,YAAY,MAAM;AAChB,YAAM,KAAK,MAAM,eAAe,UAAU,CAAA;AAAA,IAC5C,CAAC;AAED,cAAU,YAAY;AAAA,IAEtB,CAAC;AAGD,aAAS,0BAA0B,WAAW;AAC5C,YAAM,SAAS;AAAA,QACb,eAAe;AAAA,QACf,oBAAoB,CAAA;AAAA,MAC1B;AAEI,cAAQ,IAAI,0CAA0C,SAAS;AAG/D,UAAI,aAAa,UAAU,WAAW;AAEpC,YAAI,UAAU,UAAU,KAAK;AAC3B,iBAAO,gBAAgB;AAAA,YACrB,KAAK,UAAU,UAAU;AAAA,YACzB,WAAW,UAAU;AAAA;AAAA,UAC/B;AAAA,QACM;AAGA,cAAM,QAAQ,UAAU,SAAS,CAAA;AACjC,gBAAQ,IAAI,gBAAgB,KAAK;AAEjC,cAAM,QAAQ,CAAC,MAAM,UAAU;AAC7B,iBAAO,mBAAmB,KAAK;AAAA,YAC7B,KAAK,KAAK;AAAA,YACV,OAAO;AAAA,UACjB,CAAS;AAAA,QACH,CAAC;AAAA,MACH,WAAW,aAAa,UAAU,KAAK;AAErC,eAAO,gBAAgB;AAAA,UACrB,KAAK,UAAU;AAAA,UACf,WAAW,UAAU,UAAU;AAAA,QACvC;AAGM,cAAM,WAAW,UAAU;AAC3B,cAAM,YAAY,WACdC,QAAiB,IAAI,KAAK,OAAK,EAAE,QAAQ,QAAQ,GAAG,YAAY,CAAA,IAChEA,QAAiB;AAErB,kBAAU,QAAQ,CAAC,MAAM,UAAU;AACjC,iBAAO,mBAAmB,KAAK;AAAA,YAC7B,KAAK,KAAK;AAAA,YACV,OAAO;AAAA,UACjB,CAAS;AAAA,QACH,CAAC;AAAA,MACH,OAAO;AAEL,gBAAQ,IAAI,iDAAiD;AAC7DA,gBAAiB,IAAI,QAAQ,CAAC,MAAM,UAAU;AAC5C,iBAAO,mBAAmB,KAAK;AAAA,YAC7B,KAAK,KAAK;AAAA,YACV,OAAO;AAAA,UACjB,CAAS;AAAA,QACH,CAAC;AAAA,MACH;AAEA,cAAQ,IAAI,uCAAuC,MAAM;AAEzD,aAAO;AAAA,IACT;AAGA,mBAAe,sBAAsB,OAAO;AAC1C,cAAQ,IAAI,4CAA4C,KAAK;AAE7D,UAAI;AACF,cAAM,OAAO,0BAA0B,KAAK;AAG5C,gBAAQ,IAAI,wBAAwB,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;AACjE,cAAMC,QAAmB,YAAY,IAAI;AACzC,gBAAQ,IAAI,uCAAuC;AAAA,MACrD,SAAS,OAAO;AACd,gBAAQ,MAAM,oCAAoC,KAAK;AACvD,cAAM;AAAA,MACR;AAAA,IACF;AAEA,mBAAe,eAAe,UAAU;AAEtC,YAAM,cAAc,QAAQ,iDAAiD,SAAS,IAAI,IAAI;AAG9F,UAAI,aAAa;AACf,cAAMA,QAAmB,OAAO,SAAS,GAAG;AAAA,MAC9C;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,7 +15,7 @@ import _sfc_main$1 from "../../../icons/navigation/IconCheckmark.vue.js";
|
|
|
15
15
|
/* empty css */
|
|
16
16
|
/* empty css */
|
|
17
17
|
/* empty css */
|
|
18
|
-
/* empty css
|
|
18
|
+
/* empty css */
|
|
19
19
|
/* empty css */
|
|
20
20
|
import _sfc_main$2 from "../../../../components/Block/Block.vue.js";
|
|
21
21
|
import { useStore } from "../../../core/views/store/core.store.js";
|
|
@@ -43,7 +43,7 @@ const _sfc_main = {
|
|
|
43
43
|
onMounted(async () => {
|
|
44
44
|
emits("page-loading");
|
|
45
45
|
if (route.params.category) {
|
|
46
|
-
await actions.read({ _id: route.params.category });
|
|
46
|
+
await actions.read({ _id: route.params.category, owner: route.params._id });
|
|
47
47
|
} else {
|
|
48
48
|
actions.clean();
|
|
49
49
|
}
|
|
@@ -107,8 +107,9 @@ const _sfc_main = {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
function redirectTo() {
|
|
110
|
+
const routeName = route.meta.context === "organization" ? "Organization_Categories" : "BackofficeCategories";
|
|
110
111
|
router.push({
|
|
111
|
-
name:
|
|
112
|
+
name: routeName,
|
|
112
113
|
params: {
|
|
113
114
|
_id: route.params._id
|
|
114
115
|
}
|