@ozdao/prometheus-framework 0.2.48 → 0.2.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. package/dist/auth.server.js +27 -25
  2. package/dist/auth.server.mjs +27 -25
  3. package/dist/community.server.js +1 -1
  4. package/dist/community.server.mjs +1 -1
  5. package/dist/events.server.js +1 -1
  6. package/dist/events.server.mjs +1 -1
  7. package/dist/files.server.js +1 -1
  8. package/dist/files.server.mjs +1 -1
  9. package/dist/gallery.server.js +1 -1
  10. package/dist/gallery.server.mjs +1 -1
  11. package/dist/index-3981e903.mjs +217 -0
  12. package/dist/index-4eecfdb9.js +216 -0
  13. package/dist/main-203b36b6.mjs +13628 -0
  14. package/dist/main-_b1_i8mt.mjs +13606 -0
  15. package/dist/main-a7ae4ce5.js +91 -0
  16. package/dist/main-uiQFxEks.js +91 -0
  17. package/dist/main.css +1 -1
  18. package/dist/middlewares.server.js +1 -1
  19. package/dist/middlewares.server.mjs +1 -1
  20. package/dist/node_modules/vue-select/dist/vue-select.es.cjs +1 -3
  21. package/dist/node_modules/vue-select/dist/vue-select.es.js +49 -645
  22. package/dist/organizations.server.js +35 -43
  23. package/dist/organizations.server.mjs +35 -43
  24. package/dist/products.server.js +107 -24
  25. package/dist/products.server.mjs +107 -24
  26. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -225
  28. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -2
  30. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
  32. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +2 -61
  34. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
  36. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +76 -2
  38. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  40. package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.js +6 -6
  42. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
  44. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
  46. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  48. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  50. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  52. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +44 -32
  54. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  56. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  58. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  60. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/auth/store/auth.js +45 -44
  62. package/dist/prometheus-framework/src/modules/auth/store/invites.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/auth/store/invites.js +5 -5
  64. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  78. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  80. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/globals/store/globals.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/globals/store/globals.js +22 -21
  84. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  86. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
  88. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
  90. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +17 -17
  98. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +49 -42
  100. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +48 -15
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +38 -37
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +249 -61
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +78 -45
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +160 -86
  112. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  114. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  118. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +52 -54
  120. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +20 -26
  122. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +40 -46
  124. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +34 -30
  126. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -28
  128. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +18 -18
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  136. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +33 -28
  140. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +123 -113
  142. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
  144. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  146. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  148. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  150. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  152. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/products/store/products.js +1 -1
  154. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  156. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  158. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  160. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  162. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  164. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
  166. package/dist/prometheus-framework.cjs.js +1 -1
  167. package/dist/prometheus-framework.es.js +1 -1
  168. package/dist/reports.server.js +1 -1
  169. package/dist/reports.server.mjs +1 -1
  170. package/dist/style.css +1 -1
  171. package/dist/web-7p76PGnO.mjs +55 -0
  172. package/dist/web-c63f0ecc.js +1 -0
  173. package/dist/web-d8173758.mjs +55 -0
  174. package/dist/web-dn8vgptQ.js +1 -0
  175. package/package.json +1 -1
  176. package/src/components/SelectMulti/SelectMulti.vue +1 -1
  177. package/src/modules/auth/components/pages/Invite.vue +17 -6
  178. package/src/modules/auth/controllers/auth.controller.js +24 -16
  179. package/src/modules/auth/controllers/invites.controller.js +17 -8
  180. package/src/modules/auth/store/auth.js +8 -1
  181. package/src/modules/auth/store/invites.js +1 -0
  182. package/src/modules/globals/store/globals.js +5 -1
  183. package/src/modules/landing/components/blocks/MapBlock.vue +37 -0
  184. package/src/modules/landing/components/pages/404.vue +3 -0
  185. package/src/modules/landing/components/pages/Governance.vue +155 -0
  186. package/src/modules/landing/components/pages/Home.vue +52 -0
  187. package/src/modules/landing/components/pages/Hotel.vue +54 -0
  188. package/src/modules/landing/components/pages/Page.vue +184 -0
  189. package/src/modules/landing/components/sections/AboutSection.vue +69 -0
  190. package/src/modules/landing/components/sections/Examples.vue +90 -0
  191. package/src/modules/landing/components/sections/FeatureSection.vue +80 -0
  192. package/src/modules/landing/components/sections/GiftSection.vue +63 -0
  193. package/src/modules/landing/components/sections/HeroSection.vue +74 -0
  194. package/src/modules/landing/components/sections/HowItWorksSection.vue +88 -0
  195. package/src/modules/landing/components/sections/HowToBuyWDR.vue +131 -0
  196. package/src/modules/landing/components/sections/InstagramSection.vue +181 -0
  197. package/src/modules/landing/components/sections/MapSection.vue +91 -0
  198. package/src/modules/landing/components/sections/SectionsSection.vue +69 -0
  199. package/src/modules/landing/components/sections/SliderFeatures.vue +131 -0
  200. package/src/modules/landing/components/sections/WhatIsWDRSection.vue +116 -0
  201. package/src/modules/landing/router/landing.js +34 -0
  202. package/src/modules/middlewares/server/verifySignUp.js +4 -0
  203. package/src/modules/mobile/components/BottomNavigation/BottomNavigation.vue +86 -0
  204. package/src/modules/mobile/components/BottomSheet/BottomSheet.vue +86 -0
  205. package/src/modules/mobile/components/NavigationBar/NavigationBar.vue +132 -0
  206. package/src/modules/mobile/components/Walkthrough/Walkthrough.vue +195 -0
  207. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  208. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +52 -44
  209. package/src/modules/organizations/components/blocks/User.vue +42 -10
  210. package/src/modules/organizations/components/pages/Department.vue +7 -6
  211. package/src/modules/organizations/components/pages/DepartmentEdit.vue +110 -134
  212. package/src/modules/organizations/components/pages/Members.vue +85 -26
  213. package/src/modules/organizations/components/pages/Organization.vue +59 -4
  214. package/src/modules/organizations/components/sections/MembersAdd.vue +27 -34
  215. package/src/modules/organizations/components/sections/Organizations.vue +0 -1
  216. package/src/modules/organizations/controllers/memberships.controller.js +33 -26
  217. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  218. package/src/modules/organizations/models/department.model.js +0 -19
  219. package/src/modules/organizations/models/membership.model.js +4 -0
  220. package/src/modules/organizations/organizations.client.js +1 -6
  221. package/src/modules/organizations/store/departments.js +48 -44
  222. package/src/modules/organizations/store/memberships.js +11 -3
  223. package/src/modules/products/components/blocks/CardPosition.vue +2 -2
  224. package/src/modules/products/components/pages/Product.vue +6 -1
  225. package/src/modules/products/components/pages/ProductEdit.vue +48 -28
  226. package/src/modules/products/controllers/products.controller.js +99 -33
  227. package/src/modules/products/models/product.model.js +16 -1
  228. package/src/modules/products/store/products.js +1 -1
  229. package/src/modules/users/components/pages/ProfileOrganizations.vue +41 -7
  230. package/src/styles/layout.scss +1 -1
  231. package/src/modules/organizations/components/sections/FeedDepartments.vue +0 -64
  232. package/src/modules/organizations/components/sections/MembersList.vue +0 -85
  233. package/src/modules/organizations/store/invites.js +0 -93
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <section class="mn-b-medium radius-medium pd-semi bg-white">
4
- <h3 class="mn-b-medium">Добавить участников</h3>
3
+ <section class="mn-b-medium radius-medium pd-semi bg-grey">
4
+ <h3 class="mn-b-medium">Add members</h3>
5
5
  <p class="mn-b-small t-transp p-medium">Укажите email или телефон, чтобы отправить ссылку с приглашением:</p>
6
6
 
7
7
  <div
@@ -10,49 +10,42 @@
10
10
  class="
11
11
  br-1px br-solid br-grey
12
12
  flex
13
+ gap-thin
13
14
  radius-small
14
15
  mn-b-thin
15
16
  ">
16
-
17
- <div class="w-100 flex-nowrap flex">
18
17
  <Field
19
18
  v-model:field="member.contact"
20
- placeholder="Email или телефон"
21
- class="w-100 bg-white"
19
+ placeholder="Enter email or phone"
20
+ class="pd-small radius-small w-100 bg-white"
22
21
  :validation="contactValidation"
23
22
  />
24
-
23
+ <Select
24
+ v-model:select="member.role"
25
+ label="Role"
26
+ :options="[
27
+ 'owner',
28
+ 'manager',
29
+ 'member'
30
+ ]"
31
+ placeholder="Select"
32
+ class="pos-relative w-100 bg-white radius-small pd-small"
33
+ />
25
34
  <div v-if="index > 0" class="mn-r-medium flex-v-center flex">
26
- <button @click="removeMember(index)" class="button-small button">×</button>
35
+ <button @click="removeMember(index)" class="button-small button">×</button>
27
36
  </div>
28
37
  </div>
29
38
 
30
- <Select
31
- :options="[
32
- {name: 'Директор', value: 'director'},
33
- {name: 'Менеджер', value: 'manager'},
34
- {name: 'Сотрудник', value: 'member'},
35
- ]"
36
- :prop="member"
37
- content="role"
38
- placeholder="Роль"
39
- size="small"
40
- class="w-80"
41
- />
42
-
43
- </div>
44
-
45
- <div @click="addMember" class="mn-b-small flex-v-center flex-nowrap flex">
46
- <p class="t-blue mn-r-small">+ Добавить приглашение</p>
47
- </div>
48
-
49
- <Button
50
- :submit="a = () => handleSendInvite(invites.state.invites)"
51
- :callback="reloadPage"
52
- class="mn-t-medium">
53
- <span >Отправить приглашения </span>
54
- </Button>
39
+ <div @click="addMember" class="mn-b-small flex-v-center flex-nowrap flex">
40
+ <p class="t-blue mn-r-small">+ Добавить приглашение</p>
41
+ </div>
55
42
 
43
+ <Button
44
+ :submit="a = () => handleSendInvite(invites.state.invites)"
45
+ :callback="reloadPage"
46
+ class="w-100 bg-main">
47
+ <span>Invite to organization</span>
48
+ </Button>
56
49
  </section>
57
50
  </div>
58
51
  </template>
@@ -65,7 +58,7 @@
65
58
  import Button from '@pf/src/components/Button/Button.vue'
66
59
  // Import validation
67
60
  import * as inputsValidation from '@pf/src/modules/middlewares/client/inputs.validation'
68
- import * as invites from '@pf/src/modules/organizations/store/invites';
61
+ import * as invites from '@pf/src/modules/auth/store/invites';
69
62
  // Props
70
63
  const props = defineProps({
71
64
  organization: Object,
@@ -37,7 +37,6 @@
37
37
  import Button from '@pf/src/components/Button/Button.vue'
38
38
  // Local
39
39
  import DetailsTab from '@pf/src/modules/organizations/components/sections/DetailsTab.vue'
40
- import FeedDepartments from '@pf/src/modules/organizations/components/sections/FeedDepartments.vue'
41
40
  import CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'
42
41
  // Blocks
43
42
  import EmptyState from '@pf/src/modules/organizations/components/blocks/EmptyState.vue'
@@ -1,35 +1,40 @@
1
+ const ObjectId = require('mongoose').Types.ObjectId;
2
+
1
3
  const controllerFactory = (db) => {
2
4
  const Membership = db.membership;
3
5
 
4
6
  const read = async (req, res) => {
5
- let query = {};
6
- let options = {};
7
-
8
- if (req.query.user) {
9
- query.user = req.query.user;
10
- }
11
-
12
- if (req.query.type) {
13
- query.type = req.query.type;
14
- }
15
-
16
- if (req.query.target) {
17
- query.target = req.query.target;
18
- }
19
-
20
- if (req.query.role) {
21
- query.role = req.query.role;
22
- }
23
-
24
7
  try {
25
- const memberships = await Membership.find(query, null, options).populate('user');
26
- if (!memberships) {
27
- return res.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
8
+ const memberships = await Membership.aggregate([
9
+ {
10
+ $match: {
11
+ ...(req.query.user && { user: req.query.user }),
12
+ ...(req.query.type && { type: req.query.type }),
13
+ ...(req.query.target && { target: req.query.target }),
14
+ ...(req.query.role && { role: req.query.role }),
15
+ },
16
+ },
17
+ {
18
+ $lookup: {
19
+ from: 'users',
20
+ localField: 'user',
21
+ foreignField: '_id',
22
+ as: 'user',
23
+ },
24
+ },
25
+ {
26
+ $unwind: '$user',
27
+ },
28
+ ]);
29
+
30
+ if (!memberships || memberships.length === 0) {
31
+ return res.status(404).send({ errorCode: 'MEMBERSHIPS_NOT_FOUND' });
28
32
  }
33
+
29
34
  res.send(memberships);
30
35
  } catch (err) {
31
- console.log(err)
32
- res.status(500).send({ errorCode: "SERVER_ERROR" });
36
+ console.log(err);
37
+ res.status(500).send({ errorCode: 'SERVER_ERROR' });
33
38
  }
34
39
  };
35
40
 
@@ -64,13 +69,15 @@ const controllerFactory = (db) => {
64
69
  };
65
70
 
66
71
  const deleteMembership = async (req, res) => {
67
- const { type, target, user, role } = req.body;
72
+ // const { type, target, user, role } = req.body;
68
73
 
69
74
 
70
75
  console.log(req.body)
71
76
 
72
77
  try {
73
- const membership = await Membership.findOne({ type, target, user, role });
78
+ // const membership = await Membership.findOne({ type, target, user, role });
79
+ const membership = await Membership.findOneAndDelete({ _id: new ObjectId(req.body._id)})
80
+ // const membership = await Membership.findOne({ type, target, user, role });
74
81
 
75
82
  if (!membership) {
76
83
  return res.status(404).send({ errorCode: 'MEMBERSHIP_NOT_FOUND' });
@@ -61,7 +61,7 @@ const controllerFactory = (db) => {
61
61
  const matchConditions = [
62
62
  ...(req.query._id ? [{ _id: new ObjectId(req.query._id) }] : []),
63
63
  ...(req.query.owner ? [{ owner: new ObjectId(req.query.owner) }] : []),
64
- ...(req.query.member ? [{"memberships.user": new ObjectId(req.query.member), "memberships.role": { $nin: ['subscriber', 'owner'] } } ] : [] ),
64
+ ...(req.query.member ? [{"memberships.user": new ObjectId(req.query.member), "memberships.role": 'member' } ] : [] ),
65
65
  ...(req.query.subscriber ? [{"memberships.user": new ObjectId(req.query.subscriber), "memberships.role": 'subscriber'} ] : [] ),
66
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' } } ] } ] } ] : [] ),
67
67
  ...(req.query.types ? [{ types: { $in: req.query.types } }] : []), // Если req.query.types - строка
@@ -15,22 +15,6 @@ module.exports = (mongoose) => {
15
15
  description: { type: String },
16
16
  categories: [String]
17
17
  },
18
- // Working hours
19
- address: String,
20
- // Position on map
21
- location: {
22
- lat: Number,
23
- lng: Number,
24
- type: {
25
- type: String,
26
- enum: ['Point'], // 'location.type' must be 'Point'
27
- required: true
28
- },
29
- coordinates: {
30
- type: [Number],
31
- required: true
32
- }
33
- },
34
18
  worktime: [{
35
19
  day: String,
36
20
  time: {
@@ -63,9 +47,6 @@ module.exports = (mongoose) => {
63
47
 
64
48
  departmentSchema.index({ organization: 1 })
65
49
 
66
- departmentSchema.index({ location: '2dsphere' });
67
-
68
-
69
50
  const Department = mongoose.model('Department', departmentSchema);
70
51
 
71
52
  return Department
@@ -15,6 +15,10 @@ module.exports = (mongoose) => {
15
15
  type: String,
16
16
  default: 'subscriber'
17
17
  },
18
+ label: {
19
+ type: String,
20
+ default: 'subscriber'
21
+ },
18
22
  target: { // заменяем 'organization' на 'target', так как это может быть или User, или Organization
19
23
  type: mongoose.Schema.Types.ObjectId,
20
24
  ref: function (value) {
@@ -18,17 +18,15 @@ import Contacts from './components/blocks/Contacts.vue';
18
18
  import Socials from './components/blocks/Socials.vue';
19
19
 
20
20
  import MembersAdd from './components/sections/MembersAdd.vue';
21
- import FeedDepartments from './components/sections/FeedDepartments.vue';
22
21
  import DetailsTab from './components/sections/DetailsTab.vue';
23
22
  import OrganizationsSection from './components/sections/Organizations.vue';
24
23
  import Publics from './components/sections/Publics.vue';
25
24
  import Documents from './components/sections/Documents.vue';
26
- import MembersList from './components/sections/MembersList.vue';
27
25
 
28
26
  import ButtonToggleMembership from './components/elements/ButtonToggleMembership.vue';
29
27
 
30
28
  // Import Vuex store modules
31
- import * as invitesStore from './store/invites.js';
29
+
32
30
  import * as departmentsStore from './store/departments.js';
33
31
  import * as membershipsStore from './store/memberships.js';
34
32
  import * as organizationStore from './store/organizations.js';
@@ -55,14 +53,11 @@ EmptyState,
55
53
  Contacts,
56
54
  Socials,
57
55
  MembersAdd,
58
- FeedDepartments,
59
56
  DetailsTab,
60
57
  OrganizationsSection,
61
58
  Publics,
62
59
  Documents,
63
- MembersList,
64
60
  ButtonToggleMembership,
65
- invitesStore,
66
61
  departmentsStore,
67
62
  membershipsStore,
68
63
  organizationStore,
@@ -37,58 +37,62 @@ const state = reactive({
37
37
  // Methods
38
38
  const actions = {
39
39
  async readOne(departmentID) {
40
- await $axios
41
- .get(`/api/departments/get/${departmentID}`)
42
- .then(response => {
43
- state.department = response.data;
44
- state.error = null;
45
- })
46
- .catch(error => {
47
- setError(error)
48
- });
40
+ try {
41
+ const response = await $axios.get(`/api/departments/get/${departmentID}`);
42
+ state.department = response.data;
43
+ state.error = null;
44
+ return response.data; // Return the response data
45
+ } catch (error) {
46
+ setError(error);
47
+ return null; // Return null or appropriate error response
48
+ }
49
49
  },
50
+
50
51
  async read(organizationId) {
51
- await $axios
52
- .get(`/api/departments/${organizationId}`)
53
- .then(response => {
54
- console.log('Response:', response);
55
- state.departments = response.data;
56
- state.error = null;
57
- })
58
- .catch(error => {
59
- setError(error)
60
- });
52
+ try {
53
+ const response = await $axios.get(`/api/departments/${organizationId}`);
54
+ console.log('Response:', response);
55
+ state.departments = response.data;
56
+ state.error = null;
57
+ return response.data; // Return the response data
58
+ } catch (error) {
59
+ setError(error);
60
+ return null; // Return null or appropriate error response
61
+ }
61
62
  },
63
+
62
64
  async create(organizationId, department) {
63
- await $axios
64
- .post(`/api/departments/${organizationId}/create`, department)
65
- .then(response => {
66
- state.error = null;
67
- state.department = response.data;
68
- })
69
- .catch(error => {
70
- setError(error)
71
- });
65
+ try {
66
+ const response = await $axios.post(`/api/departments/${organizationId}/create`, department);
67
+ state.error = null;
68
+ state.department = response.data;
69
+ return response.data; // Return the response data
70
+ } catch (error) {
71
+ setError(error);
72
+ return null; // Return null or appropriate error response
73
+ }
72
74
  },
75
+
73
76
  async update(organizationId, department) {
74
- await $axios
75
- .post(`/api/departments/${organizationId}/update`, department)
76
- .then(() => {
77
- state.error = null;
78
- })
79
- .catch(error => {
80
- setError(error)
81
- });
77
+ try {
78
+ const response = await $axios.post(`/api/departments/${organizationId}/update`, department);
79
+ state.error = null;
80
+ return response; // Return the response for update operations, might not have body data
81
+ } catch (error) {
82
+ setError(error);
83
+ return null; // Return null or appropriate error response
84
+ }
82
85
  },
86
+
83
87
  async delete(organizationId, departmentId) {
84
- await $axios
85
- .delete(`/api/departments/${organizationId}/delete`, { data: { _id: departmentId } })
86
- .then(() => {
87
- state.error = null;
88
- })
89
- .catch(error => {
90
- setError(error)
91
- });
88
+ try {
89
+ await $axios.delete(`/api/departments/${organizationId}/delete`, { data: { _id: departmentId } });
90
+ state.error = null;
91
+ return true; // Return true to indicate successful deletion
92
+ } catch (error) {
93
+ setError(error);
94
+ return false; // Return false or appropriate error response
95
+ }
92
96
  },
93
97
  };
94
98
 
@@ -21,9 +21,17 @@ const state = reactive({
21
21
 
22
22
  // Methods
23
23
  const actions = {
24
- async read({ user, type, target, role }) {
24
+ async read(options = {}) {
25
+
26
+ let params = {}
27
+
28
+ if (options._id) params._id = options._id;
29
+ if (options.user) params.user = options.user;
30
+ if (options.target) params.target = options.target;
31
+ if (options.roles) params.roles = options.roles;
32
+
25
33
  try {
26
- const response = await $axios.get(`/api/memberships`, { params: { user, type, target, role } });
34
+ const response = await $axios.get(`/api/memberships`, { params: params });
27
35
  state.error = null;
28
36
  state.memberships = response.data;
29
37
  return Promise.resolve(response.data);
@@ -54,7 +62,7 @@ const actions = {
54
62
  },
55
63
  async delete(membership) {
56
64
  try {
57
- const response = await $axios.post(`/api/memberships/delete`, membership);
65
+ const response = await $axios.post(`/api/memberships/delete`, {_id: membership});
58
66
  state.error = null;
59
67
  return Promise.resolve(response.data);
60
68
  } catch (error) {
@@ -7,7 +7,7 @@
7
7
  :multiple="false"
8
8
  :taggable="false"
9
9
  placeholder="Select a product"
10
- class="bg-white h-100 pd-small radius-small"
10
+ class="bg-white pd-small radius-small"
11
11
  />
12
12
  <Field
13
13
  v-model:field="productPrice"
@@ -29,7 +29,7 @@
29
29
  'g',
30
30
  'ml'
31
31
  ]"
32
- class="h-100 bg-grey pd-thin radius-thin"
32
+ class="bg-grey pd-thin radius-thin"
33
33
  />
34
34
 
35
35
  </Field>
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <div class="flex flex-column w-100 o-hidden gap-thin pd-thin">
3
3
  <!-- <Breadcrumbs class="bg-grey radius-big pd-small"/> -->
4
- <!-- {{product.quantity}} -->
4
+ {{product.quantity}}
5
+ <div v-if="product.ingredients">
6
+ {{product?.ingredients[0]?._id}}
7
+ {{product?.ingredients[0]?.quantity}}
8
+ {{product?.ingredients[1]?.quantity}}
9
+ </div>
5
10
  <SectionProduct v-if="product" :product="product" :user="auth.state.user" class="pos-relative"/>
6
11
 
7
12
  <PopularProducts />
@@ -163,44 +163,51 @@
163
163
  :product="products.state.current"
164
164
  /> -->
165
165
 
166
- <Block
167
- title="Add Ingridient"
168
- class="mn-b-semi"
169
- >
166
+ <Popup
167
+ title="Add ingredient"
168
+ @close-popup="closeIngredientPopup"
169
+ :isPopupOpen="isOpenIngredientPopup"
170
+ class="bg-white pd-big radius-big"
171
+ >
170
172
  <CardPosition
171
173
  @add="(item) => globals.actions.add(
172
- products.state.current.ingridients,
174
+ products.state.current.ingredients,
173
175
  item
174
176
  )"
175
177
  :products="Products"
178
+ class="flex-column"
176
179
  />
180
+ </Popup>
177
181
 
178
- <Block
179
- placeholder="No positions added yet"
180
- class="pd-zero mn-b-semi"
181
- >
182
+ <Block
183
+ title="Ingredients"
184
+ placeholder="No positions added yet"
185
+ :actions="[{
186
+ label: '+',
187
+ function: () => openIngredientPopup()
188
+ }]"
189
+ >
190
+ <div class="cols-1 gap-thin">
182
191
  <CardPosition
183
- v-for="(product, index) in products.state.current.ingridients"
192
+ v-for="(product, index) in products.state.current.ingredients"
184
193
  :key="product._id"
185
194
  :product="product"
186
- :array="products.state.current.ingridients"
195
+ :array="products.state.current.ingredients"
187
196
  :products="Products"
188
- @add="(item) => globals.actions.add(
189
- products.state.current.ingridients,
190
- item
191
- )"
192
- @update="(item) => globals.actions.update(
193
- products.state.current.ingridients,
194
- item,
195
- index
196
- )"
197
- @delete="(item) => globals.actions.delete(
198
- products.state.current.ingridients,
199
- item,
200
- index
201
- )"
197
+ @add="(item) => {
198
+ globals.actions.add(products.state.current.ingredients, item);
199
+ closeIngredientPopup();
200
+ }"
201
+ @update="(item) => {
202
+ globals.actions.update(products.state.current.ingredients, item, index);
203
+ closeIngredientPopup();
204
+ }"
205
+ @delete="(item) => {
206
+ globals.actions.delete(products.state.current.ingredients, item, index);
207
+ closeIngredientPopup();
208
+ }"
202
209
  />
203
- </Block>
210
+ </div>
204
211
  </Block>
205
212
 
206
213
  </div>
@@ -221,6 +228,7 @@
221
228
  import Checkbox from "@pf/src/components/Checkbox/Checkbox.vue";
222
229
  import Button from "@pf/src/components/Button/Button.vue";
223
230
  import Popup from "@pf/src/components/Popup/Popup.vue";
231
+
224
232
  import EditImages from '@pf/src/components/EditImages/EditImages.vue';
225
233
 
226
234
  import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';
@@ -240,6 +248,18 @@
240
248
  const router = useRouter()
241
249
 
242
250
  const Products = ref(products.state.all);
251
+ const isOpenIngredientPopup = ref(false);
252
+
253
+
254
+ function openIngredientPopup(member) {
255
+ isOpenIngredientPopup.value = true;
256
+ // if (typeof member === "number") selectedMember.value = member;
257
+ }
258
+
259
+ function closeIngredientPopup() {
260
+ isOpenIngredientPopup.value = false;
261
+ // selectedMember.value = null;
262
+ }
243
263
 
244
264
  onMounted(async() => {
245
265
 
@@ -263,8 +283,8 @@
263
283
  // await commit('products/clearProductState')
264
284
  }
265
285
 
266
- if (!products.state.current.ingridients) {
267
- products.state.current.ingridients = []
286
+ if (!products.state.current.ingredients) {
287
+ products.state.current.ingredients = []
268
288
  }
269
289
 
270
290
  })