Skip to content

Commit

Permalink
Merge branch 'develop' into feature/cset-2572
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmostafa committed Feb 13, 2024
2 parents 3204909 + 2ba6fae commit b11515a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ public int UpdateObservation(Observation observation)
/// </summary>
public List<ActionItems> GetActionItems(int parentId, int observation_id)
{
var actionItems = new List<ActionItems>(
var actionItems = new List<ActionItems>();

);
var table = from questions in _context.MATURITY_QUESTIONS
join actions in _context.ISE_ACTIONS on questions.Mat_Question_Id equals actions.Mat_Question_Id
join o in _context.ISE_ACTIONS_FINDINGS on new { Mat_Question_Id = questions.Mat_Question_Id, Finding_Id = observation_id }
equals new { Mat_Question_Id = o.Mat_Question_Id, Finding_Id = o.Finding_Id }
into overrides
from o in overrides.DefaultIfEmpty()
orderby questions.Mat_Question_Id ascending
where questions.Parent_Question_Id == parentId
select new { actions = actions, overrides = o };
foreach (var row in table.ToList())
Expand Down
41 changes: 22 additions & 19 deletions CSETWebApi/CSETWeb_Api/CSETWebCore.Helpers/UserAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,30 @@ public LoginResponse AuthenticateStandalone(Login login, ITokenManager tokenMana
// Read the file system for the LOCAL-INSTALLATION file put there at install time
if (!_localInstallationHelper.IsLocalInstallation())
{
// this is not a local install. Return what we know about this user.
var loginUser = _context.USERS.Where(x => x.UserId == int.Parse(tokenManager.Payload("userid"))).FirstOrDefault();

if (loginUser != null)
// this is not a local install. Return what we know about this user (if anything).
if (tokenManager.Payload("userid") != null)
{
var respUser = new LoginResponse
var loginUser = _context.USERS.Where(x => x.UserId == int.Parse(tokenManager.Payload("userid"))).FirstOrDefault();

if (loginUser != null)
{
UserId = loginUser.UserId,
Email = login.Email,
Lang = loginUser.Lang,
UserFirstName = loginUser.FirstName,
UserLastName = loginUser.LastName,
IsSuperUser = loginUser.IsSuperUser,
ResetRequired = loginUser.PasswordResetRequired ?? true,
ExportExtension = IOHelper.GetExportFileExtension(login.Scope),
ImportExtensions = IOHelper.GetImportFileExtensions(login.Scope),
LinkerTime = new BuildNumberHelper().GetLinkerTime(),
IsFirstLogin = loginUser.IsFirstLogin ?? false
};

return respUser;
var respUser = new LoginResponse
{
UserId = loginUser.UserId,
Email = login.Email,
Lang = loginUser.Lang,
UserFirstName = loginUser.FirstName,
UserLastName = loginUser.LastName,
IsSuperUser = loginUser.IsSuperUser,
ResetRequired = loginUser.PasswordResetRequired ?? true,
ExportExtension = IOHelper.GetExportFileExtension(login.Scope),
ImportExtensions = IOHelper.GetImportFileExtensions(login.Scope),
LinkerTime = new BuildNumberHelper().GetLinkerTime(),
IsFirstLogin = loginUser.IsFirstLogin ?? false
};

return respUser;
}
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ export class MergeExaminationsComponent implements OnInit {
this.questionSvc.getDetails(parentId, 'Maturity').subscribe(
(details) => {
let myIssues = [];
details.findings.forEach(find => {
myIssues.push(find);
details.observations.forEach(obs => {
myIssues.push(obs);
});

if (myIssues.length > 0) {
Expand Down Expand Up @@ -350,13 +350,13 @@ export class MergeExaminationsComponent implements OnInit {
issueArray.forEach((issue, index) => {
let actionItemsOverride: ActionItemText[] = [];

this.questionSvc.getActionItems(parentKey, issue.finding_Id).subscribe((data: any) => {
this.questionSvc.getActionItems(parentKey, issue.observation_Id).subscribe((data: any) => {

for (let i = 0; i < data.length; i++) {
actionItemsOverride.push({ Mat_Question_Id: data[i].question_Id, ActionItemOverrideText: data[i].action_Items });
}

issue.finding_Id = 0;
issue.observation_Id = 0;
issue.answer_Id = this.newAnswerIds.get(parentKey);

this.observationSvc.saveObservation(issue).subscribe((response: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<span class="p-md-3 p-2 fs-medium cset-icons-exclamation-triangle"></span>
<span class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a">

<div class="mt-2 mr-4">Some reports are disabled until all issues are resolved</div>
<br />

<div class="mt-2 mr-4" *ngIf="!isAssessmentPageFilled()">
The following required fields are missing from the "Demographics" page:
<ul class="list-type">
Expand Down Expand Up @@ -110,286 +113,4 @@
</div>
</div>
</div>
</div>




<!--
<div *ngIf="disableIseReportLinks || ncuaSvc.unassignedIssues
|| (!isAssessmentPageFilled() && !assessSvc.assessment.isE_StateLed); else readyToSubmit"
class="alert-warning mt-2 mb-2 d-flex flex-row justify-content-center align-items-center flex-11a ng-star-inserted">
<span class="p-md-3 p-2 fs-medium cset-icons-exclamation-triangle"></span>
Don't submit to MERIT without a Credit Union name or asset value above $0
If state-led, we don't care about the submit button, because it's hidden
<span *ngIf="!isAssessmentPageFilled()" class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a">
<div class="!ncuaSvc.isE_StateLed">
<span class="mt-2 mr-4" *ngIf="!disableIseReportLinks && !ncuaSvc.unassignedIssues">
"Submit" button is disabled until all required fields on <br>the
"Demographics" page have been specified.
<br><br>
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
</span>
</div>
<div class="ncuaSvc.isE_StateLed">
<span class="mt-2 mr-4" *ngIf="!disableIseReportLinks && !ncuaSvc.unassignedIssues">
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
</span>
</div>
<span *ngIf="disableIseReportLinks">
have all 3 types of warnings
<span *ngIf="ncuaSvc.unassignedIssues"><br />
non-state-led
<span *ngIf="!assessSvc.assessment.isE_StateLed">
"Submit" button and some reports are disabled until
<ul class="list-type">
<li>all required fields on the "Demographics" page have been specified,</li>
<li>all statements have been answered, and</li>
<li>all Issues have an "Issue Type" assigned.</li>
</ul>
<br>
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
</span>
state-led
<span class="mt-2 mr-4" *ngIf="assessSvc.assessment.isE_StateLed">
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
There are unanswered statements. Some domains will be incomplete.
<br /><br />
Some reports are disabled until all Issues have
an "Issue Type" assigned.<br /><br />
</span>
singular
<span *ngIf="ncuaSvc.unassignedIssueTitles.length == 1">
Assign an "Issue Type" to the following issue which was
<br />generated on the "Statements" page:
</span>
plural
<span *ngIf="ncuaSvc.unassignedIssueTitles.length > 1">
Assign an "Issue Type" to the following issues which were
<br />generated on the "Statements" page:
</span>
<ul class="list-type">
<span *ngFor="let title of ncuaSvc.unassignedIssueTitles; let i = index">
<li>{{ title }}</li>
</span>
</ul>
</span>
Assessment Config and Unanswered Statements
<span *ngIf="!ncuaSvc.unassignedIssues">
non-state-led
<span *ngIf="!assessSvc.assessment.isE_StateLed">
<br />"Submit" button and some reports are disabled until
<ul class="list-type">
<li>all required fields on the "Demographics" page have been specified and</li>
<li>all statements have been answered.</li>
</ul>
<br>
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
</span>
state-led
<span *ngIf="assessSvc.assessment.isE_StateLed">
<span class="mt-2 mr-4">
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
There are unanswered statements. Some domains will be incomplete.
</span>
</span>
</span>
</span>
</span>
<span *ngIf="disableIseReportLinks && !ncuaSvc.unassignedIssues && isAssessmentPageFilled()">
Submit and reports disabled because unanswered statements
<span *ngIf="!assessSvc.assessment.isE_StateLed && isAssessmentPageFilled(); else stateLedUnanswered"
class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a">
"Submit" button and some reports are disabled until all statements have been answered.
</span>
can get here in the case it's state-led and isAssessmentPageFilled() is false
<span *ngIf="assessSvc.assessment.isE_StateLed"
class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a">
<span class="mt-2 mr-4">
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
There are unanswered statements. Some domains will be incomplete.
</span>
</span>
</span>
only Issue Type warning
<span *ngIf="(!disableIseReportLinks && ncuaSvc.unassignedIssues) && isAssessmentPageFilled()"
class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a">
non-state-led
<span *ngIf="!assessSvc.assessment.isE_StateLed">
<br />"Submit" button and some reports are disabled until all
Issues have an "Issue Type" assigned.<br /><br />
</span>
state-led
<span *ngIf="assessSvc.assessment.isE_StateLed">
<br />Some reports are disabled until all
Issues have an "Issue Type" assigned.<br /><br />
</span>
singular
<span *ngIf="ncuaSvc.unassignedIssueTitles.length == 1">
Assign an "Issue Type" to the following issue which was
<br />generated on the "Statements" page:
</span>
plural
<span *ngIf="ncuaSvc.unassignedIssueTitles.length > 1">
Assign an "Issue Type" to the following issues which were
<br />generated on the "Statements" page:
</span>
<ul class="list-type">
<span *ngFor="let title of ncuaSvc.unassignedIssueTitles; let i = index">
<li>{{ title }}</li>
</span>
</ul>
</span>
Unanswered Statements and Issue Types (also with state-led and Issue Type)
<span *ngIf="ncuaSvc.unassignedIssues && disableIseReportLinks && isAssessmentPageFilled()"
class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a"><br />
Unanswered and Issue Type for non-state-led
<span *ngIf="!assessSvc.assessment.isE_StateLed">
"Submit" button and some reports are disabled until
<ul class="list-type">
<li>all statements have been answered and</li>
<li>all Issues have an "Issue Type" assigned.</li>
</ul>
</span>
Unanswered and Issue Type for state-led
<span *ngIf="assessSvc.assessment.isE_StateLed">
There are unanswered statements. Some domains will be incomplete.
<br /><br />
Some reports are disabled until all Issues have
an "Issue Type" assigned.<br /><br />
</span>
singular
<span *ngIf="ncuaSvc.unassignedIssueTitles.length == 1">
Assign an "Issue Type" to the following issue which was
<br />generated on the "Statements" page:
</span>
plural
<span *ngIf="ncuaSvc.unassignedIssueTitles.length > 1">
Assign an "Issue Type" to the following issues which were
<br />generated on the "Statements" page:
</span>
<ul class="list-type">
<span *ngFor="let title of ncuaSvc.unassignedIssueTitles; let i = index">
<li>{{ title }}</li>
</span>
</ul>
</span>
Assessment Config and Issue Types
<span *ngIf="!isAssessmentPageFilled() && ncuaSvc.unassignedIssues && !disableIseReportLinks"
class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a"><br />
Assessment Config and Issue Type for non-state-led
<span *ngIf="!assessSvc.assessment.isE_StateLed">
"Submit" button and some reports are disabled until
<ul class="list-type">
<li>all required fields on the "Demographics" page have been specified and</li>
<li>all Issues have an "Issue Type" assigned.</li>
</ul>
<br>
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
<br>
</span>
Unanswered and Issue Type for state-led
<span *ngIf="assessSvc.assessment.isE_StateLed">
<span class="mt-2 mr-4">
<span>The following required fields are missing from the "Demographics" page:</span>
<ul class="list-type">
<span *ngFor="let field of missingFields; let i = index">
<li>{{ field }}</li>
</span>
</ul>
</span><br>
Some reports are disabled until all Issues have
an "Issue Type" assigned<br /><br />
</span>
singular
<span *ngIf="ncuaSvc.unassignedIssueTitles.length == 1">
Assign an "Issue Type" to the following issue which was
<br />generated on the "Statements" page:
</span>
plural
<span *ngIf="ncuaSvc.unassignedIssueTitles.length > 1">
Assign an "Issue Type" to the following issues which were
<br />generated on the "Statements" page:
</span>
<ul class="list-type">
<span *ngFor="let title of ncuaSvc.unassignedIssueTitles; let i = index">
<li>{{ title }}</li>
</span>
</ul>
</span>
</div>
If no warnings exist that disable the "Submit" button, check if it has already been submitted
(or if it's state-led and doesn't need a reminder to submit)
<ng-template #readyToSubmit>
<div *ngIf="(!iseHasBeenSubmitted && !ncuaSvc.iseHasBeenSubmitted) && !ncuaSvc.ISE_StateLed"
class="alert-warning mt-2 mb-2 d-flex flex-row justify-content-center align-items-center flex-11a ng-star-inserted">
<span class="p-md-3 p-2 fs-medium cset-icons-exclamation-triangle"></span>
<div class="fs-base-2 p-2 d-flex flex-column justify-content-center flex-11a">
This assessment has not been submitted yet. If this assessment is complete, please click submit.
</div>
</div>
</ng-template>
-->
</div>
Loading

0 comments on commit b11515a

Please sign in to comment.