Skip to content

Commit

Permalink
[doc] Contribute an ADR to avoid issues with invalid view decriptions…
Browse files Browse the repository at this point in the history
… elements

Bug: #2444
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
  • Loading branch information
mcharfadi authored and pcdavid committed Nov 6, 2023
1 parent f714a74 commit 6852d2f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Expand Up @@ -10,6 +10,7 @@
=== Architectural decision records

- [ADR-111] Add support for image overlay
- [ADR-112] Provide only valid view descriptions to the renderer

=== Breaking changes

Expand Down
@@ -0,0 +1,38 @@
= ADR-112 - Provide only valid view descriptions to the renderer

== Context

Some rendered components can have an invalid description.
For example a reference widget component without a valid `Reference Name Expression`.

This can provoke unexpected results.
We want to avoid converting view dsl elements to programmatic elements if they have an invalid description.

== Decision

Only the `sirius-components-view-emf` package will be impacted.

The class `ViewFormDescriptionConverterSwitch.java` will extends extends `FormSwitch<Optional<AbstractControlDescription>>` instead of `FormSwitch<AbstractControlDescription>`.

`IWidgetConverterProvider#getWidgetConverter` will change to:

`Switch<Optional<AbstractWidgetDescription>> getWidgetConverter(AQLInterpreter interpreter, IEditService editService, IObjectService objectService, IFeedbackMessageService feedbackMessageService)`;

from:
`Switch<AbstractWidgetDescription> getWidgetConverter(AQLInterpreter interpreter, IEditService editService, IObjectService objectService, IFeedbackMessageService feedbackMessageService)`;

`ReferenceWidgetDescriptionConverterSwitch#caseReferenceWidgetDescription` will return an empty optional if the widget description is invalid.


We will also log all invalid descriptions.

== Status

draft

== Consequences

This will change currently used API that will need to be documented.

== References

0 comments on commit 6852d2f

Please sign in to comment.