Skip to content

Commit

Permalink
Merge pull request #350 from GOKULRAJ136/MOSIP-36172
Browse files Browse the repository at this point in the history
MOSIP-37914 : Resolved reliability and security hotspots for admin-ui
  • Loading branch information
aranaravi authored Jan 9, 2025
2 parents 6e71a87 + 0ba1e89 commit 3929305
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ <h3>{{labelanddatas.title |translate}}</h3>
{{'genericerror.fieldValidation' | translate}}
</mat-error>
</mat-form-field>
<mat-label style="width:2%" *ngIf="showDownloadBtn" (click)="downloadCSV()"><img src="assets/images/download-csv.png" alt="Download CSV" height="18px" width="18px" style="cursor:pointer;" /></mat-label>
<mat-label style="width:2%" *ngIf="showDownloadBtn" (click)="downloadExcel()"><img src="assets/images/download-excel.png" alt="Download Excel" height="18px" width="18px" style="cursor:pointer;" /></mat-label>
<mat-label style="width:2%" *ngIf="showDownloadBtn" (click)="downloadCSV()" (keypress)="downloadCSV()"><img src="assets/images/download-csv.png" alt="Download CSV" height="18px" width="18px" style="cursor:pointer;" /></mat-label>
<mat-label style="width:2%" *ngIf="showDownloadBtn" (click)="downloadExcel()" (keypress)="downloadExcel()"><img src="assets/images/download-excel.png" alt="Download Excel" height="18px" width="18px" style="cursor:pointer;" /></mat-label>
</div>
<!-- <div class="custom-file-input">
<input type="button" *ngIf="buttonalignment === 'rtl'" value="{{labelanddatas.chooseFile | translate }}" class="browseInput">
Expand All @@ -62,7 +62,7 @@ <h3>{{labelanddatas.title |translate}}</h3>
{{'genericerror.fieldValidation' | translate}}
</mat-error>
</div> -->
<label class="labelfileupload">{{'uploadcertificate.uploadYourFile' | translate}} <span style="color:red;">*</span></label>
<label class="labelfileupload" for="fileInput">{{'uploadcertificate.uploadYourFile' | translate}} <span style="color:red;">*</span></label>
<div class="fileuploadcontainer" appDnd (fileDropped)="onFileDropped($event)" id="custom-file-input">
<input (click)="$event.target.value=null" type="file" accept=".xlsx, .xls, .csv" #fileInput id="fileInput" (change)="onFileSelect($event)"/>
<label style="margin-right: 1rem;display: flex;" for="fileInput">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h3>{{'packet-upload.header' | translate}}</h3>
{{'genericerror.fieldValidation' | translate}}
</mat-error>
</mat-form-field>
<label class="labelfileupload">{{'uploadcertificate.uploadYourFile' | translate}} <span style="color:red;">*</span></label>
<label class="labelfileupload" for="fileInput">{{'uploadcertificate.uploadYourFile' | translate}} <span style="color:red;">*</span></label>
<div class="fileuploadcontainer" appDnd (fileDropped)="onFileDropped($event)" id="custom-file-input">
<input (click)="$event.target.value=null" type="file" #fileInput id="fileInput" (change)="onFileSelect($event)"/>
<label style="margin-right: 1rem;display: flex;" for="fileInput">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<mat-form-field class="packet-status__input-placer">
<input matInput placeholder="Enter Registration ID" [(ngModel)]="id"/>
</mat-form-field>
<img src="./assets/images/search.png" (click)="search()" alt="search" class="packet-status__image-placer" height="20px" width="20px">
<img src="./assets/images/search.png" (click)="search()" alt="search" class="packet-status__image-placer" height="20px" width="20px" (keypress)="search()">
<mat-error style="margin-left: 30px ;font-size: 9.5px" *ngIf="error">{{'download-card.error' | translate}}</mat-error>
</mat-card>
<mat-card *ngIf="showDetails" style="border-radius: 0;margin-top: 20px;">
Expand All @@ -37,7 +37,7 @@
</tr>
</thead>
<tr>
<td><img style="width: 150px;height: 200px;" [src]="applicantPhoto" alt="Applicant Photo"></td>
<td><img style="width: 150px;height: 200px;" [src]="applicantPhoto" alt="Applicant"></td>
<td>
<table>
<caption>Download Card Details</caption>
Expand All @@ -59,8 +59,8 @@
<tr>
<td>
<mat-button-toggle-group name="favoriteColor" aria-label="Favorite Color">
<mat-button-toggle (click)="captureSelection('true')" value="true"><mat-icon style="color: green;">check</mat-icon>&nbsp;&nbsp;{{'download-card.verifyanddownload' | translate}}</mat-button-toggle>
<mat-button-toggle (click)="captureSelection('false')" value="flase"><mat-icon style="color:red;">clear</mat-icon>&nbsp;&nbsp;{{'download-card.reject' | translate}}</mat-button-toggle>
<mat-button-toggle (click)="captureSelection('true')" value="true" (keypress)="captureSelection('true')"><mat-icon style="color: green;">check</mat-icon>&nbsp;&nbsp;{{'download-card.verifyanddownload' | translate}}</mat-button-toggle>
<mat-button-toggle (click)="captureSelection('false')" value="false" (keypress)="captureSelection('false')"><mat-icon style="color:red;">clear</mat-icon>&nbsp;&nbsp;{{'download-card.reject' | translate}}</mat-button-toggle>
</mat-button-toggle-group>
</td>
<th id="actionHeader">Action</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export class DownloadCardComponent implements OnInit {
}

renderImage(){
this.applicantPhoto = this.sanitizer.bypassSecurityTrustUrl(this.data.applicantPhoto);
const trustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.applicantPhoto);
this.applicantPhoto = trustedUrl;
}

search() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h4>{{'masterData.doc-category-mapping'|translate}}<span></span></h4>
<ul class="unOrderList">
<ng-container *ngFor="let categoryList of allDocCategoryList; let i = index">
<li class="list" [ngClass]="{'active': selectedItem === categoryList?.code}"
(click)="onCategory(categoryList)">
(click)="onCategory(categoryList)" (keypress)="onCategory(categoryList)">
<span>{{categoryList?.name}}({{categoryList?.code}})</span>
<span><em class="material-icons">
keyboard_arrow_right
Expand All @@ -47,7 +47,7 @@ <h4>{{'masterData.doc-category-mapping'|translate}}<span></span></h4>
<ng-container *ngFor="let mappedItem of mappedDocList; let i = index">
<li class="list">
<span>{{mappedItem?.name}}</span>
<span><em class="material-icons" (click)="onClose(mappedItem, i)">
<span><em class="material-icons" (click)="onClose(mappedItem, i)" (keypress)="onClose(mappedItem, i)">
close
</em></span></li>
</ng-container>
Expand All @@ -62,7 +62,7 @@ <h4>{{'masterData.doc-category-mapping'|translate}}<span></span></h4>
<ng-container *ngFor="let unMappedItem of unMappedDocList; let i = index">
<li class="list">
<span>{{unMappedItem?.name}}</span>
<span><em class="material-icons" (click)="onAdd(unMappedItem, i)">
<span><em class="material-icons" (click)="onAdd(unMappedItem, i)" (keypress)="onAdd(unMappedItem, i)">
add
</em></span></li>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<strong>{{'masterData.common' | translate}}</strong>
</mat-card-header>
<ng-container *ngFor="let itemList of masterDataCommonList; let i = index">
<mat-card-content class="content" [style.marginTop.px]="i === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}">
<mat-card-content class="content" [style.marginTop.px]="i === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}" (keypress)="onList(itemList)">
<span style="margin-top: 5px; margin-left: 5px;">{{itemList?.label[primaryLang]}}</span>
<span style="text-align: right"><em class="material-icons">
{{arrowDirection}}
Expand All @@ -27,15 +27,15 @@
<strong>{{'masterData.dynamicField' | translate}}</strong>
</mat-card-header>
<ng-container>
<mat-card-content class="content" (click)="dynamicFeildAdd()" id="createDynamicField">
<mat-card-content class="content" (click)="dynamicFeildAdd()" id="createDynamicField" (keypress)="dynamicFeildAdd()">
<span style="margin-top: 5px; margin-left: 5px;"><strong>{{'masterData.createDynamicField' | translate}}</strong></span>
<span style="text-align: right"><em class="material-icons">
add
</em></span>
</mat-card-content>
</ng-container>
<ng-container *ngFor="let itemList of dynamicfieldDistinctValue; let i = index">
<mat-card-content class="content" [style.marginTop.px]="i === 0 ? 10:0" (click)="dynamicFeildNavigate(itemList)" id="{{itemList.description}}">
<mat-card-content class="content" [style.marginTop.px]="i === 0 ? 10:0" (click)="dynamicFeildNavigate(itemList)" id="{{itemList.description}}" (keypress)="dynamicFeildNavigate(itemList)">
<span style="margin-top: 5px; margin-left: 5px;">
<span *ngIf="itemList.description">{{itemList.description}}</span>
<span *ngIf="!itemList.description">{{itemList.name}}</span>
Expand All @@ -57,7 +57,7 @@
<strong>{{'masterData.device-definition' | translate}}</strong>
</mat-card-header>
<ng-container *ngFor="let itemList of masterDataDeviceList; let j = index">
<mat-card-content class="content" [style.marginTop.px]="j === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}">
<mat-card-content class="content" [style.marginTop.px]="j === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}" (keypress)="onList(itemList)">
<span style="margin-top: 5px; margin-left: 5px;">{{itemList?.label[primaryLang]}}</span>
<span style="text-align: right"><em class="material-icons">
{{arrowDirection}}
Expand All @@ -72,7 +72,7 @@
<strong>{{'masterData.machine-definition' | translate}}</strong>
</mat-card-header>
<ng-container *ngFor="let itemList of masterDataMachineList; let k = index">
<mat-card-content class="content" [style.marginTop.px]="k === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}">
<mat-card-content class="content" [style.marginTop.px]="k === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}" (keypress)="onList(itemList)">
<span style="margin-top: 5px; margin-left: 5px;">{{itemList?.label[primaryLang]}}</span>
<span style="text-align: right"><em class="material-icons">
{{arrowDirection}}
Expand All @@ -87,7 +87,7 @@
<strong>{{'masterData.document-definition' | translate}}</strong>
</mat-card-header>
<ng-container *ngFor="let itemList of masterDataDocumentList; let l = index">
<mat-card-content class="content" [style.marginTop.px]="l === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}">
<mat-card-content class="content" [style.marginTop.px]="l === 0 ? 10:0" (click)="onList(itemList)" id="{{itemList.actionURL}}" (keypress)="onList(itemList)">
<span style="margin-top: 5px; margin-left: 5px;">{{itemList?.label[primaryLang]}}</span>
<span style="text-align: right"><em class="material-icons">
{{arrowDirection}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
(click)="openKeyboard('primary', primaryData.langCode)"
style="color: grey; cursor: pointer;"
[ngStyle]="isPrimaryLangRTL ? {'float':'left'} : {'float':'right'}"
(keypress)="openKeyboard('primary', primaryData.langCode)"
><em class="material-icons">keyboard</em></span
>
<hr />
Expand Down Expand Up @@ -442,6 +443,7 @@
(click)="openKeyboard('secondary', '')"
style="color: grey; cursor: pointer;"
[ngStyle]="isPrimaryLangRTL ? {'float':'left'} : {'float':'right'}"
(keypress)="openKeyboard('secondary', '')"
><em class="material-icons">keyboard</em></span
>
<hr [ngStyle]="isPrimaryLangRTL ? {'margin-top': '17px'} : {'margin-top': '0px'}" />
Expand Down Expand Up @@ -780,6 +782,7 @@
matTooltip="{{ 'center.keyboard-tooltip' | translate }}"
(click)="openKeyboard('primary','')"
style="float: right; color: grey; cursor: pointer;"
(keypress)="openKeyboard('primary','')"
><em class="material-icons">keyboard</em></span
>
<hr />
Expand Down Expand Up @@ -810,6 +813,7 @@
matTooltip="{{languageNames['keyboard-tooltip'] | translate }}"
(click)="openKeyboard('secondary', '')"
style="float: right; color: grey; cursor: pointer;"
(keypress)="openKeyboard('primary','')"
><em class="material-icons">keyboard</em></span
>
<hr />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<mat-form-field class="packet-status__input-placer">
<input matInput placeholder="{{'packet-status.input-text' | translate}}" [(ngModel)]="id"/>
</mat-form-field>
<img src="./assets/images/search.png" (click)="search()" alt="search" class="packet-status__image-placer" height="20px" width="20px">
<img src="./assets/images/search.png" (click)="search()" alt="search" class="packet-status__image-placer" height="20px" width="20px" (keypress)="search()">
<mat-error style="margin-left: 30px ;font-size: 9.5px" *ngIf="error">{{errorMessage | translate}}</mat-error>
</mat-card>
<mat-card *ngIf="showDetails" style="border-radius: 0;">
Expand All @@ -28,7 +28,7 @@
<div>
<table>
<caption>Timeline</caption>
<tr (click)="viewMore()">
<tr (click)="viewMore()" (keypress)="viewMore()">
<th id="viewMore" *ngIf="!showTimeline">{{'packet-status.viewMore' | translate}}</th>
<th id="viewLess" *ngIf="showTimeline">{{'packet-status.viewLess' | translate}}</th>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<span *ngIf="!disableForms" matTooltip="{{ 'center.keyboard-tooltip' | translate }}"
(click)="openKeyboard('primary')"
style="color: grey; cursor: pointer;"
[ngStyle]="isPrimaryLangRTL ? {'float':'left'} : {'float':'right'}">
[ngStyle]="isPrimaryLangRTL ? {'float':'left'} : {'float':'right'}"
(keypress)="openKeyboard('primary')">
<em class="material-icons">keyboard</em></span>
<hr />
<br /><br />
Expand Down Expand Up @@ -504,7 +505,7 @@ <h3>{{ "center.operational-details" | translate }}</h3>
style="height: 30px;width: 100px;border: 1px solid #FF4081;border-radius: 30px;padding: 7px;margin: 15px;cursor: pointer;font-size: 11px;"
*ngIf="primary.exceptionalHolidays.value.length>=0 && data.exceptionHolidayDate!==null">
<span>{{ data.exceptionHolidayDate }}</span>
<div style="position: absolute; margin-left: 65px;margin-top: -18px;cursor: pointer;color: #FF4081;" (click)="deleteHoliday(i)">
<div style="position: absolute; margin-left: 65px;margin-top: -18px;cursor: pointer;color: #FF4081;" (click)="deleteHoliday(i)" (keypress)="deleteHoliday(i)">
<em class="material-icons" [ngClass]="isPrimaryLangRTL ? 'icon-padding-right' : 'icon-padding-left'">cancel</em>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<span *ngIf="!disablePrimaryForm" matTooltip="{{ 'center.keyboard-tooltip' | translate }}"
(click)="openKeyboard('primary')"
style="color: grey; cursor: pointer;"
[ngStyle]="isPrimaryLangRTL ? {'float':'left'} : {'float':'right'}">
[ngStyle]="isPrimaryLangRTL ? {'float':'left'} : {'float':'right'}"
(keypress)="openKeyboard('primary')">
<em class="material-icons">keyboard</em></span>
<hr />
<h3>{{ "center.center-details" | translate }}</h3>
Expand Down Expand Up @@ -132,7 +133,8 @@ <h3>{{ "center.location-details" | translate }}</h3>
<span *ngIf="!disableSecondaryForm" matTooltip="{{ secondaryLanguageLabels['keyboard-tooltip'] }}"
(click)="openKeyboard('secondary')"
style="color: grey; cursor: pointer;"
[ngStyle]="isSecondaryLangRTL ? {'float':'left'} : {'float':'right'}">
[ngStyle]="isSecondaryLangRTL ? {'float':'left'} : {'float':'right'}"
(keypress)="openKeyboard('secondary')">
<em class="material-icons">keyboard</em></span>
<hr />
<h3>{{ secondaryLanguageLabels["center-details"] }}</h3>
Expand Down Expand Up @@ -677,7 +679,7 @@ <h3>{{ "center.operational-details" | translate }}</h3>
style="height: 30px;width: 100px;border: 1px solid #FF4081;border-radius: 30px;padding: 7px;margin: 15px;cursor: pointer;font-size: 11px;"
*ngIf="common.exceptionalHolidays.value.length>=0 && data.exceptionHolidayDate!==null">
<span>{{ data.exceptionHolidayDate }}</span>
<div style="position: absolute;margin-left: 65px;margin-top: -18px;cursor: pointer;color: #FF4081;" (click)="deleteHoliday(i)">
<div style="position: absolute;margin-left: 65px;margin-top: -18px;cursor: pointer;color: #FF4081;" (click)="deleteHoliday(i)" (keypress)="deleteHoliday(i)">
<em class="material-icons" [ngClass]="isPrimaryLangRTL ? 'icon-padding-right' : 'icon-padding-left'">cancel</em>
</div>
</div>
Expand Down
Loading

0 comments on commit 3929305

Please sign in to comment.