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-5511: Focus test scenario grid when collection editor is saved… #1400
Conversation
The coverage needs to be provided, then draft will be transitioned to regular PR. |
Jenkins please retest this |
Jenkins do full downstream build |
widget.addSaveEditorEventHandler(event -> { | ||
flush(); | ||
gridPanel.setFocus(true); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jomarko Not related to your changes, but it could be an improvement. Currently if you press Close button the launched actions are:
destroyResources()
gridLayer.batch()
gridPanel.setFocus(true)
collectionEditorDOMElement.stopEditingMode()
While, for the Save button, the actions are:
flush()
(with contains thedestoyResource()
logic)gridPanel.setFocus(true)
Not sure about the effect of calling gridLayer.batch()
, but I suspect we should at least call collectionEditorDOMElement.stopEditingMode();
after Save Button is pressed. Most probably the current behavior could lead to a bug, if the state of editing mode is wrong. Can you please check it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this is so tricky is the CollectionEditorSingletonDOMElementFacotry
extends a class that was not designed for editors/popups with such complexity (buttons for saving, scrolling, switching two modes).
Other gird popups/editors are all saved by pressing TAB, ENTER (if it is not multiline text area) and canceled by ESC.
If we would able to redesign collection editor to not have any special buttons for saving, cancelling, then I think (not tried manually) we would simply remove this part of code and appformer framework would handle everything.
protected void commonCloseHandling(final CollectionEditorDOMElement collectionEditorDOMElement) {
destroyResources();
gridLayer.batch();
gridPanel.setFocus(true);
collectionEditorDOMElement.stopEditingMode();
}
@Override
public void registerHandlers(final CollectionViewImpl widget, final CollectionEditorDOMElement widgetDomElement) {
widget.addCloseCompositeEventHandler(event -> commonCloseHandling(widgetDomElement));
widget.addSaveEditorEventHandler(event -> {
flush();
gridPanel.setFocus(true);
});
}
However such rewriting is not much probable from my point of view, so back to your comment.
I think adding batch
will not harm - documented here
collectionEditorDOMElement.stopEditingMode();
is not needed. The save handler call flush()
what leads to invocation of CollectionEditorDOMElement.flush()
where we already stop editing mode. It is expected, otherwise right now in business central we would see cell in edit mode even when collection editor is saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jomarko Thank you for your exhaustive comment.
Jenkins do full downstream build |
Jenkins do full downstream build |
failed tests:
|
Jenkins do full downstream build |
1 similar comment
Jenkins do full downstream build |
… and closed For more details see https://issues.redhat.com/browse/DROOLS-5511
Jenkins do full downstream build |
SonarCloud Quality Gate failed. 0 Bugs 66.7% Coverage The version of Java (1.8.0_202) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. |
Jenkins do full downstream build |
@jstastny-cz builds passed, PR is ready for your review when you have a moment. |
@kiegroup/gatekeepers please merge |
… and closed
For more details see https://issues.redhat.com/browse/DROOLS-5511