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

DROOLS-5664 DMN editor reporting unsaved changes in DMN files after no changes #3467

Merged
merged 3 commits into from Nov 4, 2020

Conversation

vpellegrino
Copy link
Contributor

JIRA: https://issues.redhat.com/browse/DROOLS-5664

How it works:

  1. When the diagram is loaded (and the unmarshaller part already executed), this method gets called, in order to store the original diagram hash.
  2. When closing the diagram session, this method checks if the session can be closed or not by comparing the original diagram hash, with the current one:
    2.1. if they are different (the method super.mayClose(getCurrentDiagramHash()) returns false), the "unsaved changes" modal is displayed.

Provided solution:
Several operations may happen before the diagram is drawn (for example element wrapping, etc.), so it is recommended to compute and store che original diagram hash after the diagram gets loaded (inspired by kie-wb-common-stunner-kogito-client)

Recorded demo:
DROOLS-5664

How to retest this PR or trigger a specific build:
  • Retest PR: jenkins retest this
  • A full downstream build: jenkins do fdb
  • A compile downstream build: jenkins do cdb
  • A full production downstream build: jenkins do product fdb
  • An upstream build: jenkins do upstream

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

+1 from my side for this approach, @vpellegrino! As soon as we add an unit test, we can merge the fix :-)

@jstastny-cz
Copy link

jenkins do fdb

@jstastny-cz
Copy link

Please check build results.
Failing test:
org.kie.workbench.common.dmn.project.client.editor.DMNDiagramEditorTest.testOnDiagramLoadWhenCanvasHandlerIsNotNull

@vpellegrino
Copy link
Contributor Author

jenkins do fdb

@sonarcloud
Copy link

sonarcloud bot commented Nov 3, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you, @vpellegrino!

Copy link

@jstastny-cz jstastny-cz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@karreiro karreiro merged commit 25e15fb into kiegroup:master Nov 4, 2020
vpellegrino pushed a commit to vpellegrino/kie-wb-common that referenced this pull request Nov 13, 2020
…o changes (kiegroup#3467)

DROOLS-5664 DMN editor reporting unsaved changes in DMN files after no changes (kiegroup#3467)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants