@ozdao/prometheus-framework 0.2.93 → 0.2.95
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +15 -14
- package/dist/auth.server.mjs +15 -14
- package/dist/main-BJvlNekm.mjs +13631 -0
- package/dist/main-pGo7JpSP.js +92 -0
- package/dist/orders.server.js +31 -27
- package/dist/orders.server.mjs +31 -27
- package/dist/organizations.server.js +31 -10
- package/dist/organizations.server.mjs +31 -10
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +12 -12
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
- package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +58 -58
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +49 -48
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +113 -110
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +20 -20
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +47 -47
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +143 -131
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
- package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +155 -187
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +18 -18
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +66 -63
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-B2xhKZNK.js +1 -0
- package/dist/web-DTzbVshr.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Block/Block.vue +1 -1
- package/src/modules/auth/controllers/auth.controller.js +19 -16
- package/src/modules/auth/router/auth.js +4 -0
- package/src/modules/backoffice/router/backoffice.js +3 -3
- package/src/modules/chats/routes/chats.routes.js +1 -2
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
- package/src/modules/icons/navigation/IconCross.vue +11 -7
- package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
- package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +7 -3
- package/src/modules/orders/components/pages/Orders.vue +1 -1
- package/src/modules/orders/controllers/orders.controller.js +25 -25
- package/src/modules/orders/models/order.model.js +1 -1
- package/src/modules/orders/routes/orders.routes.js +6 -0
- package/src/modules/orders/store/models/order.js +33 -0
- package/src/modules/orders/store/orders.js +7 -28
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
- package/src/modules/organizations/components/pages/Members.vue +50 -38
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/controllers/invites.controller.js +2 -0
- package/src/modules/organizations/controllers/memberships.controller.js +35 -11
- package/src/modules/organizations/models/invite.model.js +4 -0
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/organizations/router/members.router.js +1 -1
- package/src/modules/organizations/store/departments.js +0 -1
- package/src/modules/organizations/store/memberships.js +1 -8
- package/src/modules/products/components/pages/ProductEdit.vue +39 -33
- package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
- package/src/modules/users/components/blocks/CardUser.vue +9 -5
- package/src/modules/users/components/pages/Profile.vue +5 -3
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js
CHANGED
@@ -6,49 +6,47 @@ import "../../../globals/localization/vue-i18n.js";
|
|
6
6
|
import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
|
7
7
|
import B from "../../../../components/UploadImage/UploadImage.vue.js";
|
8
8
|
import "../../../../components/Tab/Tab.vue.js";
|
9
|
-
import
|
9
|
+
import k from "../../../../components/Field/Field.vue.js";
|
10
10
|
import "../../../../components/Select/Select.vue2.js";
|
11
11
|
import i from "../../../../components/Checkbox/Checkbox.vue.js";
|
12
12
|
import "../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
|
13
13
|
import "../../../../components/Address/Address.vue.js";
|
14
14
|
import "../../../../components/Loader/Loader.vue.js";
|
15
15
|
import "../../../../components/LocationMarker/LocationMarker.vue.js";
|
16
|
-
import
|
16
|
+
import x from "../../../../components/Button/Button.vue.js";
|
17
17
|
import F from "../../../../components/Popup/Popup.vue.js";
|
18
18
|
import U from "../../../../components/Block/Block.vue.js";
|
19
19
|
import H from "../../../../components/Feed/Feed.vue.js";
|
20
|
+
import L from "../../../icons/navigation/IconDelete.vue.js";
|
20
21
|
import "../blocks/EditArray.vue2.js";
|
21
22
|
import "../blocks/DepartmentSub.vue2.js";
|
22
|
-
import "../../../../components/SelectMulti/SelectMulti.vue2.js";
|
23
23
|
import N from "../../../users/components/blocks/CardUser.vue.js";
|
24
|
-
import { actions as
|
25
|
-
import "../../../middlewares/client/inputs.validation.js";
|
26
|
-
import "../blocks/DepartmentMemberModify.vue2.js";
|
27
|
-
import { actions as C } from "../../../globals/store/globals.js";
|
24
|
+
import { actions as $ } from "../../../globals/store/globals.js";
|
28
25
|
import { state as e, actions as f } from "../../store/departments.js";
|
29
|
-
|
26
|
+
import { actions as j, state as q } from "../../store/memberships.js";
|
27
|
+
const G = { class: "for-transition pd-thin w-100" }, I = { class: "mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big" }, J = {
|
30
28
|
key: 0,
|
31
29
|
class: "mn-r-auto"
|
32
|
-
},
|
30
|
+
}, K = {
|
33
31
|
key: 1,
|
34
32
|
class: "mn-r-auto"
|
35
|
-
},
|
33
|
+
}, Q = { class: "flex-nowrap flex gap-thin pd-thin" }, W = { class: "cols-2-fit-content" }, X = { class: "w-100 flex-child-grow-1 flex-child" }, Y = { class: "cols-2 gap-thin" }, Z = { class: "bg-grey pd-medium o-hidden radius-big" }, ee = /* @__PURE__ */ r("h3", { class: "mn-b-semi" }, "Department Settings", -1), te = /* @__PURE__ */ r("p", { class: "p-medium mn-b-small" }, "Please settings for your department:", -1), ae = { class: "cols-1 gap-thin" }, se = { class: "bg-grey pd-medium o-hidden radius-big" }, re = /* @__PURE__ */ r("h3", { class: "mn-b-semi" }, "Acessess", -1), de = /* @__PURE__ */ r("p", { class: "p-medium mn-b-small" }, "Please select organization accesses for user in department:", -1), oe = { class: "cols-1 gap-thin" }, ie = /* @__PURE__ */ r("h4", null, "Products", -1), ne = /* @__PURE__ */ r("h4", null, "Orders", -1), le = /* @__PURE__ */ r("h4", null, "Departments", -1), Ve = {
|
36
34
|
__name: "DepartmentEdit",
|
37
35
|
setup(me) {
|
38
|
-
const
|
36
|
+
const C = T(), d = V();
|
39
37
|
async function O() {
|
40
|
-
p(
|
38
|
+
p(q.memberships), d.params.department && await f.readOne(d.params.department);
|
41
39
|
}
|
42
40
|
O();
|
43
|
-
const h = p(!1),
|
44
|
-
function
|
41
|
+
const h = p(!1), M = p(null);
|
42
|
+
function E(l) {
|
45
43
|
h.value = !0;
|
46
44
|
}
|
47
|
-
function
|
48
|
-
h.value = !1,
|
45
|
+
function g() {
|
46
|
+
h.value = !1, M.value = null;
|
49
47
|
}
|
50
48
|
p(!1), p(null);
|
51
|
-
async function
|
49
|
+
async function z() {
|
52
50
|
d.params.department && await f.update(
|
53
51
|
d.params._id,
|
54
52
|
e.department
|
@@ -57,25 +55,25 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
57
55
|
e.department
|
58
56
|
);
|
59
57
|
}
|
60
|
-
function
|
61
|
-
|
58
|
+
function A() {
|
59
|
+
C.push({ name: "Organization Members", params: { _id: d.params._id } });
|
62
60
|
}
|
63
|
-
async function
|
61
|
+
async function R() {
|
64
62
|
confirm("Are you sure you want to delete this department?") && await f.delete(
|
65
63
|
d.params._id,
|
66
64
|
e.department
|
67
65
|
);
|
68
66
|
}
|
69
67
|
function S(l) {
|
70
|
-
confirm("Are you sure you want to remove this member?") &&
|
68
|
+
confirm("Are you sure you want to remove this member?") && $.delete(e.department.members, { _id: l.user._id });
|
71
69
|
}
|
72
|
-
return (l, a) => (n(), c("div",
|
73
|
-
r("header",
|
74
|
-
b(d).params.department ? (n(), c("h1",
|
75
|
-
r("section",
|
76
|
-
b(d).params.department ? (n(), u(
|
70
|
+
return (l, a) => (n(), c("div", G, [
|
71
|
+
r("header", I, [
|
72
|
+
b(d).params.department ? (n(), c("h1", J, "Edit Department")) : (n(), c("h1", K, "Create Department")),
|
73
|
+
r("section", Q, [
|
74
|
+
b(d).params.department ? (n(), u(x, {
|
77
75
|
key: 0,
|
78
|
-
submit:
|
76
|
+
submit: R,
|
79
77
|
callback: l.redirectToDash,
|
80
78
|
class: "bg-red"
|
81
79
|
}, {
|
@@ -84,9 +82,9 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
84
82
|
]),
|
85
83
|
_: 1
|
86
84
|
}, 8, ["callback"])) : v("", !0),
|
87
|
-
s(
|
88
|
-
submit:
|
89
|
-
callback:
|
85
|
+
s(x, {
|
86
|
+
submit: z,
|
87
|
+
callback: A,
|
90
88
|
class: "bg-main"
|
91
89
|
}, {
|
92
90
|
default: m(() => [
|
@@ -102,15 +100,15 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
102
100
|
class: "mn-b-thin"
|
103
101
|
}, {
|
104
102
|
default: m(() => [
|
105
|
-
r("div",
|
103
|
+
r("div", W, [
|
106
104
|
s(B, {
|
107
105
|
photo: e.department.profile.photo,
|
108
106
|
"onUpdate:photo": a[0] || (a[0] = (t) => e.department.profile.photo = t),
|
109
107
|
uploadPath: "organizations/" + e.department.name + "/avatars",
|
110
108
|
class: "w-8r aspect-1x1 o-hidden mn-r-small radius-extra"
|
111
109
|
}, null, 8, ["photo", "uploadPath"]),
|
112
|
-
r("div",
|
113
|
-
s(
|
110
|
+
r("div", X, [
|
111
|
+
s(k, {
|
114
112
|
field: e.department.profile.name,
|
115
113
|
"onUpdate:field": a[1] || (a[1] = (t) => e.department.profile.name = t),
|
116
114
|
label: "Name",
|
@@ -118,7 +116,7 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
118
116
|
class: "mn-b-small bg-white radius-small pd-medium",
|
119
117
|
validation: l.organizationName
|
120
118
|
}, null, 8, ["field", "validation"]),
|
121
|
-
s(
|
119
|
+
s(k, {
|
122
120
|
field: e.department.profile.description,
|
123
121
|
"onUpdate:field": a[2] || (a[2] = (t) => e.department.profile.description = t),
|
124
122
|
label: "Description",
|
@@ -136,7 +134,7 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
136
134
|
placeholder: "No members added yet",
|
137
135
|
actions: [{
|
138
136
|
label: "+",
|
139
|
-
function: () =>
|
137
|
+
function: () => E()
|
140
138
|
}],
|
141
139
|
class: "cols-1 gap-thin mn-b-thin"
|
142
140
|
}, {
|
@@ -149,7 +147,10 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
149
147
|
name: t.user.profile.name || t.user.phone || t.user.email || t.user._id,
|
150
148
|
position: t.position,
|
151
149
|
action: {
|
152
|
-
label:
|
150
|
+
label: {
|
151
|
+
is: L,
|
152
|
+
props: { class: "i-medium", fill: "rgb(var(--white)" }
|
153
|
+
},
|
153
154
|
method: () => S(t)
|
154
155
|
}
|
155
156
|
}, null, 8, ["user", "photo", "name", "position", "action"]))), 128))
|
@@ -158,7 +159,7 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
158
159
|
}, 8, ["actions"]),
|
159
160
|
s(F, {
|
160
161
|
title: "Add member",
|
161
|
-
onClosePopup:
|
162
|
+
onClosePopup: g,
|
162
163
|
isPopupOpen: h.value,
|
163
164
|
class: "bg-white w-max-30r radius-big pd-big"
|
164
165
|
}, {
|
@@ -175,7 +176,7 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
175
176
|
}
|
176
177
|
},
|
177
178
|
store: {
|
178
|
-
read: (t) =>
|
179
|
+
read: (t) => j.read(t),
|
179
180
|
state: null
|
180
181
|
},
|
181
182
|
options: {
|
@@ -187,14 +188,14 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
187
188
|
items: t
|
188
189
|
}) => [
|
189
190
|
(n(!0), c(D, null, P(t, (o, pe) => {
|
190
|
-
var
|
191
|
+
var _, w;
|
191
192
|
return n(), u(N, {
|
192
193
|
key: o._id,
|
193
194
|
user: o.user,
|
194
|
-
photo: (
|
195
|
+
photo: (_ = o.user.profile) == null ? void 0 : _.photo,
|
195
196
|
name: ((w = o.user.profile) == null ? void 0 : w.name) || o.user.phone || o.user.email,
|
196
197
|
onClick: () => {
|
197
|
-
|
198
|
+
$.add(e.department.members, { _id: o.user._id, user: o.user, position: "Member" }), g();
|
198
199
|
},
|
199
200
|
class: "bg-white pd-thin radius-medium w-100 mn-b-thin"
|
200
201
|
}, null, 8, ["user", "photo", "name", "onClick"]);
|
@@ -205,12 +206,11 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
205
206
|
]),
|
206
207
|
_: 1
|
207
208
|
}, 8, ["isPopupOpen"]),
|
208
|
-
r("div",
|
209
|
-
r("div",
|
210
|
-
Z,
|
209
|
+
r("div", Y, [
|
210
|
+
r("div", Z, [
|
211
211
|
ee,
|
212
|
-
|
213
|
-
|
212
|
+
te,
|
213
|
+
r("div", ae, [
|
214
214
|
s(i, {
|
215
215
|
label: "Hidden department",
|
216
216
|
name: "hidden",
|
@@ -297,5 +297,5 @@ const q = { class: "for-transition pd-thin w-100" }, G = { class: "mn-b-thin fle
|
|
297
297
|
}
|
298
298
|
};
|
299
299
|
export {
|
300
|
-
|
300
|
+
Ve as default
|
301
301
|
};
|
package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("vue-router"),p=require("../../../../components/Feed/Feed.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");require("../../../../components/Tooltip/Tooltip.vue2.cjs");const q=require("../../../../components/Popup/Popup.vue.cjs"),M=require("../../../globals/components/sections/SectionPageTitle.vue.cjs"),N=require("../sections/MembersAdd.vue.cjs");require("../../../mobile/components/Menu/Menu.vue2.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");const g=require("../../../users/components/blocks/CardUser.vue.cjs"),x=require("../blocks/CardDepartment.vue.cjs"),_=require("../../../icons/navigation/IconDelete.vue.cjs"),m=require("../../../auth/store/auth.cjs"),u=require("../../store/invites.cjs"),f=require("../../store/memberships.cjs"),h=require("../../store/organizations.cjs"),b=require("../../store/departments.cjs"),z={class:"pd-thin"},P={key:2,class:"cols-1 gap-thin"},V={key:3},I={__name:"Members",setup(A){const o=v.useRoute();v.useRouter();const d=e.ref(null),s=e.ref("members"),c=e.ref(!1);function k(){c.value=!0}function y(){c.value=!1}e.onMounted(async()=>{d.value=(await h.actions.read({_id:o.params._id,user:m.state.user._id}))[0]}),e.computed(()=>{const a=b.state.departments,n=a.flatMap(i=>i.subdepartments.map(r=>r._id));return a.filter(i=>!n.includes(i._id))});async function w(a){console.log("invite.list"),await u.actions.create({owner:{type:"Organization",target:d.value._id},creator:{type:"User",target:m.state.user._id},invites:a})}async function B(a,n){confirm("Confirm remove of member")==!0&&(f.state.memberships.splice(a,1),await f.actions.delete(n._id))}async function C(a,n){confirm("Confirm remove of member")==!0&&(u.state.invites.splice(a,1),await u.actions.delete(n._id))}return(a,n)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",z,[e.createVNode(M.default,{title:"Members","onUpdate:tabs_current":n[0]||(n[0]=r=>s.value=r),tabs_current:s.value,tabs:[{name:`Members (${h.state.current.numberOfMembers||0})`,value:"members"},{name:"Departments",value:"departments"},{name:"Invites",value:"invites"}],actions:[{method:k,label:"Invite members"}],class:"mn-b-small bg-grey bg-grey radius-big"},null,8,["tabs_current","tabs","actions"]),e.createVNode(q.default,{title:"Add members",onClosePopup:y,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createVNode(N.default,{text:"Please enter your email or phone number to send an invitation link:",organization:d.value,onSendInvite:w},null,8,["organization"])]),_:1},8,["isPopupOpen"]),s.value==="departments"?(e.openBlock(),e.createBlock(p.default,{key:0,states:{empty:{title:"No Departments Found",description:"Currently, there are no departments available.",action:"Add department",callback:()=>a.$router.push(`/organizations/${e.unref(o).params._id}/departments/create`)}},store:{read:r=>b.actions.read(r),state:null},options:{organization:e.unref(o).params._id,user:m.state.user._id}},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(t,l)=>(e.openBlock(),e.createBlock(x.default,{key:l,department:t,organization:e.unref(o).params._id,class:"radius-semi bg-grey pos-relative mn-b-thin"},null,8,["department","organization"]))),128))]),_:1},8,["states","store","options"])):e.createCommentVNode("",!0),s.value==="departments"&&b.state.departments.length>0?(e.openBlock(),e.createBlock(i,{key:1,to:{path:`/organizations/${e.unref(o).params._id}/departments/create`},class:"d-block flex-center flex uppercase t-semi bg-main w-100 pd-small radius-extra"},{default:e.withCtx(()=>[e.createTextVNode(" Add department ")]),_:1},8,["to"])):e.createCommentVNode("",!0),s.value==="members"?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(p.default,{search:!0,states:{empty:{title:"No Members Found",description:"Currently, there are no members."}},store:{read:r=>f.actions.read(r)},options:{target:e.unref(o).params._id,role:["member","owner"]},class:"gap-thin cols-1"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(t,l)=>(e.openBlock(),e.createBlock(g.default,{key:l,user:t,_id:t.user._id,photo:t.user.profile.photo,phone:t.user.phone,email:t.user.email,name:t.user.profile.name||"No name",role:t.label||t.role,onClick:F=>a.$router.push(`/profile/${t.user._id}`),action:t.role!=="owner"?{label:{is:_.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>B(l,t)}:null,class:"w-100 bg-grey radius-big flex-nowrap flex pd-medium"},null,8,["user","_id","photo","phone","email","name","role","onClick","action"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0),s.value==="invites"?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(p.default,{search:!0,states:{empty:{title:"No Invites Found",description:"Currently, there are no members."}},store:{read:r=>u.actions.read(r)},options:{owner:e.unref(o).params._id},class:"gap-thin cols-1"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,t=>(e.openBlock(),e.createBlock(g.default,{key:a.index,user:{type:"invite"},name:t.email||t.phone,role:t.status,action:{label:{is:_.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>C(a.index,t)},class:"w-100 bg-grey radius-big flex-nowrap flex pd-medium"},null,8,["name","role","action"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)])}}};exports.default=I;
|
@@ -1,136 +1,142 @@
|
|
1
|
-
import { ref as
|
2
|
-
import { useRoute as
|
3
|
-
import
|
1
|
+
import { ref as v, onMounted as O, computed as D, resolveComponent as F, openBlock as a, createElementBlock as i, createVNode as p, withCtx as u, createBlock as d, unref as l, Fragment as g, renderList as h, createCommentVNode as f, createTextVNode as B } from "vue";
|
2
|
+
import { useRoute as S, useRouter as V } from "vue-router";
|
3
|
+
import y from "../../../../components/Feed/Feed.vue.js";
|
4
4
|
import "../../../../components/Tab/Tab.vue.js";
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
5
|
+
import "../../../../components/Tooltip/Tooltip.vue2.js";
|
6
|
+
import R from "../../../../components/Popup/Popup.vue.js";
|
7
|
+
import U from "../../../globals/components/sections/SectionPageTitle.vue.js";
|
8
|
+
import E from "../sections/MembersAdd.vue.js";
|
9
9
|
import "../../../mobile/components/Menu/Menu.vue2.js";
|
10
10
|
import "../../../mobile/components/Menu/MenuItem.vue.js";
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import {
|
15
|
-
import { actions as
|
16
|
-
import { actions as
|
17
|
-
import {
|
18
|
-
|
19
|
-
|
11
|
+
import k from "../../../users/components/blocks/CardUser.vue.js";
|
12
|
+
import L from "../blocks/CardDepartment.vue.js";
|
13
|
+
import C from "../../../icons/navigation/IconDelete.vue.js";
|
14
|
+
import { state as $ } from "../../../auth/store/auth.js";
|
15
|
+
import { actions as w, state as T } from "../../store/invites.js";
|
16
|
+
import { actions as M, state as j } from "../../store/memberships.js";
|
17
|
+
import { actions as q, state as G } from "../../store/organizations.js";
|
18
|
+
import { state as x, actions as H } from "../../store/departments.js";
|
19
|
+
const J = { class: "pd-thin" }, K = {
|
20
|
+
key: 2,
|
20
21
|
class: "cols-1 gap-thin"
|
21
|
-
}, Q = { key:
|
22
|
+
}, Q = { key: 3 }, be = {
|
22
23
|
__name: "Members",
|
23
|
-
setup(
|
24
|
-
const o =
|
25
|
-
|
26
|
-
const
|
27
|
-
function
|
28
|
-
|
24
|
+
setup(W) {
|
25
|
+
const o = S();
|
26
|
+
V();
|
27
|
+
const _ = v(null), n = v("members"), b = v(!1);
|
28
|
+
function z() {
|
29
|
+
b.value = !0;
|
29
30
|
}
|
30
|
-
function
|
31
|
-
|
31
|
+
function I() {
|
32
|
+
b.value = !1;
|
32
33
|
}
|
33
|
-
|
34
|
-
|
35
|
-
}),
|
36
|
-
const r =
|
37
|
-
(
|
34
|
+
O(async () => {
|
35
|
+
_.value = (await q.read({ _id: o.params._id, user: $.user._id }))[0];
|
36
|
+
}), D(() => {
|
37
|
+
const r = x.departments, s = r.flatMap(
|
38
|
+
(m) => m.subdepartments.map((t) => t._id)
|
38
39
|
);
|
39
40
|
return r.filter(
|
40
|
-
(
|
41
|
+
(m) => !s.includes(m._id)
|
41
42
|
);
|
42
43
|
});
|
43
|
-
async function
|
44
|
-
await
|
44
|
+
async function N(r) {
|
45
|
+
console.log("invite.list"), await w.create({
|
45
46
|
owner: {
|
46
47
|
type: "Organization",
|
47
|
-
target:
|
48
|
+
target: _.value._id
|
48
49
|
},
|
49
50
|
creator: {
|
50
51
|
type: "User",
|
51
|
-
target:
|
52
|
+
target: $.user._id
|
52
53
|
},
|
53
54
|
invites: r
|
54
55
|
});
|
55
56
|
}
|
56
|
-
async function
|
57
|
-
confirm("Confirm remove of member") == !0 && (
|
57
|
+
async function P(r, s) {
|
58
|
+
confirm("Confirm remove of member") == !0 && (j.memberships.splice(r, 1), await M.delete(s._id));
|
58
59
|
}
|
59
|
-
async function
|
60
|
-
confirm("Confirm remove of member") == !0 && (
|
60
|
+
async function A(r, s) {
|
61
|
+
confirm("Confirm remove of member") == !0 && (T.invites.splice(r, 1), await w.delete(s._id));
|
61
62
|
}
|
62
|
-
return (r, s) =>
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
action: "Add department",
|
103
|
-
callback: () => r.$router.push(`/organizations/${u(o).params._id}/departments/create`)
|
104
|
-
}
|
105
|
-
},
|
106
|
-
store: {
|
107
|
-
read: (t) => G.read(t),
|
108
|
-
state: null
|
109
|
-
},
|
110
|
-
options: {
|
111
|
-
organization: u(o).params._id,
|
112
|
-
user: y.user._id,
|
113
|
-
hidden: !1
|
63
|
+
return (r, s) => {
|
64
|
+
const m = F("router-link");
|
65
|
+
return a(), i("div", J, [
|
66
|
+
p(U, {
|
67
|
+
title: "Members",
|
68
|
+
"onUpdate:tabs_current": s[0] || (s[0] = (t) => n.value = t),
|
69
|
+
tabs_current: n.value,
|
70
|
+
tabs: [
|
71
|
+
{ name: `Members (${G.current.numberOfMembers || 0})`, value: "members" },
|
72
|
+
{ name: "Departments", value: "departments" },
|
73
|
+
{ name: "Invites", value: "invites" }
|
74
|
+
],
|
75
|
+
actions: [
|
76
|
+
{ method: z, label: "Invite members" }
|
77
|
+
],
|
78
|
+
class: "mn-b-small bg-grey bg-grey radius-big"
|
79
|
+
}, null, 8, ["tabs_current", "tabs", "actions"]),
|
80
|
+
p(R, {
|
81
|
+
title: "Add members",
|
82
|
+
onClosePopup: I,
|
83
|
+
isPopupOpen: b.value,
|
84
|
+
class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
|
85
|
+
}, {
|
86
|
+
default: u(() => [
|
87
|
+
p(E, {
|
88
|
+
text: "Please enter your email or phone number to send an invitation link:",
|
89
|
+
organization: _.value,
|
90
|
+
onSendInvite: N
|
91
|
+
}, null, 8, ["organization"])
|
92
|
+
]),
|
93
|
+
_: 1
|
94
|
+
}, 8, ["isPopupOpen"]),
|
95
|
+
n.value === "departments" ? (a(), d(y, {
|
96
|
+
key: 0,
|
97
|
+
states: {
|
98
|
+
empty: {
|
99
|
+
title: "No Departments Found",
|
100
|
+
description: "Currently, there are no departments available.",
|
101
|
+
action: "Add department",
|
102
|
+
callback: () => r.$router.push(`/organizations/${l(o).params._id}/departments/create`)
|
114
103
|
}
|
115
|
-
},
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
}
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
104
|
+
},
|
105
|
+
store: {
|
106
|
+
read: (t) => H.read(t),
|
107
|
+
state: null
|
108
|
+
},
|
109
|
+
options: {
|
110
|
+
organization: l(o).params._id,
|
111
|
+
user: $.user._id
|
112
|
+
}
|
113
|
+
}, {
|
114
|
+
default: u(({
|
115
|
+
items: t
|
116
|
+
}) => [
|
117
|
+
(a(!0), i(g, null, h(t, (e, c) => (a(), d(L, {
|
118
|
+
key: c,
|
119
|
+
department: e,
|
120
|
+
organization: l(o).params._id,
|
121
|
+
class: "radius-semi bg-grey pos-relative mn-b-thin"
|
122
|
+
}, null, 8, ["department", "organization"]))), 128))
|
123
|
+
]),
|
124
|
+
_: 1
|
125
|
+
}, 8, ["states", "store", "options"])) : f("", !0),
|
126
|
+
n.value === "departments" && x.departments.length > 0 ? (a(), d(m, {
|
127
|
+
key: 1,
|
128
|
+
to: {
|
129
|
+
path: `/organizations/${l(o).params._id}/departments/create`
|
130
|
+
},
|
131
|
+
class: "d-block flex-center flex uppercase t-semi bg-main w-100 pd-small radius-extra"
|
132
|
+
}, {
|
133
|
+
default: u(() => [
|
134
|
+
B(" Add department ")
|
135
|
+
]),
|
136
|
+
_: 1
|
137
|
+
}, 8, ["to"])) : f("", !0),
|
138
|
+
n.value === "members" ? (a(), i("div", K, [
|
139
|
+
p(y, {
|
134
140
|
search: !0,
|
135
141
|
states: {
|
136
142
|
empty: {
|
@@ -139,19 +145,19 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-big radius-medium bg-white" }
|
|
139
145
|
}
|
140
146
|
},
|
141
147
|
store: {
|
142
|
-
read: (t) =>
|
148
|
+
read: (t) => M.read(t)
|
143
149
|
},
|
144
150
|
options: {
|
145
|
-
target:
|
151
|
+
target: l(o).params._id,
|
146
152
|
role: ["member", "owner"]
|
147
153
|
},
|
148
154
|
class: "gap-thin cols-1"
|
149
155
|
}, {
|
150
|
-
default:
|
156
|
+
default: u(({
|
151
157
|
items: t
|
152
158
|
}) => [
|
153
|
-
(a(!0),
|
154
|
-
key:
|
159
|
+
(a(!0), i(g, null, h(t, (e, c) => (a(), d(k, {
|
160
|
+
key: c,
|
155
161
|
user: e,
|
156
162
|
_id: e.user._id,
|
157
163
|
photo: e.user.profile.photo,
|
@@ -159,19 +165,22 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-big radius-medium bg-white" }
|
|
159
165
|
email: e.user.email,
|
160
166
|
name: e.user.profile.name || "No name",
|
161
167
|
role: e.label || e.role,
|
162
|
-
onClick: (
|
168
|
+
onClick: (X) => r.$router.push(`/profile/${e.user._id}`),
|
163
169
|
action: e.role !== "owner" ? {
|
164
|
-
label:
|
165
|
-
|
170
|
+
label: {
|
171
|
+
is: C,
|
172
|
+
props: { class: "i-medium", fill: "rgb(var(--white)" }
|
173
|
+
},
|
174
|
+
method: () => P(c, e)
|
166
175
|
} : null,
|
167
176
|
class: "w-100 bg-grey radius-big flex-nowrap flex pd-medium"
|
168
177
|
}, null, 8, ["user", "_id", "photo", "phone", "email", "name", "role", "onClick", "action"]))), 128))
|
169
178
|
]),
|
170
179
|
_: 1
|
171
180
|
}, 8, ["store", "options"])
|
172
|
-
])) :
|
173
|
-
|
174
|
-
|
181
|
+
])) : f("", !0),
|
182
|
+
n.value === "invites" ? (a(), i("div", Q, [
|
183
|
+
p(y, {
|
175
184
|
search: !0,
|
176
185
|
states: {
|
177
186
|
empty: {
|
@@ -180,35 +189,38 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-big radius-medium bg-white" }
|
|
180
189
|
}
|
181
190
|
},
|
182
191
|
store: {
|
183
|
-
read: (t) =>
|
192
|
+
read: (t) => w.read(t)
|
184
193
|
},
|
185
194
|
options: {
|
186
|
-
owner:
|
195
|
+
owner: l(o).params._id
|
187
196
|
},
|
188
197
|
class: "gap-thin cols-1"
|
189
198
|
}, {
|
190
|
-
default:
|
199
|
+
default: u(({
|
191
200
|
items: t
|
192
201
|
}) => [
|
193
|
-
(a(!0),
|
202
|
+
(a(!0), i(g, null, h(t, (e) => (a(), d(k, {
|
194
203
|
key: r.index,
|
195
204
|
user: { type: "invite" },
|
196
205
|
name: e.email || e.phone,
|
197
206
|
role: e.status,
|
198
207
|
action: {
|
199
|
-
label:
|
200
|
-
|
208
|
+
label: {
|
209
|
+
is: C,
|
210
|
+
props: { class: "i-medium", fill: "rgb(var(--white)" }
|
211
|
+
},
|
212
|
+
method: () => A(r.index, e)
|
201
213
|
},
|
202
214
|
class: "w-100 bg-grey radius-big flex-nowrap flex pd-medium"
|
203
215
|
}, null, 8, ["name", "role", "action"]))), 128))
|
204
216
|
]),
|
205
217
|
_: 1
|
206
218
|
}, 8, ["store", "options"])
|
207
|
-
])) :
|
208
|
-
])
|
209
|
-
|
219
|
+
])) : f("", !0)
|
220
|
+
]);
|
221
|
+
};
|
210
222
|
}
|
211
223
|
};
|
212
224
|
export {
|
213
|
-
|
225
|
+
be as default
|
214
226
|
};
|