Repository navigation
Conversation
mavidser
left a comment
There was a problem hiding this comment.
This looks good! I tested this in a couple other JS files and was able to access the process.env.* variables there too. We should make this generic and upstream it.
mavidser
left a comment
There was a problem hiding this comment.
👍 This looks good. I think we can now raise a PR upstream for the ADDITIONAL_NODE_ENV_VARS changes. Btw how about ADDITIONAL_JS_ENV_VARS to be less ambiguous about the runtime?
- I tested this: I tested that variables defined in
ADDITIONAL_NODE_ENV_VARSare accessible by webpack, and that s3url plugin gets enabled in the editor. - I read through the code
- I checked for accessibility issues
mavidser
left a comment
There was a problem hiding this comment.
btw if it's not very complicated add a simple test too to ensure that the vars are successfully being passed down.
…dx-platform into pooja/autodesk-s3url-plugin-changes
…dx-platform into pooja/autodesk-s3url-plugin-changes
And rename plugin to adsk
7eb7571 to
02dc564
Compare
mavidser
left a comment
There was a problem hiding this comment.
👍 This is good to go. I assume this PR won't be merged, and results in a maintained branch for Autodesk?
- I tested this: Verified the deployed branch, with the plugin working as expected.
- I read through the code
- I checked for accessibility issues
| 'ADSK_PLUGIN_FILETYPES': 'PDF,zip,Video,Design', | ||
| 'ADSK_PLUGIN_ORIENTATIONS': 'Vertical,Horizontal', | ||
| 'ADSK_PLUGIN_STYLES': 'Primary,Normal,Secondary' | ||
| } |
There was a problem hiding this comment.
We should put these into lms.yml and studio.yml (probably via the EDXAPP_ENV_EXTRA ansible vars), not into a codebase fork.
| ((this.new_image_modal ? 'insertImage' : 'image') + " | code") + " | adsklink", | ||
| block_formats: edx.StringUtils.interpolate( | ||
| gettext("{paragraph}=p;{preformatted}=pre;{heading3}=h3;{heading4}=h4;{heading5}=h5;{heading6}=h6"), | ||
| { |
There was a problem hiding this comment.
What about a simpler, more upstreamable approach?
let tinyMceArgs = {
script_url: baseUrl + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js",
font_formats: _getFonts(),
theme: "modern",
...
};
// Allow customization of TinyMCE via the "HTML_TINYMCE_OVERRIDES" object, which can be set in
// ADDITIONAL_NODE_ENV_VARS in studio.yml:
if (process.env.ADDITIONAL_NODE_ENV_VARS) {
const tinyMceOverrides = JSON.parse(process.env.ADDITIONAL_NODE_ENV_VARS).HTML_TINYMCE_OVERRIDES;
if (tinyMceOverrides) {
if (tinyMceOverrides.toolbarExtra) {
tinyMceArgs.toolbar += tinyMceOverrides.toolbarExtra;
delete tinyMceOverrides.toolbarExtra;
}
tinyMceArgs = {...tinyMceArgs, ...tinyMceOverrides}
}
}
// Initialize TinyMCE
this.tiny_mce_textarea = $(".tiny-mce", this.element).tinymce(tinyMceArgs);Then studio.yml would look like:
ADDITIONAL_NODE_ENV_VARS:
# Enable Autodesk plugins to the HTML XBlock TinyMCE visual editor in Studio:
HTML_TINYMCE_OVERRIDES:
plugins: "textcolor, link, image, codemirror, adsklink"
toolbarExtra: " | adsklink"
adsklink:
linktypes:
- download
- offer
filetypes:
- PDF
- zip
- Video
- Design
orientations:
- Vertical
- Horizontal
styles:
- Primary
- Normal
- Secondary
|
@pkulkark, just a small note that I'm working on applying the changes that @bradenmacdonald mentioned I already have applied the necessary changes, but I'm testing them on a stage instance. I also rebased the branch to juniper.3 |
This PR adds the necessary settings to enable the custom tinymce plugin for autodesk. The custom plugin code is hosted at https://github.com/open-craft/tinymce-adsk-plugin. This allows custom node env variables to be passed in from the django settings file.
JIRA tickets: SE-3247
Sandbox URL: Has been deployed to Autodesk's STG instance.
Testing Instructions:
NOTE: This needs to be tested along with the plugin installed and custom-theme#6. See this comment for steps for installing the plugin.
ADSK Linkbutton is visible.ADSK Linkbutton but adding sample urls and setting different values in dropdowns.Reviewers: