Skip to content

Commit

Permalink
remove FE sorting of processDefinitionData
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzuming committed Jan 17, 2025
1 parent a748090 commit 9d4084a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions designer/client/src/actions/nk/processDefinitionData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import HttpService from "../../http/HttpService";
import { ProcessDefinitionData, TypingResult } from "../../types";
import { ProcessDefinitionData } from "../../types";
import { ThunkAction } from "../reduxTypes";
import { orderBy } from "lodash";

export type ProcessDefinitionDataAction = {
type: "PROCESS_DEFINITION_DATA";
Expand All @@ -10,14 +9,10 @@ export type ProcessDefinitionDataAction = {

export type ProcessingType = string;

const orderedProcessDefinitionDataClasses = (classes: TypingResult[]) => orderBy(classes, ["display", "refClazzName"]);

export function fetchProcessDefinition(processingType: ProcessingType, isFragment?: boolean): ThunkAction<Promise<ProcessDefinitionData>> {
return async (dispatch) => {
const { data: processDefinitionData } = await HttpService.fetchProcessDefinitionData(processingType, isFragment);

// Since BE doesn't provide ordered classes, to correctly memoize data in redux and not create a new object reference on every state change we need to order classes
processDefinitionData.classes = orderedProcessDefinitionDataClasses(processDefinitionData.classes);
dispatch({ type: "PROCESS_DEFINITION_DATA", processDefinitionData });

return processDefinitionData;
Expand Down

0 comments on commit 9d4084a

Please sign in to comment.