eclipse-capella / capella-requirements-vp

This add-on allows importing a set of requirements from a ReqIF file
Eclipse Public License 2.0
18 stars 17 forks source link

[VP_Requirement_0.13.1]: Misalignement of informations #180

Open henpower opened 1 year ago

henpower commented 1 year ago

Hi In Capella-5.1, informations about requirements like long_name, name, chapter, etc. where written each in a row (see figure).

image

Unfortunately, in Capella-6.1, all these informations are in the same row (see figure). image

Of course, this make diagram hard to to read because of the size of requirement object.

Kind Regards

henpower commented 1 year ago

The cause of this bug start inside the method

CapellaRequirementsOpenJavaService#evaluateExpression

Called by the method

CapellaRequirementsOpenJavaService#getRequirementTitle

Indeed, let's check line 390

Capella-5.1 with VP_Requirement-0.12.2

390: String sanytizedResult = LabelHelper.transformHTMLToTextWithLineFeed(evaluationResult);

Capella-61 with VP_Requirement-0.13.1

390: String sanytizedResult = LabelHelper.unescape( LabelHelper.transformHTMLToText(evaluationResult) );

So, there is something going wrong with the method

StringEscapeUtils#unescapeHtml

called by

LabelHelper#unescape

It seems like the called method

StringEscapeUtils#unescapeHtml

Also remove the newline tag.

When I remove the call to

LabelHelper#unescape

Then alignment works fine again!

Kind Regards

GlennPlou commented 2 months ago

This seems to be linked to https://github.com/eclipse-capella/capella-requirements-vp/issues/169

I created a PR https://github.com/eclipse-capella/capella-requirements-vp/pull/193

GlennPlou commented 2 months ago

In #169 the goal was to improve the display of labels for requirements in the importer, and also the dialog invoked by the Requirements tool in the palette. For example, i created a requirements with a description richtext ("Text" tab in Properties view). The content is written with HTML tags in the model. requirements_with_description

Without the org.polarsys.kitalpha.vp.requirements.model.helpers.LabelHelper.toOneLine(String) method: import_without_one_line requirements_tools_without_one_line

And with the org.polarsys.kitalpha.vp.requirements.model.helpers.LabelHelper.toOneLine(String) method: import_with_one_line requirements_tools_with_one_line

Indeed, the use of the LabelHelper.toOneLine(String) method is not necessary for the display on diagrams.