-
Notifications
You must be signed in to change notification settings - Fork 190
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
[kie-issues#1720] Enhance Process Details UI page to show nodeInstanceId each timer belongs to #2820
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.
Thank you for the pull request. I have a question about isNil
usage. Could you please explain little bit more why we need it for:
job.priority
job.repeatInterval
job.repeatLimit
while we do not need it for:
job.scheduleId
job.callbackEndpoint
usually our effort is to minimize the need of used libraries. So just doublechecking if we need to introduce a dependency for lodash.isNil
in this file.
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
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.
Please undo this change, it is an important aspect of releasing Apache open source. Because of this change "CI :: License headers" check will fail.
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.
As seen in this screenshot, priority, repeatInterval and repeatLimit weren't displayed correctly. In this example priority was either null/undefined, repeatInterval and repeatLimit are boths 0's. All three are numbers. I did this to display them when they are also 0. callbackEndpoint and scheduledId are both strings hence not requiring stringent validation |
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.
+1 when licenses are back and all is green.
@pefernan @josedee ok, that changes the situation, and I am sorry, it is my fault. If like:
|
@jomarko Does it consider all types.tsx files? Should we add only the specific tsx file. In this case
|
@josedee thank you for comment. It is currently not possible to add I see currently only two |
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.
Hi @josedee . Nice PR! I've just made some request changes inline regarding the lodash/isNil
usage.
@@ -26,6 +26,7 @@ import Moment from "react-moment"; | |||
import "../styles.css"; | |||
import { Job } from "@kie-tools/runtime-tools-process-gateway-api/dist/types"; | |||
import { OUIAProps, componentOuiaProps } from "@kie-tools/runtime-tools-components/dist/ouiaTools"; | |||
import isNil from "lodash/isNil"; |
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.
Please, use the inline check (<value> === undefined
or <value> !== undefined
) instead of using a library to do so. This method checks if the value is null
or undefined
[1], and looking in the Job
type, we don't have one case that can have those two values.
</Split> | ||
</FlexItem> | ||
{job.repeatInterval && ( | ||
{!isNil(job.priority) && ( |
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.
job.priority
is from type number
, you don't need to check if it will be null
or undefined
.
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.
Thanks for the suggestions @ljmotta. I think we can use ===
or !==
but one thing I think in the bug screenshot attached job.priority
is displayed as Priority:
without applying any validations. In that case I think it maybe null/undefined
</Split> | ||
</FlexItem> | ||
)} | ||
{!isNil(job.repeatInterval) && ( |
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.
job.repeatInterval
is from type number
as well.
@@ -93,7 +104,7 @@ export const JobsDetailsModal: React.FC<IOwnProps & OUIAProps> = ({ | |||
</Split> | |||
</FlexItem> | |||
)} | |||
{job.repeatLimit && ( | |||
{!isNil(job.repeatLimit) && ( |
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.
same
...ocessDetails/envelope/components/ProcessDetailsTimelinePanel/ProcessDetailsTimelinePanel.tsx
Show resolved
Hide resolved
@pefernan oh ok! So the |
@ljmotta nope priority, repeatLimit & repeatInterval can be undefined |
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 did no manual checks. However apache licenses
and isNil
removal seems as addressed.
</Split> | ||
</FlexItem> | ||
{job.repeatInterval && ( | ||
{job.priority !== undefined && ( | ||
<FlexItem> |
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.
So maybe the priority can have the null
value?
Closes apache/incubator-kie-issues#1720
Currently we do not have node instance details for every job in the Process Details UI page. Hence adding nodeInstanceId corresponding to each job/timer.