Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for missing panel buttons #171

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions platform/schemas/panel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
"editorPanel": {
"description": "For tools that create editor instances e.g. language workbenches, reference to the id of a panel of editorActivity that is the editor instance.",
"type": "string"
},
"buttons": {
"description": "Buttons to use instead of the default buttons defined by the panel. Can be a Button object or an Object with a ref attribute whose value is the id of a button from the panel's definition.",
"type": "array",
"items": {
"type": "object",
"oneOf": [
{"$ref": "button.schema.json"},
{"$ref": "ref.schema.json"}
]
}
}
},
"required": ["id", "name", "ref"]
Expand Down
15 changes: 15 additions & 0 deletions platform/schemas/ref.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$id": "https://mde-network.com/ep/ref.schema.json",
"$schema": "http://json-schema.org/draft-07/schema",
"title": "EP Ref1",
"description": "The MDENet education platform reference",

"type": "object",
"properties": {
"ref": {
"description": "The id of an education platform element.",
"type": "string"
}
},
"required": ["ref"]
}
2 changes: 1 addition & 1 deletion platform/src/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ 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;
Expand Down
Loading