@ditojs/admin 2.27.3 → 2.28.1

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": "@ditojs/admin",
3
- "version": "2.27.3",
3
+ "version": "2.28.1",
4
4
  "type": "module",
5
5
  "description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -33,8 +33,8 @@
33
33
  "not ie_mob > 0"
34
34
  ],
35
35
  "dependencies": {
36
- "@ditojs/ui": "^2.27.3",
37
- "@ditojs/utils": "^2.27.0",
36
+ "@ditojs/ui": "^2.28.0",
37
+ "@ditojs/utils": "^2.28.0",
38
38
  "@kyvg/vue3-notification": "^3.2.1",
39
39
  "@lk77/vue3-color": "^3.0.6",
40
40
  "@tiptap/core": "^2.3.0",
@@ -74,7 +74,7 @@
74
74
  "vue-upload-component": "^3.1.15"
75
75
  },
76
76
  "devDependencies": {
77
- "@ditojs/build": "^2.27.0",
77
+ "@ditojs/build": "^2.28.0",
78
78
  "@vitejs/plugin-vue": "^5.0.4",
79
79
  "@vue/compiler-sfc": "3.4.23",
80
80
  "pug": "^3.0.2",
@@ -83,7 +83,7 @@
83
83
  "vite": "^5.2.10"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "f015eea94dbfc9950c768cda9130663ff29253fb",
86
+ "gitHead": "19a0a2b37e1b5d2089079b6d624912f2a3f03f60",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -322,8 +322,8 @@ export default DitoComponent.component('DitoForm', {
322
322
  },
323
323
 
324
324
  // @override ResourceMixin.getResource()
325
- getResource(defaults) {
326
- const resource = ResourceMixin.methods.getResource.call(this, defaults)
325
+ getResource(options) {
326
+ const resource = ResourceMixin.methods.getResource.call(this, options)
327
327
  return getMemberResource(this.itemId, resource) || resource
328
328
  },
329
329
 
@@ -314,7 +314,10 @@ export default {
314
314
  resource = getResource(resource, {
315
315
  // Resources without a parent inherit the one from `dataComponent`
316
316
  // automatically.
317
- parent: this.dataComponent?.resource ?? null
317
+ parent: this.dataComponent?.getResource({
318
+ method: resource?.method,
319
+ child: resource
320
+ }) ?? null
318
321
  })
319
322
  return this.api.resources.any(resource)
320
323
  },
@@ -124,13 +124,18 @@ export default {
124
124
  },
125
125
 
126
126
  methods: {
127
- getResource(defaults = { method: 'get' }) {
127
+ getResource({ method = 'get', child } = {}) {
128
128
  // Returns the resource object representing the resource for the
129
129
  // associated source schema.
130
- return getResource(this.sourceSchema?.resource, {
130
+ const resource = this.sourceSchema?.resource
131
+ return getResource(resource, {
131
132
  type: 'collection',
132
- parent: this.parentResourceComponent?.resource ?? null,
133
- ...defaults
133
+ method,
134
+ parent: this.parentResourceComponent?.getResource({
135
+ method,
136
+ child: resource
137
+ }) ?? null,
138
+ child
134
139
  })
135
140
  },
136
141
 
@@ -285,8 +290,12 @@ export default {
285
290
  },
286
291
 
287
292
  async submit(button) {
288
- const resource = getResource(button.schema.resource, {
289
- parent: this.resource
293
+ let { resource } = button.schema
294
+ resource = getResource(resource, {
295
+ parent: this.getResource({
296
+ method: resource?.method,
297
+ child: resource
298
+ })
290
299
  })
291
300
  if (resource) {
292
301
  const { method } = resource
@@ -209,9 +209,9 @@ export default DitoTypeComponent.register('markup', {
209
209
  const onFocus = () => this.onFocus()
210
210
 
211
211
  const onBlur = ({ editor }) => {
212
- // This change handling code on blur is only needed to simplify making e2e
213
- // testing through puppeteer works, since we couldn't figure out how to
214
- // trigger tiptap's update events programmatically from the outside.
212
+ // This change handling code on blur is only needed to make e2e testing
213
+ // through puppeteer work, since we couldn't figure out how to trigger
214
+ // tiptap's update events programmatically from the outside.
215
215
  const value = editor.getHTML()
216
216
  if (value !== this.value) {
217
217
  this.value = value
@@ -259,6 +259,7 @@ export default DitoTypeComponent.register('upload', {
259
259
  uploadPath() {
260
260
  return this.getResourceUrl({
261
261
  type: 'upload',
262
+ method: 'post',
262
263
  path: this.api.normalizePath(this.dataPath)
263
264
  })
264
265
  }