@live-change/frontend-auto-form 0.9.199 → 0.9.200
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/front/src/components/crud/AutoObjectIdentification.vue +1 -1
- package/front/src/components/crud/InjectedObjectIndentification.vue +1 -1
- package/front/src/components/crud/ObjectPath.vue +13 -9
- package/front/src/logic/actionData.js +2 -0
- package/front/src/logic/editorData.js +9 -2
- package/front/src/logic/validation.js +3 -3
- package/front/src/logic/viewData.js +3 -1
- package/package.json +13 -13
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<pre>selectedPaths = {{ selectedPaths }}</pre>
|
|
7
7
|
<pre>selectedPathWithElements = {{ selectedPathWithElements }}</pre> -->
|
|
8
8
|
<div v-for="path in selectedPathsWithElements" :key="path">
|
|
9
|
-
<Breadcrumb :model="more ? [...path, '
|
|
9
|
+
<Breadcrumb :model="more ? [...path, ...pathObjects, 'placeholder'] : [...path, ...pathObjects]"
|
|
10
10
|
:pt="{
|
|
11
11
|
list: {
|
|
12
12
|
class: 'text-sm flex flex-row flex-wrap gap-2 first:negative-margin-left pl-[1.5rem]'
|
|
@@ -46,9 +46,13 @@
|
|
|
46
46
|
more: {
|
|
47
47
|
type: Boolean,
|
|
48
48
|
default: false
|
|
49
|
+
},
|
|
50
|
+
pathObjects: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => []
|
|
49
53
|
}
|
|
50
54
|
})
|
|
51
|
-
const { objectType, object, more } = toRefs(props)
|
|
55
|
+
const { objectType, object, more, pathObjects } = toRefs(props)
|
|
52
56
|
|
|
53
57
|
import { usePath, live } from '@live-change/vue3-ssr'
|
|
54
58
|
const path = usePath()
|
|
@@ -87,7 +91,7 @@
|
|
|
87
91
|
} else {
|
|
88
92
|
elements.push({ objectType, object, propertyFrom: propertyName })
|
|
89
93
|
}
|
|
90
|
-
}
|
|
94
|
+
}
|
|
91
95
|
return elements
|
|
92
96
|
}
|
|
93
97
|
|
|
@@ -114,13 +118,13 @@
|
|
|
114
118
|
live(pathsPath)
|
|
115
119
|
])
|
|
116
120
|
|
|
117
|
-
const selectedPaths = computed(() =>
|
|
118
|
-
return objectPathConfig.scopeSelector(paths.value)
|
|
119
|
-
})
|
|
121
|
+
const selectedPaths = computed(() => objectPathConfig.scopeSelector(paths.value))
|
|
120
122
|
|
|
121
|
-
const selectedPathsWithElements = computed(
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
const selectedPathsWithElements = computed(() => {
|
|
124
|
+
const result = selectedPaths.value.map(scopePath => objectPathConfig.pathElements(scopePath))
|
|
125
|
+
if(result.length == 0) return [[{objectType: objectType.value, object: object.value}]]
|
|
126
|
+
return result
|
|
127
|
+
})
|
|
124
128
|
|
|
125
129
|
|
|
126
130
|
|
|
@@ -194,6 +194,7 @@ export default async function actionData(options) {
|
|
|
194
194
|
mergedInitialValue,
|
|
195
195
|
editableProperties,
|
|
196
196
|
value: synchronizedData.value,
|
|
197
|
+
data: synchronizedData.value,
|
|
197
198
|
changed,
|
|
198
199
|
submit,
|
|
199
200
|
submitting,
|
|
@@ -231,6 +232,7 @@ export default async function actionData(options) {
|
|
|
231
232
|
initialValue,
|
|
232
233
|
editableProperties,
|
|
233
234
|
value: formData,
|
|
235
|
+
data: formData,
|
|
234
236
|
changed,
|
|
235
237
|
submit,
|
|
236
238
|
submitting,
|
|
@@ -211,7 +211,7 @@ export default function editorData(options) {
|
|
|
211
211
|
|
|
212
212
|
const propertiesErrors = computed(() => propertiesValidationErrors(
|
|
213
213
|
synchronizedData.value.value, identifiers, model, lastUploadedData.value,
|
|
214
|
-
|
|
214
|
+
propertiesServerErrors.value, appContext, editableProperties))
|
|
215
215
|
|
|
216
216
|
async function save() {
|
|
217
217
|
const saveResult = await saveData(synchronizedData.value.value)
|
|
@@ -242,6 +242,7 @@ export default function editorData(options) {
|
|
|
242
242
|
return {
|
|
243
243
|
identifiers,
|
|
244
244
|
value: synchronizedData.value,
|
|
245
|
+
data: synchronizedData.value,
|
|
245
246
|
changed,
|
|
246
247
|
save,
|
|
247
248
|
saving,
|
|
@@ -257,6 +258,8 @@ export default function editorData(options) {
|
|
|
257
258
|
saved: savedData,
|
|
258
259
|
savedPath: savedDataPath,
|
|
259
260
|
editableSavedData,
|
|
261
|
+
editableDraftData,
|
|
262
|
+
defaultData: defaultData(model),
|
|
260
263
|
draft: draftData,
|
|
261
264
|
sourceChanged /// needed for draft discard on concurrent save
|
|
262
265
|
}
|
|
@@ -283,7 +286,7 @@ export default function editorData(options) {
|
|
|
283
286
|
|
|
284
287
|
const propertiesErrors = computed(() => propertiesValidationErrors(
|
|
285
288
|
synchronizedData.value.value, identifiers, model, lastUploadedData.value,
|
|
286
|
-
propertiesServerErrors.value, appContext))
|
|
289
|
+
propertiesServerErrors.value, appContext, editableProperties))
|
|
287
290
|
|
|
288
291
|
async function reset() {
|
|
289
292
|
synchronizedData.value.value = editableSavedData.value || deepmerge(defaultData(model), initialData)
|
|
@@ -294,11 +297,15 @@ export default function editorData(options) {
|
|
|
294
297
|
return {
|
|
295
298
|
identifiers,
|
|
296
299
|
value: synchronizedData.value,
|
|
300
|
+
data: synchronizedData.value,
|
|
297
301
|
changed: synchronizedData.changed,
|
|
298
302
|
save: synchronizedData.save,
|
|
299
303
|
saving: synchronizedData.saving,
|
|
300
304
|
saved: savedData,
|
|
301
305
|
savedPath: savedDataPath,
|
|
306
|
+
editableProperties,
|
|
307
|
+
editableSavedData,
|
|
308
|
+
defaultData: defaultData(model),
|
|
302
309
|
isNew,
|
|
303
310
|
propertiesErrors,
|
|
304
311
|
reset,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { validateData } from "@live-change/vue3-components"
|
|
2
2
|
|
|
3
|
-
export function propertiesValidationErrors(rootValue, parameters, definition, lastData, propertiesServerErrors, appContext) {
|
|
3
|
+
export function propertiesValidationErrors(rootValue, parameters, definition, lastData, propertiesServerErrors, appContext, validatedProperties) {
|
|
4
4
|
const currentValue = {
|
|
5
5
|
...parameters,
|
|
6
6
|
...rootValue,
|
|
@@ -10,10 +10,10 @@ export function propertiesValidationErrors(rootValue, parameters, definition, la
|
|
|
10
10
|
lastData, propertiesServerErrors, appContext) */
|
|
11
11
|
|
|
12
12
|
const validationResult = validateData(definition, currentValue, 'validation', appContext,
|
|
13
|
-
'', rootValue, true)
|
|
13
|
+
'', rootValue, true, validatedProperties)
|
|
14
14
|
|
|
15
15
|
const softValidationResult = validateData(definition, currentValue, 'softValidation', appContext,
|
|
16
|
-
'', rootValue, true)
|
|
16
|
+
'', rootValue, true, validatedProperties)
|
|
17
17
|
|
|
18
18
|
const serverValidationResult = {}
|
|
19
19
|
if(propertiesServerErrors) {
|
|
@@ -28,7 +28,9 @@ export default async function viewData(options) {
|
|
|
28
28
|
|
|
29
29
|
const savedDataPath = path[serviceName][crudMethods.read]({
|
|
30
30
|
[modelName[0].toLowerCase() + modelName.slice(1)]: id
|
|
31
|
-
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
console.log("SAVED DATA PATH", savedDataPath)
|
|
32
34
|
|
|
33
35
|
let data
|
|
34
36
|
let error
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/frontend-auto-form",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.200",
|
|
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.
|
|
26
|
-
"@live-change/dao": "^0.9.
|
|
27
|
-
"@live-change/dao-vue3": "^0.9.
|
|
28
|
-
"@live-change/dao-websocket": "^0.9.
|
|
29
|
-
"@live-change/framework": "^0.9.
|
|
30
|
-
"@live-change/image-frontend": "^0.9.
|
|
31
|
-
"@live-change/image-service": "^0.9.
|
|
32
|
-
"@live-change/session-service": "^0.9.
|
|
33
|
-
"@live-change/vue3-components": "^0.9.
|
|
34
|
-
"@live-change/vue3-ssr": "^0.9.
|
|
25
|
+
"@live-change/cli": "^0.9.200",
|
|
26
|
+
"@live-change/dao": "^0.9.200",
|
|
27
|
+
"@live-change/dao-vue3": "^0.9.200",
|
|
28
|
+
"@live-change/dao-websocket": "^0.9.200",
|
|
29
|
+
"@live-change/framework": "^0.9.200",
|
|
30
|
+
"@live-change/image-frontend": "^0.9.200",
|
|
31
|
+
"@live-change/image-service": "^0.9.200",
|
|
32
|
+
"@live-change/session-service": "^0.9.200",
|
|
33
|
+
"@live-change/vue3-components": "^0.9.200",
|
|
34
|
+
"@live-change/vue3-ssr": "^0.9.200",
|
|
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.
|
|
55
|
+
"@live-change/codeceptjs-helper": "^0.9.200",
|
|
56
56
|
"codeceptjs": "^3.7.6",
|
|
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": "
|
|
66
|
+
"gitHead": "a509834e600a546297faa7d1534b6f52e66d2e66"
|
|
67
67
|
}
|