From 5207f3271221f706ef0f341ad35b011be6df9814 Mon Sep 17 00:00:00 2001 From: ivanszabo Date: Mon, 31 Mar 2025 22:13:17 +0200 Subject: [PATCH] BUGFIX-ek --- src/WorkFlowCheck.BL/Services/SyncService.cs | 7 +++++- .../CheckListHeaderEditPage.cshtml | 9 ++++++- .../CheckListTemplateHeaderEditPage.cshtml | 2 -- ...RoleCheckListTemplateHeaderEditPage.cshtml | 2 +- .../UserAndRole/RoleCheckPointEditPage.cshtml | 11 +++----- .../Pages/UserAndRole/RoleEditPage.cshtml | 25 +++++++++++++------ .../Pages/UserAndRole/UserRoleEditPage.cshtml | 2 +- 7 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/WorkFlowCheck.BL/Services/SyncService.cs b/src/WorkFlowCheck.BL/Services/SyncService.cs index 0acf7ee..eb4b146 100644 --- a/src/WorkFlowCheck.BL/Services/SyncService.cs +++ b/src/WorkFlowCheck.BL/Services/SyncService.cs @@ -5,6 +5,7 @@ using Serilog; using System.Collections.Generic; using WorkFlowCheck.BL.Services.Interfaces; using WorkFlowCheck.Common.DTO; +using WorkFlowCheck.Common.Enums; using WorkFlowCheck.DL; using WorkFlowCheck.DL.Entities; @@ -322,7 +323,11 @@ namespace WorkFlowCheck.BL.Services try { var res = await _dbContext.CheckListHeaders - .Where(w => w.IsEditable && w.UserId == userId && w.IsDeleted != true) + .Where(w => w.IsEditable && + w.UserId == userId && + w.IsDeleted != true && + (w.CheckStatus == CheckStatus.InProgress || + w.CheckStatus == CheckStatus.Open)) .Include(i => i.CheckListRows) //.ThenInclude(i => i.CheckListTemplateRow) .AsNoTracking() diff --git a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderEditPage.cshtml index 4905d7b..c63a206 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderEditPage.cshtml @@ -96,7 +96,14 @@ { data: "checkListTemplateRowDTO.rowIndex" }, { data: "checkListTemplateRowDTO.checkPointDTO.shortName" }, { data: "checkListTemplateRowDTO.operationDescription" }, - { data: "checkListTemplateRowDTO.answerType" }, + { + data: "checkListTemplateRowDTO.answerType", + searchable: false, + sortable: false, + render: function ( data, type, row ) { + return renderAnswerType(data); + } + }, { data: "answer" }, { data: null, render: function (data, type, row) { return renderActionButtons(row.id); diff --git a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml index fe5e40f..3803705 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml @@ -151,8 +151,6 @@ formData.CheckListTemplateHeaderDTO.CheckListTemplateRowDTO=[]; - console.log(formData.CheckListTemplateHeaderDTO); - if ($form.valid()) { $.ajax({ diff --git a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeaderEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeaderEditPage.cshtml index 8236864..5a80c08 100644 --- a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeaderEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeaderEditPage.cshtml @@ -64,7 +64,7 @@ }, data: JSON.stringify(formData.RoleCheckListTemplateHeaderDTO), success: function (response) { - // console.log(response); + if (response.success) { showMessageModal({ diff --git a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointEditPage.cshtml index 47453fa..4e1fad2 100644 --- a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointEditPage.cshtml @@ -15,8 +15,8 @@
- - + +
@@ -49,10 +49,7 @@ var formData = getFormAsNestedObject('#RoleCheckPointForm'); const $form = $('#RoleCheckPointForm'); formData.RoleCheckPointDTO.Enabled = $('#RoleCheckPointForm input[name="RoleCheckPointDTO.Enabled"]').is(':checked'); - - // console.log(formData); - console.log(formData.RoleCheckPointDTO); - + // formData.RoleCheckPointDTO.Enabled = $('#RoleCheckPointDTO_Enabled').is(':checked'); if ($form.valid()) { $.ajax({ @@ -64,7 +61,7 @@ }, data: JSON.stringify(formData.RoleCheckPointDTO), success: function (response) { - + if (response.success) { showMessageModal({ diff --git a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleEditPage.cshtml index cbf6fd4..2bb731b 100644 --- a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleEditPage.cshtml @@ -35,7 +35,7 @@ var formData = getFormAsNestedObject('#RoleForm'); const $form = $('#RoleForm'); - formData.RoleDTO.RoleDTO=[]; + if ($form.valid()) { @@ -46,13 +46,24 @@ 'X-CSRF-TOKEN': csrfToken, 'Content-Type': 'application/json' }, - data: JSON.stringify(formData.Role), + data: JSON.stringify(formData.RoleDTO), success: function (response) { - showMessageModal({ - title: 'Figyelmem!', - message: 'Sikeres mentés.', - okText: 'Értettem' - }); + if (response.success) + { + showMessageModal({ + title: 'Figyelmem!', + message: 'Sikeres mentés.', + okText: 'Értettem' + }); + } + else + { + showMessageModal({ + title: 'Figyelmem, HIBA!', + message: 'Sikertelen mentés.', + okText: 'Értettem' + }); + } }, error: function (xhr, status, error) { // Hiba esetén diff --git a/src/WorkFlowCheck.Web/Pages/UserAndRole/UserRoleEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/UserAndRole/UserRoleEditPage.cshtml index ea147dd..6d55fb0 100644 --- a/src/WorkFlowCheck.Web/Pages/UserAndRole/UserRoleEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/UserAndRole/UserRoleEditPage.cshtml @@ -53,7 +53,7 @@ }, data: JSON.stringify(formData.UserRoleDTO), success: function (response) { - // console.log(response); + if (response.success) { showMessageModal({