From c28509c8041a21a8e727b0bd6c039e9936afa919 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 29 Mar 2022 14:18:29 +0300 Subject: [PATCH 1/9] validation in forgot password and change password --- Mohem/config.xml | 147 ---------- Mohem/package.json | 251 ------------------ .../change-password.component.html | 10 +- .../change-password.component.ts | 141 ++++++---- .../forgot/forgot.component.html | 10 +- .../authentication/forgot/forgot.component.ts | 90 +++++-- 6 files changed, 169 insertions(+), 480 deletions(-) delete mode 100644 Mohem/config.xml delete mode 100644 Mohem/package.json diff --git a/Mohem/config.xml b/Mohem/config.xml deleted file mode 100644 index 5ad4f1b7..00000000 --- a/Mohem/config.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - MOHEMM - an app created by cloud Solutions - Cloud Solutions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mohem/package.json b/Mohem/package.json deleted file mode 100644 index 5acd1d9f..00000000 --- a/Mohem/package.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "name": "MOHEM", - "version": "0.0.1", - "author": "Cloud Solutions", - "homepage": "http://www.cloudsolution-sa.com/", - "private": true, - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "test": "ng test", - "lint": "ng lint", - "e2e": "ng e2e" - }, - "dependencies": { - "@angular/animations": "^7.2.15", - "@angular/common": "^7.2.2", - "@angular/core": "^7.2.2", - "@angular/forms": "^7.2.2", - "@angular/http": "^7.2.2", - "@angular/platform-browser": "^7.2.2", - "@angular/platform-browser-dynamic": "^7.2.2", - "@angular/router": "^7.2.2", - "@ionic-native/android-permissions": "^5.18.0", - "@ionic-native/app-availability": "^5.18.0", - "@ionic-native/app-rate": "^5.18.0", - "@ionic-native/background-geolocation": "^5.30.0", - "@ionic-native/badge": "^5.18.0", - "@ionic-native/barcode-scanner": "^5.18.0", - "@ionic-native/base64": "^5.18.0", - "@ionic-native/ble": "^5.18.0", - "@ionic-native/camera": "^5.18.0", - "@ionic-native/core": "^5.8.0", - "@ionic-native/date-picker": "^5.10.0", - "@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", - "@ionic-native/geolocation": "^5.10.0", - "@ionic-native/globalization": "^5.18.0", - "@ionic-native/health": "^5.4.0", - "@ionic-native/in-app-browser": "^5.17.0", - "@ionic-native/keyboard": "^5.17.0", - "@ionic-native/launch-navigator": "^5.17.0", - "@ionic-native/local-notifications": "^5.17.0", - "@ionic-native/native-storage": "^5.17.0", - "@ionic-native/nfc": "^5.30.0", - "@ionic-native/open-native-settings": "^5.14.0", - "@ionic-native/sms-retriever": "^5.36.0", - "@ionic-native/social-sharing": "^5.34.0", - "@ionic-native/splash-screen": "^5.0.0", - "@ionic-native/sqlite": "^5.18.0", - "@ionic-native/status-bar": "^5.0.0", - "@ionic-native/themeable-browser": "^5.18.0", - "@ionic-native/wifi-wizard-2": "^5.31.1", - "@ionic-native/zbar": "^5.10.0", - "@ionic/angular": "^4.1.0", - "@ng-bootstrap/ng-bootstrap": "^4.2.2", - "@swimlane/ngx-charts": "^10.1.0", - "angular-calendar": "^0.26.11", - "app": "0.1.0", - "chart.js": "^2.9.3", - "com-badrit-base64": "^0.2.0", - "cordova-android": "^8.1.0", - "cordova-android-support-gradle-release": "^3.0.1", - "cordova-open-native-settings": "^1.5.2", - "cordova-opentok-android-permissions": "^1.0.1", - "cordova-plugin-actionsheet": "^2.3.3", - "cordova-plugin-add-swift-support": "^2.0.2", - "cordova-plugin-android-permissions": "^1.0.2", - "cordova-plugin-androidx": "^1.0.2", - "cordova-plugin-androidx-adapter": "^1.1.0", - "cordova-plugin-appavailability": "^0.4.2", - "cordova-plugin-apprate": "^1.4.0", - "cordova-plugin-badge": "^0.8.8", - "cordova-plugin-ble-central": "^1.2.4", - "cordova-plugin-camera": "^4.1.0", - "cordova-plugin-datepicker": "^0.9.3", - "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", - "cordova-plugin-geolocation": "^4.0.2", - "cordova-plugin-globalization": "^1.11.0", - "cordova-plugin-inappbrowser": "^3.1.0", - "cordova-plugin-ionic-keyboard": "^2.2.0", - "cordova-plugin-ionic-webview": "^4.1.0", - "cordova-plugin-local-notification": "^0.9.0-beta.2", - "cordova-plugin-nativestorage": "^2.3.2", - "cordova-plugin-sms-retriever-manager": "^1.0.3", - "cordova-plugin-splashscreen": "^5.0.3", - "cordova-plugin-statusbar": "^2.4.3", - "cordova-plugin-themeablebrowser": "^0.2.18", - "cordova-plugin-whitelist": "^1.3.4", - "cordova-plugin-wifiwizard2": "^3.1.1", - "cordova-plugin-x-socialsharing": "^6.0.3", - "cordova-sqlite-storage": "^3.4.0", - "cordova-support-google-services": "^1.3.2", - "cordova.plugins.diagnostic": "^5.0.1", - "core-js": "^2.5.4", - "date-fns": "^1.30.1", - "es6-promise-plugin": "^4.1.0", - "ionic2-calendar": "^0.5.8", - "ionic4-rating": "^1.0.9", - "ng-circle-progress": "^1.5.1", - "ng2-file-upload": "^1.3.0", - "ng2-pdf-viewer": "^5.3.2", - "ngx-gauge": "^1.0.0-beta.10", - "npm": "^6.14.11", - "phonegap-nfc": "^1.2.0", - "phonegap-plugin-barcodescanner": "^8.1.0", - "phonegap-plugin-multidex": "^1.0.0", - "primeicons": "^1.0.0", - "primeng": "^7.1.3", - "run": "1.4.0", - "rxjs": "~6.3.3", - "tslib": "^1.10.0", - "uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2", - "xlsx": "^0.14.3", - "zone.js": "~0.8.29" - }, - "devDependencies": { - "@angular-devkit/architect": "~0.12.3", - "@angular-devkit/build-angular": "^0.13.9", - "@angular-devkit/core": "~7.2.3", - "@angular-devkit/schematics": "~7.2.3", - "@angular/cli": "^7.3.6", - "@angular/compiler": "~7.2.2", - "@angular/compiler-cli": "~7.2.2", - "@angular/language-service": "~7.2.2", - "@ionic/angular-toolkit": "~1.4.0", - "@ionic/lab": "3.1.2", - "@types/jasmine": "~2.8.8", - "@types/jasminewd2": "~2.0.3", - "@types/node": "~10.12.0", - "codelyzer": "~4.5.0", - "com.huawei.cordovahmsgmscheckplugin": "file:CordovaHMSPlugin/CordovaHMSGMSCheckPlugin", - "com.huawei.cordovahmslocationplugin": "file:CordovaHMSPlugin/CordovaHMSLocationPlugin", - "cordova-ios": "^6.2.0", - "cordova-plugin-wifiwizard2": "^3.1.1", - "es6-promise-plugin": "^4.1.0", - "jasmine-core": "~2.99.1", - "jasmine-spec-reporter": "~4.2.1", - "karma": "^4.0.1", - "karma-chrome-launcher": "~2.2.0", - "karma-coverage-istanbul-reporter": "~2.0.1", - "karma-jasmine": "~1.1.2", - "karma-jasmine-html-reporter": "^0.2.2", - "node-sass": "^4.13.1", - "protractor": "^5.4.3", - "ts-node": "~8.0.0", - "tslint": "~5.12.0", - "typescript": "3.1.6" - }, - "description": "An Ionic project", - "cordova": { - "plugins": { - "cordova-plugin-whitelist": {}, - "cordova-plugin-statusbar": {}, - "cordova-plugin-device": {}, - "cordova-plugin-splashscreen": {}, - "cordova-plugin-nativestorage": {}, - "cordova-plugin-globalization": {}, - "cordova-plugin-android-permissions": {}, - "cordova-plugin-badge": {}, - "cordova-plugin-ionic-keyboard": {}, - "cordova-plugin-datepicker": {}, - "cordova-plugin-geolocation": {}, - "phonegap-plugin-barcodescanner": { - "ANDROID_SUPPORT_V4_VERSION": "27.+" - }, - "cordova-plugin-ionic-webview": { - "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" - }, - "cordova.plugins.diagnostic": { - "ANDROID_SUPPORT_VERSION": "28.+" - }, - "cordova-open-native-settings": {}, - "cordova-plugin-camera": { - "ANDROID_SUPPORT_V4_VERSION": "27.+" - }, - "cordova-plugin-file": {}, - "cordova-plugin-filepath": {}, - "com-badrit-base64": {}, - "cordova-sqlite-storage": {}, - "cordova-plugin-ble-central": {}, - "uk.co.workingedge.phonegap.plugin.launchnavigator": {}, - "cordova-plugin-themeablebrowser": {}, - "cordova-plugin-inappbrowser": {}, - "cordova-plugin-local-notification": {}, - "cordova-opentok-android-permissions": {}, - "cordova-plugin-appavailability": {}, - "cordova-plugin-apprate": {}, - "cordova-plugin-fingerprint-aio": { - "FACEID_USAGE_DESCRIPTION": "User Authentication" - }, - "cordova-plugin-androidx": {}, - "cordova-plugin-androidx-adapter": {}, - "cordova-plugin-background-geolocation": { - "GOOGLE_PLAY_SERVICES_VERSION": "+" - }, - "phonegap-nfc": {}, - "wifiwizard2": {}, - "com.huawei.cordovahmsgmscheckplugin": {}, - "com.huawei.cordovahmslocationplugin": {}, - "cordova-plugin-x-socialsharing": {}, - "cordova-plugin-firebasex": { - "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true", - "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true", - "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true", - "ANDROID_ICON_ACCENT": "#FF00FFFF", - "ANDROID_FIREBASE_PERFORMANCE_MONITORING": "false", - "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0", - "ANDROID_PLAY_SERVICES_AUTH_VERSION": "19.0.0", - "ANDROID_FIREBASE_ANALYTICS_VERSION": "19.0.0", - "ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.0", - "ANDROID_FIREBASE_CONFIG_VERSION": "21.0.0", - "ANDROID_FIREBASE_PERF_VERSION": "20.0.1", - "ANDROID_FIREBASE_AUTH_VERSION": "21.0.1", - "ANDROID_FIREBASE_INAPPMESSAGING_VERSION": "20.0.0", - "ANDROID_FIREBASE_FIRESTORE_VERSION": "23.0.1", - "ANDROID_FIREBASE_FUNCTIONS_VERSION": "20.0.0", - "ANDROID_FIREBASE_IID_VERSION": "21.1.0", - "ANDROID_FIREBASE_INSTALLATIONS_VERSION": "17.0.0", - "ANDROID_FIREBASE_CRASHLYTICS_VERSION": "18.0.1", - "ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "18.0.1", - "ANDROID_GSON_VERSION": "2.8.7", - "ANDROID_FIREBASE_PERF_GRADLE_PLUGIN_VERSION": "1.4.0" - }, - "cordova-android-support-gradle-release": { - "ANDROID_SUPPORT_VERSION": "27.+" - }, - "cordova-plugin-sms-retriever-manager": { - "PLAY_SERVICES_VERSION": "15.0.1" - }, - "cordova-plugin-file-opener2": { - "ANDROID_SUPPORT_V4_VERSION": "27.+" - } - }, - "platforms": [ - "android", - "ios" - ] - } -} \ No newline at end of file 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 15f9d25c..8b221303 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -46,13 +46,17 @@

{{recentPasswordNote.text}}

- + + + +

{{isLetterCase.text}}

@@ -74,6 +78,10 @@

{{confirmMatchNew.text}}

+ + +

{{userNameMatchNew.text}}

+
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 e4c5ba83..3abfc214 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.ts +++ b/Mohem/src/app/authentication/change-password/change-password.component.ts @@ -53,6 +53,13 @@ export class ChangePasswordComponent implements OnInit { text: 'At least one uppdercase', isMatch: false }; + public isLetterCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: 'At least one Letter', + isMatch: false + }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', @@ -88,6 +95,14 @@ export class ChangePasswordComponent implements OnInit { text: 'Confirm Password does not match.', isMatch: false }; + public userNameMatchNew = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: 'password should not contain the username.', + isMatch: false + }; + public userId: string; constructor( public cs: CommonService, @@ -230,9 +245,7 @@ export class ChangePasswordComponent implements OnInit { if (this.P_NEW_PASSWORD === '') { switch (val) { case 1: - return this.isLowerCase.blankImg; - case 2: - return this.isUpperCase.blankImg; + return this.isLetterCase.blankImg; case 3: return this.isHasDigit.blankImg; case 4: @@ -243,72 +256,90 @@ export class ChangePasswordComponent implements OnInit { return this.isContainSpecialChar.blankImg; case 7: return this.confirmMatchNew.blankImg; + case 8: + return this.userNameMatchNew.blankImg; } } else { switch (val) { + // case 1: + // if (/[a-z]/.test(this.P_NEW_PASSWORD)) { + // this.isLowerCase.isMatch = true; + // return this.isLowerCase.greenImg; + // } else { + // this.isLowerCase.isMatch = false; + // return this.isLowerCase.redImg; + // } + // case 2: + // if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { + // this.isUpperCase.isMatch = true; + // return this.isUpperCase.greenImg; + // } else { + // this.isUpperCase.isMatch = false; + // return this.isUpperCase.redImg; + // } case 1: - if (/[a-z]/.test(this.P_NEW_PASSWORD)) { - this.isLowerCase.isMatch = true; - return this.isLowerCase.greenImg; - } else { - this.isLowerCase.isMatch = false; - return this.isLowerCase.redImg; - } - case 2: - if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { - this.isUpperCase.isMatch = true; - return this.isUpperCase.greenImg; - } else { - this.isUpperCase.isMatch = false; - return this.isUpperCase.redImg; - } + if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { + this.isLetterCase.isMatch = true; + return this.isLetterCase.greenImg; + } else { + this.isLetterCase.isMatch = false; + return this.isLetterCase.redImg; + } case 3: - if (/[0-9]/.test(this.P_NEW_PASSWORD)) { - this.isHasDigit.isMatch = true; - return this.isHasDigit.greenImg; - } else { - this.isHasDigit.isMatch = false; - return this.isHasDigit.redImg; - } + if (/[0-9]/.test(this.P_NEW_PASSWORD)) { + this.isHasDigit.isMatch = true; + return this.isHasDigit.greenImg; + } else { + this.isHasDigit.isMatch = false; + return this.isHasDigit.redImg; + } case 4: - if (this.P_NEW_PASSWORD.length >= 8) { - this.isMinLength.isMatch = true; - return this.isMinLength.greenImg; - } else { - this.isMinLength.isMatch = false; - return this.isMinLength.redImg; - } + if (this.P_NEW_PASSWORD.length >= 8) { + this.isMinLength.isMatch = true; + return this.isMinLength.greenImg; + } else { + this.isMinLength.isMatch = false; + return this.isMinLength.redImg; + } case 5: - if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { - this.isRepeatedLetter.isMatch = false; - return this.isRepeatedLetter.redImg; - } else { - this.isRepeatedLetter.isMatch = true; - return this.isRepeatedLetter.greenImg; - } + if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { + this.isRepeatedLetter.isMatch = false; + return this.isRepeatedLetter.redImg; + } else { + this.isRepeatedLetter.isMatch = true; + return this.isRepeatedLetter.greenImg; + } case 6: - if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { - this.isContainSpecialChar.isMatch = true; - return this.isContainSpecialChar.greenImg; - } else { - this.isContainSpecialChar.isMatch = false; - return this.isContainSpecialChar.redImg; - } + if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { + this.isContainSpecialChar.isMatch = true; + return this.isContainSpecialChar.greenImg; + } else { + this.isContainSpecialChar.isMatch = false; + return this.isContainSpecialChar.redImg; + } case 7: - if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { - this.confirmMatchNew.isMatch = false; - return this.confirmMatchNew.redImg; - } else { - this.confirmMatchNew.isMatch = true; - return this.confirmMatchNew.greenImg; - } - } + if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { + this.confirmMatchNew.isMatch = false; + return this.confirmMatchNew.redImg; + } else { + this.confirmMatchNew.isMatch = true; + return this.confirmMatchNew.greenImg; + } + case 8: + if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) { + this.userNameMatchNew.isMatch = true; + return this.userNameMatchNew.greenImg; + } else { + this.userNameMatchNew.isMatch = false; + return this.userNameMatchNew.redImg; + } + } } } disabledSubmitBtn() { - if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch + if (this.isLetterCase.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.isMatch && this.confirmMatchNew.isMatch) { return false; diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index 4c0ba8c2..6ac97810 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -44,13 +44,17 @@

{{recentPasswordNote.text}}

- + + + +

{{isLetterCase.text}}

@@ -72,6 +76,10 @@

{{confirmMatchNew.text}}

+ + +

{{userNameMatchNew.text}}

+
diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 7038792a..77c57c5c 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -9,7 +9,6 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser import { ForgetPassword } from '../models/forget.password'; import { LoginModel } from '../models/LoginModel'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; -import { LoginComponent } from "src/app/authentication/login/login.component"; @Component({ selector: 'app-forgot', templateUrl: './forgot.component.html', @@ -18,10 +17,11 @@ import { LoginComponent } from "src/app/authentication/login/login.component"; export class ForgotComponent implements OnInit { private loginData = new LoginModel(); - public P_NEW_PASSWORD: string = ''; - public P_Confirm_NEW_PASSWORD: string = ''; + public P_NEW_PASSWORD = ''; + // tslint:disable-next-line: variable-name + public P_Confirm_NEW_PASSWORD = ''; public P_USER_NAME: string; - public logo = "assets/icon/login/lock.png"; + public logo = 'assets/icon/login/lock.png'; public recentPasswordNote = { yellowImg: '../assets/imgs/mohemm-action/info.png', text: 'Do not user recent password' @@ -40,6 +40,13 @@ export class ForgotComponent implements OnInit { text: 'At least one uppdercase', isMatch: false }; + public isLetterCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: 'At least one Letter', + isMatch: false + }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', @@ -75,6 +82,14 @@ export class ForgotComponent implements OnInit { text: 'Confirm Password does not match.', isMatch: false }; + public userNameMatchNew = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: 'password should not contain the username.', + isMatch: false + }; + public userId: string; constructor( public cs: CommonService, @@ -88,16 +103,22 @@ export class ForgotComponent implements OnInit { ) { } - ngOnInit() { } + ngOnInit() { + console.log('ENAD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'); + this.userId = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false).P_USER_NAME; + console.log(this.userId); + } public onForgot() { this.sendSMSForForgotPassword(); } + // tslint:disable-next-line: member-ordering private checkUserResult: CheckUserAuthenticationResponse; private sendSMSForForgotPassword() { const request = new ForgetPassword(); + console.log(request); this.authService.sendForgetPassword( request, () => { @@ -117,7 +138,7 @@ export class ForgotComponent implements OnInit { forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID; } this.loginData.P_USER_NAME = this.P_USER_NAME; - let request: any = {}; + const request: any = {}; request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD; request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD; request.P_USER_NAME = data.P_USER_NAME; @@ -126,12 +147,11 @@ export class ForgotComponent implements OnInit { this.authService.submitForgetPassword( request, () => { - //this.sendSMSForForgotPassword(); }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { if (this.cs.validResponse(result)) { this.checkUserResult = result; console.log(result); - this.cs.toastPK("changePassword", "successChange"); + this.cs.toastPK('changePassword', 'successChange'); this.cs.openLogin(); } }); @@ -141,10 +161,12 @@ export class ForgotComponent implements OnInit { checkerFuncation(val) { if (this.P_NEW_PASSWORD === '') { switch (val) { + // case 1: + // return this.isLowerCase.blankImg; + // case 2: + // return this.isUpperCase.blankImg; case 1: - return this.isLowerCase.blankImg; - case 2: - return this.isUpperCase.blankImg; + return this.isLetterCase.blankImg; case 3: return this.isHasDigit.blankImg; case 4: @@ -155,24 +177,34 @@ export class ForgotComponent implements OnInit { return this.isContainSpecialChar.blankImg; case 7: return this.confirmMatchNew.blankImg; + case 8: + return this.userNameMatchNew.blankImg; } } else { switch (val) { + // case 1: + // if (/[a-z]/.test(this.P_NEW_PASSWORD)) { + // this.isLowerCase.isMatch = true; + // return this.isLowerCase.greenImg; + // } else { + // this.isLowerCase.isMatch = false; + // return this.isLowerCase.redImg; + // } + // case 2: + // if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { + // this.isUpperCase.isMatch = true; + // return this.isUpperCase.greenImg; + // } else { + // this.isUpperCase.isMatch = false; + // return this.isUpperCase.redImg; + // } case 1: - if (/[a-z]/.test(this.P_NEW_PASSWORD)) { - this.isLowerCase.isMatch = true; - return this.isLowerCase.greenImg; + if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { + this.isLetterCase.isMatch = true; + return this.isLetterCase.greenImg; } else { - this.isLowerCase.isMatch = false; - return this.isLowerCase.redImg; - } - case 2: - if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { - this.isUpperCase.isMatch = true; - return this.isUpperCase.greenImg; - } else { - this.isUpperCase.isMatch = false; - return this.isUpperCase.redImg; + this.isLetterCase.isMatch = false; + return this.isLetterCase.redImg; } case 3: if (/[0-9]/.test(this.P_NEW_PASSWORD)) { @@ -214,12 +246,20 @@ export class ForgotComponent implements OnInit { this.confirmMatchNew.isMatch = true; return this.confirmMatchNew.greenImg; } + case 8: + if (!this.P_NEW_PASSWORD.includes(this.userId)) { + this.userNameMatchNew.isMatch = true; + return this.userNameMatchNew.greenImg; + } else { + this.userNameMatchNew.isMatch = false; + return this.userNameMatchNew.redImg; + } } } } disabledSubmitBtn() { - if (this.isLowerCase.isMatch && this.isUpperCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch + if (this.isLetterCase.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 && this.confirmMatchNew.isMatch) { return false; From c58be5d885a9eab75571e8358960318a44ee671c Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 30 Mar 2022 10:00:00 +0300 Subject: [PATCH 2/9] no message --- Mohem/src/app/authentication/forgot/forgot.component.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index 6ac97810..ec9c747d 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -52,10 +52,6 @@

{{isUpperCase.text}}

--> - - -

{{isLetterCase.text}}

-

{{isHasDigit.text}}

From f8b9e47696791c29140047e599f01f2995f86217 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 30 Mar 2022 10:23:32 +0300 Subject: [PATCH 3/9] add pre-wrap to all text validation --- .../change-password/change-password.component.html | 14 +++++++------- .../authentication/forgot/forgot.component.html | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) 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 8b221303..011785e1 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -56,31 +56,31 @@
--> -

{{isLetterCase.text}}

+

{{isLetterCase.text}}

-

{{isHasDigit.text}}

+

{{isHasDigit.text}}

-

{{isMinLength.text}}

+

{{isMinLength.text}}

-

{{isRepeatedLetter.text}}

+

{{isRepeatedLetter.text}}

-

{{isContainSpecialChar.text}}

+

{{isContainSpecialChar.text}}

-

{{confirmMatchNew.text}}

+

{{confirmMatchNew.text}}

-

{{userNameMatchNew.text}}

+

{{userNameMatchNew.text}}

diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index ec9c747d..1c312f0a 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -54,27 +54,27 @@ --> -

{{isHasDigit.text}}

+

{{isHasDigit.text}}

-

{{isMinLength.text}}

+

{{isMinLength.text}}

-

{{isRepeatedLetter.text}}

+

{{isRepeatedLetter.text}}

-

{{isContainSpecialChar.text}}

+

{{isContainSpecialChar.text}}

-

{{confirmMatchNew.text}}

+

{{confirmMatchNew.text}}

-

{{userNameMatchNew.text}}

+

{{userNameMatchNew.text}}

From a3057b0126ac9d6a241d9d8596932fa6ce2ed880 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 30 Mar 2022 10:24:54 +0300 Subject: [PATCH 4/9] no message --- .../change-password.component.ts | 18 +++++++++--------- .../authentication/forgot/forgot.component.ts | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) 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 3abfc214..57990efb 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.ts +++ b/Mohem/src/app/authentication/change-password/change-password.component.ts @@ -36,56 +36,56 @@ 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', + 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', + text: 'At least one uppdercase.', isMatch: false }; public isLetterCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one Letter', + text: 'At least one Letter.', isMatch: false }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one nomeric', + 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', + 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', + 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', + text: 'It should contain special character.', isMatch: false }; public confirmMatchNew = { @@ -99,7 +99,7 @@ export class ChangePasswordComponent implements OnInit { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'password should not contain the username.', + text: 'password should not contain the user name.', isMatch: false }; public userId: string; diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 77c57c5c..0e38b23d 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -24,55 +24,55 @@ export class ForgotComponent implements OnInit { public logo = 'assets/icon/login/lock.png'; public recentPasswordNote = { yellowImg: '../assets/imgs/mohemm-action/info.png', - 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', + 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', + text: 'At least one uppdercase.', isMatch: false }; public isLetterCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one Letter', + text: 'At least one Letter.', isMatch: false }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one nomeric', + 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', + 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', + 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', + text: 'It should contain special character.', isMatch: false }; public confirmMatchNew = { @@ -86,7 +86,7 @@ export class ForgotComponent implements OnInit { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'password should not contain the username.', + text: 'password should not contain the user name.', isMatch: false }; public userId: string; From 490c525e083a2d11fe5f0ed1011483f8a66316eb Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 30 Mar 2022 10:44:19 +0300 Subject: [PATCH 5/9] add translation for validation text --- .../change-password.component.ts | 123 +++++++++--------- .../authentication/forgot/forgot.component.ts | 20 +-- Mohem/src/assets/localization/i18n.json | 40 ++++++ 3 files changed, 111 insertions(+), 72 deletions(-) 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 57990efb..0921fdd3 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.ts +++ b/Mohem/src/app/authentication/change-password/change-password.component.ts @@ -35,71 +35,70 @@ export class ChangePasswordComponent implements OnInit { public OLD_PASSWORD: boolean = false; public recentPasswordNote = { - yellowImg: '../assets/icon/yellow.svg', - text: 'Do not user recent password.', - + yellowImg: '../assets/imgs/mohemm-action/info.png', + text: this.ts.trPK('login', 'current-password-validation') }; public isLowerCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one lowercase.', + text: this.ts.trPK('login', 'lowercase-password-validation'), isMatch: false }; public isUpperCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one uppdercase.', + text: this.ts.trPK('login', 'uppercase-password-validation'), isMatch: false }; public isLetterCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one Letter.', + text: this.ts.trPK('login', 'letter-password-validation'), isMatch: false }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one nomeric.', + text: this.ts.trPK('login', 'numerica-password-validation'), isMatch: false }; public isMinLength = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'Minimum 8 characters.', + text: this.ts.trPK('login', 'min-password-validation'), 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.', + text: this.ts.trPK('login', 'repeating-password-validation'), 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.', + text: this.ts.trPK('login', 'special-character-password-validation'), 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.', + text: this.ts.trPK('login', 'not-match-password-validation'), isMatch: false }; public userNameMatchNew = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'password should not contain the user name.', + text: this.ts.trPK('login', 'contain-username-password-validation'), isMatch: false }; public userId: string; @@ -278,62 +277,62 @@ export class ChangePasswordComponent implements OnInit { // return this.isUpperCase.redImg; // } case 1: - if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { - this.isLetterCase.isMatch = true; - return this.isLetterCase.greenImg; - } else { - this.isLetterCase.isMatch = false; - return this.isLetterCase.redImg; - } + if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { + this.isLetterCase.isMatch = true; + return this.isLetterCase.greenImg; + } else { + this.isLetterCase.isMatch = false; + return this.isLetterCase.redImg; + } case 3: - if (/[0-9]/.test(this.P_NEW_PASSWORD)) { - this.isHasDigit.isMatch = true; - return this.isHasDigit.greenImg; - } else { - this.isHasDigit.isMatch = false; - return this.isHasDigit.redImg; - } + if (/[0-9]/.test(this.P_NEW_PASSWORD)) { + this.isHasDigit.isMatch = true; + return this.isHasDigit.greenImg; + } else { + this.isHasDigit.isMatch = false; + return this.isHasDigit.redImg; + } case 4: - if (this.P_NEW_PASSWORD.length >= 8) { - this.isMinLength.isMatch = true; - return this.isMinLength.greenImg; - } else { - this.isMinLength.isMatch = false; - return this.isMinLength.redImg; - } + if (this.P_NEW_PASSWORD.length >= 8) { + this.isMinLength.isMatch = true; + return this.isMinLength.greenImg; + } else { + this.isMinLength.isMatch = false; + return this.isMinLength.redImg; + } case 5: - if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { - this.isRepeatedLetter.isMatch = false; - return this.isRepeatedLetter.redImg; - } else { - this.isRepeatedLetter.isMatch = true; - return this.isRepeatedLetter.greenImg; - } + if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { + this.isRepeatedLetter.isMatch = false; + return this.isRepeatedLetter.redImg; + } else { + this.isRepeatedLetter.isMatch = true; + return this.isRepeatedLetter.greenImg; + } case 6: - if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { - this.isContainSpecialChar.isMatch = true; - return this.isContainSpecialChar.greenImg; - } else { - this.isContainSpecialChar.isMatch = false; - return this.isContainSpecialChar.redImg; - } + if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { + this.isContainSpecialChar.isMatch = true; + return this.isContainSpecialChar.greenImg; + } else { + this.isContainSpecialChar.isMatch = false; + return this.isContainSpecialChar.redImg; + } case 7: - if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { - this.confirmMatchNew.isMatch = false; - return this.confirmMatchNew.redImg; - } else { - this.confirmMatchNew.isMatch = true; - return this.confirmMatchNew.greenImg; - } + if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { + this.confirmMatchNew.isMatch = false; + return this.confirmMatchNew.redImg; + } else { + this.confirmMatchNew.isMatch = true; + return this.confirmMatchNew.greenImg; + } case 8: - if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) { - this.userNameMatchNew.isMatch = true; - return this.userNameMatchNew.greenImg; - } else { - this.userNameMatchNew.isMatch = false; - return this.userNameMatchNew.redImg; - } - } + if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) { + this.userNameMatchNew.isMatch = true; + return this.userNameMatchNew.greenImg; + } else { + this.userNameMatchNew.isMatch = false; + return this.userNameMatchNew.redImg; + } + } } } diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 0e38b23d..70785cba 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -24,69 +24,69 @@ export class ForgotComponent implements OnInit { public logo = 'assets/icon/login/lock.png'; public recentPasswordNote = { yellowImg: '../assets/imgs/mohemm-action/info.png', - text: 'Do not user recent password.' + text: this.ts.trPK('login', 'current-password-validation') }; public isLowerCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one lowercase.', + text: this.ts.trPK('login', 'lowercase-password-validation'), isMatch: false }; public isUpperCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one uppdercase.', + text: this.ts.trPK('login', 'uppercase-password-validation'), isMatch: false }; public isLetterCase = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one Letter.', + text: this.ts.trPK('login', 'letter-password-validation'), isMatch: false }; public isHasDigit = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'At least one nomeric.', + text: this.ts.trPK('login', 'numerica-password-validation'), isMatch: false }; public isMinLength = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'Minimum 8 characters.', + text: this.ts.trPK('login', 'min-password-validation'), 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.', + text: this.ts.trPK('login', 'repeating-password-validation'), 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.', + text: this.ts.trPK('login', 'special-character-password-validation'), 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.', + text: this.ts.trPK('login', 'not-match-password-validation'), isMatch: false }; public userNameMatchNew = { blankImg: '../assets/icon/blank.svg', greenImg: '../assets/icon/green.svg', redImg: '../assets/imgs/close.svg', - text: 'password should not contain the user name.', + text: this.ts.trPK('login', 'contain-username-password-validation'), isMatch: false }; public userId: string; diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 043db2b5..25b14c31 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -176,6 +176,46 @@ "check-user-text3": { "en": "will be sent to your mobile number", "ar": "سيتم ارساله الى رقم هاتفك" + }, + "current-password-validation":{ + "en":"Do not use a current password.", + "ar":"لا تستخدم كلمة المرور الحالية." + }, + "lowercase-password-validation":{ + "en":"At least one lowercase.", + "ar":"حرف صغير واحد على الأقل." + }, + "uppercase-password-validation":{ + "en":"At least one uppercase.", + "ar":"حرف كبير واحد على الأقل." + }, + "letter-password-validation":{ + "en":"At least one Letter.", + "ar":"حرف واحد على الأقل." + }, + "numerica-password-validation":{ + "en":"At least one numeric.", + "ar":"رقم واحد على الأقل." + }, + "min-password-validation":{ + "en":"Minimum 8 characters.", + "ar":"8 أحرف على الأقل." + }, + "repeating-password-validation":{ + "en":"Do not add repeating letters.", + "ar":"لا تقم بإضافة أحرف متكررة." + }, + "special-character-password-validation":{ + "en":"It should contain a special character.", + "ar":"يجب أن يحتوي على طابع خاص." + }, + "not-match-password-validation":{ + "en":"Confirm Password does not match.", + "ar":"تأكيد كلمة المرور لا يتطابق." + }, + "contain-username-password-validation":{ + "en":"The password should not contain the user name.", + "ar":"يجب ألا تحتوي كلمة المرور على اسم المستخدم." } }, "verificationcode": { From b60fd8be8a96a639e6208f4354e665b0bf9b2f2f Mon Sep 17 00:00:00 2001 From: enadhilal Date: Thu, 31 Mar 2022 12:09:48 +0300 Subject: [PATCH 6/9] fixed bugs #: MM-742 MM-743 and added show my password in forgot password and change password --- Mohem/src/app/app.component.html | 8 ++++++ .../business-card.component.html | 3 ++- .../business-card/business-card.component.ts | 3 +++ .../change-password.component.html | 12 ++++++--- .../change-password.component.ts | 25 +++++++++++++++++++ .../forgot/forgot.component.html | 12 +++++++-- .../authentication/forgot/forgot.component.ts | 21 +++++++++++++++- 7 files changed, 77 insertions(+), 7 deletions(-) diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index 22efebdf..f4f782cc 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -159,6 +159,14 @@ {{ts.trPK('userProfile','title')}} + + + + + + {{ts.trPK('userProfile','performance-evaluation')}} + + diff --git a/Mohem/src/app/authentication/business-card/business-card.component.html b/Mohem/src/app/authentication/business-card/business-card.component.html index 337ac9fb..efa14208 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.html +++ b/Mohem/src/app/authentication/business-card/business-card.component.html @@ -51,7 +51,8 @@ -->
https://hmgwebservices.com/images/Moheem/CS.jpg -

{{userInfo.name_en}}

+

{{userInfo.name_en}}

+

{{userInfo.name_ar}}

{{jobName}}
{{userInfo.mobile}}
{{userInfo.email}}
diff --git a/Mohem/src/app/authentication/business-card/business-card.component.ts b/Mohem/src/app/authentication/business-card/business-card.component.ts index 9b9217c3..a4763dde 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.ts +++ b/Mohem/src/app/authentication/business-card/business-card.component.ts @@ -15,6 +15,7 @@ export class BusinessCardComponent implements OnInit { public userInfo: any; public userJobName: any; public jobName: any; + direction: string; constructor( public modalCtrl: ModalController, public ts: TranslatorService, @@ -24,6 +25,8 @@ export class BusinessCardComponent implements OnInit { ngOnInit() { this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); + this.direction = TranslatorService.getCurrentLanguageName(); + console.log(this.userInfo); this.authService .loadAuthenticatedUser() 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 011785e1..08f78917 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -17,9 +17,11 @@

{{'changePassword,newPassword' | translate}}

@@ -27,19 +29,23 @@ 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 0921fdd3..5df74099 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.ts +++ b/Mohem/src/app/authentication/change-password/change-password.component.ts @@ -33,6 +33,9 @@ export class ChangePasswordComponent implements OnInit { public NEW_PASSWORD: boolean = false; public Confirm_NEW_PASSWORD: boolean = false; public OLD_PASSWORD: boolean = false; + public currentPasswordIcon = 'password'; + public newPasswordIcon = 'password'; + public confirmPasswordIcon = 'password'; public recentPasswordNote = { yellowImg: '../assets/imgs/mohemm-action/info.png', @@ -345,4 +348,26 @@ export class ChangePasswordComponent implements OnInit { } else { return true; } } + showPassword(val) { + if (val === 1) + this.newPasswordIcon = 'password'; + else if (val === 2) { + this.confirmPasswordIcon = 'password' + } + else { + this.currentPasswordIcon = 'password'; + } + } + + hidePassword(val) { + if (val === 1) + this.newPasswordIcon = 'text'; + else if (val === 2) { + this.confirmPasswordIcon = 'text' + } + else { + this.currentPasswordIcon = 'text'; + } + } + } diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index 1c312f0a..0a535673 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -25,19 +25,23 @@ @@ -52,6 +56,10 @@

{{isUpperCase.text}}

--> + + +

{{isLetterCase.text}}

+

{{isHasDigit.text}}

diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 70785cba..9d9133e3 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -22,6 +22,8 @@ export class ForgotComponent implements OnInit { public P_Confirm_NEW_PASSWORD = ''; public P_USER_NAME: string; public logo = 'assets/icon/login/lock.png'; + public newPasswordIcon = "password"; + public confirmPasswordIcon = "password"; public recentPasswordNote = { yellowImg: '../assets/imgs/mohemm-action/info.png', text: this.ts.trPK('login', 'current-password-validation') @@ -261,8 +263,25 @@ export class ForgotComponent implements OnInit { disabledSubmitBtn() { if (this.isLetterCase.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 && this.confirmMatchNew.isMatch) { + && this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) { return false; } else { return true; } } + + showPassword(val) { + if (val == 1) + this.newPasswordIcon = 'password'; + else { + this.confirmPasswordIcon = 'password' + } + } + + hidePassword(val) { + if (val == 1) + this.newPasswordIcon = 'text'; + else { + this.confirmPasswordIcon = 'text' + } + } + } From 1a59e0b0f00ae887224d982c3d1bcd0b9a406e2a Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 3 Apr 2022 13:58:14 +0300 Subject: [PATCH 7/9] added config.xml --- Mohem/config.xml | 147 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 Mohem/config.xml diff --git a/Mohem/config.xml b/Mohem/config.xml new file mode 100644 index 00000000..5ad4f1b7 --- /dev/null +++ b/Mohem/config.xml @@ -0,0 +1,147 @@ + + + MOHEMM + an app created by cloud Solutions + Cloud Solutions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 0d43f1f59231b41a9e513d2fc687c4956d78d413 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 3 Apr 2022 14:00:58 +0300 Subject: [PATCH 8/9] fixed package.json issue --- Mohem/.gitignore | 1 - .../CordovaHMSGMSCheckPlugin/package.json | 17 ++ .../CordovaHMSLocationPlugin/package.json | 17 ++ .../CordovaHMSPushPlugin/package.json | 21 ++ Mohem/package.json | 258 ++++++++++++++++++ 5 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 Mohem/CordovaHMSPlugin/CordovaHMSGMSCheckPlugin/package.json create mode 100644 Mohem/CordovaHMSPlugin/CordovaHMSLocationPlugin/package.json create mode 100644 Mohem/CordovaHMSPlugin/CordovaHMSPushPlugin/package.json create mode 100644 Mohem/package.json diff --git a/Mohem/.gitignore b/Mohem/.gitignore index dd1429e5..2d936f18 100644 --- a/Mohem/.gitignore +++ b/Mohem/.gitignore @@ -12,7 +12,6 @@ log.txt .vscode/ npm-debug.log* package-lock.json -package.json .idea/ .ionic/ diff --git a/Mohem/CordovaHMSPlugin/CordovaHMSGMSCheckPlugin/package.json b/Mohem/CordovaHMSPlugin/CordovaHMSGMSCheckPlugin/package.json new file mode 100644 index 00000000..36d3264c --- /dev/null +++ b/Mohem/CordovaHMSPlugin/CordovaHMSGMSCheckPlugin/package.json @@ -0,0 +1,17 @@ +{ + "name": "com.huawei.cordovahmsgmscheckplugin", + "version": "1.0.0", + "description": "Account Check Kit 4.0", + "cordova": { + "id": "com.huawei.cordovahmsgmscheckplugin", + "platforms": [ + "android" + ] + }, + "keywords": [ + "ecosystem:cordova", + "cordova-android" + ], + "author": "", + "license": "ISC" +} diff --git a/Mohem/CordovaHMSPlugin/CordovaHMSLocationPlugin/package.json b/Mohem/CordovaHMSPlugin/CordovaHMSLocationPlugin/package.json new file mode 100644 index 00000000..8b3323cf --- /dev/null +++ b/Mohem/CordovaHMSPlugin/CordovaHMSLocationPlugin/package.json @@ -0,0 +1,17 @@ +{ + "name": "com.huawei.cordovahmslocationplugin", + "version": "1.0.0", + "description": "Location Service", + "cordova": { + "id": "com.huawei.cordovahmslocationplugin", + "platforms": [ + "android" + ] + }, + "keywords": [ + "ecosystem:cordova", + "cordova-android" + ], + "author": "", + "license": "ISC" +} diff --git a/Mohem/CordovaHMSPlugin/CordovaHMSPushPlugin/package.json b/Mohem/CordovaHMSPlugin/CordovaHMSPushPlugin/package.json new file mode 100644 index 00000000..9be71e48 --- /dev/null +++ b/Mohem/CordovaHMSPlugin/CordovaHMSPushPlugin/package.json @@ -0,0 +1,21 @@ +{ + "name": "cordovahmspushplugin", + "version": "1.0.0", + "description": "For Hms Push", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "test", + "license": "ISC", + "cordova": { + "id": "com.huawei.cordovahmspushplugin", + "platforms": [ + "android" + ] + }, + "keywords": [ + "ecosystem:cordova", + "cordova-android" + ] +} diff --git a/Mohem/package.json b/Mohem/package.json new file mode 100644 index 00000000..0382be10 --- /dev/null +++ b/Mohem/package.json @@ -0,0 +1,258 @@ +{ + "name": "MOHEM", + "version": "0.0.1", + "author": "Cloud Solutions", + "homepage": "http://www.cloudsolution-sa.com/", + "private": true, + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "dependencies": { + "@angular/animations": "^7.2.15", + "@angular/common": "^7.2.2", + "@angular/core": "^7.2.2", + "@angular/forms": "^7.2.2", + "@angular/http": "^7.2.2", + "@angular/platform-browser": "^7.2.2", + "@angular/platform-browser-dynamic": "^7.2.2", + "@angular/router": "^7.2.2", + "@ionic-native/android-permissions": "^5.18.0", + "@ionic-native/app-availability": "^5.18.0", + "@ionic-native/app-rate": "^5.18.0", + "@ionic-native/background-geolocation": "^5.30.0", + "@ionic-native/badge": "^5.18.0", + "@ionic-native/barcode-scanner": "^5.18.0", + "@ionic-native/base64": "^5.18.0", + "@ionic-native/ble": "^5.18.0", + "@ionic-native/camera": "^5.18.0", + "@ionic-native/core": "^5.8.0", + "@ionic-native/date-picker": "^5.10.0", + "@ionic-native/device": "^5.18.0", + "@ionic-native/diagnostic": "^5.18.0", + "@ionic-native/file": "^5.18.0", + "@ionic-native/file-chooser": "^5.36.0", + "@ionic-native/file-opener": "^5.36.0", + "@ionic-native/file-path": "^5.18.0", + "@ionic-native/file-picker": "^5.36.0", + "@ionic-native/fingerprint-aio": "^5.18.0", + "@ionic-native/firebase-x": "^5.34.0", + "@ionic-native/geolocation": "^5.10.0", + "@ionic-native/globalization": "^5.18.0", + "@ionic-native/health": "^5.4.0", + "@ionic-native/in-app-browser": "^5.17.0", + "@ionic-native/keyboard": "^5.17.0", + "@ionic-native/launch-navigator": "^5.17.0", + "@ionic-native/local-notifications": "^5.17.0", + "@ionic-native/native-storage": "^5.17.0", + "@ionic-native/nfc": "^5.30.0", + "@ionic-native/open-native-settings": "^5.14.0", + "@ionic-native/sms-retriever": "^5.36.0", + "@ionic-native/social-sharing": "^5.34.0", + "@ionic-native/splash-screen": "^5.0.0", + "@ionic-native/sqlite": "^5.18.0", + "@ionic-native/status-bar": "^5.0.0", + "@ionic-native/themeable-browser": "^5.18.0", + "@ionic-native/wifi-wizard-2": "^5.31.1", + "@ionic-native/zbar": "^5.10.0", + "@ionic/angular": "^4.1.0", + "@ng-bootstrap/ng-bootstrap": "^4.2.2", + "@swimlane/ngx-charts": "^10.1.0", + "angular-calendar": "^0.26.11", + "app": "0.1.0", + "chart.js": "^2.9.3", + "com-badrit-base64": "^0.2.0", + "cordova-android": "^8.1.0", + "cordova-android-support-gradle-release": "^3.0.1", + "cordova-open-native-settings": "^1.5.2", + "cordova-opentok-android-permissions": "^1.0.1", + "cordova-plugin-actionsheet": "^2.3.3", + "cordova-plugin-add-swift-support": "^2.0.2", + "cordova-plugin-android-permissions": "^1.0.2", + "cordova-plugin-androidx": "^1.0.2", + "cordova-plugin-androidx-adapter": "^1.1.0", + "cordova-plugin-appavailability": "^0.4.2", + "cordova-plugin-apprate": "^1.4.0", + "cordova-plugin-badge": "^0.8.8", + "cordova-plugin-ble-central": "^1.2.4", + "cordova-plugin-camera": "^4.1.0", + "cordova-plugin-datepicker": "^0.9.3", + "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-filechooser": "^1.2.0", + "cordova-plugin-filepath": "^1.5.6", + "cordova-plugin-filepicker": "^1.1.6", + "cordova-plugin-fingerprint-aio": "^3.0.0", + "cordova-plugin-firebasex": "^13.0.0", + "cordova-plugin-geolocation": "^4.0.2", + "cordova-plugin-globalization": "^1.11.0", + "cordova-plugin-inappbrowser": "^3.1.0", + "cordova-plugin-ionic-keyboard": "^2.2.0", + "cordova-plugin-ionic-webview": "^4.1.0", + "cordova-plugin-local-notification": "^0.9.0-beta.2", + "cordova-plugin-nativestorage": "^2.3.2", + "cordova-plugin-sms-retriever-manager": "^1.0.3", + "cordova-plugin-splashscreen": "^5.0.3", + "cordova-plugin-statusbar": "^2.4.3", + "cordova-plugin-themeablebrowser": "^0.2.18", + "cordova-plugin-whitelist": "^1.3.4", + "cordova-plugin-wifiwizard2": "^3.1.1", + "cordova-plugin-x-socialsharing": "^6.0.3", + "cordova-sqlite-storage": "^3.4.0", + "cordova-support-google-services": "^1.3.2", + "cordova.plugins.diagnostic": "^5.0.1", + "core-js": "^2.5.4", + "date-fns": "^1.30.1", + "es6-promise-plugin": "^4.1.0", + "ionic2-calendar": "^0.5.8", + "ionic4-rating": "^1.0.9", + "ng-circle-progress": "^1.5.1", + "ng2-file-upload": "^1.3.0", + "ng2-pdf-viewer": "^5.3.2", + "ngx-gauge": "^1.0.0-beta.10", + "npm": "^6.14.11", + "phonegap-nfc": "^1.2.0", + "phonegap-plugin-barcodescanner": "^8.1.0", + "phonegap-plugin-multidex": "^1.0.0", + "primeicons": "^1.0.0", + "primeng": "^7.1.3", + "run": "1.4.0", + "rxjs": "~6.3.3", + "tslib": "^1.10.0", + "uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2", + "xlsx": "^0.14.3", + "zone.js": "~0.8.29" + }, + "devDependencies": { + "@angular-devkit/architect": "~0.12.3", + "@angular-devkit/build-angular": "^0.13.9", + "@angular-devkit/core": "~7.2.3", + "@angular-devkit/schematics": "~7.2.3", + "@angular/cli": "^7.3.6", + "@angular/compiler": "~7.2.2", + "@angular/compiler-cli": "~7.2.2", + "@angular/language-service": "~7.2.2", + "@ionic/angular-toolkit": "~1.4.0", + "@ionic/lab": "3.1.2", + "@types/jasmine": "~2.8.8", + "@types/jasminewd2": "~2.0.3", + "@types/node": "~10.12.0", + "codelyzer": "~4.5.0", + "com.huawei.cordovahmsgmscheckplugin": "file:CordovaHMSPlugin/CordovaHMSGMSCheckPlugin", + "com.huawei.cordovahmslocationplugin": "file:CordovaHMSPlugin/CordovaHMSLocationPlugin", + "cordova-ios": "^6.2.0", + "cordova-plugin-wifiwizard2": "^3.1.1", + "es6-promise-plugin": "^4.1.0", + "jasmine-core": "~2.99.1", + "jasmine-spec-reporter": "~4.2.1", + "karma": "^4.0.1", + "karma-chrome-launcher": "~2.2.0", + "karma-coverage-istanbul-reporter": "~2.0.1", + "karma-jasmine": "~1.1.2", + "karma-jasmine-html-reporter": "^0.2.2", + "node-sass": "^4.13.1", + "protractor": "^5.4.3", + "ts-node": "~8.0.0", + "tslint": "~5.12.0", + "typescript": "3.1.6" + }, + "description": "An Ionic project", + "cordova": { + "plugins": { + "cordova-plugin-whitelist": {}, + "cordova-plugin-statusbar": {}, + "cordova-plugin-device": {}, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-nativestorage": {}, + "cordova-plugin-globalization": {}, + "cordova-plugin-android-permissions": {}, + "cordova-plugin-badge": {}, + "cordova-plugin-ionic-keyboard": {}, + "cordova-plugin-datepicker": {}, + "cordova-plugin-geolocation": {}, + "phonegap-plugin-barcodescanner": { + "ANDROID_SUPPORT_V4_VERSION": "27.+" + }, + "cordova-plugin-ionic-webview": { + "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" + }, + "cordova.plugins.diagnostic": { + "ANDROID_SUPPORT_VERSION": "28.+" + }, + "cordova-open-native-settings": {}, + "cordova-plugin-camera": { + "ANDROID_SUPPORT_V4_VERSION": "27.+" + }, + "cordova-plugin-file": {}, + "cordova-plugin-filepath": {}, + "com-badrit-base64": {}, + "cordova-sqlite-storage": {}, + "cordova-plugin-ble-central": {}, + "uk.co.workingedge.phonegap.plugin.launchnavigator": {}, + "cordova-plugin-themeablebrowser": {}, + "cordova-plugin-inappbrowser": {}, + "cordova-plugin-local-notification": {}, + "cordova-opentok-android-permissions": {}, + "cordova-plugin-appavailability": {}, + "cordova-plugin-apprate": {}, + "cordova-plugin-fingerprint-aio": { + "FACEID_USAGE_DESCRIPTION": "User Authentication" + }, + "cordova-plugin-androidx": {}, + "cordova-plugin-androidx-adapter": {}, + "cordova-plugin-background-geolocation": { + "GOOGLE_PLAY_SERVICES_VERSION": "+" + }, + "phonegap-nfc": {}, + "wifiwizard2": {}, + "com.huawei.cordovahmsgmscheckplugin": {}, + "com.huawei.cordovahmslocationplugin": {}, + "cordova-plugin-x-socialsharing": {}, + "cordova-plugin-firebasex": { + "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true", + "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true", + "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true", + "ANDROID_ICON_ACCENT": "#FF00FFFF", + "ANDROID_FIREBASE_PERFORMANCE_MONITORING": "false", + "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0", + "ANDROID_PLAY_SERVICES_AUTH_VERSION": "19.0.0", + "ANDROID_FIREBASE_ANALYTICS_VERSION": "19.0.0", + "ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.0", + "ANDROID_FIREBASE_CONFIG_VERSION": "21.0.0", + "ANDROID_FIREBASE_PERF_VERSION": "20.0.1", + "ANDROID_FIREBASE_AUTH_VERSION": "21.0.1", + "ANDROID_FIREBASE_INAPPMESSAGING_VERSION": "20.0.0", + "ANDROID_FIREBASE_FIRESTORE_VERSION": "23.0.1", + "ANDROID_FIREBASE_FUNCTIONS_VERSION": "20.0.0", + "ANDROID_FIREBASE_IID_VERSION": "21.1.0", + "ANDROID_FIREBASE_INSTALLATIONS_VERSION": "17.0.0", + "ANDROID_FIREBASE_CRASHLYTICS_VERSION": "18.0.1", + "ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "18.0.1", + "ANDROID_GSON_VERSION": "2.8.7", + "ANDROID_FIREBASE_PERF_GRADLE_PLUGIN_VERSION": "1.4.0" + }, + "cordova-android-support-gradle-release": { + "ANDROID_SUPPORT_VERSION": "27.+" + }, + "cordova-plugin-sms-retriever-manager": { + "PLAY_SERVICES_VERSION": "15.0.1" + }, + "cordova-plugin-file-opener2": { + "ANDROID_SUPPORT_V4_VERSION": "27.+" + }, + "cordova-plugin-filepicker": {}, + "cordova-plugin-filechooser": {} + }, + "platforms": [ + "android", + "ios" + ] + } + } + \ No newline at end of file From 76cbe8ad6b84a6c313d5f19ed8e01c3d5068822d Mon Sep 17 00:00:00 2001 From: umasoodch Date: Sun, 3 Apr 2022 14:01:57 +0300 Subject: [PATCH 9/9] added package.json in gitignore --- Mohem/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/Mohem/.gitignore b/Mohem/.gitignore index 2d936f18..dd1429e5 100644 --- a/Mohem/.gitignore +++ b/Mohem/.gitignore @@ -12,6 +12,7 @@ log.txt .vscode/ npm-debug.log* package-lock.json +package.json .idea/ .ionic/