From 67fe85f4a0c3b2d5e8862dff118c144aa69eecf8 Mon Sep 17 00:00:00 2001 From: RealZimboGuy Date: Thu, 2 May 2024 11:34:14 +0200 Subject: [PATCH] sort the state variables by key ref https://github.com/NitorCreations/nflow/issues/638 (#639) --- .../src/workflow-instance/StateVariableTable.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nflow-explorer/src/workflow-instance/StateVariableTable.tsx b/nflow-explorer/src/workflow-instance/StateVariableTable.tsx index 419c3cd49..57b0e6dea 100644 --- a/nflow-explorer/src/workflow-instance/StateVariableTable.tsx +++ b/nflow-explorer/src/workflow-instance/StateVariableTable.tsx @@ -11,11 +11,13 @@ function StateVariableTable(props: {instance: WorkflowInstance}) { ); }; - const columns = Object.keys(props.instance.stateVariables || {}).map(key => ({ - field: key, - headerName: key, - fieldRender: renderValue - })); + const columns = Object.keys(props.instance.stateVariables || {}) + .map(key => ({ + field: key, + headerName: key, + fieldRender: renderValue + })) + .sort((a, b) => a.field.localeCompare(b.field)); if (!props.instance.stateVariables) { return No state variables;