@fishawack/lab-velocity 2.0.0-beta.40 → 2.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_Build/vue/modules/AuthModule/js/router.js +17 -36
- package/_Build/vue/modules/AuthModule/routes/PCompanies/columns.js +268 -0
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +172 -232
- package/_Build/vue/modules/AuthModule/routes/PUsers/columns.js +349 -0
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +143 -262
- package/_Build/vue/modules/resource/Children/create.vue +1 -1
- package/_Build/vue/modules/resource/Children/edit.vue +1 -1
- package/index.js +6 -0
- package/package.json +1 -1
- package/_Build/vue/modules/AuthModule/routes/PCompanies/form.vue +0 -205
- package/_Build/vue/modules/AuthModule/routes/PUsers/form.vue +0 -193
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { merge } from "lodash";
|
|
4
|
-
|
|
5
3
|
import { h } from "vue";
|
|
6
4
|
import { RouterView } from "vue-router";
|
|
7
5
|
|
|
8
6
|
import { routes as resourceRoutes } from "../../resource/index.js";
|
|
9
7
|
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import defaultUserResource from "../routes/PUsers/resource.js";
|
|
9
|
+
import defaultCompanyResource from "../routes/PCompanies/resource.js";
|
|
10
|
+
import defaultTeamResource from "../routes/PTeams/resource.js";
|
|
13
11
|
|
|
14
12
|
// Admin routes export - minimal auth flow (headless login only)
|
|
15
13
|
export function adminRoutes(node, overrides = {}) {
|
|
16
14
|
const {
|
|
17
|
-
userResource
|
|
18
|
-
companyResource
|
|
19
|
-
teamResource
|
|
15
|
+
userResource = defaultUserResource,
|
|
16
|
+
companyResource = defaultCompanyResource,
|
|
17
|
+
teamResource = defaultTeamResource,
|
|
20
18
|
} = overrides;
|
|
21
19
|
|
|
22
20
|
return [
|
|
@@ -53,34 +51,17 @@ export function adminRoutes(node, overrides = {}) {
|
|
|
53
51
|
},
|
|
54
52
|
],
|
|
55
53
|
},
|
|
56
|
-
...resourceRoutes(
|
|
57
|
-
|
|
58
|
-
...
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
undefined,
|
|
68
|
-
merge(overrideCompanyResource, {
|
|
69
|
-
routeName: "companies.teams",
|
|
70
|
-
}),
|
|
71
|
-
]),
|
|
72
|
-
),
|
|
73
|
-
],
|
|
74
|
-
),
|
|
75
|
-
...resourceRoutes(
|
|
76
|
-
node,
|
|
77
|
-
...merge(teamResource, [
|
|
78
|
-
undefined,
|
|
79
|
-
merge(overrideCompanyResource, {
|
|
80
|
-
routeName: "teams",
|
|
81
|
-
}),
|
|
82
|
-
]),
|
|
83
|
-
),
|
|
54
|
+
...resourceRoutes(node, ...userResource),
|
|
55
|
+
...resourceRoutes(node, ...companyResource, [
|
|
56
|
+
...resourceRoutes(node, teamResource[0], {
|
|
57
|
+
...teamResource[1],
|
|
58
|
+
routeName: "companies.teams",
|
|
59
|
+
}),
|
|
60
|
+
]),
|
|
61
|
+
...resourceRoutes(node, teamResource[0], {
|
|
62
|
+
...teamResource[1],
|
|
63
|
+
routeName: "teams",
|
|
64
|
+
}),
|
|
84
65
|
];
|
|
85
66
|
}
|
|
86
67
|
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { h, resolveComponent } from "vue";
|
|
2
|
+
import { ElInput } from "element-plus";
|
|
3
|
+
|
|
4
|
+
import VelBasic from "../../../../components/form/basic.vue";
|
|
5
|
+
import VelButton from "../../../../components/basic/Button.vue";
|
|
6
|
+
import VelSelect from "../../../../components/form/Select.vue";
|
|
7
|
+
import VelFormRole from "../../../../components/layout/FormRole.vue";
|
|
8
|
+
import Chip from "../../../../components/layout/Chip.vue";
|
|
9
|
+
import Chips from "../../../../components/layout/Chips.vue";
|
|
10
|
+
|
|
11
|
+
export default [
|
|
12
|
+
{
|
|
13
|
+
key: "name",
|
|
14
|
+
sortable: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: "primary_contact",
|
|
18
|
+
label: "Primary Contact",
|
|
19
|
+
condition: {
|
|
20
|
+
table: false,
|
|
21
|
+
form: {
|
|
22
|
+
write: ({ method }) => method === "patch",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
preparation: ({ form }) => form.primary_contact?.id,
|
|
26
|
+
render: {
|
|
27
|
+
read: ({ model }) => h("span", model.primary_contact?.name),
|
|
28
|
+
write: ({ $route }) =>
|
|
29
|
+
h(VelSelect, {
|
|
30
|
+
endpoint: `api/users`,
|
|
31
|
+
params: {
|
|
32
|
+
"filter[company_id]": $route.params.companiesId,
|
|
33
|
+
},
|
|
34
|
+
labelKey: "name",
|
|
35
|
+
filterable: true,
|
|
36
|
+
searchParam: "name",
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "primary_contact_email",
|
|
42
|
+
label: "Primary Contact Email",
|
|
43
|
+
condition: {
|
|
44
|
+
table: false,
|
|
45
|
+
form: false,
|
|
46
|
+
},
|
|
47
|
+
render: {
|
|
48
|
+
read: ({ model }) => h("span", model.primary_contact?.email),
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "primary_contact_contacted",
|
|
53
|
+
label: "Primary Contact Contacted",
|
|
54
|
+
condition: {
|
|
55
|
+
table: false,
|
|
56
|
+
form: false,
|
|
57
|
+
},
|
|
58
|
+
render: {
|
|
59
|
+
read: ({ model }) =>
|
|
60
|
+
h("span", String(!!model.primary_contact_contacted)),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: "domains",
|
|
65
|
+
condition: {
|
|
66
|
+
table: false,
|
|
67
|
+
},
|
|
68
|
+
initial: ({ model }) => model?.domains || [],
|
|
69
|
+
render: {
|
|
70
|
+
read: ({ model }) => h("span", model.domains.join(", ")),
|
|
71
|
+
write: ({ form }) =>
|
|
72
|
+
h("div", { class: "form__group vel-basic" }, [
|
|
73
|
+
h("p", { class: "my-0" }, [
|
|
74
|
+
"Domain/s ",
|
|
75
|
+
h("sup", { class: "color-status-red-100" }, "*"),
|
|
76
|
+
]),
|
|
77
|
+
h(
|
|
78
|
+
"ul",
|
|
79
|
+
{ class: "list-none pl-0 mt mb-2" },
|
|
80
|
+
form.domains.map((domain, index) =>
|
|
81
|
+
h("li", { key: index, class: "mb-0.5" }, [
|
|
82
|
+
h(
|
|
83
|
+
ElInput,
|
|
84
|
+
{
|
|
85
|
+
modelValue: form.domains[index],
|
|
86
|
+
"onUpdate:modelValue": (val) => {
|
|
87
|
+
form.domains[index] = val;
|
|
88
|
+
},
|
|
89
|
+
placeholder: "avalerehealth.com",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
prepend: () => "@",
|
|
93
|
+
append: () =>
|
|
94
|
+
h(
|
|
95
|
+
VelButton,
|
|
96
|
+
{
|
|
97
|
+
type: "danger",
|
|
98
|
+
onClick: () =>
|
|
99
|
+
form.domains.splice(
|
|
100
|
+
index,
|
|
101
|
+
1,
|
|
102
|
+
),
|
|
103
|
+
},
|
|
104
|
+
() =>
|
|
105
|
+
h(
|
|
106
|
+
resolveComponent(
|
|
107
|
+
"GSvg",
|
|
108
|
+
),
|
|
109
|
+
{
|
|
110
|
+
class: "vel-icon",
|
|
111
|
+
name: "icon-trash",
|
|
112
|
+
},
|
|
113
|
+
),
|
|
114
|
+
),
|
|
115
|
+
},
|
|
116
|
+
),
|
|
117
|
+
form.errors?.has?.(`domains.${index}`) &&
|
|
118
|
+
h(
|
|
119
|
+
"small",
|
|
120
|
+
{
|
|
121
|
+
class: "form__error vel-basic__error",
|
|
122
|
+
},
|
|
123
|
+
form.errors.first(`domains.${index}`),
|
|
124
|
+
),
|
|
125
|
+
]),
|
|
126
|
+
),
|
|
127
|
+
),
|
|
128
|
+
h("div", [
|
|
129
|
+
h(
|
|
130
|
+
VelButton,
|
|
131
|
+
{
|
|
132
|
+
onClick: () => form.domains.push(""),
|
|
133
|
+
},
|
|
134
|
+
() => [
|
|
135
|
+
"Add Domain ",
|
|
136
|
+
h(resolveComponent("GIcon"), {
|
|
137
|
+
name: "icon-plus",
|
|
138
|
+
embed: true,
|
|
139
|
+
asis: true,
|
|
140
|
+
class: "fill-0 icon--0.5 ml",
|
|
141
|
+
}),
|
|
142
|
+
],
|
|
143
|
+
),
|
|
144
|
+
]),
|
|
145
|
+
]),
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: "seats",
|
|
150
|
+
label: "Available Seats",
|
|
151
|
+
type: "number",
|
|
152
|
+
min: 0,
|
|
153
|
+
condition: {
|
|
154
|
+
table: false,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "user_count",
|
|
159
|
+
label: "Total Users",
|
|
160
|
+
width: "150",
|
|
161
|
+
condition: {
|
|
162
|
+
form: false,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
key: "sso_enabled",
|
|
167
|
+
label: "SSO Enabled",
|
|
168
|
+
condition: {
|
|
169
|
+
table: false,
|
|
170
|
+
form: false,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: "roles",
|
|
175
|
+
label: "Role",
|
|
176
|
+
condition: {
|
|
177
|
+
description: false,
|
|
178
|
+
form: {
|
|
179
|
+
write: ({ $store }) => $store.getters.can("edit roles"),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
initial: ({ model }) =>
|
|
183
|
+
model?.roles.map((val) => ({
|
|
184
|
+
label: val.label,
|
|
185
|
+
value: val.id,
|
|
186
|
+
})) || [],
|
|
187
|
+
preparation: ({ form }) =>
|
|
188
|
+
form.roles.map((d) => (typeof d === "object" ? d.value : d)),
|
|
189
|
+
render: {
|
|
190
|
+
read: ({ model }) =>
|
|
191
|
+
h(
|
|
192
|
+
model.roles.length === 1 ? Chip : Chips,
|
|
193
|
+
model.roles.length === 1
|
|
194
|
+
? {
|
|
195
|
+
name: model.roles[0].name,
|
|
196
|
+
label: model.roles[0].label,
|
|
197
|
+
}
|
|
198
|
+
: { array: model.roles },
|
|
199
|
+
),
|
|
200
|
+
write: ({ model, form }) =>
|
|
201
|
+
h(VelFormRole, {
|
|
202
|
+
overrides: model?.overrides_roles_and_permissions,
|
|
203
|
+
form,
|
|
204
|
+
}),
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
key: "sso_type",
|
|
209
|
+
label: "Provider",
|
|
210
|
+
condition: {
|
|
211
|
+
table: false,
|
|
212
|
+
description: false,
|
|
213
|
+
form: {
|
|
214
|
+
write: ({ $store }) => $store.getters.can("edit sso"),
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
initial: ({ model }) => model?.sso_type || undefined,
|
|
218
|
+
preparation: ({ form }) => form.sso_type?.value,
|
|
219
|
+
render: {
|
|
220
|
+
write: () =>
|
|
221
|
+
h(VelSelect, {
|
|
222
|
+
clearable: true,
|
|
223
|
+
class: "mt-2",
|
|
224
|
+
options: [
|
|
225
|
+
{ value: "azure", label: "azure" },
|
|
226
|
+
{ value: "google", label: "google" },
|
|
227
|
+
],
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
key: "sso_client_id",
|
|
233
|
+
label: "Key",
|
|
234
|
+
condition: {
|
|
235
|
+
table: false,
|
|
236
|
+
description: false,
|
|
237
|
+
form: {
|
|
238
|
+
write: ({ $store }) => $store.getters.can("edit sso"),
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
initial: ({ model }) => model?.sso_client_id || undefined,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
key: "sso_tenant",
|
|
245
|
+
label: "Tenant",
|
|
246
|
+
condition: {
|
|
247
|
+
table: false,
|
|
248
|
+
description: false,
|
|
249
|
+
form: {
|
|
250
|
+
write: ({ $store }) => $store.getters.can("edit sso"),
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
initial: ({ model }) => model?.sso_tenant || undefined,
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
key: "sso_client_secret",
|
|
257
|
+
label: "Secret",
|
|
258
|
+
type: "password",
|
|
259
|
+
condition: {
|
|
260
|
+
table: false,
|
|
261
|
+
description: false,
|
|
262
|
+
form: {
|
|
263
|
+
write: ({ $store }) => $store.getters.can("edit sso"),
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
initial: ({ model }) => model?.sso_client_secret || undefined,
|
|
267
|
+
},
|
|
268
|
+
];
|