diff --git a/docs/developer-guide/context-editor-config.md b/docs/developer-guide/context-editor-config.md index 7b64293eaa..dbab5ff3d3 100644 --- a/docs/developer-guide/context-editor-config.md +++ b/docs/developer-guide/context-editor-config.md @@ -10,6 +10,7 @@ The configuration file has this shape: { "name": "Map", "mandatory": true, // <-- mandatory should not be shown in editor OR not movable and directly added to the right list. + "version": "1.2.3", }, { "name": "Notifications", "mandatory": true, // <-- mandatory should not be shown in editor OR not movable and directly added to the right list. @@ -52,6 +53,7 @@ Each entry of `plugins` array is an object that describes the plugin, it's depen These are the properties allowed for the plugin entry object: * `name`: `{string}` the name (ID) of the plugin +* `version`: `{string}` the version of the plugn * `title`: `{string}` the title string OR messageId (from localization file) * `description`: `{string}`: the description string OR messageId (from localization file) * `docUrl`: `{string}`: the plugin/extension specific documentation url diff --git a/web/client/components/contextcreator/ConfigurePluginsStep.jsx b/web/client/components/contextcreator/ConfigurePluginsStep.jsx index 93e28bcb16..504eeaa0cc 100644 --- a/web/client/components/contextcreator/ConfigurePluginsStep.jsx +++ b/web/client/components/contextcreator/ConfigurePluginsStep.jsx @@ -83,6 +83,18 @@ const getAvailableTools = (plugin, onShowDialog, hideUploadExtension) => { }]; }; +const formatPluginTitle = (plugin) => { + var version = ''; + if (plugin.version && plugin.version !== 'undefined') { + version = ' (' + plugin.version + ')'; + } + return (plugin.title || plugin.label || plugin.name) + version; +}; + +const formatPluginDescription = (plugin) => { + return plugin.description || 'plugin name: ' + plugin.name; +}; + /** * Converts plugin objects to Transform items * @param {string} editedPlugin currently edited plugin @@ -128,9 +140,9 @@ const pluginsToItems = ({ const isMandatory = plugin.forcedMandatory || plugin.mandatory; return { id: plugin.name, - title: plugin.title || plugin.label || plugin.name, + title: formatPluginTitle(plugin), cardSize: 'sm', - description: plugin.description || 'plugin name: ' + plugin.name, + description: formatPluginDescription(plugin), showDescriptionTooltip, descriptionTooltipDelay, mandatory: isMandatory, diff --git a/web/client/reducers/contextcreator.js b/web/client/reducers/contextcreator.js index ff7d3aba60..f8e9fa3635 100644 --- a/web/client/reducers/contextcreator.js +++ b/web/client/reducers/contextcreator.js @@ -74,6 +74,7 @@ const makeNode = (plugin, parent = null, plugins = [], localPlugins = []) => ({ name: plugin.name, title: plugin.title, description: plugin.description, + version: plugin.version, docUrl: plugin.docUrl, // custom documentation url (useful for plugin as extension with extension specific documentation) glyph: plugin.glyph, parent,