@live-change/frontend-auto-form 0.9.113 → 0.9.114

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.
@@ -32,17 +32,33 @@
32
32
 
33
33
  </div>
34
34
 
35
- <div v-if="connectedActions"
36
- class="bg-surface-0 dark:bg-surface-900 p-4 shadow-sm rounded-border mb-6">
37
- <div class="text-xl mb-3">
38
- Actions
35
+ <div class="flex flex-row flex-wrap gap-2">
36
+ <div v-if="connectedActions"
37
+ class="bg-surface-0 dark:bg-surface-900 p-4 shadow-sm rounded-border mb-6 flex-1 flex-grow">
38
+ <div class="text-xl mb-3">
39
+ Actions
40
+ </div>
41
+ <div class="flex flex-row flex-wrap gap-2">
42
+ <div v-for="action of connectedActions" class="mb-0">
43
+ <!-- <pre>{{ action }}</pre> -->
44
+ <router-link :to="actionRoute(action)">
45
+ <Button :label="action.label" icon="pi pi-play" class="p-button mb-0" />
46
+ </router-link>
47
+ </div>
48
+ </div>
39
49
  </div>
40
- <div class="flex flex-row flex-wrap gap-2">
41
- <div v-for="action of connectedActions" class="mb-0">
42
- <!-- <pre>{{ action }}</pre> -->
43
- <router-link :to="actionRoute(action)">
44
- <Button :label="action.label" icon="pi pi-play" class="p-button mb-0" />
45
- </router-link>
50
+ <div v-if="connectedPages"
51
+ class="bg-surface-0 dark:bg-surface-900 p-4 shadow-sm rounded-border mb-6 flex-1 flex-grow">
52
+ <div class="text-xl mb-3">
53
+ Pages
54
+ </div>
55
+ <div class="flex flex-row flex-wrap gap-2">
56
+ <div v-for="page of connectedPages" class="mb-0">
57
+ <!-- <pre>{{ action }}</pre> -->
58
+ <router-link :to="pageRoute(page)">
59
+ <Button :label="page.label" icon="pi pi-external-link" class="p-button mb-0" />
60
+ </router-link>
61
+ </div>
46
62
  </div>
47
63
  </div>
48
64
  </div>
@@ -207,6 +223,17 @@
207
223
  })
208
224
  })
209
225
 
226
+ const connectedPages = computed(() => {
227
+ const srcPages = modelDefinition.value?.connectedPages
228
+ if(!srcPages) return null
229
+ return Object.values(srcPages).map(page => {
230
+ return {
231
+ ...page,
232
+ label: page.label ?? page.name
233
+ }
234
+ })
235
+ })
236
+
210
237
  import { getForwardRelations, getBackwardRelations, anyRelationsTypes, prepareObjectRelations }
211
238
  from '../../logic/relations.js'
212
239
  const forwardRelations = computed(() => getForwardRelations(modelDefinition.value, () => true, api))
@@ -297,6 +324,17 @@
297
324
  }
298
325
  }
299
326
 
327
+ function pageRoute(page) {
328
+ const modelName = model.value
329
+ const modelProperty = modelName[0].toLowerCase() + modelName.slice(1)
330
+ return {
331
+ name: page.name,
332
+ params: {
333
+ ...page.params,
334
+ [modelProperty]: object.value.to ?? object.value.id
335
+ }
336
+ }
337
+ }
300
338
  </script>
301
339
 
302
340
  <style scoped>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/frontend-auto-form",
3
- "version": "0.9.113",
3
+ "version": "0.9.114",
4
4
  "scripts": {
5
5
  "memDev": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
@@ -22,16 +22,16 @@
22
22
  "type": "module",
23
23
  "dependencies": {
24
24
  "@fortawesome/fontawesome-free": "^6.7.2",
25
- "@live-change/cli": "^0.9.113",
26
- "@live-change/dao": "^0.9.113",
27
- "@live-change/dao-vue3": "^0.9.113",
28
- "@live-change/dao-websocket": "^0.9.113",
29
- "@live-change/framework": "^0.9.113",
30
- "@live-change/image-frontend": "^0.9.113",
31
- "@live-change/image-service": "^0.9.113",
32
- "@live-change/session-service": "^0.9.113",
33
- "@live-change/vue3-components": "^0.9.113",
34
- "@live-change/vue3-ssr": "^0.9.113",
25
+ "@live-change/cli": "^0.9.114",
26
+ "@live-change/dao": "^0.9.114",
27
+ "@live-change/dao-vue3": "^0.9.114",
28
+ "@live-change/dao-websocket": "^0.9.114",
29
+ "@live-change/framework": "^0.9.114",
30
+ "@live-change/image-frontend": "^0.9.114",
31
+ "@live-change/image-service": "^0.9.114",
32
+ "@live-change/session-service": "^0.9.114",
33
+ "@live-change/vue3-components": "^0.9.114",
34
+ "@live-change/vue3-ssr": "^0.9.114",
35
35
  "@vueuse/core": "^12.3.0",
36
36
  "codeceptjs-assert": "^0.0.5",
37
37
  "compression": "^1.7.5",
@@ -52,7 +52,7 @@
52
52
  "vue3-scroll-border": "0.1.7"
53
53
  },
54
54
  "devDependencies": {
55
- "@live-change/codeceptjs-helper": "^0.9.113",
55
+ "@live-change/codeceptjs-helper": "^0.9.114",
56
56
  "codeceptjs": "^3.6.10",
57
57
  "generate-password": "1.7.1",
58
58
  "playwright": "1.49.1",
@@ -63,5 +63,5 @@
63
63
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
64
64
  "license": "ISC",
65
65
  "description": "",
66
- "gitHead": "8bf5b441c3b006618e5d2c0cc9acc838b405ed3d"
66
+ "gitHead": "aaec3f6cef06e910e6dea5dc573df24288c9997c"
67
67
  }