@ozdao/prometheus-framework 0.0.85 → 0.0.87
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs +138 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
- package/dist/ButtonFollow-728aab73.mjs +130 -0
- package/dist/CardHeader-ce5a1a75.mjs +96 -0
- package/dist/CardOrganization-58b54995.js +1 -0
- package/dist/CardOrganization-91e79698.mjs +320 -0
- package/dist/CardOrganization-ee5c34ab.js +1 -0
- package/dist/CardOrganization-f70bd169.mjs +202 -0
- package/dist/Comments-63f154a6.js +9 -0
- package/dist/Comments-c092550f.mjs +76 -0
- package/dist/Comments-c5afa4d6.mjs +459 -0
- package/dist/EditProductImages-61ff4321.mjs +236 -0
- package/dist/Feed-8fd41524.js +1 -0
- package/dist/Feed-926cf4f3.mjs +355 -0
- package/dist/Feed-a31c43c2.mjs +423 -0
- package/dist/Feed-ecf37814.mjs +367 -0
- package/dist/IconEdit-736c89be.js +1 -0
- package/dist/IconEdit-e9fd4c6c.mjs +21 -0
- package/dist/PlaceholderUserpic-995da0fc.mjs +28 -0
- package/dist/Popup-0c791801.mjs +76 -0
- package/dist/Popup-105ef2c3.js +1 -0
- package/dist/Popup-82fb2c8a.mjs +76 -0
- package/dist/Product-2f3d592f.mjs +837 -0
- package/dist/Product-2fbf9d99.js +7 -0
- package/dist/Product-6c37ef35.js +7 -0
- package/dist/Product-7087b358.mjs +837 -0
- package/dist/ProductEdit-20709821.mjs +349 -0
- package/dist/ProductEdit-a81d13b9.js +1 -0
- package/dist/ProductEdit-c5067942.mjs +113 -0
- package/dist/ProfileBlogposts-79d5c858.mjs +63 -0
- package/dist/ProfileBlogposts-eca9916c.js +1 -0
- package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
- package/dist/ProfileComments-48f3d4bc.mjs +43 -0
- package/dist/ProfileComments-58094a50.mjs +43 -0
- package/dist/ProfileComments-b919f021.js +1 -0
- package/dist/ProfileEvents-05485e20.js +1 -0
- package/dist/ProfileEvents-20695376.mjs +55 -0
- package/dist/ProfileEvents-5d206e3d.mjs +55 -0
- package/dist/ProfileLikes-2f3a4488.js +1 -0
- package/dist/ProfileLikes-503712ec.mjs +43 -0
- package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
- package/dist/ProfileOrganizations-0b76e38f.js +1 -0
- package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
- package/dist/ProfileOrganizations-3f305f4e.mjs +210 -0
- package/dist/ProfileOrganizations-50fce34e.js +1 -0
- package/dist/Publics-3f277c17.js +1 -0
- package/dist/Publics-49dbeafc.js +1 -0
- package/dist/Publics-9ebffff1.mjs +122 -0
- package/dist/Publics-b0fad2b0.mjs +1926 -0
- package/dist/Tab-58cd105f.mjs +46 -0
- package/dist/Tab-6f0a4909.js +1 -0
- package/dist/UploadImage-441e8526.js +1 -0
- package/dist/UploadImage-d1dbc280.mjs +99 -0
- package/dist/UploadImage-ff8f9a0c.mjs +83 -0
- package/dist/auth-35ef1791.mjs +1502 -0
- package/dist/auth.client.cjs +2 -2
- package/dist/auth.client.js +61 -41
- package/dist/auth.validation-29113f37.mjs +20 -0
- package/dist/categories-d669f3af.mjs +225 -0
- package/dist/community.client.cjs +1 -9
- package/dist/community.client.js +369 -741
- package/dist/community.server.js +16 -4
- package/dist/community.server.mjs +16 -4
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +433 -331
- package/dist/events.server.js +19 -2
- package/dist/events.server.mjs +19 -2
- package/dist/inputs.validation-24ae76b9.js +1 -0
- package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
- package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
- package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
- package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
- package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
- package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
- package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
- package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
- package/dist/modules/icons/entities/IconCommunity.vue.d.ts +2 -0
- package/dist/organizations-1b4c84ee.mjs +121 -0
- package/dist/organizations-af43bda4.js +1 -0
- package/dist/organizations.client-253c8068.mjs +3179 -0
- package/dist/organizations.client-c60d7659.js +3 -0
- package/dist/organizations.client.cjs +1 -3
- package/dist/organizations.client.js +50 -3026
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +245 -208
- package/package.json +1 -1
- package/src/modules/auth/router/auth.js +28 -7
- package/src/modules/community/community.client.js +1 -12
- package/src/modules/community/components/pages/BlogPost.vue +1 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
- package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
- package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
- package/src/modules/constructor/components/sections/Constructor.vue +167 -0
- package/src/modules/events/components/blocks/CardEvent.vue +14 -6
- package/src/modules/events/components/pages/EditEvent.vue +228 -133
- package/src/modules/events/components/sections/Feed.vue +7 -1
- package/src/modules/events/controllers/events.controller.js +9 -0
- package/src/modules/events/controllers/tickets.controller.js +2 -1
- package/src/modules/events/models/event.model.js +10 -0
- package/src/modules/events/store/events.js +15 -19
- package/src/modules/icons/entities/IconCommunity.vue +8 -0
- package/src/modules/organizations/components/blocks/CardOrganization.vue +3 -5
- package/src/modules/organizations/components/sections/Publics.vue +3 -3
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/users/components/pages/Profile.vue +15 -4
- package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
- package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
- /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
@@ -1,146 +1,241 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<article v-if="event" class="pd-thin">
|
3
|
+
<div class="mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex">
|
4
|
+
<UploadImage
|
5
|
+
v-model:photo="event.cover"
|
6
|
+
:uploadPath="'users/' + auth.state.user._id + '/events'"
|
7
|
+
class="h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"
|
8
|
+
/>
|
9
|
+
<h4>Upload Event Cover</h4>
|
6
10
|
</div>
|
7
11
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
12
|
+
<Field
|
13
|
+
v-model:field="event.name"
|
14
|
+
placeholder="Event name"
|
15
|
+
class="mn-thin w-100 bg-grey pd-medium radius-small"
|
16
|
+
/>
|
17
|
+
<Field
|
18
|
+
v-model:field="event.description"
|
19
|
+
type="textfield"
|
20
|
+
placeholder="Enter short description"
|
21
|
+
class="mn-thin w-100 bg-grey pd-medium radius-small"
|
22
|
+
/>
|
23
|
+
|
24
|
+
<h3 class="mn-small">Date</h3>
|
25
|
+
<Field
|
26
|
+
v-model:field="event.date.start"
|
27
|
+
label="Start"
|
28
|
+
type="datetime-local"
|
29
|
+
placeholder="Not specified"
|
30
|
+
class="mn-thin w-100 bg-grey pd-medium radius-small"
|
31
|
+
/>
|
32
|
+
|
33
|
+
<Field
|
34
|
+
v-model:field="event.date.end"
|
35
|
+
label="End"
|
36
|
+
type="datetime-local"
|
37
|
+
placeholder="Not specified"
|
38
|
+
class="mn-thin w-100 bg-grey pd-medium radius-small"
|
39
|
+
/>
|
40
|
+
|
41
|
+
<h3 class="mn-small">Description</h3>
|
42
|
+
<section v-if="event" class="w-100 bg-grey pd-big radius-big">
|
43
|
+
<Constructor
|
44
|
+
:content="event.content"
|
45
|
+
@update="update => event.content = update"
|
46
|
+
/>
|
47
|
+
</section>
|
48
|
+
|
49
|
+
<section v-if="event" class="pd-thin pos-fixed pos-l-0 pos-b-0 w-100 ">
|
50
|
+
<div class="pd-thin radius-big bg-main w-100 flex-nowrap flex">
|
51
|
+
<a v-if="route.params.url" @click="onDelete()" class="mn-r-auto bg-red t-white t-black button">Delete</a>
|
52
|
+
<a @click="onDrafts()" class="mn-l-auto bg-white t-black button">To Drafts</a>
|
53
|
+
<a @click="openPublicationPopup()" class="mn-l-thin bg-black t-white button">Publish</a>
|
54
|
+
</div>
|
55
|
+
</section>
|
56
|
+
|
57
|
+
<Popup
|
58
|
+
title="Добавить участника"
|
59
|
+
@close-popup="closePublicationPopup"
|
60
|
+
:isPopupOpen="isPublicationPopup"
|
61
|
+
>
|
62
|
+
<div class="w-m-66r t-left pd-big bg-white radius-big">
|
63
|
+
<h3 class="mn-small">Final Touches</h3>
|
64
|
+
|
65
|
+
<BlockTags
|
66
|
+
@tags-changed="newTags => event.tags = newTags"
|
67
|
+
:tags="event.tags"
|
68
|
+
/>
|
69
|
+
|
70
|
+
<h5 class="mn-thin">Add to public:</h5>
|
71
|
+
<SelectMulti
|
72
|
+
v-model="selectedOrganization"
|
73
|
+
:options="publics"
|
74
|
+
:multiple="false"
|
75
|
+
:taggable="false"
|
76
|
+
placeholder="Type to search or add tag"
|
77
|
+
label="name"
|
78
|
+
track-by="_id"
|
79
|
+
class="mn-medium bg-grey radius-medium pd-small"
|
80
|
+
/>
|
81
|
+
<h5 v-if="selectedOrganization" class="mn-thin">Options:</h5>
|
82
|
+
<div v-if="selectedOrganization" class="mn-medium br-grey br-2px br-solid pd-small radius-big">
|
83
|
+
<Checkbox
|
84
|
+
:label="'Hide Author'"
|
85
|
+
:radio="event.creator.hidden"
|
86
|
+
@update:radio="updateEvent => event.creator.hidden = updateEvent"
|
87
|
+
name="prices"
|
88
|
+
class="w-100"
|
89
|
+
/>
|
37
90
|
</div>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
addButtonLabel="Add parameter"
|
43
|
-
keyName="name"
|
44
|
-
valueName="value"
|
45
|
-
@add-info="addInfo"
|
46
|
-
@delete-info="deleteInfo"
|
47
|
-
/>
|
48
|
-
<EditParameters
|
49
|
-
:items="products.state.current.localization"
|
50
|
-
title="Localization"
|
51
|
-
emptyMessage="No localizations"
|
52
|
-
addButtonLabel="Add localization"
|
53
|
-
keyName="locale"
|
54
|
-
valueName="text"
|
55
|
-
@add-info="addLocale"
|
56
|
-
@delete-info="deleteLocale"
|
57
|
-
/>
|
58
|
-
|
59
|
-
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div class="">
|
63
|
-
<div class="mn-thin bg-grey pd-medium o-hidden radius-big">
|
64
|
-
<h3 class="mn-semi">Images</h3>
|
65
|
-
<EditProductImages
|
66
|
-
:product="products.state.current"
|
67
|
-
/>
|
68
|
-
</div>
|
69
|
-
</div>
|
70
|
-
|
71
|
-
</div>
|
72
|
-
</div>
|
73
|
-
|
91
|
+
<Button :submit="onSubmit" :callback="redirectTo" class="w-100 bg-black t-white">Publish</Button>
|
92
|
+
</div>
|
93
|
+
</Popup>
|
94
|
+
</article>
|
74
95
|
</template>
|
75
96
|
|
76
97
|
<script setup>
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
98
|
+
import Textarea from '@pf/src/modules/constructor/components/elements/Textarea.vue';
|
99
|
+
import Constructor from '@pf/src/modules/constructor/components/sections/Constructor.vue';
|
100
|
+
|
101
|
+
import Popup from '@pf/src/components/Popup/Popup.vue';
|
102
|
+
import Field from '@pf/src/components/Field/Field.vue'
|
103
|
+
import BlockTags from '@pf/src/components/FieldTags/BlockTags.vue';
|
104
|
+
import Checkbox from '@pf/src/components/Checkbox/Checkbox.vue';
|
105
|
+
import SelectMulti from '@pf/src/components/SelectMulti/SelectMulti.vue';
|
106
|
+
import UploadImage from '@pf/src/components/UploadImage/UploadImage.vue';
|
107
|
+
import Button from '@pf/src/components/Button/Button.vue';
|
108
|
+
|
109
|
+
import { ref, onMounted } from 'vue';
|
110
|
+
import { useRoute, useRouter } from 'vue-router';
|
111
|
+
|
112
|
+
import * as events from '@pf/src/modules/events/store/events.js';
|
113
|
+
import * as auth from '@pf/src/modules/auth/store/auth';
|
114
|
+
import * as organizations from '@pf/src/modules/organizations/store/organizations';
|
115
|
+
|
116
|
+
const route = useRoute();
|
117
|
+
const router = useRouter();
|
118
|
+
|
119
|
+
let event = ref(null);
|
120
|
+
let publics = ref(null);
|
121
|
+
|
122
|
+
const selectedTags = ref([]);
|
123
|
+
const selectedOrganization = ref(null);
|
124
|
+
|
125
|
+
onMounted(async () =>{
|
95
126
|
|
96
|
-
|
97
|
-
|
98
|
-
|
127
|
+
if (route.params.url) {
|
128
|
+
const data = await events.read({ user: auth.state.user._id, url: route.params.url });
|
129
|
+
event.value = data.pop();
|
130
|
+
} else {
|
131
|
+
events.clean();
|
132
|
+
event.value = events.state.current;
|
133
|
+
}
|
134
|
+
|
135
|
+
if (!event.value.owner) event.value.owner = {
|
136
|
+
target: auth.state.user._id,
|
137
|
+
type: 'user'
|
138
|
+
}
|
139
|
+
|
140
|
+
if (!event.value.creator) event.value.creator = {
|
141
|
+
target: auth.state.user._id,
|
142
|
+
type: 'user',
|
143
|
+
hidden: false
|
144
|
+
}
|
145
|
+
|
146
|
+
if (event.value.owner.type === 'organization') selectedOrganization.value = {
|
147
|
+
_id: event.value.owner.target._id,
|
148
|
+
name: event.value.owner.target.profile.name,
|
149
|
+
photo: event.value.owner.target.profile.photo
|
150
|
+
}
|
151
|
+
|
152
|
+
const dataPublics = await organizations.actions.read({
|
153
|
+
user: auth.state.user._id,
|
154
|
+
postable: auth.state.user._id
|
155
|
+
})
|
156
|
+
|
157
|
+
publics.value = dataPublics.map(publicItem => ({
|
158
|
+
name: publicItem.profile.name,
|
159
|
+
_id: publicItem._id,
|
160
|
+
photo: publicItem.profile.photo
|
161
|
+
}));
|
162
|
+
})
|
163
|
+
|
164
|
+
const isPublicationPopup = ref(false)
|
165
|
+
|
166
|
+
function openPublicationPopup() {
|
167
|
+
isPublicationPopup.value = true;
|
168
|
+
}
|
169
|
+
function closePublicationPopup() {
|
170
|
+
isPublicationPopup.value = false;
|
171
|
+
}
|
172
|
+
|
173
|
+
function onDrafts() {
|
174
|
+
|
175
|
+
if (selectedTags.value.length > 0) selectedTags.value.map(tag => (tag.text))
|
176
|
+
|
177
|
+
event.value.status = "draft"
|
178
|
+
|
179
|
+
if (route.params.url) {
|
180
|
+
events.update(event.value)
|
181
|
+
.then(response => {
|
182
|
+
router.push({ name: 'Event', params: { url: response.url } });
|
183
|
+
})
|
184
|
+
.catch(error => {
|
185
|
+
console.error(error);
|
186
|
+
})
|
187
|
+
} else {
|
188
|
+
events.create(event.value)
|
189
|
+
.then(response => {
|
190
|
+
router.push({ name: 'Event', params: { url: response.url } });
|
191
|
+
})
|
192
|
+
.catch(error => {
|
193
|
+
console.error(error);
|
194
|
+
})
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
function onDelete() {
|
199
|
+
if (confirm('Are you sure you want to delete this event?')) {
|
200
|
+
events.delete(event.value._id)
|
201
|
+
.then(response => {
|
202
|
+
router.push({ name: 'Drafts' });
|
203
|
+
})
|
204
|
+
.catch(error => {
|
205
|
+
console.error(error);
|
206
|
+
})
|
207
|
+
}
|
208
|
+
}
|
209
|
+
|
210
|
+
function onSubmit() {
|
211
|
+
|
212
|
+
if (selectedOrganization.value) event.value.owner = {
|
213
|
+
target: selectedOrganization.value._id,
|
214
|
+
type: 'organization'
|
215
|
+
}
|
99
216
|
|
100
|
-
|
101
|
-
|
217
|
+
if (!selectedOrganization.value) event.value.creator.hidden = false
|
218
|
+
if (!selectedOrganization.value) event.value.organization = event.value.creator
|
102
219
|
|
103
|
-
|
104
|
-
await categories.actions.fetchCategories()
|
220
|
+
event.value.status = "published"
|
105
221
|
|
106
|
-
|
107
|
-
|
222
|
+
console.log(event.value)
|
223
|
+
if (route.params.url) {
|
224
|
+
events.update(event.value)
|
225
|
+
.then(response => {
|
226
|
+
router.push({ name: 'Blogevent', params: { url: response.url } });
|
227
|
+
})
|
228
|
+
.catch(error => {
|
229
|
+
console.log(error);
|
230
|
+
});
|
108
231
|
} else {
|
109
|
-
|
232
|
+
events.create(event.value)
|
233
|
+
.then(response => {
|
234
|
+
router.push({ name: 'Blogevent', params: { url: response.url } });
|
235
|
+
})
|
236
|
+
.catch(error => {
|
237
|
+
console.log(error);
|
238
|
+
});
|
110
239
|
}
|
111
|
-
|
112
|
-
|
113
|
-
products.state.current.information.push({name: '', value: ''});
|
114
|
-
}
|
115
|
-
|
116
|
-
function deleteInfo(index) {
|
117
|
-
products.state.current.information.splice(index, 1);
|
118
|
-
}
|
119
|
-
|
120
|
-
function addLocale() {
|
121
|
-
products.state.current.localization.push({locale: '', text: ''});
|
122
|
-
}
|
123
|
-
|
124
|
-
function deleteLocale(index) {
|
125
|
-
products.state.current.localization.splice(index, 1);
|
126
|
-
}
|
127
|
-
|
128
|
-
function onSubmit() {
|
129
|
-
if (route.params.product) {
|
130
|
-
products.actions.update(route.params.product, products.state.current)
|
131
|
-
} else {
|
132
|
-
products.actions.create(route.params._id, products.state.current)
|
133
|
-
}
|
134
|
-
}
|
135
|
-
|
136
|
-
function redirectTo () {
|
137
|
-
router.push({name: 'ProductEdit', params: { _id: route.params._id, product: products.state.current._id } })
|
138
|
-
}
|
139
|
-
</script>
|
140
|
-
|
141
|
-
<style lang="scss">
|
142
|
-
.main-photo {
|
143
|
-
max-width: 50%;
|
144
|
-
img { width: 100%; }
|
145
|
-
}
|
146
|
-
</style>
|
240
|
+
}
|
241
|
+
</script>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<template>
|
1
|
+
f<template>
|
2
2
|
<section class="feed">
|
3
3
|
<TransitionGroup tag="ul" name="fade" class="o-hidden bg-grey radius-big">
|
4
4
|
<SkeletonEvent
|
@@ -68,6 +68,10 @@
|
|
68
68
|
type: String,
|
69
69
|
default: null
|
70
70
|
},
|
71
|
+
creator: {
|
72
|
+
type: String,
|
73
|
+
default: null
|
74
|
+
},
|
71
75
|
user: {
|
72
76
|
type: [String, Number],
|
73
77
|
default: null
|
@@ -107,6 +111,7 @@
|
|
107
111
|
category: props.category,
|
108
112
|
sortOrder: props.sortOrder,
|
109
113
|
participant: props.participant,
|
114
|
+
creator: props.creator,
|
110
115
|
user: props.user,
|
111
116
|
date: props.selectedDate,
|
112
117
|
owner: props.owner,
|
@@ -136,6 +141,7 @@
|
|
136
141
|
sortOrder: props.sortOrder,
|
137
142
|
user: props.user,
|
138
143
|
owner: props.owner,
|
144
|
+
creator: props.creator,
|
139
145
|
date: props.selectedDate,
|
140
146
|
organization: props.organization,
|
141
147
|
period: props.period,
|
@@ -107,6 +107,7 @@ const middlewareFactory = (db) => {
|
|
107
107
|
...(dateConditions.length > 0 ? [{ $and: dateConditions }] : []),
|
108
108
|
...(req.query.url ? [{ url: req.query.url }] : []),
|
109
109
|
...(req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : []),
|
110
|
+
...(req.query.creator ? [{ "creator.target": new ObjectId(req.query.creator) }] : []),
|
110
111
|
];
|
111
112
|
|
112
113
|
const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
|
@@ -219,6 +220,7 @@ const middlewareFactory = (db) => {
|
|
219
220
|
url: 1,
|
220
221
|
cover: 1,
|
221
222
|
name: 1,
|
223
|
+
status: 1,
|
222
224
|
description: 1,
|
223
225
|
content: 1,
|
224
226
|
owner: 1,
|
@@ -275,12 +277,18 @@ const middlewareFactory = (db) => {
|
|
275
277
|
|
276
278
|
const create = async (req, res) => {
|
277
279
|
try {
|
280
|
+
|
281
|
+
delete req.body._id;
|
282
|
+
req.body.url = req.body.name.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '');
|
283
|
+
|
278
284
|
const event = await Event.create(req.body);
|
285
|
+
|
279
286
|
if (!event) {
|
280
287
|
return res.status(404).send({ message: "Event is not created." });
|
281
288
|
}
|
282
289
|
res.status(200).send(event);
|
283
290
|
} catch (err) {
|
291
|
+
console.log(err)
|
284
292
|
return res.status(500).send({ message: err.message });
|
285
293
|
}
|
286
294
|
};
|
@@ -305,6 +313,7 @@ const middlewareFactory = (db) => {
|
|
305
313
|
}
|
306
314
|
res.status(200).send(event);
|
307
315
|
} catch (err) {
|
316
|
+
console.log(err)
|
308
317
|
return res.status(500).send({ message: err.message });
|
309
318
|
}
|
310
319
|
};
|
@@ -70,9 +70,10 @@ const controllerFactory = (db) => {
|
|
70
70
|
return res.status(404).send({ errorCode: 'TICKET_NOT_FOUND' });
|
71
71
|
}
|
72
72
|
|
73
|
-
await ticket.
|
73
|
+
await Ticket.deleteOne({ _id: ticket._id });
|
74
74
|
res.status(200).send(ticket);
|
75
75
|
} catch (error) {
|
76
|
+
console.log(error)
|
76
77
|
res.status(500).send({ errorCode: 'SERVER_ERROR' });
|
77
78
|
}
|
78
79
|
};
|
@@ -11,6 +11,12 @@ module.exports = (mongoose) => {
|
|
11
11
|
type: String,
|
12
12
|
required: true
|
13
13
|
},
|
14
|
+
status: {
|
15
|
+
type: String,
|
16
|
+
enum: ['draft','published','removed'],
|
17
|
+
default: 'draft',
|
18
|
+
required: true,
|
19
|
+
},
|
14
20
|
description: {
|
15
21
|
type: String,
|
16
22
|
required: true
|
@@ -45,6 +51,10 @@ module.exports = (mongoose) => {
|
|
45
51
|
},
|
46
52
|
},
|
47
53
|
creator: {
|
54
|
+
hidden: {
|
55
|
+
type: Boolean,
|
56
|
+
required: true
|
57
|
+
},
|
48
58
|
type: {
|
49
59
|
type: String,
|
50
60
|
required: true
|
@@ -27,12 +27,15 @@ const state = reactive({
|
|
27
27
|
},
|
28
28
|
current: {
|
29
29
|
_id: "",
|
30
|
+
cover: "",
|
30
31
|
url: "",
|
31
32
|
status: "",
|
32
33
|
name: "",
|
33
34
|
tags: [],
|
34
|
-
|
35
|
-
|
35
|
+
date: {
|
36
|
+
start: null,
|
37
|
+
false: null
|
38
|
+
},
|
36
39
|
views: 0,
|
37
40
|
content: [],
|
38
41
|
}
|
@@ -77,6 +80,10 @@ async function read(options = {}) {
|
|
77
80
|
if (options.owner) {
|
78
81
|
options.params.owner = options.owner;
|
79
82
|
}
|
83
|
+
// Creator
|
84
|
+
if (options.creator) {
|
85
|
+
options.params.creator = options.creator;
|
86
|
+
}
|
80
87
|
// User
|
81
88
|
if (options.user) {
|
82
89
|
options.params.user = options.user;
|
@@ -156,30 +163,20 @@ function set(eventData, property) {
|
|
156
163
|
function clean () {
|
157
164
|
state.current = {
|
158
165
|
_id: "",
|
166
|
+
cover: "",
|
159
167
|
url: "",
|
160
168
|
status: "",
|
161
169
|
name: "",
|
162
170
|
tags: [],
|
163
|
-
|
164
|
-
|
165
|
-
|
171
|
+
date: {
|
172
|
+
start: null,
|
173
|
+
false: null
|
174
|
+
},
|
166
175
|
views: 0,
|
167
176
|
content: []
|
168
177
|
}
|
169
178
|
}
|
170
179
|
|
171
|
-
// Actions
|
172
|
-
function blockAdd (block) {
|
173
|
-
const blockNew = {
|
174
|
-
order: state.project.content.length + 1,
|
175
|
-
type: block.type,
|
176
|
-
data: block.data,
|
177
|
-
class: block.class,
|
178
|
-
content: block.content
|
179
|
-
}
|
180
|
-
state.project.content.push(blockNew)
|
181
|
-
}
|
182
|
-
|
183
180
|
const history = []
|
184
181
|
history.push(state) // push initial state
|
185
182
|
|
@@ -192,8 +189,7 @@ export {
|
|
192
189
|
read,
|
193
190
|
create,
|
194
191
|
update,
|
192
|
+
remove,
|
195
193
|
set,
|
196
194
|
clean,
|
197
|
-
remove,
|
198
|
-
blockAdd
|
199
195
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<template>
|
2
|
+
<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path d="M28.2899 50C24.4282 50.007 20.6332 48.9927 17.2899 47.06L12.5299 49.17C11.6317 49.567 10.6307 49.6695 9.67068 49.4627C8.71061 49.2558 7.84068 48.7503 7.1856 48.0186C6.53051 47.2869 6.12391 46.3666 6.02409 45.3896C5.92426 44.4126 6.13634 43.4291 6.62991 42.58L8.96991 38.58C6.65145 34.3531 5.78562 29.4816 6.50556 24.7147C7.22549 19.9478 9.49132 15.5493 12.9546 12.1956C16.418 8.84187 20.887 6.71863 25.6747 6.15233C30.4623 5.58604 35.3034 6.60805 39.4536 9.06121C43.6037 11.5144 46.8332 15.2629 48.6454 19.7303C50.4576 24.1977 50.7522 29.1367 49.4839 33.7879C48.2155 38.4391 45.4545 42.5448 41.6254 45.4739C37.7962 48.403 33.1109 49.9932 28.2899 50ZM17.4799 42.81C17.8631 42.811 18.238 42.9221 18.5599 43.13C22.2995 45.5441 26.7982 46.4939 31.1945 45.7975C35.5908 45.1011 39.5757 42.8075 42.3861 39.3558C45.1966 35.9041 46.6349 31.537 46.4258 27.0908C46.2167 22.6446 44.3748 18.4318 41.2529 15.2591C38.1309 12.0864 33.9483 10.1769 29.5061 9.89616C25.0638 9.61544 20.6741 10.9833 17.1776 13.7377C13.6811 16.4921 11.3235 20.4396 10.5563 24.8241C9.78918 29.2086 10.6664 33.722 13.0199 37.5C13.2068 37.8111 13.3055 38.1671 13.3055 38.53C13.3055 38.8929 13.2068 39.2489 13.0199 39.56L10.0899 44.56C10.0202 44.6791 9.99023 44.8174 10.0043 44.9547C10.0184 45.0919 10.0759 45.2212 10.1683 45.3237C10.2608 45.4262 10.3834 45.4966 10.5186 45.5247C10.6537 45.5528 10.7943 45.5371 10.9199 45.48L16.6699 43C16.9236 42.8806 17.1996 42.8159 17.4799 42.81Z" fill="white"/>
|
4
|
+
<path d="M28.2898 30C27.7594 30 27.2507 29.7893 26.8756 29.4142C26.5005 29.0391 26.2898 28.5304 26.2898 28C26.2898 27.4696 26.5005 26.9609 26.8756 26.5858C27.2507 26.2107 27.7594 26 28.2898 26C28.8202 26 29.3289 26.2107 29.704 26.5858C30.0791 26.9609 30.2898 27.4696 30.2898 28C30.2898 28.5304 30.0791 29.0391 29.704 29.4142C29.3289 29.7893 28.8202 30 28.2898 30Z" fill="white"/>
|
5
|
+
<path d="M20.2898 30C19.7594 30 19.2507 29.7893 18.8756 29.4142C18.5005 29.0391 18.2898 28.5304 18.2898 28C18.2898 27.4696 18.5005 26.9609 18.8756 26.5858C19.2507 26.2107 19.7594 26 20.2898 26C20.8202 26 21.3289 26.2107 21.704 26.5858C22.0791 26.9609 22.2898 27.4696 22.2898 28C22.2898 28.5304 22.0791 29.0391 21.704 29.4142C21.3289 29.7893 20.8202 30 20.2898 30Z" fill="white"/>
|
6
|
+
<path d="M36.2898 30C35.7594 30 35.2507 29.7893 34.8756 29.4142C34.5005 29.0391 34.2898 28.5304 34.2898 28C34.2898 27.4696 34.5005 26.9609 34.8756 26.5858C35.2507 26.2107 35.7594 26 36.2898 26C36.8202 26 37.3289 26.2107 37.704 26.5858C38.0791 26.9609 38.2898 27.4696 38.2898 28C38.2898 28.5304 38.0791 29.0391 37.704 29.4142C37.3289 29.7893 36.8202 30 36.2898 30Z" fill="white"/>
|
7
|
+
</svg>
|
8
|
+
</template>
|
@@ -3,11 +3,11 @@
|
|
3
3
|
class="bg-grey radius-big o-hidden"
|
4
4
|
@click="$router.push({name: 'Organization', params: {_id: organization._id}})"
|
5
5
|
>
|
6
|
-
<div class="pd-medium
|
6
|
+
<div class="pd-medium flex-v-center flex-nowrap flex">
|
7
7
|
<img
|
8
8
|
v-if="organization.profile.photo && organization.profile.photo.length > 0"
|
9
9
|
:src="organization.profile.photo"
|
10
|
-
class="h-4r w-4r radius-extra"
|
10
|
+
class="h-4r w-4r radius-extra bg-main"
|
11
11
|
/>
|
12
12
|
|
13
13
|
<svg v-else class="h-4r w-4r radius-extra" width="42" height="42" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<div class="mn-l-small">
|
19
19
|
<p class="h3 mn-r-semi mn-thin">{{organization.profile.name}}</p>
|
20
20
|
|
21
|
-
<div v-if="organization.
|
21
|
+
<div v-if="organization.ratingS" class="w-max star-container flex-v-center flex">
|
22
22
|
<span class="mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small">
|
23
23
|
{{organization.types[0]}}
|
24
24
|
</span>
|
@@ -50,8 +50,6 @@
|
|
50
50
|
</div>
|
51
51
|
</div>
|
52
52
|
|
53
|
-
|
54
|
-
|
55
53
|
<div v-if="organization.products.length > 0" class="pd-medium">
|
56
54
|
<div class="mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium">
|
57
55
|
<p class="t-black p-medium t-semi">
|
@@ -7,7 +7,7 @@
|
|
7
7
|
class="radius-big bg-grey pd-medium"
|
8
8
|
/>
|
9
9
|
|
10
|
-
<div v-else class="w-max flex-nowrap flex">
|
10
|
+
<div v-else class="w-max gap-thin flex-nowrap flex">
|
11
11
|
<CardOrganization
|
12
12
|
v-if="publics"
|
13
13
|
v-for="(organization,index) in publics"
|
@@ -15,8 +15,7 @@
|
|
15
15
|
:organization="organization"
|
16
16
|
:user="auth.state.user"
|
17
17
|
@updateMembership="handleMembershipUpdate"
|
18
|
-
class="flex-child-
|
19
|
-
:class="{'mn-r-small': index !== publics.length - 1}"
|
18
|
+
class="flex-child-1 flex-child w-100"
|
20
19
|
/>
|
21
20
|
</div>
|
22
21
|
</div>
|
@@ -26,6 +25,7 @@
|
|
26
25
|
import { onMounted, ref } from 'vue'
|
27
26
|
import CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'
|
28
27
|
import EmptyState from '@pf/src/components/EmptyState/EmptyState.vue'
|
28
|
+
|
29
29
|
import * as auth from '@pf/src/modules/auth/store/auth'
|
30
30
|
import * as organization from '@pf/src/modules/organizations/store/organizations'
|
31
31
|
import * as memberships from '@pf/src/modules/organizations/store/memberships'
|
@@ -53,7 +53,7 @@ const controllerFactory = (db) => {
|
|
53
53
|
...(req.query.member ? [{"memberships.user": new ObjectId(req.query.member), "memberships.role": { $ne: 'subscriber' } } ] : [] ),
|
54
54
|
...(req.query.subscriber ? [{"memberships.user": new ObjectId(req.query.subscriber), "memberships.role": 'subscriber'} ] : [] ),
|
55
55
|
...(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' } } ] } ] } ] : [] ),
|
56
|
-
...(req.query.types ? [{ types: { $in: req.query.types
|
56
|
+
...(req.query.types ? [{ types: { $in: req.query.types } }] : []), // Если req.query.types - строка
|
57
57
|
// to remove
|
58
58
|
...(req.query.onlyuser ? [{ "memberships.user": new ObjectId(req.query.onlyuser) }] : []),
|
59
59
|
...(categories.length > 0 ? [{ "products.category": { $in: categories } }] : []),
|
@@ -7,7 +7,6 @@ import Organizations from './components/pages/Organizations.vue';
|
|
7
7
|
import DepartmentEdit from './components/pages/DepartmentEdit.vue';
|
8
8
|
|
9
9
|
import CardOrganization from './components/blocks/CardOrganization.vue';
|
10
|
-
import CardOrganizationSocial from './components/blocks/CardOrganizationSocial.vue';
|
11
10
|
import EditArray from './components/blocks/EditArray.vue';
|
12
11
|
import User from './components/blocks/User.vue';
|
13
12
|
import Unit from './components/blocks/Unit.vue';
|
@@ -50,7 +49,6 @@ export {
|
|
50
49
|
Organizations,
|
51
50
|
DepartmentEdit,
|
52
51
|
CardOrganization,
|
53
|
-
CardOrganizationSocial,
|
54
52
|
EditArray,
|
55
53
|
User,
|
56
54
|
Unit,
|