deleted unused code

MOHEMM-SFH-COLORS
umasoodch 5 years ago
parent 077538efe5
commit b9e58a3739

@ -127,7 +127,6 @@
<plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
<plugin name="cordova-plugin-device" spec="^2.0.3" />
<plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
<plugin name="call-number" spec="~0.0.2" />
<plugin name="cordova-plugin-badge" spec="^0.8.8" />
<plugin name="cordova.plugins.diagnostic" spec="^5.0.1" />
<plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0">

@ -90,16 +90,11 @@ call npm install @ionic-native/device
call ionic cordova plugin add cordova-plugin-local-notification
call npm install @ionic-native/local-notifications
@echo call phone number
call ionic cordova plugin add call-number
call npm install @ionic-native/call-number
@echo badge
call ionic cordova plugin add cordova-plugin-badge
call npm install @ionic-native/badge
@echo biometric features
call ionic cordova plugin add cordova-plugin-fingerprint-aio --variable FACEID_USAGE_DESCRIPTION="User Authentication"
call npm install @ionic-native/fingerprint-aio

@ -93,10 +93,6 @@ echo local notifications
ionic cordova plugin add cordova-plugin-local-notification
npm install @ionic-native/local-notifications
echo call phone number
ionic cordova plugin add call-number
npm install @ionic-native/call-number
echo badge
ionic cordova plugin add cordova-plugin-badge
npm install @ionic-native/badge

@ -3329,11 +3329,6 @@
"resolved": "https://registry.npmjs.org/calendar-utils/-/calendar-utils-0.2.3.tgz",
"integrity": "sha512-wXxvJX/fdVZqrHeyxEWq5kbwALXrjifbY2L3fXvuS815cCwoWv+Uuiu0jkfqZNTtOSKaTXHdMkIhmLRqcC0E5g=="
},
"call-number": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/call-number/-/call-number-0.0.2.tgz",
"integrity": "sha1-GWnh1XQt42na7Q9EM4wawhKDcP8="
},
"caller-callsite": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
@ -9320,11 +9315,6 @@
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
"dev": true
},
"mx.ferreyra.callnumber": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/mx.ferreyra.callnumber/-/mx.ferreyra.callnumber-0.0.2.tgz",
"integrity": "sha512-J9FJiMrfWG9Q8AQEz/cgYLcXTTD/Z5+vfq29hn8K7yVWjxkSzr7zFi7Dpn8wcv2iKHBHDJY+U0z8yoAzDugXMw=="
},
"nan": {
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",

@ -60,7 +60,6 @@
"@swimlane/ngx-charts": "^10.1.0",
"angular-calendar": "^0.26.11",
"app": "0.1.0",
"call-number": "~0.0.2",
"chart.js": "^2.9.3",
"com-badrit-base64": "^0.2.0",
"cordova-android": "^8.1.0",
@ -102,7 +101,6 @@
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"ionic2-calendar": "^0.5.8",
"mx.ferreyra.callnumber": "0.0.2",
"ng-circle-progress": "^1.5.1",
"ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2",
@ -188,7 +186,6 @@
"cordova-plugin-themeablebrowser": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
"call-number": {},
"cordova-opentok-android-permissions": {},
"cordova-plugin-appavailability": {},
"cordova-plugin-apprate": {},

@ -1,28 +1,22 @@
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Platform, Events, MenuController } from '@ionic/angular';
import { TranslatorService } from './hmg-common/services/translator/translator.service';
import { CommonService } from './hmg-common/services/common/common.service';
import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from './hmg-common/services/authentication/models/authenticated-user';
import { TabsBarComponent } from './hmg-common/ui/tabs-bar/tabs-bar.component';
import { KeyboardService } from './hmg-common/services/keyboard/keyboard.service';
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
import { PushService } from '../../src/app/hmg-common/services/push/push.service';
import { LazyLoadingService } from './hmg-common/services/lazy-loading/lazy-loading.service';
import { DomSanitizer } from '@angular/platform-browser';
// import { SplashScreen } from '@ionic-native/splash-screen';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { Router } from '@angular/router';
import { rejects } from 'assert';
@Component({
selector: 'app-root',
styleUrls: ['./app.component.scss'],
templateUrl: 'app.component.html'
})
export class AppComponent implements OnInit, AfterViewInit {
// rootPage:any = LoginPage;
// @ViewChild(Nav) nav: Nav;
export class AppComponent implements OnInit {
start: any = false;
menuList: any = [];
User_name_Emp = '';
@ -34,13 +28,15 @@ export class AppComponent implements OnInit, AfterViewInit {
direction = 'ltr';
User_Job_name: string;
public logoutFlage: any = false;
requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; // this.deviceToken
};
user: boolean;
deviceToken: string;
TeamFlag: string = 'false';
isIOS = false;
public requestGetLoginInfo: {
DeviceType: string;
DeviceToken: string; // this.deviceToken
};
constructor(
public ts: TranslatorService,
private cs: CommonService,
@ -57,17 +53,15 @@ export class AppComponent implements OnInit, AfterViewInit {
) {
this.events.subscribe('img-change', displayImg => {
console.log('app compont: ' + displayImg);
// this.user_image = "data:image/png;base64"+displayImg;
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg);
});
}
ngOnInit() {
this.initializeApp();
}
ngAfterViewInit() {}
initializeApp() {
public initializeApp() {
this.start = false;
this.menu.enable(false);
this.lazyLoadingService.monitorLazyLoading(15, true);
@ -75,7 +69,6 @@ export class AppComponent implements OnInit, AfterViewInit {
this.ts.loadResources(() => {
this.isIOS = this.platform.is('ios') ? true : false;
this.initializeDirection();
// this.statusBar.styleDefault();
this.start = true;
if (this.isIOS) {
this.monitUrlChange();
@ -88,7 +81,7 @@ export class AppComponent implements OnInit, AfterViewInit {
});
}
private monitUrlChange() {
private monitUrlChange() {
this.router.events.subscribe((val) => {
if (this.router.isActive('/authentication/login', true)) {
this.direction = 'ltr';
@ -96,7 +89,6 @@ export class AppComponent implements OnInit, AfterViewInit {
this.direction = TranslatorService.getCurrentDirection();
}
});
}
private startReceivingPushService() {
@ -106,52 +98,35 @@ export class AppComponent implements OnInit, AfterViewInit {
console.log(' in setTimeout startReceiving');
this.getLastLoginInfo();
}, 4000);
}
}
subscribeEvents() {
public subscribeEvents() {
this.platform.backButton.subscribe(() => {
if (this.router.isActive('/authentication/login', true)) {
// tslint:disable-next-line: no-string-literal
navigator['app'].exitApp();
}
});
this.events.subscribe('setMenu', () => {
const user = this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.companyUrl = user.CompanyImageURL
? user.CompanyImageURL
: '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription
? user.CompanyImageDescription
: 'Powered By Cloud Solutions';
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions';
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {
this.user_image = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: '../assets/imgs/profile.png';
}
} else {
this.user_image = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : '../assets/imgs/profile.png';
}
this.User_Job_name = user.JOB_NAME;
console.log(user);
} else {
console.log(user);
}
});
});
this.events.subscribe('getNotCount', badge => {
this.notBadge = badge;
});
this.events.subscribe('myTeamFlag', myTeamFlag => {
this.TeamFlag = myTeamFlag;
});
console.log("this.TeamFlag>>>>>>>>>"+ this.TeamFlag);
this.events.subscribe('getNotCount', badge => { this.notBadge = badge; });
this.events.subscribe('myTeamFlag', myTeamFlag => { this.TeamFlag = myTeamFlag; });
}
private initializeDirection() {
if (this.isIOS) {
if (this.router.isActive('/authentication/login', true)) {
@ -162,14 +137,8 @@ export class AppComponent implements OnInit, AfterViewInit {
} else {
this.direction = TranslatorService.getCurrentDirection();
}
}
private watchUserLoginChangeEvents() {
this.events.subscribe(
AuthenticationService.LOGIN_EVENT,
(user: AuthenticatedUser, time: Date) => {}
);
}
private watchLanguageChangeEvents() {
this.events.subscribe(TranslatorService.CHANGE_EVENT, () => {
this.start = false;
@ -179,92 +148,71 @@ export class AppComponent implements OnInit, AfterViewInit {
}, 100);
});
}
logout() {
public logout() {
this.cs.sharedService.clearAll();
// this.menu.toggle();
this.menu.enable(false);
this.logoutFlage = true;
this.events.publish('logoutFlage', this.logoutFlage);
this.cs.setUpdateImage('', false);
this.TeamFlag = 'false';
this.getLastLoginInfo();
// this.cs.openLogin();
}
openMyTeamPage() {
public openMyTeamPage() {
this.menu.toggle();
this.cs.openMyTeamPage();
}
// profile() {
// this.cs.openProfile();
// this.menu.toggle();
// }
profile() {
public profile() {
this.cs.openEditProfile();
this.menu.toggle();
}
openNotification() {
public openNotification() {
this.cs.openNotificationPage();
this.menu.toggle();
}
openChangePassword() {
public openChangePassword() {
this.cs.openChangePassword();
this.menu.toggle();
}
// openPayslipPage(){
// this.cs.openPayslipPage();
// this.menu.toggle();
// }
private changeImage() {
this.cs.openChangeImagePage();
this.menu.toggle();
}
closeMenu() {
public closeMenu() {
this.menu.toggle();
}
getLastLoginInfo() {
public getLastLoginInfo() {
this.deviceToken = this.cs.getDeviceToken();
// this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken');
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken');
}, 1000);
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken');
}, 1000);
}
this.requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(), // 'Android',
DeviceToken: this.deviceToken// "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
DeviceType: this.cs.getDeviceType(),
DeviceToken: this.deviceToken
};
this.authService.getLoginInfo(this.requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0],
res.Mohemm_GetMobileLoginInfoList[0],
AuthenticationService.IMEI_USER_DATA
);
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
this.user = true;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
}, 3000);
if (this.logoutFlage) {
this.cs.openLogin();
}
@ -278,14 +226,7 @@ export class AppComponent implements OnInit, AfterViewInit {
this.cs.openLogin();
}
}
} else {
// this.user = false;
// this.splashScreen.hide();
// if(this.logoutFlage){
// this.cs.openLogin();
// }
}
} else {}
});
}
}

@ -4,7 +4,7 @@ import { Globalization } from '@ionic-native/globalization/ngx';
import { NumberRangeComponent } from './ui/number-range/number-range.component';
import { IonicModule } from '@ionic/angular';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FormsModule } from '@angular/forms';
import { SSpacerComponent } from './ui/spacer/s-spacer/s-spacer.component';
import { MSpacerComponent } from './ui/spacer/m-spacer/m-spacer.component';
import { LSpacerComponent } from './ui/spacer/l-spacer/l-spacer.component';
@ -33,7 +33,6 @@ import { KeysPipe } from './pipes/keys/keys.pipe';
import { SegmentContentComponent } from './ui/segment-content/segment-content.component';
import { GraphComponent } from './ui/graph/graph.component';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { ExpandableComponent } from './ui/expandable/expandable.component';
import { ProjectsService } from './services/projects/projects.service';
import { NationalityService } from './services/nationality/nationality.service';
@ -43,8 +42,6 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service';
import { BarChartComponent } from './ui/bar-chart/bar-chart.component';
import { DonutChartComponent } from './ui/donut-chart/donut-chart.component';
// import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service';
// import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { EmailComponent } from './ui/email/email.component';
import { Badge } from '@ionic-native/badge/ngx';
import { PushService } from './services/push/push.service';
@ -53,15 +50,12 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service';
import { GuidService } from './services/guid/guid.service';
import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component';
import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component';
// import { GeofencingService } from './services/geofencing/geofencing.service';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { ButtonComponent, Modal } from './ui/button/button.component';
import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component';
import { ListboxModule } from 'primeng/listbox';
import { GenderSelectComponent } from './ui/gender-select/gender-select.component';
import { DateSelectComponent } from './ui/date-select/date-select.component';
import { ToggleButtonComponent } from './ui/toggle-button/toggle-button.component';
import { Footer } from 'primeng/components/common/shared';
import { FooterComponent } from './ui/footer/footer.component';
import { ScrollContentComponent } from './ui/scroll-content/scroll-content.component';
import { ScrollSegmentContentComponent } from './ui/scroll-segment-content/scroll-segment-content.component';
@ -82,20 +76,16 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { DetailButtonComponent } from './ui/detail-button/detail-button.component';
import { RouterModule } from '@angular/router';
import { HeaderButtonComponent } from './ui/header-button/header-button.component';
// import { CallNumber } from '@ionic-native/call-number/ngx';
import { AppRate } from '@ionic-native/app-rate/ngx';
import { RatingService } from './services/rating/rating.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service';
// import { PaymentComponent } from './ui/payment/payment.component';
// import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { FileUploadModule } from 'ng2-file-upload';
// import { FileSelectDirective } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import {Camera} from '@ionic-native/Camera/ngx';
import {File} from '@ionic-native/file/ngx';
import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
@ -120,6 +110,7 @@ import { ChartModule } from 'primeng/chart';
import { GenericHeaderComponent } from './ui/generic-header/generic-header.component';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component';
@NgModule({
imports: [
CommonModule,
@ -153,7 +144,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DatePipeTransform,
DateTimePipe,
SafeHtmlPipe,
// TurncatePipe,
BackButtonComponent,
IfDatePipe,
DynamicTableComponent,
@ -188,7 +178,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
// FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@ -219,7 +208,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DividerComponent,
NavButtonsComponent,
DatePipeTransform,
// TurncatePipe,
TranslatePipe,
DateTimePipe,
SafeHtmlPipe,
@ -254,7 +242,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
// FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@ -293,14 +280,10 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
NativeStorage,
ProgressLoadingService,
PushService,
// UserLocalNotificationService,
// LocalNotifications,
Badge,
LifeCycleService,
HmgBrowserService,
GuidService,
// BackgroundGeolocation,
// GeofencingService,
Keyboard,
KeyboardService,
Diagnostic,
@ -315,7 +298,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
RateService,
Camera,
File,
// PaymentService,
MenuService,
OpenNativeSettings,
BarcodeScanner,

@ -26,7 +26,6 @@ import { SharedDataService } from '../shared-data-service/shared-data.service';
import { Badge } from '@ionic-native/badge/ngx';
import { LifeCycleService } from '../life-cycle/life-cycle.service';
import { Diagnostic } from '@ionic-native/diagnostic/ngx';
//import { CallNumber } from "@ionic-native/call-number/ngx";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Injectable({
@ -100,7 +99,6 @@ export class CommonService {
public badge: Badge,
public lifeCycle: LifeCycleService,
public diagnostic: Diagnostic,
//public callNumber: CallNumber,
public iab: InAppBrowser,
private menu: MenuController,
) {}
@ -1321,20 +1319,6 @@ public getMonthNameAr(value: number): string {
});
}
// public callPhoneNumber(phoneNumber: string) {
// this.platform.ready().then(() => {
// if (this.isCordova()) {
// this.callNumber
// .callNumber(phoneNumber, true)
// .then(res => {})
// .catch(err => {});
// } else {
// window.open("tel:" + phoneNumber);
// // this.presentAlert(this.ts.trPK('error', 'call'));
// }
// });
// }
list_to_tree(list) {
let map = {},
node,

Loading…
Cancel
Save