Skip to content

Commit

Permalink
feat(bl): fixes not being Able to update and member decisions for ne…
Browse files Browse the repository at this point in the history
…w projects (#447)
  • Loading branch information
John-Vaughan authored Nov 21, 2023
1 parent 3f105f5 commit 023aca0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
32 changes: 27 additions & 5 deletions src/TRE-API/DoAgentWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,17 +372,39 @@ public async Task CheckTESK(string taskID, int subId, string tesId, string outpu
break;
}


var result = _subHelper.UpdateStatusForTre(subId.ToString(), statusMessage, "");
APIReturn? result = null;
try
{
result = _subHelper.UpdateStatusForTre(subId.ToString(), statusMessage, "");
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}

if (status.state == "COMPLETE")
{
Log.Information($" CloseSubmissionForTre with status.state subId {subId.ToString()} == COMPLETE ");
result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Completed, "","");
try
{
result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Completed, "","");
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}
}
else if (status.state == "EXECUTER_ERROR" || status.state == "SYSTEM_ERROR")
{
Log.Information($" CloseSubmissionForTre with status.state subId {subId.ToString()} == EXECUTER_ERROR or SYSTEM_ERROR ");
result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Failed, "", "");
try
{
result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Failed, "", "");
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}
}
}
Log.Information($" Checking status ");
Expand Down Expand Up @@ -600,7 +622,7 @@ public void Execute()



var OutputBucket = _AgentSettings.TESKOutputBucketPrefix + _dbContext.Projects.First(x => x.Id == projectId).OutputBucketTre; //TODO Check, Projects not getting The synchronised Properly
var OutputBucket = _AgentSettings.TESKOutputBucketPrefix + _dbContext.Projects.First(x => x.SubmissionProjectId == projectId).OutputBucketTre; //TODO Check, Projects not getting The synchronised Properly
//it need the file name?? (key-name)

if (tesMessage.Outputs == null)
Expand Down
4 changes: 2 additions & 2 deletions src/TRE-UI/Views/Approval/EditProject.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
</div>
<ul class="nav nav-underline border-bottom mt-4 mb-5">
<li class="nav-item" role="presentation">
<a href="@Url.Action("EditProject", new { projectId = @Model.SubmissionProjectId})" class="nav-link text-dark">
<a href="@Url.Action("EditProject", new { projectId = @Model.Id})" class="nav-link text-dark">
Project Approval</a>
</li>
<li class="nav-item" role="presentation">
<a href="@Url.Action("EditMemberships", new { projectId = @Model.SubmissionProjectId})" class="nav-link text-dark">
<a href="@Url.Action("EditMemberships", new { projectId = @Model.Id})" class="nav-link text-dark">
Memberships
</a>
</li>
Expand Down

0 comments on commit 023aca0

Please sign in to comment.