Skip to content

Commit

Permalink
Resolve activity buttons without tool buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
szschaler committed Feb 9, 2024
1 parent e3c9a11 commit 6082bbe
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions platform/src/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,19 @@ function createPanelForDefinitionId(panel){
// No activity defined buttons
newPanel.addButtons( Button.createButtons( panelDefinition.buttons, panel.id));

} else if (panel.buttons != null && panelDefinition.buttons != null) {
// The activity has defined the buttons
} else if (panel.buttons != null) {
// The activity has defined the buttons, some may be references to buttons defined in the tool spec
let resolvedButtonConfigs = panel.buttons.map(btn =>{
let resolvedButton;

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

0 comments on commit 6082bbe

Please sign in to comment.