Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing IOD Workflow Switch for Non-Standalone Environment #3526

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
using CSETWebCore.DataLayer.Model;
using CSETWebCore.Model.Module;
using CSETWebCore.Interfaces.Helpers;
using CSETWebCore.Helpers;
using Namotion.Reflection;
using Microsoft.AspNetCore.Authorization;

namespace CSETWebCore.Api.Controllers
{
Expand Down Expand Up @@ -116,16 +115,18 @@ public IActionResult SetCisaAssessorWorkflow([FromBody] bool cisaWorkflowEnabled
}

[HttpGet]
[AllowAnonymous]
[Route("api/EnableProtectedFeature/getCisaAssessorWorkflow")]
/// <summary>
/// Marks the FAA set as 'unlocked.'
/// Gets the status of the CISA assessor workflow for the current user.
/// </summary>
/// <returns></returns>
public IActionResult GetCisaAssessorWorkflow()
{
var userId = _tokenManager.GetCurrentUserId();
var ak = _tokenManager.GetAccessKey();

// Assume false if we can't find the user or access key (they are probably on the login page).
bool cisaWorkflowEnabled = false;

if (userId != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</tr>
</table>

<div *ngIf="!modulesList || modulesList.length === 0">
<div *ngIf="!modulesList || modulesList.length === 0 || !cisaWorkflowStatusLoaded">
<div class="spinner-container" style="margin: 2em auto">
<div style="max-width: 50px; max-height: 50px;"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class EnableProtectedComponent implements OnInit {
message: any;
enableFeatureButtonClick: boolean = false;
cisaWorkflowEnabled: boolean = false;
cisaWorkflowStatusLoaded: boolean = false;

constructor(private dialog: MatDialogRef<EnableProtectedComponent>,
private featureSvc: EnableFeatureService,
Expand All @@ -54,6 +55,7 @@ export class EnableProtectedComponent implements OnInit {

this.configSvc.getCisaAssessorWorkflow().subscribe((cisaWorkflowEnabled: boolean) => {
this.cisaWorkflowEnabled = cisaWorkflowEnabled;
this.cisaWorkflowStatusLoaded = true;
});
}

Expand Down
Loading
Loading