@quazardous/qdadm 2.9.0 → 2.10.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": "@quazardous/qdadm",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Vue 3 framework for admin dashboards with PrimeVue",
5
5
  "author": "quazardous",
6
6
  "license": "MIT",
@@ -54,11 +54,11 @@
54
54
  "yaml": "^2.8.4"
55
55
  },
56
56
  "peerDependencies": {
57
- "pinia": "^2.0.0 || ^3.0.0",
57
+ "pinia": "^2.0.0 || ^3.0.0 || ^4.0.0",
58
58
  "primevue": "^4.0.0",
59
59
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
60
60
  "vue": "^3.3.0",
61
- "vue-router": "^4.0.0"
61
+ "vue-router": "^4.0.0 || ^5.0.0"
62
62
  },
63
63
  "peerDependenciesMeta": {
64
64
  "vanilla-jsoneditor": {
@@ -59,6 +59,9 @@ const guardDialog = useGuardDialog()
59
59
  const router = useRouter()
60
60
  const route = useRoute()
61
61
  const app = useApp()
62
+ // Top-level binding so the template unwraps the ComputedRef — `app.version`
63
+ // nested in a plain object stays a ref object (always truthy) in v-if (#1382)
64
+ const appVersion = app.version
62
65
  const { navSections, isNavActive, sectionHasActiveItem, handleNavClick } = useNavigation()
63
66
  const { user, logout, authEnabled } = useAuth()
64
67
  const signals = inject<SignalBus | null>('qdadmSignals', null)
@@ -288,7 +291,7 @@ const showBreadcrumb = computed<boolean>(() => {
288
291
  <img v-if="app.logo" :src="app.logo" :alt="app.name" class="sidebar-logo" />
289
292
  <h1 v-else>{{ app.name }}</h1>
290
293
  </div>
291
- <span v-if="app.version" class="version">v{{ app.version }}</span>
294
+ <span v-if="appVersion" class="version">v{{ appVersion }}</span>
292
295
  </div>
293
296
 
294
297
  <nav class="sidebar-nav">
@@ -4,7 +4,6 @@ import {
4
4
  createWebHashHistory,
5
5
  type RouteRecordRaw,
6
6
  type RouteLocationNormalized,
7
- type NavigationGuardNext,
8
7
  type RouteRecordNormalized,
9
8
  } from 'vue-router'
10
9
  import { getRoutes } from '../module/moduleRegistry'
@@ -170,7 +169,9 @@ export function applyRoutingMethods(KernelClass: { prototype: Kernel }): void {
170
169
  )
171
170
  })
172
171
 
173
- this.router!.beforeEach((to: RouteLocationNormalized, _from: RouteLocationNormalized, next: NavigationGuardNext) => {
172
+ // Return-style guard (no next() callback): supported since vue-router 4,
173
+ // required to avoid the R0025 deprecation warning on vue-router 5 (#1384)
174
+ this.router!.beforeEach((to: RouteLocationNormalized) => {
174
175
  if (authAdapter.isAuthenticated()) {
175
176
  wasEverAuthenticated = true
176
177
  }
@@ -181,7 +182,6 @@ export function applyRoutingMethods(KernelClass: { prototype: Kernel }): void {
181
182
  )
182
183
 
183
184
  if (isPublic) {
184
- next()
185
185
  return
186
186
  }
187
187
 
@@ -204,11 +204,9 @@ export function applyRoutingMethods(KernelClass: { prototype: Kernel }): void {
204
204
  wasEverAuthenticated = false
205
205
  }
206
206
 
207
- const loginRoute = this.router!.hasRoute('login')
207
+ return this.router!.hasRoute('login')
208
208
  ? { name: 'login', query: { session_lost: '1' } }
209
209
  : '/'
210
- next(loginRoute)
211
- return
212
210
  }
213
211
 
214
212
  const entity = to.meta?.entity as string | undefined
@@ -233,20 +231,16 @@ export function applyRoutingMethods(KernelClass: { prototype: Kernel }): void {
233
231
  entity,
234
232
  manager,
235
233
  })
236
- next({ path: '/' })
237
- return
234
+ return { path: '/' }
238
235
  }
239
236
  } catch (err) {
240
237
  console.error(
241
238
  `[qdadm] Access check failed for ${to.path} (entity: ${entity}) — denying navigation:`,
242
239
  err
243
240
  )
244
- next({ path: '/' })
245
- return
241
+ return { path: '/' }
246
242
  }
247
243
  }
248
-
249
- next()
250
244
  })
251
245
  }
252
246