From e613ac3255a21a6c6ab63eaf9c68be4e598341ff Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 22 Jul 2024 14:33:19 +0200 Subject: [PATCH] computes the childactions for the room in the search result independently --- public/js/components/searchbar/raum.js | 15 +---------- public/js/components/searchbar/searchbar.js | 29 ++++++++++++++++++++- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/public/js/components/searchbar/raum.js b/public/js/components/searchbar/raum.js index 87fcc7747..85a7e3ce8 100755 --- a/public/js/components/searchbar/raum.js +++ b/public/js/components/searchbar/raum.js @@ -14,20 +14,7 @@ export default { action: function(data) { return FHC_JS_DATA_STORAGE_OBJECT.app_root+'cms/content.php?content_id='+data.content_id; } - }; */ - - this.res.roomoverview= FHC_JS_DATA_STORAGE_OBJECT.app_root + - FHC_JS_DATA_STORAGE_OBJECT.ci_router + - `/CisVue/Cms/getRoomInformation/${this.res.ort_kurzbz}`; - - if(this.res.content_id !=="N/A"){ - this.res.infolink= FHC_JS_DATA_STORAGE_OBJECT.app_root + - FHC_JS_DATA_STORAGE_OBJECT.ci_router + - `/CisVue/Cms/content/${this.res.content_id}`; - }else{ - this.res.infolink= '#'; - } - + }; */ }, emits: [ 'actionexecuted' ], template: /*html*/` diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index d4b35dc80..d116ab286 100755 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -47,7 +47,7 @@ export default { - +
Unbekannter Ergebnistyp: '{{ res.type }}'.
@@ -69,6 +69,33 @@ export default { this.updateSearchOptions(); }, methods: { + getActionsForRoom: function(res){ + res.roomoverview= FHC_JS_DATA_STORAGE_OBJECT.app_root + + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + `/CisVue/Cms/getRoomInformation/${res.ort_kurzbz}`; + + if(res.content_id !=="N/A"){ + res.infolink= FHC_JS_DATA_STORAGE_OBJECT.app_root + + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + `/CisVue/Cms/content/${res.content_id}`; + } + + let child = this.searchoptions.actions.raum.childactions.filter((child)=>{ + if(child.label =="Rauminformation" && res.content_id =="N/A"){ + return false; + } + return true; + }); + + let computedActions = { + childactions:child, + defaultaction:this.searchoptions.actions.raum.defaultaction + } + + return computedActions; + + + }, updateSearchOptions: function() { this.searchsettings.types = []; for( const idx in this.searchoptions.types ) {