-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for URL interpolation when setting up panels #156
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Documentation on the Wiki still needs updating when this PR is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, just the question on syntax overlap with bash.
barnettwilliam
approved these changes
Jan 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
barnettwilliam
added a commit
to mdenet/educationplatform-docker
that referenced
this pull request
Jan 9, 2024
…anel url interpolation, and mdenet/platformtools#32 switch to Epsilon micronaught. Fix for mdenet/platformtools#27 highlighting does not work in generated editor,
barnettwilliam
added a commit
to mdenet/educationplatform-docker
that referenced
this pull request
Jan 9, 2024
…atform#57 files may be null and feature mdenet/educationplatform#156 panel url interpolation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for interpolation in panel URLs in the activity specification.
This is useful to allow dependent activities to access information from other activities. The concrete motivating example was the generation of Xtext editors, where I may wish to allow students to access the meta-model generated by Xtext in the activity where they can try out their new language. The URL to that file is generated by the platform (specifically, the xtext tool) and so isn't known at the time when the activity specification file is written.
With this PR, I can now write something like:
and have
{{ID-panel-turtles}}
replaced from session storage associated with thepanel-turtles
panel at runtime. For generated editors, the platform stores the editor URL in that session storage key.This is a somewhat pragmatic change, which could be made more powerful, but for now I suggest we keep things simple. We may need to invest in a more systematic architecture should there be a need for more flexibility at any point down the line.
The change consists of two separate changes:
ActivityManager.js
to perform the URL interpolation, andFileHandler.js
to gracefully manage unknown types of URLs even for private repositories.The latter change isn't strictly related to URL interpolation, but is required so that the generated URL can actually be used by the platform even when the activity lives in a private repository. To make this compatible with how file saving is managed, I have also adjusted the code for
canSave
in various panel types to ensure we only attempt to save a panel when it actually has an associated SHA and, thus, we know that it came from the original repository. This may make it difficult for the platform to save back to public repositories.