Bugzilla – Attachment 155102 Details for
Bug 34418
Allow empty nodes in breadcrumb's elements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34418: Replace dynamic parameter on unnamed route node
Bug-34418-Replace-dynamic-parameter-on-unnamed-rou.patch (text/plain), 3.37 KB, created by
Pedro Amorim
on 2023-09-01 11:11:24 UTC
(
hide
)
Description:
Bug 34418: Replace dynamic parameter on unnamed route node
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-09-01 11:11:24 UTC
Size:
3.37 KB
patch
obsolete
>From b3762160c5e7f48d3983a25d85273ab475e75c78 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Thu, 27 Jul 2023 10:57:37 -0300 >Subject: [PATCH] Bug 34418: Replace dynamic parameter on unnamed route node > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > .../prog/js/vue/stores/navigation.js | 40 ++++++++++++++----- > 1 file changed, 30 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js >index 5df32a53e1..1e3ecb58b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js >@@ -72,7 +72,11 @@ export const useNavigationStore = defineStore("navigation", { > getters: { > breadcrumbs() { > if (this.current) >- return _buildFromCurrentMatches(this.current, this.routeState); >+ return _buildFromCurrentMatches( >+ this.current, >+ this.routeState, >+ this.params >+ ); > > return _getBaseElements(this.routeState); > >@@ -100,14 +104,18 @@ export const useNavigationStore = defineStore("navigation", { > ); > } > >- function _buildFromCurrentMatches(currentMatches, routeState) { >+ function _buildFromCurrentMatches( >+ currentMatches, >+ routeState, >+ params >+ ) { > return [ > { > ...routeState, > icon: null, > children: null, > }, >- ..._mapMatches(currentMatches), >+ ..._mapMatches(currentMatches, params), > ]; > } > >@@ -119,16 +127,28 @@ export const useNavigationStore = defineStore("navigation", { > return !child.is_empty; > } > >- function _mapMatches(currentMatches) { >+ function _getPath(match, params) { >+ if (!match.name && match.path && params) { >+ return match.path.replaceAll(/(:[^/]+)/g, param_name => { >+ return params[param_name.substr(1)]; >+ }); >+ } >+ return match.path; >+ } >+ >+ function _mapMatches(currentMatches, params) { > return currentMatches > .filter(match => _isBaseOrNotStub(match.meta.self)) > .filter(match => _isEmptyNode(match.meta.self)) >- .map(match => ({ >- ...match.meta.self, >- icon: null, >- path: match.path, >- children: null, >- })); >+ .map(match => { >+ let path = _getPath(match, params); >+ return { >+ ...match.meta.self, >+ icon: null, >+ path, >+ children: null, >+ }; >+ }); > } > }, > leftNavigation() { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34418
:
153902
|
153903
|
153904
|
153905
|
153910
|
153911
|
153912
|
153913
|
153983
|
154095
|
154210
|
154211
|
154212
|
154213
|
154214
|
155098
|
155099
|
155100
|
155101
| 155102