@ditojs/admin 1.20.0 → 1.21.0

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": "1.20.0",
3
+ "version": "1.21.0",
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",
@@ -39,11 +39,11 @@
39
39
  "not ie_mob > 0"
40
40
  ],
41
41
  "dependencies": {
42
- "@ditojs/build": "^1.20.0",
43
- "@ditojs/ui": "^1.20.0",
44
- "@ditojs/utils": "^1.20.0",
42
+ "@ditojs/build": "^1.21.0",
43
+ "@ditojs/ui": "^1.21.0",
44
+ "@ditojs/utils": "^1.21.0",
45
45
  "codeflask": "^1.4.1",
46
- "filesize": "^10.0.5",
46
+ "filesize": "^10.0.6",
47
47
  "filesize-parser": "^1.5.0",
48
48
  "nanoid": "^4.0.0",
49
49
  "tinycolor2": "^1.4.2",
@@ -65,12 +65,12 @@
65
65
  "devDependencies": {
66
66
  "@ditojs/build": "^1.19.0",
67
67
  "pug": "^3.0.2",
68
- "sass": "1.56.1",
69
- "type-fest": "^3.3.0",
70
- "typescript": "^4.9.3",
71
- "vite": "^3.2.5",
68
+ "sass": "1.56.2",
69
+ "type-fest": "^3.4.0",
70
+ "typescript": "^4.9.4",
71
+ "vite": "^4.0.1",
72
72
  "vite-plugin-vue2": "^2.0.2"
73
73
  },
74
74
  "types": "types",
75
- "gitHead": "049aa3611927f3f096bc6230f0ce93e1419303e4"
75
+ "gitHead": "a9dd1a854dbf2928a92c0be6481d704bd579cfdc"
76
76
  }
package/src/DitoAdmin.js CHANGED
@@ -22,9 +22,11 @@ Vue.use(VueRouter)
22
22
  Vue.use(VueModal, { dynamic: true })
23
23
  Vue.use(VueNotifications)
24
24
 
25
- // Workaround for a strange Vite hot-reloading bug, see:
26
- // https://github.com/vitejs/vite/issues/7839#issuecomment-1340109679
27
- import.meta.hot?.on('vite:beforeUpdate', onBeforeViteUpdate)
25
+ if (import.meta.hot) {
26
+ // Workaround for a strange Vite hot-reloading bug, see:
27
+ // https://github.com/vitejs/vite/issues/7839#issuecomment-1340109679
28
+ import.meta.hot.on('vite:beforeUpdate', onBeforeViteUpdate)
29
+ }
28
30
 
29
31
  export default class DitoAdmin {
30
32
  constructor(el, {
@@ -245,19 +245,11 @@ export default {
245
245
  const { response } = error
246
246
  if (!callback(error, response)) {
247
247
  const data = response?.data
248
- if (data && isString(data.type)) {
249
- this.notify({
250
- type: 'error',
251
- title: labelize(data.type),
252
- text: data.message || error
253
- })
254
- } else {
255
- this.notify({
256
- type: 'error',
257
- title: 'Request Error',
258
- text: error
259
- })
260
- }
248
+ const title = isString(data?.type)
249
+ ? labelize(data.type)
250
+ : 'Error'
251
+ const text = data?.message ?? error
252
+ this.notify({ type: 'error', title, text })
261
253
  }
262
254
  }
263
255
  this.setLoading(false, loadingOptions)