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

Internationalization to "extras." Refactored filtering #3732

Merged
merged 1 commit into from
Feb 7, 2024
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 @@ -20,7 +20,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-------------------------->
<div class="white-panel">
<div class="white-panel" *transloco="let t">

<div id="top"></div>
<div class="d-flex flex-row flex-wrap justify-content-between align-items-start flex-11a mb-4">
Expand All @@ -40,9 +40,9 @@
</div>

<h3>
Diagram Component Questions
{{t('titles.diagram component questions')}}
</h3>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">Showing Only Filtered Questions</div>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">{{t('filterMenu.showing only filtered')}}</div>

<div *ngIf="!categories" class="w-100">
<div class="spinner-container" style="margin: 2em auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2>{{ t('acet.statements') }}</h2>
</div>
</div>

<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">Showing Only Filtered Questions</div>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">{{t('filterMenu.showing only filtered')}}</div>

<div *ngIf="!groupings" class="w-100">
<div class="spinner-container" style="margin: 2em auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<h2>{{ statementLevel }}</h2>
</div>

<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">Showing Only Filtered Questions</div>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">{{t('filterMenu.showing only filtered')}}</div>

<ng-container *ngIf="this.assessSvc.isISE(); else notIse">
<div *ngIf="!this.ncuaSvc.issuesFinishedLoading || !groupings" class="w-100">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h3>{{ groupingTitle }}</h3>
</span>
</div>

<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">Showing Only Filtered Questions</div>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">{{t('filterMenu.showing only filtered')}}</div>

<div *ngIf="maturityFilteringSvc.showingAboveMaturityTargetLevel()" class="filters-engaged">Including Questions
Above Target Level</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@
<div *ngIf=" !!extras && !!tab && mode == 'COMPONENT'" class="detail">
<table>
<tr>
<th>Component Type</th>
<th>Override Component Answer</th>
<th>{{t('extras.component type')}}</th>
<th>{{t('extras.override component answer')}}</th>
</tr>
<tr *ngFor="let componentType of tab?.componentTypes">
<td>{{componentType.symbol_Name}}</td>
<td>
<div class="text-right">
<button *ngIf="componentType.enabled; else noOverride"
class="btn btn-link btn-link-dark" style="padding: 0; margin: 0;"
(click)="this.showOverrideDialog(componentType)">Override</button>
(click)="this.showOverrideDialog(componentType)">{{t('extras.override')}}</button>
</div>
<ng-template #noOverride>
<div class="text-right">None</div>
<div class="text-right">{{t('extras.none')}}</div>
</ng-template>
</td>
</tr>
Expand All @@ -199,26 +199,26 @@
<ng-template #detailTab>
<div *ngIf="!!extras && !!tab && mode == 'DETAIL' && !checkForApproach(tab?.requirementsData?.examinationApproach)"
class="detail">
<div><span class="reqlabel">Title: </span>{{tab?.requirementFrameworkTitle}}</div>
<div *ngIf="tab?.relatedFrameworkCategory"><span class="reqlabel">Category:
<div><span class="reqlabel">{{t('extras.title')}}: </span>{{tab?.requirementFrameworkTitle}}</div>
<div *ngIf="tab?.relatedFrameworkCategory"><span class="reqlabel">{{t('extras.category')}}:
</span>{{tab?.relatedFrameworkCategory}}</div>
<div *ngIf="!tab?.isMaturity && tab?.levelName && !usesRAC()">
<span class="reqlabel">Security Assurance Level (SAL): </span>{{tab?.levelName}}
<span class="reqlabel">{{t('extras.sal level')}}: </span>{{salLevel(tab?.levelName)}}
</div>

<div *ngIf="tab?.isMaturity && tab?.levelName">
<span class="reqlabel">Maturity Level: </span>{{tab?.levelName}}
<span class="reqlabel">{{t('extras.maturity level')}}: </span>{{tab?.levelName}}
</div>

<div *ngIf="!tab?.showRequirementStandards" class="reqlabel">Standard Specific Requirement:</div>
<div *ngIf="!tab?.showRequirementStandards" class="reqlabel">{{t('extras.standard specific requirement')}}:</div>
<div *ngIf="!tab?.showRequirementStandards">
<span
[innerHTML]="tab?.requirementsData?.text ? (tab.requirementsData.text | safe: 'html') : 'none'"></span>
<span *ngIf="showQuestionIds" class="debug-highlight">{{
tab?.requirementsData?.requirementID }}</span>
</div>

<div *ngIf="tab?.questionsList?.length > 0" class="reqlabel">Questions Related to this Requirement:
<div *ngIf="tab?.questionsList?.length > 0" class="reqlabel">{{t('extras.questions related to req')}}:
</div>

<div>
Expand Down Expand Up @@ -246,23 +246,23 @@
<!-- "pieces" -->

<div *ngIf="!!myQuestion.scope" class="mb-3">
<div class="sub-header-1">Scope</div>
<div class="sub-header-1">{{t('extras.scope')}}</div>
<div>
{{myQuestion.scope}}
</div>
</div>

<div *ngIf="!!myQuestion.recommendedAction" class="mb-3">
<div class="sub-header-1">
Recommended Action
{{t('extras.recommended action')}}
</div>
<div [innerHTML]="myQuestion.recommendedAction">
</div>
</div>

<div *ngIf="!!myQuestion.services" class="mb-3">
<div class="sub-header-1">
Free Services and References
{{t('extras.free services')}}
</div>
<div [innerHTML]="myQuestion.services">
</div>
Expand Down Expand Up @@ -305,13 +305,13 @@
</td>
<td>
<div class="text-nowrap">
<button (click)="showRelatedQuestions(doc)" matTooltip="Related questions"
<button (click)="showRelatedQuestions(doc)" matTooltip="{{t('tooltip.related questions')}}"
*ngIf="!tab?.isMaturity" matTooltipPosition="above" class="btn btn-link cset2-icons-q"
style="color: #285464; transform: scale(1.3);
cursor: pointer; background-color:transparent;" tabindex="0">
</button>

<button (click)="deleteDocument(doc)" matTooltip="Delete document"
<button (click)="deleteDocument(doc)" matTooltip="{{t('tooltip.delete document')}}"
matTooltipPosition="above" class="btn btn-link pt-0 pb-0"
style="margin-left: .5rem; margin-right: .5rem; padding-left: .5rem; padding-right: .5rem"
tabindex="0">
Expand All @@ -322,7 +322,7 @@
</svg>
</button>

<button (click)="download(doc)" matTooltip="Copy this document to another location."
<button (click)="download(doc)" matTooltip="{{t('tooltip.copy document')}}"
matTooltipPosition="above" class="btn btn-link cset-icons-import" style="color: #285464; transform: scale(1.3);
cursor: pointer; background-color:transparent;" tabindex="0"></button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ export class QuestionExtrasComponent implements OnInit {
}

this.showMfr = this.myOptions.showMfr;

}


}

/**
Expand Down Expand Up @@ -202,6 +199,17 @@ export class QuestionExtrasComponent implements OnInit {
});
}

/**
* Translates the level to the user's language.
* Returns empty string if no level is present.
*/
salLevel(level: string) {
if (!level) {
return '';
}
return this.tSvc.translate('titles.sal.' + level.toLowerCase());
}

/**
*
* @param e
Expand All @@ -217,7 +225,6 @@ export class QuestionExtrasComponent implements OnInit {
* @returns
*/
showDocumentsIcon(): boolean {

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<h2 *ngIf="this.assessSvc.applicationMode == 'Q'">{{t('titles.standard questions')}}</h2>
<h2 *ngIf="this.assessSvc.applicationMode == 'R'">{{t('titles.standard requirements')}}</h2>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">Showing Only Filtered Questions</div>
<div *ngIf="filterSvc.isFilterEngaged()" class="filters-engaged">{{t('filterMenu.showing only filtered')}}</div>

<div *ngIf="!categories" class="w-100">
<div class="spinner-container" style="margin: 2em auto">
Expand Down Expand Up @@ -99,8 +99,7 @@ <h2 *ngIf="this.assessSvc.applicationMode == 'R'">{{t('titles.standard requireme
class="alert-warning mt-4 mb-4 d-flex flex-row justify-content-center align-items-center flex-11a">
<span class="p-md-3 p-2 fs-large cset-icons-exclamation-triangle"></span>
<span class="fs-base-3 p-2 d-flex flex-column justify-content-center flex-11a">
There are no questions visible for the current filters or search criteria. Please change your selections and try
again.
{{t('filterMenu.no questions visible')}}
</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div *transloco="let t; read: 'filterMenu'" class="d-flex flex-column justify-content-center flex-11a">
<div class="mat-dialog-header p-3 d-flex justify-content-start align-items-center flex-00a">
<span class="mr-3 fs-base-6 cset-icons-filter" aria-label="{{ 'buttons.filter' | transloco }}"></span>
<span>{{ t(question + ' filters') }}</span>
<span>{{ t(skin + '.dialog title') }}</span>
</div>

<mat-dialog-content class="pt-3 pl-3 pr-0 oy-auto d-flex flex-column flex-11a">
Expand All @@ -45,59 +45,59 @@
<div>
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn(option.value)"
[id]="getId(option)" (click)="updateFilters($event, option.value)">
<label [for]="getId(option)" class="checkbox-custom-label d-block">
{{ t('show ' + questions + ' answered') }} <em><strong>{{option.text}}</strong></em>
<label [for]="getId(option)" class="checkbox-custom-label d-block" [innerHTML]="t(skin + '.show answered as', {'optionText': option.text })">
</label>
</div>
</div>
<div *ngIf="usesMaturityModel('VADR')">
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('FR')" id="cbShowFreeResponse"
name="cbShowFreeResponse" (click)="updateFilters($event, 'FR')">
<label for="cbShowFreeResponse" class="checkbox-custom-label d-block">
Show answered Open Ended {{questions}}
{{ t(skin + '.show open ended') }}

</label>
</div>
<div>
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('U')" id="cbShowU" name="cbShowU"
(click)="updateFilters($event, 'U')">
<label for="cbShowU" class="checkbox-custom-label d-block">
{{ t('show unanswered ' + questions) }}
{{ t(skin + '.show unanswered') }}
</label>
</div>
<div>
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('C')" id="cbShowComments"
name="cbShowComments" (click)="updateFilters($event, 'C')">
<label for="cbShowComments" class="checkbox-custom-label d-block">
{{ t('show '+ questions + ' with ' + comments) }}
{{ t(skin + '.show with comments') }}
</label>
</div>
<div *ngIf="!isInstallation('ACET')">
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('FB')" id="cbShowFeedback"
name="cbShowFeedback" (click)="updateFilters($event, 'FB')">
<label for="cbShowFeedback" class="checkbox-custom-label d-block">
Show {{questions}} with feedback
{{ t(skin + '.show with feedback') }}
</label>
</div>
<div>
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('M')" id="cbShowMarked"
name="cbShowMarked" (click)="updateFilters($event, 'M')">
<label for="cbShowMarked" class="checkbox-custom-label d-block">
{{ t('show ' + questions + ' marked for review') }}
{{ t(skin + '.show marked for review') }}
</label>
</div>
<div>
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('O')" id="cbShowObservations"
name="cbShowObservations" (click)="updateFilters($event, 'O')">
<label for="cbShowObservations" class="checkbox-custom-label d-block">
{{ t('show ' + questions + ' with ' + observations) }}
{{ t(skin + '.show with observations') }}
</label>
</div>
<hr class="mt-2 mb-2" *ngIf="showFilterAboveTargetLevel">
<div *ngIf="showFilterAboveTargetLevel">
<input class="checkbox-custom" type="checkbox" [checked]="filterSvc.filterOn('MT+')" id="cbShowAboveMatTarget"
name="cbShowAboveMatTarget" (click)="updateFilters($event, 'MT+')">
<label for="cbShowAboveMatTarget" class="checkbox-custom-label d-block">
Include {{questions}} above maturity target level
{{ t(skin + '.include above target') }}
</label>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export class QuestionFiltersComponent implements OnInit {
@Output() filterChanged = new EventEmitter<any>();

question = "Question";
questions = "questions";

/**
* Holds the word "questions" or "statements"
*/
skin = "core";
observations = "observations";
comments = "comments";
answerOptions: any[];
Expand Down Expand Up @@ -72,7 +76,7 @@ export class QuestionFiltersComponent implements OnInit {
ngOnInit(): any {
if (this.configSvc.installationMode === 'ACET') {
this.question = "Statement";
this.questions = "statements";
this.skin = "ncua";
if (this.assessSvc.isISE()) {
this.observations = "issues";
this.comments = "notes";
Expand Down
58 changes: 43 additions & 15 deletions CSETWebNg/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@
"comment": "Comment",
"artifacts documents": "Artifacts/Documents",
"artifacts documents with content": "Artifacts/Documents with Content",
"related questions": "Related questions",
"delete document": "Delete document",
"copy document": "Copy this document to another location",
"references": "References",
"observations": "Observations",
"observations with content": "Observations with content",
Expand Down Expand Up @@ -437,23 +440,35 @@
"most": "Most"
},
"filterMenu": {
"Question filters": "Question Filters",
"Statement filters": "Statement Filters",
"search": "Search",
"select deselect all": "Select/Deselect All",
"show questions answered": "Show questions answered",
"show unanswered questions": "Show unanswered questions",
"show questions with comments": "Show questions with comments",
"show questions with notes": "Show questions with notes",
"show questions marked for review": "Show questions marked for review",
"show questions with observations": "Show questions with observations",
"show statements answered": "Show statements answered",
"show unanswered statements": "Show unanswered statements",
"show statements with comments": "Show statements with comments",
"show statements with notes": "Show statements with notes",
"show statements marked for review": "Show statements marked for review",
"show statements with observations": "Show statements with observations",
"show statements with issues": "Show statements with issues"
"core": {
"dialog title": "Question Filters",
"show answered as": "Show questions answered <em><b>{{optionText}}</b></em>",
"show unanswered": "Show unanswered questions",
"show with comments": "Show questions with comments",
"show with feedback": "Show questions with feedback",
"show with notes": "Show questions with notes",
"show marked for review": "Show questions marked for review",
"show with observations": "Show questions with observations",
"include above target": "Include questions above maturity target level",
"show open ended": "Show answered open-ended questions"
},
"ncua": {
"dialog title": "Statement Filters",
"show answered as": "Show statements answered <em><b>{{optionText}}</b></em>",
"show unanswered": "Show unanswered statements",
"show with comments": "Show statements with comments",
"show with feedback": "Show statements with feedback",
"show with notes": "Show statements with notes",
"show marked for review": "Show statements marked for review",
"show with observations": "Show statements with observations",
"show with issues": "Show statements with issues",
"include above target": "Include statements above maturity target level",
"show open ended": "Show answered open-ended statements"
},
"showing only filtered": "Showing Only Filtered Questions",
"no questions visible": "There are no questions visible for the current filters or search criteria. Please change your selections and try again."
},
"dialogs": {
"please confirm": "Please Confirm",
Expand Down Expand Up @@ -639,6 +654,19 @@
"no feedback exists": "There is no feedback for any question in this assessment."
},
"extras": {
"title": "Title",
"category": "Category",
"sal level": "Security Assurance Level (SAL)",
"maturity level": "Maturity Level",
"standard specific requirement": "Standard Specific Requirement",
"questions related to req": "Questions Related to this Requirement",
"scope": "Scope",
"recommended action": "Recommended Action",
"free services": "Free Services and References",
"component type": "Component Type",
"override component answer": "Override Component Answer",
"override": "Override",
"none": "None",
"artifact title": "Artifact/Document Title",
"file name": "File Name",
"source documents": "Source Documents",
Expand Down
Loading
Loading