thiagoelg commented on code in PR #3183:
URL:
https://github.com/apache/incubator-kie-tools/pull/3183#discussion_r2153129489
##########
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx:
##########
@@ -90,6 +90,38 @@ const WorkflowListTable: React.FC<WorkflowListTableProps &
OUIAProps> = ({
const [titleType, setTitleType] = useState<string>("");
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
const [selectedWorkflowInstance, setSelectedWorkflowInstance] =
useState<WorkflowInstance | null>(null);
+ const [sortByState, setSortByState] = useState<{ index: number; direction:
"asc" | "desc" }>({
+ index: 2,
+ direction: "asc",
+ });
+
+ const getComparableValue = (instance: WorkflowInstance, columnKey: string):
any => {
+ switch (columnKey) {
+ case "Id":
+ return instance.id;
+ case "Status":
+ return instance.state;
+ case "Created":
+ return new Date(instance.start);
+ case "Last update":
+ return new Date(instance.lastUpdate);
+ default:
+ return "";
+ }
+ };
+
+ const onSortInternal = (_event: React.SyntheticEvent, index: number,
direction: "asc" | "desc") => {
Review Comment:
This will sort the already-fetched items, but if the Data Index is returning
a "paginated" list of items, this sort is not necessarily correct.
@fantonangeli , can the Data-Index sort by ID?
--
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]