@ozdao/prometheus-framework 0.0.86 → 0.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
  3. package/dist/CardOrganization-ee5c34ab.js +1 -0
  4. package/dist/CardOrganization-f70bd169.mjs +202 -0
  5. package/dist/Comments-63f154a6.js +9 -0
  6. package/dist/Comments-c5afa4d6.mjs +459 -0
  7. package/dist/Feed-8fd41524.js +1 -0
  8. package/dist/Feed-ecf37814.mjs +367 -0
  9. package/dist/IconEdit-736c89be.js +1 -0
  10. package/dist/IconEdit-e9fd4c6c.mjs +21 -0
  11. package/dist/Popup-105ef2c3.js +1 -0
  12. package/dist/Popup-82fb2c8a.mjs +76 -0
  13. package/dist/Product-2f3d592f.mjs +837 -0
  14. package/dist/Product-2fbf9d99.js +7 -0
  15. package/dist/ProductEdit-20709821.mjs +349 -0
  16. package/dist/ProductEdit-a81d13b9.js +1 -0
  17. package/dist/ProfileBlogposts-eca9916c.js +1 -0
  18. package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
  19. package/dist/ProfileComments-58094a50.mjs +43 -0
  20. package/dist/ProfileComments-b919f021.js +1 -0
  21. package/dist/ProfileEvents-05485e20.js +1 -0
  22. package/dist/ProfileEvents-5d206e3d.mjs +55 -0
  23. package/dist/ProfileLikes-2f3a4488.js +1 -0
  24. package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
  25. package/dist/ProfileOrganizations-0b76e38f.js +1 -0
  26. package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
  27. package/dist/Publics-3f277c17.js +1 -0
  28. package/dist/Publics-9ebffff1.mjs +122 -0
  29. package/dist/Tab-58cd105f.mjs +46 -0
  30. package/dist/Tab-6f0a4909.js +1 -0
  31. package/dist/UploadImage-441e8526.js +1 -0
  32. package/dist/UploadImage-ff8f9a0c.mjs +83 -0
  33. package/dist/auth.client.cjs +2 -2
  34. package/dist/auth.client.js +60 -40
  35. package/dist/community.client.cjs +1 -9
  36. package/dist/community.client.js +367 -739
  37. package/dist/community.server.js +16 -4
  38. package/dist/community.server.mjs +16 -4
  39. package/dist/events.client.cjs +1 -1
  40. package/dist/events.client.js +431 -329
  41. package/dist/events.server.js +19 -2
  42. package/dist/events.server.mjs +19 -2
  43. package/dist/inputs.validation-24ae76b9.js +1 -0
  44. package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
  45. package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
  46. package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
  47. package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
  48. package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
  49. package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
  50. package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
  51. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
  52. package/dist/organizations-1b4c84ee.mjs +121 -0
  53. package/dist/organizations-af43bda4.js +1 -0
  54. package/dist/organizations.client-253c8068.mjs +3179 -0
  55. package/dist/organizations.client-c60d7659.js +3 -0
  56. package/dist/organizations.client.cjs +1 -3
  57. package/dist/organizations.client.js +49 -3025
  58. package/dist/style.css +1 -1
  59. package/dist/users.client.cjs +1 -1
  60. package/dist/users.client.js +10 -10
  61. package/package.json +1 -1
  62. package/src/modules/auth/router/auth.js +28 -7
  63. package/src/modules/community/community.client.js +1 -12
  64. package/src/modules/community/components/pages/BlogPost.vue +1 -1
  65. package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
  66. package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
  67. package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
  68. package/src/modules/constructor/components/sections/Constructor.vue +167 -0
  69. package/src/modules/events/components/blocks/CardEvent.vue +14 -6
  70. package/src/modules/events/components/pages/EditEvent.vue +228 -133
  71. package/src/modules/events/components/sections/Feed.vue +7 -1
  72. package/src/modules/events/controllers/events.controller.js +9 -0
  73. package/src/modules/events/controllers/tickets.controller.js +2 -1
  74. package/src/modules/events/models/event.model.js +10 -0
  75. package/src/modules/events/store/events.js +15 -19
  76. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -3
  77. package/src/modules/organizations/components/sections/Publics.vue +2 -3
  78. package/src/modules/organizations/organizations.client.js +0 -2
  79. package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
  80. package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
  81. /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
  82. /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
  83. /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
  84. /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
  85. /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
@@ -17,55 +17,11 @@
17
17
  class="h2"
18
18
  />
19
19
  </div>
20
- <!-- Content -->
21
- <VueDraggableNext
22
- v-if="post.content"
23
- class="w-full"
24
- :list="post.content"
25
- @start="handleDragStart"
26
- @end="handleDragEnd"
27
- >
28
- <div
29
- v-for="(block, index) in post.content"
30
- :key="index"
31
- class="relative"
32
-
33
- >
34
- <div
35
- @mouseover="showControls = index, showMenu = false"
36
- class="w-full h-full"
37
- >
38
- <component
39
- :is="ComponentMap[block.type]"
40
- :index="index"
41
- :component="block"
42
- :prop="block"
43
- :class="block.class"
44
- :setFocus="block.setFocus"
45
- content="content"
46
- @deleteBlock="handleDeleteBlock"
47
- @addBlock="handleAddBlock"
48
- @updateBlock="handleUpdateBlock"
49
-
50
- />
51
- </div>
52
-
53
- <transition name="fade">
54
- <div
55
- v-if="showControls === index"
56
- class="pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi"
57
- @mousedown.prevent="startDragging = true"
58
- >
59
- <button @click="showMenu = !showMenu" class="mn-small w-100 i-semi bg-white radius-thin">{{ block.content ? '...' : '+' }}</button>
60
- <div v-if="showMenu" class="z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded">
61
- <button @click="handleDeleteBlock(block)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Удалить</button>
62
- <button @click="handleAddBlock('ImageUpload', '', index)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Добавить изображение</button>
63
- <button @click="handleAddBlock('H2', '', index)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Добавить заголовок</button>
64
- </div>
65
- </div>
66
- </transition>
67
- </div>
68
- </VueDraggableNext>
20
+
21
+ <Constructor
22
+ :content="post.content"
23
+ @update="update => post.content = update"
24
+ />
69
25
  </section>
70
26
 
71
27
  <section v-if="post" class="pd-thin pos-fixed pos-l-0 pos-b-0 w-100 ">
@@ -112,26 +68,14 @@
112
68
  </div>
113
69
  <Button :submit="onSubmit" :callback="redirectTo" class="w-100 bg-black t-white">Publish</Button>
114
70
  </div>
115
- <!-- <DepartmentMemberModify
116
- :members="departments.state.department.members"
117
- :member="selectedMember"
118
- :users="users"
119
- @callback="closeMemberPopup"
120
- /> -->
121
71
  </Popup>
72
+
122
73
  </article>
123
74
  </template>
124
75
 
125
-
126
-
127
-
128
76
  <script setup>
129
- import Textarea from '@pf/src/modules/community/components/elements/Textarea.vue';
130
- import H2 from '@pf/src/modules/community/components/elements/H2.vue';
131
- import Caption from '@pf/src/modules/community/components/elements/Caption.vue';
132
- import Bullets from '@pf/src/modules/community/components/elements/Bullets.vue';
133
- import ImageUpload from '@pf/src/modules/community/components/elements/ImageUpload.vue';
134
-
77
+ import Textarea from '@pf/src/modules/constructor/components/elements/Textarea.vue';
78
+ import Constructor from '@pf/src/modules/constructor/components/sections/Constructor.vue';
135
79
 
136
80
  import Popup from '@pf/src/components/Popup/Popup.vue'
137
81
  import FieldTags from '@pf/src/components/FieldTags/FieldTags.vue'
@@ -306,93 +250,6 @@ function onDelete() {
306
250
  });
307
251
  }
308
252
  }
309
-
310
- // /////////////////////////////////////////
311
- // CONSTRUCTOR
312
- // /////////////////////////////////////////
313
-
314
- const ComponentMap = {
315
- 'Textarea': Textarea,
316
- 'H2': H2,
317
- 'Bullets': Bullets,
318
- 'Caption': Caption,
319
- 'ImageUpload': ImageUpload
320
- };
321
-
322
- function handleAddBlock(type = 'Textarea', content = '', index, data) {
323
- console.log('We are adding new block (functuin HandleAddBlock):' + type + content + index + data )
324
- let blockNew = {
325
- order: post.value.content.length + 1,
326
- type: type,
327
- style: '',
328
- class: '',
329
- content: content,
330
- blocks: [],
331
- setFocus: true,
332
- };
333
-
334
- if (data && data.blocks && Array.isArray(data.blocks)) {
335
- let newBlocks = data.blocks.map(block => ({
336
- ...blockNew,
337
- content: block.content,
338
-
339
- }));
340
-
341
- let args = [(data.index || index) + 1, 0].concat(newBlocks);
342
-
343
- post.value.content.splice.apply(post.value.content, args);
344
-
345
- const lastBlock = newBlocks[newBlocks.length - 1];
346
-
347
- console.log('New block is' + lastBlock)
348
- } else if (index !== undefined) {
349
- post.value.content.splice(index + 1, 0, blockNew);
350
- console.log('Latest block is' + blockNew)
351
- } else {
352
- console.log('Another block is' + blockNew)
353
- post.value.content.push(blockNew);
354
- }
355
-
356
- showControls.value = null
357
- }
358
-
359
- function handleUpdateBlock(block, update) {
360
- const index = post.value.content.findIndex(item => item === block);
361
-
362
- if (index !== -1) {
363
- post.value.content[index] = { ...post.value.content[index], ...update };
364
- }
365
- }
366
-
367
-
368
- function handleDeleteBlock(block) {
369
- let index = post.value.content.findIndex(b => b === block);
370
-
371
- if (index !== -1) {
372
- post.value.content.splice(index, 1);
373
- }
374
-
375
- post.value.content[index - 1].setFocus = true
376
- }
377
-
378
- // Добавлено из BlogConstructor
379
- const showControls = ref(null)
380
- const startDragging = ref(false)
381
- const showMenu = ref(false)
382
-
383
- function handleDragStart() {
384
- startDragging.value = true
385
- }
386
-
387
- function handleDragEnd() {
388
- startDragging.value = false
389
- }
390
-
391
- watchEffect(() => {
392
- if (post.value && post.value.content.length === 0) {
393
- handleAddBlock('Textarea', '');
394
- }
395
- });
396
253
  </script>
397
254
 
398
255
 
@@ -4,31 +4,44 @@ const middlewareFactory = (db) => {
4
4
 
5
5
  const checkBlogpostExistOrNot = async (req, res, next) => {
6
6
  try {
7
- const url = req.body.url
8
- ? req.body.url
7
+ // Обработка URL
8
+ const url = req.body.url
9
+ ? req.body.url
9
10
  : req.body.name.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '');
10
11
 
11
- // Проверка на наличие _id в теле запроса
12
+ // Создание блога
12
13
  if (!req.body._id) {
13
- res.status(400).send({ errorCode: 'MISSING_BLOGPOST_ID', accessToken: null });
14
+ const blogpost = await Blogpost.findOne({ url });
15
+ if (blogpost) {
16
+ res.status(400).send({ errorCode: 'POST_URL_ALREADY_IN_USE', accessToken: null });
17
+ return;
18
+ }
19
+ next();
14
20
  return;
15
21
  }
16
22
 
17
- const blogpost = await Blogpost.findOne({ url });
23
+ // Обновление блога
18
24
  const updatingBlogpostId = req.body._id;
19
-
20
- if (blogpost && (String(blogpost._id) !== String(updatingBlogpostId))) {
21
- res.status(400).send({ errorCode: 'POST_URL_ALREADY_IN_USE', accessToken: null });
25
+ const existingBlogpost = await Blogpost.findById(updatingBlogpostId);
26
+ if (!existingBlogpost) {
27
+ res.status(404).send({ errorCode: 'BLOGPOST_NOT_FOUND', accessToken: null });
22
28
  return;
23
29
  }
24
-
30
+ if (existingBlogpost.url !== url) {
31
+ const blogpost = await Blogpost.findOne({ url });
32
+ if (blogpost) {
33
+ res.status(400).send({ errorCode: 'POST_URL_ALREADY_IN_USE', accessToken: null });
34
+ return;
35
+ }
36
+ }
37
+
25
38
  next();
26
39
  } catch (err) {
27
40
  console.log(err);
28
41
  res.status(500).send({ message: err });
29
42
  }
30
- };
31
-
43
+ }
44
+
32
45
  const checkNameNotEmpty = (req, res, next) => {
33
46
  if (!req.body.name || req.body.name.trim() === '') {
34
47
  res.status(400).send({ errorCode: "NAME_CANNOT_BE_EMPTY", accessToken: null });
@@ -15,15 +15,13 @@
15
15
  <script setup="props">
16
16
  import { computed, ref, onMounted, watch, nextTick, onUpdated, watchEffect } from 'vue'
17
17
 
18
- const props = defineProps(
19
- ['obj','label','prop','value','content','textarea','placeholder','index','ref','setFocus']
20
- )
18
+ const props = defineProps(['prop','value','content','placeholder','index','setFocus'])
19
+ const emit = defineEmits(['deleteBlock', 'updateBlock','addBlock','focus'])
21
20
 
22
21
  const data = ref(props)
23
22
  const textarea = ref(null)
24
- const emit = defineEmits(['deleteBlock', 'updateBlock','addBlock','focus'])
25
23
 
26
- let cursorPosition = ref(0); // To store the cursor position
24
+ let cursorPosition = ref(0);
27
25
 
28
26
  function handleInput(event) {
29
27
  let paragraphs = event.target.value.split(/\n+/);
@@ -79,12 +77,6 @@
79
77
  if (props.setFocus) nextTick(() => { { focus()} })
80
78
  resize()
81
79
  });
82
-
83
- watch(() => props.prop[props.content], (newValue) => {
84
- // if (newValue === "" && !newValue.includes("\n")) {
85
- // emit('deleteBlock', props.prop)
86
- // }
87
- });
88
80
  </script>
89
81
 
90
82
 
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <!-- Content -->
3
+ <section>
4
+ <VueDraggableNext
5
+ v-if="post.content"
6
+ class="w-full"
7
+ :list="post.content"
8
+ @start="handleDragStart"
9
+ @end="handleDragEnd"
10
+ >
11
+ <div
12
+ v-for="(block, index) in post.content"
13
+ :key="index"
14
+ class="relative"
15
+
16
+ >
17
+ <div
18
+ @mouseover="showControls = index, showMenu = false"
19
+ class="w-full h-full"
20
+ >
21
+ <component
22
+ :is="ComponentMap[block.type]"
23
+ :index="index"
24
+ :component="block"
25
+ :prop="block"
26
+ :class="block.class"
27
+ :setFocus="block.setFocus"
28
+ content="content"
29
+ @deleteBlock="handleDeleteBlock"
30
+ @addBlock="handleAddBlock"
31
+ @updateBlock="handleUpdateBlock"
32
+
33
+ />
34
+ </div>
35
+
36
+ <transition name="fade">
37
+ <div
38
+ v-if="showControls === index"
39
+ class="pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi"
40
+ @mousedown.prevent="startDragging = true"
41
+ >
42
+ <button @click="showMenu = !showMenu" class="mn-small w-100 i-semi bg-white radius-thin">{{ block.content ? '...' : '+' }}</button>
43
+ <div v-if="showMenu" class="z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded">
44
+ <button @click="handleDeleteBlock(block)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Удалить</button>
45
+ <button @click="handleAddBlock('ImageUpload', '', index)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Добавить изображение</button>
46
+ <button @click="handleAddBlock('H2', '', index)" class="block w-max text-left px-4 py-2 hover:bg-gray-200">Добавить заголовок</button>
47
+ </div>
48
+ </div>
49
+ </transition>
50
+ </div>
51
+ </VueDraggableNext>
52
+ </section>
53
+ </template>
54
+
55
+
56
+ <script setup>
57
+ import Textarea from '../elements/Textarea.vue';
58
+ import H2 from '../elements/H2.vue';
59
+ import Caption from '../elements/Caption.vue';
60
+ import Bullets from '../elements/Bullets.vue';
61
+ import ImageUpload from '../elements/ImageUpload.vue';
62
+
63
+ import { ref, watchEffect, computed, emit } from 'vue';
64
+ import { VueDraggableNext } from 'vue-draggable-next';
65
+
66
+ const props = defineProps(['content']);
67
+ const emits = defineEmits(['update'])
68
+
69
+ let post = ref(null);
70
+ let publics = ref(null);
71
+
72
+ post.value = { content: props.content }
73
+
74
+ const ComponentMap = {
75
+ 'Textarea': Textarea,
76
+ 'H2': H2,
77
+ 'Bullets': Bullets,
78
+ 'Caption': Caption,
79
+ 'ImageUpload': ImageUpload
80
+ };
81
+
82
+ function handleAddBlock(type = 'Textarea', content = '', index, data) {
83
+ console.log('We are adding new block (functuin HandleAddBlock):' + type + content + index + data )
84
+ let blockNew = {
85
+ order: post.value.content.length + 1,
86
+ type: type,
87
+ style: '',
88
+ class: '',
89
+ content: content,
90
+ blocks: [],
91
+ setFocus: true,
92
+ };
93
+
94
+ if (data && data.blocks && Array.isArray(data.blocks)) {
95
+ let newBlocks = data.blocks.map(block => ({
96
+ ...blockNew,
97
+ content: block.content,
98
+
99
+ }));
100
+
101
+ let args = [(data.index || index) + 1, 0].concat(newBlocks);
102
+
103
+ post.value.content.splice.apply(post.value.content, args);
104
+
105
+ const lastBlock = newBlocks[newBlocks.length - 1];
106
+
107
+ console.log('New block is' + lastBlock)
108
+ } else if (index !== undefined) {
109
+ post.value.content.splice(index + 1, 0, blockNew);
110
+ console.log('Latest block is' + blockNew)
111
+ } else {
112
+ console.log('Another block is' + blockNew)
113
+ post.value.content.push(blockNew);
114
+ }
115
+
116
+ showControls.value = null
117
+ emits('update', post.value.content);
118
+ }
119
+
120
+ function handleUpdateBlock(block, update) {
121
+ const index = post.value.content.findIndex(item => item === block);
122
+
123
+ if (index !== -1) {
124
+ post.value.content[index] = { ...post.value.content[index], ...update };
125
+ }
126
+
127
+ emits('update', post.value.content);
128
+ }
129
+
130
+
131
+ function handleDeleteBlock(block) {
132
+ let index = post.value.content.findIndex(b => b === block);
133
+
134
+ if (index !== -1) {
135
+ post.value.content.splice(index, 1);
136
+ }
137
+
138
+ post.value.content[index - 1].setFocus = true
139
+
140
+ emits('update', post.value.content);
141
+ }
142
+
143
+ const showControls = ref(null)
144
+ const startDragging = ref(false)
145
+ const showMenu = ref(false)
146
+
147
+ function handleDragStart() {
148
+ startDragging.value = true
149
+ }
150
+
151
+ function handleDragEnd() {
152
+ startDragging.value = false
153
+ }
154
+
155
+ watchEffect(() => {
156
+ if (post.value && post.value.content.length === 0) {
157
+ handleAddBlock('Textarea', '');
158
+ }
159
+
160
+ emits('update', post.value.content);
161
+ });
162
+ </script>
163
+
164
+
165
+ <style lang="scss">
166
+
167
+ </style>
@@ -74,12 +74,20 @@
74
74
  </span>
75
75
  </div>
76
76
 
77
- <h3
78
- v-if="type !== 'short'"
79
- class="cursor-pointer mn-thin"
80
- >
81
- {{ event.name }}
82
- </h3>
77
+ <div v-if="type !== 'short'" class="cursor-pointer mn-thin flex-nowrap flex w-100">
78
+
79
+ <h3
80
+ v-if="type !== 'short'"
81
+ class=""
82
+ >
83
+ {{ event.name }}
84
+ </h3>
85
+
86
+ <div v-if="event.status === 'draft'" class="pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra">
87
+ {{event.status}}
88
+ </div>
89
+
90
+ </div>
83
91
 
84
92
  <p
85
93
  v-if="type !== 'short'"