@fishawack/lab-velocity 2.0.0-beta.20 → 2.0.0-beta.22
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/components/layout/TableSorter.vue +8 -4
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +2 -0
- package/_Build/vue/modules/resource/Children/create.vue +1 -1
- package/_Build/vue/modules/resource/Children/edit.vue +2 -2
- package/_Build/vue/modules/resource/Children/show.vue +1 -1
- package/_Build/vue/modules/resource/index.js +13 -11
- package/_Build/vue/modules/resource/parent.vue +1 -1
- package/package.json +1 -1
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
</VelBasic>
|
|
35
35
|
<slot v-if="displayActions" name="table-action">
|
|
36
36
|
<VelButton
|
|
37
|
-
v-if="
|
|
37
|
+
v-if="displayCreateAction"
|
|
38
38
|
size="large"
|
|
39
39
|
type="primary"
|
|
40
40
|
tag="a"
|
|
41
41
|
class="ml-2"
|
|
42
42
|
@click="
|
|
43
43
|
$router.push({
|
|
44
|
-
name: `${jsonData.
|
|
44
|
+
name: `${jsonData.slug}.create`,
|
|
45
45
|
})
|
|
46
46
|
"
|
|
47
47
|
>
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
:fixed-height="fixedHeight"
|
|
67
67
|
:target-action="
|
|
68
68
|
(item) => ({
|
|
69
|
-
name: `${jsonData.
|
|
69
|
+
name: `${jsonData.slug}.show`,
|
|
70
70
|
params: { id: item.id },
|
|
71
71
|
})
|
|
72
72
|
"
|
|
73
73
|
:edit-action="
|
|
74
74
|
(item) => ({
|
|
75
|
-
name: `${jsonData.
|
|
75
|
+
name: `${jsonData.slug}.edit`,
|
|
76
76
|
params: { id: item.id },
|
|
77
77
|
})
|
|
78
78
|
"
|
|
@@ -141,6 +141,10 @@ export default {
|
|
|
141
141
|
type: Boolean,
|
|
142
142
|
default: true,
|
|
143
143
|
},
|
|
144
|
+
displayCreateAction: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: true,
|
|
147
|
+
},
|
|
144
148
|
displayEditAction: {
|
|
145
149
|
type: Boolean,
|
|
146
150
|
default: true,
|
|
@@ -158,6 +158,8 @@ export default [
|
|
|
158
158
|
},
|
|
159
159
|
defaults: `include=company&filter[company_id]=${model.id}`,
|
|
160
160
|
"fixed-height": false,
|
|
161
|
+
"display-create-action":
|
|
162
|
+
$store.getters.can("write users"),
|
|
161
163
|
"display-edit-action":
|
|
162
164
|
$store.getters.can("write users"),
|
|
163
165
|
});
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
|
|
79
79
|
this.addBreadcrumbs.push({
|
|
80
80
|
href: {
|
|
81
|
-
name: `${this.resource.
|
|
81
|
+
name: `${this.resource.slug}.show`,
|
|
82
82
|
param: this.model.id,
|
|
83
83
|
},
|
|
84
84
|
text: this.model.name,
|
|
@@ -97,7 +97,7 @@ export default {
|
|
|
97
97
|
);
|
|
98
98
|
|
|
99
99
|
this.$router.replace({
|
|
100
|
-
name: `${this.resource.
|
|
100
|
+
name: `${this.resource.slug}.show`,
|
|
101
101
|
params: { id: res.data.id },
|
|
102
102
|
});
|
|
103
103
|
} catch (e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { merge } from "lodash";
|
|
3
|
+
import { merge, kebabCase } from "lodash";
|
|
4
4
|
import axios from "axios";
|
|
5
5
|
import { h, resolveComponent } from "vue";
|
|
6
6
|
|
|
@@ -20,8 +20,8 @@ export function meta(name = "default", properties = {}) {
|
|
|
20
20
|
singular,
|
|
21
21
|
label: singular,
|
|
22
22
|
multiLabel: name,
|
|
23
|
-
|
|
24
|
-
api: `/api/${name}`,
|
|
23
|
+
slug: properties?.slug || kebabCase(name),
|
|
24
|
+
api: `/api/${properties?.slug || kebabCase(name)}`,
|
|
25
25
|
permissions: {
|
|
26
26
|
create: () => true,
|
|
27
27
|
edit: () => true,
|
|
@@ -64,8 +64,10 @@ export function meta(name = "default", properties = {}) {
|
|
|
64
64
|
},
|
|
65
65
|
defaults: resource.defaults,
|
|
66
66
|
"fixed-height": false,
|
|
67
|
-
"display-
|
|
67
|
+
"display-create-action":
|
|
68
68
|
resource.permissions.create(props),
|
|
69
|
+
"display-edit-action":
|
|
70
|
+
resource.permissions.edit(props),
|
|
69
71
|
});
|
|
70
72
|
},
|
|
71
73
|
],
|
|
@@ -83,7 +85,7 @@ export function meta(name = "default", properties = {}) {
|
|
|
83
85
|
type: "primary",
|
|
84
86
|
onClick: () => {
|
|
85
87
|
$router.push({
|
|
86
|
-
name: `${resource.
|
|
88
|
+
name: `${resource.slug}.edit`,
|
|
87
89
|
params: { id: model.id },
|
|
88
90
|
});
|
|
89
91
|
},
|
|
@@ -117,7 +119,7 @@ export function meta(name = "default", properties = {}) {
|
|
|
117
119
|
);
|
|
118
120
|
|
|
119
121
|
$router.push({
|
|
120
|
-
name: `${resource.
|
|
122
|
+
name: `${resource.slug}.index`,
|
|
121
123
|
});
|
|
122
124
|
},
|
|
123
125
|
},
|
|
@@ -231,7 +233,7 @@ export function routes(node, name, properties = {}) {
|
|
|
231
233
|
|
|
232
234
|
return [
|
|
233
235
|
{
|
|
234
|
-
path: `/${resource.
|
|
236
|
+
path: `/${resource.slug}`,
|
|
235
237
|
component: node ? "" : require("../resource/parent.vue").default,
|
|
236
238
|
name,
|
|
237
239
|
meta: {
|
|
@@ -245,28 +247,28 @@ export function routes(node, name, properties = {}) {
|
|
|
245
247
|
component: node
|
|
246
248
|
? ""
|
|
247
249
|
: require("../resource/Children/index.vue").default,
|
|
248
|
-
name: `${
|
|
250
|
+
name: `${resource.slug}.index`,
|
|
249
251
|
},
|
|
250
252
|
{
|
|
251
253
|
path: "create",
|
|
252
254
|
component: node
|
|
253
255
|
? ""
|
|
254
256
|
: require("../resource/Children/create.vue").default,
|
|
255
|
-
name: `${
|
|
257
|
+
name: `${resource.slug}.create`,
|
|
256
258
|
},
|
|
257
259
|
{
|
|
258
260
|
path: ":id",
|
|
259
261
|
component: node
|
|
260
262
|
? ""
|
|
261
263
|
: require("../resource/Children/show.vue").default,
|
|
262
|
-
name: `${
|
|
264
|
+
name: `${resource.slug}.show`,
|
|
263
265
|
},
|
|
264
266
|
{
|
|
265
267
|
path: ":id/edit",
|
|
266
268
|
component: node
|
|
267
269
|
? ""
|
|
268
270
|
: require("../resource/Children/edit.vue").default,
|
|
269
|
-
name: `${
|
|
271
|
+
name: `${resource.slug}.edit`,
|
|
270
272
|
},
|
|
271
273
|
],
|
|
272
274
|
},
|