diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index b5bceed..d61804b 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -214,6 +214,10 @@ "popconfirm": { "title": "Sind Sie sicher, dass Sie den Job von dem Roboter entfernen wollen?", "description": "Der Roboter wird danach wieder für Aufträge zur Verfügung stehen" + }, + "popconfirmErrorNotification": { + "message": "Job konnte nicht entfernt werden", + "description": "Der Roboter ist am arbeiten" } } }, diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 7cfd66b..e8ab29b 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -214,6 +214,10 @@ "popconfirm": { "title": "Are you sure you want to free up the job of the robot?", "description": "The job of the robot will be removed" + }, + "popconfirmErrorNotification": { + "message": "Job could not be freed up", + "description": "The robot is not processing a job" } } }, diff --git a/src/Pages/Robotics/Robots/index.js b/src/Pages/Robotics/Robots/index.js index be71db0..316d724 100644 --- a/src/Pages/Robotics/Robots/index.js +++ b/src/Pages/Robotics/Robots/index.js @@ -250,7 +250,18 @@ export default function Robots() { {}, myFetchContentType.JSON, Constants.ROBOTICS_API_ADDRESS - ) + ).catch((err) => { + if (err === 422) { + notificationApi["error"]({ + message: t( + "robotics.robots.freeUpJob.popconfirmErrorNotification.message" + ), + description: t( + "robotics.robots.freeUpJob.popconfirmErrorNotification.description" + ), + }); + } + }) } icon={} >