@ditojs/admin 2.2.7-debug.0 → 2.2.7-debug.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.2.7-debug.0",
3
+ "version": "2.2.7-debug.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",
@@ -82,7 +82,7 @@
82
82
  "vite": "^4.3.1"
83
83
  },
84
84
  "types": "types",
85
- "gitHead": "3e466e0a94142eda903705f977712e4080b50ebb",
85
+ "gitHead": "e79299ffdc4c7d26653f609bff4eb6d5df0ab07e",
86
86
  "scripts": {
87
87
  "build": "vite build",
88
88
  "watch": "yarn build --mode 'development' --watch",
@@ -3,7 +3,6 @@ import ResourceMixin from './ResourceMixin.js'
3
3
  import SchemaParentMixin from '../mixins/SchemaParentMixin.js'
4
4
  import { getSchemaAccessor, getStoreAccessor } from '../utils/accessor.js'
5
5
  import { getMemberResource } from '../utils/resource.js'
6
- import { replaceRoute } from '../utils/route.js'
7
6
  import {
8
7
  processRouteSchema,
9
8
  processForms,
@@ -44,6 +43,7 @@ export default {
44
43
  data() {
45
44
  return {
46
45
  wrappedPrimitives: null,
46
+ ignoreRouteChange: false,
47
47
  unwrappingPrimitives: false
48
48
  }
49
49
  },
@@ -177,9 +177,12 @@ export default {
177
177
  ...query
178
178
  }
179
179
  if (!equals(query, this.$route.query)) {
180
+ // Tell the `$route` watcher to ignore the changed triggered here:
181
+ this.ignoreRouteChange = true
182
+ this.$router.replace({ query, hash: this.$route.hash })
180
183
  // Change the route query parameters, but don't trigger a route
181
184
  // change, as that would cause the list to reload.
182
- replaceRoute({ query })
185
+ // replaceRoute({ query })
183
186
  }
184
187
  return query // Let getStoreAccessor() do the actual setting
185
188
  }
@@ -314,6 +317,10 @@ export default {
314
317
 
315
318
  watch: {
316
319
  $route(to, from) {
320
+ if (this.ignoreRouteChange) {
321
+ this.ignoreRouteChange = false
322
+ return
323
+ }
317
324
  if (from.path === to.path && from.hash === to.hash) {
318
325
  // Paths and hashes remain the same, so only queries have changed.
319
326
  // Update filter and reload data without clearing.
@@ -195,7 +195,7 @@ export default DitoTypeComponent.register('list', {
195
195
  },
196
196
  set query(query) {
197
197
  const component = getListComponent()
198
- console.log('set query', query, !!component)
198
+ console.log('set query', !!component)
199
199
  if (component) {
200
200
  // Filter out undefined values for comparing with equals()
201
201
  const filter = obj => pickBy(obj, value => value !== undefined)
@@ -112,10 +112,8 @@ export function createFiltersPanel(api, filters, dataPath, proxy) {
112
112
  console.log(
113
113
  'applyFilters()',
114
114
  JSON.stringify({
115
- ...proxy.query,
116
- filter: this.filters,
117
- // Clear pagination when applying or clearing filters:
118
- page: undefined
115
+ data: this.data,
116
+ filters: this.filters
119
117
  })
120
118
  )
121
119
  proxy.query = {