-
Notifications
You must be signed in to change notification settings - Fork 2
fix: include viewName in navigation href and preserve listViews through defineStack #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ad17911
bd9d8fc
a436d40
15ff2e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -427,7 +427,7 @@ export function AppContent() { | |||||||||||||
| function findFirstRoute(items: any[]): string { | ||||||||||||||
| if (!items || items.length === 0) return ''; | ||||||||||||||
| for (const item of items) { | ||||||||||||||
| if (item.type === 'object') return `${item.objectName}`; | ||||||||||||||
| if (item.type === 'object') return item.viewName ? `${item.objectName}/view/${item.viewName}` : `${item.objectName}`; | ||||||||||||||
|
||||||||||||||
| if (item.type === 'object') return item.viewName ? `${item.objectName}/view/${item.viewName}` : `${item.objectName}`; | |
| if (item.type === 'object') { | |
| // Skip object items that do not have a valid objectName | |
| if (!item.objectName) continue; | |
| return item.viewName ? `${item.objectName}/view/${item.viewName}` : `${item.objectName}`; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -524,7 +524,10 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri | |||||||||||||
| const NavIcon = getIcon(item.icon); | ||||||||||||||
| const baseUrl = `/apps/${activeAppName}`; | ||||||||||||||
| let href = '#'; | ||||||||||||||
| if (item.type === 'object') href = `${baseUrl}/${item.objectName}`; | ||||||||||||||
| if (item.type === 'object') { | ||||||||||||||
| href = `${baseUrl}/${item.objectName}`; | ||||||||||||||
| if (item.viewName) href += `/view/${item.viewName}`; | ||||||||||||||
|
Comment on lines
+528
to
+529
|
||||||||||||||
| href = `${baseUrl}/${item.objectName}`; | |
| if (item.viewName) href += `/view/${item.viewName}`; | |
| if (item.objectName) { | |
| href = `${baseUrl}/${item.objectName}`; | |
| if (item.viewName) href += `/view/${item.viewName}`; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -77,7 +77,10 @@ export function SearchResultsPage() { | |||||
| const navItems = flattenNavigation(activeApp.navigation || []); | ||||||
| return navItems.map((item: any) => { | ||||||
| let href = '#'; | ||||||
| if (item.type === 'object') href = `${baseUrl}/${item.objectName}`; | ||||||
| if (item.type === 'object') { | ||||||
|
||||||
| if (item.type === 'object') { | |
| if (item.type === 'object' && item.objectName) { |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -195,7 +195,10 @@ function MobileBottomNav({ | |||||||||||||||||
| {leaves.map((item) => { | ||||||||||||||||||
| const NavIcon = resolveIcon(item.icon); | ||||||||||||||||||
| let href = '#'; | ||||||||||||||||||
| if (item.type === 'object') href = `${basePath}/${item.objectName}`; | ||||||||||||||||||
| if (item.type === 'object') { | ||||||||||||||||||
| href = `${basePath}/${item.objectName}`; | ||||||||||||||||||
|
Comment on lines
195
to
+199
|
||||||||||||||||||
| if (item.viewName) href += `/view/${item.viewName}`; | ||||||||||||||||||
|
Comment on lines
+199
to
+200
|
||||||||||||||||||
| href = `${basePath}/${item.objectName}`; | |
| if (item.viewName) href += `/view/${item.viewName}`; | |
| if (item.objectName) { | |
| href = `${basePath}/${item.objectName}`; | |
| if (item.viewName) href += `/view/${item.viewName}`; | |
| } else { | |
| href = '#'; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -184,8 +184,10 @@ const defaultPermission: PermissionChecker = () => true; | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| function resolveHref(item: NavigationItem, basePath: string): { href: string; external: boolean } { | ||||||||||||||||||||||
| switch (item.type) { | ||||||||||||||||||||||
| case 'object': | ||||||||||||||||||||||
| return { href: `${basePath}/${item.objectName ?? ''}`, external: false }; | ||||||||||||||||||||||
| case 'object': { | ||||||||||||||||||||||
| const objectPath = `${basePath}/${item.objectName ?? ''}`; | ||||||||||||||||||||||
| return { href: item.viewName ? `${objectPath}/view/${item.viewName}` : objectPath, external: false }; | ||||||||||||||||||||||
|
Comment on lines
+188
to
+189
|
||||||||||||||||||||||
| const objectPath = `${basePath}/${item.objectName ?? ''}`; | |
| return { href: item.viewName ? `${objectPath}/view/${item.viewName}` : objectPath, external: false }; | |
| if (!item.objectName) { | |
| return { href: '#', external: false }; | |
| } | |
| const objectPath = `${basePath}/${item.objectName}`; | |
| return { | |
| href: item.viewName ? `${objectPath}/view/${item.viewName}` : objectPath, | |
| external: false, | |
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change re-merges
listViewsafterdefineStack()(objects: mergeViewsIntoObjects(validated.objects || [], allConfigs)), butsharedConfig.objectsalready ranmergeViewsIntoObjects()before validation. SincedefineStack()stripslistViews, the pre-merge is now redundant work and makes the pipeline harder to follow. Consider constructingsharedConfig.objectswithoutlistViewsand applyingmergeViewsIntoObjects()only once after validation.