@fishawack/lab-velocity 2.0.0-beta.4 → 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/README.md +441 -37
- package/_Build/vue/components/basic/Button.vue +1 -1
- package/_Build/vue/components/form/Checkbox.vue +10 -0
- package/_Build/vue/components/form/Select.vue +223 -33
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/components/layout/Audit.vue +75 -0
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +4 -4
- package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
- package/_Build/vue/components/layout/Footer.vue +11 -10
- package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +13 -7
- package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +10 -8
- package/_Build/vue/components/layout/Layout.vue +76 -0
- package/_Build/vue/components/layout/Navigation.vue +77 -0
- package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +7 -2
- package/_Build/vue/components/layout/SideBar.vue +26 -0
- package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +32 -16
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +68 -43
- package/_Build/vue/components/layout/pageTitle.vue +1 -1
- package/_Build/vue/components/navigation/MenuItem.vue +7 -2
- package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
- package/_Build/vue/modules/AuthModule/js/axios.js +19 -0
- package/_Build/vue/modules/AuthModule/js/router.js +24 -89
- package/_Build/vue/modules/AuthModule/js/store.js +15 -6
- package/_Build/vue/modules/AuthModule/routes/PCompanies/columns.js +268 -0
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +213 -0
- package/_Build/vue/modules/AuthModule/routes/PTeams/resource.js +334 -0
- package/_Build/vue/modules/AuthModule/routes/PUsers/columns.js +349 -0
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +203 -0
- package/_Build/vue/modules/AuthModule/routes/account-exists.vue +2 -2
- package/_Build/vue/modules/AuthModule/routes/change-password.vue +23 -24
- package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
- package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +4 -4
- package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +9 -8
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +39 -50
- package/_Build/vue/modules/AuthModule/routes/forgot.vue +4 -4
- package/_Build/vue/modules/AuthModule/routes/login.vue +7 -11
- package/_Build/vue/modules/AuthModule/routes/logincallback.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +7 -9
- package/_Build/vue/modules/AuthModule/routes/logout.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/register.vue +19 -21
- package/_Build/vue/modules/AuthModule/routes/reset.vue +14 -13
- package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +8 -7
- package/_Build/vue/modules/AuthModule/routes/success-reset.vue +2 -2
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/verify.vue +11 -14
- package/_Build/vue/modules/resource/Children/create.vue +81 -0
- package/_Build/vue/modules/resource/Children/edit.vue +106 -0
- package/_Build/vue/modules/resource/Children/index.vue +42 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +61 -0
- package/_Build/vue/modules/resource/Children/show.vue +144 -0
- package/_Build/vue/modules/resource/index.js +545 -0
- package/_Build/vue/modules/resource/parent.vue +63 -0
- package/_base.scss +0 -1
- package/_defaults.scss +2 -13
- package/_variables.scss +9 -4
- package/components/_alert.scss +5 -0
- package/components/_auth.scss +163 -0
- package/components/_basic.scss +55 -0
- package/components/_breadcrumbs.scss +39 -0
- package/components/_button.scss +304 -0
- package/components/_cascader.scss +12 -0
- package/components/_checkbox.scss +41 -0
- package/components/_chip.scss +24 -0
- package/components/_collapse.scss +24 -0
- package/components/_datepicker.scss +53 -0
- package/components/_descriptions.scss +2 -0
- package/components/_footer.scss +47 -0
- package/components/_form.scss +24 -0
- package/components/_header.scss +30 -0
- package/components/_icon.scss +25 -0
- package/components/_inputNumber.scss +22 -0
- package/components/_layout.scss +56 -0
- package/components/_link.scss +44 -0
- package/components/_loader.scss +43 -0
- package/components/_menu.scss +112 -0
- package/components/_modal.scss +24 -0
- package/components/_pageTitle.scss +8 -0
- package/components/_permissionLegend.scss +18 -0
- package/components/_select.scss +29 -0
- package/components/_sidebar.scss +41 -0
- package/components/_switch.scss +14 -0
- package/components/_table.scss +20 -0
- package/components/_tooltip.scss +4 -0
- package/components/_typography.scss +162 -0
- package/components/_upload.scss +15 -0
- package/components/_wysiwyg.scss +7 -0
- package/components/_wysiwyg2.scss +142 -0
- package/index.js +16 -1
- package/package.json +5 -3
- package/vendor.scss +0 -1
- package/_Build/vue/components/layout/sideBar.vue +0 -25
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -251
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +0 -173
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -262
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +0 -169
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -120
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<PageTitle title="Companies" />
|
|
3
|
-
|
|
4
|
-
<router-view :key="$route.path" :breadcrumbs="breadcrumbs" />
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import PageTitle from "../../../../components/layout/pageTitle.vue";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
name: "PCompanies",
|
|
12
|
-
|
|
13
|
-
components: {
|
|
14
|
-
PageTitle,
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
data() {
|
|
18
|
-
return {
|
|
19
|
-
breadcrumbs: [
|
|
20
|
-
{
|
|
21
|
-
href: {
|
|
22
|
-
name: "index",
|
|
23
|
-
},
|
|
24
|
-
text: "Home",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
href: {
|
|
28
|
-
name: "companies.index",
|
|
29
|
-
},
|
|
30
|
-
text: "Companies",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
</script>
|
|
@@ -1,112 +0,0 @@
|
|
|
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 User</h2>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="grid__1/2">
|
|
10
|
-
<XForm ref="form" :form="form" :submit="submit" />
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { ElMessageBox } from "element-plus";
|
|
18
|
-
import Form from "form-backend-validation";
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
name: "PCreate",
|
|
22
|
-
|
|
23
|
-
components: {
|
|
24
|
-
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
25
|
-
XForm: require("./partials/form.vue").default,
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
props: {
|
|
29
|
-
breadcrumbs: {
|
|
30
|
-
type: Array,
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
data() {
|
|
36
|
-
return {
|
|
37
|
-
form: new Form(
|
|
38
|
-
{
|
|
39
|
-
name: null,
|
|
40
|
-
email: null,
|
|
41
|
-
roles: [],
|
|
42
|
-
notify_user: true,
|
|
43
|
-
company_id: null,
|
|
44
|
-
force_password_change: true,
|
|
45
|
-
set_password: true,
|
|
46
|
-
password: null,
|
|
47
|
-
password_confirmation: null,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
resetOnSuccess: false,
|
|
51
|
-
},
|
|
52
|
-
),
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
methods: {
|
|
57
|
-
generatePassword(
|
|
58
|
-
length = 20,
|
|
59
|
-
characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$",
|
|
60
|
-
) {
|
|
61
|
-
return Array.from(crypto.getRandomValues(new Uint32Array(length)))
|
|
62
|
-
.map((x) => characters[x % characters.length])
|
|
63
|
-
.join("");
|
|
64
|
-
},
|
|
65
|
-
async submit() {
|
|
66
|
-
try {
|
|
67
|
-
if (this.form.set_password) {
|
|
68
|
-
const password = this.generatePassword();
|
|
69
|
-
this.form.password = password;
|
|
70
|
-
this.form.password_confirmation = password;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
let res = await this.form.post(`/api/users`);
|
|
74
|
-
|
|
75
|
-
if (!this.form.set_password) {
|
|
76
|
-
this.open(res.data.id);
|
|
77
|
-
} else {
|
|
78
|
-
this.$notify({
|
|
79
|
-
title: "Success",
|
|
80
|
-
message: "User created a notified of their new account",
|
|
81
|
-
type: "success",
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
this.$router.replace({
|
|
85
|
-
name: "users.show",
|
|
86
|
-
params: { id: res.data.id },
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
} catch (e) {
|
|
90
|
-
this.$root.errors(e);
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
open(id) {
|
|
94
|
-
ElMessageBox.alert(
|
|
95
|
-
`<p>The password below will not be shown again. Ensure you've taken a copy if you plan to send manually. <br><br><strong>Email</strong>: ${this.form.email}<br> <strong>Password</strong>: ${this.form.password}</p>`,
|
|
96
|
-
"User Created",
|
|
97
|
-
{
|
|
98
|
-
confirmButtonText: "Ok",
|
|
99
|
-
dangerouslyUseHTMLString: true,
|
|
100
|
-
},
|
|
101
|
-
)
|
|
102
|
-
.then(() => {
|
|
103
|
-
this.$router.replace({
|
|
104
|
-
name: "users.show",
|
|
105
|
-
params: { id },
|
|
106
|
-
});
|
|
107
|
-
})
|
|
108
|
-
.catch(() => {});
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
</script>
|
|
@@ -1,103 +0,0 @@
|
|
|
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 User</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
|
-
|
|
29
|
-
export default {
|
|
30
|
-
name: "PEdit",
|
|
31
|
-
|
|
32
|
-
components: {
|
|
33
|
-
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
34
|
-
XForm: require("./partials/form.vue").default,
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
props: {
|
|
38
|
-
breadcrumbs: {
|
|
39
|
-
type: Array,
|
|
40
|
-
required: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
data() {
|
|
45
|
-
return {
|
|
46
|
-
id: null,
|
|
47
|
-
form: new Form({
|
|
48
|
-
name: null,
|
|
49
|
-
email: null,
|
|
50
|
-
company_id: null,
|
|
51
|
-
roles: [],
|
|
52
|
-
}),
|
|
53
|
-
addBreadcrumbs: [...this.$props.breadcrumbs],
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
async mounted() {
|
|
58
|
-
this.id = this.$route.params.id;
|
|
59
|
-
window.axios
|
|
60
|
-
.get(`/api/users/${this.id}?include=company`)
|
|
61
|
-
.then((res) => {
|
|
62
|
-
const user = res.data.data;
|
|
63
|
-
this.form.name = user.name;
|
|
64
|
-
this.form.email = user.email;
|
|
65
|
-
this.form.company_id = user.company_id;
|
|
66
|
-
this.form.roles = user.overrides_roles_and_permissions
|
|
67
|
-
? user.roles.map((val) => {
|
|
68
|
-
return val.id;
|
|
69
|
-
})
|
|
70
|
-
: [];
|
|
71
|
-
this.addBreadcrumbs.push({
|
|
72
|
-
href: {
|
|
73
|
-
name: "users.show",
|
|
74
|
-
param: this.id,
|
|
75
|
-
},
|
|
76
|
-
text: user.name,
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
methods: {
|
|
82
|
-
async submit() {
|
|
83
|
-
try {
|
|
84
|
-
let res = await this.form.patch(`/api/users/${this.id}`);
|
|
85
|
-
|
|
86
|
-
// if changing ourselves, re-fetch user data
|
|
87
|
-
if (res.data.id === this.$store.state.auth.user.id) {
|
|
88
|
-
await this.$store.dispatch("getUser", {
|
|
89
|
-
errors: this.$root.errors,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
this.$router.replace({
|
|
94
|
-
name: "users.show",
|
|
95
|
-
params: { id: res.data.id },
|
|
96
|
-
});
|
|
97
|
-
} catch (e) {
|
|
98
|
-
this.$root.errors(e);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
</script>
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<VBreadcrumbs :items="breadcrumbs" />
|
|
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
|
-
api="users"
|
|
13
|
-
:json-data="jsonData"
|
|
14
|
-
defaults="include=company"
|
|
15
|
-
:fixed-height="false"
|
|
16
|
-
:display-edit-action="$store.getters.can('write users')"
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
<VRoleLegend class="mt-5" />
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
export default {
|
|
26
|
-
name: "PIndex",
|
|
27
|
-
|
|
28
|
-
components: {
|
|
29
|
-
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
30
|
-
VTableSorter: require("../../../components/VTableSorter.vue").default,
|
|
31
|
-
VRoleLegend: require("../../../components/VRoleLegend.vue").default,
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
props: {
|
|
35
|
-
breadcrumbs: {
|
|
36
|
-
type: Array,
|
|
37
|
-
required: true,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
data() {
|
|
42
|
-
return {
|
|
43
|
-
jsonData: {
|
|
44
|
-
label: "user",
|
|
45
|
-
multiLabel: "users",
|
|
46
|
-
pageLink: "users",
|
|
47
|
-
api: "/api/users",
|
|
48
|
-
searchable: {
|
|
49
|
-
label: "Search users",
|
|
50
|
-
value: "email",
|
|
51
|
-
},
|
|
52
|
-
tableStructure: [
|
|
53
|
-
{
|
|
54
|
-
label: "Name",
|
|
55
|
-
key: "name",
|
|
56
|
-
sortable: true,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: "Email",
|
|
60
|
-
key: "email",
|
|
61
|
-
sortable: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: "Company",
|
|
65
|
-
sortable: true,
|
|
66
|
-
component: {
|
|
67
|
-
is: () => "router-link",
|
|
68
|
-
props: (row) => ({
|
|
69
|
-
to: {
|
|
70
|
-
name: "companies.show",
|
|
71
|
-
params: { id: row.company_id },
|
|
72
|
-
},
|
|
73
|
-
text: row.company.name,
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: "Role",
|
|
79
|
-
component: {
|
|
80
|
-
module: (row) => {
|
|
81
|
-
if (
|
|
82
|
-
!row.overrides_roles_and_permissions ||
|
|
83
|
-
row.roles.length === 1
|
|
84
|
-
)
|
|
85
|
-
return require("../../../components/Chip.vue")
|
|
86
|
-
.default;
|
|
87
|
-
|
|
88
|
-
return require("../../../components/Chips.vue")
|
|
89
|
-
.default;
|
|
90
|
-
},
|
|
91
|
-
props: (row) => {
|
|
92
|
-
if (!row.overrides_roles_and_permissions)
|
|
93
|
-
return {
|
|
94
|
-
name: "inherited",
|
|
95
|
-
label: "Inherited",
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return row.roles.length === 1
|
|
99
|
-
? {
|
|
100
|
-
name: row.roles[0].name,
|
|
101
|
-
label: row.roles[0].label,
|
|
102
|
-
}
|
|
103
|
-
: { array: row.roles };
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
</script>
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
<!-- eslint-disable vue/no-mutating-props -->
|
|
2
|
-
<template>
|
|
3
|
-
<form class="" @submit.prevent="submit">
|
|
4
|
-
<template v-if="method !== 'patch'">
|
|
5
|
-
<el-basic
|
|
6
|
-
v-model="form.name"
|
|
7
|
-
name="name"
|
|
8
|
-
:error="form.errors"
|
|
9
|
-
type="text"
|
|
10
|
-
placeholder="Name"
|
|
11
|
-
label="Name"
|
|
12
|
-
/>
|
|
13
|
-
|
|
14
|
-
<el-basic
|
|
15
|
-
v-model="form.email"
|
|
16
|
-
placeholder="Email"
|
|
17
|
-
label="Email"
|
|
18
|
-
type="text"
|
|
19
|
-
name="email"
|
|
20
|
-
:error="form.errors"
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
Company: <span v-text="company?.name" />
|
|
24
|
-
|
|
25
|
-
<hr class="my-3 hr-muted" />
|
|
26
|
-
|
|
27
|
-
<el-checkbox
|
|
28
|
-
v-model="form.notify_user"
|
|
29
|
-
name="notify_user"
|
|
30
|
-
:error="form.errors"
|
|
31
|
-
label="Send email to notify user of account and password"
|
|
32
|
-
/>
|
|
33
|
-
<el-checkbox
|
|
34
|
-
v-model="form.force_password_change"
|
|
35
|
-
name="force_password_change"
|
|
36
|
-
:error="form.errors"
|
|
37
|
-
label="Force password change on first login"
|
|
38
|
-
/>
|
|
39
|
-
<el-checkbox
|
|
40
|
-
v-model="form.set_password"
|
|
41
|
-
name="set_password"
|
|
42
|
-
:error="form.errors"
|
|
43
|
-
label="Auto generate password"
|
|
44
|
-
/>
|
|
45
|
-
<template v-if="!form.set_password">
|
|
46
|
-
<el-basic
|
|
47
|
-
v-model="form.password"
|
|
48
|
-
name="password"
|
|
49
|
-
:error="form.errors"
|
|
50
|
-
type="password"
|
|
51
|
-
placeholder="Password"
|
|
52
|
-
label="Password"
|
|
53
|
-
/>
|
|
54
|
-
<el-basic
|
|
55
|
-
v-model="form.password_confirmation"
|
|
56
|
-
name="password_confirmation"
|
|
57
|
-
:error="form.errors"
|
|
58
|
-
type="password"
|
|
59
|
-
placeholder="Password Confirmation"
|
|
60
|
-
label="Password Confirmation"
|
|
61
|
-
/>
|
|
62
|
-
</template>
|
|
63
|
-
|
|
64
|
-
<hr class="my-5 hr-muted" />
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<template v-if="$store.getters.can('edit roles')">
|
|
68
|
-
<template v-if="enableRoles">
|
|
69
|
-
<el-button
|
|
70
|
-
type="secondary"
|
|
71
|
-
@click="
|
|
72
|
-
form.roles = [];
|
|
73
|
-
enableRoles = false;
|
|
74
|
-
"
|
|
75
|
-
>
|
|
76
|
-
Reset roles
|
|
77
|
-
</el-button>
|
|
78
|
-
<FormRole :form="form" />
|
|
79
|
-
</template>
|
|
80
|
-
<template v-else>
|
|
81
|
-
<el-button @click="enableRoles = true">
|
|
82
|
-
<GIcon name="icon-plus" embed asis class="fill-0 mr" />
|
|
83
|
-
Override roles
|
|
84
|
-
</el-button>
|
|
85
|
-
<p class="mt-2">
|
|
86
|
-
Roles will be inherited from the company level.
|
|
87
|
-
</p>
|
|
88
|
-
</template>
|
|
89
|
-
<hr class="my-5 hr-muted" />
|
|
90
|
-
</template>
|
|
91
|
-
|
|
92
|
-
<VFormFooter :loading="form.processing" />
|
|
93
|
-
</form>
|
|
94
|
-
</template>
|
|
95
|
-
|
|
96
|
-
<script>
|
|
97
|
-
import axios from "axios";
|
|
98
|
-
import { debounce } from "lodash";
|
|
99
|
-
|
|
100
|
-
export default {
|
|
101
|
-
components: {
|
|
102
|
-
VFormFooter: require("../../../../components/VFormFooter.vue").default,
|
|
103
|
-
FormRole: require("../../../../components/FormRole.vue").default,
|
|
104
|
-
},
|
|
105
|
-
props: {
|
|
106
|
-
form: {
|
|
107
|
-
required: true,
|
|
108
|
-
type: Object,
|
|
109
|
-
},
|
|
110
|
-
submit: {
|
|
111
|
-
required: true,
|
|
112
|
-
type: Function,
|
|
113
|
-
},
|
|
114
|
-
method: {
|
|
115
|
-
required: true,
|
|
116
|
-
type: String,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
data() {
|
|
121
|
-
return {
|
|
122
|
-
companies: null,
|
|
123
|
-
enableRoles: null,
|
|
124
|
-
company: null,
|
|
125
|
-
};
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
computed: {
|
|
129
|
-
domain() {
|
|
130
|
-
return this.form.email?.split("@")[1];
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
watch: {
|
|
135
|
-
"form.roles": {
|
|
136
|
-
handler(newVal) {
|
|
137
|
-
if (this.enableRoles === null) {
|
|
138
|
-
this.enableRoles = newVal.length > 0;
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
"form.email": debounce(function () {
|
|
143
|
-
if (this.domain) {
|
|
144
|
-
axios
|
|
145
|
-
.get("/api/companies", {
|
|
146
|
-
params: {
|
|
147
|
-
"filter[domains.domain]": this.domain,
|
|
148
|
-
},
|
|
149
|
-
})
|
|
150
|
-
.then((res) => {
|
|
151
|
-
this.company = res.data.data[0];
|
|
152
|
-
})
|
|
153
|
-
.catch((error) => {
|
|
154
|
-
console.error("Error fetching company:", error);
|
|
155
|
-
this.company = null;
|
|
156
|
-
});
|
|
157
|
-
} else {
|
|
158
|
-
this.company = null;
|
|
159
|
-
}
|
|
160
|
-
}, 500),
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
mounted() {
|
|
164
|
-
axios.getAll("/api/companies").then((res) => {
|
|
165
|
-
this.companies = res.data.data;
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
</script>
|
|
@@ -1,120 +0,0 @@
|
|
|
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
|
-
<template v-if="user">
|
|
11
|
-
<div class="bg-0 p-3 box-shadow-1 border-r-4 mb-6">
|
|
12
|
-
<VPageHeader
|
|
13
|
-
icon="icon-user"
|
|
14
|
-
:title="`${user.name} ${user.last_name ?? ''}`"
|
|
15
|
-
>
|
|
16
|
-
<el-button
|
|
17
|
-
v-if="$store.getters.can('write users')"
|
|
18
|
-
tag="a"
|
|
19
|
-
type="primary"
|
|
20
|
-
@click="
|
|
21
|
-
$router.push({
|
|
22
|
-
name: 'users.edit',
|
|
23
|
-
param: user.id,
|
|
24
|
-
})
|
|
25
|
-
"
|
|
26
|
-
>
|
|
27
|
-
<GIcon
|
|
28
|
-
class="fill-0 mr-0.5"
|
|
29
|
-
name="icon-edit"
|
|
30
|
-
embed
|
|
31
|
-
artboard
|
|
32
|
-
/>
|
|
33
|
-
Edit user
|
|
34
|
-
</el-button>
|
|
35
|
-
</VPageHeader>
|
|
36
|
-
|
|
37
|
-
<hr class="my-3 hr-muted" />
|
|
38
|
-
|
|
39
|
-
<table>
|
|
40
|
-
<tbody>
|
|
41
|
-
<tr>
|
|
42
|
-
<td class="p">Email</td>
|
|
43
|
-
<td class="p">{{ user.email }}</td>
|
|
44
|
-
</tr>
|
|
45
|
-
<tr>
|
|
46
|
-
<td class="p">Company</td>
|
|
47
|
-
<td class="p">
|
|
48
|
-
<router-link
|
|
49
|
-
:to="{
|
|
50
|
-
name: 'companies.show',
|
|
51
|
-
params: { id: user.company.id },
|
|
52
|
-
}"
|
|
53
|
-
>
|
|
54
|
-
{{ user.company?.name }}
|
|
55
|
-
</router-link>
|
|
56
|
-
</td>
|
|
57
|
-
</tr>
|
|
58
|
-
</tbody>
|
|
59
|
-
</table>
|
|
60
|
-
|
|
61
|
-
<hr class="my-3 hr-muted" />
|
|
62
|
-
|
|
63
|
-
<FormRole
|
|
64
|
-
:overrides="user.overrides_roles_and_permissions"
|
|
65
|
-
:form="{ roles: user.roles.map((d) => d.id) }"
|
|
66
|
-
:readonly="true"
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<div v-else class="absolute transform-center text-center">
|
|
72
|
-
<GSpinner class="fill-5" />
|
|
73
|
-
<p v-text="`Loading...`" />
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</template>
|
|
78
|
-
|
|
79
|
-
<script>
|
|
80
|
-
import axios from "axios";
|
|
81
|
-
|
|
82
|
-
export default {
|
|
83
|
-
name: "PShow",
|
|
84
|
-
|
|
85
|
-
components: {
|
|
86
|
-
VBreadcrumbs: require("../../../components/VBreadcrumbs.vue").default,
|
|
87
|
-
VPageHeader: require("../../../components/VPageHeader.vue").default,
|
|
88
|
-
FormRole: require("../../../components/FormRole.vue").default,
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
props: {
|
|
92
|
-
breadcrumbs: {
|
|
93
|
-
type: Array,
|
|
94
|
-
required: true,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
data() {
|
|
99
|
-
return {
|
|
100
|
-
user: null,
|
|
101
|
-
addBreadcrumbs: [...this.$props.breadcrumbs],
|
|
102
|
-
};
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
mounted() {
|
|
106
|
-
axios
|
|
107
|
-
.get(`/api/users/${this.$route.params.id}?include=company`)
|
|
108
|
-
.then((res) => {
|
|
109
|
-
this.user = res.data.data;
|
|
110
|
-
this.addBreadcrumbs.push({
|
|
111
|
-
href: {
|
|
112
|
-
name: "users.show",
|
|
113
|
-
param: this.user.id,
|
|
114
|
-
},
|
|
115
|
-
text: this.user.name,
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
</script>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<PageTitle title="Users" />
|
|
3
|
-
|
|
4
|
-
<router-view :key="$route.path" :breadcrumbs="breadcrumbs" />
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import PageTitle from "../../../../components/layout/pageTitle.vue";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
name: "PUsers",
|
|
12
|
-
|
|
13
|
-
components: {
|
|
14
|
-
PageTitle,
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
data() {
|
|
18
|
-
return {
|
|
19
|
-
breadcrumbs: [
|
|
20
|
-
{
|
|
21
|
-
href: {
|
|
22
|
-
name: "index",
|
|
23
|
-
},
|
|
24
|
-
text: "Home",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
href: {
|
|
28
|
-
name: "users.index",
|
|
29
|
-
},
|
|
30
|
-
text: "Users",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
</script>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|