-
Notifications
You must be signed in to change notification settings - Fork 572
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
JBPM-10058 Task form with LocalDateTime datatype displays time format… #2768
Conversation
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 naming convention remarks.
...vices-jbpm-ui/src/main/java/org/kie/server/services/jbpm/ui/form/render/model/FormField.java
Outdated
Show resolved
Hide resolved
...ices-jbpm-ui/src/main/java/org/kie/server/services/jbpm/ui/form/render/model/LayoutItem.java
Outdated
Show resolved
Hide resolved
Jenkins retest this |
1 similar comment
Jenkins retest this |
Jenkins run fdb |
jenkins retest this please |
@bxf12315 It works fine and changes looks good. I just miss some testing |
@bxf12315 |
|
I am sorry, wrong button :-( . I just wanted to confirm Shilpa's finding. I am able to reproduce the same using FDB build. |
It seems we should extend testing as proposed by @nmirasch and test that the server is able to handle the localdatetime without time part. |
Updated, later I will add some tests for it. Thanks |
@nmirasch @jstastny-cz UT added. |
Jenkins retest this |
Jenkins run fdb |
@@ -503,6 +503,7 @@ private String getFieldType(FormField field) { | |||
default: | |||
switch (field.getType()) { | |||
case "java.time.LocalDateTime": | |||
return "datetime-local"; |
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.
This does not change the result of the switch, is that a leftover?
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.
it's a short name and will be used in the HTML template.
https://github.com/kiegroup/droolsjbpm-integration/pull/2768/files#diff-f490d20f356970cad0c84cd0ffe2f5396127ad65bcf5a6d08c0ee3439efbb4f9R65
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.
There's no operational difference in previous:
case "java.time.LocalDateTime":
case "java.util.Date":
case "java.sql.Date":
case "java.sql.Timestamp":
return "datetime-local";
and after this change:
case "java.time.LocalDateTime":
return "datetime-local";
case "java.util.Date":
case "java.sql.Date":
case "java.sql.Timestamp":
return "datetime-local";
So IMO this should be fixed or reverted.
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.
previous "java.time.LocalDateTime" return default name, now is "datetime-local"
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 original switch the case statement "case "java.time.LocalDateTime":
was activated when input matching the literal so the first return
value was actually returned. That's the way of execution in case statement without break statement is to continue in the following lines (and also cross cases) until it reaches interruption point (usually a break
statement in this case it's return
). In any case those two switches are identical when it comes to how it's executed.
The default
branch is activated only when none of the cases matched the input value.
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.
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'm with Jan here, if the case
statement doesn't have a end (break/return) the execution will continue until it reaches the next return/break
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.
@pefernan wdyt, should we rollback this change? IMO it's unnecessary isolated change of coding style - there is another approach applied for the rest of cases, so diverging might puzzle people (it did puzzle myself).
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.
totally
processAssetDesc.setId("test-id"); | ||
|
||
BootstrapFormRenderer bootstrapFormRenderer = new BootstrapFormRenderer(); | ||
String outString = bootstrapFormRenderer.renderProcess("test-contianerId", processAssetDesc, form); |
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.
String outString = bootstrapFormRenderer.renderProcess("test-contianerId", processAssetDesc, form); | |
String outString = bootstrapFormRenderer.renderProcess("test-containerId", processAssetDesc, form); |
Jenkins run fdb |
Jenkins run fdb |
Jenkins run fdb |
jenkins retest this please |
Jenkins run fdb |
Jenkins run fdb |
Jenkins run fdb |
@ChughShilpa @jstastny-cz @nmirasch @pefernan updated, please check agian, |
@bxf12315
|
BC. can not save local-datetime, so the. issue related to kie-server, I think we needs create new issue for it.
|
Agree with you @bxf12315 , these issues are not particularly related to this change. |
@@ -503,6 +503,7 @@ private String getFieldType(FormField field) { | |||
default: | |||
switch (field.getType()) { | |||
case "java.time.LocalDateTime": | |||
return "datetime-local"; |
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'm with Jan here, if the case
statement doesn't have a end (break/return) the execution will continue until it reaches the next return/break
@@ -409,7 +409,10 @@ protected void processFormLayout(FormInstance topLevelForm, | |||
if (outputs.get(field.getBinding()) != null) { | |||
value = outputs.get(field.getBinding()); | |||
} | |||
|
|||
|
|||
if (value != null && value.toString().length() >= 10 && "datetime-local".equals(fieldType) && !field.isShowTime()) { |
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'd do this inside of the next switch
@@ -503,6 +503,7 @@ private String getFieldType(FormField field) { | |||
default: | |||
switch (field.getType()) { | |||
case "java.time.LocalDateTime": | |||
return "datetime-local"; |
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.
totally
@@ -762,6 +775,19 @@ protected String appendExtractionExpression(String type, String name, String id, | |||
jsonTemplate.append("getMultipleInputData('") | |||
.append(id) | |||
.append("')"); | |||
} else if (type.equals("datetime-local")) { | |||
if (isShowTime) { |
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.
wouldn't it make sense here to use a mechansim like the ones in the date
type where the it converts the input value into the proper JS Date object correctly formatted with the getDateFormatted
function instead of adding the value as string?
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.
getDateFormatted will return an object, we need string in here.
Line 112 in 88f4182
Map<String, Object> parameters = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class); |
jenkins retest this please |
@bxf12315 the fix worked fine with the reproducer attached to the jira. The only thing that failed was to store date without the show time check. |
c504c4a
to
baf0116
Compare
… even when the option is unflagged
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.
LGTM. Tested fine.
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.
this code solves the customer issue.
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.
Tested and it looks fine
jenkins retest this please the build was green, the failure happened only on ant running jacoco coverage instrumentation
|
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.
works! thanks @bxf12315
Kudos, SonarCloud Quality Gate passed! |
… even when the option is unflagged (kiegroup#2768)
… even when the option is unflagged (kiegroup#2768)
… even when the option is unflagged (#2768)
… even when the option is unflagged (#2768)
… even when the option is unflagged
Thank you for submitting this pull request
JIRA: (please edit the JIRA link if it exists)
[link](JBPM-10058)
referenced Pull Requests:
How to replicate CI configuration locally?
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.
build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.
How to retest this PR or trigger a specific build:
a pull request please add comment: Jenkins retest this
a full downstream build please add comment: Jenkins run fdb
a compile downstream build please add comment: Jenkins run cdb
a full production downstream build please add comment: Jenkins execute product fdb
an upstream build please add comment: Jenkins run upstream