@fishawack/lab-velocity 2.0.0-beta.14 → 2.0.0-beta.15
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 +12 -1
- package/_Build/vue/components/layout/Table.vue +3 -1
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +6 -6
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +9 -9
- package/_Build/vue/modules/resource/Children/edit.vue +1 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,6 +78,17 @@ import { Auth } from "@fishawack/lab-velocity";
|
|
|
78
78
|
];
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
You can override the default setup for companies & user resources by passing an optional second object to the `adminRoutes` method. See the [resources](#Resources) section below for available options.
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
...Auth.Router.adminRoutes(node, {
|
|
85
|
+
userResource: {
|
|
86
|
+
label: "Custom User label",
|
|
87
|
+
api: `/api/v2/users`,
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
81
92
|
### Configure store
|
|
82
93
|
|
|
83
94
|
##### store.js
|
|
@@ -392,7 +403,7 @@ Structure arrays take objects. The objects require a key only but have other opt
|
|
|
392
403
|
},
|
|
393
404
|
{
|
|
394
405
|
key: "role",
|
|
395
|
-
render: (
|
|
406
|
+
render: () => h("div", "Custom template"),
|
|
396
407
|
},
|
|
397
408
|
],
|
|
398
409
|
},
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
>
|
|
23
23
|
<!-- Support a custom render function -->
|
|
24
24
|
<template v-if="item.render" #default="scope">
|
|
25
|
-
<component
|
|
25
|
+
<component
|
|
26
|
+
:is="item.render({ model: scope.row, ...this })"
|
|
27
|
+
/>
|
|
26
28
|
</template>
|
|
27
29
|
</el-table-column>
|
|
28
30
|
</template>
|
|
@@ -48,15 +48,15 @@ export default [
|
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
key: "role",
|
|
51
|
-
render: (
|
|
51
|
+
render: ({ model }) =>
|
|
52
52
|
h(
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
model.roles.length === 1 ? Chip : Chips,
|
|
54
|
+
model.roles.length === 1
|
|
55
55
|
? {
|
|
56
|
-
name:
|
|
57
|
-
label:
|
|
56
|
+
name: model.roles[0].name,
|
|
57
|
+
label: model.roles[0].label,
|
|
58
58
|
}
|
|
59
|
-
: { array:
|
|
59
|
+
: { array: model.roles },
|
|
60
60
|
),
|
|
61
61
|
},
|
|
62
62
|
],
|
|
@@ -125,7 +125,7 @@ export default [
|
|
|
125
125
|
{
|
|
126
126
|
key: "company",
|
|
127
127
|
sortable: true,
|
|
128
|
-
render: (model) =>
|
|
128
|
+
render: ({ model }) =>
|
|
129
129
|
h(resolveComponent("router-link"), {
|
|
130
130
|
class: "underline",
|
|
131
131
|
to: {
|
|
@@ -137,23 +137,23 @@ export default [
|
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
key: "role",
|
|
140
|
-
render: (
|
|
140
|
+
render: ({ model }) =>
|
|
141
141
|
h(
|
|
142
|
-
!
|
|
143
|
-
|
|
142
|
+
!model.overrides_roles_and_permissions ||
|
|
143
|
+
model.roles.length === 1
|
|
144
144
|
? Chip
|
|
145
145
|
: Chips,
|
|
146
|
-
!
|
|
146
|
+
!model.overrides_roles_and_permissions
|
|
147
147
|
? {
|
|
148
148
|
name: "inherited",
|
|
149
149
|
label: "Inherited",
|
|
150
150
|
}
|
|
151
|
-
:
|
|
151
|
+
: model.roles.length === 1
|
|
152
152
|
? {
|
|
153
|
-
name:
|
|
154
|
-
label:
|
|
153
|
+
name: model.roles[0].name,
|
|
154
|
+
label: model.roles[0].label,
|
|
155
155
|
}
|
|
156
|
-
: { array:
|
|
156
|
+
: { array: model.roles },
|
|
157
157
|
),
|
|
158
158
|
},
|
|
159
159
|
],
|