fix(dees-appui): substitute route params into URL hash when navigating

This commit is contained in:
2026-03-10 14:42:02 +00:00
parent 14e8b8c533
commit 1eeebb35e6
3 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,11 @@
# Changelog # Changelog
## 2026-03-10 - 3.45.1 - fix(dees-appui)
substitute route params into URL hash when navigating
- Replaces :param placeholders in view.route with provided params before updating the URL hash.
- Ensures window.history.pushState is called with the resolved route so URLs do not contain literal parameter tokens.
## 2026-03-10 - 3.45.0 - feat(dees-form) ## 2026-03-10 - 3.45.0 - feat(dees-form)
register new input components (tags, list, wysiwyg, richtext) and emit change notification for richtext updates register new input components (tags, list, wysiwyg, richtext) and emit change notification for richtext updates

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-catalog', name: '@design.estate/dees-catalog',
version: '3.45.0', version: '3.45.1',
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.' description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
} }

View File

@@ -875,8 +875,13 @@ export class DeesAppui extends DeesElement {
try { try {
await this.loadView(view, params); await this.loadView(view, params);
// Update URL hash // Update URL hash (substitute params into route pattern)
const route = view.route || viewId; let route = view.route || viewId;
if (params) {
for (const [key, val] of Object.entries(params)) {
route = route.replace(`:${key}`, val);
}
}
const newHash = `#${route}`; const newHash = `#${route}`;
if (window.location.hash !== newHash) { if (window.location.hash !== newHash) {
window.history.pushState({ viewId }, '', newHash); window.history.pushState({ viewId }, '', newHash);