Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AQL is not interpreted correctly in style customizations for image workspacePath #865

Closed
4 tasks done
Tracked by #24
Gelio opened this issue Dec 4, 2021 · 7 comments · Fixed by #901
Closed
4 tasks done
Tracked by #24

AQL is not interpreted correctly in style customizations for image workspacePath #865

Gelio opened this issue Dec 4, 2021 · 7 comments · Fixed by #901

Comments

@Gelio
Copy link

Gelio commented Dec 4, 2021

  • I have checked that this bug has not yet been reported by someone else
  • I have checked that this bug appears on Chrome
  • I have specified the version :
  • other: 0.5.3
  • I have specified my environment :
  • Ubuntu 20.04 LTS

Screenshots

Some of my style customizations in the odesign file use AQL. An example style customization:

image

getDataPinIconPath is defined in my metamodel's Services.

It works well in Sirius Desktop:

image

But there are no images shown in Sirius Web:

image

The image path that Sirius Web wants to load is:

http://localhost:3000/api/images/eu.balticlsc.model.CAL.edit/icons/computed-data-pin/'%20+%20self.declared.getDataPinIconPath()

whereas it should be:

http://localhost:3000/api/images/eu.balticlsc.model.CAL.edit/icons/computed-data-pin/single-data-single-token.png

Steps to reproduce

  1. Add a metamodel style customization using AQL for the workspacePath of an image of a node

Expected behavior

The image is loaded correctly using the same logic as in Sirius Desktop.

Actual behavior

The image is not loaded due to a malformed URL.

Gelio added a commit to Gelio/CAL-web that referenced this issue Dec 4, 2021
Required application data pins have a black bar on the right side.
Provided ones keep the bar on the left.

This commit also refactors the style customizations to use a service and
a more predictable pattern of finding the right image. In the end, the
number of style customizations required for this feature is down from 8
to 1 and most of the complexity is handled in the metamodel's service
which concatenates the path for a single pin.

The same logic is used for changing the image for the computed data pin.

Due to a bug in Sirius Components, AQL does not work correctly in style
customizations. This means this change breaks images in Sirius Web.
See eclipse-sirius/sirius-web#865

Related to #24
Gelio added a commit to Gelio/CAL-web that referenced this issue Dec 4, 2021
This reverts commit e97d2fd.

It breaks Sirius Web due to a bug in Sirius Components:
eclipse-sirius/sirius-web#865

Related to #24
@pcdavid
Copy link
Member

pcdavid commented Dec 4, 2021

@Gelio can you try your use case with

        // @formatter:off
        String workspacePath = this.eAttributeCustomizationProvider.getEAttributeCustomization(this.workspaceImageDescription, WORKSPACE_PATH)
                .map(EAttributeCustomization::getValue)
                .flatMap(expression -> this.interpreter.evaluateExpression(this.variableManager.getVariables(), expression).asString())
                .orElse(this.workspaceImageDescription.getWorkspacePath());
        // @formatter:on

in org.eclipse.sirius.web.compat.diagrams.WorkspaceImageDescriptionConverter.convert()?

@Gelio
Copy link
Author

Gelio commented Dec 5, 2021

@pcdavid Sorry, I don't have my own fork of sirius-components set up to be consumed in Sirius Web. I am only using the public version of sirius-components. I don't have the bandwidth right now to set up a fork to test it out

pcdavid added a commit that referenced this issue Dec 17, 2021
EAttributeCustomization.value is defined as an InterpretedExpression
in the Sirius Desktop metamodal, and should be interpreted as such.

Bug: #865
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Dec 17, 2021
EAttributeCustomization.value is defined as an InterpretedExpression
in the Sirius Desktop metamodel, and should be interpreted as such.

Bug: #865
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@pcdavid pcdavid linked a pull request Dec 17, 2021 that will close this issue
@sbegaudeau sbegaudeau added this to the 2022.01.0 milestone Dec 17, 2021
sbegaudeau pushed a commit that referenced this issue Dec 17, 2021
EAttributeCustomization.value is defined as an InterpretedExpression
in the Sirius Desktop metamodel, and should be interpreted as such.

Bug: #865
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@pcdavid
Copy link
Member

pcdavid commented Dec 26, 2021

@Gelio the fix mentioned in my earlier comment should now be available starting from version 2021.12.6. Could you confirm if it fixes the issue for you?

@Gelio
Copy link
Author

Gelio commented Dec 28, 2021

There were some pretty heavy changes since the last time I updated my fork of sirius-web. I have just spent 1.5h trying to apply those 20 commits, but I probably messed something up, as I missed the changes from some of the commits. I don't have the bandwidth right now to redo the process.

@Gelio
Copy link
Author

Gelio commented Dec 29, 2021

I had a bit more time today and applied the patch correctly this time.

I confirm that the problem is solved:

image

Thanks!

Gelio added a commit to Gelio/CAL-web that referenced this issue Dec 29, 2021
This re-applies commit e97d2fd
(which was reverted in a8fc6c6)
since eclipse-sirius/sirius-web#865 was
fixed.

Use dynamic logic to compute data pin icon paths instead of hardcoding
style customizations for each possible configuration of
data-multiplicity and token-multiplicity (and provided/required for
application data pins).

This simplifies the metamodel a bit.
Gelio added a commit to Gelio/CAL-web that referenced this issue Dec 29, 2021
This re-applies commit e97d2fd
(which was reverted in a8fc6c6)
since eclipse-sirius/sirius-web#865 was
fixed.

Use dynamic logic to compute data pin icon paths instead of hardcoding
style customizations for each possible configuration of
data-multiplicity and token-multiplicity (and provided/required for
application data pins).

This simplifies the metamodel a bit.
@pcdavid
Copy link
Member

pcdavid commented Dec 29, 2021

Good news, thanks for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants