From c253de0ba8d74b93621be360f705d9a826ff69cb Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sat, 7 Dec 2024 14:49:58 +0100 Subject: [PATCH 1/3] fixed missing shipcall id in backend result --- src/server/BreCal/validators/input_validation_shipcall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/BreCal/validators/input_validation_shipcall.py b/src/server/BreCal/validators/input_validation_shipcall.py index ff86287..060909f 100644 --- a/src/server/BreCal/validators/input_validation_shipcall.py +++ b/src/server/BreCal/validators/input_validation_shipcall.py @@ -498,7 +498,7 @@ class InputValidationShipcall(): # if the *existing* shipcall in the database is canceled, it may not be changed if shipcall.get("canceled", False): - raise ValidationError({"canceled":f"The shipcall with id 'shipcall_id' is canceled. A canceled shipcall may not be changed."}) + raise ValidationError({"canceled":f"The shipcall with id {shipcall_id} is canceled. A canceled shipcall may not be changed."}) return @staticmethod From d536d9479e41f79c2420dd6006621ca858ad6f11 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sat, 7 Dec 2024 14:50:40 +0100 Subject: [PATCH 2/3] Do not allow editing on cancelled shipcalls --- src/BreCalClient/EditShipcallControl.xaml.cs | 4 ++++ src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs | 2 +- src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs | 2 +- src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs | 2 +- src/BreCalClient/EditTimesControl.xaml.cs | 2 +- src/BreCalClient/EditTimesTerminalControl.xaml.cs | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 76fd1a0..f02ab43 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -188,6 +188,8 @@ namespace BreCalClient void CheckForCompletion() { + if (this.ShipcallModel.Shipcall?.Canceled ?? false) return; // Cancelled shipcall never clicks ok + bool isEnabled = true; isEnabled &= this.comboBoxShip.SelectedItem != null; @@ -378,6 +380,8 @@ namespace BreCalClient bool editRightGrantedForBSMD = false; + if (this.ShipcallModel.Shipcall?.Canceled ?? false) return; // do not allow edit on canceled shipcall + // Special case: Selected Agency allows BSMD to edit their fields if (this.comboBoxAgency.SelectedIndex >= 0) { diff --git a/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs index d0273a9..4362f2c 100644 --- a/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs +++ b/src/BreCalClient/EditTimesAgencyIncomingControl.xaml.cs @@ -366,7 +366,7 @@ namespace BreCalClient private void CheckOKButton() { - this.buttonOK.IsEnabled = _editing && RequiredFieldsSet(); + this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false); } #endregion diff --git a/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs index c866dfb..5506317 100644 --- a/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs +++ b/src/BreCalClient/EditTimesAgencyOutgoingControl.xaml.cs @@ -356,7 +356,7 @@ namespace BreCalClient private void CheckOKButton() { - this.buttonOK.IsEnabled = _editing && RequiredFieldsSet(); + this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false); } #endregion diff --git a/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs b/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs index dab96ed..aab35ab 100644 --- a/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs +++ b/src/BreCalClient/EditTimesAgencyShiftingControl.xaml.cs @@ -394,7 +394,7 @@ namespace BreCalClient private void CheckOKButton() { - this.buttonOK.IsEnabled = _editing && RequiredFieldsSet(); + this.buttonOK.IsEnabled = _editing && RequiredFieldsSet() && !(this.ShipcallModel.Shipcall?.Canceled ?? false); } #endregion diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs index 3c699f3..aa0c3bf 100644 --- a/src/BreCalClient/EditTimesControl.xaml.cs +++ b/src/BreCalClient/EditTimesControl.xaml.cs @@ -259,7 +259,7 @@ namespace BreCalClient // setting en/dis-abled - if (this.Times.ParticipantId != App.Participant.Id) + if ((this.Times.ParticipantId != App.Participant.Id) || (this.ShipcallModel.Shipcall?.Canceled ?? false)) { this.buttonFixedOrder.IsEnabled = false; this.buttonOK.IsEnabled = false; diff --git a/src/BreCalClient/EditTimesTerminalControl.xaml.cs b/src/BreCalClient/EditTimesTerminalControl.xaml.cs index 54d87a3..36e55ec 100644 --- a/src/BreCalClient/EditTimesTerminalControl.xaml.cs +++ b/src/BreCalClient/EditTimesTerminalControl.xaml.cs @@ -217,7 +217,7 @@ namespace BreCalClient private void EnableControls() { - if (this.Times.ParticipantId != App.Participant.Id) + if ((this.Times.ParticipantId != App.Participant.Id) || (this.ShipcallModel.Shipcall?.Canceled ?? false)) { this.buttonOK.IsEnabled = false; return; From 70977e9abd163b172c7d22c80345891043265c07 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sat, 7 Dec 2024 15:12:16 +0100 Subject: [PATCH 3/3] Version bump to 1.6.0.8 --- misc/version.txt | 2 +- src/BreCalClient/BreCalClient.csproj | 4 ++-- .../Properties/PublishProfiles/ClickOnceTestProfile.pubxml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/version.txt b/misc/version.txt index 2379a4c..5dc1d67 100644 --- a/misc/version.txt +++ b/misc/version.txt @@ -1 +1 @@ -1.6.0.6 \ No newline at end of file +1.6.0.8 \ No newline at end of file diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index a6dcc3a..88b1f22 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -8,8 +8,8 @@ True BreCalClient.App ..\..\misc\brecal.snk - 1.6.0.6 - 1.6.0.6 + 1.6.0.8 + 1.6.0.8 Bremen calling client A Windows WPF client for the Bremen calling API. containership.ico diff --git a/src/BreCalClient/Properties/PublishProfiles/ClickOnceTestProfile.pubxml b/src/BreCalClient/Properties/PublishProfiles/ClickOnceTestProfile.pubxml index 7e092c7..6e4026a 100644 --- a/src/BreCalClient/Properties/PublishProfiles/ClickOnceTestProfile.pubxml +++ b/src/BreCalClient/Properties/PublishProfiles/ClickOnceTestProfile.pubxml @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. 6 - 1.6.0.6 + 1.6.0.8 True Debug True @@ -41,7 +41,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. bin\Debug\net6.0-windows\win-x64\app.publish\ win-x64 false - 1.6.0.6 + 1.6.0.8