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

Can't save diagrams with text inside certain shapes #144

Closed
oanalavinia opened this issue May 8, 2020 · 2 comments · Fixed by #161 or #162
Closed

Can't save diagrams with text inside certain shapes #144

oanalavinia opened this issue May 8, 2020 · 2 comments · Fixed by #161 or #162

Comments

@oanalavinia
Copy link

@oanalavinia oanalavinia commented May 8, 2020

Steps to reproduce:

Create a new diagram
Add a Diamond / Triangle/ Actor / Round (not squared) shape with text inside
Click on Save & View / Save

Expected results: The diagram is saved.

Actual results: The Save & View / Save button becomes disabled but the page remains blocked and nothing happens, the page is not saved.

issue_diamondText

@oanalavinia
Copy link
Author

@oanalavinia oanalavinia commented May 8, 2020

Investigation: The issue is caused by: https://github.com/xwikisas/application-diagram/blob/master/application-diagram-ui/src/main/resources/Diagram/DiagramEditSheet.xml#L865
'rect' is available only for squared shapes, and for other shapes a 'path' svg element is actually the parent of the text node. So there should be added a way to calculate the maximal width of the text element (used for wrapping) in this cases

@oanalavinia oanalavinia self-assigned this Jun 16, 2020
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Jun 17, 2020
* there are shape that don't have a rect as a parent, that is needed as a frame for the wrapping process, and in this case we use the initial width of the mxText node
oanalavinia added a commit that referenced this issue Jun 17, 2020
* there are shape that don't have a rect as a parent, that is needed as a frame for the wrapping process, and in this case we use the initial width of the mxText node
@oanalavinia oanalavinia added this to the 1.15 milestone Jun 17, 2020
@oanalavinia
Copy link
Author

@oanalavinia oanalavinia commented Jun 17, 2020

Reopening since the fix is not complete.

Here https://github.com/xwikisas/application-diagram/blob/master/application-diagram-ui/src/main/resources/Diagram/DiagramEditSheet.xml#L876 it is not taking into consideration only the last rect parent, but any that could be found in the diagram, leading to the blocked save if you do not have any rect in the diagram, or to a wrong width, which does not correspond to the current element.

@oanalavinia oanalavinia reopened this Jun 17, 2020
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Jun 17, 2020
* take into consideration only the previous element as a rect parent, otherwise any other rect will be considered as parent, leading to the blocked save if you do not have any rect in the diagram, or to a wrong width, which does not correspond to the current element.
oanalavinia added a commit that referenced this issue Jun 17, 2020
* take into consideration only the previous element as a rect parent, otherwise any other rect will be considered as parent, leading to the blocked save if you do not have any rect in the diagram, or to a wrong width, which does not correspond to the current element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment