Fixes #3732: createPlugin helper function#3734
Merged
mbarto merged 5 commits intogeosolutions-it:masterfrom May 21, 2019
Merged
Fixes #3732: createPlugin helper function#3734mbarto merged 5 commits intogeosolutions-it:masterfrom
mbarto merged 5 commits intogeosolutions-it:masterfrom
Conversation
offtherailz
reviewed
May 10, 2019
Member
offtherailz
left a comment
There was a problem hiding this comment.
Only a suggestion to improve doc
web/client/utils/PluginsUtils.js
Outdated
| * | ||
| * @param {string} name name of the plugin (without the Plugin postfix) | ||
| * @param {object} config configuration object, with the following (optional) properties: | ||
| * * component: ReactJS component that implements the plugin functionalities, can be null if the plugin supports lazy loading |
Member
There was a problem hiding this comment.
I suggest to use
@param {type} cfg.name for all the cfg object parameters, so it will can specify type and if they are options (using [])
also an
@example
createPlugin( MyPlugin, {
component: ...
options: {
disablePluginIf: ,,,
},
containers: {
Toolbar: {}
}
}
could be useful. I see there are some usage samples around, but they are not so many neither complete.
This file contains hidden or 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
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.
Description
Helper function to ease creating new plugins.
Issues
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
What is the current behavior? (You can also link to an open issue here)
To create a plugin you need to export a JS object, a descriptor of the plugin
What is the new behavior?
The old way of exporting plugins still works, the new helper makes the process more easy and readable.
Does this PR introduce a breaking change? (check one with "x", remove the other)
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: