qdadm 0.51.3 → 0.51.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdadm",
3
- "version": "0.51.3",
3
+ "version": "0.51.4",
4
4
  "description": "Vue 3 framework for admin dashboards with PrimeVue",
5
5
  "author": "quazardous",
6
6
  "license": "MIT",
@@ -99,7 +99,7 @@ export function useEntityItemFormPage(config = {}) {
99
99
  // Form options
100
100
  loadOnMount = true,
101
101
  enableGuard = true,
102
- redirectOnCreate = true, // Redirect to edit mode after create
102
+ // redirectOnCreate removed: "Create" now resets form, "Create & Close" navigates
103
103
  usePatch = false, // Use PATCH instead of PUT for updates
104
104
  // Hooks for custom behavior
105
105
  transformLoad = (data) => data,
@@ -319,20 +319,24 @@ export function useEntityItemFormPage(config = {}) {
319
319
  }
320
320
 
321
321
  if (andClose) {
322
- // For child entities, redirect to sibling list route with parent params
322
+ // Navigate to list route (or previous page)
323
323
  const listRoute = findListRoute()
324
324
  router.push(listRoute)
325
- } else if (!isEdit.value && redirectOnCreate) {
326
- // Redirect to edit mode after create (only for top-level entities)
327
- // Child entities with parent config go to list instead (edit route may not exist)
328
- if (parentConfig.value) {
329
- const listRoute = findListRoute()
330
- router.replace(listRoute)
331
- } else {
332
- const newId = responseData[manager.idField] || responseData.id || responseData.key
333
- router.replace({ name: `${routePrefix}-${editRouteSuffix}`, params: { id: newId } })
334
- }
325
+ } else if (!isEdit.value) {
326
+ // "Create" without close: reset form for new entry, stay on route
327
+ data.value = deepClone(initialData)
328
+ originalData.value = null
329
+ takeSnapshot()
330
+ errors.value = {}
331
+ submitted.value = false
332
+ toast.add({
333
+ severity: 'info',
334
+ summary: 'Ready',
335
+ detail: 'Form reset for new entry',
336
+ life: 2000
337
+ })
335
338
  }
339
+ // Edit mode without close: just stay on page (data already updated)
336
340
 
337
341
  return responseData
338
342
  } catch (error) {