From 338c1f85c94044119c989f564cb4b52db1dfd99e Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Tue, 7 Dec 2021 18:08:34 +0100 Subject: [PATCH 1/3] fix: ConfirmDialog title shows undefined on exit chore: remove variable --- .../src/components/machineActions/MachineActions.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/new-lamassu-admin/src/components/machineActions/MachineActions.js b/new-lamassu-admin/src/components/machineActions/MachineActions.js index d2f58eea..60d20174 100644 --- a/new-lamassu-admin/src/components/machineActions/MachineActions.js +++ b/new-lamassu-admin/src/components/machineActions/MachineActions.js @@ -97,7 +97,6 @@ const MachineActions = memo(({ machine, onActionSuccess }) => { } }) - const confirmDialogOpen = Boolean(action.command) const disabled = !!(action?.command === 'restartServices' && loadingEvents) const machineStatusPreflight = actionToDo => { @@ -193,8 +192,8 @@ const MachineActions = memo(({ machine, onActionSuccess }) => { { }) }} onDismissed={() => { - setAction({ command: null }) + setAction({ display: action.display, command: null }) setErrorMessage(null) }} /> From e07d33fd41da9af99f03b0fcb9b3bd0e02f91786 Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Tue, 7 Dec 2021 18:37:22 +0100 Subject: [PATCH 2/3] fix: Dialog title shows undefined on confirm --- .../src/components/machineActions/MachineActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-lamassu-admin/src/components/machineActions/MachineActions.js b/new-lamassu-admin/src/components/machineActions/MachineActions.js index 60d20174..fa129c7f 100644 --- a/new-lamassu-admin/src/components/machineActions/MachineActions.js +++ b/new-lamassu-admin/src/components/machineActions/MachineActions.js @@ -93,7 +93,7 @@ const MachineActions = memo(({ machine, onActionSuccess }) => { }, onCompleted: () => { onActionSuccess && onActionSuccess() - setAction({ command: null }) + setAction({ display: action.display, command: null }) } }) From 712b31e3ff613aeae3fcb3b6cedca6722412b9fc Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Thu, 9 Dec 2021 21:13:21 +0100 Subject: [PATCH 3/3] fix: revert explicit cast --- .../src/components/machineActions/MachineActions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/new-lamassu-admin/src/components/machineActions/MachineActions.js b/new-lamassu-admin/src/components/machineActions/MachineActions.js index fa129c7f..815d8e90 100644 --- a/new-lamassu-admin/src/components/machineActions/MachineActions.js +++ b/new-lamassu-admin/src/components/machineActions/MachineActions.js @@ -97,6 +97,7 @@ const MachineActions = memo(({ machine, onActionSuccess }) => { } }) + const confirmDialogOpen = Boolean(action.command) const disabled = !!(action?.command === 'restartServices' && loadingEvents) const machineStatusPreflight = actionToDo => { @@ -192,7 +193,7 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {