fantonangeli commented on code in PR #2478:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2478#discussion_r1687774148


##########
packages/runtime-tools-swf-enveloped-components/src/workflowDefinitions/envelope/components/WorkflowDefinitionList/WorkflowDefinitionList.tsx:
##########
@@ -44,6 +44,29 @@ const WorkflowDefinitionList: 
React.FC<WorkflowDefinitionListProps & OUIAProps>
   const [isLoading, setIsLoading] = useState<boolean>(true);
   const [filterWorkflowNames, setFilterWorkflowNames] = useState<string[]>([]);
   const [error, setError] = useState<string>();
+  const [defaultPageSize] = useState<number>(10);
+  const [isLoadingMore, setIsLoadingMore] = useState<boolean>(false);
+  const [limit, setLimit] = useState<number>(defaultPageSize);
+
+  const doQuery = async (

Review Comment:
   We can move the logic from `init()` inside the `doQuery()`  and in the 
`init()` call the `doQuery()`.
   See `WorkflowList.initLoad()` as example.



##########
packages/runtime-tools-swf-enveloped-components/src/workflowDefinitions/envelope/components/WorkflowDefinitionListToolbar/WorkflowDefinitionListToolbar.tsx:
##########
@@ -60,9 +62,8 @@ const WorkflowDefinitionListToolbar: 
React.FC<WorkflowDefinitionListToolbarProps
     setFilterWorkflowNames([]);
   };
 
-  const doRefresh = (): void => {
-    setFilterWorkflowNames([...filterWorkflowNames]);
-    applyFilter();
+  const refresh = (): void => {

Review Comment:
   I think we can remove the `refresh()` function and call directly the 
`doRefresh()` received from `WorkflowDefinitionList`.
   Together with this we can rename `doRefresh()` to `refresh()` following the 
same names and style of `WorkflowListToolbar`



##########
packages/runtime-tools-swf-enveloped-components/src/workflowDefinitions/envelope/components/WorkflowDefinitionList/WorkflowDefinitionList.tsx:
##########
@@ -44,6 +44,29 @@ const WorkflowDefinitionList: 
React.FC<WorkflowDefinitionListProps & OUIAProps>
   const [isLoading, setIsLoading] = useState<boolean>(true);
   const [filterWorkflowNames, setFilterWorkflowNames] = useState<string[]>([]);
   const [error, setError] = useState<string>();
+  const [defaultPageSize] = useState<number>(10);
+  const [isLoadingMore, setIsLoadingMore] = useState<boolean>(false);
+  const [limit, setLimit] = useState<number>(defaultPageSize);
+
+  const doQuery = async (
+    _offset: number,
+    _limit: number,
+    _resetWorkflows: boolean,
+    _resetPagination: boolean = false,
+    _loadMore: boolean = false

Review Comment:
   Please remove the parameters which we don't use



##########
packages/runtime-tools-swf-enveloped-components/src/workflowDefinitions/envelope/components/WorkflowDefinitionList/WorkflowDefinitionList.tsx:
##########
@@ -44,6 +44,31 @@ const WorkflowDefinitionList: 
React.FC<WorkflowDefinitionListProps & OUIAProps>
   const [isLoading, setIsLoading] = useState<boolean>(true);
   const [filterWorkflowNames, setFilterWorkflowNames] = useState<string[]>([]);
   const [error, setError] = useState<string>();
+  const [defaultPageSize] = useState<number>(10);
+  const [isLoadingMore, setIsLoadingMore] = useState<boolean>(false);
+  // const [selectableInstances, setSelectableInstances] = useState<number>(0);
+  const [limit, setLimit] = useState<number>(defaultPageSize);

Review Comment:
   These variables are used in `WorkflowList` but we don't need these variables 
in `WorkflowDefinitionList` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to