Skip to content

Ask for template parameters on config template import - #3564

Open
Ekhorn wants to merge 6 commits into
mainfrom
feature/configuration-template-parameters
Open

Ekhorn wants to merge 6 commits into
mainfrom
feature/configuration-template-parameters

Conversation

@Ekhorn

@Ekhorn Ekhorn commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a parameter step to configuration template import for the values that differ per asset, so one template can be reused across assets and instances.

Changelog

  • Add @JsonSchemaTemplateParameter to mark template parameters in the generated schema.
  • Mark AgentLink.id and ModbusAgentLink.unitId with @JsonSchemaTemplateParameter.
  • Add the parameter step, grouped by agent link type, where fields of one type with the same value share one parameter
  • Offer only agents of the link's type in the asset's realm, and block import while no such agent exists
  • Check the other parameters with JSON Forms against the schema of their field
  • Add @JsonSchemaTitle labels for Agent ID and Unit ID
  • Cover the parameter mark in JSONSchemaUtilTest

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

@Ekhorn Ekhorn self-assigned this Nov 10, 2026
@Ekhorn Ekhorn added the Feature Development of new feature label Nov 10, 2026
@Ekhorn
Ekhorn force-pushed the feature/configuration-template-parameters branch from 7b33be2 to b5653dc Compare November 10, 2026 21:58
@Ekhorn
Ekhorn changed the base branch from main to feature/import-export-asset-attribute-configuration November 10, 2026 22:34
@Ekhorn
Ekhorn marked this pull request as ready for review November 10, 2026 22:46
@Ekhorn
Ekhorn force-pushed the feature/configuration-template-parameters branch from 9a6b347 to d8c9dec Compare November 11, 2026 10:46
@Ekhorn
Ekhorn force-pushed the feature/configuration-template-parameters branch from d8c9dec to 43c062c Compare November 19, 2026 08:35
Base automatically changed from feature/import-export-asset-attribute-configuration to main November 19, 2026 18:47
- Ask for a template parameter per agent and apply it to every linked attribute
- Block import until an agent of the link type exists
@Ekhorn
Ekhorn force-pushed the feature/configuration-template-parameters branch from 43c062c to 39d4e77 Compare November 19, 2026 18:49

@MartinaeyNL MartinaeyNL left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial AI-assisted review 😉

};

const refreshAgents = async () => {
agents = [...(await loadAgents())];

@MartinaeyNL MartinaeyNL Nov 20, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This comment is AI-assisted ⚠️

loadAgents() queries manager.displayRealm, so "agents in the asset's realm" (acceptance criteria 5)
holds only because the asset viewer always runs in the display realm. Worth a comment
stating that assumption, or filtering against asset.realm if that invariant could
ever break.

- Show the unknown agent error while no agent is picked, since the agent is only preset when the template's agent exists
- Drop the unused asset argument of getParameterGroups
- Test that the Modbus unit ID is a template parameter
@sonarqubecloud

Copy link
Copy Markdown

@Ekhorn
Ekhorn requested a review from MartinaeyNL November 20, 2026 16:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Development of new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support template parameters on configuration template import

2 participants