@fishawack/lab-velocity 2.0.0-beta.20 → 2.0.0-beta.21

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.
@@ -41,7 +41,7 @@
41
41
  class="ml-2"
42
42
  @click="
43
43
  $router.push({
44
- name: `${jsonData.pageLink}.create`,
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.pageLink}.show`,
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.pageLink}.edit`,
75
+ name: `${jsonData.slug}.edit`,
76
76
  params: { id: item.id },
77
77
  })
78
78
  "
@@ -63,7 +63,7 @@ export default {
63
63
  let res = await this.form.post(`${this.resource.api}`);
64
64
 
65
65
  this.$router.replace({
66
- name: `${this.resource.name}.show`,
66
+ name: `${this.resource.slug}.show`,
67
67
  params: { id: res.data.id },
68
68
  });
69
69
  } catch (e) {
@@ -78,7 +78,7 @@ export default {
78
78
 
79
79
  this.addBreadcrumbs.push({
80
80
  href: {
81
- name: `${this.resource.name}.show`,
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.name}.show`,
100
+ name: `${this.resource.slug}.show`,
101
101
  params: { id: res.data.id },
102
102
  });
103
103
  } catch (e) {
@@ -86,7 +86,7 @@ export default {
86
86
  this.model = res.data.data;
87
87
  this.addBreadcrumbs.push({
88
88
  href: {
89
- name: `${this.resource.name}.show`,
89
+ name: `${this.resource.slug}.show`,
90
90
  param: this.model.id,
91
91
  },
92
92
  text: this.model.name,
@@ -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
- pageLink: name,
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,
@@ -83,7 +83,7 @@ export function meta(name = "default", properties = {}) {
83
83
  type: "primary",
84
84
  onClick: () => {
85
85
  $router.push({
86
- name: `${resource.name}.edit`,
86
+ name: `${resource.slug}.edit`,
87
87
  params: { id: model.id },
88
88
  });
89
89
  },
@@ -117,7 +117,7 @@ export function meta(name = "default", properties = {}) {
117
117
  );
118
118
 
119
119
  $router.push({
120
- name: `${resource.name}.index`,
120
+ name: `${resource.slug}.index`,
121
121
  });
122
122
  },
123
123
  },
@@ -231,7 +231,7 @@ export function routes(node, name, properties = {}) {
231
231
 
232
232
  return [
233
233
  {
234
- path: `/${resource.pageLink}`,
234
+ path: `/${resource.slug}`,
235
235
  component: node ? "" : require("../resource/parent.vue").default,
236
236
  name,
237
237
  meta: {
@@ -245,28 +245,28 @@ export function routes(node, name, properties = {}) {
245
245
  component: node
246
246
  ? ""
247
247
  : require("../resource/Children/index.vue").default,
248
- name: `${name}.index`,
248
+ name: `${resource.slug}.index`,
249
249
  },
250
250
  {
251
251
  path: "create",
252
252
  component: node
253
253
  ? ""
254
254
  : require("../resource/Children/create.vue").default,
255
- name: `${name}.create`,
255
+ name: `${resource.slug}.create`,
256
256
  },
257
257
  {
258
258
  path: ":id",
259
259
  component: node
260
260
  ? ""
261
261
  : require("../resource/Children/show.vue").default,
262
- name: `${name}.show`,
262
+ name: `${resource.slug}.show`,
263
263
  },
264
264
  {
265
265
  path: ":id/edit",
266
266
  component: node
267
267
  ? ""
268
268
  : require("../resource/Children/edit.vue").default,
269
- name: `${name}.edit`,
269
+ name: `${resource.slug}.edit`,
270
270
  },
271
271
  ],
272
272
  },
@@ -30,7 +30,7 @@ export default {
30
30
  },
31
31
  {
32
32
  href: {
33
- name: `${this.resource.name}.index`,
33
+ name: `${this.resource.slug}.index`,
34
34
  },
35
35
  text: this.resource.title,
36
36
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-velocity",
3
- "version": "2.0.0-beta.20",
3
+ "version": "2.0.0-beta.21",
4
4
  "description": "Avalere Health branded style system",
5
5
  "scripts": {
6
6
  "setup": "npm ci || npm i && npm run content",