Skip to content

Commit

Permalink
Fix for missing panel buttons. Panel definitions are required to reso…
Browse files Browse the repository at this point in the history
…lve any button references given in an activity config file. Button references are identified by their type that is string rather than object for Buttons.
  • Loading branch information
barnettwilliam committed Jan 31, 2024
1 parent a92eaea commit 4e628ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions platform/src/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,14 @@ function createPanelForDefinitionId(panel){
// No activity defined buttons
newPanel.addButtons( Button.createButtons( panelDefinition.buttons, panel.id));

} else if (panel.buttons != null && panelDefinition.buttons == null) {
} else if (panel.buttons != null && panelDefinition.buttons != null) {
// The activity has defined the buttons
let resolvedButtonConfigs = panel.buttons.map(btn =>{
let resolvedButton;

if (btn.ref){
if (typeof btn == "string"){
// button reference so resolve
resolvedButton= panelDefinition.buttons.find((pdBtn)=> pdBtn.id===btn.ref);
resolvedButton= panelDefinition.buttons.find((pdBtn)=> pdBtn.id===btn);
} else {
// activity defined button
resolvedButton= btn;
Expand Down

0 comments on commit 4e628ab

Please sign in to comment.