sales list page and login
39
package-lock.json
generated
@ -9,7 +9,6 @@
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@angular/animations": "^16.0.0",
|
||||
"@angular/cdk": "^16.2.10",
|
||||
"@angular/common": "^16.0.0",
|
||||
"@angular/compiler": "^16.0.0",
|
||||
"@angular/core": "^16.2.11",
|
||||
@ -23,6 +22,7 @@
|
||||
"@capacitor/haptics": "5.0.6",
|
||||
"@capacitor/keyboard": "5.0.6",
|
||||
"@capacitor/status-bar": "5.0.6",
|
||||
"@ionic-native/app-version": "^5.0.0",
|
||||
"@ionic-native/core": "^5.0.0",
|
||||
"@ionic/angular": "^7.5.2",
|
||||
"@ionic/cordova-builders": "^10.0.0",
|
||||
@ -50,6 +50,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "5.3.0",
|
||||
"@typescript-eslint/parser": "5.3.0",
|
||||
"cordova-android": "^12.0.1",
|
||||
"cordova-plugin-app-version": "^0.1.14",
|
||||
"cordova-plugin-camera": "^7.0.0",
|
||||
"cordova-plugin-device": "2.0.2",
|
||||
"cordova-plugin-ionic-keyboard": "^2.0.5",
|
||||
@ -486,6 +487,7 @@
|
||||
"version": "16.2.10",
|
||||
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-16.2.10.tgz",
|
||||
"integrity": "sha512-kOQrPxSMPi66aM9XfwZIjQXhH+q0PkhK4BNMHB9RkvaaQ34ovOrKaGsT7t0+sjlVhiwTiy2mB1Qgz6NlIB0ZZw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
@ -503,6 +505,7 @@
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz",
|
||||
"integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"entities": "^4.4.0"
|
||||
},
|
||||
@ -3193,6 +3196,18 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@ionic-native/app-version": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@ionic-native/app-version/-/app-version-5.0.0.tgz",
|
||||
"integrity": "sha512-/ZKMaKaFsoDYTzBX+ZTapIGiG3WUGBHwfnKXpIPYpNvILoEquKXDi2830en+/ZnsBTYJOHhJo4KUCSuzgj/fzA==",
|
||||
"dependencies": {
|
||||
"@types/cordova": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ionic-native/core": "5.0.0",
|
||||
"rxjs": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@ionic-native/core": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-5.0.0.tgz",
|
||||
@ -7710,6 +7725,12 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/cordova-plugin-app-version": {
|
||||
"version": "0.1.14",
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-app-version/-/cordova-plugin-app-version-0.1.14.tgz",
|
||||
"integrity": "sha512-HN6Yz6IIdRO+iMvCHN/qMe8/O4miOpHH/pDtWNjIYTjV3MzP+XdzFJoFnq2zxlNNXFz0Zn8REGQhFY77vV4AWQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/cordova-plugin-camera": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-7.0.0.tgz",
|
||||
@ -18318,6 +18339,7 @@
|
||||
"version": "16.2.10",
|
||||
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-16.2.10.tgz",
|
||||
"integrity": "sha512-kOQrPxSMPi66aM9XfwZIjQXhH+q0PkhK4BNMHB9RkvaaQ34ovOrKaGsT7t0+sjlVhiwTiy2mB1Qgz6NlIB0ZZw==",
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"parse5": "^7.1.2",
|
||||
"tslib": "^2.3.0"
|
||||
@ -18328,6 +18350,7 @@
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz",
|
||||
"integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"entities": "^4.4.0"
|
||||
}
|
||||
@ -20096,6 +20119,14 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
|
||||
"dev": true
|
||||
},
|
||||
"@ionic-native/app-version": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@ionic-native/app-version/-/app-version-5.0.0.tgz",
|
||||
"integrity": "sha512-/ZKMaKaFsoDYTzBX+ZTapIGiG3WUGBHwfnKXpIPYpNvILoEquKXDi2830en+/ZnsBTYJOHhJo4KUCSuzgj/fzA==",
|
||||
"requires": {
|
||||
"@types/cordova": "latest"
|
||||
}
|
||||
},
|
||||
"@ionic-native/core": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-5.0.0.tgz",
|
||||
@ -23617,6 +23648,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"cordova-plugin-app-version": {
|
||||
"version": "0.1.14",
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-app-version/-/cordova-plugin-app-version-0.1.14.tgz",
|
||||
"integrity": "sha512-HN6Yz6IIdRO+iMvCHN/qMe8/O4miOpHH/pDtWNjIYTjV3MzP+XdzFJoFnq2zxlNNXFz0Zn8REGQhFY77vV4AWQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cordova-plugin-camera": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-7.0.0.tgz",
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^16.0.0",
|
||||
"@angular/cdk": "^16.2.10",
|
||||
"@angular/common": "^16.0.0",
|
||||
"@angular/compiler": "^16.0.0",
|
||||
"@angular/core": "^16.2.11",
|
||||
@ -28,6 +27,7 @@
|
||||
"@capacitor/haptics": "5.0.6",
|
||||
"@capacitor/keyboard": "5.0.6",
|
||||
"@capacitor/status-bar": "5.0.6",
|
||||
"@ionic-native/app-version": "^5.0.0",
|
||||
"@ionic-native/core": "^5.0.0",
|
||||
"@ionic/angular": "^7.5.2",
|
||||
"@ionic/cordova-builders": "^10.0.0",
|
||||
@ -55,6 +55,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "5.3.0",
|
||||
"@typescript-eslint/parser": "5.3.0",
|
||||
"cordova-android": "^12.0.1",
|
||||
"cordova-plugin-app-version": "^0.1.14",
|
||||
"cordova-plugin-camera": "^7.0.0",
|
||||
"cordova-plugin-device": "2.0.2",
|
||||
"cordova-plugin-ionic-keyboard": "^2.0.5",
|
||||
@ -88,7 +89,8 @@
|
||||
"cordova-plugin-camera": {
|
||||
"ANDROIDX_CORE_VERSION": "1.6.+"
|
||||
},
|
||||
"cordova-plugin-network-information": {}
|
||||
"cordova-plugin-network-information": {},
|
||||
"cordova-plugin-app-version": {}
|
||||
},
|
||||
"platforms": [
|
||||
"android"
|
||||
|
||||
0
resources/README.md
Normal file → Executable file
BIN
resources/android/icon/drawable-hdpi-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
resources/android/icon/drawable-ldpi-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
resources/android/icon/drawable-mdpi-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
resources/android/icon/drawable-xhdpi-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
resources/android/icon/drawable-xxhdpi-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.6 KiB |
BIN
resources/android/icon/drawable-xxxhdpi-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
BIN
resources/android/splash/drawable-land-hdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 20 KiB |
BIN
resources/android/splash/drawable-land-ldpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 6.6 KiB |
BIN
resources/android/splash/drawable-land-mdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
BIN
resources/android/splash/drawable-land-xhdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 36 KiB |
BIN
resources/android/splash/drawable-land-xxhdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 49 KiB |
BIN
resources/android/splash/drawable-land-xxxhdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 63 KiB |
BIN
resources/android/splash/drawable-port-hdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 21 KiB |
BIN
resources/android/splash/drawable-port-ldpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 6.8 KiB |
BIN
resources/android/splash/drawable-port-mdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |
BIN
resources/android/splash/drawable-port-xhdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 37 KiB |
BIN
resources/android/splash/drawable-port-xxhdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 50 KiB |
BIN
resources/android/splash/drawable-port-xxxhdpi-screen.png
Normal file → Executable file
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 63 KiB |
BIN
resources/icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 82 KiB |
1
resources/icon.png.md5
Executable file
@ -0,0 +1 @@
|
||||
2aeb4d7c6908a4397252ab8661c42e50
|
||||
BIN
resources/ios/icon/icon-1024.png
Normal file → Executable file
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 59 KiB |
BIN
resources/ios/icon/icon-40.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
resources/ios/icon/icon-40@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
resources/ios/icon/icon-40@3x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 10 KiB |
BIN
resources/ios/icon/icon-50.png
Normal file → Executable file
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
resources/ios/icon/icon-50@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 4.6 KiB |
BIN
resources/ios/icon/icon-60.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
resources/ios/icon/icon-60@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 5.9 KiB |
BIN
resources/ios/icon/icon-60@3x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |
BIN
resources/ios/icon/icon-72.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
resources/ios/icon/icon-72@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 7.6 KiB |
BIN
resources/ios/icon/icon-76.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
resources/ios/icon/icon-76@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 8.1 KiB |
BIN
resources/ios/icon/icon-83.5@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
BIN
resources/ios/icon/icon-small.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 818 B |
BIN
resources/ios/icon/icon-small@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
resources/ios/icon/icon-small@3x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
resources/ios/icon/icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
resources/ios/icon/icon@2x.png
Normal file → Executable file
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
resources/ios/splash/Default-568h@2x~iphone.png
Normal file → Executable file
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 31 KiB |
BIN
resources/ios/splash/Default-667h.png
Normal file → Executable file
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 40 KiB |
BIN
resources/ios/splash/Default-736h.png
Normal file → Executable file
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 44 KiB |
BIN
resources/ios/splash/Default-Landscape-736h.png
Normal file → Executable file
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 44 KiB |
BIN
resources/ios/splash/Default-Landscape@2x~ipad.png
Normal file → Executable file
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 100 KiB |
BIN
resources/ios/splash/Default-Landscape@~ipadpro.png
Normal file → Executable file
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 158 KiB |
BIN
resources/ios/splash/Default-Landscape~ipad.png
Normal file → Executable file
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 22 KiB |
BIN
resources/ios/splash/Default-Portrait@2x~ipad.png
Normal file → Executable file
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 97 KiB |
BIN
resources/ios/splash/Default-Portrait@~ipadpro.png
Normal file → Executable file
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 153 KiB |
BIN
resources/ios/splash/Default-Portrait~ipad.png
Normal file → Executable file
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 22 KiB |
BIN
resources/ios/splash/Default@2x~iphone.png
Normal file → Executable file
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 18 KiB |
BIN
resources/ios/splash/Default@2x~universal~anyany.png
Normal file → Executable file
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 77 KiB |
BIN
resources/ios/splash/Default~iphone.png
Normal file → Executable file
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 7.0 KiB |
BIN
resources/splash.png
Normal file → Executable file
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 58 KiB |
1
resources/splash.png.md5
Executable file
@ -0,0 +1 @@
|
||||
50007304f4721190957196d17b2ae952
|
||||
@ -13,7 +13,7 @@
|
||||
</ion-item>
|
||||
</ion-menu-toggle>
|
||||
</ion-list>
|
||||
|
||||
<!--
|
||||
<ion-list id="labels-list">
|
||||
<ion-list-header>Labels</ion-list-header>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<ion-icon aria-hidden="true" slot="start" ios="bookmark-outline" md="bookmark-sharp"></ion-icon>
|
||||
<ion-label>{{ label }}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-list> -->
|
||||
</ion-content>
|
||||
</ion-menu>
|
||||
<ion-router-outlet id="main-content"></ion-router-outlet>
|
||||
|
||||
@ -116,4 +116,8 @@ ion-note {
|
||||
|
||||
ion-item.selected {
|
||||
--color: var(--ion-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
// @import "theme/filter-modal";
|
||||
|
||||
@import '../theme/filter-modal.scss'
|
||||
@ -6,13 +6,201 @@ import { Component } from '@angular/core';
|
||||
})
|
||||
export class AppComponent {
|
||||
public appPages = [
|
||||
{ title: 'Inbox', url: '/folder/inbox', icon: 'mail' },
|
||||
{ title: 'Outbox', url: '/folder/outbox', icon: 'paper-plane' },
|
||||
{ title: 'Favorites', url: '/folder/favorites', icon: 'heart' },
|
||||
{ title: 'Archived', url: '/folder/archived', icon: 'archive' },
|
||||
{ title: 'Trash', url: '/folder/trash', icon: 'trash' },
|
||||
{ title: 'Spam', url: '/folder/spam', icon: 'warning' },
|
||||
{ title: ' ', url: '/folder/inbox', icon: '' },
|
||||
{ title: ' ', url: '/folder/outbox', icon: '' },
|
||||
{ title: ' ', url: '/folder/favorites', icon: '' },
|
||||
{ title: ' ', url: '/folder/archived', icon: '' },
|
||||
{ title: ' ', url: '/folder/trash', icon: '' },
|
||||
{ title: ' ', url: '/folder/spam', icon: '' },
|
||||
];
|
||||
public labels = ['Family', 'Friends', 'Notes', 'Work', 'Travel', 'Reminders'];
|
||||
public labels = [' ', ' ', ' ', ' ', ' ', ' '];
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// import { Component } from '@angular/core';
|
||||
// import { AlertController, NavController, Platform } from '@ionic/angular';
|
||||
// import { environment } from 'src/environments/environment';
|
||||
// import { PdtriggerService } from 'src/providers/pdtrigger/pdtrigger.service';
|
||||
// import { LoginComponent } from './authencation/login/login.component';
|
||||
// import { PinLockComponent } from './authencation/pin-lock/pin-lock.component';
|
||||
// import { AuthService } from './authencation/auth-service/auth.service';
|
||||
// import { CognitoService } from './authencation/auth-service/cognito.service';
|
||||
// import { AppVersion } from '@ionic-native/app-version/ngx'
|
||||
|
||||
// @Component({
|
||||
// selector: 'app-root',
|
||||
// templateUrl: 'app.component.html',
|
||||
// styleUrls: ['app.component.scss'],
|
||||
// })
|
||||
|
||||
// export class AppComponent {
|
||||
|
||||
// pages: { title: string; icon: string; method: () => any; }[];
|
||||
// private env = environment
|
||||
// protected app_version: any;
|
||||
// rootPage: any = LoginComponent;
|
||||
// userDetails: any = [];
|
||||
// userAccess:boolean = false;
|
||||
|
||||
// constructor(public platform: Platform,private nav: NavController, public statusBar: StatusBar,public aws:AuthService,public shared:CognitoService,public alertCtrl:AlertController,private appVersionProvide:AppVersion,private events:Events,private pdtrigger:PdtriggerService) {
|
||||
// this.initializeApp();
|
||||
// // this.changeDecision();
|
||||
|
||||
// // used for an example of ngFor and navigation
|
||||
// this.pages = [
|
||||
// // { title: 'Home', component: HomePage, icon: 'home' },
|
||||
// { title: 'Home', icon: 'home',method:()=>this.menulist(1) },
|
||||
// { title: 'Logout', icon: 'md-exit',method:()=>this.menulist(2)}
|
||||
// ];
|
||||
|
||||
// }
|
||||
// initializeApp() {
|
||||
// this.platform.ready().then(() => {
|
||||
// this.statusBar.styleDefault();
|
||||
// this.appVersionProvide.getVersionNumber().then((version_number: any) => {
|
||||
// console.log("version number", version_number);
|
||||
// this.app_version = version_number;
|
||||
// }).catch((err:any) => {
|
||||
// console.log("Version Error", err);
|
||||
// });
|
||||
|
||||
// if (this.platform.is('android')) {
|
||||
// this.statusBar.overlaysWebView(false);
|
||||
// this.statusBar.backgroundColorByHexString('#E00201');
|
||||
// }
|
||||
|
||||
// this.shared.getAccessToken().then(() => {
|
||||
// this.getuserDetails();
|
||||
// // this.getCommonSettings();
|
||||
// this.rootPage = PinLockComponent;
|
||||
// }).catch(() => {
|
||||
// setTimeout(() => {
|
||||
// this.rootPage = LoginComponent;
|
||||
// }, 1000);
|
||||
// });
|
||||
|
||||
// // this.networkDetection();
|
||||
// });
|
||||
|
||||
// this.platform.registerBackButtonAction(() => {
|
||||
// if (this.nav.length() === 1) {
|
||||
// if (!this.alertShown) {
|
||||
// let alert = this.alertCtrl.create({
|
||||
// title: 'Confirm Exit',
|
||||
// message: 'Do You Want to Exit?',
|
||||
// buttons: [
|
||||
// {
|
||||
// text: 'Cancel',
|
||||
// role: 'cancel',
|
||||
// handler: () => {
|
||||
// console.log("Cancel clicked");
|
||||
// this.alertShown = false;
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// text: 'Yes',
|
||||
// handler: () => {
|
||||
// console.log("Exit");
|
||||
// this.platform.exitApp();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// });
|
||||
// alert.present();
|
||||
// this.alertShown = true;
|
||||
// }
|
||||
// } else {
|
||||
// this.nav.pop();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// getuserDetails()
|
||||
// {
|
||||
// let userid = this.aws.getlocale();
|
||||
// console.log(userid);
|
||||
// this.aws.getUserProfile(userid).subscribe(res=>{
|
||||
// this.userDetails = res;
|
||||
// if(this.userDetails.dataStatus == true)
|
||||
// {
|
||||
// this.userAccess = true;
|
||||
// this.userDetails = this.userDetails.records[0];
|
||||
// this.events.publish('len_user_name',this.userDetails)
|
||||
// localStorage.setItem("user_details",JSON.stringify( this.userDetails));
|
||||
// }
|
||||
|
||||
// });
|
||||
// }
|
||||
|
||||
// // getCommonSettings(){
|
||||
// // // getCommonConfig
|
||||
// // this.pdtrigger.getCommonSettingsConfig().subscribe(res=>{
|
||||
// // this.commonDetails = res;
|
||||
// // if(this.commonDetails.dataStatus == true){
|
||||
// // localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
|
||||
// // }
|
||||
// // })
|
||||
// // }
|
||||
|
||||
// changeDecision(){
|
||||
// this.events.subscribe('len_user_name',(data:any)=>{
|
||||
// console.log("event data",data)
|
||||
// this.userDetails=data
|
||||
// this.userAccess=true;
|
||||
// // if(data == 'MWISE'){
|
||||
// // this.pages.splice(-1,1)
|
||||
// // this.pages=this.pages.filter(ele=>ele.title != 'Sales PD')
|
||||
// // this.pages.push( { title :'Sales PD',icon:'list',method:()=>this.menulist(3)},
|
||||
// // { title: 'Logout', icon: 'md-exit',method:()=>this.menulist(2)})
|
||||
// // }
|
||||
// // else{
|
||||
// // this.pages=this.pages.filter(ele=>ele.title != 'Sales PD')
|
||||
// // }
|
||||
// let role= this.aws.takeDecisionRouting(this.userDetails)
|
||||
// if(role == 'sales'){
|
||||
// this.pages[0].method=()=>this.menulist(3)
|
||||
// this.pages=this.pages.filter(ele=>ele.title != 'Sales PD' && ele.title != 'Credit PD')
|
||||
// }
|
||||
// else{
|
||||
// this.pages[0].method=()=>this.menulist(1)
|
||||
// this.pages.splice(-1,1)
|
||||
// this.pages=this.pages.filter(ele=>ele.title != 'Sales PD' && ele.title != 'Credit PD')
|
||||
// this.pages.push( { title :'Sales PD',icon:'briefcase',method:()=>this.menulist(3)},
|
||||
// // { title :'Credit PD',icon:'list',method:()=>this.menulist(4)},
|
||||
// { title: 'Logout', icon: 'md-exit',method:()=>this.menulist(2)})
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
// menulist(id: number): void {
|
||||
// switch (id) {
|
||||
// case 1:
|
||||
// this.nav.navigateRoot('/pd-list'); // Use routing to navigate
|
||||
// break;
|
||||
// case 2:
|
||||
// this.aws.logout().subscribe(() => {
|
||||
// // this.salesPDService.clearLocalData();
|
||||
// localStorage.removeItem('product_id_salesPD');
|
||||
// localStorage.removeItem('sales_pd_type');
|
||||
// this.nav.navigateRoot('/login'); // Use routing to navigate
|
||||
// });
|
||||
// break;
|
||||
// case 3:
|
||||
// this.nav.navigateRoot('/sales-pd-list'); // Use routing to navigate
|
||||
// break;
|
||||
// case 4:
|
||||
// this.nav.navigateRoot('/credit-pd-list'); // Use routing to navigate
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// logout(){
|
||||
// // this.aws.logout();
|
||||
// this.nav.navigateRoot('/auth');
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { HttpClientModule, HTTP_INTERCEPTORS} from '@angular/common/http';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AuthService } from './authencation/auth-service/auth.service';
|
||||
@ -14,7 +14,13 @@ import { CognitoService } from './authencation/auth-service/cognito.service';
|
||||
import { PageModule } from './pages/page.module';
|
||||
import { PageRoutingModule } from './pages/page-routing.module';
|
||||
import { IonicStorageModule } from '@ionic/storage-angular';
|
||||
|
||||
import { ToastService } from 'src/providers/common-provider/toast.service';
|
||||
import { IonicStorageService } from 'src/providers/ionic-storage/ionic-storage.service';
|
||||
import { PdtriggerService } from 'src/providers/pdtrigger/pdtrigger.service';
|
||||
import { ReqTokenInterceptor } from 'src/providers/_guard/req-token.interceptor';
|
||||
import { SalesPdService } from './pages/providers/sales-pd/sales-pd.service';
|
||||
// import { AppVersion } from '@ionic-native/app-version/ngx'
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
imports: [
|
||||
@ -29,7 +35,13 @@ import { IonicStorageModule } from '@ionic/storage-angular';
|
||||
PageRoutingModule,
|
||||
IonicStorageModule.forRoot(),
|
||||
],
|
||||
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
||||
providers: [SalesPdService,ReqTokenInterceptor,PdtriggerService,ToastService,IonicStorageService,AuthService,CognitoService,{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
|
||||
{
|
||||
provide:HTTP_INTERCEPTORS,
|
||||
useClass:ReqTokenInterceptor,
|
||||
multi: true
|
||||
},
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@ -24,6 +24,7 @@ export class AuthService {
|
||||
|
||||
|
||||
takeDecisionRouting(userDetails:any){
|
||||
console.log(userDetails)
|
||||
let role_name=userDetails.role_name.toLowerCase()
|
||||
console.log("e",role_name)
|
||||
if(role_name.includes('sales')){
|
||||
@ -102,17 +103,30 @@ export class AuthService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
getlocale() {
|
||||
console.log('222');
|
||||
let session: any = this.shared.getToken() || null;
|
||||
console.log(session, '222');
|
||||
let userid = '';
|
||||
if (session && session.idToken && session.idToken.payload && session.idToken.payload.locale) {
|
||||
userid = session.idToken.payload.locale;
|
||||
console.log(userid)
|
||||
|
||||
// Your JWT token as a string
|
||||
const token = this.shared.getToken();
|
||||
console.log(token)
|
||||
|
||||
if (token) {
|
||||
// Parse the JWT token string into a JSON object
|
||||
const tokenPayload = JSON.parse(atob(token.split('.')[1]));
|
||||
console.log(tokenPayload)
|
||||
// Access the 'locale' property
|
||||
const locale = tokenPayload.locale;
|
||||
|
||||
console.log(locale);
|
||||
|
||||
return locale;
|
||||
} else {
|
||||
console.log('JWT token is not available.');
|
||||
return '';
|
||||
}
|
||||
return userid;
|
||||
}
|
||||
}
|
||||
|
||||
getUserProfile(userid: any): Observable<any> {
|
||||
alert();
|
||||
@ -123,7 +137,7 @@ export class AuthService {
|
||||
return this.http.post(this.apiurl.url + 'getUsersDetails', roles)
|
||||
.pipe(
|
||||
map((result: any) => {
|
||||
this.ionicStorageProvider.checkAndInsertApiDataLocally(result, { 'userid': userid }, 'getUsersDetails','');
|
||||
this.ionicStorageProvider.checkAndInsertApiDataLocally(result, { 'userid': userid }, 'getUsersDetails');
|
||||
return result;
|
||||
}),
|
||||
catchError((error: any) => {
|
||||
|
||||
@ -131,7 +131,7 @@ export class CognitoService {
|
||||
console.log('User not logged in');
|
||||
isLogging = false;
|
||||
}
|
||||
|
||||
console.log(jwtToken)
|
||||
return jwtToken;
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ import { OtpComponent } from './otp/otp/otp.component';
|
||||
IonicModule,
|
||||
AuthencationRoutingModule,
|
||||
ReactiveFormsModule,
|
||||
IonicStorageModule
|
||||
IonicStorageModule,
|
||||
],
|
||||
declarations: [LoginComponent,PinLockComponent,PasswordComponent,OtpComponent],
|
||||
providers:[AuthService,CognitoService]
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<ion-input formControlName="password" type="password" placeholder="*******"></ion-input>
|
||||
</fieldset> -->
|
||||
<!-- </ion-item> -->
|
||||
<!-- <p class="forget-text"><a (click)="change('forget')">Forgot Password?</a></p> -->
|
||||
<p class="forget-text"><a (click)="forgotpassword();">Forgot Password?</a></p>
|
||||
<!-- <p class="signup-text">I'm a new user <a (click)="change('signup')">Sign Up?</a></p> -->
|
||||
<ion-button type="onSubmit" class="login-button" [disabled]="!loginForm.valid || isFormEmpty()" expand="block">Sign In</ion-button>
|
||||
<!-- <ion-button class="google-button" expand="block" color="light"><ion-icon name="logo-google"></ion-icon> Google Signin</ion-button> -->
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
@import '../../../theme/filter-modal.scss';
|
||||
|
||||
::ng-deep .login-bg {
|
||||
--background: none; /* Set it to none to clear the background */
|
||||
background: url('../../../assets/img/misc/login3.jpg') no-repeat center center fixed !important;
|
||||
@ -97,4 +99,6 @@ ion-footer {
|
||||
}
|
||||
::ng-deep .mdc-text-field--filled:not(.mdc-text-field--disabled) {
|
||||
background-color: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { LoadingController, MenuController, ModalController, NavController, NavParams } from '@ionic/angular';
|
||||
import { LoadingController, MenuController, ModalController, NavController } from '@ionic/angular';
|
||||
import { AuthService } from '../auth-service/auth.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { PdtriggerService } from 'src/providers/pdtrigger/pdtrigger.service';
|
||||
@ -122,6 +122,7 @@ export class LoginComponent implements OnInit {
|
||||
if (this.forgetpin === 'true') {
|
||||
this.navCtrl.navigateRoot('/pin-lock', { queryParams: { resetpin: this.forgetpin } });
|
||||
} else if (role === 'sales') {
|
||||
console.log(console.log('sales'))
|
||||
this.pdtrigger.initiateMasterApis('sales');
|
||||
this.navCtrl.navigateRoot('/sales-pd-list');
|
||||
} else {
|
||||
@ -132,8 +133,7 @@ export class LoginComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getCommonSettings(){
|
||||
|
||||
getCommonSettings(){
|
||||
// getCommonConfig
|
||||
this.pdtrigger.getCommonSettingsConfig().subscribe(res=>{
|
||||
this.commonDetails = res;
|
||||
@ -161,7 +161,7 @@ getCommonSettings(){
|
||||
const modal = await this.modalController.create({
|
||||
component: OtpComponent,
|
||||
componentProps: { drop_down_datas: email },
|
||||
cssClass: 'optModal'
|
||||
cssClass: 'small-popup-modal'
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
@ -1,3 +1,30 @@
|
||||
<p>
|
||||
otp works!
|
||||
</p>
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>OTP</ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button clear (click)="closeModal()">
|
||||
<ion-icon name="close" style="font-size: 20px;"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
<ion-row class="topspace">
|
||||
<ion-col></ion-col>
|
||||
<ion-col size="6">
|
||||
<mat-form-field style="width: 80%">
|
||||
<input matInput placeholder="Enter OTP" #otp type="text" maxlength="6">
|
||||
</mat-form-field>
|
||||
<p *ngIf="timeLeft !=0" style="color: red;" type="onSubmit" >{{timeLeft == 0 ? 'Resend OTP' : timeLeft+' Seconds Left....' }}</p>
|
||||
</ion-col>
|
||||
<ion-col size="4"><ion-button class="mt" color="danger" *ngIf="timeLeft ==0" (click)="resendOTP()" type="onSubmit" size="small">{{timeLeft == 0 ? 'Resend OTP' : timeLeft+' Seconds Left....' }}</ion-button></ion-col>
|
||||
<ion-col></ion-col>
|
||||
</ion-row>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<div fxLayout="row" fxLayoutAlign="flex-end">
|
||||
<ion-button type="onSubmit" class="login-button" expand="block" (click)="updatepassword(otp.value)" style="color: #fff;">Verify</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,24 @@
|
||||
@import '../../../../theme/filter-modal.scss';
|
||||
|
||||
|
||||
::ng-deep .toolbar-background{
|
||||
--background: none; /* Set it to none to clear the background */
|
||||
border-color: #b2b2b2 ;
|
||||
background: #fff !important;
|
||||
|
||||
}
|
||||
.toolbar-title-md{
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
::ng-deep .small-popup-modal {
|
||||
--width: 82% !important;
|
||||
--height: 38% !important;
|
||||
--max-width: 52vh !important;
|
||||
--max-height: 40vh !important;
|
||||
--border-radius: 10px;
|
||||
}
|
||||
.mt{
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { ModalController, NavController, NavParams } from '@ionic/angular';
|
||||
import { ToastService } from 'src/providers/common-provider/toast.service';
|
||||
import { AuthService } from '../../auth-service/auth.service';
|
||||
import { ViewController } from '@ionic/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-otp',
|
||||
@ -6,9 +10,68 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./otp.component.scss'],
|
||||
})
|
||||
export class OtpComponent implements OnInit {
|
||||
timeLeft: number = 0;
|
||||
loggedEmailID:any="";
|
||||
interval;
|
||||
drop_down_datas: any;
|
||||
constructor(private modalController: ModalController,public toast:ToastService,public navCtrl: NavController, public navParams: NavParams,public aws: AuthService) {
|
||||
this.timeLeft = 60;
|
||||
this.interval = setInterval(() => {
|
||||
if(this.timeLeft > 0) {
|
||||
this.timeLeft--;
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
ngOnInit() {
|
||||
this.drop_down_datas = this.navParams.get('drop_down_datas');
|
||||
console.log(this.drop_down_datas);
|
||||
}
|
||||
updatepassword(otp:any){
|
||||
console.log('data');
|
||||
console.log(this.drop_down_datas,otp);
|
||||
const mail = this.drop_down_datas.split(/\s/).join('');
|
||||
this.aws.resetpassword(mail,otp).subscribe(data => {
|
||||
console.log('data');
|
||||
console.log(data)
|
||||
if (data.status == 200) {
|
||||
this.toast.lenderappmessage('Password Reset Successfully');
|
||||
// alert('Password Reset Successfully');
|
||||
// this.dialogRef.close();
|
||||
this.modalController.dismiss({ success: true });
|
||||
} else
|
||||
{
|
||||
alert('OTP is invalid. Plesae enter correct OTP.!');
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
ionViewDidLoad() {
|
||||
console.log('ionViewDidLoad OtpPage');
|
||||
}
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {}
|
||||
closeModal() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
resendOTP() {
|
||||
console.log(this.drop_down_datas);
|
||||
console.log(this.loggedEmailID)
|
||||
this.timeLeft = 60;
|
||||
this.aws.generateotp(this.drop_down_datas.split(/\s/).join('')).subscribe(
|
||||
response => {
|
||||
// if(response.status == 200)
|
||||
console.log(response)
|
||||
this.interval = setInterval(() => {
|
||||
if(this.timeLeft > 0) {
|
||||
this.timeLeft--;
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
// alert(response.msg);//comment this.
|
||||
}
|
||||
},1000)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,14 +8,14 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content [fullscreen]="true">
|
||||
<ion-header collapse="condense">
|
||||
<!-- <ion-header collapse="condense">
|
||||
<ion-toolbar>
|
||||
<ion-title size="large">{{ folder }}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
</ion-header> -->
|
||||
|
||||
<div id="container">
|
||||
<!-- <div id="container">
|
||||
<strong class="capitalize">{{ folder }}</strong>
|
||||
<p>Explore <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI Components</a></p>
|
||||
</div>
|
||||
</div> -->
|
||||
</ion-content>
|
||||
|
||||
@ -3,13 +3,17 @@ import { CommonModule } from '@angular/common';
|
||||
|
||||
import { PageRoutingModule } from './page-routing.module';
|
||||
import { PdListComponent } from './pd-list/pd-list.component';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { SharedModule } from 'src/shared/shared.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [PdListComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
PageRoutingModule
|
||||
PageRoutingModule,
|
||||
SharedModule,
|
||||
IonicModule.forRoot(),
|
||||
]
|
||||
})
|
||||
export class PageModule { }
|
||||
|
||||
@ -1,3 +1,71 @@
|
||||
<p>
|
||||
pd-list works!
|
||||
</p>
|
||||
<ion-header>
|
||||
<ion-toolbar color="optblue">
|
||||
<ion-buttons slot="start">
|
||||
<ion-menu-button></ion-menu-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Sales PD List</ion-title>
|
||||
<!-- <ion-buttons slot="end">
|
||||
<ion-button (click)="advancefilter()">
|
||||
<ion-icon name="options" style="font-size: 23px;"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons> -->
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding >
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher-content></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<!-- <div class="pdf_source">
|
||||
<pdf-viewer [src]="reportSrc" [render-text]="true" [original-size]="false" [autoresize]="true" style="display: block;"></pdf-viewer>
|
||||
</div> -->
|
||||
<ion-list>
|
||||
<ion-item-sliding *ngFor="let val of sales_displayValue" style="padding: 0px">
|
||||
<ion-item>
|
||||
<ion-grid>
|
||||
<ion-row class="ion-align-items-center">
|
||||
<ion-col class="applicant_name" col-6 *ngIf="val.applicant_name != null" (click)="val.status != 'COMPLETED' ? editForm(val) : presentActionSheet(val)">
|
||||
<h1>{{val.applicant_name}}</h1>
|
||||
</ion-col>
|
||||
<ion-col col-6 *ngIf="val.applicant_name == null">
|
||||
<h1>Name Not Given</h1>
|
||||
</ion-col>
|
||||
<ion-col col-6 class="ion-text-end">
|
||||
<div style="font-size: 10px;color: #473938;">
|
||||
<p>{{val.createdon | date:'dd-MM-yy h:mm:ss a'}}</p>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row class="ion-align-items-center">
|
||||
<ion-col col-6 (click)="val.status != 'COMPLETED' ? editForm(val) : presentActionSheet(val)">
|
||||
<h6 class="app_id">{{val.sales_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</h6>
|
||||
</ion-col>
|
||||
<ion-col col-6 class="ion-text-end">
|
||||
<div style="font-size: 13px;">
|
||||
<h6>
|
||||
<span style="font-size: 13px;color: black;">{{val.abbr}}</span> <span style="font-weight: bold;color: black;">|</span> <span style="font-weight: bold; font-size: 13px" [ngStyle]="{'color': val.status == 'COMPLETED' ? 'green' : 'orange'}">{{val.status}}</span>
|
||||
</h6>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
<!-- <ion-row>
|
||||
<ion-col text-right col-12>
|
||||
<a [href]="val.link" [target]="val.link"><ion-icon style="color: #008828; font-size: 25px;" name="link"></ion-icon></a>
|
||||
</ion-col>
|
||||
</ion-row> -->
|
||||
</ion-item>
|
||||
<ion-item-options>
|
||||
<ion-item-option (click)="goToUrl(val.link)">
|
||||
<ion-icon style="color: #69f0ae; font-size: 25px;" name="link"></ion-icon>
|
||||
</ion-item-option>
|
||||
<!-- <ion-item-option color="danger">Delete</ion-item-option> -->
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
<ion-fab slot="fixed" vertical="bottom" horizontal="end" (click)="newForm()" *ngIf="is_sales_login">
|
||||
<ion-fab-button size="small">
|
||||
<ion-icon name="add"></ion-icon>
|
||||
</ion-fab-button>
|
||||
</ion-fab>
|
||||
</ion-content>
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
.header-md{
|
||||
background-color: #ff0303 !important;
|
||||
}
|
||||
ion-item-sliding{
|
||||
border-bottom: 1px solid #b4b5b9;
|
||||
}
|
||||
ion-col{
|
||||
padding: 0px !important;
|
||||
}
|
||||
h1{
|
||||
margin: 2px 0;
|
||||
font-size: 20px !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: black;
|
||||
}
|
||||
p{
|
||||
margin: 0px !important;
|
||||
}
|
||||
h6{
|
||||
margin: 0px !important;
|
||||
}
|
||||
::ng-deep .item-native{
|
||||
padding-inline-start: unset !important;
|
||||
}
|
||||
ion-grid{
|
||||
padding:0px;
|
||||
}
|
||||
.fadeIn {
|
||||
animation-name: fadeIn;
|
||||
animation-duration: 15s;
|
||||
transition: all 0.5s cubic-bezier(.36,-0.64,.34,1.76);
|
||||
}
|
||||
@font-face{
|
||||
font-family: Roboto;
|
||||
src: url('../../../assets/fonts/Roboto-Bold.ttf')!important;
|
||||
}
|
||||
.app_id{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 12px;
|
||||
color: #473938;
|
||||
}
|
||||
.label-md{
|
||||
margin: 0px;
|
||||
}
|
||||
.item-md h4 {
|
||||
font-size: 10px;
|
||||
}
|
||||
.item-md p{
|
||||
font-size: 12px;
|
||||
}
|
||||
.item-md ion-icon[item-start] + .item-inner{
|
||||
margin-left: 0px;
|
||||
}
|
||||
.applicant_name{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
|
||||
.action-sheet-md .action-sheet-group:first-child {
|
||||
padding-top: 0.8rem;
|
||||
border-radius: 15px 15px 0 0;
|
||||
}
|
||||
.action-sheet-container {
|
||||
padding: 0 3% 0 3%;
|
||||
font-weight:bold
|
||||
}
|
||||
|
||||
.action-sheet-md .action-sheet-button {
|
||||
// font-weight: 500;
|
||||
border-top:1px solid lightgray;
|
||||
}
|
||||
.action-sheet-md .action-sheet-icon {
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
p.note{
|
||||
color: gray;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
float: center;
|
||||
|
||||
}
|
||||
@ -1,5 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActionSheetController, MenuController, ModalController, NavController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/authencation/auth-service/auth.service';
|
||||
import { LoadingService } from 'src/providers/common-provider/loading.service';
|
||||
import { ToastService } from 'src/providers/common-provider/toast.service';
|
||||
import { IonicStorageService } from 'src/providers/ionic-storage/ionic-storage.service';
|
||||
import { SalesPdService } from '../providers/sales-pd/sales-pd.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
const pd_key ='local_sales_PDs'
|
||||
@Component({
|
||||
selector: 'app-pd-list',
|
||||
templateUrl: './pd-list.component.html',
|
||||
@ -7,8 +15,287 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class PdListComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
is_sales_login:boolean = false
|
||||
common: any;
|
||||
sales_displayValue: any=[];
|
||||
localPDs: any = [];
|
||||
loader_access:any=true
|
||||
findListIndex: any;
|
||||
filterMsg: boolean = false;
|
||||
apiurl: any
|
||||
filter_drop_down_data: any;
|
||||
visibleItems: any[] = []; // Items to display in the current view
|
||||
itemsPerView = 10; // Number of items to display at a time
|
||||
startIndex = 0; // Start index of the visible range
|
||||
|
||||
constructor(public Menu:MenuController,public aws:AuthService,public actionSheetCtrl: ActionSheetController,public navCtrl: NavController,private toastProvider:ToastService,private loaderProvider:LoadingService,private modalCtrl:ModalController,
|
||||
private ionicStorageService:IonicStorageService,public salesPDService:SalesPdService) {
|
||||
|
||||
let userDetails:any = localStorage.getItem('user_details');
|
||||
console.log('userdetails');
|
||||
console.log(userDetails);
|
||||
let role= this.aws.takeDecisionRouting(JSON.parse(userDetails))
|
||||
if(role == 'sales'){
|
||||
this.is_sales_login = true
|
||||
}
|
||||
else {
|
||||
this.is_sales_login = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
|
||||
|
||||
|
||||
ionViewWillEnter() {
|
||||
console.log('ionViewWillEnter SalesPDlistPage');
|
||||
setTimeout(() => {
|
||||
let commonData:any = localStorage.getItem('commonSettings')
|
||||
this.common = JSON.parse(commonData);
|
||||
if (this.common) {
|
||||
this.common = this.common.default_pd_list_count;
|
||||
this.common = this.common.count + ' ' + this.common.factor;
|
||||
}
|
||||
}, 300);
|
||||
// this.cameraProvider.checkGPSPermission();
|
||||
// this.salesPDService.clearLocalData();
|
||||
}
|
||||
|
||||
ionViewDidEnter() {
|
||||
this.Menu.enable(false);
|
||||
this.getListofPD();
|
||||
}
|
||||
|
||||
ionViewWillLeave(){
|
||||
this.Menu.enable(true);
|
||||
}
|
||||
|
||||
|
||||
doRefresh(event: CustomEvent) {
|
||||
console.log('refresh', event);
|
||||
this.getListofPD();
|
||||
setTimeout(() => {
|
||||
// console.log('Async operation has ended');
|
||||
event.detail.complete();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
getListofLocalPD() {
|
||||
return this.ionicStorageService.getLocalDataWithFilter(pd_key, { name: 'local_pd_id', type: 'filter', value: null })
|
||||
.then(result => {
|
||||
console.log(result, this.sales_displayValue);
|
||||
if (result && result.length > 0) {
|
||||
const result_val = result;
|
||||
result_val.sort((a:any, b:any) => 0 - (a > b ? -1 : 1));
|
||||
this.localPDs = result_val;
|
||||
this.sales_displayValue.unshift(...this.localPDs);
|
||||
}
|
||||
this.loader_access = false;
|
||||
})
|
||||
.catch(err => {
|
||||
this.loader_access = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getListofPD() {
|
||||
return this.ionicStorageService.getLocalDataWithFilter(pd_key, { name: 'sales_pd_id', type: 'filter', value: null })
|
||||
.then(local_res => {
|
||||
console.log('local_res');
|
||||
this.salesPDService.getSalesPDList(this.is_sales_login)
|
||||
.subscribe(res => {
|
||||
if (res.dataStatus) {
|
||||
this.sales_displayValue = res.records;
|
||||
|
||||
console.log(this.sales_displayValue);
|
||||
|
||||
let user1:any = localStorage.getItem('user_details');
|
||||
let user = JSON.parse(user1);
|
||||
|
||||
if (local_res && local_res.length > 0) {
|
||||
|
||||
local_res.forEach((local_obj:any) => {
|
||||
if (local_obj && local_obj.sales_pd_id && local_obj.sales_pd_id !== null) {
|
||||
console.log(local_obj);
|
||||
this.findListIndex = this.sales_displayValue.findIndex((val:any) => val.sales_pd_id === local_obj.sales_pd_id);
|
||||
if (this.sales_displayValue[this.findListIndex]) {
|
||||
this.sales_displayValue[this.findListIndex].is_pd_synced = local_obj.is_pd_synced;
|
||||
this.sales_displayValue[this.findListIndex].is_all_section_synced = local_obj.is_all_section_synced;
|
||||
this.sales_displayValue[this.findListIndex].is_pd_completed = local_obj.is_pd_completed;
|
||||
this.sales_displayValue[this.findListIndex].is_pd_completed_sync = local_obj.is_pd_completed_sync;
|
||||
if (local_obj.hasOwnProperty('status') && local_obj.status) {
|
||||
this.sales_displayValue[this.findListIndex].status = local_obj.status;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.sales_displayValue.length > 0) {
|
||||
console.log(this.sales_displayValue);
|
||||
if (!this.is_sales_login) {
|
||||
this.sales_displayValue = this.sales_displayValue.filter((vll:any) => vll.status === 'COMPLETED');
|
||||
}
|
||||
this.filterMsg = true;
|
||||
let products:any = [];
|
||||
let lenders:any = [];
|
||||
let pd_status:any = [];
|
||||
this.sales_displayValue.map((val:any) => {
|
||||
console.log('vvvaaall');
|
||||
console.log(val);
|
||||
this.apiurl = environment
|
||||
console.log(this.apiurl.authorization);
|
||||
let link;
|
||||
if (this.apiurl.authorization === 'sparqvenba2018') {
|
||||
console.log(this.apiurl.authorization);
|
||||
link = 'http://salesapp.devopsmcfinance.com/secure?saltkey=VQDa79tyBlpu7ZuKt6U';
|
||||
} else {
|
||||
console.log(this.apiurl.authorization);
|
||||
link = 'https://salesapp.smcfinance.com/app/secure?saltkey=VQDa79tyBlpu7ZuKt6U';
|
||||
}
|
||||
console.log(link);
|
||||
let PDID = val.sales_pd_sno;
|
||||
let finallink = link + '&PDID=' + PDID + '&Email=' + user.email;
|
||||
console.log('finallink');
|
||||
console.log(finallink);
|
||||
val.link = finallink;
|
||||
if (products.length > 0) {
|
||||
if (products.filter((pro:any) => pro === val.product_id).length === 0) {
|
||||
products.push(val.product_id);
|
||||
}
|
||||
} else {
|
||||
products.push(val.product_id);
|
||||
}
|
||||
if (lenders.length > 0) {
|
||||
if (lenders.filter((pro:any) => pro === val.lender_id).length === 0) {
|
||||
lenders.push(val.lender_id);
|
||||
}
|
||||
} else {
|
||||
lenders.push(val.lender_id);
|
||||
}
|
||||
if (pd_status.length > 0) {
|
||||
if (pd_status.filter((pro:any) => pro === val.status).length === 0) {
|
||||
pd_status.push(val.status);
|
||||
}
|
||||
} else {
|
||||
pd_status.push(val.status);
|
||||
}
|
||||
});
|
||||
this.filter_drop_down_data = { product_ids: products, lender_ids: lenders, pd_status: pd_status };
|
||||
console.log(this.sales_displayValue);
|
||||
}
|
||||
this.getListofLocalPD();
|
||||
} else {
|
||||
this.loader_access = false;
|
||||
this.sales_displayValue = [];
|
||||
this.getListofLocalPD();
|
||||
}
|
||||
}, err => {
|
||||
console.log('Error', err);
|
||||
this.loader_access = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
newForm(){
|
||||
this.salesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
|
||||
localStorage.removeItem('product_id_salesPD')
|
||||
localStorage.removeItem('sales_pd_type')
|
||||
// this.navCtrl.push(HomePage)
|
||||
}
|
||||
|
||||
editForm(valueObj: any) {
|
||||
let primaryKey = 'sales_pd_id';
|
||||
|
||||
if (valueObj.local_pd_id !== null && valueObj.sales_pd_id === null && valueObj.is_pd_synced === false) {
|
||||
primaryKey = 'local_pd_id';
|
||||
}
|
||||
|
||||
this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY', valueObj[primaryKey]).then(() => {
|
||||
this.salesPDService.insertData_Replace('sales_rand_string', valueObj['rand_string']).then(() => {
|
||||
localStorage.setItem('product_id_salesPD', valueObj.product_id);
|
||||
|
||||
if (!valueObj.hasOwnProperty('sales_pd_type') && !valueObj.sales_pd_type) {
|
||||
valueObj.sales_pd_type = '1';
|
||||
}
|
||||
|
||||
localStorage.setItem('sales_pd_type', valueObj.sales_pd_type);
|
||||
|
||||
this.navCtrl.navigateForward('/section-list', {
|
||||
queryParams: {
|
||||
product_id: valueObj.product_id,
|
||||
sales_pd_type: valueObj.sales_pd_type,
|
||||
link: valueObj.link,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
presentActionSheet(value_obj:any) {
|
||||
let buttons = [
|
||||
{
|
||||
text: 'View Report',
|
||||
icon: 'eye',
|
||||
role: 'destructive',
|
||||
handler: () => {
|
||||
// this.salesPDpdf(value_obj.sales_pd_id);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Cancel',
|
||||
role: 'cancel',
|
||||
icon: 'arrow-round-back',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
let actionSheet:any = this.actionSheetCtrl.create({
|
||||
buttons: buttons
|
||||
});
|
||||
|
||||
actionSheet.present();
|
||||
}
|
||||
|
||||
// salesPDpdf(pdfdetail:any){
|
||||
// this.loaderProvider.pdloader("Processing..")
|
||||
// this.salesPDService.getSalesPdpdf(pdfdetail)
|
||||
// .subscribe(data => {
|
||||
// if (data.status == 200) {
|
||||
// let profileModal:any = this.modalCtrl.create(ReportViewer,{'report_link':data.records});
|
||||
// profileModal.present();
|
||||
|
||||
// }
|
||||
// this.loaderProvider.dismissLoader();
|
||||
// },err=>{
|
||||
// this.loaderProvider.dismissLoader()
|
||||
// console.log(err);
|
||||
// let profileModal = this.modalCtrl.create(ReportViewer,{'error_msg':'Please check your internet connection to view PD reports. They are available only if you are connected.'});
|
||||
// profileModal.present();
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
|
||||
updateVisibleItems() {
|
||||
this.visibleItems = this.sales_displayValue.slice(this.startIndex, this.startIndex + this.itemsPerView);
|
||||
console.log(this.visibleItems)
|
||||
}
|
||||
|
||||
// Calculate the visible range based on user interaction or screen size
|
||||
onScroll(event: any) {
|
||||
const scrollTop = event.target.scrollTop;
|
||||
this.startIndex = Math.floor(scrollTop / 50); // Adjust this value based on your item height
|
||||
this.updateVisibleItems();
|
||||
console.log('scroll')
|
||||
}
|
||||
|
||||
goToUrl(url:any){
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
16
src/app/pages/providers/sales-pd/sales-pd.service.spec.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SalesPdService } from './sales-pd.service';
|
||||
|
||||
describe('SalesPdService', () => {
|
||||
let service: SalesPdService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(SalesPdService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
119
src/app/pages/providers/sales-pd/sales-pd.service.ts
Normal file
@ -0,0 +1,119 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, forkJoin, tap } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { IonicStorageService } from 'src/providers/ionic-storage/ionic-storage.service';
|
||||
import { Storage } from '@ionic/storage-angular'
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SalesPdService {
|
||||
private apiUrl = environment.url
|
||||
constructor(public http: HttpClient, private ionicStorageProvider:IonicStorageService,private storage: Storage) { }
|
||||
|
||||
getSalesPDList(isSalesLogin: boolean): Observable<any> {
|
||||
let userDetails:any = localStorage.getItem('user_details')
|
||||
const det = JSON.parse(userDetails);
|
||||
const params = { fk_entity_id: det.fk_entity_id, userid: det.userid };
|
||||
|
||||
// if (this.networkProvider.getCurrentNetworkStatus() === ConnectionStatus.online) {
|
||||
let complete_url = this.apiUrl + 'listSalesPD/' + det.fk_entity_id;
|
||||
if (isSalesLogin) {
|
||||
complete_url = complete_url+'/'+det.userid+'/'+det.user_role;
|
||||
}
|
||||
const options = { params: new HttpParams({ fromObject: params }) };
|
||||
|
||||
return this.http.get(complete_url, options).pipe(
|
||||
tap((res: any) => {
|
||||
this.ionicStorageProvider.checkAndInsertApiDataLocally(res, params, 'listSalesPD');
|
||||
})
|
||||
);
|
||||
// } else {
|
||||
return this.ionicStorageProvider.getApiDataFromLocally(params, 'listSalesPD');
|
||||
// }
|
||||
}
|
||||
|
||||
insertData_Replace(key:any,data:any){
|
||||
// console.log(key)
|
||||
return this.storage.set(key,data);
|
||||
}
|
||||
|
||||
getSalesPdpdf(pdfdetail:any): Observable<any> {
|
||||
return this.http.get<any[]>(this.apiUrl + "downloadSalesPDReport/" + pdfdetail)
|
||||
}
|
||||
|
||||
getAllMasterDatas(TableName: string): Observable<any> {
|
||||
let params = { "master_name": TableName }
|
||||
return new Observable((observer:any)=>{
|
||||
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||
return this.http.post(this.apiUrl + 'getListOfMaster', { "master_name": TableName }).subscribe(result=>{
|
||||
return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'getListOfMaster',true).then(rr=>{
|
||||
observer.next(result);
|
||||
observer.complete();
|
||||
})
|
||||
})
|
||||
// }
|
||||
// else {
|
||||
// return this.ionicStorageProvider.getApiDataFromLocally(params,'getListOfMaster').subscribe(result=>{
|
||||
// observer.next(result);
|
||||
// observer.complete();
|
||||
// })
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
getCityPincode(value:any){
|
||||
let params={records:{state_id:value}}
|
||||
return new Observable((observer:any)=>{
|
||||
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||
return this.http.post(this.apiUrl+"getListOfStatesAndCities",params).subscribe(result=>{
|
||||
return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'getListOfStatesAndCities',true).then(res=>{
|
||||
observer.next(result);
|
||||
observer.complete();
|
||||
})
|
||||
})
|
||||
// }
|
||||
// else {
|
||||
// return this.ionicStorageProvider.getApiDataFromLocally(params,'getListOfStatesAndCities').subscribe(result=>{
|
||||
// observer.next(result);
|
||||
// observer.complete();
|
||||
// })
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
callMultipleApisForTemplate(product_arr:any) {
|
||||
let users:any=localStorage.getItem('user_details')
|
||||
users=JSON.parse(users)
|
||||
let arr_call = []
|
||||
for(let val of product_arr) {
|
||||
let params1 = {records:{lender_id:users.fk_entity_id,product_id:val.product_id,sales_pd_type:'1'}}
|
||||
let params2 = {records:{lender_id:users.fk_entity_id,product_id:val.product_id,sales_pd_type:'2'}}
|
||||
let api1= this.http.post(this.apiUrl+'loadSalesPDTemplate',params1)
|
||||
let api2= this.http.post(this.apiUrl+'loadSalesPDTemplate',params2)
|
||||
arr_call.push(api1)
|
||||
arr_call.push(api2)
|
||||
}
|
||||
forkJoin(arr_call).subscribe((res:any)=>{
|
||||
console.log("rrsadfsadf",res)
|
||||
res.forEach((val:any)=>{
|
||||
if(val['dataStatus']) {
|
||||
let params = {records:{lender_id:val.records.lender_id,product_id:val.records.product_id,sales_pd_type:val.records.sales_pd_type}}
|
||||
// this.ionicStorageProvider.checkAndInsertApiDataLocally(val,params,'loadSalesPDTemplate',true).then(rr=>)
|
||||
val.params = params
|
||||
}
|
||||
})
|
||||
console.log("final lksdjfl asdf", res);
|
||||
this.ionicStorageProvider.insertDataWithReplace('loadSalesPDTemplate',res).then(rr=>{})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
clear_local_key(key:any){
|
||||
return this.storage.remove(key)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
BIN
src/assets/fonts/Roboto-Black.ttf
Executable file
BIN
src/assets/fonts/Roboto-BlackItalic.ttf
Executable file
BIN
src/assets/fonts/Roboto-Bold.ttf
Executable file
BIN
src/assets/fonts/Roboto-BoldItalic.ttf
Executable file
BIN
src/assets/fonts/Roboto-Italic.ttf
Executable file
BIN
src/assets/fonts/Roboto-Light.ttf
Executable file
BIN
src/assets/fonts/Roboto-LightItalic.ttf
Executable file
BIN
src/assets/fonts/Roboto-Medium.ttf
Executable file
BIN
src/assets/fonts/Roboto-MediumItalic.ttf
Executable file
BIN
src/assets/fonts/Roboto-Regular.ttf
Executable file
BIN
src/assets/fonts/Roboto-Thin.ttf
Executable file
BIN
src/assets/fonts/Roboto-ThinItalic.ttf
Executable file
@ -25,3 +25,12 @@
|
||||
@import "@ionic/angular/css/text-alignment.css";
|
||||
@import "@ionic/angular/css/text-transformation.css";
|
||||
@import "@ionic/angular/css/flex-utils.css";
|
||||
|
||||
|
||||
|
||||
// ion-content {
|
||||
// --padding-start: 16px; // Adjust as needed
|
||||
// --padding-end: 16px; // Adjust as needed
|
||||
// --padding-top: 16px; // Adjust as needed
|
||||
// --padding-bottom: 16px; // Adjust as needed
|
||||
// }
|
||||
17
src/providers/_guard/req-token.interceptor.spec.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ReqTokenInterceptor } from './req-token.interceptor';
|
||||
|
||||
describe('ReqTokenInterceptor', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({
|
||||
providers: [
|
||||
ReqTokenInterceptor
|
||||
]
|
||||
}));
|
||||
|
||||
it('should be created', () => {
|
||||
console.log("fuck u");
|
||||
const interceptor: ReqTokenInterceptor = TestBed.inject(ReqTokenInterceptor);
|
||||
expect(interceptor).toBeTruthy();
|
||||
});
|
||||
});
|
||||
105
src/providers/_guard/req-token.interceptor.ts
Normal file
@ -0,0 +1,105 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor,
|
||||
HttpErrorResponse,
|
||||
} from '@angular/common/http';
|
||||
import { Observable, BehaviorSubject, throwError } from 'rxjs';
|
||||
import { catchError, switchMap } from 'rxjs/operators';
|
||||
import { NavController } from '@ionic/angular'; // Import NavController from Ionic
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { CognitoService } from 'src/app/authencation/auth-service/cognito.service';
|
||||
import { AuthService } from 'src/app/authencation/auth-service/auth.service';
|
||||
import { ToastService } from '../common-provider/toast.service';
|
||||
|
||||
@Injectable()
|
||||
export class ReqTokenInterceptor implements HttpInterceptor {
|
||||
|
||||
private env = environment
|
||||
|
||||
constructor(public injector: Injector) {}
|
||||
|
||||
isRefreshingToken: boolean = false;
|
||||
tokenSubject: BehaviorSubject<string> = new BehaviorSubject<string>('');
|
||||
|
||||
addToken(req: HttpRequest<any>, token: string): HttpRequest<any> {
|
||||
return req.clone({
|
||||
setHeaders: {
|
||||
'Authorization': this.env.authorization, // Replace with your authorization header
|
||||
'Token': token,
|
||||
'From': '2',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
intercept(req: HttpRequest<any>,next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
const cognitoService = this.injector.get(CognitoService);
|
||||
console.log(cognitoService)
|
||||
let token = cognitoService.getToken() || '';
|
||||
console.log(token)
|
||||
console.log('Token From Interceptor >>', cognitoService.getToken());
|
||||
// if (token !== '') {
|
||||
// token = token.getIdToken().getJwtToken();
|
||||
// }
|
||||
// console.log(token)
|
||||
return next.handle(this.addToken(req, token)).pipe(
|
||||
catchError((error) => {
|
||||
if (error instanceof HttpErrorResponse) {
|
||||
if (error.status === 401 && error.error.error.toLowerCase() === 'invalid token!') {
|
||||
return this.handle401Error(req, next, error);
|
||||
} else {
|
||||
return throwError(error);
|
||||
}
|
||||
} else {
|
||||
console.log('Observable error');
|
||||
return throwError(error);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
handle401Error(req: HttpRequest<any>, next: HttpHandler, err: HttpErrorResponse): Observable<any> {
|
||||
console.log('err', err);
|
||||
const cognitoService = this.injector.get(CognitoService);
|
||||
console.log('entered', this.isRefreshingToken, this.tokenSubject);
|
||||
|
||||
if (err.status === 401 && err.error.error.toLowerCase() === 'invalid token!') {
|
||||
if (!this.isRefreshingToken) {
|
||||
this.isRefreshingToken = true;
|
||||
this.tokenSubject.next('');
|
||||
return cognitoService.refresh().pipe(
|
||||
switchMap((newToken: string) => {
|
||||
if (newToken) {
|
||||
this.isRefreshingToken = false;
|
||||
this.tokenSubject.next(newToken);
|
||||
return next.handle(this.addToken(req, cognitoService.getToken().getIdToken().getJwtToken()));
|
||||
}
|
||||
const awsService = this.injector.get(AuthService);
|
||||
return awsService.logout();
|
||||
})
|
||||
);
|
||||
} else {
|
||||
console.log('Else Part 1201');
|
||||
return next.handle(this.addToken(req, cognitoService.getToken().getIdToken().getJwtToken()));
|
||||
}
|
||||
} else {
|
||||
return this.handleError('', err);
|
||||
}
|
||||
}
|
||||
|
||||
private handleError(operation = 'operation', error?: HttpErrorResponse): Observable<HttpEvent<any>> {
|
||||
console.log('Error: ', error);
|
||||
if (error && error.status === 401) {
|
||||
localStorage.clear();
|
||||
const navCtrl = this.injector.get(NavController);
|
||||
navCtrl.navigateRoot('LoginPage'); // Use the correct route to navigate to the login page
|
||||
} else {
|
||||
const toastProvider = this.injector.get(ToastService);
|
||||
toastProvider.lenderappmessage('Network Error');
|
||||
}
|
||||
|
||||
return throwError(error);
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,9 @@ import { Observable, Observer } from 'rxjs';
|
||||
})
|
||||
export class IonicStorageService {
|
||||
|
||||
constructor(private ionicStorage: Storage) { }
|
||||
constructor(private ionicStorage: Storage) {
|
||||
this.ionicStorage.create();
|
||||
}
|
||||
|
||||
insertDataWithReplace(key: any, value: any): Promise<void> {
|
||||
return this.ionicStorage.set(key, value);
|
||||
@ -137,5 +139,6 @@ export class IonicStorageService {
|
||||
// return ''
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,32 +2,33 @@ import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { LoadingService } from '../common-provider/loading.service';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { of, switchMap } from 'rxjs';
|
||||
import { Observable, map, of, switchMap } from 'rxjs';
|
||||
import { IonicStorageService } from '../ionic-storage/ionic-storage.service';
|
||||
import { SalesPdService } from 'src/app/pages/providers/sales-pd/sales-pd.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PdtriggerService {
|
||||
private apiUrl = environment.url;
|
||||
constructor(public http: HttpClient,private loadingProvider:LoadingService,private storage:IonicStorageService) { }
|
||||
constructor(public http: HttpClient,private loadingProvider:LoadingService,private ionicStorageProvider:IonicStorageService,private salesPDProvider:SalesPdService) { }
|
||||
|
||||
initiateMasterApis(type:any) {
|
||||
if(type == 'sales') {
|
||||
this.loadingProvider.pdloader('')
|
||||
// this.loadingProvider.pdloader('')
|
||||
let lender_id:any=localStorage.getItem("user_details")
|
||||
lender_id=JSON.parse(lender_id).fk_entity_id;
|
||||
// HARD CODED API PARAMS
|
||||
// this.salesPDProvider.getAllMasterDatas('STATE').subscribe(res=>{
|
||||
// // FOR MEQ PRODUCTS MASTER API
|
||||
// // this.salesPDProvider.getAllMasterDatas('BUSINESSENTITYTYPE').subscribe(res=>{
|
||||
// this.salesPDProvider.getAllMasterDatas('COMPANYRELATIONSHIPS').subscribe(res=>{
|
||||
// this.salesPDProvider.getAllMasterDatas('SALESEQUIPMENTLIST').subscribe(res=>{
|
||||
// this.salesPDProvider.getAllMasterDatas('SALESVENDORLIST').subscribe(res=>{})
|
||||
// })
|
||||
// })
|
||||
// // })
|
||||
this.salesPDProvider.getAllMasterDatas('STATE').subscribe(res=>{
|
||||
// FOR MEQ /PRODUCTS MASTER API
|
||||
// this.salesPDProvider.getAllMasterDatas('BUSINESSENTITYTYPE').subscribe(res=>{
|
||||
this.salesPDProvider.getAllMasterDatas('COMPANYRELATIONSHIPS').subscribe(res=>{
|
||||
this.salesPDProvider.getAllMasterDatas('SALESEQUIPMENTLIST').subscribe(res=>{
|
||||
this.salesPDProvider.getAllMasterDatas('SALESVENDORLIST').subscribe(res=>{})
|
||||
})
|
||||
})
|
||||
// })
|
||||
})
|
||||
// SALES PD TEMPLATE FOR WCTL AND LFMP
|
||||
// this.salesPDProvider.getData('8','1').subscribe(res=>{
|
||||
// this.salesPDProvider.getData('9','1').subscribe(res=>{
|
||||
@ -41,33 +42,45 @@ export class PdtriggerService {
|
||||
// })
|
||||
// })
|
||||
//SALES PD PRODUCTS LIST FOR LENDER MWISE
|
||||
// this.getEntityPreferences(lender_id).subscribe(res=>{
|
||||
// if(res.dataStatus && res.records && res.records.salespd_products && res.records.salespd_products.length > 0) {
|
||||
// // SALES PD TEMPLATE FOR WCTL AND LFMP
|
||||
// // this.salesPDProvider.callMultipleApisForTemplate(res.records.salespd_products)
|
||||
// }
|
||||
// })
|
||||
// GETTING CITY AND PINCODE FOR SOME STATES
|
||||
// this.salesPDProvider.getCityPincode('5').subscribe(res=>{
|
||||
// this.salesPDProvider.getCityPincode('6').subscribe(res=>{
|
||||
// this.salesPDProvider.getCityPincode('15').subscribe(res=>{
|
||||
// this.salesPDProvider.getCityPincode('27').subscribe(res=>{
|
||||
// this.salesPDProvider.getCityPincode('26').subscribe(res=>{
|
||||
// this.loadingProvider.dismissLoader();
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
this.getEntityPreferences(lender_id).subscribe(res=>{
|
||||
if(res.dataStatus && res.records && res.records.salespd_products && res.records.salespd_products.length > 0) {
|
||||
// SALES PD TEMPLATE FOR WCTL AND LFMP
|
||||
this.salesPDProvider.callMultipleApisForTemplate(res.records.salespd_products)
|
||||
}
|
||||
})
|
||||
//GETTING CITY AND PINCODE FOR SOME STATES
|
||||
this.salesPDProvider.getCityPincode('5').subscribe(res=>{
|
||||
this.salesPDProvider.getCityPincode('6').subscribe(res=>{
|
||||
this.salesPDProvider.getCityPincode('15').subscribe(res=>{
|
||||
this.salesPDProvider.getCityPincode('27').subscribe(res=>{
|
||||
this.salesPDProvider.getCityPincode('26').subscribe(res=>{
|
||||
// this.loadingProvider.dismissLoader();
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
getEntityPreferences(entity_id: any): Observable<any> {
|
||||
const params = { entity_id: entity_id };
|
||||
return this.http.get<any>(`${this.apiUrl}getEntityPreferences/${entity_id}`)
|
||||
.pipe(
|
||||
map((result: any) => {
|
||||
this.ionicStorageProvider.checkAndInsertApiDataLocally(result, params, 'getEntityPreferences');
|
||||
return result;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
getCommonSettingsConfig()
|
||||
{
|
||||
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
|
||||
return this.http.post(this.apiUrl + 'getCommonConfig', '').pipe(
|
||||
switchMap((result) => {
|
||||
this.storage.checkAndInsertApiDataLocally(result, null, 'getCommonConfig');
|
||||
this.ionicStorageProvider.checkAndInsertApiDataLocally(result, null, 'getCommonConfig');
|
||||
return of(result);
|
||||
})
|
||||
);
|
||||
|
||||
76
src/theme/filter-modal.scss
Normal file
@ -0,0 +1,76 @@
|
||||
.filterModal{
|
||||
padding: 6.4%;
|
||||
// padding: 30px;
|
||||
background-color: rgba(0, 0, 0, 0.56);
|
||||
// padding: 30px;
|
||||
color:red;
|
||||
// filter:blur(5px);
|
||||
//color:lightcyan;
|
||||
// background-color:gray;
|
||||
.modal-wrapper {
|
||||
// border-radius: 7px;
|
||||
// background: rgba(0, 0, 0, 0.5);
|
||||
// color: gray;
|
||||
|
||||
height: 80% !important;
|
||||
width:100% !important;
|
||||
// margin-top: 13.5%;
|
||||
border-radius: 10px;
|
||||
margin-top:10%;
|
||||
|
||||
mat-card{
|
||||
// background-color:rgb(252, 252, 161);
|
||||
background-color:white;
|
||||
box-shadow: 2px 2px lavender;
|
||||
border-radius: 5px;
|
||||
min-height: 13em;
|
||||
// height: 16.5em;
|
||||
max-height: 16.5em;
|
||||
border:1px solid lavender;
|
||||
}
|
||||
.mat-card-title{
|
||||
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color:#e2412f;
|
||||
}
|
||||
mat-card-content{
|
||||
margin-left: 4%;
|
||||
}
|
||||
ion-item{
|
||||
// background-color:rgb(252, 252, 161);
|
||||
background-color: lightcyan;
|
||||
}
|
||||
// margin-right: 15%;
|
||||
|
||||
button{
|
||||
font-size: 12px;
|
||||
// height: 40px;
|
||||
color:#e2412f;
|
||||
// margin-bottom: 10px;
|
||||
position: relative;
|
||||
bottom:0.5em;
|
||||
}
|
||||
// input{
|
||||
// // border:1px solid blueviolet;
|
||||
// }
|
||||
mat-form-field{
|
||||
width: 100%;
|
||||
margin-top: 3%;
|
||||
}
|
||||
mat-radio-button{
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.small-popup-modal {
|
||||
--width: 80% !important; /* Adjust as needed */
|
||||
--height: 50% !important; /* Adjust as needed */
|
||||
--max-width: 300px !important; /* Maximum width */
|
||||
--max-height: 400px !important; /* Maximum height */
|
||||
}
|
||||
@ -197,13 +197,13 @@
|
||||
*/
|
||||
|
||||
.md body {
|
||||
--ion-background-color: #ffffff;
|
||||
--ion-background-color: #ccc;
|
||||
--ion-background-color-rgb: 18,18,18;
|
||||
|
||||
--ion-text-color: #ffffff;
|
||||
--ion-text-color-rgb: 255,255,255;
|
||||
|
||||
--ion-border-color: #222222;
|
||||
--ion-border-color: #ffffff;
|
||||
|
||||
--ion-color-step-50: #1e1e1e;
|
||||
--ion-color-step-100: #2a2a2a;
|
||||
@ -225,11 +225,11 @@
|
||||
--ion-color-step-900: #e7e7e7;
|
||||
--ion-color-step-950: #f3f3f3;
|
||||
|
||||
--ion-item-background: #1e1e1e;
|
||||
--ion-item-background: #ffffff;
|
||||
|
||||
--ion-toolbar-background: #1f1f1f;
|
||||
--ion-toolbar-background: #ff0000;
|
||||
|
||||
--ion-tab-bar-background: #1f1f1f;
|
||||
--ion-tab-bar-background: #ff0000;
|
||||
|
||||
--ion-card-background: #1e1e1e;
|
||||
}
|
||||
|
||||