Skip to content

Commit

Permalink
fixed localStorage.frontendConfig being clobbered in localhost:3000 t…
Browse files Browse the repository at this point in the history
…esting (cBioPortal#4955)

Co-authored-by: Denis Papp <[email protected]>
  • Loading branch information
pappde and pappde authored Aug 12, 2024
1 parent 895d50f commit dcae06d
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions my-index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,36 @@
window.frontendConfig = {
}
/* REMOVED: This is an example of how to add custom tabs to the patient page. Enabling this will clobber localStorage.frontendConfig that is set through the browser console
localStorage.frontendConfig = JSON.stringify(
{
serverConfig:{
custom_tabs:[
{
title: 'Sync Tab',
id: 'customTab1',
location: 'PATIENT_PAGE',
mountCallback: `(div)=>{
$(div).html("tab for patient " + window.location.search.split("=").slice(-1))
}`,
},
{
title: 'Async Tab',
id: 'customTab2',
location: 'PATIENT_PAGE',
hideAsync: `()=>{
return new Promise((resolve)=>{
setTimeout(()=>{
resolve(true);
}, 2000);
});
}`,
},
]
}
}
);
serverConfig:{
custom_tabs:[
{
title: 'Sync Tab',
id: 'customTab1',
location: 'PATIENT_PAGE',
mountCallback: `(div)=>{
$(div).html("tab for patient " + window.location.search.split("=").slice(-1))
}`,
},
{
title: 'Async Tab',
id: 'customTab2',
location: 'PATIENT_PAGE',
hideAsync: `()=>{
return new Promise((resolve)=>{
setTimeout(()=>{
resolve(true);
}, 2000);
});
}`,
},
]
}
});
*/
function renderCustomTab1(div, tab){
$(div).append(`<div>this is the content for <strong>${tab.title}</strong></div>`);
Expand Down

0 comments on commit dcae06d

Please sign in to comment.