@ozdao/prometheus-framework 0.2.29 → 0.2.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/addMembersQuantity-3505b6f3.mjs +98 -0
- package/dist/addMembersQuantity-fb552ca0.js +97 -0
- package/dist/auth.server.js +6 -9
- package/dist/auth.server.mjs +6 -9
- package/dist/community.server.js +28 -21
- package/dist/community.server.mjs +28 -21
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/files.server.js +114 -111
- package/dist/files.server.mjs +114 -111
- package/dist/gallery.server.js +3 -3
- package/dist/gallery.server.mjs +3 -3
- package/dist/globals.server.js +1 -1
- package/dist/globals.server.mjs +1 -1
- package/dist/index-a8dffc0c.js +213 -0
- package/dist/index-d769324d.mjs +214 -0
- package/dist/mailing-37c2ba41.mjs +68 -0
- package/dist/mailing-fe16a26a.js +67 -0
- package/dist/main.css +1 -1
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/organizations.server.js +125 -25
- package/dist/organizations.server.mjs +125 -25
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +49 -2
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +2 -49
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +62 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -62
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +30 -29
- package/dist/prometheus-framework.es.js +2478 -2282
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/users.server.js +1 -1
- package/dist/users.server.mjs +1 -1
- package/package.json +4 -2
- package/src/assets/images/logo.svg +7 -7
- package/src/components/Block/Block.vue +77 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +2 -2
- package/src/components/Button/Button.vue +32 -227
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/Chips/Chips.vue +8 -8
- package/src/components/DatePicker/DatePicker.vue +3 -4
- package/src/components/EditImages/EditImages.vue +32 -14
- package/src/{modules/globals/components/sections → components/Feed}/Feed.vue +60 -45
- package/src/components/FieldBig/FieldBig.vue +16 -5
- package/src/components/FieldPhone/FieldPhone.vue +2 -1
- package/src/components/Footer/Footer.vue +36 -27
- package/src/components/Header/Header.vue +161 -166
- package/src/components/Loader/Loader.vue +9 -2
- package/src/components/LocationMarker/LocationMarker.vue +38 -12
- package/src/components/LocationSelection/LocationSelection.vue +67 -75
- package/src/components/Magnifier/Magnifier.vue +3 -3
- package/src/components/Navigation/Navigation.vue +16 -16
- package/src/components/Popup/Popup.vue +8 -6
- package/src/components/Select/Select.vue +35 -6
- package/src/components/SelectMulti/SelectMulti.vue +5 -13
- package/src/components/Shader/Shader.vue +128 -0
- package/src/components/Sidebar/Sidebar.vue +71 -35
- package/src/components/Spoiler/Spoiler.vue +1 -1
- package/src/components/Tab/Tab.vue +1 -1
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/UploadImage/UploadImage.vue +4 -4
- package/src/components/UploadImageMultiple/UploadImageMultiple.vue +54 -10
- package/src/modules/applications/controllers/applications.controller.js +0 -1
- package/src/modules/auth/components/pages/EnterCode.vue +1 -1
- package/src/modules/auth/components/pages/EnterPassword.vue +3 -3
- package/src/modules/auth/components/pages/ResetPassword.vue +1 -2
- package/src/modules/auth/components/pages/SignIn.vue +26 -10
- package/src/modules/auth/components/pages/SignUp.vue +1 -2
- package/src/modules/auth/controllers/twofa.controller.js +4 -4
- package/src/modules/auth/localization/EnterCode.json +2 -2
- package/src/modules/auth/localization/EnterPassword.json +2 -2
- package/src/modules/auth/localization/ResetPassword.json +2 -2
- package/src/modules/auth/localization/SignIn.json +3 -3
- package/src/modules/auth/localization/SignUp.json +3 -3
- package/src/modules/auth/utils/server/verifyAppleIdToken.js +0 -1
- package/src/modules/backoffice/components/layouts/Backoffice.vue +1 -1
- package/src/modules/backoffice/components/pages/Dashboard.vue +171 -120
- package/src/modules/backoffice/router/backoffice.js +119 -129
- package/src/modules/chats/components/blocks/ChatMessage.vue +25 -0
- package/src/modules/chats/components/pages/ChatPage.vue +50 -0
- package/src/modules/chats/components/sections/ChatWindow.vue +38 -0
- package/src/modules/chats/controllers/chats.controller.js +32 -0
- package/src/modules/chats/models/chat.model.js +26 -0
- package/src/modules/chats/routes/chats.routes.js +53 -0
- package/src/modules/chats/store/chat.store.js +61 -0
- package/src/modules/community/components/blocks/CardBlogpost.vue +19 -4
- package/src/modules/community/components/layouts/Community.vue +96 -39
- package/src/modules/community/components/pages/Blog.vue +4 -3
- package/src/modules/community/components/pages/BlogPost.vue +10 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +36 -17
- package/src/modules/community/components/sections/HotPosts.vue +3 -3
- package/src/modules/community/components/sections/JoinUs.vue +19 -13
- package/src/modules/community/controllers/blog.controller.js +3 -4
- package/src/modules/community/controllers/utils/queryProcessor.js +16 -17
- package/src/modules/community/models/blogpost.model.js +6 -3
- package/src/modules/community/store/blogposts.js +1 -0
- package/src/modules/constructor/components/elements/Embed.vue +12 -1
- package/src/modules/constructor/components/elements/ImageUpload.vue +2 -2
- package/src/modules/constructor/components/elements/Textarea.vue +6 -1
- package/src/modules/constructor/components/elements/Video.vue +79 -0
- package/src/modules/constructor/components/elements/VideoPlayer.vue +59 -0
- package/src/modules/constructor/components/elements/Youtube.vue +52 -0
- package/src/modules/constructor/components/sections/Constructor.vue +27 -3
- package/src/modules/events/components/layouts/layoutEvents.vue +7 -28
- package/src/modules/files/controllers/files.controller.js +9 -22
- package/src/modules/files/middlewares/server/index.js +2 -2
- package/src/modules/files/middlewares/server/middlewareBusboy.js +137 -0
- package/src/modules/files/routes/files.routes.js +9 -9
- package/src/modules/globals/localization/vue-i18n.js +8 -1
- package/src/modules/globals/mixins/mixins.js +23 -13
- package/src/modules/globals/router/routerGuards.js +2 -2
- package/src/modules/globals/store/globals.js +86 -9
- package/src/modules/globals/utils/mailing.js +24 -3
- package/src/modules/icons/entities/IconCommunity.vue +4 -4
- package/src/modules/icons/entities/IconEvents.vue +1 -1
- package/src/modules/icons/entities/IconGroups.vue +1 -1
- package/src/modules/icons/entities/IconPrice.vue +5 -0
- package/src/modules/icons/entities/IconProfile.vue +5 -0
- package/src/modules/icons/entities/IconShopcart.vue +5 -0
- package/src/modules/icons/entities/IconTime.vue +5 -0
- package/src/modules/icons/icons.client.js +4 -0
- package/src/modules/icons/labels/LabelAppStore.vue +24 -24
- package/src/modules/icons/labels/LabelGooglePlay.vue +9 -9
- package/src/modules/icons/logos/Logotype.vue +20 -0
- package/src/modules/icons/navigation/IconAdd.vue +17 -0
- package/src/modules/icons/navigation/IconChevronBottom.vue +18 -0
- package/src/modules/icons/navigation/IconChevronRight.vue +3 -3
- package/src/modules/icons/navigation/IconDelete.vue +19 -0
- package/src/modules/icons/navigation/IconMinus.vue +15 -0
- package/src/modules/icons/navigation/IconSearch.vue +17 -0
- package/src/modules/icons/navigation/IconUpload.vue +16 -0
- package/src/modules/icons/placeholders/PlaceholderImage.vue +5 -0
- package/src/modules/icons/placeholders/PlaceholderOrganizationPic.vue +20 -0
- package/src/modules/icons/placeholders/PlaceholderUserpic.vue +4 -18
- package/src/modules/icons/socials/instagram.vue +1 -1
- package/src/modules/icons/socials/line.vue +1 -1
- package/src/modules/icons/socials/reddit.vue +1 -1
- package/src/modules/icons/socials/telegram.vue +1 -1
- package/src/modules/icons/socials/twitter.vue +1 -1
- package/src/modules/icons/socials/youtube.vue +1 -1
- package/src/modules/landing/components/sections/Guide.vue +92 -0
- package/src/modules/landing/components/sections/MobileApp.vue +23 -12
- package/src/modules/marketplace/components/layouts/Marketplace.vue +76 -188
- package/src/modules/marketplace/components/pages/Catalog.vue +65 -119
- package/src/modules/marketplace/components/sections/Filters.vue +195 -0
- package/src/modules/marketplace/store/marketplace.js +2 -2
- package/src/modules/middlewares/client/auth.validation.js +0 -6
- package/src/modules/middlewares/client/states.validation.js +2 -8
- package/src/modules/middlewares/server/authJwt.js +1 -1
- package/src/modules/mobile/components/Menu/MenuItem.vue +3 -6
- package/src/modules/openai/controllers/openai.controller.js +0 -1
- package/src/modules/orders/components/blocks/CardOrder.vue +166 -0
- package/src/modules/orders/components/blocks/CardOrderItem.vue +59 -66
- package/src/modules/orders/components/blocks/Positions.vue +4 -4
- package/src/modules/orders/components/pages/EditOrder.vue +78 -142
- package/src/modules/orders/components/pages/FormOrder.vue +192 -0
- package/src/modules/orders/components/pages/Order.vue +326 -120
- package/src/modules/orders/components/pages/Orders.vue +13 -9
- package/src/modules/orders/components/pages/{ViewOrder.vue → Orders_refact.vue} +13 -10
- package/src/modules/orders/components/partials/ShopCart.vue +22 -13
- package/src/modules/orders/components/sections/EmptyState.vue +1 -1
- package/src/modules/orders/components/sections/{Form.vue → FormOrderDetails.vue} +38 -106
- package/src/modules/orders/controllers/orders.controller.js +37 -28
- package/src/modules/orders/models/order.model.js +39 -9
- package/src/modules/orders/router/orders.router.js +23 -2
- package/src/modules/orders/routes/orders.routes.js +14 -17
- package/src/modules/orders/store/orders.js +24 -9
- package/src/modules/orders/store/shopcart.js +20 -19
- package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
- package/src/modules/organizations/components/blocks/CardOrganization.vue +98 -46
- package/src/modules/organizations/components/blocks/Rating.vue +1 -1
- package/src/modules/organizations/components/blocks/Socials.vue +11 -3
- package/src/modules/organizations/components/elements/ButtonToggleMembership.vue +1 -1
- package/src/modules/organizations/components/pages/Department.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +4 -4
- package/src/modules/organizations/components/pages/Members.vue +6 -4
- package/src/modules/organizations/components/pages/Organization.vue +120 -49
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +8 -1
- package/src/modules/organizations/components/pages/Organizations.vue +27 -6
- package/src/modules/organizations/components/sections/DetailsTab.vue +11 -9
- package/src/modules/organizations/components/sections/Feed.vue +0 -3
- package/src/modules/organizations/components/sections/FeedDepartments.vue +2 -2
- package/src/modules/organizations/controllers/organizations.controller.js +126 -15
- package/src/modules/organizations/controllers/utils/addMembersQuantity.js +19 -9
- package/src/modules/organizations/models/organization.model.js +5 -2
- package/src/modules/organizations/router/members.router.js +1 -3
- package/src/modules/organizations/router/organizations.js +8 -6
- package/src/modules/organizations/router/products.router.js +36 -2
- package/src/modules/organizations/store/organizations.js +38 -84
- package/src/modules/pages/controllers/pages.controller.js +0 -4
- package/src/modules/payments/controller/payments.controller.js +1 -1
- package/src/modules/products/components/blocks/CardLeftover.vue +17 -22
- package/src/modules/products/components/blocks/CardPosition.vue +96 -49
- package/src/modules/products/components/blocks/CardProduct.vue +24 -53
- package/src/modules/products/components/blocks/Images360.vue +4 -4
- package/src/modules/products/components/blocks/ImagesThumbnails.vue +2 -7
- package/src/modules/products/components/blocks/ListPositions.vue +74 -0
- package/src/modules/products/components/elements/Price.vue +11 -5
- package/src/modules/products/components/elements/THC.vue +6 -6
- package/src/modules/products/components/pages/{LeftoverAdd.vue → EditLeftover.vue} +93 -79
- package/src/modules/products/components/pages/Leftovers.vue +74 -70
- package/src/modules/products/components/pages/Product.vue +4 -7
- package/src/modules/products/components/pages/ProductEdit.vue +230 -88
- package/src/modules/products/components/pages/ProductRecommmendation.vue +1 -1
- package/src/modules/products/components/pages/Products.vue +6 -3
- package/src/modules/products/components/pages/ProductsBackoffice.vue +3 -5
- package/src/modules/products/components/sections/EditModifications.vue +3 -3
- package/src/modules/products/components/sections/EditProductInfo.vue +40 -50
- package/src/modules/products/components/sections/FilterProducts.vue +57 -18
- package/src/modules/products/components/sections/HeroRecommendation.vue +233 -99
- package/src/modules/products/components/sections/MenuSection.vue +127 -0
- package/src/modules/products/components/sections/PopularProducts.vue +81 -37
- package/src/modules/products/components/sections/SectionProduct.vue +21 -23
- package/src/modules/products/controllers/leftovers.controller.js +11 -1
- package/src/modules/products/controllers/products.controller.js +100 -97
- package/src/modules/products/models/leftover.model.js +6 -4
- package/src/modules/products/models/product.model.js +13 -1
- package/src/modules/products/routes/products.routes.js +4 -4
- package/src/modules/products/store/leftovers.js +4 -24
- package/src/modules/products/store/products.js +44 -30
- package/src/modules/spots/components/blocks/CardSpot.vue +43 -72
- package/src/modules/spots/components/layouts/Spots.vue +9 -91
- package/src/modules/spots/components/pages/Map.vue +171 -62
- package/src/modules/spots/components/pages/Spot.vue +1 -1
- package/src/modules/spots/components/pages/SpotEdit.vue +131 -174
- package/src/modules/spots/controllers/spots.controller.js +1 -0
- package/src/modules/spots/models/spot.model.js +6 -3
- package/src/modules/spots/store/spots.js +42 -48
- package/src/modules/users/components/pages/Profile.vue +6 -28
- package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
- package/src/modules/users/components/pages/ProfileEdit.vue +1 -1
- package/src/modules/users/components/pages/ProfileEvents.vue +1 -1
- package/src/modules/users/components/pages/ProfileOrganizations.vue +1 -1
- package/src/modules/users/router/users.js +1 -1
- package/src/modules/wallet/components/pages/Wallet.vue +105 -109
- package/src/modules/wallet/controllers/crypto.controller.js +129 -0
- package/src/modules/wallet/models/reward.model.js +53 -0
- package/src/modules/wallet/routes/crypto.routes.js +36 -0
- package/src/modules/wallet/store/wallet.js +52 -49
- package/src/styles/base/all.scss +144 -12
- package/src/styles/base/backgrounds.scss +2 -34
- package/src/styles/base/borders.scss +18 -23
- package/src/styles/base/scrolling.scss +97 -29
- package/src/styles/base/{shadows.scss → shadow_transitions_hover_refactor.scss} +55 -2
- package/src/styles/config.scss +69 -17
- package/src/styles/layout.scss +12 -182
- package/src/styles/reset.scss +20 -21
- package/src/styles/responsive.scss +4 -67
- package/src/styles/theme.scss +3 -4
- package/src/styles/typography.scss +15 -17
- package/src/assets/fonts/AvenirNext-Bold.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-DemiBold.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-Heavy.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-Medium.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-Regular.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-UltraLight.woff2 +0 -0
- package/src/modules/files/middlewares/server/md.js +0 -152
- package/src/modules/files/middlewares/server/middlewareMulter.js +0 -121
- package/src/modules/organizations/controllers/organizations.new.controller.js +0 -372
- package/src/modules/products/components/blocks/EditCategories.vue +0 -68
- package/src/modules/products/components/sections/EditParameters.vue +0 -58
- package/src/modules/products/components/sections/EditProductImages.vue +0 -67
- package/src/modules/spots/components/sections/Feed.vue +0 -64
- package/src/styles/base/border-radius.scss +0 -47
- package/src/styles/base/cursors.scss +0 -23
- package/src/styles/base/height.scss +0 -60
- package/src/styles/base/hovers.scss +0 -110
- package/src/styles/base/positions.scss +0 -192
- package/src/styles/base/transitions.scss +0 -137
- package/src/styles/base/width.scss +0 -2
- package/src/styles/components/block.scss +0 -18
- package/src/styles/components/breadcrumbs.scss +0 -0
- package/src/styles/components/input.scss +0 -319
@@ -10,48 +10,34 @@
|
|
10
10
|
class="mn-b-semi"
|
11
11
|
/>
|
12
12
|
|
13
|
-
<!--
|
14
|
-
@click="router.push({
|
15
|
-
name: 'Organization Members',
|
16
|
-
params: {
|
17
|
-
_id: route.params._id
|
18
|
-
}
|
19
|
-
})"
|
20
|
-
class="
|
21
|
-
mn-b-semi
|
22
|
-
bg-grey
|
23
|
-
radius-big
|
24
|
-
pd-medium
|
25
|
-
"
|
26
|
-
>
|
27
|
-
<p>34 members</p>
|
28
|
-
</section> -->
|
13
|
+
<!-- MEMBERS TAB -->
|
29
14
|
|
30
|
-
<!-- <Menu
|
31
|
-
|
32
|
-
|
33
|
-
|
15
|
+
<!-- <Menu
|
16
|
+
class="mn-b-regular bg-grey"
|
17
|
+
>
|
18
|
+
<MenuItem
|
19
|
+
@click="router.push({
|
20
|
+
name: 'Organization Members',
|
21
|
+
params: {
|
22
|
+
_id: route.params._id
|
23
|
+
}
|
24
|
+
})"
|
25
|
+
class="cursor-pointer"
|
26
|
+
theme="black"
|
27
|
+
>
|
28
|
+
<span>
|
29
|
+
{{organization.state.current.numberOfMembers}} members
|
30
|
+
</span>
|
34
31
|
</MenuItem>
|
35
32
|
</Menu> -->
|
36
33
|
|
37
|
-
<!-- <FeedDepartments
|
38
|
-
:organization="organization.state.current"
|
39
|
-
:memberships="memberships.state.memberships"
|
40
|
-
/>
|
41
|
-
|
42
|
-
<Members
|
43
|
-
:organization="organization.state.current"
|
44
|
-
:memberships="memberships.state.memberships"
|
45
|
-
/> -->
|
46
|
-
|
47
34
|
<Tab
|
48
35
|
v-model:selected="tabOrganization"
|
49
36
|
:tabs="[
|
50
|
-
|
51
|
-
{ name: '
|
52
|
-
|
53
|
-
{ name: '
|
54
|
-
// { name: 'Spots', value: 'spots' }
|
37
|
+
{ name: 'Community', value: 'community' },
|
38
|
+
{ name: 'Menu', value: 'products' },
|
39
|
+
{ name: 'Events', value: 'events' },
|
40
|
+
{ name: 'Spots', value: 'spots' }
|
55
41
|
]"
|
56
42
|
class="mn-b-small o-hidden h5 radius-big bg-grey"
|
57
43
|
/>
|
@@ -61,7 +47,7 @@
|
|
61
47
|
<transition name="slide-fade">
|
62
48
|
<FeedCommunity
|
63
49
|
v-if="tabOrganization === 'community'"
|
64
|
-
|
50
|
+
:user="auth.state.user._id"
|
65
51
|
:owner="route.params._id"
|
66
52
|
/>
|
67
53
|
</transition>
|
@@ -70,28 +56,108 @@
|
|
70
56
|
<transition name="slide-fade">
|
71
57
|
<FeedEvents
|
72
58
|
v-if="tabOrganization === 'events'"
|
73
|
-
|
59
|
+
:user="auth.state.user._id"
|
74
60
|
:owner="route.params._id"
|
75
61
|
:sortOrder="'desc'"
|
76
62
|
:sortParam="'date.start'"
|
77
63
|
/>
|
78
64
|
</transition>
|
79
65
|
|
66
|
+
<Block
|
67
|
+
v-if="tabOrganization === 'products' && auth.state.user._id === organization.state.current.owner"
|
68
|
+
class="flex-nowrap gap-thin mn-b-small flex"
|
69
|
+
>
|
70
|
+
|
71
|
+
<router-link
|
72
|
+
class="bg-black t-white uppercase t-semi pd-thin radius-extra "
|
73
|
+
:to="{
|
74
|
+
name:'ProductAdd',
|
75
|
+
params: {
|
76
|
+
_id: route.params._id
|
77
|
+
}
|
78
|
+
}"
|
79
|
+
>
|
80
|
+
Add Product
|
81
|
+
</router-link>
|
82
|
+
|
83
|
+
<router-link
|
84
|
+
class=" uppercase t-semi pd-thin radius-extra "
|
85
|
+
:to="{
|
86
|
+
name:'Leftovers',
|
87
|
+
params: {
|
88
|
+
_id: route.params._id
|
89
|
+
}
|
90
|
+
}"
|
91
|
+
>
|
92
|
+
Change Invetory
|
93
|
+
</router-link>
|
94
|
+
|
95
|
+
<router-link
|
96
|
+
class="d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra "
|
97
|
+
:to="{
|
98
|
+
name:'Backoffice',
|
99
|
+
params: {
|
100
|
+
_id: route.params._id
|
101
|
+
}
|
102
|
+
}"
|
103
|
+
>
|
104
|
+
Go to Backoffice
|
105
|
+
</router-link>
|
106
|
+
|
107
|
+
</Block>
|
108
|
+
|
80
109
|
<transition name="slide-fade">
|
81
110
|
<Products
|
82
111
|
v-if="tabOrganization === 'products'"
|
83
112
|
:organization="organization.state.current"
|
84
113
|
/>
|
114
|
+
|
85
115
|
</transition>
|
86
116
|
|
117
|
+
|
87
118
|
<transition name="slide-fade">
|
88
119
|
<div v-if="tabOrganization === 'spots'">
|
89
|
-
<
|
90
|
-
|
91
|
-
|
92
|
-
|
120
|
+
<Feed
|
121
|
+
:states="{
|
122
|
+
empty: {
|
123
|
+
title: 'No Spots Found',
|
124
|
+
description: 'Currently, there are no spots available.'
|
125
|
+
}
|
126
|
+
}"
|
127
|
+
:store="{
|
128
|
+
read: (options) => spots.actions.read(route.params._id),
|
129
|
+
state: organization.state
|
130
|
+
}"
|
131
|
+
:options="{
|
132
|
+
user: auth.state.user._id,
|
133
|
+
sort: 'numberOfMemberships',
|
134
|
+
contain: ['blogposts'],
|
135
|
+
limit: 10
|
136
|
+
}"
|
137
|
+
v-slot="{
|
138
|
+
items
|
139
|
+
}"
|
140
|
+
>
|
141
|
+
<CardSpot
|
142
|
+
v-for="(spot, index) in items"
|
143
|
+
:key="index"
|
144
|
+
:spot="spot"
|
145
|
+
:organization="organization.state.current"
|
146
|
+
class="radius-big bg-grey mn-b-thin"
|
147
|
+
/>
|
148
|
+
</Feed>
|
149
|
+
|
150
|
+
<button
|
151
|
+
v-if="auth.state.user._id === organization.state.current.owner"
|
152
|
+
@click="$router.push(`/spots/${organization.state.current._id}/spots/create`)"
|
153
|
+
class="mn-b-thin button w-100"
|
154
|
+
>
|
155
|
+
Add spot
|
156
|
+
</button>
|
157
|
+
|
93
158
|
</div>
|
94
159
|
</transition>
|
160
|
+
|
95
161
|
</div>
|
96
162
|
</div>
|
97
163
|
</template>
|
@@ -100,8 +166,10 @@
|
|
100
166
|
import { computed,reactive,ref, onMounted,watch } from 'vue'
|
101
167
|
import { useRoute, useRouter } from 'vue-router'
|
102
168
|
// Import components
|
103
|
-
|
169
|
+
import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'
|
104
170
|
import Tab from '@pf/src/components/Tab/Tab.vue'
|
171
|
+
import Block from '@pf/src/components/Block/Block.vue'
|
172
|
+
import Feed from '@pf/src/components/Feed/Feed.vue'
|
105
173
|
// Mobile Module
|
106
174
|
import Menu from '@pf/src/modules/mobile/components/Menu/Menu.vue'
|
107
175
|
import MenuItem from '@pf/src/modules/mobile/components/Menu/MenuItem.vue'
|
@@ -109,28 +177,31 @@
|
|
109
177
|
import FeedEvents from '@pf/src/modules/events/components/sections/Feed.vue';
|
110
178
|
import FeedCommunity from '@pf/src/modules/community/components/sections/Feed.vue';
|
111
179
|
// Spots
|
112
|
-
import
|
113
|
-
|
180
|
+
import CardSpot from '@pf/src/modules/spots/components/blocks/CardSpot.vue';
|
114
181
|
// Local
|
115
182
|
import DetailsTab from '@pf/src/modules/organizations/components/sections/DetailsTab.vue'
|
116
183
|
import Products from '@pf/src/modules/products/components/pages/Products.vue'
|
117
|
-
import FeedDepartments from '@pf/src/modules/organizations/components/sections/FeedDepartments.vue'
|
118
|
-
import Members from '@pf/src/modules/organizations/components/pages/Members.vue'
|
119
184
|
// Import state
|
120
185
|
import * as auth from '@pf/src/modules/auth/store/auth'
|
121
186
|
import * as organization from '@pf/src/modules/organizations/store/organizations'
|
122
187
|
import * as memberships from '@pf/src/modules/organizations/store/memberships'
|
188
|
+
// Spots
|
189
|
+
import * as spots from '@pf/src/modules/spots/store/spots';
|
123
190
|
// Init router
|
124
191
|
const router = useRouter()
|
125
192
|
const route = useRoute()
|
126
193
|
// Accesing state
|
127
|
-
|
128
|
-
let tab = route.query.tab ? route.query.tab : 'events';
|
194
|
+
let tab = route.query.tab ? route.query.tab : 'community';
|
129
195
|
|
130
196
|
const organizationData = ref(null)
|
131
197
|
|
132
198
|
onMounted(async () => {
|
133
|
-
|
199
|
+
|
200
|
+
organizationData.value = await organization.actions.read({
|
201
|
+
_id: route.params._id,
|
202
|
+
user: auth.state.user._id
|
203
|
+
})
|
204
|
+
|
134
205
|
await memberships.actions.read(route.params._id)
|
135
206
|
})
|
136
207
|
|
@@ -68,11 +68,18 @@
|
|
68
68
|
placeholder=""
|
69
69
|
class="mn-b-thin bg-grey pd-medium radius-small"
|
70
70
|
/>
|
71
|
+
<Field
|
72
|
+
v-model:field="organization.state.current.socials.youtube"
|
73
|
+
label="Telegram"
|
74
|
+
placeholder=""
|
75
|
+
class="mn-b-thin bg-grey pd-medium radius-small"
|
76
|
+
/>
|
71
77
|
|
72
|
-
<Button :submit="onSubmit" :callback="redirectTo" class="mn-b-thin">Save</Button>
|
78
|
+
<Button :submit="onSubmit" :callback="redirectTo" class="bg-main w-100 mn-b-thin">Save</Button>
|
73
79
|
<!-- <Button :submit="onDelete" :callback="redirectDash" class="mn-b-thin bg-fourth">Delete</Button> -->
|
74
80
|
|
75
81
|
</div>
|
82
|
+
|
76
83
|
</template>
|
77
84
|
|
78
85
|
<script setup>
|
@@ -3,11 +3,17 @@
|
|
3
3
|
<header class="mn-b-medium flex-v-center flex-nowrap flex">
|
4
4
|
<h2 class="mn-r-medium">Groups</h2>
|
5
5
|
<button
|
6
|
-
v-if="auth.state.user._id === route.params._id"
|
7
6
|
@click="$router.push({
|
8
7
|
name: 'Create Organization'
|
9
8
|
})"
|
10
|
-
class="
|
9
|
+
class="
|
10
|
+
bg-second
|
11
|
+
radius-100
|
12
|
+
i-big
|
13
|
+
hover-scale-1
|
14
|
+
cursor-pointer
|
15
|
+
t-whitebg-second
|
16
|
+
">
|
11
17
|
+
|
12
18
|
</button>
|
13
19
|
</header>
|
@@ -15,20 +21,35 @@
|
|
15
21
|
<Tab
|
16
22
|
v-model:selected="tabOrganization"
|
17
23
|
:tabs="[
|
24
|
+
{ name: 'Owner', value: 'owner' },
|
18
25
|
{ name: 'Member', value: 'member' },
|
19
26
|
{ name: 'Follower', value: 'follower' }
|
20
27
|
]"
|
21
|
-
class="
|
28
|
+
class="
|
29
|
+
mn-b-medium
|
30
|
+
o-hidden
|
31
|
+
h5
|
32
|
+
radius-big
|
33
|
+
bg-grey
|
34
|
+
"
|
22
35
|
/>
|
23
36
|
|
24
37
|
<transition name="slide-fade">
|
25
38
|
<Feed
|
26
|
-
v-if="tabOrganization === '
|
27
|
-
|
39
|
+
v-if="tabOrganization === 'owner'"
|
40
|
+
:user="auth.state.user._id"
|
28
41
|
:owner="route.params._id"
|
29
42
|
/>
|
30
43
|
</transition>
|
31
44
|
|
45
|
+
<transition name="slide-fade">
|
46
|
+
<Feed
|
47
|
+
v-if="tabOrganization === 'member'"
|
48
|
+
:user="auth.state.user._id"
|
49
|
+
:member="route.params._id"
|
50
|
+
/>
|
51
|
+
</transition>
|
52
|
+
|
32
53
|
<transition name="slide-fade">
|
33
54
|
<Feed
|
34
55
|
v-if="tabOrganization === 'follower'"
|
@@ -51,7 +72,7 @@
|
|
51
72
|
const route = useRoute()
|
52
73
|
const router = useRouter()
|
53
74
|
// State
|
54
|
-
let tab = route.query.tab ? route.query.tab : '
|
75
|
+
let tab = route.query.tab ? route.query.tab : 'owner';
|
55
76
|
|
56
77
|
const tabOrganization = ref(tab)
|
57
78
|
|
@@ -34,7 +34,7 @@
|
|
34
34
|
:status="organization.isBlocked"
|
35
35
|
:text="{create: 'Block', remove: 'Unblock'}"
|
36
36
|
@updateMembership="event => handleMembershipUpdate(event, 'isBlocked')"
|
37
|
-
class="t-white
|
37
|
+
class="t-white mn-t-thin bg-red"
|
38
38
|
/>
|
39
39
|
</section>
|
40
40
|
</Dropdown>
|
@@ -47,7 +47,7 @@
|
|
47
47
|
_id: organization._id
|
48
48
|
}
|
49
49
|
})"
|
50
|
-
class="pos-absolute pos-t-
|
50
|
+
class="pos-absolute cursor-pointer pos-t-big pos-r-big i-regular t-transp"
|
51
51
|
/>
|
52
52
|
|
53
53
|
<img
|
@@ -56,7 +56,7 @@
|
|
56
56
|
class="radius-big bg-grey flex-center flex mn-b-small i-extra"
|
57
57
|
/>
|
58
58
|
|
59
|
-
<
|
59
|
+
<PlaceholderOrganizationPic
|
60
60
|
v-else
|
61
61
|
class="radius-medium mn-b-small i-extra"
|
62
62
|
/>
|
@@ -73,11 +73,11 @@
|
|
73
73
|
|
74
74
|
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
76
|
+
<Chips
|
77
|
+
v-if="organization.profile.tags.length > 0"
|
78
|
+
:chips="organization.profile.tags"
|
79
|
+
class="mn-b-semi"
|
80
|
+
/>
|
81
81
|
|
82
82
|
<p
|
83
83
|
class="t-semi mn-b-small"
|
@@ -116,6 +116,7 @@
|
|
116
116
|
:facebook="organization.socials.facebook"
|
117
117
|
:instagram="organization.socials.instagram"
|
118
118
|
:twitter="organization.socials.twitter"
|
119
|
+
:youtube="organization.socials.youtube"
|
119
120
|
/>
|
120
121
|
</section>
|
121
122
|
|
@@ -145,9 +146,10 @@
|
|
145
146
|
// Import components
|
146
147
|
import Dropdown from "@pf/src/components/Dropdown/Dropdown.vue";
|
147
148
|
import Text from '@pf/src/components/Text/Text.vue'
|
149
|
+
import Chips from '@pf/src/components/Chips/Chips.vue'
|
148
150
|
// Icons
|
149
151
|
import IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'
|
150
|
-
import
|
152
|
+
import PlaceholderOrganizationPic from '@pf/src/modules/icons/placeholders/PlaceholderOrganizationPic.vue'
|
151
153
|
// Org Module
|
152
154
|
import ButtonToggleMembership from '@pf/src/modules/organizations/components/elements/ButtonToggleMembership.vue'
|
153
155
|
import Contacts from '@pf/src/modules/organizations/components/blocks/Contacts.vue'
|
@@ -26,9 +26,6 @@
|
|
26
26
|
:user="user"
|
27
27
|
:type="'normal'"
|
28
28
|
class="w-100 radius-big mn-b-medium"
|
29
|
-
:class="{
|
30
|
-
'br-b br-solid br-black-transp-10': index !== organizationsList.length - 1
|
31
|
-
}"
|
32
29
|
/>
|
33
30
|
<button v-if="hasMoreOrganizations && organizationsList.length > 0" @click="loadMoreOrganizations" class="w-100 bg-main button">Load more</button>
|
34
31
|
</TransitionGroup>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
title="You don't have any spots yet."
|
7
7
|
description="Add spots to your hub."
|
8
8
|
action="Add spot"
|
9
|
-
:callback="() => $router.push(`/
|
9
|
+
:callback="() => $router.push(`/organizations/${props.organization._id}/departments/create`)"
|
10
10
|
/>
|
11
11
|
|
12
12
|
<div>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
/>
|
20
20
|
<button
|
21
21
|
v-if="FirstLevelDepartments.length > 0 && auth.state.user._id === organization.owner"
|
22
|
-
@click="$router.push(`/
|
22
|
+
@click="$router.push(`/organizations/${props.organization._id}/departments/create`)"
|
23
23
|
class="mn-b-thin button w-100"
|
24
24
|
>
|
25
25
|
Add spot
|
@@ -23,12 +23,12 @@ const controllerFactory = (db) => {
|
|
23
23
|
// Auth Module
|
24
24
|
const User = db.user;
|
25
25
|
const Role = db.role;
|
26
|
-
// Init
|
27
|
-
console.log(req)
|
28
26
|
|
29
27
|
const sortParam = req.query.sortParam || 'numberOfProducts';
|
30
28
|
const sortOrder = req.query.sortOrder || 'desc';
|
29
|
+
|
31
30
|
const sort = {
|
31
|
+
'numberOfProducts': -1,
|
32
32
|
[sortParam]: sortOrder === 'desc' ? -1 : 1,
|
33
33
|
"_id": 1
|
34
34
|
};
|
@@ -49,25 +49,35 @@ const controllerFactory = (db) => {
|
|
49
49
|
return { "products.price": { $gte: min, $lte: max } };
|
50
50
|
});
|
51
51
|
|
52
|
-
|
52
|
+
let containConditions = []
|
53
|
+
|
54
|
+
|
55
|
+
if (req.query.contain) {
|
56
|
+
containConditions = req.query.contain.map(property => ({
|
57
|
+
[property]: { $exists: true, $not: { $size: 0 } }
|
58
|
+
}));
|
59
|
+
}
|
53
60
|
|
54
61
|
const matchConditions = [
|
55
62
|
...(req.query._id ? [{ _id: new ObjectId(req.query._id) }] : []),
|
56
63
|
...(req.query.owner ? [{ owner: new ObjectId(req.query.owner) }] : []),
|
57
|
-
...(req.query.member ? [{"memberships.user": new ObjectId(req.query.member), "memberships.role": { $
|
64
|
+
...(req.query.member ? [{"memberships.user": new ObjectId(req.query.member), "memberships.role": { $nin: ['subscriber', 'owner'] } } ] : [] ),
|
58
65
|
...(req.query.subscriber ? [{"memberships.user": new ObjectId(req.query.subscriber), "memberships.role": 'subscriber'} ] : [] ),
|
59
66
|
...(req.query.postable ? [{$or: [{$and: [{ types: { $elemMatch: { $eq: 'public' } } }, { "memberships.user": new ObjectId(req.query.postable) } ] }, {$and: [{types: {$elemMatch: {$in: ['exclusive', 'hidden'] } } }, { "memberships.user": new ObjectId(req.query.postable) }, { "memberships.role": { $ne: 'subscriber' } } ] } ] } ] : [] ),
|
60
67
|
...(req.query.types ? [{ types: { $in: req.query.types } }] : []), // Если req.query.types - строка
|
61
68
|
// to remove
|
62
69
|
...(req.query.onlyuser ? [{ "memberships.user": new ObjectId(req.query.onlyuser) }] : []),
|
63
70
|
...(categories.length > 0 ? [{ "products.category": { $in: categories } }] : []),
|
64
|
-
...(delivery.length > 0 ? [{ "
|
71
|
+
...(delivery.length > 0 ? [{ "spots.delivery": { $all: delivery } }] : []),
|
65
72
|
...(priceConditions.length > 0 ? [{ $or: priceConditions }] : []),
|
73
|
+
...(req.query.contain ? containConditions : []),
|
66
74
|
];
|
67
75
|
|
68
|
-
let { location, address, city, state, country } = req.query;
|
76
|
+
let { location, address, locationRadius, city, state, country } = req.query;
|
77
|
+
|
78
|
+
let userLocation = { coordinates:[0,0] }
|
69
79
|
|
70
|
-
if (!location && address || city || state || country) {
|
80
|
+
if (!location && (address || city || state || country)) {
|
71
81
|
let geoLocation;
|
72
82
|
|
73
83
|
// Create a string to pass to geocoding client
|
@@ -83,6 +93,13 @@ const controllerFactory = (db) => {
|
|
83
93
|
|
84
94
|
if (geoResponse.data.results && geoResponse.data.results.length > 0) {
|
85
95
|
geoLocation = geoResponse.data.results[0].geometry.location;
|
96
|
+
|
97
|
+
userLocation.coordinates = [
|
98
|
+
geoResponse.data.results[0].geometry.location.lng,
|
99
|
+
geoResponse.data.results[0].geometry.location.lat,
|
100
|
+
]
|
101
|
+
|
102
|
+
console.log(userLocation)
|
86
103
|
} else {
|
87
104
|
return res.status(400).send({ message: 'Unable to geocode the provided location.' });
|
88
105
|
}
|
@@ -92,14 +109,14 @@ const controllerFactory = (db) => {
|
|
92
109
|
}
|
93
110
|
|
94
111
|
// Determine the search radius based on the level of specificity
|
95
|
-
const radius = city ?
|
112
|
+
const radius = city ? 500 : state ? 1000 : 5000;
|
96
113
|
|
97
114
|
// Use MongoDB's $geoNear to find organizations within a certain radius
|
98
115
|
matchConditions.push({
|
99
|
-
"
|
116
|
+
"spots.location.coordinates": {
|
100
117
|
$geoWithin: {
|
101
118
|
$centerSphere: [
|
102
|
-
[geoLocation.lng,
|
119
|
+
[parseFloat(geoLocation.lng),parseFloat(geoLocation.lat),],
|
103
120
|
radius / 6378.1
|
104
121
|
]
|
105
122
|
}
|
@@ -107,21 +124,57 @@ const controllerFactory = (db) => {
|
|
107
124
|
});
|
108
125
|
}
|
109
126
|
|
127
|
+
const search = req.query.search;
|
128
|
+
|
129
|
+
if (search) {
|
130
|
+
const parts = search.split('.');
|
131
|
+
|
132
|
+
let regexPattern = '';
|
133
|
+
|
134
|
+
if (parts.length === 2) {
|
135
|
+
// Создаем паттерн, который допускает замену одного символа в каждой части
|
136
|
+
regexPattern = parts.map(part => part.substr(0, part.length - 1) + '.{1}').join('\\.');
|
137
|
+
} else {
|
138
|
+
// Если нет точки, применяем аналогичный подход к всей строке
|
139
|
+
regexPattern = search.substr(0, search.length - 1) + '.{1}';
|
140
|
+
}
|
141
|
+
|
142
|
+
matchConditions.push({
|
143
|
+
$or: [
|
144
|
+
{ "profile.name": { $regex: regexPattern, $options: 'i' } },
|
145
|
+
{ "products.name": { $regex: regexPattern, $options: 'i' } }
|
146
|
+
]
|
147
|
+
});
|
148
|
+
}
|
149
|
+
|
150
|
+
|
110
151
|
if (location) {
|
111
|
-
|
152
|
+
|
153
|
+
console.log(location)
|
112
154
|
|
113
155
|
if (typeof location === 'string') {
|
114
156
|
location = JSON.parse(location);
|
115
157
|
}
|
116
158
|
|
117
|
-
|
159
|
+
let lng
|
160
|
+
let lat
|
161
|
+
|
162
|
+
if (location.lng) {
|
163
|
+
lng = location.lng
|
164
|
+
lat = location.lat
|
165
|
+
userLocation.coordinates = [lng,lat]
|
166
|
+
} else {
|
167
|
+
lng = location.coordinates[0]
|
168
|
+
lat = location.coordinates[1]
|
169
|
+
userLocation.coordinates = [lng,lat]
|
170
|
+
}
|
118
171
|
|
119
172
|
matchConditions.push({
|
120
|
-
"
|
173
|
+
"spots.location.coordinates": {
|
121
174
|
$geoWithin: {
|
122
175
|
$centerSphere: [
|
123
|
-
[lng, lat],
|
124
|
-
|
176
|
+
[parseFloat(lng), parseFloat(lat)],
|
177
|
+
(locationRadius || 50) / 6378.1
|
125
178
|
]
|
126
179
|
}
|
127
180
|
}
|
@@ -139,6 +192,14 @@ const controllerFactory = (db) => {
|
|
139
192
|
as: "products"
|
140
193
|
}
|
141
194
|
},
|
195
|
+
{
|
196
|
+
$lookup: {
|
197
|
+
from: "blogposts",
|
198
|
+
localField: "_id",
|
199
|
+
foreignField: "owner.target",
|
200
|
+
as: "blogposts"
|
201
|
+
}
|
202
|
+
},
|
142
203
|
{
|
143
204
|
$addFields: {
|
144
205
|
numberOfProducts: { $size: '$products' }
|
@@ -160,6 +221,56 @@ const controllerFactory = (db) => {
|
|
160
221
|
as: "spots"
|
161
222
|
}
|
162
223
|
},
|
224
|
+
{
|
225
|
+
$addFields: {
|
226
|
+
spots: {
|
227
|
+
$map: {
|
228
|
+
input: "$spots",
|
229
|
+
as: "spot",
|
230
|
+
in: {
|
231
|
+
$mergeObjects: [
|
232
|
+
"$$spot",
|
233
|
+
{
|
234
|
+
distance: {
|
235
|
+
$function: {
|
236
|
+
body: `function(spotCoords, userCoords, isMiles) {
|
237
|
+
// The function remains the same
|
238
|
+
function toRad(x) {
|
239
|
+
return x * Math.PI / 180;
|
240
|
+
}
|
241
|
+
var lon1 = spotCoords[0];
|
242
|
+
var lat1 = spotCoords[1];
|
243
|
+
var lon2 = userCoords[0];
|
244
|
+
var lat2 = userCoords[1];
|
245
|
+
var R = 6371; // Radius of the Earth in km
|
246
|
+
if (isMiles) R = 3959; // Radius of the Earth in miles
|
247
|
+
var x1 = lat2 - lat1;
|
248
|
+
var dLat = toRad(x1);
|
249
|
+
var x2 = lon2 - lon1;
|
250
|
+
var dLon = toRad(x2);
|
251
|
+
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
252
|
+
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
|
253
|
+
Math.sin(dLon / 2) * Math.sin(dLon / 2);
|
254
|
+
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
255
|
+
var d = R * c;
|
256
|
+
return d;
|
257
|
+
}`,
|
258
|
+
args: ["$$spot.location.coordinates", userLocation.coordinates, false], // Use actual field names
|
259
|
+
lang: "js"
|
260
|
+
}
|
261
|
+
}
|
262
|
+
}
|
263
|
+
]
|
264
|
+
}
|
265
|
+
}
|
266
|
+
},
|
267
|
+
}
|
268
|
+
},
|
269
|
+
{
|
270
|
+
$addFields: {
|
271
|
+
distance: { $min: "$spots.distance" } // Add the minDistance field here
|
272
|
+
}
|
273
|
+
},
|
163
274
|
{
|
164
275
|
$lookup: {
|
165
276
|
from: "memberships",
|
@@ -2,20 +2,30 @@
|
|
2
2
|
|
3
3
|
const { ObjectId } = require('mongodb'); // Make sure to import ObjectId correctly from your MongoDB driver
|
4
4
|
|
5
|
-
const addMembersQuantity= (user) => {
|
5
|
+
const addMembersQuantity = (user) => {
|
6
6
|
return {
|
7
7
|
$addFields: {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
numberOfSubscribers: {
|
9
|
+
$size: {
|
10
|
+
$filter: {
|
11
|
+
input: '$memberships',
|
12
|
+
as: 'membership',
|
13
|
+
cond: { $eq: ['$$membership.role', 'subscriber'] }
|
14
|
+
}
|
15
|
+
}
|
16
|
+
},
|
17
|
+
numberOfMembers: {
|
18
|
+
$size: {
|
19
|
+
$filter: {
|
20
|
+
input: '$memberships',
|
21
|
+
as: 'membership',
|
22
|
+
cond: { $not: { $in: ['$$membership.role', ['blocked', 'subscriber']] } }
|
15
23
|
}
|
16
24
|
}
|
17
25
|
}
|
18
|
-
}
|
26
|
+
}
|
27
|
+
};
|
19
28
|
}
|
20
29
|
|
30
|
+
|
21
31
|
module.exports = addMembersQuantity;
|