From e78f512eeef1658406b2d70082fae0a5867014b9 Mon Sep 17 00:00:00 2001 From: abarz722 Date: Wed, 29 May 2024 17:21:12 +0200 Subject: [PATCH] some small fixes --- .../files/sql/idempotent/fworch-texts.sql | 8 +++--- .../EditAppRoleLeftSide.razor | 2 +- .../NetworkModelling/EditAppServer.razor | 14 +++++++++- .../NetworkModelling/ManualAppServer.razor | 6 ++--- .../NetworkModelling/NetworkModelling.razor | 17 +++--------- .../Settings/SettingsModellingPers.razor | 5 ++-- .../SettingsRecertificationPers.razor | 5 ++-- .../Pages/Settings/SettingsReport.razor | 5 ++-- .../files/FWO.UI/Shared/ConnectionTable.razor | 27 +++++++++++++++---- 9 files changed, 55 insertions(+), 34 deletions(-) diff --git a/roles/database/files/sql/idempotent/fworch-texts.sql b/roles/database/files/sql/idempotent/fworch-texts.sql index c9dbd0728..58b042680 100644 --- a/roles/database/files/sql/idempotent/fworch-texts.sql +++ b/roles/database/files/sql/idempotent/fworch-texts.sql @@ -2817,10 +2817,8 @@ INSERT INTO txt VALUES ('E5291', 'English', 'Owner could not be saved'); INSERT INTO txt VALUES ('E5292', 'German', 'Dn oder Gruppe muss gefüllt sein'); INSERT INTO txt VALUES ('E5292', 'English', 'Dn or group has to be filled'); -INSERT INTO txt VALUES ('E5301', 'German', 'Konfiguration für Standardsprache konnte nicht gelesen werden: Wert auf Englisch gesetzt'); -INSERT INTO txt VALUES ('E5301', 'English', 'Error reading Config for default language: taking default English'); -INSERT INTO txt VALUES ('E5302', 'German', 'Konfiguration konnte nicht gelesen werden, Standardwert gesetzt: '); -INSERT INTO txt VALUES ('E5302', 'English', 'Error reading Config, taking default: '); +INSERT INTO txt VALUES ('E5301', 'German', 'Konfiguration konnte nicht gelesen oder verarbeitet werden.'); +INSERT INTO txt VALUES ('E5301', 'English', 'Error reading or processing Config.'); INSERT INTO txt VALUES ('E5401', 'German', 'Bitte das alte Passwort eintragen'); INSERT INTO txt VALUES ('E5401', 'English', 'Please insert the old password'); @@ -2927,6 +2925,8 @@ INSERT INTO txt VALUES ('E9015', 'German', 'Schnittstelle kann beantragte nicht INSERT INTO txt VALUES ('E9015', 'English', 'Interface cannot replace requested one: Wrong type.'); INSERT INTO txt VALUES ('E9016', 'German', 'Beantragte Schnittstelle kann nicht gelöscht werden.'); INSERT INTO txt VALUES ('E9016', 'English', 'Requested interface cannot be deleted.'); +INSERT INTO txt VALUES ('E9101', 'German', 'Fehler bei externer Auftragserzeugung.'); +INSERT INTO txt VALUES ('E9101', 'English', 'Error at external ticket creation.'); -- errors from Api INSERT INTO txt VALUES ('A0001', 'German', 'Ungültige Anmeldedaten. Nutzername darf nicht leer sein'); diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor index fb75ff008..03212929c 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor @@ -10,7 +10,7 @@
@(userConfig.GetText("app_server"))
-
+
diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppServer.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppServer.razor index 1c7737572..964956dcb 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppServer.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppServer.razor @@ -63,7 +63,7 @@ { - + @@ -91,6 +91,9 @@ [Parameter] public ModellingAppServerHandler AppServerHandler { get; set; } + [Parameter] + public EventCallback AppServerHandlerChanged { get; set; } + private List appServerTypes = new(); private AppServerType actAppServerType = new(); private bool firstTry = true; @@ -131,6 +134,15 @@ Close(); } + private async Task Save() + { + if(await AppServerHandler.Save()) + { + await AppServerHandlerChanged.InvokeAsync(AppServerHandler); + Close(); + } + } + private void Close() { Display = false; diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor index ba1915ee1..4e5ca8e1f 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor @@ -61,7 +61,7 @@ - + extTicketSystems = new(); - - try - { - configData = await globalConfig.GetEditableConfig(); - extTicketSystems = System.Text.Json.JsonSerializer.Deserialize>(configData.ExtTicketSystems) ?? new(); - } - catch (Exception exception) - { - DisplayMessageInUi(exception, userConfig.GetText("read_config"), userConfig.GetText("E5301"), false); - } + List extTicketSystems = System.Text.Json.JsonSerializer.Deserialize>(userConfig.ExtTicketSystems) ?? new(); // build ticket SCTicket ticket = new(appHandler.Connections, "test ticket 1", TicketPriority.High); // create external ticket - if (extTicketSystems.Count()>0) + if (extTicketSystems.Count() > 0) { try { @@ -295,7 +284,7 @@ Roles.Auditor }); } catch (Exception exception) { - DisplayMessageInUi(exception, userConfig.GetText("ext_ticket_fail"), userConfig.GetText("E5301"), false); + DisplayMessageInUi(exception, userConfig.GetText("ext_ticket_fail"), userConfig.GetText("E9101"), false); } } diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsModellingPers.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsModellingPers.razor index 530b3a639..e874ed771 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsModellingPers.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsModellingPers.razor @@ -8,6 +8,7 @@ @attribute [Authorize(Roles = $"{Roles.Admin}, {Roles.Auditor}, {Roles.Modeller}")] @inject ApiConnection apiConnection +@inject GlobalConfig globalConfig @inject UserConfig userConfig
@@ -56,7 +57,7 @@ else { try { - configData = await userConfig.GetEditableConfig(); + configData = await globalConfig.GetEditableConfig(); } catch (Exception exception) { @@ -69,7 +70,7 @@ else { if (configData != null) { - await userConfig.WriteToDatabase(configData, apiConnection); + await globalConfig.WriteToDatabase(configData, apiConnection); DisplayMessageInUi(null, userConfig.GetText("modelling_settings"), userConfig.GetText("U5301"), false); } else diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor index 65affc1aa..58f3d1248 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor @@ -7,6 +7,7 @@ @attribute [Authorize(Roles = $"{Roles.Admin}, {Roles.Recertifier}, {Roles.Auditor}")] @inject ApiConnection apiConnection +@inject GlobalConfig globalConfig @inject UserConfig userConfig
@@ -47,7 +48,7 @@ else { try { - configData = await userConfig.GetEditableConfig(); + configData = await globalConfig.GetEditableConfig(); } catch (Exception exception) { @@ -61,7 +62,7 @@ else { if (configData != null) { - await userConfig.WriteToDatabase(configData, apiConnection); + await globalConfig.WriteToDatabase(configData, apiConnection); DisplayMessageInUi(null, userConfig.GetText("recert_settings"), userConfig.GetText("U5301"), false); } else diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor index 11e455bd8..b49013baf 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor @@ -7,6 +7,7 @@ @attribute [Authorize(Roles = $"{Roles.Admin}, {Roles.Reporter}, {Roles.ReporterViewAll}, {Roles.Recertifier}, {Roles.Auditor}, {Roles.FwAdmin}")] @inject ApiConnection apiConnection +@inject GlobalConfig globalConfig @inject UserConfig userConfig
@@ -80,7 +81,7 @@ else { try { - configData = await userConfig.GetEditableConfig(); + configData = await globalConfig.GetEditableConfig(); } catch (Exception exception) { @@ -94,7 +95,7 @@ else { if (configData != null) { - await userConfig.WriteToDatabase(configData, apiConnection); + await globalConfig.WriteToDatabase(configData, apiConnection); DisplayMessageInUi(null, userConfig.GetText("report_settings"), userConfig.GetText("U5301"), false); } else diff --git a/roles/ui/files/FWO.UI/Shared/ConnectionTable.razor b/roles/ui/files/FWO.UI/Shared/ConnectionTable.razor index cd51dec72..2780bc76a 100644 --- a/roles/ui/files/FWO.UI/Shared/ConnectionTable.razor +++ b/roles/ui/files/FWO.UI/Shared/ConnectionTable.razor @@ -51,9 +51,17 @@ { } - + + + + Field="@(x => x.Reason)" Sortable="true" Filterable="true" > + +