Skip to content

Commit

Permalink
Merge pull request #211 from aranaravi/develop
Browse files Browse the repository at this point in the history
[MOSIP-23162][MOSIP-22043][MOSIP-22881][MOSIP-28383]Changes related rtl language and resource bundle rendering issue fixed
  • Loading branch information
ckm007 authored Feb 6, 2024
2 parents 804107c + 572ce3c commit 72a0937
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 35 deletions.
2 changes: 1 addition & 1 deletion pmp-ui/src/app/core/parent/parent.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="parent-component">
<div id="parent-component" dir="{{sitealignment}}">
<div class="fixed-topnav">
<app-header [screenResize]="screenWidth">></app-header>
</div>
Expand Down
6 changes: 5 additions & 1 deletion pmp-ui/src/app/core/parent/parent.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class ParentComponent implements OnInit, AfterViewInit {
navItems: NavItem[];
primaryLang: string;
secondaryLang: string;
sitealignment = 'ltr';

constructor(public headerService: HeaderService,
public sideMenuService: SideMenuService,
Expand All @@ -40,8 +41,11 @@ export class ParentComponent implements OnInit, AfterViewInit {
}

ngOnInit() {
this.primaryLang = this.appConfigService.getConfig()['primaryLangCode'];
this.primaryLang = this.headerService.getlanguageCode();
this.secondaryLang = this.appConfigService.getConfig()['secondaryLangCode'];
if(this.primaryLang === "ara"){
this.sitealignment = 'rtl';
}
this.translateService.use(this.primaryLang);
this.navItems = cloneObject(appConstants.navItems);
if (this.headerService.getRoles()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- center filter -->
<div dir="{{sitealignment}}">
<div class="filter" *ngIf="input.case === 'filter'">
<h2 class="filter-heading">{{ "filters.titleTxt" | translate }}</h2>
<mat-divider></mat-divider>
Expand Down Expand Up @@ -223,3 +224,4 @@ <h1 mat-dialog-title>{{ input.title }}</h1>
</button></span>
</div>
</div> -->
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class DialogComponent implements OnInit {

filterOptions: any = {};
primaryLangCode: string;

sitealignment = 'ltr';
constructor(
public dialog: MatDialog,
public dialogRef: MatDialogRef<DialogComponent>,
Expand All @@ -65,7 +65,9 @@ export class DialogComponent implements OnInit {

async ngOnInit() {
this.input = this.data;
console.log(this.input);
if(this.primaryLangCode === "ara"){
this.sitealignment = 'rtl';
}
if (this.input.case === 'filter') {
this.existingFilters = Utils.convertFilter(
this.activatedRoute.snapshot.queryParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="flex-body">
<mat-card>
<mat-card *ngIf="popupMessages">
<mat-card-content class="forms-container" *ngIf="!hideContainer">
<p class="mat-form1" *ngFor="let field of fields; let i = index">
<mat-form-field *ngIf="field.showInSingleView === 'true' && field.inputType === 'text'">
Expand Down Expand Up @@ -248,10 +248,10 @@
</mat-card-content>
<mat-card-actions class="action-buttons">
<button id="createButton" mat-raised-button (click)="submit()" *ngIf="!hideContainer">
Save
{{ popupMessages["generickeys"]["save"] | translate }}
</button>
<button mat-raised-button (click)="changePage()">
Cancel
{{ popupMessages["generickeys"]["cancel"] | translate }}
</button>
</mat-card-actions>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
setTimeout(()=>{
this.loadSecondaryForm();
}, 500);

this.primaryLang = this.headerService.getlanguageCode();
this.translateService
.getTranslation(this.primaryLang)
.subscribe(response => {
Expand Down Expand Up @@ -605,7 +605,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
this.primaryData["policies"] = JSON.stringify(this.primaryData["policies"]);
}
if (!response.errors || (response.errors.length == 0)) {
let url = this.pageName+" Updated Successfully";
let url = this.pageName+" "+this.popupMessages.generickeys.updatedSuccessfully;
this.showMessage(url)
.afterClosed()
.subscribe(() => {
Expand Down Expand Up @@ -651,7 +651,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
this.primaryData["policies"] = JSON.stringify(this.primaryData["policies"]);
}
if (!response.errors || (response.errors.length == 0)) {
let url = this.pageName+" Created Successfully";
let url = this.pageName+" "+this.popupMessages.generickeys.createdSuccessfully;
this.showMessage(url)
.afterClosed()
.subscribe(() => {
Expand Down Expand Up @@ -693,7 +693,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
case: 'MESSAGE',
title: 'Success',
message: message,
btnTxt: 'Ok'
btnTxt: this.popupMessages.generickeys.ok
}
});
return dialogRef;
Expand All @@ -707,7 +707,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
case: 'MESSAGE',
title: 'Error',
message: message,
btnTxt: 'Ok'
btnTxt: this.popupMessages.generickeys.ok
},
disableClose: true
});
Expand Down
28 changes: 6 additions & 22 deletions pmp-ui/src/app/shared/dialog/dialog.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- center filter -->
<div dir="{{sitealignment}}" *ngIf=translateValue>
<div class="filter" *ngIf="input.case === 'filter'">
<h2 class="filter-heading">{{ "filters.titleTxt" | translate }}</h2>
<mat-divider></mat-divider>
Expand Down Expand Up @@ -138,25 +139,6 @@ <h2 class="filter-heading">{{ "filters.titleTxt" | translate }}</h2>
>
</div>
<div class="footer">
<!-- <button
type="reset"
mat-button
class="footer-button"
style="color: #FF4081; border: inherit"
>
<img
src="assets/images/refresh.png"
height="15px; width:12px;"
/>&nbsp;{{ "filters.footerButtons.resetTxt" | translate }}
</button>
<button
mat-button
class="footer-button"
(click)="onNoClick()"
style="color: #FF4081; background-color: white;"
>
{{ "filters.footerButtons.cancelTxt" | translate }}
</button> -->
<button
type="submit"
mat-button
Expand Down Expand Up @@ -270,15 +252,16 @@ <h2 class="filter-heading">{{ "filters.titleTxt" | translate }}</h2>
height="45px"
width="45px"
class="success-img"
*ngIf="input.title == ('Success' || 'Success_ara' || 'Success_fra') || ('Success_tam' || 'Success_kan' || 'Success_hin')" />
*ngIf="input.title === 'Success'" />
<img
src="assets/images/cross.png"
height="45px"
width="45px"
class="success-img"
*ngIf="input.title === ('Error' || 'Error_ara' || 'Error_fra') || ('Error_tam' || 'Error_kan' || 'Error_hin')" />
*ngIf="input.title === 'Error'" />
<div class="pop-up-header">
<b mat-dialog-title>{{ input.title }}</b>
<b mat-dialog-title *ngIf="input.title === 'Success'">{{ translateValue["generickeys"]["success"] | translate }}</b>
<b mat-dialog-title *ngIf="input.title === 'Error'">{{ translateValue["generickeys"]["error"] | translate }}</b>
<div mat-dialog-content>
<p>{{ input.message }}</p>
</div>
Expand Down Expand Up @@ -316,3 +299,4 @@ <h2 class="filter-heading">{{ "filters.titleTxt" | translate }}</h2>
>
</div>
</div>
</div>
14 changes: 13 additions & 1 deletion pmp-ui/src/app/shared/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export class DialogComponent implements OnInit {

holidayForm: FormGroup;

sitealignment = 'ltr';

translateValue:any;

constructor(
public dialog: MatDialog,
public dialogRef: MatDialogRef<DialogComponent>,
Expand All @@ -68,7 +72,15 @@ export class DialogComponent implements OnInit {

async ngOnInit() {
this.input = this.data;
console.log(this.input);
if(this.primaryLangCode === "ara"){
this.sitealignment = 'rtl';
}
this.translate
.getTranslation(this.primaryLangCode)
.subscribe(response => {
this.translateValue = response;
});

if (this.input.case === 'filter') {
this.existingFilters = Utils.convertFilter(
this.activatedRoute.snapshot.queryParams,
Expand Down
5 changes: 5 additions & 0 deletions pmp-ui/src/assets/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@
"fieldValidation": "This field is required",
"fieldNameValidation": " is required"
},
"generickeys":{
"save":"Save",
"cancel":"Cancel",
"detailView":"Detail View"
},
"serverError": {
"PMS_COR_001": "Missing Input Parameter",
"PMS_PRT_002": " Policy group does not exist",
Expand Down
5 changes: 5 additions & 0 deletions pmp-ui/src/assets/i18n/kan.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@
"fieldValidation": "This field is required_kan",
"fieldNameValidation": " is required_kan"
},
"generickeys":{
"save":"Save_kan",
"cancel":"Cancel_kan",
"detailView":"Detail View_kan"
},
"serverError": {
"PMS_COR_001": "ಇನ್‌ಪುಟ್ ಪ್ಯಾರಾಮೀಟರ್ ಕಾಣೆಯಾಗಿದೆ",
"PMS_PRT_002": "ನೀತಿ ಗುಂಪು ಅಸ್ತಿತ್ವದಲ್ಲಿಲ್ಲ",
Expand Down
10 changes: 10 additions & 0 deletions pmp-ui/src/assets/i18n/tam.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,16 @@
"fieldValidation": "This field is required_tam",
"fieldNameValidation": " is required_tam"
},
"generickeys":{
"save":"Save_tam",
"cancel":"Cancel_tam",
"detailView":"Detail View_tam",
"ok":"Ok_tam",
"updatedSuccessfully":"Updated Successfully_tam",
"createdSuccessfully":"Created Successfully_tam",
"success":"Success_tam",
"error":"Error_tam"
},
"serverError": {
"PMS_COR_001": "உள்ளீட்டு அளவுரு இல்லை",
"PMS_PRT_002": " கொள்கை குழு இல்லை",
Expand Down

0 comments on commit 72a0937

Please sign in to comment.