From 1313602ab3219d280dff90a1930a3f7da4b282d8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 23 Feb 2022 12:27:19 +0300 Subject: [PATCH 1/3] q3 changes updates --- Mohem/src/app/app.component.html | 9 ++- Mohem/src/app/app.component.ts | 5 +- .../change-password.component.html | 6 +- .../change-password.component.scss | 4 ++ .../change-password.component.ts | 30 ++++++---- .../forgot/forgot.component.html | 6 +- .../forgot/forgot.component.scss | 5 +- .../authentication/forgot/forgot.component.ts | 35 +++++++----- Mohem/src/app/hmg-common/hmg-common.module.ts | 5 +- .../services/connector/connector.service.ts | 2 +- .../generic-header.component.html | 4 +- .../generic-header.component.scss | 4 ++ .../app/itemforsale/home/home.component.html | 2 +- .../app/itemforsale/home/home.component.scss | 4 ++ .../itemforsale/items/items.component.html | 2 +- .../itemforsale/items/items.component.scss | 2 + .../app/itemforsale/items/items.component.ts | 22 ++++++- .../src/app/profile/home/home.component.html | 2 +- Mohem/src/app/profile/home/home.component.ts | 31 +--------- .../performance-evaluation.component.ts | 57 ++++++++++++++----- .../transaction-list.component.html | 2 +- .../transaction-list.component.ts | 52 ++++++++++++++++- Mohem/src/assets/icon/settings-not.svg | 10 ++++ Mohem/src/assets/localization/i18n.json | 4 ++ 24 files changed, 213 insertions(+), 92 deletions(-) create mode 100644 Mohem/src/assets/icon/settings-not.svg diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index 47c87d50..b9e9c73a 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -35,7 +35,14 @@ {{ts.trPK('userProfile','title')}} - + + + + + + {{ts.trPK('userProfile','performance-evaluation')}} + + diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index b2792344..676501d7 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -271,7 +271,10 @@ export class AppComponent implements OnInit { this.cs.openProfile('sideMenu'); this.menu.toggle(); } - + public performanceEvaluation() { + this.cs.openPerformanceevaluation(); + this.menu.toggle(); + } public openNotification() { this.cs.openNotificationPage(); this.menu.toggle(); diff --git a/Mohem/src/app/authentication/change-password/change-password.component.html b/Mohem/src/app/authentication/change-password/change-password.component.html index 68932635..15f9d25c 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -41,10 +41,10 @@ minLength="8" min="8"> - + - -

{{recentPasswordNote.text}}

+ +

{{recentPasswordNote.text}}

diff --git a/Mohem/src/app/authentication/change-password/change-password.component.scss b/Mohem/src/app/authentication/change-password/change-password.component.scss index 727737ed..a05e7a94 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.scss +++ b/Mohem/src/app/authentication/change-password/change-password.component.scss @@ -33,3 +33,7 @@ opacity:.5; } +.info{ + color: #000; + font-weight: bold; +} diff --git a/Mohem/src/app/authentication/change-password/change-password.component.ts b/Mohem/src/app/authentication/change-password/change-password.component.ts index 5d9402d4..e4c5ba83 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.ts +++ b/Mohem/src/app/authentication/change-password/change-password.component.ts @@ -36,47 +36,55 @@ export class ChangePasswordComponent implements OnInit { public recentPasswordNote = { yellowImg: '../assets/icon/yellow.svg', - text: 'Do not user recent password' + text: 'Do not user recent password', + }; public isLowerCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'At least one lowercase', isMatch: false }; public isUpperCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'At least one uppdercase', isMatch: false }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'At least one nomeric', isMatch: false }; public isMinLength = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'Minimum 8 characters', isMatch: false }; public isRepeatedLetter = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'Do not add repeating letters', isMatch: false }; public isContainSpecialChar = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'It should contain special character', isMatch: false }; public confirmMatchNew = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'Confirm Password does not match.', isMatch: false }; @@ -244,7 +252,7 @@ export class ChangePasswordComponent implements OnInit { return this.isLowerCase.greenImg; } else { this.isLowerCase.isMatch = false; - return this.isLowerCase.blankImg; + return this.isLowerCase.redImg; } case 2: if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { @@ -252,7 +260,7 @@ export class ChangePasswordComponent implements OnInit { return this.isUpperCase.greenImg; } else { this.isUpperCase.isMatch = false; - return this.isUpperCase.blankImg; + return this.isUpperCase.redImg; } case 3: if (/[0-9]/.test(this.P_NEW_PASSWORD)) { @@ -260,7 +268,7 @@ export class ChangePasswordComponent implements OnInit { return this.isHasDigit.greenImg; } else { this.isHasDigit.isMatch = false; - return this.isHasDigit.blankImg; + return this.isHasDigit.redImg; } case 4: if (this.P_NEW_PASSWORD.length >= 8) { @@ -268,12 +276,12 @@ export class ChangePasswordComponent implements OnInit { return this.isMinLength.greenImg; } else { this.isMinLength.isMatch = false; - return this.isMinLength.blankImg; + return this.isMinLength.redImg; } case 5: if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { this.isRepeatedLetter.isMatch = false; - return this.isRepeatedLetter.blankImg; + return this.isRepeatedLetter.redImg; } else { this.isRepeatedLetter.isMatch = true; return this.isRepeatedLetter.greenImg; @@ -284,14 +292,14 @@ export class ChangePasswordComponent implements OnInit { return this.isContainSpecialChar.greenImg; } else { this.isContainSpecialChar.isMatch = false; - return this.isContainSpecialChar.blankImg; + return this.isContainSpecialChar.redImg; } case 7: if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { - this.confirmMatchNew.isMatch = true; - return this.confirmMatchNew.blankImg; - } else { this.confirmMatchNew.isMatch = false; + return this.confirmMatchNew.redImg; + } else { + this.confirmMatchNew.isMatch = true; return this.confirmMatchNew.greenImg; } } @@ -302,7 +310,7 @@ export class ChangePasswordComponent implements OnInit { disabledSubmitBtn() { if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.NEW_PASSWORD - && this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.isContainSpecialChar) { + && this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) { return false; } else { return true; } } diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index ccc41b2b..4c0ba8c2 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -41,8 +41,8 @@ - -

{{recentPasswordNote.text}}

+ +

{{recentPasswordNote.text}}

@@ -81,7 +81,7 @@
\ No newline at end of file diff --git a/Mohem/src/app/authentication/forgot/forgot.component.scss b/Mohem/src/app/authentication/forgot/forgot.component.scss index f9421f1c..55589cb9 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.scss +++ b/Mohem/src/app/authentication/forgot/forgot.component.scss @@ -2,4 +2,7 @@ opacity:.5; } - +.info{ + color: #000; + font-weight: bold; +} diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index c9688ec5..7038792a 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -23,48 +23,55 @@ export class ForgotComponent implements OnInit { public P_USER_NAME: string; public logo = "assets/icon/login/lock.png"; public recentPasswordNote = { - yellowImg: '../assets/icon/yellow.svg', + yellowImg: '../assets/imgs/mohemm-action/info.png', text: 'Do not user recent password' }; public isLowerCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'At least one lowercase', isMatch: false }; public isUpperCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'At least one uppdercase', isMatch: false }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'At least one nomeric', isMatch: false }; public isMinLength = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'Minimum 8 characters', isMatch: false }; public isRepeatedLetter = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'Do not add repeating letters', isMatch: false }; public isContainSpecialChar = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'It should contain special character', isMatch: false }; public confirmMatchNew = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', text: 'Confirm Password does not match.', isMatch: false }; @@ -157,7 +164,7 @@ export class ForgotComponent implements OnInit { return this.isLowerCase.greenImg; } else { this.isLowerCase.isMatch = false; - return this.isLowerCase.blankImg; + return this.isLowerCase.redImg; } case 2: if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { @@ -165,7 +172,7 @@ export class ForgotComponent implements OnInit { return this.isUpperCase.greenImg; } else { this.isUpperCase.isMatch = false; - return this.isUpperCase.blankImg; + return this.isUpperCase.redImg; } case 3: if (/[0-9]/.test(this.P_NEW_PASSWORD)) { @@ -173,7 +180,7 @@ export class ForgotComponent implements OnInit { return this.isHasDigit.greenImg; } else { this.isHasDigit.isMatch = false; - return this.isHasDigit.blankImg; + return this.isHasDigit.redImg; } case 4: if (this.P_NEW_PASSWORD.length >= 8) { @@ -181,12 +188,12 @@ export class ForgotComponent implements OnInit { return this.isMinLength.greenImg; } else { this.isMinLength.isMatch = false; - return this.isMinLength.blankImg; + return this.isMinLength.redImg; } case 5: if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { this.isRepeatedLetter.isMatch = false; - return this.isRepeatedLetter.blankImg; + return this.isRepeatedLetter.redImg; } else { this.isRepeatedLetter.isMatch = true; return this.isRepeatedLetter.greenImg; @@ -197,14 +204,14 @@ export class ForgotComponent implements OnInit { return this.isContainSpecialChar.greenImg; } else { this.isContainSpecialChar.isMatch = false; - return this.isContainSpecialChar.blankImg; + return this.isContainSpecialChar.redImg; } case 7: if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { - this.confirmMatchNew.isMatch = true; - return this.confirmMatchNew.blankImg; - } else { this.confirmMatchNew.isMatch = false; + return this.confirmMatchNew.redImg; + } else { + this.confirmMatchNew.isMatch = true; return this.confirmMatchNew.greenImg; } } @@ -213,9 +220,9 @@ export class ForgotComponent implements OnInit { disabledSubmitBtn() { if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch - && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD - && this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar) { - return false; + && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD + && this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar && this.confirmMatchNew.isMatch) { + return false; } else { return true; } - } + } } diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index d0b4fd8d..d0aa318e 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -113,7 +113,7 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc import { CardCalendarComponent } from './ui/card-calendar/card-calendar.component'; import { WorklistSettingComponent } from '../notification/worklist-setting/worklist-setting.component'; import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit-address-modal.component'; - +import { FileOpener } from '@ionic-native/file-opener/ngx'; @NgModule({ imports: [ CommonModule, @@ -309,7 +309,8 @@ import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit- MenuService, OpenNativeSettings, BarcodeScanner, - BackgroundGeolocation + BackgroundGeolocation, + FileOpener ], entryComponents: [DateInfoModalComponent, WorklistSettingComponent], }) diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index 62631565..f472cb49 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -25,7 +25,7 @@ export class ConnectorService { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) }; public static retryTimes = 0; - public static timeOut = 120 * 1000; + public static timeOut = 180 * 1000; public static host = 'https://uat.hmgwebservices.com/'; // public static host = 'https://hmgwebservices.com/'; diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html index e470558f..40d6516a 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html @@ -31,8 +31,8 @@ -
- +
+
diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss index a8495839..60f1d786 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss @@ -23,4 +23,8 @@ } .header-toolbar-new { --background: #269DB8; +} +.setting-conatainer{ + height: 40px !important; + width: 40px !important; } \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/home/home.component.html b/Mohem/src/app/itemforsale/home/home.component.html index 39929ee6..7b21c88b 100644 --- a/Mohem/src/app/itemforsale/home/home.component.html +++ b/Mohem/src/app/itemforsale/home/home.component.html @@ -60,7 +60,7 @@
-
+

{{category.title}}

diff --git a/Mohem/src/app/itemforsale/home/home.component.scss b/Mohem/src/app/itemforsale/home/home.component.scss index 3aa5ee5f..ff52efa4 100644 --- a/Mohem/src/app/itemforsale/home/home.component.scss +++ b/Mohem/src/app/itemforsale/home/home.component.scss @@ -394,4 +394,8 @@ ion-radio{ width: 21px; margin-top: 5px; +} +.sale-icon .top-icon{ + position: relative; + margin: 5px 8px; } \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/items/items.component.html b/Mohem/src/app/itemforsale/items/items.component.html index 73f72e84..26778eb1 100644 --- a/Mohem/src/app/itemforsale/items/items.component.html +++ b/Mohem/src/app/itemforsale/items/items.component.html @@ -131,7 +131,7 @@ - + diff --git a/Mohem/src/app/itemforsale/items/items.component.scss b/Mohem/src/app/itemforsale/items/items.component.scss index b6e1bfcd..f8c6c061 100644 --- a/Mohem/src/app/itemforsale/items/items.component.scss +++ b/Mohem/src/app/itemforsale/items/items.component.scss @@ -18,6 +18,8 @@ } .top{ position: relative; + margin: 5px 10px; + } .bottom{ height: 100%; diff --git a/Mohem/src/app/itemforsale/items/items.component.ts b/Mohem/src/app/itemforsale/items/items.component.ts index 5ce86db5..a96d2a9e 100644 --- a/Mohem/src/app/itemforsale/items/items.component.ts +++ b/Mohem/src/app/itemforsale/items/items.component.ts @@ -6,6 +6,7 @@ import { deepCopy } from '@angular-devkit/core/src/utils/object'; import * as moment from 'moment'; import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; @Component({ selector: 'app-items', @@ -21,7 +22,7 @@ export class ItemsComponent implements OnInit { pageNo: number = 1; tempSearch: any = []; itemsByEmployee: any = []; - constructor(public ts: TranslatorService, public route: ActivatedRoute, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService) { + constructor(public ts: TranslatorService, public route: ActivatedRoute, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService, private authService: AuthenticationService) { this.route .params.subscribe(val => { setTimeout(() => { @@ -128,5 +129,24 @@ export class ItemsComponent implements OnInit { this.cs.sharedService.setSharedData(items, ItemForSaleService.EDIT_ITEMS); this.cs.openCreateitems(); } + deleteItems(item) { + var authUser = this.authService.getAuthenticatedRequest(); + this.cs.startLoading(); + var request = new FormData(); + request.append('itemSaleID', item.itemSaleID); + request.append('isActive', 'false'); + request.append('Channel', authUser.Channel.toString()); + request.append('LogInToken', authUser.LogInTokenID); + request.append('Token', authUser.TokenID); + request.append('EmployeeNumber', authUser.P_USER_NAME); + request.append('MobileNo', authUser.MobileNumber); + request.append('employeeNumber', authUser.P_USER_NAME); + this.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + if (this.cs.validResponse(result)) { + this.cs.greenToastPK('itemforsale', 'item-deleted'); + this.getItemsByEmployee(); + } + }) + } } diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html index 9e43f968..682c8590 100644 --- a/Mohem/src/app/profile/home/home.component.html +++ b/Mohem/src/app/profile/home/home.component.html @@ -1,4 +1,4 @@ - + diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index bcab0844..5bfbba0b 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -28,9 +28,7 @@ export class HomeComponent implements OnInit { public setImage: any; public user_image: any = '../assets/imgs/profile.png'; public personalInfo: any; - public appraisalArr: any = []; - public performanceData: any = []; - public static PERFORMANCE_DATA = 'perAppData'; + public personalInfoSegment = false; public familyMemberSegment = false; public basicDetailsSegment = false; @@ -257,35 +255,8 @@ export class HomeComponent implements OnInit { this.cs.openProfile('sideMenu'); } - public openPerormance() { - this.showPerformanceAppraisal(); - } - public showPerformanceAppraisal() { - this.DS.getPerformanceAppraisal(() => { - this.showPerformanceAppraisal(); - }).subscribe((result: PerformanceAppraisalResponse) => { - this.handlePerformanceAppraisalResult(result); - }); - } - private handlePerformanceAppraisalResult(result) { - if (this.cs.validResponse(result)) { - if (this.cs.hasData(result.GetPerformanceAppraisalList)) { - this.appraisalArr = result.GetPerformanceAppraisalList; - this.performanceData = []; - for (let i = 0; i < this.appraisalArr.length; i++) { - this.performanceData.push({ name: this.appraisalArr[i].APPRAISAL_YEAR, value: parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed() }); - } - console.log('PerformanceAppraisalResponse'); - this.sharedData.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA); - this.cs.openPerformanceevaluation(); - } else { - let msg: string = this.ts.trPK("userProfile", "no-appraisal"); - this.cs.presentAlert(msg); - } - } - } public selectedSegment(segmentData) { switch (segmentData) { diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts index a755c831..a3a61872 100644 --- a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts @@ -25,7 +25,9 @@ export class PerformanceEvaluationComponent implements OnInit { public length; public direction: string; // public showText:boolean =false; + public appraisalArr: any = []; + public static PERFORMANCE_DATA = 'perAppData'; constructor(public ts: TranslatorService, public cs: CommonService, public DS: DashboredService, @@ -53,21 +55,21 @@ export class PerformanceEvaluationComponent implements OnInit { this.getProfile(); - - this.performanceData = this.cs.sharedService.getSharedData( - PerformanceAppraisalResponse.PERFORMANCE_DATA, - true - ); - console.log(this.performanceData.length); - //i % 2 == 0 - this.length = this.performanceData.length; - - for (let i = 0; i < this.performanceData.length; i++) { - this.performanceData[i].color = this.colorScheme.domain[i]; - console.log(i + ' : ' + this.performanceData[i].name) - - } - console.log(this.performanceData[0].color) + this.showPerformanceAppraisal() + // this.performanceData = this.cs.sharedService.getSharedData( + // PerformanceAppraisalResponse.PERFORMANCE_DATA, + // true + // ); + // console.log(this.performanceData.length); + // //i % 2 == 0 + // this.length = this.performanceData.length; + + // for (let i = 0; i < this.performanceData.length; i++) { + // this.performanceData[i].color = this.colorScheme.domain[i]; + // console.log(i + ' : ' + this.performanceData[i].name) + + // } + // console.log(this.performanceData[0].color) } @@ -90,5 +92,30 @@ export class PerformanceEvaluationComponent implements OnInit { } }); } + public showPerformanceAppraisal() { + this.DS.getPerformanceAppraisal(() => { + this.showPerformanceAppraisal(); + }).subscribe((result: PerformanceAppraisalResponse) => { + this.handlePerformanceAppraisalResult(result); + }); + } + + private handlePerformanceAppraisalResult(result) { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.GetPerformanceAppraisalList)) { + this.appraisalArr = result.GetPerformanceAppraisalList; + this.performanceData = []; + for (let i = 0; i < this.appraisalArr.length; i++) { + this.performanceData.push({ name: this.appraisalArr[i].APPRAISAL_YEAR, value: parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed() }); + } + console.log('PerformanceAppraisalResponse'); + this.cs.sharedService.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA); + this.cs.openPerformanceevaluation(); + } else { + let msg: string = this.ts.trPK("userProfile", "no-appraisal"); + this.cs.presentAlert(msg); + } + } + } } diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.html b/Mohem/src/app/reports/transaction-list/transaction-list.component.html index af807b32..e77ffca3 100644 --- a/Mohem/src/app/reports/transaction-list/transaction-list.component.html +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.html @@ -35,7 +35,7 @@

{{'transaction,output' | translate}}

-

+

diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.ts b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts index 56d0aa06..66985159 100644 --- a/Mohem/src/app/reports/transaction-list/transaction-list.component.ts +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts @@ -1,10 +1,11 @@ -import { copyStyles } from '@angular/animations/browser/src/util'; import { Component, ElementRef, OnInit } from '@angular/core'; +import { File } from '@ionic-native/file/ngx'; +import { Platform } from '@ionic/angular'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { ReportServiceService } from '../report-service.service'; - +import { FileOpener } from '@ionic-native/file-opener/ngx'; @Component({ selector: 'app-transaction-list', templateUrl: './transaction-list.component.html', @@ -14,7 +15,8 @@ export class TransactionListComponent implements OnInit { transactionList: any = []; selectedMenu: any; template: any; - constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService,) { } + constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, private platform: Platform, private file: File, private opener: FileOpener, + ) { } ngOnInit() { this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false); @@ -30,12 +32,56 @@ export class TransactionListComponent implements OnInit { }; this.cs.startLoading(); this.reports.getCppOutput(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + this.saveAndOpenPdf(result.GetCcpOutputList['P_OUTPUT_FILE'], 'report.pdf'); console.log(result); this.cs.stopLoading(); }); } + // saveAndOpenPdf(pdf: string, filename: string) { + + // const linkSource = `data:application/pdf;base64,${pdf}`; + // const downloadLink = document.createElement("a"); + // const fileName = "report.pdf"; + // downloadLink.href = linkSource; + // downloadLink.download = fileName; + // downloadLink.click(); + + // } + + saveAndOpenPdf(pdf: string, filename: string) { + const writeDirectory = this.platform.is('ios') ? this.file.dataDirectory : this.file.externalDataDirectory; + this.file.writeFile(writeDirectory, filename, this.convertBase64ToBlob(pdf, 'data:application/pdf;base64'), { replace: true }) + .then(() => { + this.opener.open(writeDirectory + filename, 'application/pdf') + .catch(() => { + console.log('Error opening pdf file'); + }); + }) + .catch(() => { + console.error('Error writing pdf file'); + }); + } + + convertBase64ToBlob(b64Data, contentType): Blob { + contentType = contentType || ''; + const sliceSize = 512; + b64Data = b64Data.replace(/^[^,]+,/, ''); + b64Data = b64Data.replace(/\s/g, ''); + const byteCharacters = window.atob(b64Data); + const byteArrays = []; + for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) { + const slice = byteCharacters.slice(offset, offset + sliceSize); + const byteNumbers = new Array(slice.length); + for (let i = 0; i < slice.length; i++) { + byteNumbers[i] = slice.charCodeAt(i); + } + const byteArray = new Uint8Array(byteNumbers); + byteArrays.push(byteArray); + } + return new Blob(byteArrays, { type: contentType }); + } refresh(transaction) { var request: any = { P_REQUEST_ID: transaction['REQUEST_ID'] diff --git a/Mohem/src/assets/icon/settings-not.svg b/Mohem/src/assets/icon/settings-not.svg new file mode 100644 index 00000000..e05313cb --- /dev/null +++ b/Mohem/src/assets/icon/settings-not.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 7108cc18..ed25d049 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -3217,6 +3217,10 @@ "en": "This ad will be valid for 2 week after approval", "ar": "هذا الإعلان ساري المفعول لمدة أسبوعين بعد الموافقة" }, + "item-deleted": { + "en": "Item deleted successfully", + "ar": "تم حذف العنصر بنجاح" + }, "locked": { "en": "Locked", "ar": "مقفل" From 1fd51782d43a0f4e41fcbbdb233b7564479bef17 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Wed, 23 Feb 2022 16:49:55 +0300 Subject: [PATCH 2/3] fixed prod issue --- Mohem/package.json | 7 ++++++- .../app/authentication/check-user/check-user.component.ts | 2 +- .../app/hmg-common/services/connector/connector.service.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Mohem/package.json b/Mohem/package.json index 23dbf7c0..5acd1d9f 100644 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -35,6 +35,7 @@ "@ionic-native/device": "^5.18.0", "@ionic-native/diagnostic": "^5.18.0", "@ionic-native/file": "^5.18.0", + "@ionic-native/file-opener": "^5.36.0", "@ionic-native/file-path": "^5.18.0", "@ionic-native/fingerprint-aio": "^5.18.0", "@ionic-native/firebase-x": "^5.34.0", @@ -81,6 +82,7 @@ "cordova-plugin-device": "^2.0.3", "cordova-plugin-dialogs": "^2.0.2", "cordova-plugin-file": "^6.0.2", + "cordova-plugin-file-opener2": "^3.0.5", "cordova-plugin-filepath": "^1.5.6", "cordova-plugin-fingerprint-aio": "^3.0.0", "cordova-plugin-firebasex": "^13.0.0", @@ -236,6 +238,9 @@ }, "cordova-plugin-sms-retriever-manager": { "PLAY_SERVICES_VERSION": "15.0.1" + }, + "cordova-plugin-file-opener2": { + "ANDROID_SUPPORT_V4_VERSION": "27.+" } }, "platforms": [ @@ -243,4 +248,4 @@ "ios" ] } -} +} \ No newline at end of file diff --git a/Mohem/src/app/authentication/check-user/check-user.component.ts b/Mohem/src/app/authentication/check-user/check-user.component.ts index 6fce627c..2b74c986 100644 --- a/Mohem/src/app/authentication/check-user/check-user.component.ts +++ b/Mohem/src/app/authentication/check-user/check-user.component.ts @@ -61,7 +61,7 @@ export class CheckUserComponent implements OnInit { private checkUserResult: CheckUserAuthenticationResponse; - private sendSMSForForgotPassword() { + public sendSMSForForgotPassword() { this.cs.startLoading(); let changePwdObj= new LoginRequest(); // changePwdObj.MobileNumber= this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index f472cb49..5a1959c6 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -27,8 +27,8 @@ export class ConnectorService { public static retryTimes = 0; public static timeOut = 180 * 1000; - public static host = 'https://uat.hmgwebservices.com/'; - // public static host = 'https://hmgwebservices.com/'; + // public static host = 'https://uat.hmgwebservices.com/'; + public static host = 'https://hmgwebservices.com/'; constructor(public httpClient: HttpClient, public cs: CommonService, From 526a5cbeb5541a4cc54b2813c754f9f099db3f89 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 2 Mar 2022 14:50:46 +0300 Subject: [PATCH 3/3] added new design for delegate and favourite --- .../work-list-main-itg.component.ts | 2 + .../work-list-replacement-itg.component.html | 71 ++++++++++++++----- .../work-list-replacement-itg.component.scss | 12 ++++ .../work-list-replacement-itg.component.ts | 28 ++++++++ .../work-list-replacement-roll.component.html | 71 +++++++++++++++---- .../work-list-replacement-roll.component.scss | 23 +++++- .../work-list-replacement-roll.component.ts | 4 ++ Mohem/src/theme/styles.scss | 7 +- 8 files changed, 183 insertions(+), 35 deletions(-) diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index 20b990ad..afde12f7 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -498,6 +498,7 @@ export class WorkListMainItgComponent implements OnInit { } if (this.actionSelected === 'Delegate') { this.common.sharedService.setSharedData(info, 'selectedEmpInfo'), + this.common.sharedService.setSharedData('Delegate','pressedBtn') this.presentModal(4); } if (this.actionSelected === 'Doable') { @@ -516,6 +517,7 @@ export class WorkListMainItgComponent implements OnInit { this.actionService(2, this.commentText); } if (this.actionSelected === 'RequestInformation') { + this.common.sharedService.setSharedData('RequestInformation','pressedBtn') this.presentModal(3); } if (this.actionSelected === 'ReportGenerated') { diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html index 8dfbc335..a9a6c762 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html @@ -1,13 +1,12 @@ - - + @@ -60,9 +59,15 @@ --> - {{'replacementRoll, searchBy' | translate}} + + {{ + 'replacementRoll, title' | translate}} + {{ 'worklistMain, request' | translate}} + + {{ 'worklistMain, delegate' | translate}} - + + + +
+ + + +
+ + +
+ + + +
+ +
+ + +

{{'replacementRoll, workflow' | translate}}

+

{{'replacementRoll, favorite' | translate}}

+

{{'replacementRoll, employee-id' | translate}}

+

{{'replacementRoll, employee-email' | translate}}

+

{{'replacementRoll, employee-name' | translate}}

+
+
+
+
+
+
+ + + +
+ +
+
+
+
- - + diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss index d478da6e..5c9b62ba 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss @@ -14,7 +14,9 @@ ion-radio { text-align: center; } .boldTxtNav { + text-align: start; font-weight: bold; + padding: 12px; } .employee-details { display: inline-block; @@ -284,3 +286,13 @@ ion-radio { border-radius: 60px; color: white; } +.vl { + border-left: 2px solid lightgray; + height: 36px; +} +.searchText{ + background: transparent; + color: #D55D5C; + font-weight: bold; + text-decoration: underline; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts index e70e8589..9ef56f82 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts @@ -41,6 +41,7 @@ export class WorkListReplacementItgComponent implements OnInit { arr = []; delegtedEmp; isFavoriteLetterActive = false; + getPassActionMode: any; public slideOptsOne = { slidesPerView: 6, @@ -63,7 +64,9 @@ export class WorkListReplacementItgComponent implements OnInit { // } ngOnInit() { + this.onChangeSelect1('1'); this.delegtedEmp = this.cs.sharedService.getSharedData('selectedEmpInfo', true); + this.getPassActionMode = this.cs.sharedService.getSharedData('pressedBtn', true); if (this.delegtedEmp === undefined) { if (!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined) { this.arr = this.cs.sharedService.getSharedData('workflow-user', false); @@ -223,6 +226,31 @@ export class WorkListReplacementItgComponent implements OnInit { } } + onChangeSelect1(select) { + let selectValue = select; + this.searchKey = ''; + if (selectValue == "1") { + this.listOfRealted = this.relatedList; + console.log(this.relatedList); + this.isSelect = true; + this.isFilter = true; + this.ReplacementList = []; + } else if (selectValue == "4") { + this.listOfFav = this.favoriteUserList; + this.isFilter = true; + this.ReplacementList = []; + // if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined){ + this.getFavruite(); + // } + } else if (selectValue === '2' || selectValue === '3' || selectValue === '5') { + this.isSelect = true; + this.isFilter = false; + } + else { + this.isSelect = false; + + } + } getPlaceHolder() { return this.searchKeySelect == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchKeySelect == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail'); } diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html index edb614b4..1f9c533d 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html @@ -1,14 +1,12 @@ - - - - {{ + + + - @@ -18,9 +16,15 @@ - {{'replacementRoll, searchBy' | translate}} + + {{ + 'replacementRoll, title' | translate}} + {{ 'worklistMain, request' | translate}} + + {{ 'worklistMain, delegate' | translate}} + - + -
+ @@ -80,12 +83,50 @@
+
--> + +
+ + + +
+ + +
+ + + +
+ +
+ + +

{{'replacementRoll, workflow' | translate}}

+

{{'replacementRoll, favorite' | translate}}

+

{{'replacementRoll, employee-id' | translate}}

+

{{'replacementRoll, employee-email' | translate}}

+

{{'replacementRoll, employee-name' | translate}}

+
+
+
+
+
- - + + + +
+ +
+
+
+
-
+
@@ -95,7 +136,7 @@
-
+
diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss index 4eb8d499..b60d1508 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss @@ -158,8 +158,9 @@ ion-radio { padding: 5px; } .boldTxtNav { + text-align: start; font-weight: bold; - padding: 5px; + padding: 12px; } .employee-details { display: inline-block; @@ -212,3 +213,23 @@ ion-radio { border-radius: 60px; color: white; } +.vl { + border-left: 2px solid lightgray; + height: 36px; +} +.clearText{ + background: transparent; + color: #D55D5C; + font-weight: bold; + text-decoration: underline; +} +.searchText{ + background: transparent; + color: #D55D5C; + font-weight: bold; + text-decoration: underline; +} +.filterClass input{ + box-shadow: none !important; + -webkit-box-shadow: none !important; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index f7052c5f..9f3fad7f 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -673,4 +673,8 @@ selectedLetter(el) { returnIsActiveFunction(i) { return this.favIsActive[i]; } + +clearSearchInput(){ + this.inputSearch = ''; +} } diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 499f6f9b..e24bafc5 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -1630,4 +1630,9 @@ ion-segment-button { .disabledField{ opacity: .5; pointer-events: none; -} \ No newline at end of file +} + +.filterClass input{ + box-shadow: none !important; + -webkit-box-shadow: none !important; + } \ No newline at end of file