-
Notifications
You must be signed in to change notification settings - Fork 242
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-3838] Improve error reporting in scenario result #1125
Conversation
…/FactMappingValue
…ecated variable. TO be managed in a different ticket.
…o remove simulationDescription parameter
@yesamer, I noticed the following things:
|
@kkufova Points 2,3,4 can be easily managed. Point 1 could be a little bit harder to implement. |
…nor change on CSS
I created https://issues.jboss.org/browse/DROOLS-3989 to manage point 1. |
@yesamer, I found the following issues:
All three bugs can be seed here. |
@jomarko Hi Jozef, I fixed points 1 and 3 raised by @kkufova. Point 2 should be managed in another ticket in my opinion. Please consider that the changes contained in https://github.com/kiegroup/drools/pull/2335 are mandatory to test 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.
Code review notes, manual check pending.
protected ErrorReportPopoverPresenter errorReportPopupPresenter; | ||
|
||
protected Integer currentlyShownHeaderRowIndex = -1; | ||
protected Integer currentlyShownHeaderColumnIndex = -1; |
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.
currentlyShownHeaderRowIndex
and currentlyShownHeaderColumnIndex
are never used, is it intentional?
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.
At the moment these are not used, you right. Could be used in the future when a popover for the header cells is required. But I agree with you, they can be removed.
Done!
if (isHeader) { | ||
return manageHeaderCoordinates(uiColumnIndex, scenarioGridColumn, gridClickPoint); | ||
} else { | ||
return (uiRowIndex == null || uiColumnIndex == null) ? manageBodyCoordinates(-1, -1) : manageBodyCoordinates(uiRowIndex, uiColumnIndex); |
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.
I would change this line to simple return manageBodyCoordinates(uiRowIndex, uiColumnIndex)
and add the check for null values inside of manageBodyCoordinates
. This wil facilitate invocation from other places (if needed in future), what do you think?
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.
Agree, DONE!
@Override | ||
protected boolean manageBodyCoordinates(Integer uiRowIndex, Integer uiColumnIndex) { | ||
/* In this case, the mouse is out ot the GridLayer, then return false, without perform any action */ | ||
if (uiColumnIndex == -1 || uiRowIndex == -1) { |
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.
Related to comment in AbstractScenarioSimulationGridPanelHandler
. This if
would change to uiColumnIndex == null || uiRowIndex == null
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.
Agree, DONE!
currentlyShownBodyColumnIndex = uiColumnIndex; | ||
/* It calculates the coordinates */ | ||
final GridColumn<?> column = scenarioGrid.getModel().getColumns().get(uiColumnIndex); | ||
Point2D xYCell = retrieveCellMiddleXYPosition(column, uiRowIndex); |
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.
xYCell
can be also final
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.
Done!
} else { | ||
errorReportPopupPresenter.show(ScenarioSimulationEditorConstants.INSTANCE.errorReason(), | ||
ScenarioSimulationEditorConstants.INSTANCE.errorPopoverMessageFailedWithException( | ||
factMappingValue.getExceptionMessage()), |
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.
Do we need to check null
value here as we do for FAILED_WITH_ERROR
and if test is positive use constant NULL
?
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.
Do you mean to test if factMappingValue.getStatus()
is null?
Yes, I agree to add it, but in another point. In my opinion, if that value is NULL, the popover shouldn't be visible at all. I put it in line 87.
} | ||
|
||
@Override | ||
public void show(final Optional<String> editorTitle, final int mx, final int my, Position position) { |
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.
Just for consistency, please make also the last parameter final: final Position position
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.
DONE!
final String keepText, | ||
final int mx, | ||
final int my, | ||
final Position position) { |
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.
Just formatting - indent of parameters.
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.
Done!
close=Close | ||
apply=Apply | ||
errorPopoverMessageFailedWithError=The expected value is ''{0}'' but the actual one is ''{1}''. | ||
errorPopoverMessageFailedWithException=Error with this value: {0} |
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.
Not sure if this comes form UX mockups, but I would expect something more like - "Exception with detailed message: {0}"
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.
In my knowledge, this case is not handled in UX mockups.
Fine for me to put yours.
DONE!
@Mock | ||
private FactMappingValue factMappingValueMock; | ||
@Mock | ||
private AbsolutePanel scrollPanel; |
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.
to be consistent, please use name scrollPanelMock
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.
Done!
@Mock | ||
private AbsolutePanel scrollPanel; | ||
@Mock | ||
private Element element; |
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.
To be consistent, please use name elementMock
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.
Done!
jenkins execute full downstream build |
@yesamer thank you for the PR, works very nice. I can confirm pints 1. and 3. from comment are fixed. The point 2. will be addressed by DROOLS-3992. There remain two points that I would like to discuss:
[2] |
@jomarko Thank you!
|
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.
Fine for me
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.
@yesamer
Fine for me, but I would prefer to have a green build for that before merging
jenkins execute full downstream build |
Hi @manstis, can you please merge this PR and kiegroup/drools#2335? |
@kkufova @gitgabrio @danielezonca @jomarko can you please test it and review it? Thanks!
https://issues.jboss.org/browse/DROOLS-3838
This PR contains the client sidechanges required for DROOLS-3838.
Related PR on drools-wb which contains backend change is here kiegroup/drools#2335
PRs list:
kiegroup/drools#2335