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

KOGITO-1436: Stunner - Remove double setContent call. #3246

Merged
merged 3 commits into from Mar 26, 2020

Conversation

ederign
Copy link
Member

@ederign ederign commented Mar 25, 2020

This PR changes the set content method to return a Promise instead of void.

The goal of this change is to be able to make the loading of editors predictable and remove the need for double set content call.

This PR also includes the changes by @manstis and @romartin at #3236

Merge together with:
apache/incubator-kie-tools#95
kiegroup/appformer#934

The new changes are here: 0d5c3a1

target/
yarn*.log
Copy link
Member Author

Choose a reason for hiding this comment

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

just a clean up

@@ -40,8 +40,6 @@
default void onSuccess() {
}

;

Copy link
Member Author

Choose a reason for hiding this comment

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

another clean up

@@ -316,6 +316,7 @@ public void onError(final ClientRuntimeError error) {
BPMNStandaloneDiagramEditor.this.getEditor().onLoadError(error);
}
});
return null;
Copy link
Member Author

Choose a reason for hiding this comment

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

@romartin I'm not sure what should I return here.

@romartin
Copy link
Contributor

Closing as code from this PR is already present in #3236.

@romartin romartin closed this Mar 25, 2020
@romartin romartin reopened this Mar 25, 2020
@romartin
Copy link
Contributor

@ederign oops sorry closed the wrong PR :/

@romartin
Copy link
Contributor

Jenkins execute full downsteam build

@romartin
Copy link
Contributor

romartin commented Mar 26, 2020

Hey @ederign @manstis @jomarko @tiagobento

Great job guys, I've been testing this locally and it results on most of the acutal blocker tickets for editors being fixed, although I there is still one concrete case in which it doesn't work properly...

See the following video:

https://issues.redhat.com/secure/attachment/12468485/KOGITO-1436-verification.mp4

As you can see, I can verify (VERIFICATION) it works, although I can still see a non-related issue (BUG):

  • [VERIFICATION] Now there is no need to click "first" on the canvas, to make properties work, you can just open the editor, update the properties, save and it works (see how the it-works.bpmn process is created in the video) - It means removing the double setContent calls makes everything work as expected! Great news guys!
  • [BUG] On the other hand, I found a bug, that maybe it's still causing confusion to end users, but not related to this. The bug is: after some forms validatoin errors happens, whatever changes to other fields will be not saved properly. So it happens only AFTER some forms validation happens, see how the it-still-does-not-work.bpmn process is being created in the video, but not propertly updated

Sooo IMO we should take these actions:

  1. Try to merge this PR
  2. Try to merge also KOGITO-987 - VsCode editor - process id not saved/updated #3239
  3. Report and fix the issue mentioned above, on top

PS: Also I've been testing this locally with #3239 merged as well, I mean both features in my local, and Ctrl +S is working fine too now in VSCode, expect in same situation that the bug mentioned above. Good job @Josephblt too!!

Again - great job everyone involed, specially @ederign @tiagobento !!!! 👍

CC @LuboTerifaj @domhanak

Thanks!!
Roger

@romartin
Copy link
Contributor

CC @lazarotti @porcelli ^^

@romartin
Copy link
Contributor

Jenkins execute full downstream build

@romartin
Copy link
Contributor

CC @pefernan maybe I'll need your help Pere, after flushing, once some invalid field, it looks the forms state is not properly saved, see comment above. If you have some clue anyway please let us know!! 👍

@pefernan
Copy link
Member

hey @romartin let me test it locally to understand the issue.

Copy link
Member

@manstis manstis left a comment

Choose a reason for hiding this comment

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

I tested DMN in VSCode and -webapp-kogito-testing. Both were fine. Thank-you.

@domhanak
Copy link
Contributor

Jenkins execute full downstream build

Comment on lines 433 to 396
public void setContent(final String path,
public Promise setContent(final String path,
final String value) {
Copy link

Choose a reason for hiding this comment

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

please update formatting

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -145,7 +145,7 @@ public boolean isDirty() {
* @param value
* Editor's content
*/
public abstract void setContent(final String path, final String value);
public abstract Promise setContent(final String path, final String value);
Copy link

Choose a reason for hiding this comment

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

In appformer we changed to Promise<Void> shouldn't we follow also here?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a current limitation of our annotation processors. Other methods also return untyped Promises for now.

@jomarko
Copy link

jomarko commented Mar 26, 2020

Manual check in business central was same as on vs code apache/incubator-kie-tools#95 (comment), but passed all scenarios.

@romartin
Copy link
Contributor

Hey @ederign @paulovmr @tiagobento

Please this PR is blocking this other one for being properly reviewed: #3239

Could you please prioritize this review and try to merge this ASAP?

Thx!

@romartin
Copy link
Contributor

CC @LuboTerifaj @Josephblt ^^

@ederign ederign merged commit 1fa0ec9 into kiegroup:master Mar 26, 2020
@sonarcloud
Copy link

sonarcloud bot commented Mar 26, 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 1 Code Smell

8.5% 8.5% Coverage
0.0% 0.0% Duplication

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