@fishawack/lab-velocity 1.11.1 → 2.0.0-beta.2
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/README.md +13 -7
- package/_Build/vue/components/Icon.vue +33 -0
- package/_Build/vue/components/Svg.vue +45 -0
- package/{basic → _Build/vue/components/basic}/Button.vue +16 -18
- package/{basic → _Build/vue/components/basic}/link.vue +8 -7
- package/{form → _Build/vue/components/form}/Cascader.vue +13 -13
- package/{form → _Build/vue/components/form}/CheckboxGroup.vue +28 -6
- package/{form → _Build/vue/components/form}/DatePicker.vue +23 -7
- package/{form → _Build/vue/components/form}/InputNumber.vue +1 -2
- package/{form → _Build/vue/components/form}/Select.vue +8 -9
- package/{form → _Build/vue/components/form}/Switch.vue +2 -2
- package/{form → _Build/vue/components/form}/Upload.vue +4 -6
- package/{form → _Build/vue/components/form}/Wysiwyg.vue +14 -14
- package/_Build/vue/components/form/Wysiwyg2.vue +577 -0
- package/{form → _Build/vue/components/form}/basic.vue +25 -7
- package/{form → _Build/vue/components/form}/file.vue +1 -1
- package/{form → _Build/vue/components/form}/input.js +2 -2
- package/{form → _Build/vue/components/form}/input.vue +31 -11
- package/{layout → _Build/vue/components/layout}/Alert.vue +10 -10
- package/_Build/vue/components/layout/Footer.vue +50 -0
- package/{layout → _Build/vue/components/layout}/Header.vue +5 -7
- package/_Build/vue/components/layout/Loader.vue +59 -0
- package/{layout → _Build/vue/components/layout}/Tooltip.vue +12 -12
- package/{layout → _Build/vue/components/layout}/pageTitle.vue +4 -4
- package/{layout → _Build/vue/components/layout}/sideBar.vue +4 -6
- package/{navigation → _Build/vue/components/navigation}/Breadcrumbs.vue +15 -10
- package/{navigation → _Build/vue/components/navigation}/BreadcrumbsItem.vue +6 -6
- package/_Build/vue/components/navigation/Menu.vue +14 -0
- package/_Build/vue/components/navigation/MenuItem.vue +20 -0
- package/_Build/vue/components/navigation/MenuItemGroup.vue +20 -0
- package/_Build/vue/components/navigation/SubMenu.vue +20 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +251 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +62 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +98 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +90 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +173 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +262 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +36 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +112 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +103 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +112 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +169 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +120 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +36 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/components/AuthModal.vue +30 -35
- package/_Build/vue/modules/AuthModule/components/Chip.vue +70 -0
- package/_Build/vue/modules/AuthModule/components/Chips.vue +26 -0
- package/_Build/vue/modules/AuthModule/components/FormRole.vue +115 -0
- package/_Build/vue/modules/AuthModule/components/VBreadcrumbs.vue +32 -0
- package/_Build/vue/modules/AuthModule/components/VFormFooter.vue +46 -0
- package/_Build/vue/modules/AuthModule/components/VPageHeader.vue +38 -0
- package/_Build/vue/modules/AuthModule/components/VPasswordValidation.vue +106 -0
- package/_Build/vue/modules/AuthModule/components/VRoleLegend.vue +43 -0
- package/_Build/vue/modules/AuthModule/components/VTable.vue +127 -0
- package/_Build/vue/modules/AuthModule/components/VTableSorter.vue +240 -0
- package/_Build/vue/modules/AuthModule/js/FakeAPI.js +78 -0
- package/_Build/vue/modules/AuthModule/js/axios.js +62 -0
- package/_Build/vue/modules/AuthModule/js/router.js +295 -0
- package/_Build/vue/modules/AuthModule/js/store.js +62 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/account-exists.vue +5 -7
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/change-password.vue +28 -25
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/container.vue +4 -8
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-reset.vue +13 -11
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-verification.vue +12 -12
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/force-reset.vue +36 -26
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/forgot.vue +11 -7
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/login.vue +20 -15
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/logincallback.vue +5 -10
- package/_Build/vue/modules/AuthModule/routes/loginheadless.vue +21 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/loginsso.vue +32 -25
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/logout.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +27 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/register.vue +43 -25
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/reset.vue +24 -14
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-forgot.vue +14 -12
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-reset.vue +4 -4
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-verify.vue +10 -7
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/verify.vue +15 -12
- package/_base.scss +1 -1
- package/_defaults.scss +2 -3
- package/_variables.scss +16 -18
- package/general.scss +1 -2
- package/index.js +38 -30
- package/package.json +103 -102
- package/vendor.scss +2 -2
- package/AuthModule/components/VPasswordValidation.vue +0 -66
- package/AuthModule/js/AuthAxios.js +0 -59
- package/AuthModule/js/AuthRoutes.js +0 -186
- package/AuthModule/js/AuthStore.js +0 -99
- package/AuthModule/js/FakeAPI.js +0 -84
- package/AuthModule/routes/loginheadless.vue +0 -16
- package/Icon.vue +0 -33
- package/Svg.vue +0 -40
- package/components/_alert.scss +0 -5
- package/components/_basic.scss +0 -54
- package/components/_breadcrumbs.scss +0 -40
- package/components/_button.scss +0 -305
- package/components/_cascader.scss +0 -12
- package/components/_checkbox.scss +0 -40
- package/components/_collapse.scss +0 -25
- package/components/_datepicker.scss +0 -51
- package/components/_footer.scss +0 -46
- package/components/_form.scss +0 -22
- package/components/_header.scss +0 -55
- package/components/_icon.scss +0 -24
- package/components/_input.scss +0 -0
- package/components/_inputNumber.scss +0 -21
- package/components/_link.scss +0 -44
- package/components/_loader.scss +0 -44
- package/components/_menu.scss +0 -112
- package/components/_pageTitle.scss +0 -8
- package/components/_select.scss +0 -28
- package/components/_sidebar.scss +0 -57
- package/components/_switch.scss +0 -14
- package/components/_table.scss +0 -20
- package/components/_tooltip.scss +0 -4
- package/components/_typography.scss +0 -153
- package/components/_upload.scss +0 -15
- package/components/_wysiwyg.scss +0 -6
- package/components/_wysiwyg2.scss +0 -136
- package/form/Wysiwyg2.vue +0 -278
- package/layout/Footer.vue +0 -35
- package/layout/Loader.vue +0 -39
- package/modules/_AuthModule.scss +0 -209
- package/modules/_AuthVariables.scss +0 -7
- package/modules/_modal.scss +0 -24
- package/navigation/Menu.vue +0 -16
- package/navigation/MenuItem.vue +0 -20
- package/navigation/MenuItemGroup.vue +0 -20
- package/navigation/SubMenu.vue +0 -20
- /package/{form → _Build/vue/components/form}/Checkbox.vue +0 -0
- /package/{form → _Build/vue/components/form}/color.vue +0 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VBreadcrumbs :items="breadcrumbs" class="mb-8" container-classes="m-0" />
|
|
3
|
+
|
|
4
|
+
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
5
|
+
<div class="grid__1/2">
|
|
6
|
+
<div class="grid__1/1 grid justify-between mb-4 items-end">
|
|
7
|
+
<h2 class="h1">User import</h2>
|
|
8
|
+
<div>
|
|
9
|
+
<el-button
|
|
10
|
+
tag="a"
|
|
11
|
+
type="secondary"
|
|
12
|
+
href="/media/content/files/example.csv"
|
|
13
|
+
download
|
|
14
|
+
>
|
|
15
|
+
<GIcon
|
|
16
|
+
class="fill-1 mr-0.5"
|
|
17
|
+
name="icon-download"
|
|
18
|
+
embed
|
|
19
|
+
artboard
|
|
20
|
+
/>
|
|
21
|
+
Download example file
|
|
22
|
+
</el-button>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="grid__1/1">
|
|
26
|
+
<el-select
|
|
27
|
+
v-model="form.roles"
|
|
28
|
+
placeholder="Select"
|
|
29
|
+
multiple
|
|
30
|
+
name="roles"
|
|
31
|
+
:error="form.errors"
|
|
32
|
+
label="Roles"
|
|
33
|
+
:options="[
|
|
34
|
+
{
|
|
35
|
+
label: 'Administrator',
|
|
36
|
+
value: '1',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Subscriber',
|
|
40
|
+
value: '2',
|
|
41
|
+
},
|
|
42
|
+
]"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<el-select
|
|
46
|
+
v-if="form.roles && form.roles.length"
|
|
47
|
+
v-model="form.permissions"
|
|
48
|
+
placeholder="Select"
|
|
49
|
+
multiple
|
|
50
|
+
name="permissions"
|
|
51
|
+
:error="form.errors"
|
|
52
|
+
label="Permissions"
|
|
53
|
+
:options="[
|
|
54
|
+
{
|
|
55
|
+
label: `Inherit Permissions`,
|
|
56
|
+
value: null,
|
|
57
|
+
},
|
|
58
|
+
//{ // temporarily disabled as not used yet
|
|
59
|
+
// label: "Approve Content",
|
|
60
|
+
// value: "2"
|
|
61
|
+
//},
|
|
62
|
+
{
|
|
63
|
+
label: 'View content',
|
|
64
|
+
value: '3',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'Write content',
|
|
68
|
+
value: '4',
|
|
69
|
+
disabled: !form.roles.includes(1),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Delete content',
|
|
73
|
+
value: '5',
|
|
74
|
+
disabled: !form.roles.includes(1),
|
|
75
|
+
},
|
|
76
|
+
]"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="grid__1/1">
|
|
80
|
+
<hr class="my-3 hr-muted" />
|
|
81
|
+
|
|
82
|
+
<el-upload
|
|
83
|
+
ref="upload"
|
|
84
|
+
v-model="form.files"
|
|
85
|
+
name="files"
|
|
86
|
+
label="Upload spreadsheet"
|
|
87
|
+
:auto-upload="false"
|
|
88
|
+
:limit="1"
|
|
89
|
+
:on-exceed="handleExceed"
|
|
90
|
+
>
|
|
91
|
+
<template #trigger>
|
|
92
|
+
<el-button
|
|
93
|
+
class="mt"
|
|
94
|
+
type="primary"
|
|
95
|
+
:disabled="form.processing || form.files.length"
|
|
96
|
+
>Select file</el-button
|
|
97
|
+
>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<el-button
|
|
101
|
+
class="ml relative button--spinner"
|
|
102
|
+
type="success"
|
|
103
|
+
:disabled="form.processing || !form.files.length"
|
|
104
|
+
@click="submitUpload"
|
|
105
|
+
>
|
|
106
|
+
<span :class="{ active: !form.processing }"
|
|
107
|
+
>Upload</span
|
|
108
|
+
>
|
|
109
|
+
<GSpinner :class="{ active: form.processing }" />
|
|
110
|
+
</el-button>
|
|
111
|
+
|
|
112
|
+
<small class="block my color-muted"
|
|
113
|
+
>Upload one spreadsheet with a size less than
|
|
114
|
+
50MB</small
|
|
115
|
+
>
|
|
116
|
+
</el-upload>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<script>
|
|
123
|
+
"use strict";
|
|
124
|
+
|
|
125
|
+
import Form from "form-backend-validation";
|
|
126
|
+
import { ElMessageBox, genFileId } from "element-plus";
|
|
127
|
+
|
|
128
|
+
export default {
|
|
129
|
+
name: "Create",
|
|
130
|
+
|
|
131
|
+
components: {
|
|
132
|
+
VBreadcrumbs: require("../../../../components/VBreadcrumbs.vue")
|
|
133
|
+
.default,
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
data() {
|
|
137
|
+
return {
|
|
138
|
+
id: null,
|
|
139
|
+
breadcrumbs: [
|
|
140
|
+
{
|
|
141
|
+
href: {
|
|
142
|
+
name: "index",
|
|
143
|
+
},
|
|
144
|
+
text: "Home",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
form: new Form(
|
|
148
|
+
{
|
|
149
|
+
step: 0,
|
|
150
|
+
files: [],
|
|
151
|
+
roles: [2],
|
|
152
|
+
permissions: [null],
|
|
153
|
+
company_id: null,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
http: window.axios,
|
|
157
|
+
},
|
|
158
|
+
),
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
watch: {
|
|
163
|
+
"form.roles": {
|
|
164
|
+
handler(newVal) {
|
|
165
|
+
const subscriptions = [
|
|
166
|
+
3, // view content
|
|
167
|
+
4, // write content
|
|
168
|
+
5, // delete content
|
|
169
|
+
];
|
|
170
|
+
|
|
171
|
+
if (!newVal.includes(1)) {
|
|
172
|
+
this.form.permissions = this.form.permissions.filter(
|
|
173
|
+
(item) => subscriptions.includes(item),
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
if (!newVal.includes(2)) {
|
|
177
|
+
this.form.permissions = this.form.permissions.filter(
|
|
178
|
+
(item) => !subscriptions.includes(item),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
async mounted() {
|
|
187
|
+
this.id = this.$route.params.id;
|
|
188
|
+
this.form.company_id = this.id;
|
|
189
|
+
window.axios.get(`/api/companies/${this.id}`).then((res) => {
|
|
190
|
+
const company = res.data.data;
|
|
191
|
+
this.breadcrumbs.push(
|
|
192
|
+
{
|
|
193
|
+
href: {
|
|
194
|
+
name: "companies.show",
|
|
195
|
+
param: this.id,
|
|
196
|
+
},
|
|
197
|
+
text: company.name,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
href: {
|
|
201
|
+
name: "companies.pload",
|
|
202
|
+
},
|
|
203
|
+
text: "User upload",
|
|
204
|
+
},
|
|
205
|
+
);
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
methods: {
|
|
210
|
+
submitUpload() {
|
|
211
|
+
this.form.post(`/api/users/import`).then(({ data }) => {
|
|
212
|
+
this.open(data);
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
handleExceed(files) {
|
|
217
|
+
this.$refs.upload.clearFiles();
|
|
218
|
+
|
|
219
|
+
const file = files[0];
|
|
220
|
+
file.uid = genFileId();
|
|
221
|
+
|
|
222
|
+
this.$refs.upload.handleStart(file);
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
open(data) {
|
|
226
|
+
let html = "Succesfully imported all users";
|
|
227
|
+
|
|
228
|
+
if (data.length > 0) {
|
|
229
|
+
html =
|
|
230
|
+
"Errors detected on upload following emails were not added to the system<table>";
|
|
231
|
+
for (let x = 0; x < data.length; x++) {
|
|
232
|
+
html += `<tr><td>${data[x].email}</td></tr>`;
|
|
233
|
+
}
|
|
234
|
+
html += "</table>";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
ElMessageBox.alert(html, {
|
|
238
|
+
confirmButtonText: "Ok",
|
|
239
|
+
dangerouslyUseHTMLString: true,
|
|
240
|
+
})
|
|
241
|
+
.then(() => {
|
|
242
|
+
this.$router.replace({
|
|
243
|
+
name: "companies.show",
|
|
244
|
+
params: { id: this.id },
|
|
245
|
+
});
|
|
246
|
+
})
|
|
247
|
+
.catch(() => {});
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
</script>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VBreadcrumbs :items="breadcrumbs" class="mb-8" container-classes="m-0" />
|
|
3
|
+
|
|
4
|
+
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
5
|
+
<div class="grid__1/1">
|
|
6
|
+
<div class="grid__1/1 mb-4">
|
|
7
|
+
<h2 class="h1">Create Company</h2>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="mt grid__1/2">
|
|
10
|
+
<XForm ref="form" :form="form" :submit="submit" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import Form from "form-backend-validation";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "PCreate",
|
|
21
|
+
|
|
22
|
+
components: {
|
|
23
|
+
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
24
|
+
XForm: require("./partials/form.vue").default,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
props: {
|
|
28
|
+
breadcrumbs: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
form: new Form({
|
|
37
|
+
name: null,
|
|
38
|
+
domains: [],
|
|
39
|
+
roles: [],
|
|
40
|
+
sso_client_id: undefined,
|
|
41
|
+
sso_tenant: undefined,
|
|
42
|
+
sso_client_secret: undefined,
|
|
43
|
+
sso_type: undefined,
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
methods: {
|
|
49
|
+
async submit() {
|
|
50
|
+
try {
|
|
51
|
+
let res = await this.form.post(`/api/companies`);
|
|
52
|
+
this.$router.replace({
|
|
53
|
+
name: "companies.show",
|
|
54
|
+
params: { id: res.data.id },
|
|
55
|
+
});
|
|
56
|
+
} catch (e) {
|
|
57
|
+
this.$root.errors(e);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VBreadcrumbs
|
|
3
|
+
:items="addBreadcrumbs"
|
|
4
|
+
class="mb-8"
|
|
5
|
+
container-classes="m-0"
|
|
6
|
+
/>
|
|
7
|
+
|
|
8
|
+
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
9
|
+
<div class="grid__1/1">
|
|
10
|
+
<div class="grid__1/1 mb-4">
|
|
11
|
+
<h2 class="h1">Edit Company</h2>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="grid__1/2">
|
|
14
|
+
<XForm
|
|
15
|
+
:id="id"
|
|
16
|
+
ref="form"
|
|
17
|
+
:form="form"
|
|
18
|
+
:submit="submit"
|
|
19
|
+
method="patch"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import Form from "form-backend-validation";
|
|
28
|
+
export default {
|
|
29
|
+
name: "PEdit",
|
|
30
|
+
|
|
31
|
+
components: {
|
|
32
|
+
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
33
|
+
XForm: require("./partials/form.vue").default,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
props: {
|
|
37
|
+
breadcrumbs: {
|
|
38
|
+
type: Array,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
id: null,
|
|
46
|
+
form: new Form({
|
|
47
|
+
name: null,
|
|
48
|
+
domains: [],
|
|
49
|
+
roles: [],
|
|
50
|
+
primary_contact: null,
|
|
51
|
+
sso_client_id: undefined,
|
|
52
|
+
sso_tenant: undefined,
|
|
53
|
+
sso_client_secret: undefined,
|
|
54
|
+
sso_type: undefined,
|
|
55
|
+
}),
|
|
56
|
+
addBreadcrumbs: [...this.$props.breadcrumbs],
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
async mounted() {
|
|
61
|
+
this.id = this.$route.params.id;
|
|
62
|
+
window.axios
|
|
63
|
+
.get(`/api/companies/${this.id}?include=primary_contact`)
|
|
64
|
+
.then((res) => {
|
|
65
|
+
const company = res.data.data;
|
|
66
|
+
this.form.name = company.name;
|
|
67
|
+
this.form.primary_contact = company?.primary_contact?.id;
|
|
68
|
+
this.form.domains = company.domains;
|
|
69
|
+
this.form.roles = company.roles.map((val) => val.id);
|
|
70
|
+
this.form.sso_client_id = company.sso_client_id;
|
|
71
|
+
this.form.sso_tenant = company.sso_tenant;
|
|
72
|
+
this.form.sso_client_secret = company.sso_client_secret;
|
|
73
|
+
this.form.sso_type = company.sso_type;
|
|
74
|
+
this.addBreadcrumbs.push({
|
|
75
|
+
href: {
|
|
76
|
+
name: "companies.show",
|
|
77
|
+
param: this.id,
|
|
78
|
+
},
|
|
79
|
+
text: company.name,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
methods: {
|
|
85
|
+
async submit() {
|
|
86
|
+
try {
|
|
87
|
+
let res = await this.form.patch(`/api/companies/${this.id}`);
|
|
88
|
+
this.$router.replace({
|
|
89
|
+
name: "companies.show",
|
|
90
|
+
params: { id: res.data.id },
|
|
91
|
+
});
|
|
92
|
+
} catch (e) {
|
|
93
|
+
this.$root.errors(e);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
</script>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VBreadcrumbs :items="breadcrumbs" class="mb-8" container-classes="m-0" />
|
|
3
|
+
|
|
4
|
+
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
5
|
+
<div class="grid__1/1">
|
|
6
|
+
<h2 class="h1 pb-4">
|
|
7
|
+
{{ breadcrumbs[breadcrumbs.length - 1].text }}
|
|
8
|
+
</h2>
|
|
9
|
+
|
|
10
|
+
<VTableSorter
|
|
11
|
+
key="PIndex"
|
|
12
|
+
:json-data="jsonData"
|
|
13
|
+
api="companies"
|
|
14
|
+
:fixed-height="false"
|
|
15
|
+
:display-edit-action="$store.getters.can('write companies')"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<VRoleLegend class="mt-5" />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: "PIndex",
|
|
26
|
+
|
|
27
|
+
components: {
|
|
28
|
+
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
29
|
+
VTableSorter: require("../../../components/VTableSorter.vue").default,
|
|
30
|
+
VRoleLegend: require("../../../components/VRoleLegend.vue").default,
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
props: {
|
|
34
|
+
breadcrumbs: {
|
|
35
|
+
type: Array,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
jsonData: {
|
|
43
|
+
label: "company",
|
|
44
|
+
multiLabel: "companies",
|
|
45
|
+
pageLink: "companies",
|
|
46
|
+
api: "/api/companies",
|
|
47
|
+
searchable: {
|
|
48
|
+
label: "Search companies",
|
|
49
|
+
value: "name",
|
|
50
|
+
},
|
|
51
|
+
tableStructure: [
|
|
52
|
+
{
|
|
53
|
+
label: "Name",
|
|
54
|
+
key: "name",
|
|
55
|
+
sortable: true,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Total users",
|
|
59
|
+
key: "user_count",
|
|
60
|
+
sortable: false,
|
|
61
|
+
width: "150",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "Role",
|
|
65
|
+
component: {
|
|
66
|
+
module: (row) => {
|
|
67
|
+
if (row.roles.length === 1)
|
|
68
|
+
return require("../../../components/Chip.vue")
|
|
69
|
+
.default;
|
|
70
|
+
|
|
71
|
+
return require("../../../components/Chips.vue")
|
|
72
|
+
.default;
|
|
73
|
+
},
|
|
74
|
+
props: (row) =>
|
|
75
|
+
row.roles.length === 1
|
|
76
|
+
? {
|
|
77
|
+
name: row.roles[0].name,
|
|
78
|
+
label: row.roles[0].label,
|
|
79
|
+
}
|
|
80
|
+
: { array: row.roles },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
mounted() {},
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<!-- eslint-disable vue/no-mutating-props -->
|
|
2
|
+
<template>
|
|
3
|
+
<form class="" @submit.prevent="submit">
|
|
4
|
+
<el-basic
|
|
5
|
+
v-model="form.name"
|
|
6
|
+
name="name"
|
|
7
|
+
:error="form.errors"
|
|
8
|
+
type="text"
|
|
9
|
+
placeholder="Name"
|
|
10
|
+
label="Company name"
|
|
11
|
+
>
|
|
12
|
+
<template #label>
|
|
13
|
+
Company name <sup class="color-status-red-100">*</sup>
|
|
14
|
+
</template>
|
|
15
|
+
</el-basic>
|
|
16
|
+
|
|
17
|
+
<el-select
|
|
18
|
+
v-if="method === 'patch'"
|
|
19
|
+
v-model="form.primary_contact"
|
|
20
|
+
name="primary_contact"
|
|
21
|
+
:error="form.errors"
|
|
22
|
+
placeholder="Primary Contact"
|
|
23
|
+
label="Primary Contact"
|
|
24
|
+
:options="
|
|
25
|
+
users?.map(({ name, id }) => ({
|
|
26
|
+
label: name,
|
|
27
|
+
value: id,
|
|
28
|
+
}))
|
|
29
|
+
"
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<hr class="my-3 hr-muted" />
|
|
33
|
+
|
|
34
|
+
<p class="my-0">Domain/s <sup class="color-status-red-100">*</sup></p>
|
|
35
|
+
|
|
36
|
+
<ul class="list-none pl-0 mt mb-2">
|
|
37
|
+
<li
|
|
38
|
+
v-for="(path, index) in form.domains"
|
|
39
|
+
:key="index"
|
|
40
|
+
class="mb-0.5"
|
|
41
|
+
>
|
|
42
|
+
<el-input
|
|
43
|
+
v-model="form.domains[index]"
|
|
44
|
+
placeholder="avalerehealth.com"
|
|
45
|
+
>
|
|
46
|
+
<template #prepend>@</template>
|
|
47
|
+
<template #append>
|
|
48
|
+
<el-button
|
|
49
|
+
type="danger"
|
|
50
|
+
@click="form.domains.splice(index, 1)"
|
|
51
|
+
>
|
|
52
|
+
<GSvg class="vel-icon" name="trash" />
|
|
53
|
+
</el-button>
|
|
54
|
+
</template>
|
|
55
|
+
</el-input>
|
|
56
|
+
|
|
57
|
+
<small
|
|
58
|
+
v-if="form.errors && form.errors.has(`domains.${index}`)"
|
|
59
|
+
class="form__error vel-basic__error"
|
|
60
|
+
v-text="form.errors.first(`domains.${index}`)"
|
|
61
|
+
></small>
|
|
62
|
+
</li>
|
|
63
|
+
</ul>
|
|
64
|
+
|
|
65
|
+
<div>
|
|
66
|
+
<el-button @click="form.domains.push('')">
|
|
67
|
+
Add Domain
|
|
68
|
+
|
|
69
|
+
<GIcon name="icon-plus" embed asis class="fill-0 ml" />
|
|
70
|
+
</el-button>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<hr class="my-5 hr-muted" />
|
|
74
|
+
|
|
75
|
+
<template v-if="$store.getters.can('edit roles')">
|
|
76
|
+
<FormRole :form="form" />
|
|
77
|
+
|
|
78
|
+
<hr class="my-5 hr-muted" />
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<template v-if="$store.getters.can('edit sso')">
|
|
82
|
+
<h3 class="h3 mb-2">SSO Settings</h3>
|
|
83
|
+
|
|
84
|
+
<el-select
|
|
85
|
+
v-model="form.sso_type"
|
|
86
|
+
name="sso_type"
|
|
87
|
+
:error="form.errors"
|
|
88
|
+
placeholder="Please Select"
|
|
89
|
+
label="Provider"
|
|
90
|
+
clearable
|
|
91
|
+
:options="[
|
|
92
|
+
{
|
|
93
|
+
value: 'azure',
|
|
94
|
+
label: 'azure',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
value: 'google',
|
|
98
|
+
label: 'google',
|
|
99
|
+
},
|
|
100
|
+
]"
|
|
101
|
+
/>
|
|
102
|
+
<el-basic
|
|
103
|
+
v-model="form.sso_client_id"
|
|
104
|
+
name="sso_client_id"
|
|
105
|
+
:error="form.errors"
|
|
106
|
+
type="text"
|
|
107
|
+
placeholder="Key"
|
|
108
|
+
label="Key"
|
|
109
|
+
/>
|
|
110
|
+
<el-basic
|
|
111
|
+
v-model="form.sso_tenant"
|
|
112
|
+
name="sso_tenant"
|
|
113
|
+
:error="form.errors"
|
|
114
|
+
type="text"
|
|
115
|
+
placeholder="Tenant"
|
|
116
|
+
label="Tenant"
|
|
117
|
+
/>
|
|
118
|
+
<el-basic
|
|
119
|
+
v-model="form.sso_client_secret"
|
|
120
|
+
name="sso_client_secret"
|
|
121
|
+
:error="form.errors"
|
|
122
|
+
type="password"
|
|
123
|
+
placeholder="Secret"
|
|
124
|
+
label="Secret"
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
<hr class="my-3 hr-muted" />
|
|
128
|
+
</template>
|
|
129
|
+
|
|
130
|
+
<VFormFooter :form="form" />
|
|
131
|
+
</form>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
<!-- eslint-disable vue/no-mutating-props -->
|
|
135
|
+
<script>
|
|
136
|
+
import axios from "axios";
|
|
137
|
+
|
|
138
|
+
export default {
|
|
139
|
+
components: {
|
|
140
|
+
VFormFooter: require("../../../../components/VFormFooter.vue").default,
|
|
141
|
+
FormRole: require("../../../../components/FormRole.vue").default,
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
props: {
|
|
145
|
+
form: {
|
|
146
|
+
required: true,
|
|
147
|
+
type: Object,
|
|
148
|
+
},
|
|
149
|
+
submit: {
|
|
150
|
+
required: true,
|
|
151
|
+
type: Function,
|
|
152
|
+
},
|
|
153
|
+
method: {
|
|
154
|
+
required: true,
|
|
155
|
+
type: String,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
data() {
|
|
160
|
+
return {
|
|
161
|
+
users: [],
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
mounted() {
|
|
166
|
+
axios
|
|
167
|
+
.getAll(`/api/users?filter[company_id]=${this.$route.params.id}`)
|
|
168
|
+
.then((res) => {
|
|
169
|
+
this.users = res.data.data;
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
</script>
|