Skip to content

Commit de1d04d

Browse files
Merge pull request #4719 from cisagov/bug/reports-non-workflow
Refactor of CISA Assessor variable. Reports page tied to that now
2 parents 74c8816 + 3f7eb95 commit de1d04d

File tree

13 files changed

+25
-25
lines changed

13 files changed

+25
-25
lines changed

CSETWebNg/src/app/assessment/prepare/assessment-info/assessment-config-iod/assessment-config-iod.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h5>{{ assessment.typeTitle || 'Blank Assessment' }}</h5>
108108

109109
<div class="mt-4">
110110
<h4>{{ t('assessment settings') }}</h4>
111-
<div *ngIf="this.configSvc.cisaAssessorWorkflow; else content"
111+
<div *ngIf="this.configSvc.userIsCisaAssessor; else content"
112112
class="d-flex align-items-center flex-00a ms-auto me-5" style="margin-top:-5px;">
113113
<div class="d-flex align-items-center me-3 pt-2">{{ t('protected features.cisa assessor workflow') }}</div>
114114
<div class="mb-2">

CSETWebNg/src/app/assessment/prepare/assessment-info/assessment-config-iod/assessment-config-iod.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class AssessmentConfigIodComponent implements OnInit {
9595
this.assessment.pciiNumber = null;
9696
}
9797

98-
this.configSvc.cisaAssessorWorkflow = true;
98+
this.configSvc.userIsCisaAssessor = true;
9999
this.assessSvc.updateAssessmentDetails(this.assessment);
100100
}
101101
}

CSETWebNg/src/app/assessment/prepare/assessment-info/assessment-detail/assessment-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h5>{{ assessment.typeTitle || 'Blank Assessment' }}</h5>
7575
</div>
7676

7777
</div>
78-
<div *ngIf="this.configSvc.cisaAssessorWorkflow" class="mt-4">
78+
<div *ngIf="this.configSvc.userIsCisaAssessor" class="mt-4">
7979
<h4>{{ t('assessment settings') }}</h4>
8080
<div class="d-flex align-items-center flex-00a ms-auto me-5" style="margin-top:-5px;">
8181
<div class="d-flex align-items-center me-3 pt-2">{{ t('protected features.cisa assessor workflow') }}</div>

CSETWebNg/src/app/assessment/prepare/assessment-info/demographics-iod/demographics-iod.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export class DemographicsIodComponent implements OnInit {
140140
*
141141
*/
142142
updateDemographics() {
143-
this.configSvc.cisaAssessorWorkflow = true;
143+
this.configSvc.userIsCisaAssessor = true;
144144
this.demographicData.sectorDirective = 'NIPP';
145145

146146
// keep a few things in sync

CSETWebNg/src/app/assessment/results/reports/reports.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,20 @@ export class ReportsComponent implements OnInit, AfterViewInit {
133133
this.router.navigate([value], { relativeTo: this.route.parent });
134134
});
135135

136-
if (this.configSvc.installationMode === 'IOD') {
136+
if (this.configSvc.installationMode === 'IOD' && this.assessSvc.assessment.assessorMode) {
137137
this.reportSvc.validateCisaAssessorFields().subscribe((result: CisaWorkflowFieldValidationResponse) => {
138138
this.cisaAssessorWorkflowFieldValidation = result;
139139
if (!this.cisaAssessorWorkflowFieldValidation?.isValid) {
140140
this.disableEntirePage = true;
141141
}
142142
});
143143
}
144-
144+
145145
this.assessSvc.getLastModified().subscribe((data: any) => {
146146
this.lastModifiedTimestamp = data.lastModifiedDate;
147147
});
148-
149-
this.configSvc.getCisaAssessorWorkflow().subscribe((resp: boolean) => this.configSvc.cisaAssessorWorkflow = resp);
148+
149+
this.configSvc.getCisaAssessorWorkflow().subscribe((resp: boolean) => this.configSvc.userIsCisaAssessor = resp);
150150

151151
this.updateSectionId();
152152
}

CSETWebNg/src/app/assessment/upgrade/upgrade.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class UpgradeComponent implements OnInit {
164164
this.iodDemoSvc.getDemographics().subscribe((data: any) => {
165165
this.iodDemographics = data;
166166
});
167-
if (this.configSvc.cisaAssessorWorkflow == true) {
167+
if (this.configSvc.userIsCisaAssessor == true) {
168168
this.csiSvc.getCsiServiceDemographic().subscribe((result: CsiServiceDemographic) => {
169169
this.csiServiceDemographic = result;
170170
});
@@ -187,7 +187,7 @@ export class UpgradeComponent implements OnInit {
187187
this.assessment.galleryItemGuid = this.assessSvc.galleryItemGuid.toLowerCase()
188188
this.demoSvc.updateDemographic(this.demographicData);
189189
this.iodDemoSvc.updateDemographic(this.iodDemographics);
190-
if (this.configSvc.cisaAssessorWorkflow == true) {
190+
if (this.configSvc.userIsCisaAssessor == true) {
191191
this.csiSvc.updateCsiServiceDemographic(this.csiServiceDemographic);
192192
this.csiSvc.updateCsiServiceComposition(this.serviceComposition);
193193
}

CSETWebNg/src/app/dialogs/user-settings/user-settings.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class UserSettingsComponent implements OnInit {
4747
this.encryption = result
4848
});
4949
this.configSvc.getCisaAssessorWorkflow().subscribe((cisaWorkflowEnabled: boolean) => {
50-
this.configSvc.cisaAssessorWorkflow = cisaWorkflowEnabled;
50+
this.configSvc.userIsCisaAssessor = cisaWorkflowEnabled;
5151
this.cisaWorkflowEnabled = cisaWorkflowEnabled;
5252
this.cisaWorkflowStatusLoaded = true;
5353
});

CSETWebNg/src/app/initial/my-assessments/my-assessments.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class MyAssessmentsComponent implements OnInit {
139139
}
140140

141141

142-
this.configSvc.getCisaAssessorWorkflow().subscribe((resp: boolean) => this.configSvc.cisaAssessorWorkflow = resp);
142+
this.configSvc.getCisaAssessorWorkflow().subscribe((resp: boolean) => this.configSvc.userIsCisaAssessor = resp);
143143
}
144144

145145
/**
@@ -162,7 +162,7 @@ export class MyAssessmentsComponent implements OnInit {
162162
}
163163

164164
if (column == 'export json') {
165-
return this.configSvc.cisaAssessorWorkflow;
165+
return this.configSvc.userIsCisaAssessor;
166166
}
167167

168168
return true;

CSETWebNg/src/app/services/assessment.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class AssessmentService {
233233
headers
234234
)
235235
.subscribe(() => {
236-
if (this.configSvc.cisaAssessorWorkflow) {
236+
if (this.configSvc.userIsCisaAssessor) {
237237
this.updateAssessmentName();
238238
}
239239
});

CSETWebNg/src/app/services/config.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class ConfigService {
9999
* will contain an empty string or "none".
100100
*/
101101
mobileEnvironment = '';
102-
cisaAssessorWorkflow: boolean = false;
102+
userIsCisaAssessor: boolean = false;
103103

104104
/**
105105
* Constructor.
@@ -346,7 +346,7 @@ export class ConfigService {
346346
}
347347

348348
setCisaAssessorWorkflow(cisaAssessorWorkflowEnabled: boolean) {
349-
this.cisaAssessorWorkflow = cisaAssessorWorkflowEnabled;
349+
this.userIsCisaAssessor = cisaAssessorWorkflowEnabled;
350350
return this.http.post(this.apiUrl + 'EnableProtectedFeature/setCisaAssessorWorkflow', cisaAssessorWorkflowEnabled);
351351
}
352352

CSETWebNg/src/app/services/demographic-iod.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class DemographicIodService {
7777
updateDemographic(demographic: DemographicsIod) {
7878
this.http.post(this.apiUrl, demographic, headers)
7979
.subscribe(() => {
80-
if (this.configSvc.cisaAssessorWorkflow) {
80+
if (this.configSvc.userIsCisaAssessor) {
8181
this.assessSvc.updateAssessmentName();
8282
}
8383
});

CSETWebNg/src/app/services/demographic.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class DemographicService {
9292

9393
this.http.post(this.apiUrl, JSON.stringify(demographic), headers)
9494
.subscribe(() => {
95-
if (this.configSvc.cisaAssessorWorkflow) {
95+
if (this.configSvc.userIsCisaAssessor) {
9696

9797
}
9898
});

CSETWebNg/src/app/services/navigation/page-visibility.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,18 @@ export class PageVisibilityService {
153153
}
154154

155155
if (c == ('ASSESSOR')) {
156-
if (this.configSvc.cisaAssessorWorkflow) {
157-
show = show && (this.configSvc.cisaAssessorWorkflow && this.assessSvc.assessment?.assessorMode);
156+
if (this.configSvc.userIsCisaAssessor) {
157+
show = show && (this.configSvc.userIsCisaAssessor && this.assessSvc.assessment?.assessorMode);
158158
} else {
159-
show = show && (this.configSvc.cisaAssessorWorkflow !== this.assessSvc.assessment?.assessorMode);
159+
show = show && (this.configSvc.userIsCisaAssessor !== this.assessSvc.assessment?.assessorMode);
160160
}
161161
}
162162

163163
if (c == ('ASSESSOR-NONE')) {
164-
if (this.configSvc.cisaAssessorWorkflow) {
165-
show = show && !(this.configSvc.cisaAssessorWorkflow && this.assessSvc.assessment?.assessorMode);
164+
if (this.configSvc.userIsCisaAssessor) {
165+
show = show && !(this.configSvc.userIsCisaAssessor && this.assessSvc.assessment?.assessorMode);
166166
} else {
167-
show = show && !(this.configSvc.cisaAssessorWorkflow !== this.assessSvc.assessment?.assessorMode);
167+
show = show && !(this.configSvc.userIsCisaAssessor !== this.assessSvc.assessment?.assessorMode);
168168
}
169169
}
170170

@@ -344,7 +344,7 @@ export class PageVisibilityService {
344344
* Indicates whether the current user is a CISA CSA / assessor
345345
*/
346346
isUserCisaAssessor(): boolean {
347-
return this.configSvc.cisaAssessorWorkflow;
347+
return this.configSvc.userIsCisaAssessor;
348348
}
349349

350350
/**

0 commit comments

Comments
 (0)