[SE-3381] Allows adding new tinymce plugins through platform configuration - #295
Conversation
This adds a way for tinymce plugins to use custom environment variables.
| ), | ||
| sort_keys=True, | ||
| ) | ||
| additional_node_env_vars = json.dumps(additional_node_env_vars_sorted_json) |
There was a problem hiding this comment.
json.dumps is already called in the previous step while defining the variable.
There was a problem hiding this comment.
Check this commit please.
So in that commit, what I did was take the Env.get_django_setting("ADDITIONAL_NODE_ENV_VARS", "cms", settings=settings).replace("'", '"') and simply sort it. So I json.loads to sort it and then json.dumps after it is sorted.
But we need to run json.dumps again in order to escape the previous string, which is the dump of the sorted json.
So we dump twice in order to make sure that the string is escaped when it is added to the command.
|
@pkulkark following up on this discussion... The only tinymce plugin from the list of tinymce plugins in the edx-platform which uses CSS is visualblocks. It seems like we'll need to continue adding the styles manually through the custom theme for now. Adding the stylesheets from tinymce plugins into the platform's bundle would be a big change, and for now the adsklink plugin is the only one that's using it. I have launched a new app server with the custom autodesk theme in order to prove my suspicions, which are that the reason it wasn't working was because of the theme. 👍 cc @bradenmacdonald could we have your thoughts on this matter? |
|
@nizarmah I would have expected tinymce to handle the loading of stylesheets for its own plugins. If it's not doing that, and if most plugins don't need stylesheets, and if you don't see any easy way to add that now, then that makes sense to just use the theme for the time being. |
The reason behind the added null check is because when testing, devstack settings might be null
…dx-platform into nizar/tinymce-easy-plugin-modification-backport
(cherry picked from commit f801319)
…and because sometimes we want to specify an order (cherry picked from commit 28c2082)
(cherry picked from commit 441fcad5fc0fed7d3442aa2654c0858648a95d35)
(cherry picked from commit dabac7a12580dec92f3a2c1e37b8b551d8d0b9f9)
(cherry picked from commit 6fa07ec6c7863885a1f9f80ab3370001e37698f3)
(cherry picked from commit a8fa550a57f3168400bed3345dcc470fb481d789)
Reason behind this is the follow eslint error that was showing up during the build: Error - Unexpected trailing comma. (comma-dangle) (cherry picked from commit 78a6cf1f72a9bab7842ef52d68536920af974815)
(cherry picked from commit 7a53899a723e41b486c92287509efa0a42181e9e)
(cherry picked from commit e882cd41a7c5a25f94bfe15d42fc478ed37469cd)
nizarmah
left a comment
There was a problem hiding this comment.
👍🏼
I'll be merging the changes.
- Changes are being reviewed upstream
- Addressed first set of comments on upstream pull request
- Tested the new changes on the sandbox instance
- Pull request was already reviewed by another member
If any changes are requested upstream, we can revert, and re-apply the changes.
This makes it possible to install new tinymce plugins through the environment settings.
This PR is responsible for adding the tinymce plugin settings to the tinymce javascript configuration.
JIRA tickets: SE-3381, SE-3247
Dependencies:
Upstream Pull Request:
Sandbox URL:
Testing instructions:
staff@example.com/edxReviewers
Settings