Skip to content

Commit

Permalink
[behavioural_qc ] Auto-open behavioural panel with query parameter (#…
Browse files Browse the repository at this point in the history
…9183)

This adds the query parameter showFeedback=true to trigger auto-opening the feedback panel on-load.

Fixes #8056.
  • Loading branch information
jeffersoncasimir committed Apr 23, 2024
1 parent 43f53e9 commit 8e21e88
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class BehaviouralFeedback extends Component {
rowData['sessionID'] +
'&commentID=' +
rowData['commentID'];
// Open feedback panel
bvlLink += '&showFeedback=true';
bvlLevel ='Instrument : ' + rowData['Instrument'];
} else if (rowData['Visit']) {
bvlLink = this.props.baseURL +
Expand All @@ -127,10 +129,14 @@ class BehaviouralFeedback extends Component {
rowData['DCCID'] +
'&sessionID=' +
rowData['sessionID'];
// Open feedback panel
bvlLink += '&showFeedback=true';
bvlLevel ='Visit : ' + rowData['Visit'];
} else {
bvlLink = this.props.baseURL +
'/' + rowData['DCCID'];
// Open feedback panel
bvlLink += '/?showFeedback=true';
bvlLevel ='Profile : ' + rowData['PSCID'];
}
reactElement = (
Expand Down
25 changes: 15 additions & 10 deletions modules/bvl_feedback/js/bvl_feedback_panel_jquery.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
function toggleBVLMenu() {
$("#bvl_feedback_menu").toggleClass("active_panel");
$("#bvl_panel_wrapper").toggleClass("bvl_panel");

// We check if a sidebar exists on the page and toggle it if such.
if ($("#page_wrapper_sidebar").length){
$("#sidebar-wrapper").toggle("#sidebar-wrapper hide_sidebar");
$("#page_wrapper_sidebar").toggleClass("wrapper");
}
$('.dynamictable').DynamicTable();
}
/**
* Created by evanmcilroy on 15-06-09.
*/
Expand All @@ -7,17 +17,12 @@ $(document).ready(function() {
var sessionID = $('meta[itemprop="sessionID"]').attr("context");
var commentID = $('meta[itemprop="commentID"]').attr("context");

$('.navbar-toggle').on('click',function(event){
$("#bvl_feedback_menu").toggleClass("active_panel");
$("#bvl_panel_wrapper").toggleClass("bvl_panel");
$('.navbar-toggle').on('click', toggleBVLMenu);

//We check if a sidebar exists on the page and toggle it if such.
if ($("#page_wrapper_sidebar").length){
$("#sidebar-wrapper").toggle("#sidebar-wrapper hide_sidebar");
$("#page_wrapper_sidebar").toggleClass("wrapper");
}
$('.dynamictable').DynamicTable();
});
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('showFeedback') === 'true') {
toggleBVLMenu();
}
}); // end of document


0 comments on commit 8e21e88

Please # to comment.