diff --git a/Fab2ApprovalSystem/Controllers/ChangeControlController.cs b/Fab2ApprovalSystem/Controllers/ChangeControlController.cs index 3e1ed71..6464fe3 100644 --- a/Fab2ApprovalSystem/Controllers/ChangeControlController.cs +++ b/Fab2ApprovalSystem/Controllers/ChangeControlController.cs @@ -48,60 +48,27 @@ public class ChangeControlController : Controller { } public ActionResult Edit(int issueID) { - int isITARCompliant = 1; - ChangeControlViewModel cc = new ChangeControlViewModel(); - cc = ccDMO.GetChangeControlRead(issueID, out isITARCompliant, (int)Session[GlobalVars.SESSION_USERID]); + string jwt = Session["JWT"].ToString(); + string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); + string refreshToken = Session["RefreshToken"].ToString(); + string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); + string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? + "https://localhost:7255"; + string mrbUrl = $"{wasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/pcrb/{issueID}"; - List userList = MiscDMO.GetApproversListByDocument(cc.PlanNumber, cc.CurrentStep, (int)GlobalVars.DocumentType.ChangeControl); - ApproversListViewModel appUser = userList.Find(delegate (ApproversListViewModel al) { return al.UserID == (int)Session[GlobalVars.SESSION_USERID]; }); - if (appUser != null) { - ViewBag.IsApprover = "true"; - } - // TODO locked functionality - - if (isITARCompliant == 0) // not ITAR Compliant - { - return View("UnAuthorizedAccess"); - } else { - if ((int)Session[GlobalVars.SESSION_USERID] == cc.OwnerID) - ViewBag.IsOriginator = "true"; - else - ViewBag.IsOriginator = "false"; - - if ((cc.RecordLockIndicator && cc.RecordLockedBy != (int)Session[GlobalVars.SESSION_USERID]) || - cc.ClosedDate != null) { - return RedirectToAction("ReadOnlyCC", new { issueID = issueID }); - } else { - cc = ccDMO.GetChangeControl(issueID, out isITARCompliant, (int)Session[GlobalVars.SESSION_USERID]); - ViewBag.Attendees = ccDMO.GetUsers(); - ViewBag.Generations = ccDMO.GetGenerations(); - ViewBag.PartNumbers = ccDMO.GetPartNumbers(); - ViewBag.Processes = ccDMO.GetProcesses(); - ViewBag.Logistics = ccDMO.GetLogistics(); - ViewBag.AIResponsibles = ccDMO.GetActionItemResponsible(); - ViewBag.Sites = ccDMO.GetSites(); - return View(cc); - } - } + return Redirect(mrbUrl); } public ActionResult ReadOnlyCC(int issueID) { - int isITARCompliant = 1; - ChangeControlViewModel cc = new ChangeControlViewModel(); - cc = ccDMO.GetChangeControlRead(issueID, out isITARCompliant, (int)Session[GlobalVars.SESSION_USERID]); - // TODO locked functionality + string jwt = Session["JWT"].ToString(); + string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); + string refreshToken = Session["RefreshToken"].ToString(); + string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); + string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? + "https://localhost:7255"; + string mrbUrl = $"{wasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/pcrb/{issueID}"; - if (isITARCompliant == 0) // not ITAR Compliant - { - return View("UnAuthorizedAccess"); - } else { - ViewBag.MeetingList = ccDMO.GetMeetingList(issueID); - ViewBag.Generations = ccDMO.GetGenerations(); - ViewBag.PartNumbers = ccDMO.GetPartNumbers(); - ViewBag.Processes = ccDMO.GetProcesses(); - ViewBag.Logistics = ccDMO.GetLogistics(); - return View(cc); - } + return Redirect(mrbUrl); } [HttpPost] diff --git a/Fab2ApprovalSystem/Views/Home/_HomeLayout.cshtml b/Fab2ApprovalSystem/Views/Home/_HomeLayout.cshtml index d4fe335..cee1856 100644 --- a/Fab2ApprovalSystem/Views/Home/_HomeLayout.cshtml +++ b/Fab2ApprovalSystem/Views/Home/_HomeLayout.cshtml @@ -92,15 +92,15 @@ "https://localhost:7255"; string mrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/mrb/new";
  • Create MRB
  • - @*string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/new"; -
  • Create PCRB
  • *@ + string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/new"; +
  • Create PCRB
  • } else { string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? "https://localhost:7255"; string mrbUrl = wasmClientUrl + "/redirect?redirectPath=/mrb/new";
  • Create MRB
  • - @*string pcrbUrl = wasmClientUrl + "/redirect?redirectPath=/pcrb/new"; -
  • Create PCRB
  • *@ + string pcrbUrl = wasmClientUrl + "/redirect?redirectPath=/pcrb/new"; +
  • Create PCRB
  • } @*
  • Create Special Work Request
  • *@ @*
  • Create PCR
  • *@ @@ -152,8 +152,8 @@ "https://localhost:7255"; string mrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/mrb/all"; menu.Add().Text("MRB").Url(mrbUrl); - //string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/all"; - //menu.Add().Text("PCRB").Url(pcrbUrl); + string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/all"; + menu.Add().Text("PCRB").Url(pcrbUrl); //menu.Add().Text("Special Work Requests").Action("SpecialWorkRequestList", "Home"); //menu.Add().Text("PCRB").Action("ChangeControlList", "Home"); //menu.Add().Text("MRB").Action("MRBList", "Home"); diff --git a/MesaFabApproval.Client/MesaFabApproval.Client.csproj b/MesaFabApproval.Client/MesaFabApproval.Client.csproj index cdfb8e2..105c8a6 100644 --- a/MesaFabApproval.Client/MesaFabApproval.Client.csproj +++ b/MesaFabApproval.Client/MesaFabApproval.Client.csproj @@ -30,4 +30,11 @@ + + + true + PreserveNewest + + + diff --git a/MesaFabApproval.Client/Pages/Components/PCR3DocumentForm.razor b/MesaFabApproval.Client/Pages/Components/PCR3DocumentForm.razor index 2306fcb..315f379 100644 --- a/MesaFabApproval.Client/Pages/Components/PCR3DocumentForm.razor +++ b/MesaFabApproval.Client/Pages/Components/PCR3DocumentForm.razor @@ -19,6 +19,7 @@ @bind-Value="@document.DocNumbers" @bind-Text="@document.DocNumbers" Immediate + Required AutoGrow AutoFocus /> @if (DocNumberIsNA()) { @@ -49,8 +50,8 @@ - @if ((DocNumberIsNA() && !string.IsNullOrWhiteSpace(document.Comment)) || - (!DocNumberIsNA() && ecnNoIsValid)) { + @if (!string.IsNullOrWhiteSpace(document.DocNumbers) && ((DocNumberIsNA() && !string.IsNullOrWhiteSpace(document.Comment)) || + (!DocNumberIsNA() && ecnNoIsValid))) { a.ClosedStatus == false).Count(); bool allActionItemsComplete = current_i < 3 || actionItems.Where(a => a.ClosedStatus == false).Count() == 0; + bool actionItemsAreComplete = actionItems.Where(a => a.ClosedStatus == false).Count() == 0; bool attachmentsMissing = currentStageAttachments.Count() == 0; bool actionItemsIncomplete = current_i < 3 && currentStagePendingActionItemCount > 0; bool affectedDocumentsIncomplete = current_i == 3 && pcr3Documents.Where(d => d.CompletedByID <= 0).Count() > 0; bool approvalsIncomplete = currentStageApprovals.Count() > 0 && currentStagePendingApprovalsCount > 0; - @($"PCR {current_i}") @@ -495,7 +496,17 @@ @context.DocType @context.DocNumbers @context.Comment - @context.GetEcnNumberString() + + @if (string.IsNullOrWhiteSpace(context.GetEcnNumberString())) { + context.GetEcnNumberString(); + } else { + + @context.GetEcnNumberString() + + } + @(DateTimeUtilities.GetDateAsStringMaxDefault(context.CompletedDate)) @(context.CompletedBy is null ? string.Empty : context.CompletedBy.GetFullName()) @@ -568,6 +579,11 @@ Approvers + @if (!actionItemsAreComplete && current_i == 3) { + + All actions must be completed before PCR3 is submitted for approval + + }