@live-change/frontend-auto-form 0.8.137 → 0.8.139

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.
@@ -97,14 +97,18 @@ export default function editorData(options) {
97
97
  let savePromise = null
98
98
  const saving = ref(false)
99
99
  async function saveData(data){
100
+ const requestData = {
101
+ ...(updateDataProperty ? { [updateDataProperty]: data } : data),
102
+ ...identifiers
103
+ }
100
104
  if(savePromise) await savePromise // wait for previous save
101
105
  saving.value = true
102
106
  savePromise = (async () => {
103
107
  try {
104
108
  if(savedData.value) {
105
- return updateAction(data)
109
+ return updateAction(requestData)
106
110
  } else {
107
- const createResult = await createAction(data)
111
+ const createResult = await createAction(requestData)
108
112
  await onCreated(createResult)
109
113
  return createResult
110
114
  }
@@ -113,7 +117,8 @@ export default function editorData(options) {
113
117
  savePromise = null
114
118
  }
115
119
  })()
116
- if(!autoSave && workingZone) workingZone.addPromise(savePromise.catch(() => {}))
120
+ if(!autoSave && workingZone)
121
+ workingZone.addPromise('save:'+serviceName+':'+modelName, savePromise.catch(() => {}))
117
122
  await savePromise
118
123
  }
119
124
 
@@ -147,9 +152,8 @@ export default function editorData(options) {
147
152
  const sourceChanged = computed(() =>
148
153
  JSON.stringify(draftData.value.from) !== JSON.stringify(editableSavedData.value))
149
154
 
150
-
151
155
  async function save() {
152
- await saveData()
156
+ await saveData(synchronizedData.value.value)
153
157
  if(draftData.value) await removeDraftAction(draftIdentifiers)
154
158
  onSaved()
155
159
  if(toast && savedToast) toast.add({ severity: 'success', summary: savedToast, life: 1500 })
@@ -157,7 +161,8 @@ export default function editorData(options) {
157
161
 
158
162
  async function discardDraft() {
159
163
  const discardPromise = removeDraftAction(draftIdentifiers)
160
- if(workingZone) workingZone.addPromise(discardPromise)
164
+ if(workingZone)
165
+ workingZone.addPromise('discardDraft:'+serviceName+':'+modelName, discardPromise)
161
166
  await discardPromise
162
167
  onDraftDiscarded()
163
168
  if(toast && discardedDraftToast) toast.add({ severity: 'info', summary: discardedDraftToast, life: 1500 })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/frontend-auto-form",
3
- "version": "0.8.137",
3
+ "version": "0.8.139",
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.5.2",
25
- "@live-change/cli": "^0.8.137",
26
- "@live-change/dao": "^0.8.137",
27
- "@live-change/dao-vue3": "^0.8.137",
28
- "@live-change/dao-websocket": "^0.8.137",
29
- "@live-change/framework": "^0.8.137",
30
- "@live-change/image-frontend": "^0.8.137",
31
- "@live-change/image-service": "^0.8.137",
32
- "@live-change/session-service": "^0.8.137",
33
- "@live-change/vue3-components": "^0.8.137",
34
- "@live-change/vue3-ssr": "^0.8.137",
25
+ "@live-change/cli": "^0.8.139",
26
+ "@live-change/dao": "^0.8.139",
27
+ "@live-change/dao-vue3": "^0.8.139",
28
+ "@live-change/dao-websocket": "^0.8.139",
29
+ "@live-change/framework": "^0.8.139",
30
+ "@live-change/image-frontend": "^0.8.139",
31
+ "@live-change/image-service": "^0.8.139",
32
+ "@live-change/session-service": "^0.8.139",
33
+ "@live-change/vue3-components": "^0.8.139",
34
+ "@live-change/vue3-ssr": "^0.8.139",
35
35
  "@vueuse/core": "^10.11.0",
36
36
  "codeceptjs-assert": "^0.0.5",
37
37
  "compression": "^1.7.4",
@@ -52,7 +52,7 @@
52
52
  "vue3-scroll-border": "0.1.6"
53
53
  },
54
54
  "devDependencies": {
55
- "@live-change/codeceptjs-helper": "^0.8.137",
55
+ "@live-change/codeceptjs-helper": "^0.8.139",
56
56
  "codeceptjs": "^3.6.5",
57
57
  "generate-password": "1.7.1",
58
58
  "playwright": "^1.41.2",
@@ -63,5 +63,5 @@
63
63
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
64
64
  "license": "ISC",
65
65
  "description": "",
66
- "gitHead": "cb42255fbe7aa794dc5d7a6e57250ce8c959acf9"
66
+ "gitHead": "7f54396b91dc7b596380ec4d8b182c12c765fc6f"
67
67
  }