From 96142ac64c2ce37920c1bfed79549426ee53f3fb Mon Sep 17 00:00:00 2001 From: FNI18300 <50654937+FNI18300@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:08:20 +0200 Subject: [PATCH 1/4] Add release information in creation context and upload plugins --- docs/developer-guide/context-editor-config.md | 2 ++ .../contextcreator/ConfigurePluginsStep.jsx | 21 +++++++++++++++++-- web/client/reducers/contextcreator.js | 2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) 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..89723a8b73 100644 --- a/web/client/components/contextcreator/ConfigurePluginsStep.jsx +++ b/web/client/components/contextcreator/ConfigurePluginsStep.jsx @@ -83,6 +83,23 @@ const getAvailableTools = (plugin, onShowDialog, hideUploadExtension) => { }]; }; +const formatPluginTitle = (plugin) => { + var version = ''; + if (plugin.version && plugin.version !== 'undefined') { + version = ' (' + plugin.version + ')'; + } + if( plugin.name === 'SignalementExtension') { + console.log("plugin.version:" + plugin.version); + } + const title = (plugin.title || plugin.label || plugin.name) + version; + console.log("title:" + title + " " + plugin.name); + return title; +}; + +const formatPluginDescription = (plugin) => { + return plugin.description || 'plugin name: ' + plugin.name; +} + /** * Converts plugin objects to Transform items * @param {string} editedPlugin currently edited plugin @@ -128,9 +145,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..c35c14a3e9 100644 --- a/web/client/reducers/contextcreator.js +++ b/web/client/reducers/contextcreator.js @@ -18,6 +18,7 @@ import {INIT, SET_CREATION_STEP, SET_WAS_TUTORIAL_SHOWN, SET_TUTORIAL_STEP, MAP_ BACK_TO_PAGE_SHOW_CONFIRMATION, SET_SELECTED_THEME, ON_TOGGLE_CUSTOM_VARIABLES, LOAD_CONTEXT} from "../actions/contextcreator"; import {set} from '../utils/ImmutableUtils'; import { migrateContextConfiguration } from '../utils/ContextCreatorUtils'; +import { version } from 'process'; const defaultPlugins = [ @@ -74,6 +75,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, From 63616ee28e7e0ae1218867cbae32b8cff471f75b Mon Sep 17 00:00:00 2001 From: FNI18300 <50654937+FNI18300@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:11:25 +0200 Subject: [PATCH 2/4] Add release information in creation context and upload plugins --- .../components/contextcreator/ConfigurePluginsStep.jsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/web/client/components/contextcreator/ConfigurePluginsStep.jsx b/web/client/components/contextcreator/ConfigurePluginsStep.jsx index 89723a8b73..38f2375be1 100644 --- a/web/client/components/contextcreator/ConfigurePluginsStep.jsx +++ b/web/client/components/contextcreator/ConfigurePluginsStep.jsx @@ -88,12 +88,7 @@ const formatPluginTitle = (plugin) => { if (plugin.version && plugin.version !== 'undefined') { version = ' (' + plugin.version + ')'; } - if( plugin.name === 'SignalementExtension') { - console.log("plugin.version:" + plugin.version); - } - const title = (plugin.title || plugin.label || plugin.name) + version; - console.log("title:" + title + " " + plugin.name); - return title; + return (plugin.title || plugin.label || plugin.name) + version; }; const formatPluginDescription = (plugin) => { From e483090fba20c2a3594d7d61fc3b5bff926e787d Mon Sep 17 00:00:00 2001 From: FNI18300 <50654937+FNI18300@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:12:43 +0200 Subject: [PATCH 3/4] Add release information in creation context and upload plugins --- web/client/reducers/contextcreator.js | 1 - 1 file changed, 1 deletion(-) diff --git a/web/client/reducers/contextcreator.js b/web/client/reducers/contextcreator.js index c35c14a3e9..f8e9fa3635 100644 --- a/web/client/reducers/contextcreator.js +++ b/web/client/reducers/contextcreator.js @@ -18,7 +18,6 @@ import {INIT, SET_CREATION_STEP, SET_WAS_TUTORIAL_SHOWN, SET_TUTORIAL_STEP, MAP_ BACK_TO_PAGE_SHOW_CONFIRMATION, SET_SELECTED_THEME, ON_TOGGLE_CUSTOM_VARIABLES, LOAD_CONTEXT} from "../actions/contextcreator"; import {set} from '../utils/ImmutableUtils'; import { migrateContextConfiguration } from '../utils/ContextCreatorUtils'; -import { version } from 'process'; const defaultPlugins = [ From 9e7bcacd09779006f762a14965bb2f7e21b1647f Mon Sep 17 00:00:00 2001 From: FNI18300 <50654937+FNI18300@users.noreply.github.com> Date: Fri, 24 Oct 2025 08:03:15 +0200 Subject: [PATCH 4/4] ESLint --- web/client/components/contextcreator/ConfigurePluginsStep.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/components/contextcreator/ConfigurePluginsStep.jsx b/web/client/components/contextcreator/ConfigurePluginsStep.jsx index 38f2375be1..504eeaa0cc 100644 --- a/web/client/components/contextcreator/ConfigurePluginsStep.jsx +++ b/web/client/components/contextcreator/ConfigurePluginsStep.jsx @@ -93,7 +93,7 @@ const formatPluginTitle = (plugin) => { const formatPluginDescription = (plugin) => { return plugin.description || 'plugin name: ' + plugin.name; -} +}; /** * Converts plugin objects to Transform items