From a6b52f784887ecf9053c8afc7cd63cd8b5176f53 Mon Sep 17 00:00:00 2001 From: abarz722 Date: Tue, 27 Aug 2024 09:52:07 +0200 Subject: [PATCH 01/21] fix monitoring, tickets desc, small rename --- .../APIcalls/request/getTickets.graphql | 2 +- .../Pages/Monitoring/MonitoringMain.razor | 325 ++++++++++-------- .../Pages/NetworkModelling/EditConn.razor | 2 +- .../RejectInterfacePopup.razor | 2 +- .../Services/ModellingConnectionHandler.cs | 2 +- .../ui/files/FWO.UI/Services/TicketCreator.cs | 2 +- 6 files changed, 187 insertions(+), 148 deletions(-) diff --git a/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql b/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql index 3a5405a07..3b96a268d 100644 --- a/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql +++ b/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql @@ -1,5 +1,5 @@ query getTickets($fromState: Int!, $toState: Int!) { - request_ticket(where: {_or: [{_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}, {reqtasks: {_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}}]}, order_by: {id: asc}) { + request_ticket(where: {_or: [{_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}, {reqtasks: {_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}}]}, order_by: {id: desc}) { ...ticketDetails } } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor index 4b32ea453..10517493b 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor @@ -92,48 +92,55 @@ } - - - + + + @code { + [CascadingParameter] + private Task? authenticationStateTask { get; set; } + [CascadingParameter] Action DisplayMessageInUi { get; set; } = DefaultInit.DoNothing; - private List alertEntrys = new List(); - private List actActions = new List(); - private List managements = new List(); + private List alertEntrys = []; + private List actActions = []; + private List managements = []; private bool AutoDiscoverMode = false; private int actMgmtId = 0; private ImportControl[]? LastIncompleteImport { get; set; } private bool RollbackMode = false; - private ImportStatus actStatus = new ImportStatus(); + private ImportStatus actStatus = new(); private bool DetailsMode = false; private bool RemoveSampleDataMode = false; - private Alert actAlert = new Alert(); + private Alert actAlert = new(); private bool workInProgress = false; private bool InitComplete = false; + private int deletedSampleManagements; + private int deletedSampleCredentials; + private int deletedSampleUsers; + private int deletedSampleTenants; + private int deletedSampleGroups; + private int deletedSampleOwners; protected override async Task OnInitializedAsync() { try { - JwtReader jwt = new JwtReader(userConfig.User.Jwt); - jwt.Validate(); - if (jwt.ContainsAllowedRole(Roles.Admin) || jwt.ContainsAllowedRole(Roles.FwAdmin) || jwt.ContainsAllowedRole(Roles.Auditor)) + if(authenticationStateTask!.Result.User.IsInRole(Roles.Admin) || authenticationStateTask!.Result.User.IsInRole(Roles.FwAdmin)) { - if (jwt.ContainsAllowedRole(Roles.Admin) || jwt.ContainsAllowedRole(Roles.FwAdmin)) - { - managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementsDetails); - } - else - { - managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementDetailsWithoutSecrets); - } - await Refresh(); + apiConnection.SetProperRole(authenticationStateTask!.Result.User, [Roles.Admin, Roles.FwAdmin]); + managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementsDetails); + await RefreshAlerts(); + } + else if(authenticationStateTask!.Result.User.IsInRole(Roles.Auditor)) + { + apiConnection.SetProperRole(authenticationStateTask!.Result.User, [Roles.Auditor]); + managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementDetailsWithoutSecrets); + await RefreshAlerts(); } InitComplete = true; } @@ -143,7 +150,7 @@ } } - private async Task Refresh() + private async Task RefreshAlerts() { try { @@ -227,131 +234,16 @@ RemoveSampleDataMode = false; workInProgress = true; - JwtReader jwt = new JwtReader(userConfig.User.Jwt); - jwt.Validate(); - - List managements = new List(); - if (jwt.ContainsAllowedRole(Roles.Admin) || jwt.ContainsAllowedRole(Roles.FwAdmin)) - managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementsDetails); - else - managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementDetailsWithoutSecrets); - - int deletedSampleManagements = 0; - foreach (var management in managements) - { - if (management.Name.EndsWith("_demo")) - { - if (await DeleteManagement(management)) - { - deletedSampleManagements++; - } - } - } - - List credentials = await apiConnection.SendQueryAsync>(DeviceQueries.getCredentials); - int deletedSampleCredentials = 0; - foreach (var credential in credentials) - { - if (credential.Name.EndsWith("_demo")) - { - if (await DeleteCredential(credential)) - { - deletedSampleCredentials++; - } - } - } - - List users = await apiConnection.SendQueryAsync>(AuthQueries.getUsers); - int deletedSampleUsers = 0; - foreach (var user in users) - { - if (user.Name.EndsWith("_demo")) - { - if (await DeleteUser(user)) - { - deletedSampleUsers++; - } - } - } - - List tenants = await apiConnection.SendQueryAsync>(AuthQueries.getTenants); - int deletedSampleTenants = 0; - foreach (var tenant in tenants) - { - if (tenant.Name.EndsWith("_demo")) - { - if (await DeleteTenant(tenant)) - { - deletedSampleTenants++; - } - } - } - - int deletedSampleGroups = 0; - RestResponse> middlewareServerResponse = await middlewareClient.GetInternalGroups(); - if (middlewareServerResponse.StatusCode == HttpStatusCode.OK && middlewareServerResponse.Data != null) - { - foreach (var ldapUserGroup in middlewareServerResponse.Data) - { - string groupName = (new DistName(ldapUserGroup.GroupDn)).Group; - if (groupName.EndsWith("_demo")) - { - if (await DeleteGroup(groupName)) - { - deletedSampleGroups++; - } - } - } - } - - List owners = await apiConnection.SendQueryAsync>(OwnerQueries.getOwners); - int deletedSampleOwners = 0; - foreach (var owner in owners) - { - if (owner.Name.EndsWith("_demo")) - { - if (await DeleteOwner(owner)) - { - deletedSampleOwners++; - } - } - } + await DeleteManagements(); + await DeleteCredentials(); + await DeleteUsers(); + await DeleteTenants(); + await DeleteGroups(); + await DeleteOwners(); await Acknowledge(actAlert); - - string text = ""; - if(deletedSampleManagements > 0) - { - text += $"{deletedSampleManagements} " + userConfig.GetText("managements"); - } - if(deletedSampleCredentials > 0) - { - text += $"{deletedSampleCredentials} " + userConfig.GetText("credentials"); - } - if(deletedSampleUsers > 0) - { - text += $" {deletedSampleUsers} " + userConfig.GetText("users"); - } - if(deletedSampleTenants > 0) - { - text += $" {deletedSampleTenants} " + userConfig.GetText("tenants"); - } - if(deletedSampleGroups > 0) - { - text += $" {deletedSampleGroups} " + userConfig.GetText("groups"); - } - if(deletedSampleOwners > 0) - { - text += $" {deletedSampleOwners} " + userConfig.GetText("owners"); - } - - if(text == "") - { - text += userConfig.GetText("nothing"); - } - text += " " + userConfig.GetText("deleted"); + DisplayMessageInUi(null, userConfig.GetText("remove_sample_data"), ConstructMessage(), false); workInProgress = false; - DisplayMessageInUi(null, userConfig.GetText("remove_sample_data"), text, false); } catch (Exception exception) { @@ -360,6 +252,33 @@ } } + private async Task DeleteManagements() + { + // Todo: refresh necessary? + if(authenticationStateTask!.Result.User.IsInRole(Roles.Admin) || authenticationStateTask!.Result.User.IsInRole(Roles.FwAdmin)) + { + apiConnection.SetProperRole(authenticationStateTask!.Result.User, [Roles.Admin, Roles.FwAdmin]); + managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementsDetails); + } + else if(authenticationStateTask!.Result.User.IsInRole(Roles.Auditor)) + { + apiConnection.SetProperRole(authenticationStateTask!.Result.User, [Roles.Auditor]); + managements = await apiConnection.SendQueryAsync>(DeviceQueries.getManagementDetailsWithoutSecrets); + } + + deletedSampleManagements = 0; + foreach (var management in managements) + { + if (management.Name.EndsWith("_demo")) + { + if (await DeleteManagement(management)) + { + deletedSampleManagements++; + } + } + } + } + private async Task DeleteManagement(Management management) { try @@ -378,6 +297,22 @@ return false; } + private async Task DeleteCredentials() + { + List credentials = await apiConnection.SendQueryAsync>(DeviceQueries.getCredentials); + deletedSampleCredentials = 0; + foreach (var credential in credentials) + { + if (credential.Name.EndsWith("_demo")) + { + if (await DeleteCredential(credential)) + { + deletedSampleCredentials++; + } + } + } + } + private async Task DeleteCredential(ImportCredential credential) { try @@ -396,6 +331,22 @@ return false; } + private async Task DeleteUsers() + { + List users = await apiConnection.SendQueryAsync>(AuthQueries.getUsers); + deletedSampleUsers = 0; + foreach (var user in users) + { + if (user.Name.EndsWith("_demo")) + { + if (await DeleteUser(user)) + { + deletedSampleUsers++; + } + } + } + } + private async Task DeleteUser(UiUser user) { try @@ -422,6 +373,22 @@ return false; } + private async Task DeleteTenants() + { + List tenants = await apiConnection.SendQueryAsync>(AuthQueries.getTenants); + deletedSampleTenants = 0; + foreach (var tenant in tenants) + { + if (tenant.Name.EndsWith("_demo")) + { + if (await DeleteTenant(tenant)) + { + deletedSampleTenants++; + } + } + } + } + private async Task DeleteTenant(Tenant tenant) { try @@ -444,6 +411,26 @@ return false; } + private async Task DeleteGroups() + { + deletedSampleGroups = 0; + RestResponse> middlewareServerResponse = await middlewareClient.GetInternalGroups(); + if (middlewareServerResponse.StatusCode == HttpStatusCode.OK && middlewareServerResponse.Data != null) + { + foreach (var ldapUserGroup in middlewareServerResponse.Data) + { + string groupName = (new DistName(ldapUserGroup.GroupDn)).Group; + if (groupName.EndsWith("_demo")) + { + if (await DeleteGroup(groupName)) + { + deletedSampleGroups++; + } + } + } + } + } + private async Task DeleteGroup(string groupName) { try @@ -466,6 +453,22 @@ return false; } + private async Task DeleteOwners() + { + List owners = await apiConnection.SendQueryAsync>(OwnerQueries.getOwners); + deletedSampleOwners = 0; + foreach (var owner in owners) + { + if (owner.Name.EndsWith("_demo")) + { + if (await DeleteOwner(owner)) + { + deletedSampleOwners++; + } + } + } + } + private async Task DeleteOwner(FwoOwner owner) { try @@ -484,6 +487,42 @@ return false; } + private string ConstructMessage() + { + string text = ""; + if(deletedSampleManagements > 0) + { + text += $"{deletedSampleManagements} " + userConfig.GetText("managements"); + } + if(deletedSampleCredentials > 0) + { + text += $"{deletedSampleCredentials} " + userConfig.GetText("credentials"); + } + if(deletedSampleUsers > 0) + { + text += $" {deletedSampleUsers} " + userConfig.GetText("users"); + } + if(deletedSampleTenants > 0) + { + text += $" {deletedSampleTenants} " + userConfig.GetText("tenants"); + } + if(deletedSampleGroups > 0) + { + text += $" {deletedSampleGroups} " + userConfig.GetText("groups"); + } + if(deletedSampleOwners > 0) + { + text += $" {deletedSampleOwners} " + userConfig.GetText("owners"); + } + + if(text == "") + { + text += userConfig.GetText("nothing"); + } + text += " " + userConfig.GetText("deleted"); + return text; + } + private void Cancel() { RemoveSampleDataMode = false; diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor index f154c9502..799391ee2 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor @@ -553,7 +553,7 @@ { apiConnection.SetProperRole(authenticationStateTask!.Result.User, [ Roles.Implementer, Roles.Requester, Roles.Admin, Roles.Auditor ]); TicketCreator ticketCreator = new (apiConnection, userConfig, authenticationStateTask!.Result.User, middlewareClient, WorkflowPhases.implementation); - if(await ticketCreator.PromoteTicket(ConnHandler.Application, (long)(ConnHandler.ActConn.TicketId), ExtStates.Done)) + if(await ticketCreator.PromoteNewInterfaceImplTask(ConnHandler.Application, (long)(ConnHandler.ActConn.TicketId), ExtStates.Done)) { DisplayMessageInUi(null, userConfig.GetText("publish"), userConfig.GetText("U9013"), false); } diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/RejectInterfacePopup.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/RejectInterfacePopup.razor index ca38ed59c..a5f72fb27 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/RejectInterfacePopup.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/RejectInterfacePopup.razor @@ -101,7 +101,7 @@ { apiConnection.SetProperRole(authenticationStateTask!.Result.User, [Roles.Implementer, Roles.Planner, Roles.Approver, Roles.Requester, Roles.Admin, Roles.Auditor]); TicketCreator ticketCreator = new (apiConnection, userConfig, authenticationStateTask!.Result.User, middlewareClient, WorkflowPhases.implementation); - if(await ticketCreator.PromoteTicket(ConnHandler.ActConn.App, (long)ConnHandler.ActConn.TicketId, ExtStates.Rejected, Reason)) + if(await ticketCreator.PromoteNewInterfaceImplTask(ConnHandler.ActConn.App, (long)ConnHandler.ActConn.TicketId, ExtStates.Rejected, Reason)) { DisplayMessageInUi(null, userConfig.GetText("reject_interface"), userConfig.GetText("U9018"), false); } diff --git a/roles/ui/files/FWO.UI/Services/ModellingConnectionHandler.cs b/roles/ui/files/FWO.UI/Services/ModellingConnectionHandler.cs index bb1463a41..546b26774 100644 --- a/roles/ui/files/FWO.UI/Services/ModellingConnectionHandler.cs +++ b/roles/ui/files/FWO.UI/Services/ModellingConnectionHandler.cs @@ -396,7 +396,7 @@ private async Task UpdateTicket(Task authenticationStateTas string comment = $"{userConfig.GetText("U9016")}: {IntConnHandler?.ActConn.Name}"; apiConnection.SetProperRole(authenticationStateTask!.Result.User, [Roles.Implementer, Roles.Requester, Roles.Admin, Roles.Auditor]); TicketCreator ticketCreator = new (apiConnection, userConfig, authenticationStateTask!.Result.User, middlewareClient, WorkflowPhases.implementation); - if(await ticketCreator.PromoteTicket(Application, (long)ActConn.TicketId, ExtStates.Done, comment)) + if(await ticketCreator.PromoteNewInterfaceImplTask(Application, (long)ActConn.TicketId, ExtStates.Done, comment)) { DisplayMessageInUi(null, comment, userConfig.GetText("U9013"), false); } diff --git a/roles/ui/files/FWO.UI/Services/TicketCreator.cs b/roles/ui/files/FWO.UI/Services/TicketCreator.cs index 92b3224d7..badebb120 100644 --- a/roles/ui/files/FWO.UI/Services/TicketCreator.cs +++ b/roles/ui/files/FWO.UI/Services/TicketCreator.cs @@ -75,7 +75,7 @@ public async Task SetInterfaceId(long ticketId, long connId, FwoOwner owner) } } - public async Task PromoteTicket(FwoOwner owner, long ticketId, ExtStates extState, string comment = "") + public async Task PromoteNewInterfaceImplTask(FwoOwner owner, long ticketId, ExtStates extState, string comment = "") { ExtStateHandler extStateHandler = new(apiConnection); await extStateHandler.Init(); From 44952a831f0cc08f340f11d7352e886255a1811d Mon Sep 17 00:00:00 2001 From: abarz722 Date: Tue, 27 Aug 2024 13:48:06 +0200 Subject: [PATCH 02/21] rename Request -> Wf --- .../FWO.Api.Client/Data/NwObjectElement.cs | 12 +- .../FWO.Api.Client/Data/NwRuleElement.cs | 8 +- .../FWO.Api.Client/Data/NwServiceElement.cs | 8 +- .../Data/RequestApprovalWriter.cs | 12 - .../Data/RequestReqTaskWriter.cs | 51 ---- .../{RequestApproval.cs => WfApproval.cs} | 8 +- ...questApprovalBase.cs => WfApprovalBase.cs} | 6 +- .../FWO.Api.Client/Data/WfApprovalWriter.cs | 12 + .../Data/{RequestComment.cs => WfComment.cs} | 14 +- ...RequestCommentBase.cs => WfCommentBase.cs} | 6 +- ...RequestElementBase.cs => WfElementBase.cs} | 6 +- .../{RequestExtState.cs => WfExtState.cs} | 2 +- ...RequestImplElement.cs => WfImplElement.cs} | 8 +- .../{RequestImplTask.cs => WfImplTask.cs} | 22 +- ...RequestOwnerWriter.cs => WfOwnerWriter.cs} | 6 +- .../{RequestPriority.cs => WfPriority.cs} | 2 +- .../{RequestReqElement.cs => WfReqElement.cs} | 6 +- ...ElementWriter.cs => WfReqElementWriter.cs} | 6 +- .../Data/{RequestReqTask.cs => WfReqTask.cs} | 16 +- ...RequestReqTaskBase.cs => WfReqTaskBase.cs} | 6 +- .../FWO.Api.Client/Data/WfReqTaskWriter.cs | 51 ++++ ...RequestStateAction.cs => WfStateAction.cs} | 10 +- ...tStatefulObject.cs => WfStatefulObject.cs} | 8 +- .../Data/{RequestStates.cs => WfStates.cs} | 12 +- .../{RequestTaskBase.cs => WfTaskBase.cs} | 6 +- .../Data/{RequestTicket.cs => WfTicket.cs} | 22 +- .../{RequestTicketBase.cs => WfTicketBase.cs} | 6 +- ...questTicketWriter.cs => WfTicketWriter.cs} | 8 +- .../FWO.Tufin.SecureChange/ExternalTicket.cs | 2 +- .../ExternalTicketTask.cs | 2 +- .../Pages/NetworkModelling/EditConn.razor | 24 +- .../FWO.UI/Pages/Request/AssignObject.razor | 4 +- .../Pages/Request/DisplayApprovals.razor | 42 +-- .../Pages/Request/DisplayImplTaskTable.razor | 140 +++++----- .../Request/DisplayImplementationTask.razor | 190 +++++++------- .../Pages/Request/DisplayPathAnalysis.razor | 2 +- .../Pages/Request/DisplayReqTaskTable.razor | 84 +++--- .../Pages/Request/DisplayRequestTask.razor | 242 +++++++++--------- .../FWO.UI/Pages/Request/DisplayTicket.razor | 94 +++---- .../Pages/Request/DisplayTicketTable.razor | 50 ++-- .../Pages/Request/ImplOptSelection.razor | 4 +- .../FWO.UI/Pages/Request/PromoteObject.razor | 6 +- .../Pages/Request/RequestApprovals.razor | 20 +- .../Request/RequestImplementations.razor | 34 +-- .../Pages/Request/RequestPlannings.razor | 20 +- .../FWO.UI/Pages/Request/RequestReviews.razor | 32 +-- .../FWO.UI/Pages/Request/RequestTickets.razor | 14 +- .../Request/RequestTicketsOverview.razor | 16 +- .../FWO.UI/Pages/Settings/EditExtStates.razor | 26 +- .../Pages/Settings/SettingsActions.razor | 58 ++--- .../Pages/Settings/SettingsCustomizing.razor | 14 +- .../Settings/SettingsRecertificationGen.razor | 16 +- .../Pages/Settings/SettingsStateMatrix.razor | 8 +- .../Pages/Settings/SettingsStates.razor | 46 ++-- .../ui/files/FWO.UI/Services/ActionHandler.cs | 72 +++--- roles/ui/files/FWO.UI/Services/DefaultInit.cs | 6 +- roles/ui/files/FWO.UI/Services/EmailHelper.cs | 6 +- .../files/FWO.UI/Services/ExtStateHandler.cs | 4 +- .../ui/files/FWO.UI/Services/PathAnalysis.cs | 6 +- .../ui/files/FWO.UI/Services/TicketCreator.cs | 72 +++--- .../{RequestDbAccess.cs => WfDbAccess.cs} | 88 +++---- .../{RequestHandler.cs => WfHandler.cs} | 162 ++++++------ 62 files changed, 973 insertions(+), 973 deletions(-) delete mode 100644 roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs delete mode 100644 roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs rename roles/lib/files/FWO.Api.Client/Data/{RequestApproval.cs => WfApproval.cs} (84%) rename roles/lib/files/FWO.Api.Client/Data/{RequestApprovalBase.cs => WfApprovalBase.cs} (90%) create mode 100644 roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs rename roles/lib/files/FWO.Api.Client/Data/{RequestComment.cs => WfComment.cs} (52%) rename roles/lib/files/FWO.Api.Client/Data/{RequestCommentBase.cs => WfCommentBase.cs} (90%) rename roles/lib/files/FWO.Api.Client/Data/{RequestElementBase.cs => WfElementBase.cs} (93%) rename roles/lib/files/FWO.Api.Client/Data/{RequestExtState.cs => WfExtState.cs} (93%) rename roles/lib/files/FWO.Api.Client/Data/{RequestImplElement.cs => WfImplElement.cs} (84%) rename roles/lib/files/FWO.Api.Client/Data/{RequestImplTask.cs => WfImplTask.cs} (86%) rename roles/lib/files/FWO.Api.Client/Data/{RequestOwnerWriter.cs => WfOwnerWriter.cs} (69%) rename roles/lib/files/FWO.Api.Client/Data/{RequestPriority.cs => WfPriority.cs} (94%) rename roles/lib/files/FWO.Api.Client/Data/{RequestReqElement.cs => WfReqElement.cs} (84%) rename roles/lib/files/FWO.Api.Client/Data/{RequestReqElementWriter.cs => WfReqElementWriter.cs} (76%) rename roles/lib/files/FWO.Api.Client/Data/{RequestReqTask.cs => WfReqTask.cs} (89%) rename roles/lib/files/FWO.Api.Client/Data/{RequestReqTaskBase.cs => WfReqTaskBase.cs} (93%) create mode 100644 roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs rename roles/lib/files/FWO.Api.Client/Data/{RequestStateAction.cs => WfStateAction.cs} (89%) rename roles/lib/files/FWO.Api.Client/Data/{RequestStatefulObject.cs => WfStatefulObject.cs} (93%) rename roles/lib/files/FWO.Api.Client/Data/{RequestStates.cs => WfStates.cs} (74%) rename roles/lib/files/FWO.Api.Client/Data/{RequestTaskBase.cs => WfTaskBase.cs} (94%) rename roles/lib/files/FWO.Api.Client/Data/{RequestTicket.cs => WfTicket.cs} (71%) rename roles/lib/files/FWO.Api.Client/Data/{RequestTicketBase.cs => WfTicketBase.cs} (94%) rename roles/lib/files/FWO.Api.Client/Data/{RequestTicketWriter.cs => WfTicketWriter.cs} (53%) rename roles/ui/files/FWO.UI/Services/{RequestDbAccess.cs => WfDbAccess.cs} (91%) rename roles/ui/files/FWO.UI/Services/{RequestHandler.cs => WfHandler.cs} (89%) diff --git a/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs b/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs index 167297c45..acf9521de 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs @@ -16,7 +16,7 @@ public string IpString get { return Cidr.CidrString; } set { Cidr = new Cidr(value); } } - public Cidr Cidr { get; set; } = new Cidr(); + public Cidr Cidr { get; set; } = new(); [JsonProperty("ip_end"), JsonPropertyName("ip_end")] public string IpEndString @@ -24,7 +24,7 @@ public string IpEndString get { return CidrEnd.CidrString; } // ?? Cidr.CidrString; } set { CidrEnd = new Cidr(value ?? Cidr.CidrString); } // if End value is not set, asume host and set start ip as end ip } - public Cidr CidrEnd { get; set; } = new Cidr(); + public Cidr CidrEnd { get; set; } = new(); [JsonProperty("name"), JsonPropertyName("name")] public string? Name { get; set; } @@ -55,9 +55,9 @@ public NwObjectElement(IPAddressRange ipAddressRange, long taskId) TaskId = taskId; } - public RequestReqElement ToReqElement(ElemFieldType field) + public WfReqElement ToReqElement(ElemFieldType field) { - RequestReqElement element = new RequestReqElement() + WfReqElement element = new() { Id = ElemId, TaskId = TaskId, @@ -68,9 +68,9 @@ public RequestReqElement ToReqElement(ElemFieldType field) return element; } - public RequestImplElement ToImplElement(ElemFieldType field) + public WfImplElement ToImplElement(ElemFieldType field) { - RequestImplElement element = new RequestImplElement() + WfImplElement element = new() { Id = ElemId, ImplTaskId = TaskId, diff --git a/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs b/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs index 6c5a9641d..b5c8d375b 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs @@ -7,9 +7,9 @@ public class NwRuleElement public string RuleUid { get; set; } = ""; - public RequestReqElement ToReqElement() + public WfReqElement ToReqElement() { - RequestReqElement element = new RequestReqElement() + WfReqElement element = new() { Id = ElemId, TaskId = TaskId, @@ -19,9 +19,9 @@ public RequestReqElement ToReqElement() return element; } - public RequestImplElement ToImplElement() + public WfImplElement ToImplElement() { - RequestImplElement element = new RequestImplElement() + WfImplElement element = new() { Id = ElemId, ImplTaskId = TaskId, diff --git a/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs b/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs index 363b19d9b..3dfebd877 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs @@ -9,9 +9,9 @@ public class NwServiceElement public long? ServiceId { get; set; } - public RequestReqElement ToReqElement() + public WfReqElement ToReqElement() { - RequestReqElement element = new () + WfReqElement element = new () { Id = ElemId, TaskId = TaskId, @@ -23,9 +23,9 @@ public RequestReqElement ToReqElement() return element; } - public RequestImplElement ToImplElement() + public WfImplElement ToImplElement() { - RequestImplElement element = new () + WfImplElement element = new () { Id = ElemId, ImplTaskId = TaskId, diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs b/roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs deleted file mode 100644 index bb629235c..000000000 --- a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace FWO.Api.Data -{ - public class RequestApprovalWriter : RequestApprovalBase - { - public RequestApprovalWriter() - { } - - public RequestApprovalWriter(RequestApproval approval) : base(approval) - { - } - } -} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs b/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs deleted file mode 100644 index 8a51341bf..000000000 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; - -namespace FWO.Api.Data -{ - public class RequestReqTaskWriter : RequestReqTaskBase - { - [JsonProperty("elements"), JsonPropertyName("elements")] - public RequestElementDataHelper Elements { get; set; } = new (); - - [JsonProperty("approvals"), JsonPropertyName("approvals")] - public RequestApprovalDataHelper Approvals { get; set; } = new (); - - [JsonProperty("reqtask_owners"), JsonPropertyName("reqtask_owners")] - public RequestOwnerDataHelper Owners { get; set; } = new (); - - public RequestReqTaskWriter(RequestReqTask reqtask) : base(reqtask) - { - foreach(var element in reqtask.Elements) - { - Elements.RequestElementList.Add(new RequestReqElementWriter(element)); - } - foreach(var approval in reqtask.Approvals) - { - Approvals.RequestApprovalList.Add(new RequestApprovalWriter(approval)); - } - foreach(var owner in reqtask.Owners) - { - Owners.RequestOwnerList.Add(new RequestOwnerWriter(owner.Owner)); - } - } - } - - public class RequestElementDataHelper - { - [JsonProperty("data"), JsonPropertyName("data")] - public List RequestElementList { get; set; } = new (); - } - - public class RequestApprovalDataHelper - { - [JsonProperty("data"), JsonPropertyName("data")] - public List RequestApprovalList { get; set; } = new (); - } - - public class RequestOwnerDataHelper - { - [JsonProperty("data"), JsonPropertyName("data")] - public List RequestOwnerList { get; set; } = new (); - } -} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestApproval.cs b/roles/lib/files/FWO.Api.Client/Data/WfApproval.cs similarity index 84% rename from roles/lib/files/FWO.Api.Client/Data/RequestApproval.cs rename to roles/lib/files/FWO.Api.Client/Data/WfApproval.cs index 644d79392..ee00913cb 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestApproval.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfApproval.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestApproval : RequestApprovalBase + public class WfApproval : WfApprovalBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -12,13 +12,13 @@ public class RequestApproval : RequestApprovalBase public long TaskId { get; set; } [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public RequestApproval() + public WfApproval() { } - public RequestApproval(RequestApproval approval) : base(approval) + public WfApproval(WfApproval approval) : base(approval) { Id = approval.Id; TaskId = approval.TaskId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfApprovalBase.cs similarity index 90% rename from roles/lib/files/FWO.Api.Client/Data/RequestApprovalBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfApprovalBase.cs index b99a19490..fd424ab6a 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfApprovalBase.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestApprovalBase : RequestStatefulObject + public class WfApprovalBase : WfStatefulObject { [JsonProperty("date_opened"), JsonPropertyName("date_opened")] public DateTime DateOpened { get; set; } = DateTime.Now; @@ -30,10 +30,10 @@ public class RequestApprovalBase : RequestStatefulObject public bool InitialApproval { get; set; } = true; - public RequestApprovalBase() + public WfApprovalBase() { } - public RequestApprovalBase(RequestApprovalBase approval) : base(approval) + public WfApprovalBase(WfApprovalBase approval) : base(approval) { DateOpened = approval.DateOpened; ApprovalDate = approval.ApprovalDate; diff --git a/roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs new file mode 100644 index 000000000..8d997e36f --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs @@ -0,0 +1,12 @@ +namespace FWO.Api.Data +{ + public class WfApprovalWriter : WfApprovalBase + { + public WfApprovalWriter() + { } + + public WfApprovalWriter(WfApproval approval) : base(approval) + { + } + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestComment.cs b/roles/lib/files/FWO.Api.Client/Data/WfComment.cs similarity index 52% rename from roles/lib/files/FWO.Api.Client/Data/RequestComment.cs rename to roles/lib/files/FWO.Api.Client/Data/WfComment.cs index 4d3a7d5f7..e9104a2ca 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestComment.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfComment.cs @@ -3,31 +3,31 @@ namespace FWO.Api.Data { - public class RequestComment : RequestCommentBase + public class WfComment : WfCommentBase { [JsonProperty("id"), JsonPropertyName("id")] public int Id { get; set; } - public RequestComment() + public WfComment() { } - public RequestComment(RequestComment comment) : base(comment) + public WfComment(WfComment comment) : base(comment) { Id = comment.Id; } } - public class RequestCommentDataHelper + public class WfCommentDataHelper { [JsonProperty("comment"), JsonPropertyName("comment")] - public RequestComment Comment { get; set; } = new (); + public WfComment Comment { get; set; } = new (); - public RequestCommentDataHelper() + public WfCommentDataHelper() {} - public RequestCommentDataHelper(RequestComment comment) + public WfCommentDataHelper(WfComment comment) { Comment = comment; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestCommentBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfCommentBase.cs similarity index 90% rename from roles/lib/files/FWO.Api.Client/Data/RequestCommentBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfCommentBase.cs index 1a5014ee2..8134ff1f6 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestCommentBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfCommentBase.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestCommentBase + public class WfCommentBase { [JsonProperty("ref_id"), JsonPropertyName("ref_id")] public long? RefId { get; set; } @@ -21,10 +21,10 @@ public class RequestCommentBase public string CommentText { get; set; } = ""; - public RequestCommentBase() + public WfCommentBase() { } - public RequestCommentBase(RequestCommentBase comment) + public WfCommentBase(WfCommentBase comment) { RefId = comment.RefId; Scope = comment.Scope; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestElementBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfElementBase.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestElementBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfElementBase.cs index 26f23757e..eb1cc7733 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestElementBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfElementBase.cs @@ -11,7 +11,7 @@ public enum ElemFieldType rule } - public class RequestElementBase + public class WfElementBase { [JsonProperty("ip"), JsonPropertyName("ip")] public string? IpString { get; set; } @@ -41,10 +41,10 @@ public class RequestElementBase public string? RuleUid { get; set; } - public RequestElementBase() + public WfElementBase() { } - public RequestElementBase(RequestElementBase element) + public WfElementBase(WfElementBase element) { IpString = element.IpString; Port = element.Port; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestExtState.cs b/roles/lib/files/FWO.Api.Client/Data/WfExtState.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestExtState.cs rename to roles/lib/files/FWO.Api.Client/Data/WfExtState.cs index 1b7fd785a..49138d5f3 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestExtState.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfExtState.cs @@ -11,7 +11,7 @@ public enum ExtStates Rejected } - public class RequestExtState + public class WfExtState { [JsonProperty("id"), JsonPropertyName("id")] public int? Id { get; set; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestImplElement.cs b/roles/lib/files/FWO.Api.Client/Data/WfImplElement.cs similarity index 84% rename from roles/lib/files/FWO.Api.Client/Data/RequestImplElement.cs rename to roles/lib/files/FWO.Api.Client/Data/WfImplElement.cs index 1c8061100..00f50f1f5 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestImplElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfImplElement.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestImplElement : RequestElementBase + public class WfImplElement : WfElementBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -16,10 +16,10 @@ public class RequestImplElement : RequestElementBase public Cidr Cidr { get; set; } = new Cidr(); - public RequestImplElement() + public WfImplElement() {} - public RequestImplElement(RequestImplElement element) : base(element) + public WfImplElement(WfImplElement element) : base(element) { Id = element.Id; ImplTaskId = element.ImplTaskId; @@ -27,7 +27,7 @@ public RequestImplElement(RequestImplElement element) : base(element) Cidr = new Cidr(element.Cidr != null ? element.Cidr.CidrString : ""); } - public RequestImplElement(RequestReqElement element) + public WfImplElement(WfReqElement element) { Id = 0; ImplAction = element.RequestAction; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestImplTask.cs b/roles/lib/files/FWO.Api.Client/Data/WfImplTask.cs similarity index 86% rename from roles/lib/files/FWO.Api.Client/Data/RequestImplTask.cs rename to roles/lib/files/FWO.Api.Client/Data/WfImplTask.cs index 7a41c5696..3b68cc47c 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestImplTask.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfImplTask.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestImplTask: RequestTaskBase + public class WfImplTask: WfTaskBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -18,20 +18,20 @@ public class RequestImplTask: RequestTaskBase public string ImplAction { get; set; } = RequestAction.create.ToString(); [JsonProperty("elements"), JsonPropertyName("elements")] - public List ImplElements { get; set; } = new (); + public List ImplElements { get; set; } = new (); [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public List RemovedElements { get; set; } = new (); + public List RemovedElements { get; set; } = new (); public long TicketId { get; set; } - public RequestImplTask() + public WfImplTask() {} - public RequestImplTask(RequestImplTask implTask): base(implTask) + public WfImplTask(WfImplTask implTask): base(implTask) { Id = implTask.Id; ReqTaskId = implTask.ReqTaskId; @@ -43,7 +43,7 @@ public RequestImplTask(RequestImplTask implTask): base(implTask) } - public RequestImplTask(RequestReqTask reqtask, bool copyComments = true) + public WfImplTask(WfReqTask reqtask, bool copyComments = true) { Id = 0; Title = reqtask.Title; @@ -73,17 +73,17 @@ public RequestImplTask(RequestReqTask reqtask, bool copyComments = true) { DeviceId = reqtask.Elements[0].DeviceId; } - ImplElements = new List(); - foreach(RequestReqElement element in reqtask.Elements) + ImplElements = new List(); + foreach(WfReqElement element in reqtask.Elements) { - ImplElements.Add(new RequestImplElement(element)); + ImplElements.Add(new WfImplElement(element)); } } if(copyComments) { foreach(var comm in reqtask.Comments) { - comm.Comment.Scope = RequestObjectScopes.ImplementationTask.ToString(); + comm.Comment.Scope = WfObjectScopes.ImplementationTask.ToString(); Comments.Add(comm); } } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestOwnerWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfOwnerWriter.cs similarity index 69% rename from roles/lib/files/FWO.Api.Client/Data/RequestOwnerWriter.cs rename to roles/lib/files/FWO.Api.Client/Data/WfOwnerWriter.cs index 4bd0ed3a7..f55435965 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestOwnerWriter.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfOwnerWriter.cs @@ -3,15 +3,15 @@ namespace FWO.Api.Data { - public class RequestOwnerWriter + public class WfOwnerWriter { [JsonProperty("owner_id"), JsonPropertyName("owner_id")] public int? OwnerId { get; set; } - public RequestOwnerWriter() + public WfOwnerWriter() {} - public RequestOwnerWriter(FwoOwner owner) + public WfOwnerWriter(FwoOwner owner) { OwnerId = owner.Id; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestPriority.cs b/roles/lib/files/FWO.Api.Client/Data/WfPriority.cs similarity index 94% rename from roles/lib/files/FWO.Api.Client/Data/RequestPriority.cs rename to roles/lib/files/FWO.Api.Client/Data/WfPriority.cs index cbaff92ba..4c73732fd 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestPriority.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfPriority.cs @@ -4,7 +4,7 @@ namespace FWO.Api.Data { - public class RequestPriority + public class WfPriority { [JsonProperty("numeric_prio"), JsonPropertyName("numeric_prio")] public int NumPrio { get; set; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqElement.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqElement.cs similarity index 84% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqElement.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqElement.cs index 3f43cb334..083de3023 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqElement.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestReqElement : RequestElementBase + public class WfReqElement : WfElementBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -19,10 +19,10 @@ public class RequestReqElement : RequestElementBase public Cidr Cidr { get; set; } = new Cidr(); - public RequestReqElement() + public WfReqElement() {} - public RequestReqElement(RequestReqElement element) : base (element) + public WfReqElement(WfReqElement element) : base (element) { Id = element.Id; TaskId = element.TaskId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqElementWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqElementWriter.cs similarity index 76% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqElementWriter.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqElementWriter.cs index fc378b75d..045c103da 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqElementWriter.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqElementWriter.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestReqElementWriter : RequestElementBase + public class WfReqElementWriter : WfElementBase { [JsonProperty("request_action"), JsonPropertyName("request_action")] public string RequestAction { get; set; } = Data.RequestAction.create.ToString(); @@ -11,10 +11,10 @@ public class RequestReqElementWriter : RequestElementBase [JsonProperty("device_id"), JsonPropertyName("device_id")] public int? DeviceId { get; set; } - public RequestReqElementWriter() + public WfReqElementWriter() {} - public RequestReqElementWriter(RequestReqElement element) : base(element) + public WfReqElementWriter(WfReqElement element) : base(element) { RequestAction = element.RequestAction; DeviceId = element.DeviceId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqTask.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqTask.cs similarity index 89% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqTask.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqTask.cs index 0c85fad9b..e98ad3016 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqTask.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqTask.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestReqTask : RequestReqTaskBase + public class WfReqTask : WfReqTaskBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -12,28 +12,28 @@ public class RequestReqTask : RequestReqTaskBase public long TicketId { get; set; } [JsonProperty("elements"), JsonPropertyName("elements")] - public List Elements { get; set; } = new (); + public List Elements { get; set; } = new (); [JsonProperty("implementation_tasks"), JsonPropertyName("implementation_tasks")] - public List ImplementationTasks { get; set; } = new (); + public List ImplementationTasks { get; set; } = new (); [JsonProperty("request_approvals"), JsonPropertyName("request_approvals")] - public List Approvals { get; set; } = new (); + public List Approvals { get; set; } = new (); [JsonProperty("owners"), JsonPropertyName("owners")] public List Owners { get; set; } = new (); [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public List RemovedElements { get; set; } = new (); + public List RemovedElements { get; set; } = new (); public List NewOwners { get; set; } = new (); public List RemovedOwners { get; set; } = new (); - public RequestReqTask() + public WfReqTask() { } - public RequestReqTask(RequestReqTask reqtask) : base(reqtask) + public WfReqTask(WfReqTask reqtask) : base(reqtask) { Id = reqtask.Id; TicketId = reqtask.TicketId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskBase.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqTaskBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqTaskBase.cs index 34307fba4..ee3ce83cb 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskBase.cs @@ -18,7 +18,7 @@ public struct AdditionalInfoKeys public const string ReqOwner = "ReqOwner"; } - public class RequestReqTaskBase : RequestTaskBase + public class WfReqTaskBase : WfTaskBase { [JsonProperty("request_action"), JsonPropertyName("request_action")] public string RequestAction { get; set; } = Data.RequestAction.create.ToString(); @@ -48,10 +48,10 @@ public string SelectedDevices private List deviceList { get; set; } = new (); - public RequestReqTaskBase() + public WfReqTaskBase() { } - public RequestReqTaskBase(RequestReqTaskBase reqtask) : base(reqtask) + public WfReqTaskBase(WfReqTaskBase reqtask) : base(reqtask) { RequestAction = reqtask.RequestAction; Reason = reqtask.Reason; diff --git a/roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs new file mode 100644 index 000000000..86b7e19da --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs @@ -0,0 +1,51 @@ +using System.Text.Json.Serialization; +using Newtonsoft.Json; + +namespace FWO.Api.Data +{ + public class WfReqTaskWriter : WfReqTaskBase + { + [JsonProperty("elements"), JsonPropertyName("elements")] + public WfElementDataHelper Elements { get; set; } = new (); + + [JsonProperty("approvals"), JsonPropertyName("approvals")] + public WfApprovalDataHelper Approvals { get; set; } = new (); + + [JsonProperty("reqtask_owners"), JsonPropertyName("reqtask_owners")] + public WfOwnerDataHelper Owners { get; set; } = new (); + + public WfReqTaskWriter(WfReqTask reqtask) : base(reqtask) + { + foreach(var element in reqtask.Elements) + { + Elements.WfElementList.Add(new WfReqElementWriter(element)); + } + foreach(var approval in reqtask.Approvals) + { + Approvals.WfApprovalList.Add(new WfApprovalWriter(approval)); + } + foreach(var owner in reqtask.Owners) + { + Owners.WfOwnerList.Add(new WfOwnerWriter(owner.Owner)); + } + } + } + + public class WfElementDataHelper + { + [JsonProperty("data"), JsonPropertyName("data")] + public List WfElementList { get; set; } = new (); + } + + public class WfApprovalDataHelper + { + [JsonProperty("data"), JsonPropertyName("data")] + public List WfApprovalList { get; set; } = new (); + } + + public class WfOwnerDataHelper + { + [JsonProperty("data"), JsonPropertyName("data")] + public List WfOwnerList { get; set; } = new (); + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestStateAction.cs b/roles/lib/files/FWO.Api.Client/Data/WfStateAction.cs similarity index 89% rename from roles/lib/files/FWO.Api.Client/Data/RequestStateAction.cs rename to roles/lib/files/FWO.Api.Client/Data/WfStateAction.cs index 24430d3e2..db6159981 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestStateAction.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfStateAction.cs @@ -31,7 +31,7 @@ public enum StateActionEvents OnAssignment = 15 } - public class RequestStateAction + public class WfStateAction { [JsonProperty("id"), JsonPropertyName("id")] public int Id { get; set; } @@ -43,7 +43,7 @@ public class RequestStateAction public string ActionType { get; set; } = StateActionTypes.DoNothing.ToString(); [JsonProperty("scope"), JsonPropertyName("scope")] - public string Scope { get; set; } = RequestObjectScopes.None.ToString(); + public string Scope { get; set; } = WfObjectScopes.None.ToString(); [JsonProperty("task_type"), JsonPropertyName("task_type")] public string TaskType { get; set; } = ""; @@ -61,7 +61,7 @@ public class RequestStateAction public string ExternalParams { get; set; } = ""; - public RequestStateAction() + public WfStateAction() { } public static bool IsReadonlyType(string actionTypeString) @@ -79,9 +79,9 @@ public static bool IsReadonlyType(string actionTypeString) } } - public class RequestStateActionDataHelper + public class WfStateActionDataHelper { [JsonProperty("action"), JsonPropertyName("action")] - public RequestStateAction Action { get; set; } = new RequestStateAction(); + public WfStateAction Action { get; set; } = new WfStateAction(); } } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestStatefulObject.cs b/roles/lib/files/FWO.Api.Client/Data/WfStatefulObject.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestStatefulObject.cs rename to roles/lib/files/FWO.Api.Client/Data/WfStatefulObject.cs index 42a7511a1..621d917db 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestStatefulObject.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfStatefulObject.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public enum RequestObjectScopes + public enum WfObjectScopes { None = 0, Ticket = 1, @@ -12,7 +12,7 @@ public enum RequestObjectScopes Approval = 4 } - public class RequestStatefulObject + public class WfStatefulObject { [JsonProperty("state_id"), JsonPropertyName("state_id")] public int StateId @@ -71,10 +71,10 @@ public void ResetStateChanged() stateChanged = false; } - public RequestStatefulObject() + public WfStatefulObject() { } - public RequestStatefulObject(RequestStatefulObject obj) + public WfStatefulObject(WfStatefulObject obj) { stateId = obj.stateId; oldStateId = obj.oldStateId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestStates.cs b/roles/lib/files/FWO.Api.Client/Data/WfStates.cs similarity index 74% rename from roles/lib/files/FWO.Api.Client/Data/RequestStates.cs rename to roles/lib/files/FWO.Api.Client/Data/WfStates.cs index e25812995..0e0a62aa3 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestStates.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfStates.cs @@ -5,7 +5,7 @@ namespace FWO.Api.Data { - public class RequestState + public class WfState { [JsonProperty("id"), JsonPropertyName("id")] public int Id { get; set; } @@ -14,12 +14,12 @@ public class RequestState public string Name { get; set; } = ""; [JsonProperty("actions"), JsonPropertyName("actions")] - public List Actions { get; set; } = new (); + public List Actions { get; set; } = new (); - public RequestState(){} + public WfState(){} - public RequestState(RequestState state) + public WfState(WfState state) { Id = state.Id; Name = state.Name; @@ -37,13 +37,13 @@ public string ActionList() } } - public class RequestStateDict + public class WfStateDict { public Dictionary Name = new (); public async Task Init(ApiConnection apiConnection) { - List states = await apiConnection.SendQueryAsync>(Client.Queries.RequestQueries.getStates); + List states = await apiConnection.SendQueryAsync>(Client.Queries.RequestQueries.getStates); Name = new (); foreach(var state in states) { diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTaskBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfTaskBase.cs similarity index 94% rename from roles/lib/files/FWO.Api.Client/Data/RequestTaskBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTaskBase.cs index c0607e3ca..631d816e3 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTaskBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTaskBase.cs @@ -23,7 +23,7 @@ public enum RequestAction modify } - public class RequestTaskBase : RequestStatefulObject + public class WfTaskBase : WfStatefulObject { [JsonProperty("title"), JsonPropertyName("title")] public string Title { get; set; } = ""; @@ -65,10 +65,10 @@ public class RequestTaskBase : RequestStatefulObject public DateTime? TargetEndDate { get; set; } - public RequestTaskBase() + public WfTaskBase() { } - public RequestTaskBase(RequestTaskBase reqtask) : base(reqtask) + public WfTaskBase(WfTaskBase reqtask) : base(reqtask) { Title = reqtask.Title; TaskNumber = reqtask.TaskNumber; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTicket.cs b/roles/lib/files/FWO.Api.Client/Data/WfTicket.cs similarity index 71% rename from roles/lib/files/FWO.Api.Client/Data/RequestTicket.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTicket.cs index 16e6aff9e..c7d6af549 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTicket.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTicket.cs @@ -3,19 +3,19 @@ namespace FWO.Api.Data { - public class RequestTicket : RequestTicketBase + public class WfTicket : WfTicketBase { [JsonProperty("reqtasks"), JsonPropertyName("reqtasks")] - public List Tasks { get; set; } = new (); + public List Tasks { get; set; } = new (); [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public RequestTicket() + public WfTicket() {} - public RequestTicket(RequestTicket ticket) : base(ticket) + public WfTicket(WfTicket ticket) : base(ticket) { Tasks = ticket.Tasks; Comments = ticket.Comments; @@ -46,9 +46,9 @@ public int NumberImplTasks() public void UpdateCidrStringsInTaskElements() { - foreach (RequestReqTask reqtask in Tasks) + foreach (WfReqTask reqtask in Tasks) { - foreach(RequestReqElement elem in reqtask.Elements) + foreach(WfReqElement elem in reqtask.Elements) { elem.IpString = elem.Cidr != null && elem.Cidr.Valid ? elem.Cidr.CidrString : null ; } @@ -57,18 +57,18 @@ public void UpdateCidrStringsInTaskElements() public void UpdateCidrsInTaskElements() { - foreach (RequestReqTask reqtask in Tasks) + foreach (WfReqTask reqtask in Tasks) { - foreach(RequestReqElement elem in reqtask.Elements) + foreach(WfReqElement elem in reqtask.Elements) { if (elem.IpString != null) { elem.Cidr = new Cidr(elem.IpString); } } - foreach(RequestImplTask implTask in reqtask.ImplementationTasks) + foreach(WfImplTask implTask in reqtask.ImplementationTasks) { - foreach(RequestImplElement elem in implTask.ImplElements) + foreach(WfImplElement elem in implTask.ImplElements) { if (elem.IpString != null) { diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTicketBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfTicketBase.cs similarity index 94% rename from roles/lib/files/FWO.Api.Client/Data/RequestTicketBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTicketBase.cs index 758bf6288..d41c69928 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTicketBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTicketBase.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestTicketBase: RequestStatefulObject + public class WfTicketBase: WfStatefulObject { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -45,10 +45,10 @@ public class RequestTicketBase: RequestStatefulObject public int? Priority { get; set; } - public RequestTicketBase() + public WfTicketBase() { } - public RequestTicketBase(RequestTicketBase ticket) : base(ticket) + public WfTicketBase(WfTicketBase ticket) : base(ticket) { Id = ticket.Id; Title = ticket.Title; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTicketWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfTicketWriter.cs similarity index 53% rename from roles/lib/files/FWO.Api.Client/Data/RequestTicketWriter.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTicketWriter.cs index 87bf3f54b..5303a4fa8 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTicketWriter.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTicketWriter.cs @@ -3,18 +3,18 @@ namespace FWO.Api.Data { - public class RequestTicketWriter + public class WfTicketWriter { [JsonProperty("data"), JsonPropertyName("data")] - public List Tasks { get; set; } = new (); + public List Tasks { get; set; } = new (); - public RequestTicketWriter(RequestTicket ticket) + public WfTicketWriter(WfTicket ticket) { foreach(var reqtask in ticket.Tasks) { - Tasks.Add(new RequestReqTaskWriter(reqtask)); + Tasks.Add(new WfReqTaskWriter(reqtask)); } } } diff --git a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs index f2d0393ff..c7a534a9a 100644 --- a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs +++ b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs @@ -8,7 +8,7 @@ namespace FWO.Tufin.SecureChange { - abstract public class ExternalTicket : RequestTicket + abstract public class ExternalTicket : WfTicket { public List TicketTasks = []; diff --git a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs index 5a8c17d8c..47dd4c5f7 100644 --- a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs +++ b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs @@ -3,7 +3,7 @@ namespace FWO.Tufin.SecureChange { - public class ExternalAccessRequestTicketTask : RequestReqTask + public class ExternalAccessRequestTicketTask : WfReqTask { private ModellingConnection Connection = new(); diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor index 799391ee2..a44348ef5 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor @@ -349,7 +349,7 @@ - + } @@ -391,8 +391,8 @@ private static string forbiddenDropzoneClass = "minheight-dropzone bg-white"; private bool workInProgress = false; - private RequestHandler reqHandler = new (); - private RequestStateDict states = new (); + private WfHandler wfHandler = new (); + private WfStateDict states = new (); private List OwnerIds = new (); private ModellingConnection unchangedConn = new(); private bool RejectInterfaceMode = false; @@ -608,21 +608,21 @@ apiConnection.SetProperRole(authenticationStateTask!.Result.User, new List { Roles.Implementer, Roles.Requester, Roles.Admin, Roles.Auditor }); await states.Init(apiConnection); OwnerIds = (await apiConnection.SendQueryAsync>(OwnerQueries.getOwners)).ConvertAll(x => x.Id); - reqHandler = new (DisplayMessageInUi, userConfig, authenticationStateTask!.Result.User, apiConnection, middlewareClient, WorkflowPhases.request){}; - reqHandler.ReadOnlyMode = true; - await reqHandler.Init(OwnerIds, true, true); - RequestTicket? ticket = await reqHandler.ResolveTicket((long)ConnHandler.ActConn.TicketId); + wfHandler = new (DisplayMessageInUi, userConfig, authenticationStateTask!.Result.User, apiConnection, middlewareClient, WorkflowPhases.request){}; + wfHandler.ReadOnlyMode = true; + await wfHandler.Init(OwnerIds, true, true); + WfTicket? ticket = await wfHandler.ResolveTicket((long)ConnHandler.ActConn.TicketId); if(ticket != null) { - reqHandler.SetTicketEnv(ticket); - RequestReqTask? reqTask = ticket.Tasks.FirstOrDefault(x => x.TaskType == TaskType.new_interface.ToString()); + wfHandler.SetTicketEnv(ticket); + WfReqTask? reqTask = ticket.Tasks.FirstOrDefault(x => x.TaskType == TaskType.new_interface.ToString()); if(reqTask != null) { - reqHandler.SetReqTaskEnv(reqTask); - RequestImplTask? implTask = reqTask.ImplementationTasks.FirstOrDefault(x => x.ReqTaskId == reqTask.Id); + wfHandler.SetReqTaskEnv(reqTask); + WfImplTask? implTask = reqTask.ImplementationTasks.FirstOrDefault(x => x.ReqTaskId == reqTask.Id); if(implTask != null) { - reqHandler.SelectImplTask(implTask, ObjAction.display); + wfHandler.SelectImplTask(implTask, ObjAction.display); } } } diff --git a/roles/ui/files/FWO.UI/Pages/Request/AssignObject.razor b/roles/ui/files/FWO.UI/Pages/Request/AssignObject.razor index 912f131ee..fa001dc00 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/AssignObject.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/AssignObject.razor @@ -90,10 +90,10 @@ public Func ResetParent { get; set; } = DefaultInit.DoNothing; [Parameter] - public RequestStatefulObject StatefulObject { get; set; } = new RequestStatefulObject(); + public WfStatefulObject StatefulObject { get; set; } = new WfStatefulObject(); [Parameter] - public Func Assign { get; set; } = DefaultInit.DoNothing; + public Func Assign { get; set; } = DefaultInit.DoNothing; [Parameter] public Func? AssignBack { get; set; } diff --git a/roles/ui/files/FWO.UI/Pages/Request/DisplayApprovals.razor b/roles/ui/files/FWO.UI/Pages/Request/DisplayApprovals.razor index 9b78c5066..de5be669a 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/DisplayApprovals.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/DisplayApprovals.razor @@ -14,11 +14,11 @@ @if (Display) {
- - + + - - - + + + - - + + - + - + @@ -62,8 +62,8 @@ - - + + @code { @@ -77,16 +77,16 @@ public EventCallback DisplayChanged { get; set; } [Parameter] - public RequestHandler ReqHandler { get; set; } = new (); + public WfHandler WfHandler { get; set; } = new (); [Parameter] public Func ResetParent { get; set; } = DefaultInit.DoNothing; [Parameter] - public List Approvals { get; set; } = new (); + public List Approvals { get; set; } = new (); [Parameter] - public RequestStateDict States { get; set; } = new (); + public WfStateDict States { get; set; } = new (); static List validRoles = new (){Roles.Approver}; @@ -99,22 +99,22 @@ private async Task Reset() { - ReqHandler.ResetApprovalActions(); + WfHandler.ResetApprovalActions(); StateHasChanged(); } - private async Task AssignApproval(RequestApproval approval) + private async Task AssignApproval(WfApproval approval) { - await ReqHandler.SelectApprovalPopUp(approval, ObjAction.displayAssign); + await WfHandler.SelectApprovalPopUp(approval, ObjAction.displayAssign); } - private async Task InitAddComment(RequestApproval approval) + private async Task InitAddComment(WfApproval approval) { - await ReqHandler.SelectApprovalPopUp(approval, ObjAction.displayComment); + await WfHandler.SelectApprovalPopUp(approval, ObjAction.displayComment); } private async Task ConfAddComment(string commentText) { - await ReqHandler.ConfAddCommentToApproval(commentText); + await WfHandler.ConfAddCommentToApproval(commentText); StateHasChanged(); } diff --git a/roles/ui/files/FWO.UI/Pages/Request/DisplayImplTaskTable.razor b/roles/ui/files/FWO.UI/Pages/Request/DisplayImplTaskTable.razor index b9a40b038..ee9855244 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/DisplayImplTaskTable.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/DisplayImplTaskTable.razor @@ -9,20 +9,20 @@ @inject ApiConnection apiConnection @inject UserConfig userConfig -@if(ReqHandler.InitDone) +@if(WfHandler.InitDone) { - @if (ReqHandler.PlanReqTaskMode) + @if (WfHandler.PlanReqTaskMode) {
- @if(ReqHandler.ActReqTask.TaskType == TaskType.access.ToString() && userConfig.ReqActivatePathAnalysis) + @if(WfHandler.ActReqTask.TaskType == TaskType.access.ToString() && userConfig.ReqActivatePathAnalysis) { - @if(ReqHandler.ActReqTask.ImplementationTasks.Count > 0) + @if(WfHandler.ActReqTask.ImplementationTasks.Count > 0) { @@ -37,29 +37,29 @@ @if (AllImplTasks != null && AllImplTasks.Count > 0) {
-
- + + - - + + @if(ImplTaskView) { - + - + - + } - + @if(userConfig.ReqOwnerBased) { - + @@ -119,29 +119,29 @@ } else { - + } - + - + - + - - + +
} @@ -175,12 +175,12 @@ - - - - - + + + + + @code @@ -192,22 +192,22 @@ public WorkflowPhases Phase { get; set; } = WorkflowPhases.approval; [Parameter] - public RequestStateDict States { get; set; } = new (); + public WfStateDict States { get; set; } = new (); [Parameter] - public RequestHandler ReqHandler { get; set; } = new (); + public WfHandler WfHandler { get; set; } = new (); [Parameter] public Func ResetParent { get; set; } = DefaultInit.DoNothing; [Parameter] - public List? AllImplTasks { get; set; } = new List(); + public List? AllImplTasks { get; set; } = new List(); [Parameter] public bool ImplTaskView { get; set; } = false; [Parameter] - public Func StartImplPhase { get; set; } = DefaultInit.DoNothing; + public Func StartImplPhase { get; set; } = DefaultInit.DoNothing; static List validRoles = new (){ Roles.Implementer, Roles.FwAdmin }; private bool DisplayInfo = false; @@ -217,31 +217,31 @@ private async Task Reset() { await ResetParent(); - ReqHandler.ResetImplTaskActions(); + WfHandler.ResetImplTaskActions(); StateHasChanged(); } - private RequestTicket? ResolveTicket(RequestImplTask implTask) + private WfTicket? ResolveTicket(WfImplTask implTask) { if(implTask.TicketId != 0) { - int idx = ReqHandler.TicketList.FindIndex(x => x.Id == implTask.TicketId); + int idx = WfHandler.TicketList.FindIndex(x => x.Id == implTask.TicketId); if(idx >= 0) { - return ReqHandler.TicketList[idx]; + return WfHandler.TicketList[idx]; } } return null; } - private string GetOwnerName(RequestImplTask implTask) + private string GetOwnerName(WfImplTask implTask) { if(implTask.ReqTaskId != 0) { - RequestTicket? ticket = ResolveTicket(implTask); + WfTicket? ticket = ResolveTicket(implTask); if(ticket != null && ticket.Tasks.Count > 0) { - RequestReqTask? reqTask = ticket.Tasks.FirstOrDefault(x => x.Id == implTask.ReqTaskId); + WfReqTask? reqTask = ticket.Tasks.FirstOrDefault(x => x.Id == implTask.ReqTaskId); if(reqTask != null && reqTask.Owners != null && reqTask.Owners.Count > 0) { return reqTask.Owners?.First()?.Owner.Name ?? ""; @@ -251,89 +251,89 @@ return ""; } - private void ShowImplTask(RequestImplTask implTask) + private void ShowImplTask(WfImplTask implTask) { - ReqHandler.SelectImplTask(implTask, ObjAction.display); + WfHandler.SelectImplTask(implTask, ObjAction.display); } private void AddImplTask() { - RequestImplTask newTask = new (ReqHandler.ActReqTask, false) + WfImplTask newTask = new (WfHandler.ActReqTask, false) { - TaskNumber = ReqHandler.ActReqTask.HighestImplTaskNumber() + 1, - DeviceId = (ReqHandler.Devices.Count > 0 ? ReqHandler.Devices[0].Id : 0) + TaskNumber = WfHandler.ActReqTask.HighestImplTaskNumber() + 1, + DeviceId = (WfHandler.Devices.Count > 0 ? WfHandler.Devices[0].Id : 0) }; - if(ReqHandler.Devices.Count > 0) + if(WfHandler.Devices.Count > 0) { - newTask.Title += ": "+ ReqHandler.Devices[ReqHandler.Devices.FindIndex(x => x.Id == ReqHandler.Devices[0].Id)].Name; + newTask.Title += ": "+ WfHandler.Devices[WfHandler.Devices.FindIndex(x => x.Id == WfHandler.Devices[0].Id)].Name; } - ReqHandler.SelectImplTask(newTask, ObjAction.add); + WfHandler.SelectImplTask(newTask, ObjAction.add); } private async Task AutocreateImplTasks() { - await ReqHandler.CreateAccessImplTasksFromPathAnalysis(ReqHandler.ActReqTask); + await WfHandler.CreateAccessImplTasksFromPathAnalysis(WfHandler.ActReqTask); } - private async Task Assign(RequestStatefulObject grp) + private async Task Assign(WfStatefulObject grp) { - await ReqHandler.AssignImplTaskGroup(grp); + await WfHandler.AssignImplTaskGroup(grp); UpdateImplTaskInList(); } private async Task AssignBack() { - await ReqHandler.AssignImplTaskBack(); + await WfHandler.AssignImplTaskBack(); UpdateImplTaskInList(); } private void UpdateImplTaskInList() { - int? idx = AllImplTasks?.FindIndex(x => x.Id == ReqHandler.ActImplTask.Id); + int? idx = AllImplTasks?.FindIndex(x => x.Id == WfHandler.ActImplTask.Id); if(idx != null && idx >= 0) { - AllImplTasks[(int)idx] = ReqHandler.ActImplTask; + AllImplTasks[(int)idx] = WfHandler.ActImplTask; } } private async Task CheckImplTasks() { - List foundDevices = await (new PathAnalysis(apiConnection)).getAllDevices(ReqHandler.ActReqTask.Elements); + List foundDevices = await (new PathAnalysis(apiConnection)).getAllDevices(WfHandler.ActReqTask.Elements); deviceCheck = new List>(); foreach(var dev in foundDevices) { - deviceCheck.Add(new KeyValuePair(dev.Name ?? "", ReqHandler.ActReqTask.ImplementationTasks.FirstOrDefault(x => x.DeviceId == dev.Id) != null)); + deviceCheck.Add(new KeyValuePair(dev.Name ?? "", WfHandler.ActReqTask.ImplementationTasks.FirstOrDefault(x => x.DeviceId == dev.Id) != null)); } DisplayInfo = true; } private void CleanupImplTasks() { - ReqHandler.SetImplTaskPopUpOpt(ObjAction.displayCleanup); + WfHandler.SetImplTaskPopUpOpt(ObjAction.displayCleanup); } - private void EditImplTask(RequestImplTask implTask) + private void EditImplTask(WfImplTask implTask) { - ReqHandler.SelectImplTask(implTask, ObjAction.edit); + WfHandler.SelectImplTask(implTask, ObjAction.edit); } - private void DeleteImplTask(RequestImplTask implTask) + private void DeleteImplTask(WfImplTask implTask) { - ReqHandler.SelectImplTaskPopUp(implTask, ObjAction.displayDelete); + WfHandler.SelectImplTaskPopUp(implTask, ObjAction.displayDelete); } - private void ShowApprovals(RequestImplTask implTask) + private void ShowApprovals(WfImplTask implTask) { - ReqHandler.SelectImplTaskPopUp(implTask, ObjAction.displayApprovals); + WfHandler.SelectImplTaskPopUp(implTask, ObjAction.displayApprovals); } - private void AssignImplTask(RequestImplTask implTask) + private void AssignImplTask(WfImplTask implTask) { - ReqHandler.SelectImplTaskPopUp(implTask, ObjAction.displayAssign); + WfHandler.SelectImplTaskPopUp(implTask, ObjAction.displayAssign); } - private async Task ContinueImplPhase(RequestImplTask implTask) + private async Task ContinueImplPhase(WfImplTask implTask) { - await ReqHandler.ContinueImplPhase(implTask); + await WfHandler.ContinueImplPhase(implTask); } } diff --git a/roles/ui/files/FWO.UI/Pages/Request/DisplayImplementationTask.razor b/roles/ui/files/FWO.UI/Pages/Request/DisplayImplementationTask.razor index eabe10220..ab206e989 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/DisplayImplementationTask.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/DisplayImplementationTask.razor @@ -12,9 +12,9 @@ @inject UserConfig userConfig - + - @if (ReqHandler.DisplayImplTaskMode) + @if (WfHandler.DisplayImplTaskMode) {
@@ -22,7 +22,7 @@
- +
@@ -30,7 +30,7 @@
- +
@@ -38,7 +38,7 @@
- +
@@ -48,19 +48,19 @@
- +
- @if(ReqHandler.ActImplTask.TaskType == TaskType.access.ToString() || ReqHandler.ActImplTask.TaskType == TaskType.rule_delete.ToString()) + @if(WfHandler.ActImplTask.TaskType == TaskType.access.ToString() || WfHandler.ActImplTask.TaskType == TaskType.rule_delete.ToString()) {
- @if (ReqHandler.EditImplTaskMode) + @if (WfHandler.EditImplTaskMode) { - + @device.Name @@ -74,14 +74,14 @@
} - else if(ReqHandler.ActImplTask.TaskType == TaskType.new_interface.ToString()) + else if(WfHandler.ActImplTask.TaskType == TaskType.new_interface.ToString()) {
- @if (ReqHandler.ImplementImplTaskMode) + @if (WfHandler.ImplementImplTaskMode) {
- +
@if(actOwner != oldOwner) { @@ -93,7 +93,7 @@ } else { - @if(ReqHandler.GetAddInfoValue(AdditionalInfoKeys.ReqOwner) == "") + @if(WfHandler.GetAddInfoValue(AdditionalInfoKeys.ReqOwner) == "") { @@ -109,7 +109,7 @@
- +
} @@ -118,24 +118,24 @@
}
- @if(ReqHandler.ActImplTask.TaskType == TaskType.generic.ToString()) + @if(WfHandler.ActImplTask.TaskType == TaskType.generic.ToString()) {
- +
} - @if(ReqHandler.ActImplTask.TaskType == TaskType.access.ToString()) + @if(WfHandler.ActImplTask.TaskType == TaskType.access.ToString()) {
- @if (ReqHandler.EditImplTaskMode) + @if (WfHandler.EditImplTaskMode) { @@ -154,7 +154,7 @@
- @if (ReqHandler.EditImplTaskMode) + @if (WfHandler.EditImplTaskMode) { @@ -173,13 +173,13 @@
- @if (ReqHandler.EditImplTaskMode) + @if (WfHandler.EditImplTaskMode) { - + } else { - + }
@@ -188,13 +188,13 @@
- @if (ReqHandler.EditImplTaskMode) + @if (WfHandler.EditImplTaskMode) { - + } else { - + }
@@ -203,16 +203,16 @@ + TaskId="WfHandler.ActImplTask.Id" EditMode="WfHandler.EditImplTaskMode" /> } - else if(ReqHandler.ActImplTask.TaskType == TaskType.rule_delete.ToString()) + else if(WfHandler.ActImplTask.TaskType == TaskType.rule_delete.ToString()) { - + }
- @if(ReqHandler.ImplementImplTaskMode || ReqHandler.ReviewImplTaskMode) + @if(WfHandler.ImplementImplTaskMode || WfHandler.ReviewImplTaskMode) { @@ -226,7 +226,7 @@
@foreach(var action in offeredActions) { - @if(ReqHandler.ImplementImplTaskMode || ReqHandler.ReviewImplTaskMode || RequestStateAction.IsReadonlyType(action.ActionType)) + @if(WfHandler.ImplementImplTaskMode || WfHandler.ReviewImplTaskMode || WfStateAction.IsReadonlyType(action.ActionType)) { } @@ -238,7 +238,7 @@
- @if (ReqHandler.EditImplTaskMode) + @if (WfHandler.EditImplTaskMode) { @@ -249,7 +249,7 @@ } - else if ((ReqHandler.ImplementImplTaskMode || ReqHandler.ReviewImplTaskMode) && !newOwnerAssigned) + else if ((WfHandler.ImplementImplTaskMode || WfHandler.ReviewImplTaskMode) && !newOwnerAssigned) { @@ -260,7 +260,7 @@ } - @if((ReqHandler.EditImplTaskMode || ReqHandler.ImplementImplTaskMode || ReqHandler.ReviewImplTaskMode) && !newOwnerAssigned) + @if((WfHandler.EditImplTaskMode || WfHandler.ImplementImplTaskMode || WfHandler.ReviewImplTaskMode) && !newOwnerAssigned) { } @@ -274,12 +274,12 @@ @if(IncludePopups) { - - + + - + } @code @@ -294,7 +294,7 @@ public WorkflowPhases Phase { get; set; } = WorkflowPhases.planning; [Parameter] - public RequestHandler ReqHandler { get; set; } = new (); + public WfHandler WfHandler { get; set; } = new (); [Parameter] public Func ResetParent { get; set; } = DefaultInit.DoNothing; @@ -303,7 +303,7 @@ public StateMatrix StateMatrix { get; set; } = new (); [Parameter] - public RequestStateDict States { get; set; } = new (); + public WfStateDict States { get; set; } = new (); [Parameter] public bool IncludePopups { get; set; } = true; @@ -332,7 +332,7 @@ private bool newOwnerAssigned = false; private bool firstParamSet = false; - private List offeredActions = new (); + private List offeredActions = new (); private string allComments = ""; private string message = ""; private bool assignOwnerMode = false; @@ -356,19 +356,19 @@ { try { - if (ReqHandler.DisplayImplTaskMode && firstParamSet) + if (WfHandler.DisplayImplTaskMode && firstParamSet) { firstParamSet = false; InitElements(); await InitComments(); if(IncludePopups) { - offeredActions = ReqHandler.ActionHandler.GetOfferedActions(ReqHandler.ActImplTask, RequestObjectScopes.ImplementationTask, ReqHandler.Phase); + offeredActions = WfHandler.ActionHandler.GetOfferedActions(WfHandler.ActImplTask, WfObjectScopes.ImplementationTask, WfHandler.Phase); } - actDevice = ReqHandler.Devices.FirstOrDefault(x => x.Id == ReqHandler.ActImplTask.DeviceId); - actRuleAction = ruleActions.FirstOrDefault(x => x.Id == ReqHandler.ActImplTask.RuleAction); - actTracking = trackings.FirstOrDefault(x => x.Id == ReqHandler.ActImplTask.Tracking); - actOwner = ReqHandler.ActReqTask.Owners.FirstOrDefault()?.Owner; + actDevice = WfHandler.Devices.FirstOrDefault(x => x.Id == WfHandler.ActImplTask.DeviceId); + actRuleAction = ruleActions.FirstOrDefault(x => x.Id == WfHandler.ActImplTask.RuleAction); + actTracking = trackings.FirstOrDefault(x => x.Id == WfHandler.ActImplTask.Tracking); + actOwner = WfHandler.ActReqTask.Owners.FirstOrDefault()?.Owner; oldOwner = actOwner; newOwnerAssigned = false; } @@ -381,34 +381,34 @@ private void InitElements() { - actSources = ReqHandler.ActImplTask.GetNwObjectElements(ElemFieldType.source); - actDestinations = ReqHandler.ActImplTask.GetNwObjectElements(ElemFieldType.destination); - actServices = ReqHandler.ActImplTask.GetServiceElements(); - actRules = ReqHandler.ActImplTask.GetRuleElements(); + actSources = WfHandler.ActImplTask.GetNwObjectElements(ElemFieldType.source); + actDestinations = WfHandler.ActImplTask.GetNwObjectElements(ElemFieldType.destination); + actServices = WfHandler.ActImplTask.GetServiceElements(); + actRules = WfHandler.ActImplTask.GetRuleElements(); } private async Task InitComments() { - allComments = ReqHandler.ActImplTask.GetAllComments(); - ReqHandler.DisplayImplTaskCommentMode = false; + allComments = WfHandler.ActImplTask.GetAllComments(); + WfHandler.DisplayImplTaskCommentMode = false; } private async Task Close() { await ResetParent(); - ReqHandler.DisplayPromoteImplTaskMode = false; - ReqHandler.DisplayImplTaskMode = false; + WfHandler.DisplayPromoteImplTaskMode = false; + WfHandler.DisplayImplTaskMode = false; firstParamSet = true; } private async Task CancelPromote() { - ReqHandler.DisplayPromoteImplTaskMode = false; + WfHandler.DisplayPromoteImplTaskMode = false; } - private async Task PerformAction(RequestStateAction action) + private async Task PerformAction(WfStateAction action) { - await ReqHandler.ActionHandler.PerformAction(action, ReqHandler.ActImplTask, RequestObjectScopes.ImplementationTask, actOwner, ReqHandler.ActReqTask.TicketId); + await WfHandler.ActionHandler.PerformAction(action, WfHandler.ActImplTask, WfObjectScopes.ImplementationTask, actOwner, WfHandler.ActReqTask.TicketId); } private void RequestAssignOwner() @@ -420,20 +420,20 @@ private async Task AssignOwner() { SetChangedOwner(); - await ReqHandler.ChangeOwner(); - actOwner = ReqHandler.ActReqTask.Owners.FirstOrDefault()?.Owner; + await WfHandler.ChangeOwner(); + actOwner = WfHandler.ActReqTask.Owners.FirstOrDefault()?.Owner; newOwnerAssigned = true; assignOwnerMode = false; } private void InitAddComment() { - ReqHandler.SetImplTaskPopUpOpt(ObjAction.displayComment); + WfHandler.SetImplTaskPopUpOpt(ObjAction.displayComment); } private async Task ConfAddComment(string commentText) { - await ReqHandler.ConfAddCommentToImplTask(commentText); + await WfHandler.ConfAddCommentToImplTask(commentText); await InitComments(); StateHasChanged(); } @@ -443,50 +443,50 @@ foreach(var src in sourcesToDelete) { actSources.Remove(src); - RequestImplElement? oldElem = ReqHandler.ActImplTask.ImplElements.FirstOrDefault(x => x.Id == src.ElemId); + WfImplElement? oldElem = WfHandler.ActImplTask.ImplElements.FirstOrDefault(x => x.Id == src.ElemId); if(oldElem != null) { - ReqHandler.ActImplTask.RemovedElements.Add(oldElem); - ReqHandler.ActImplTask.ImplElements.Remove(oldElem); + WfHandler.ActImplTask.RemovedElements.Add(oldElem); + WfHandler.ActImplTask.ImplElements.Remove(oldElem); } } foreach(var dst in destinationsToDelete) { actDestinations.Remove(dst); - RequestImplElement? oldElem = ReqHandler.ActImplTask.ImplElements.FirstOrDefault(x => x.Id == dst.ElemId); + WfImplElement? oldElem = WfHandler.ActImplTask.ImplElements.FirstOrDefault(x => x.Id == dst.ElemId); if(oldElem != null) { - ReqHandler.ActImplTask.RemovedElements.Add(oldElem); - ReqHandler.ActImplTask.ImplElements.Remove(oldElem); + WfHandler.ActImplTask.RemovedElements.Add(oldElem); + WfHandler.ActImplTask.ImplElements.Remove(oldElem); } } foreach(var svc in servicesToDelete) { actServices.Remove(svc); - RequestImplElement? oldElem = ReqHandler.ActImplTask.ImplElements.FirstOrDefault(x => x.Id == svc.ElemId); + WfImplElement? oldElem = WfHandler.ActImplTask.ImplElements.FirstOrDefault(x => x.Id == svc.ElemId); if(oldElem != null) { - ReqHandler.ActImplTask.RemovedElements.Add(oldElem); - ReqHandler.ActImplTask.ImplElements.Remove(oldElem); + WfHandler.ActImplTask.RemovedElements.Add(oldElem); + WfHandler.ActImplTask.ImplElements.Remove(oldElem); } } foreach(var src in sourcesToAdd) { - src.TaskId = ReqHandler.ActImplTask.Id; + src.TaskId = WfHandler.ActImplTask.Id; actSources.Add(src); - ReqHandler.ActImplTask.ImplElements.Add(src.ToImplElement(ElemFieldType.source)); + WfHandler.ActImplTask.ImplElements.Add(src.ToImplElement(ElemFieldType.source)); } foreach(var dst in destinationsToAdd) { - dst.TaskId = ReqHandler.ActImplTask.Id; + dst.TaskId = WfHandler.ActImplTask.Id; actDestinations.Add(dst); - ReqHandler.ActImplTask.ImplElements.Add(dst.ToImplElement(ElemFieldType.destination)); + WfHandler.ActImplTask.ImplElements.Add(dst.ToImplElement(ElemFieldType.destination)); } foreach(var svc in servicesToAdd) { - svc.TaskId = ReqHandler.ActImplTask.Id; + svc.TaskId = WfHandler.ActImplTask.Id; actServices.Add(svc); - ReqHandler.ActImplTask.ImplElements.Add(svc.ToImplElement()); + WfHandler.ActImplTask.ImplElements.Add(svc.ToImplElement()); } sourcesToDelete = []; destinationsToDelete = []; @@ -495,12 +495,12 @@ destinationsToAdd = []; servicesToAdd = []; - ReqHandler.ActImplTask.ImplElements.RemoveAll(x => x.Field == ElemFieldType.rule.ToString()); + WfHandler.ActImplTask.ImplElements.RemoveAll(x => x.Field == ElemFieldType.rule.ToString()); foreach(var rule in actRules) { - RequestImplElement implElem = rule.ToImplElement(); - implElem.ImplAction = ReqHandler.ActImplTask.ImplAction; - ReqHandler.ActImplTask.ImplElements.Add(implElem); + WfImplElement implElem = rule.ToImplElement(); + implElem.ImplAction = WfHandler.ActImplTask.ImplAction; + WfHandler.ActImplTask.ImplElements.Add(implElem); } } @@ -508,28 +508,28 @@ { try { - if (ReqHandler.ActImplTask.Sanitize()) + if (WfHandler.ActImplTask.Sanitize()) { DisplayMessageInUi(null, userConfig.GetText("save_task"), userConfig.GetText("U0001"), true); } - ReqHandler.ActImplTask.DeviceId = actDevice?.Id; - ReqHandler.ActImplTask.RuleAction = actRuleAction?.Id; - ReqHandler.ActImplTask.Tracking = actTracking?.Id; - if(ReqHandler.ActImplTask.TaskType == TaskType.rule_delete.ToString()) + WfHandler.ActImplTask.DeviceId = actDevice?.Id; + WfHandler.ActImplTask.RuleAction = actRuleAction?.Id; + WfHandler.ActImplTask.Tracking = actTracking?.Id; + if(WfHandler.ActImplTask.TaskType == TaskType.rule_delete.ToString()) { - ReqHandler.ActImplTask.ImplAction = RequestAction.delete.ToString(); + WfHandler.ActImplTask.ImplAction = RequestAction.delete.ToString(); } SetChangedOwner(); UpdateElements(); if (CheckImplTaskValues()) { - if (ReqHandler.AddImplTaskMode) + if (WfHandler.AddImplTaskMode) { - await ReqHandler.AddImplTask(); + await WfHandler.AddImplTask(); } else { - await ReqHandler.ChangeImplTask(); + await WfHandler.ChangeImplTask(); } await Close(); } @@ -546,18 +546,18 @@ { if(oldOwner != null) { - ReqHandler.ActReqTask.RemovedOwners.Add(oldOwner); + WfHandler.ActReqTask.RemovedOwners.Add(oldOwner); } if(actOwner != null) { - ReqHandler.ActReqTask.NewOwners.Add(actOwner); + WfHandler.ActReqTask.NewOwners.Add(actOwner); } } } private bool CheckImplTaskValues() { - foreach (var implElem in ReqHandler.ActImplTask.ImplElements) + foreach (var implElem in WfHandler.ActImplTask.ImplElements) { if (implElem.Field == ElemFieldType.service.ToString() && implElem.ServiceId == null) { @@ -573,11 +573,11 @@ private void InitPromoteImplTask() { - ReqHandler.SetImplTaskPopUpOpt(ObjAction.displayPromote); + WfHandler.SetImplTaskPopUpOpt(ObjAction.displayPromote); } - private async Task ConfPromoteImplTask(RequestStatefulObject implTask) + private async Task ConfPromoteImplTask(WfStatefulObject implTask) { - await ReqHandler.PromoteImplTask(implTask); + await WfHandler.PromoteImplTask(implTask); } } diff --git a/roles/ui/files/FWO.UI/Pages/Request/DisplayPathAnalysis.razor b/roles/ui/files/FWO.UI/Pages/Request/DisplayPathAnalysis.razor index e9f6cbf3c..ad019180b 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/DisplayPathAnalysis.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/DisplayPathAnalysis.razor @@ -46,7 +46,7 @@ public Func ResetParent { get; set; } = DefaultInit.DoNothing; [Parameter] - public RequestReqTask ReqTask { get; set; } = new (); + public WfReqTask ReqTask { get; set; } = new (); private List deviceList = new (); diff --git a/roles/ui/files/FWO.UI/Pages/Request/DisplayReqTaskTable.razor b/roles/ui/files/FWO.UI/Pages/Request/DisplayReqTaskTable.razor index d351a0317..c5b8aab9e 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/DisplayReqTaskTable.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/DisplayReqTaskTable.razor @@ -5,36 +5,36 @@ @inject UserConfig userConfig -@if(ReqHandler.InitDone) +@if(WfHandler.InitDone) { - @if (ReqHandler.EditTicketMode) + @if (WfHandler.EditTicketMode) { } - @if (ReqHandler.ActTicket.Tasks.Count > 0) + @if (WfHandler.ActTicket.Tasks.Count > 0) {
- - + + - - - + + + - + - + - + @if(Phase == WorkflowPhases.approval) { - + @@ -92,23 +92,23 @@ } else { - + - - + + }
} } - - - - + + + + @code @@ -120,19 +120,19 @@ public WorkflowPhases Phase { get; set; } = WorkflowPhases.request; [Parameter] - public RequestStateDict States { get; set; } = new (); + public WfStateDict States { get; set; } = new (); [Parameter] - public RequestHandler ReqHandler { get; set; } = new (); + public WfHandler WfHandler { get; set; } = new (); [Parameter] public Func ResetParent { get; set; } = DefaultInit.DoNothing; [Parameter] - public Func StartPhase { get; set; } = DefaultInit.DoNothing; + public Func StartPhase { get; set; } = DefaultInit.DoNothing; [Parameter] - public Func StartImplPhase { get; set; } = DefaultInit.DoNothing; + public Func StartImplPhase { get; set; } = DefaultInit.DoNothing; static List validRoles = new (){Roles.Planner, Roles.FwAdmin}; @@ -140,42 +140,42 @@ private async Task Reset() { await ResetParent(); - ReqHandler.ResetReqTaskActions(); + WfHandler.ResetReqTaskActions(); StateHasChanged(); } - private void ShowReqTask(RequestReqTask reqTask) + private void ShowReqTask(WfReqTask reqTask) { - ReqHandler.SelectReqTask(reqTask, ObjAction.display); + WfHandler.SelectReqTask(reqTask, ObjAction.display); } private void AddReqTask() { - ReqHandler.SelectReqTask(new RequestReqTask(){ RuleAction = 1, Tracking = 1 }, ObjAction.add); + WfHandler.SelectReqTask(new WfReqTask(){ RuleAction = 1, Tracking = 1 }, ObjAction.add); } - private void EditReqTask(RequestReqTask reqTask) + private void EditReqTask(WfReqTask reqTask) { - ReqHandler.SelectReqTask(reqTask, ObjAction.edit); + WfHandler.SelectReqTask(reqTask, ObjAction.edit); } - private void DeleteReqTask(RequestReqTask reqTask) + private void DeleteReqTask(WfReqTask reqTask) { - ReqHandler.SelectReqTaskPopUp(reqTask, ObjAction.displayDelete); + WfHandler.SelectReqTaskPopUp(reqTask, ObjAction.displayDelete); } - private void ShowApprovals(RequestReqTask reqTask) + private void ShowApprovals(WfReqTask reqTask) { - ReqHandler.SelectReqTaskPopUp(reqTask, ObjAction.displayApprovals); + WfHandler.SelectReqTaskPopUp(reqTask, ObjAction.displayApprovals); } - private void AssignTask(RequestReqTask reqTask) + private void AssignTask(WfReqTask reqTask) { - ReqHandler.SelectReqTaskPopUp(reqTask, ObjAction.displayAssign); + WfHandler.SelectReqTaskPopUp(reqTask, ObjAction.displayAssign); } - private async Task ContinuePhase(RequestReqTask reqTask) + private async Task ContinuePhase(WfReqTask reqTask) { - await ReqHandler.ContinuePhase(reqTask); + await WfHandler.ContinuePhase(reqTask); } } diff --git a/roles/ui/files/FWO.UI/Pages/Request/DisplayRequestTask.razor b/roles/ui/files/FWO.UI/Pages/Request/DisplayRequestTask.razor index 7befc498c..f67828125 100644 --- a/roles/ui/files/FWO.UI/Pages/Request/DisplayRequestTask.razor +++ b/roles/ui/files/FWO.UI/Pages/Request/DisplayRequestTask.razor @@ -10,9 +10,9 @@ @inject UserConfig userConfig - + - @if (ReqHandler.DisplayReqTaskMode) + @if (WfHandler.DisplayReqTaskMode) {
@@ -20,7 +20,7 @@
- +
@@ -28,7 +28,7 @@
- +
@@ -38,7 +38,7 @@
- +
@@ -46,7 +46,7 @@
- +
@@ -54,7 +54,7 @@
- +
@@ -64,7 +64,7 @@
- @if (ReqHandler.EditReqTaskMode) + @if (WfHandler.EditReqTaskMode) { @@ -79,15 +79,15 @@
- @if(actTaskType == TaskType.access && !ReqHandler.ActStateMatrix.PhaseActive[WorkflowPhases.planning] && userConfig.ReqAutoCreateImplTasks == AutoCreateImplTaskOptions.enterInReqTask) + @if(actTaskType == TaskType.access && !WfHandler.ActStateMatrix.PhaseActive[WorkflowPhases.planning] && userConfig.ReqAutoCreateImplTasks == AutoCreateImplTaskOptions.enterInReqTask) {
- @if (ReqHandler.EditReqTaskMode) + @if (WfHandler.EditReqTaskMode) { - + @device.Name @@ -107,9 +107,9 @@
- @if (ReqHandler.EditReqTaskMode) + @if (WfHandler.EditReqTaskMode) { - + @device.Name @@ -125,17 +125,17 @@ } else if(actTaskType == TaskType.new_interface) { - @if (ReqHandler.EditReqTaskMode) + @if (WfHandler.EditReqTaskMode) {
- +
} else { - @if(ReqHandler.GetAddInfoValue(AdditionalInfoKeys.ReqOwner) == "") + @if(WfHandler.GetAddInfoValue(AdditionalInfoKeys.ReqOwner) == "") {
@@ -155,7 +155,7 @@
- +
} @@ -167,7 +167,7 @@
-