@ozdao/prometheus-framework 0.2.94 → 0.2.96

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. package/dist/auth.server.js +15 -14
  2. package/dist/auth.server.mjs +15 -14
  3. package/dist/main-BJvlNekm.mjs +13631 -0
  4. package/dist/main-pGo7JpSP.js +92 -0
  5. package/dist/orders.server.js +26 -22
  6. package/dist/orders.server.mjs +26 -22
  7. package/dist/organizations.server.js +31 -10
  8. package/dist/organizations.server.mjs +31 -10
  9. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Block/Block.vue.js +2 -2
  11. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  13. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  15. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
  16. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  20. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  22. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +12 -12
  23. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  25. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  27. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
  28. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
  44. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  56. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  57. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  58. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  68. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +60 -60
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  72. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  76. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
  78. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  80. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  81. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
  82. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
  84. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +50 -49
  86. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +113 -110
  88. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
  89. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  91. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
  96. package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
  97. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
  99. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +19 -19
  101. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +47 -47
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +143 -131
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  111. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  117. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
  119. package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
  125. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  135. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +155 -187
  139. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +19 -19
  143. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  145. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
  149. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +68 -65
  151. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  152. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  153. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  154. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  155. package/dist/prometheus-framework.cjs.js +1 -1
  156. package/dist/prometheus-framework.es.js +1 -1
  157. package/dist/style.css +1 -1
  158. package/dist/web-B2xhKZNK.js +1 -0
  159. package/dist/web-DTzbVshr.mjs +54 -0
  160. package/package.json +1 -1
  161. package/src/components/Block/Block.vue +1 -1
  162. package/src/components/Completion/Completion.vue +2 -2
  163. package/src/modules/auth/controllers/auth.controller.js +19 -16
  164. package/src/modules/auth/router/auth.js +4 -0
  165. package/src/modules/backoffice/router/backoffice.js +3 -3
  166. package/src/modules/chats/routes/chats.routes.js +1 -2
  167. package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
  168. package/src/modules/globals/services/globals.crud.js +2 -0
  169. package/src/modules/icons/navigation/IconCross.vue +11 -7
  170. package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
  171. package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
  172. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +8 -4
  173. package/src/modules/orders/components/pages/Orders.vue +1 -1
  174. package/src/modules/orders/controllers/orders.controller.js +26 -25
  175. package/src/modules/orders/models/order.model.js +1 -1
  176. package/src/modules/orders/routes/orders.routes.js +9 -3
  177. package/src/modules/orders/store/customers.store.js +1 -1
  178. package/src/modules/orders/store/models/order.js +33 -0
  179. package/src/modules/orders/store/orders.js +7 -28
  180. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
  181. package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
  182. package/src/modules/organizations/components/pages/Members.vue +50 -38
  183. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  184. package/src/modules/organizations/components/pages/Organizations.vue +2 -1
  185. package/src/modules/organizations/controllers/invites.controller.js +2 -0
  186. package/src/modules/organizations/controllers/memberships.controller.js +35 -11
  187. package/src/modules/organizations/controllers/organizations.controller.js +5 -4
  188. package/src/modules/organizations/models/invite.model.js +4 -0
  189. package/src/modules/organizations/organizations.client.js +0 -2
  190. package/src/modules/organizations/router/members.router.js +1 -1
  191. package/src/modules/organizations/store/departments.js +0 -1
  192. package/src/modules/organizations/store/memberships.js +1 -8
  193. package/src/modules/products/components/pages/ProductEdit.vue +39 -33
  194. package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
  195. package/src/modules/users/components/blocks/CardUser.vue +9 -5
  196. package/src/modules/users/components/pages/Profile.vue +5 -3
  197. package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
  198. package/src/modules/users/components/sections/ProfileCompletion.vue +2 -2
  199. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
  200. package/src/modules/users/components/pages/ProfileOrganizations.vue +0 -97
@@ -185,7 +185,7 @@
185
185
  user: auth.state.user._id
186
186
  })
187
187
 
188
- await memberships.actions.read(route.params._id)
188
+ await memberships.actions.read({target: route.params._id})
189
189
  })
190
190
 
191
191
  const tabOrganization = ref(tab)
@@ -12,7 +12,8 @@
12
12
  i-big
13
13
  hover-scale-1
14
14
  cursor-pointer
15
- t-whitebg-second
15
+ t-white
16
+ bg-second
16
17
  ">
17
18
  +
18
19
  </button>
@@ -36,6 +36,7 @@ const сontrollerFactory = (db) => {
36
36
  const create = async (req, res) => {
37
37
  const creator = req.body.creator
38
38
  const owner = req.body.owner
39
+
39
40
  const list = req.body.invites
40
41
 
41
42
  try {
@@ -60,6 +61,7 @@ const сontrollerFactory = (db) => {
60
61
 
61
62
  await membership.save();
62
63
  } else {
64
+
63
65
  const newInvite = new Invite({
64
66
  code: uuid(),
65
67
  creator: creator,
@@ -5,17 +5,27 @@ const controllerFactory = (db) => {
5
5
 
6
6
  const read = async (req, res) => {
7
7
  try {
8
+
9
+ let search = req.query.search;
10
+
11
+ let regexPattern = '';
12
+
13
+ if (search) {
14
+ // Экранируем специальные символы
15
+ search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
16
+
17
+ const parts = search.split('.');
18
+
19
+ if (parts.length === 2) {
20
+ // Создаем паттерн, который допускает замену одного символа в каждой части
21
+ regexPattern = parts.map(part => part.substr(0, part.length - 1) + '.{1}').join('\\.');
22
+ } else {
23
+ // Если нет точки, применяем аналогичный подход к всей строке
24
+ regexPattern = search.substr(0, search.length - 1) + '.{1}';
25
+ }
26
+ }
8
27
 
9
28
  const memberships = await Membership.aggregate([
10
- {
11
- $match: {
12
- ...(req.query.user && { user: new ObjectId(req.query.user) }),
13
- ...(req.query.type && { type: req.query.type }),
14
- ...(req.query.target && { target: new ObjectId(req.query.target) }),
15
- // ...(req.query.role && { role: req.query.role }),
16
- ...(req.query.role && { role: { $in: req.query.role } }),
17
- },
18
- },
19
29
  {
20
30
  $lookup: {
21
31
  from: 'users',
@@ -24,6 +34,21 @@ const controllerFactory = (db) => {
24
34
  as: 'user',
25
35
  },
26
36
  },
37
+ {
38
+ $match: {
39
+ ...(req.query.user && { user: new ObjectId(req.query.user) }),
40
+ ...(req.query.type && { type: req.query.type }),
41
+ ...(req.query.target && { target: new ObjectId(req.query.target) }),
42
+ ...(req.query.role && { role: { $in: req.query.role } }),
43
+ ...(req.query.search && {
44
+ $or: [
45
+ { "user.profile.name": { $regex: regexPattern, $options: 'i' } },
46
+ { "user.email": { $regex: regexPattern, $options: 'i' } },
47
+ { "user.phone": { $regex: regexPattern, $options: 'i' } }
48
+ ]
49
+ })
50
+ },
51
+ },
27
52
  {
28
53
  $unwind: '$user',
29
54
  },
@@ -32,7 +57,7 @@ const controllerFactory = (db) => {
32
57
  if (!memberships || memberships.length === 0) {
33
58
  return res.status(404).send({ errorCode: 'MEMBERSHIPS_NOT_FOUND' });
34
59
  }
35
-
60
+ console.log('membership is', memberships[0].user)
36
61
  res.send(memberships);
37
62
  } catch (err) {
38
63
  console.log(err);
@@ -42,7 +67,6 @@ const controllerFactory = (db) => {
42
67
 
43
68
  const create = async (req, res) => {
44
69
 
45
- console.log(req.body)
46
70
  const newMembership = new Membership({
47
71
  user: req.body.user,
48
72
  type: req.body.type,
@@ -371,10 +371,11 @@ const create = async (req, res) => {
371
371
  const savedOrganization = await organization.save();
372
372
 
373
373
  const membership = new Membership({
374
- user: savedOrganization.owner,
375
- type: 'organization',
376
- target: savedOrganization._id,
377
- role: 'owner',
374
+ user: savedOrganization.owner,
375
+ type: 'organization',
376
+ target: savedOrganization._id,
377
+ role: 'owner',
378
+ label: 'owner',
378
379
  });
379
380
 
380
381
  const savedMembership = await membership.save();
@@ -13,6 +13,10 @@ module.exports = (db) => {
13
13
  enum: ['active', 'used', 'deactivated'],
14
14
  default: 'active'
15
15
  },
16
+ role: {
17
+ type: String,
18
+ default: 'member'
19
+ }
16
20
  }, {
17
21
  timestamps: true
18
22
  });
@@ -9,7 +9,6 @@ import CardOrganization from './components/blocks/CardOrganization.vue';
9
9
  import EditArray from './components/blocks/EditArray.vue';
10
10
  import Unit from './components/blocks/Unit.vue';
11
11
  import DepartmentSub from './components/blocks/DepartmentSub.vue';
12
- import DepartmentMemberModify from './components/blocks/DepartmentMemberModify.vue';
13
12
  import CardDepartment from './components/blocks/CardDepartment.vue';
14
13
  import Rating from './components/blocks/Rating.vue';
15
14
  import EmptyState from './components/blocks/EmptyState.vue';
@@ -45,7 +44,6 @@ CardOrganization,
45
44
  EditArray,
46
45
  Unit,
47
46
  DepartmentSub,
48
- DepartmentMemberModify,
49
47
  CardDepartment,
50
48
  Rating,
51
49
  EmptyState,
@@ -6,7 +6,7 @@ const membersRoutes = [{
6
6
  meta: {
7
7
  title: {
8
8
  en: 'Members',
9
- ru: 'Участникb'
9
+ ru: 'Участники'
10
10
  }
11
11
  },
12
12
  component: () => import('@pf/src/modules/organizations/components/pages/Members.vue')
@@ -87,7 +87,6 @@ const actions = {
87
87
  try {
88
88
  const response = await $axios.post(`/api/departments/${organizationId}/create`, department);
89
89
  state.error = null;
90
- state.department = response.data;
91
90
  return response.data; // Return the response data
92
91
  } catch (error) {
93
92
  setError(error);
@@ -23,15 +23,8 @@ const state = reactive({
23
23
  const actions = {
24
24
  async read(options = {}) {
25
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.role) params.role = options.role;
32
-
33
26
  try {
34
- const response = await $axios.get(`/api/memberships`, { params: params });
27
+ const response = await $axios.get(`/api/memberships`, { params: options });
35
28
  state.error = null;
36
29
  state.memberships = response.data;
37
30
  return Promise.resolve(response.data);
@@ -46,6 +46,39 @@
46
46
  />
47
47
  </Block>
48
48
 
49
+ <Block
50
+ title="Ingredients"
51
+ placeholder="No ingridients added yet"
52
+ :actions="[{
53
+ label: '+',
54
+ function: () => openIngredientPopup()
55
+ }]"
56
+ >
57
+ <div v-if="products.state.current.ingredients.length > 0" class="cols-1 gap-thin">
58
+ <CardPosition
59
+ v-for="(product, index) in products.state.current.ingredients"
60
+ :key="product._id"
61
+ :product="product"
62
+ :array="products.state.current.ingredients"
63
+ :products="Products"
64
+ @add="(item) => {
65
+ globals.actions.add(products.state.current.ingredients, item);
66
+ closeIngredientPopup();
67
+ }"
68
+ @update="(item) => {
69
+ globals.actions.update(products.state.current.ingredients, item, index);
70
+ closeIngredientPopup();
71
+ }"
72
+ @delete="(item) => {
73
+ globals.actions.delete(products.state.current.ingredients, item, index);
74
+ closeIngredientPopup();
75
+ }"
76
+ />
77
+ </div>
78
+ </Block>
79
+
80
+ </div>
81
+
49
82
  <Block
50
83
  title="Categories"
51
84
  :actions="[{
@@ -69,6 +102,7 @@
69
102
  />
70
103
  </Block>
71
104
 
105
+
72
106
  <Block
73
107
  title="Parameters"
74
108
  placeholder="No parameters added yet"
@@ -102,6 +136,7 @@
102
136
  </div>
103
137
  </Block>
104
138
 
139
+
105
140
  <Block
106
141
  title="Localization"
107
142
  placeholder="No localizations added yet"
@@ -134,9 +169,9 @@
134
169
  </div>
135
170
  </Block>
136
171
 
137
- </div>
172
+
138
173
 
139
- <Block
174
+ <!-- <Block
140
175
  title="Quantity Discount"
141
176
  class="mn-b-semi"
142
177
  :actions="[{
@@ -166,7 +201,7 @@
166
201
  />
167
202
  </div>
168
203
  </div>
169
- </Block>
204
+ </Block> -->
170
205
 
171
206
  <!-- <EditModifications
172
207
  :product="products.state.current"
@@ -188,36 +223,7 @@
188
223
  />
189
224
  </Popup>
190
225
 
191
- <Block
192
- title="Ingredients"
193
- placeholder="No positions added yet"
194
- :actions="[{
195
- label: '+',
196
- function: () => openIngredientPopup()
197
- }]"
198
- >
199
- <div class="cols-1 gap-thin">
200
- <CardPosition
201
- v-for="(product, index) in products.state.current.ingredients"
202
- :key="product._id"
203
- :product="product"
204
- :array="products.state.current.ingredients"
205
- :products="Products"
206
- @add="(item) => {
207
- globals.actions.add(products.state.current.ingredients, item);
208
- closeIngredientPopup();
209
- }"
210
- @update="(item) => {
211
- globals.actions.update(products.state.current.ingredients, item, index);
212
- closeIngredientPopup();
213
- }"
214
- @delete="(item) => {
215
- globals.actions.delete(products.state.current.ingredients, item, index);
216
- closeIngredientPopup();
217
- }"
218
- />
219
- </div>
220
- </Block>
226
+
221
227
 
222
228
  </div>
223
229
 
@@ -15,13 +15,13 @@
15
15
  <Field
16
16
  v-model:field="product.name"
17
17
  label="Name"
18
- placeholder="Введите название"
18
+ placeholder="Enter product name"
19
19
  class="w-100 mn-b-small bg-white radius-small pd-medium"
20
20
  />
21
21
  <Field
22
22
  v-model:field="product.price"
23
23
  label="Price"
24
- placeholder="Введите цену"
24
+ placeholder="Enter product price"
25
25
  class="w-100 mn-b-small bg-white radius-small pd-medium"
26
26
  type="number"
27
27
  >
@@ -39,7 +39,7 @@
39
39
  <Field
40
40
  v-model:field="product.description"
41
41
  label="Description"
42
- placeholder="Введите описание"
42
+ placeholder="Enter product description"
43
43
  class="w-100 bg-white radius-small pd-medium"
44
44
  type="textarea"
45
45
  />
@@ -30,7 +30,7 @@
30
30
  <span class=" mn-r-small">{{phone || email}}</span>
31
31
  </div>
32
32
 
33
- <div v-if="action || role" class="mn-l-auto flex-v-center flex">
33
+ <div v-if="action || role" class="mn-l-auto flex-stretch flex-v-center flex">
34
34
  <span
35
35
  v-if="role"
36
36
  class="flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"
@@ -40,10 +40,14 @@
40
40
  <button
41
41
  v-if="action"
42
42
  @click.stop="action.method"
43
- class="h-100 w-2r t-white mn-l-thin capitalize t-medium radius-big bg-red"
44
- >
45
- {{action.label}}
46
- </button>
43
+ class="h-2r w-2r t-white mn-l-thin capitalize t-medium radius-big bg-red"
44
+ >
45
+ <component v-if="action.label.is" :is="action.label.is" v-bind="action.label.props"></component>
46
+
47
+ <template v-else>
48
+ {{action.label}}
49
+ </template>
50
+ </button>
47
51
  <!-- {{`Member since ${user.createdAt}. Invited by ${user.creator.target}`}} -->
48
52
  </div>
49
53
 
@@ -80,7 +80,7 @@
80
80
  />
81
81
 
82
82
  <img
83
- v-if="users.state.current.profile.photo.length > 0"
83
+ v-if="users.state.current.profile.photo && users.state.current.profile.photo.length > 0"
84
84
  :src="(FILE_SERVER_URL || '')+ users.state.current.profile.photo"
85
85
  class="radius-extra bg-white mn-b-small object-fit-cover i-extra"
86
86
  />
@@ -93,10 +93,11 @@
93
93
  <h3
94
94
  class="mn-b-thin"
95
95
  >
96
- {{users.state.current.profile.name ? users.state.current.profile.name : 'Not specified' }}
96
+ {{users.state.current.profile.name ? users.state.current.profile.name : 'Anonymous' }}
97
97
  </h3>
98
98
 
99
99
  <p
100
+ v-if="users.state.current.username"
100
101
  class="mn-b-thin t-main t-semi"
101
102
  >
102
103
  @{{ users.state.current.username ? users.state.current.username : 'Not specified' }}
@@ -105,7 +106,7 @@
105
106
  <p
106
107
  class="mn-b-small p-medium"
107
108
  >
108
- {{ users.state.current.profile.description ? users.state.current.profile.description : 'Not specified' }}
109
+ {{ users.state.current.profile.description ? users.state.current.profile.description : 'Bio not specified' }}
109
110
  </p>
110
111
 
111
112
  <div class="mn-b-medium flex-center flex-nowrap flex">
@@ -283,6 +284,7 @@ const handleMembershipUpdate = ({ membership, status, target }, statusName, stat
283
284
 
284
285
  function logout () {
285
286
  auth.actions.logout()
287
+
286
288
  router.push({name: 'Sign In'})
287
289
  }
288
290
  </script>
@@ -7,7 +7,7 @@
7
7
  @click="$router.push({
8
8
  name: 'Create BlogPost'
9
9
  })"
10
- class="radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second">
10
+ class="radius-100 t-white t-semi i-big hover-scale-1 cursor-pointer t-white bg-second">
11
11
  +
12
12
  </button>
13
13
  </header>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <section class="w-100 mn-b-semi radius-medium pd-medium bg-main t-black">
2
+ <section class="w-100 mn-b-semi radius-medium pd-medium bg-second t-black">
3
3
  <div class="mn-b-thin flex-v-center flex-nowrap flex">
4
4
  <h4>
5
5
  {{text}}
@@ -22,7 +22,7 @@
22
22
  </div>
23
23
 
24
24
  <div class=" w-100 h-2r pos-relative pd-nano bg-black radius-big">
25
- <div :style="`width: ${completionPercentage}%`"class="h-100 bg-main mn-b-thin radius-big">
25
+ <div :style="`width: ${completionPercentage}%`"class="h-100 bg-second mn-b-thin radius-big">
26
26
  </div>
27
27
  </div>
28
28
 
@@ -1,126 +0,0 @@
1
- <template>
2
- <div>
3
-
4
- <div class="br-grey radius-small mn-small">
5
-
6
- <div class="bg-grey mn-b-thin h-min-10r h-max-10r o-scroll pd-medium radius-big">
7
- <Feed
8
- :states="{
9
- empty: {
10
- title: 'No Members Found',
11
- description: 'Currently, there are no members available.'
12
- }
13
- }"
14
- :store="{
15
- read: (options) => memberships.actions.read(options),
16
- state: null
17
- }"
18
- :options="{
19
- target: $route.params._id
20
- }"
21
- v-slot="{
22
- items
23
- }"
24
- >
25
- <User
26
- v-for="(item, index) in items"
27
- :key="index"
28
- :photo="item.user.profile.photo"
29
- :name="item.user.profile.name || item.user.phone || item.user.email || item.user._id"
30
- :user="item"
31
- :position="item.position"
32
- @click="$router.push(`/app/profile/${user._id}`)"
33
- class="mn-b-thin"
34
- />
35
- </Feed>
36
- </div>
37
-
38
- <!-- <div v-else class="pd-small br-grey br-1px br-solid">
39
- {{ memberForm.user.name ? memberForm.user.name : 'Безымянный' }}, {{memberForm.user.id}}
40
- </div> -->
41
- <Field
42
- v-model:field="roleInput"
43
- label="Должность"
44
- placeholder="Название должности"
45
- class="bg-white "
46
- :validation="organizationName"
47
- />
48
- </div>
49
-
50
- <button :disabled="!userInput || !roleInput" @click="submitForm" class="w-100 button bg-blue t-white">
51
- {{ props.member !== null ? "Редактировать участника" : "Добавить участника" }}
52
- </button>
53
-
54
- <button v-if="props.member !== null" @click="removeMember" class="w-100 button bg-red t-white">
55
- Удалить участника
56
- </button>
57
- </div>
58
- </template>
59
-
60
- <script setup>
61
- import { ref, watch, computed } from "vue";
62
- // Import components
63
- import SelectMulti from '@pf/src/components/SelectMulti/SelectMulti.vue'
64
- import Field from "@pf/src/components/Field/Field.vue";
65
- import Select from "@pf/src/components/Select/Select.vue";
66
-
67
- import Feed from '@pf/src/components/Feed/Feed.vue'
68
- import User from '@pf/src/modules/users/components/blocks/CardUser.vue';
69
-
70
- import * as memberships from '@pf/src/modules/organizations/store/memberships'
71
-
72
- const props = defineProps({
73
- isPopupOpen: Boolean,
74
- member: Number,
75
- members: Array,
76
- users: Array,
77
- });
78
-
79
- const emits = defineEmits(['callback','remove'])
80
-
81
- const userInput = ref(null);
82
- const roleInput = ref(null);
83
-
84
- if (props.member !== null) {
85
- userInput.value = props.members[props.member]
86
- }
87
-
88
- import * as inputsValidation from '@pf/src/modules/middlewares/client/inputs.validation'
89
- const placeValidation = ref(null)
90
-
91
-
92
- async function submitForm() {
93
- if (props.member !== null) {
94
- props.members[props.member] = userInput
95
- props.members[props.member].role = roleInput.value
96
- emits("callback");
97
- } else {
98
- props.members.push({...userInput.value, role: roleInput.value});
99
- emits("callback");
100
- }
101
- }
102
-
103
- async function removeMember() {
104
- props.members.splice(props.member, 1);
105
- emits("callback");
106
- }
107
-
108
- </script>
109
-
110
- <style scoped>
111
- .form-group {
112
- margin-bottom: 1rem;
113
- }
114
-
115
- label {
116
- display: block;
117
- margin-bottom: 0.5rem;
118
- }
119
-
120
- input {
121
- width: 100%;
122
- padding: 0.5rem;
123
- border: 1px solid #ccc;
124
- border-radius: 5px;
125
- }
126
- </style>
@@ -1,97 +0,0 @@
1
- <template>
2
- <div class="pd-thin">
3
- <header class="mn-b-medium flex-v-center flex-nowrap flex">
4
- <h2 class="mn-r-medium">Groups</h2>
5
- <button
6
- v-if="auth.state.user._id === route.params._id"
7
- @click="$router.push({
8
- name: 'Create Organization'
9
- })"
10
- class="radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second">
11
- +
12
- </button>
13
- </header>
14
-
15
- <Tab
16
- v-model:selected="tabOrganization"
17
- :tabs="[
18
- { name: 'Member', value: 'member' },
19
- { name: 'Follower', value: 'follower' }
20
- ]"
21
- class="mn-b-medium mn-r-medium o-hidden h5 radius-big bg-grey"
22
- />
23
-
24
- <transition name="slide-fade">
25
- <Feed
26
- v-if="tabOrganization === 'member'"
27
- :states="{
28
- empty: {
29
- title: 'No Organization Found',
30
- description: 'Currently, there are no organization available.'
31
- }
32
- }"
33
- :store="{
34
- read: (options) => organizations.actions.read(options),
35
- state: organizations.state
36
- }"
37
- :options="{
38
- user: auth.state.user._id,
39
- member: auth.state.user._id,
40
- limit: 10
41
- }"
42
- v-slot="{
43
- items
44
- }"
45
- >
46
- <CardOrganization
47
- v-for="organization in items"
48
- :key="organization._id"
49
- :organization="organization"
50
- :user="auth.state.user"
51
- :showProducts="false"
52
- :showRating="false"
53
- :showFeatured="false"
54
- :showFollowers="false"
55
- @updateMembership="handleMembershipUpdate"
56
- class="mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"
57
- />
58
- </Feed>
59
- </transition>
60
-
61
- <!-- <transition name="slide-fade">
62
- <Feed
63
- v-if="tabOrganization === 'follower'"
64
- :user="auth.state.user._id"
65
- :subscriber="route.params._id"
66
- />
67
- </transition> -->
68
- </div>
69
- </template>
70
-
71
- <script setup>
72
- import { watch, ref } from 'vue'
73
- import { useRoute, useRouter } from 'vue-router'
74
- // Components
75
- import Tab from '@pf/src/components/Tab/Tab.vue'
76
- import Feed from '@pf/src/components/Feed/Feed.vue'
77
-
78
- import CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'
79
-
80
- // import Feed from '@pf/src/modules/organizations/components/sections/Feed.vue';
81
-
82
- import * as auth from '@pf/src/modules/auth/store/auth';
83
- import * as organizations from '@pf/src/modules/organizations/store/organizations'
84
- // Accessing router
85
- const route = useRoute()
86
- const router = useRouter()
87
- // State
88
- let tab = route.query.tab ? route.query.tab : 'member';
89
-
90
- const tabOrganization = ref(tab)
91
-
92
- route.query.tab = tabOrganization.value
93
-
94
- watch(tabOrganization, (newValue) => {
95
- router.replace({ query: { ...route.query, tab: newValue } });
96
- });
97
- </script>