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

Feature/966 markdown in dialog #970

Merged
merged 12 commits into from
Jan 10, 2022
Merged

Conversation

jacobwod
Copy link
Member

@jacobwod jacobwod commented Jan 5, 2022

Closes #966

- Initial commit for #966, though if it turns out well and we can live with minor format changes, it's pretty much done.
- Please test with your setups.
… each with a separate 'target':

- Previously all plugins had one 'options' property that was an object with various plugin-specific settings.
- I've identied use cases where it would be useful to use a single plugin but allow for multiple 'entities' of that plugin to have separate settings. One example is the new InfoDialog plugin where we provide the plugin once but it can initiate multiple dialog windows, each with different title, text, icon and target (i.e. control button or drawer button).
- This change is totally backwards compatible: if 'options' isn't an Array, we just do what we did previously.
…to BaseWindowPlugin:

- This new component will render a Dialog instead of a Window though.
- It takes care of rendering the plugins that use it in the correct place, using value of the 'target' property.
- Created a separate component, LegacyNonMarkdownRenderer, that is used inside Dialog if Admin wants to bypass the new ReactMarkdown renderer. This legacy solution still uses dangeresoulySetInnerHTML, which is what some users still want to do.
- This legacy renderer is also **the default renderer** for the old Information plugin. We preserve the current functionality by hard coding this option. If you want to use ReactMarkdown, you should switch to the new plugin: InfoDialog.
- Dialog.js has been moved inside the Dialog folder. Some other componenets that import Dialog are included in this commit where I've fixed the path.
- DialogWindowPlugin now passes on all the options to Dialog. This way we it's a bit more future-proof as we won't have to modify it each time we which to send a new option to the Dialog.
- This file holds and exports the object needed to provide custom components to react-markdown.
- Dialog.js is now using these custom components.
- TODO: Refactor FeaturePropsParsing.js so it makes use of this object too.
- Moved customComponentsForReactMarkdown to utils/
- Enabled 'export' for all components defined in customComponentsForReactMarkdown (this allows overriding of specific parts, should the need arise)
- Refactored FeaturePropsParsing.js to use the common customComponentsForReactMarkdown library too.
@jacobwod jacobwod added module:client/core Core functionality (not a plugin) module:client/plugin Functionality that goes into plugins in client new feature Request for adding/changing functionality focus:accessibility labels Jan 5, 2022
@jacobwod jacobwod added this to the 3.9 milestone Jan 5, 2022
@Hallbergs Hallbergs merged commit 1a32dac into develop Jan 10, 2022
@Hallbergs Hallbergs deleted the feature/966-markdown-in-dialog branch January 10, 2022 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus:accessibility module:client/core Core functionality (not a plugin) module:client/plugin Functionality that goes into plugins in client new feature Request for adding/changing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants