Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/developer-guide/context-editor-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions web/client/components/contextcreator/ConfigurePluginsStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions web/client/reducers/contextcreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down