sales pd expert photo section

This commit is contained in:
venbainfotech 2021-12-16 14:29:05 +05:30
parent 5bcac93228
commit 3e84a31a82
862 changed files with 307958 additions and 0 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# Sparq Lender

208
ng6-seed/angular.json Executable file
View File

@ -0,0 +1,208 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"optima": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
"src/firebase-messaging-sw.js",
"src/manifest.json",
"src/manifest.json"
],
"styles": [
"node_modules/quill/dist/quill.snow.css",
"node_modules/dragula/dist/dragula.css",
"node_modules/leaflet/dist/leaflet.css",
"node_modules/angular-calendar/scss/angular-calendar.scss",
"node_modules/@swimlane/ngx-datatable/release/index.css",
"node_modules/@swimlane/ngx-datatable/release/themes/material.css",
"src/assets/fonts/pe/css/pe-icon-set-weather.css",
"src/assets/fonts/data-table/icons.css",
"src/assets/styles/app.scss",
"src/assets/cropper/cropper.css",
"src/assets/glyphicons/glyphicons.css",
"node_modules/font-awesome/scss/font-awesome.scss",
"node_modules/perfect-scrollbar/css/perfect-scrollbar.css",
"node_modules/simple-line-icons/scss/simple-line-icons.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/tether/dist/js/tether.min.js",
"node_modules/hammerjs/hammer.min.js",
"node_modules/sortablejs/Sortable.js",
"node_modules/chart.js/dist/Chart.bundle.min.js",
"src/assets/cropper/cropper.js",
"node_modules/blueimp-canvas-to-blob/js/canvas-to-blob.min.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"serviceWorker": true
},
"staging": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.stage.ts"
}
],
"serviceWorker": true
},
"test": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.stage.ts"
}
],
"serviceWorker": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "optima:build"
},
"configurations": {
"production": {
"browserTarget": "optima:build:production"
},
"test": {
"browserTarget": "optima:build:test"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "optima:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/tether/dist/js/tether.min.js",
"node_modules/hammerjs/hammer.min.js",
"node_modules/sortablejs/Sortable.js",
"node_modules/chart.js/dist/Chart.bundle.min.js",
"src/assets/cropper/cropper.js"
],
"styles": [
"node_modules/quill/dist/quill.snow.css",
"node_modules/dragula/dist/dragula.css",
"node_modules/leaflet/dist/leaflet.css",
"node_modules/angular-calendar/scss/angular-calendar.scss",
"node_modules/@swimlane/ngx-datatable/release/index.css",
"node_modules/@swimlane/ngx-datatable/release/themes/material.css",
"src/assets/fonts/pe/css/pe-icon-set-weather.css",
"src/assets/fonts/data-table/icons.css",
"src/assets/styles/app.scss",
"src/assets/cropper/cropper.css",
"src/assets/glyphicons/glyphicons.css",
"node_modules/font-awesome/scss/font-awesome.scss",
"node_modules/perfect-scrollbar/css/perfect-scrollbar.css",
"node_modules/simple-line-icons/scss/simple-line-icons.scss"
],
"assets": [
"src/assets",
"src/favicon.ico",
"src/manifest.json"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
"optima-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "optima:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "optima",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"analytics": "509641b9-0932-4a65-bc55-144b73b41471"
}
}

21
ng6-seed/cert.pem Normal file
View File

@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgIJALp8pgcPInoDMA0GCSqGSIb3DQEBCwUAMFExCzAJBgNV
BAYTAklOMRMwEQYDVQQIDApUYW1pbCBOYWR1MRAwDgYDVQQHDAdDaGVubmFpMQ4w
DAYDVQQKDAVWZW5iYTELMAkGA1UECwwCSVQwHhcNMjAxMTE2MTIxMDI3WhcNMzAx
MTE0MTIxMDI3WjBRMQswCQYDVQQGEwJJTjETMBEGA1UECAwKVGFtaWwgTmFkdTEQ
MA4GA1UEBwwHQ2hlbm5haTEOMAwGA1UECgwFVmVuYmExCzAJBgNVBAsMAklUMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9Abu9StEo1KrngOXi53hQN3W
lJUELHjRLtz+246W8/l+U2SQ8pvh/UsvS/T+2Ymtwkrn8+pLik+7abrMOFaYpW8i
LdbLtBDZHMrP/SkKv3SN3bIQQVtyWzMwoPtmOzvRuxyyvkWjwp3qIcLmLe104Z0D
myy4bG69lmgHY6tH9VPRzPSdMuJSETPZlTCec035CHauXub1kn33PWS/J6ZWzQV2
j2Cdp/U22qaRtv8mqqhgy85ytHddxzJs65Ea0Bf3zUaQwFLEFTHYKgdo+wzY3OC+
969xZA+zqh1WMWPSGikyMS113ECM/vt/0o2p2Uvj+H2Up/z5xC3li76NBQ4CRwID
AQABo1AwTjAdBgNVHQ4EFgQUsqEFNzWzQuQswW7/EmqLFC9ovO0wHwYDVR0jBBgw
FoAUsqEFNzWzQuQswW7/EmqLFC9ovO0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B
AQsFAAOCAQEAJsP1FxUT9N3SQDIiXMzId0cEMSfeqrTEJRLruQj2LvooPnvoheF1
CEgp+YDEbFphKfmYVb8e5B3P/xCqoNRrWZDgufXLhZbvo5KCufMt6z1gPJSMVt4c
/ChSqHonzlodz+w3gueHDkgs4bxK41E15BUhlIH4qGYuSoGPjmP2799aWIfX98k8
bjzRoqKEQzSZDjkrwpHdcbqm5XuxR19tYB7rbPawjPVyjIehZ5IkibxFdjJ9k01M
sETsdfXlyDZHUlyX0SA39eqUO4f7AXsidleHExYbolhQ82HpYJANXHFzmA5c9kLk
K2QQH8yTjqirZkQW6QB9HYYrxHTkNM4SLw==
-----END CERTIFICATE-----

View File

@ -0,0 +1,13 @@
import { PrimerPage } from './app.po';
describe('primer App', function() {
let page: PrimerPage;
beforeEach(() => {
page = new PrimerPage();
});
it('should expect true to be true', () => {
expect(true).toBe(true);
});
});

11
ng6-seed/e2e/app.po.ts Normal file
View File

@ -0,0 +1,11 @@
import { browser, element, by } from 'protractor';
export class PrimerPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016"
],
"outDir": "../dist/out-tsc-e2e",
"module": "commonjs",
"target": "es6",
"types":[
"jasmine",
"node"
]
}
}

BIN
ng6-seed/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

44
ng6-seed/karma.conf.js Normal file
View File

@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
],
preprocessors: {
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

28
ng6-seed/key.pem Normal file
View File

@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0Bu71K0SjUque
A5eLneFA3daUlQQseNEu3P7bjpbz+X5TZJDym+H9Sy9L9P7Zia3CSufz6kuKT7tp
usw4VpilbyIt1su0ENkcys/9KQq/dI3dshBBW3JbMzCg+2Y7O9G7HLK+RaPCneoh
wuYt7XThnQObLLhsbr2WaAdjq0f1U9HM9J0y4lIRM9mVMJ5zTfkIdq5e5vWSffc9
ZL8nplbNBXaPYJ2n9TbappG2/yaqqGDLznK0d13HMmzrkRrQF/fNRpDAUsQVMdgq
B2j7DNjc4L73r3FkD7OqHVYxY9IaKTIxLXXcQIz++3/SjanZS+P4fZSn/PnELeWL
vo0FDgJHAgMBAAECggEAcX0T/uN7jXVyKQ/EmAL58l/5XqqbAU/DAUd4I4YCAD9F
F+WKX7pNdK5Vtb6gE22raNPLYi3RqeaA46AjQAROA4pW2/isTfcT8gcEidlfjUDY
hYU9eBfebDm3YPbqSZv9Y0bqfgEHMwicDc2FnVB07kRGnBFFR/CMrXl+DkVnNtk3
EBDxGjEja0MpQe/uVAwscCCqKG/Ra+wbRPoRHCdpT8UTLYfd5Tbz7lTMtKoPVQyy
Svm0OfrDSCNksagJGLZgJMVQQr2W+4EGhL91pkysBIX/Gu+pV6nTWGpwlB3tjPOw
4e4SwcWhX75kQLXRtjQYM7okq7Y/Gs3KdgdYTOS9UQKBgQD+wYs512yuiCfKwiss
uOZyJGKUoNWQhy1CfzzvX2BvxW0DcwGcWLq4xsJtXEK4AvG3ZRwdssxF2Im38Vas
28TFLyhkYM/gHLwmrcWczab77jXMM12BPQBvz4iwC90+BtHnBEbNNkkj7h8FFwOf
qqNBcHzpKbBoSMn4uloDqimE6QKBgQD1N/pZU9S89NimeLPrTHibW3j/gJ6R8LO7
NaG1eV3JM9bhrFM3qQJTXYEW8gQ4b+z1uCKx+Mgz+D7JJMF7lH6H0XM5P6d/JTxm
6RpPOV01iuBe2ULkisg/4QQqY0F47iWuShja7WgxqVNyMrcZG4S92Neemg0DTKqT
vuQPKT6PrwKBgQDcQsy0cuyVrkTxSpX3sdoVAB53sONVdXqNTuOJdyYzHTgWzl2r
JxAx6C98TFOnM2x4CySXDNsO3Jyd/DzbcZwcfJxoxUeV1mJa8s2zuB9THO9IoXSL
5Ak3ovDkfS2Jjm33Vjw8+12bgisxxGcuqmNClhZ5pcDPOXfe5IglOP9y2QKBgDDl
dJoTSTxUZk7ripTErtfrqXjpILVhFbWiwBf7l2PjXlmpjv5uSPRulKsKnyTRzKJC
kUiDnwgd3AcnuRz3QzO55AvqUW/c8OpkWMarXZarlonTMK95rOxv5fC90fRXKFRU
mhgtdrVQWj9PNYtgHVvtvTD27tlVlD3Ztof/ZWYpAoGARlt6y7u87M8rI7ROz2xJ
EX/vvsq8+/NAkW4NSXC7ETJ4bjhvigG4/vN/gNdAZpw3NGaDaNZNaIOIIoYZ+pNL
JYnNOCfWfbu15tZGDOeQcArY8gHUjH63W2/da3c/SRvfP5rASmtk1mjOf0G8E3/v
JY3AbidYmdex3n0792PRuMI=
-----END PRIVATE KEY-----

56
ng6-seed/ngsw-config.json Normal file
View File

@ -0,0 +1,56 @@
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
],
"urls":[
"https://fonts.googleapis.com/css?family=Roboto:300,400,700|Material+Icons"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.woff",
"/*.svg",
"/*.ttf",
"/*.eot",
"/*.woff2"
]
}
}
],
"dataGroups": [
{
"name": "my-api-30days",
"urls": [
"/api/"
],
"cacheConfig": {
"strategy": "freshness",
"maxSize": 300,
"maxAge": "30d"
}
}
],
"navigationUrls": [
"/**",
"!/**/*.*",
"!/**/*__*",
"!/**/*__*/**",
"!/bypass/service/worker",
"!/account/bypass-service-worker**",
"!/bypass-service-worker**"
]
}

29452
ng6-seed/package-lock.json generated Executable file

File diff suppressed because it is too large Load Diff

114
ng6-seed/package.json Executable file
View File

@ -0,0 +1,114 @@
{
"name": "optima",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"production": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --build-optimizer=true --base-href /lender/",
"staging": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --configuration=staging --base-href /lenderdemo/",
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"static-serve": "http-server -p 3000 -c-1",
"postbuild": "node_modules/.bin/html-minifier dist/index.html --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true -o dist/index.html && node_modules/.bin/terser dist/ngsw-worker.js -o dist/ngsw-worker.js -c --comments /^##/"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "^6.1.10",
"@angular/cdk": "^6.0.0-rc.5",
"@angular/common": "^6.1.10",
"@angular/compiler": "^6.1.10",
"@angular/core": "^6.1.10",
"@angular/flex-layout": "^6.0.0-beta.18",
"@angular/forms": "^6.1.10",
"@angular/http": "^6.0.0-rc.6",
"@angular/material": "^6.0.0-rc.5",
"@angular/material-moment-adapter": "^6.0.0-rc.5",
"@angular/platform-browser": "^6.1.10",
"@angular/platform-browser-dynamic": "^6.1.10",
"@angular/pwa": "^0.1001.7",
"@angular/router": "^6.1.10",
"@angular/service-worker": "^6.1.10",
"@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@swimlane/ngx-charts": "^7.0.1",
"@swimlane/ngx-datatable": "11.1.5",
"@types/file-saver": "^2.0.0",
"amazon-cognito-identity-js": "^2.0.30",
"angular-calendar": "0.23.3",
"angular-notifier": "^4.1.1",
"angular-sortablejs": "^2.7.0",
"angular-split": "^3.0.2",
"angular-tree-component": "6.1.0",
"blueimp-canvas-to-blob": "^3.28.0",
"chart.js": "2.6.0",
"core-js": "^2.6.5",
"d3": "^4.9.1",
"dragula": "3.7.2",
"file-saver": "^2.0.1",
"font-awesome": "4.7.0",
"hammerjs": "2.0.8",
"intl": "^1.2.4",
"jquery": "^3.5.1",
"karma-jasmine": "^1.1.1",
"leaflet": "^1.4.0",
"mat-video": "^2.8.1",
"moment": "^2.24.0",
"ng-pick-datetime": "^6.0.16",
"ng2-charts": "1.6.0",
"ng2-ckeditor": "^1.2.2",
"ng2-dragula": "1.3.1",
"ng2-file-upload": "1.2.1",
"ng2-img-max": "^2.2.4",
"ng2-pdf-viewer": "^5.2.4",
"ng2-toastr": "^4.1.2",
"ng2-validation": "4.2.0",
"ngx-color-picker": "^4.0.3",
"ngx-mat-daterange-picker": "^1.1.4",
"ngx-mat-select-search": "^1.8.0",
"ngx-perfect-scrollbar": "5.0.0-7",
"ngx-viewer": "^1.0.1",
"node-sass": "^4.14.1",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.3.7",
"rxjs": "^6.5.1",
"rxjs-compat": "^6.5.1",
"screenfull": "^3.2.2",
"simple-line-icons": "^2.4.1",
"sortablejs": "^1.9.0",
"sweetalert2": "^7.33.1",
"tether": "^1.4.6",
"viewerjs": "^1.3.3",
"watermarkjs": "^2.1.1",
"xlsx": "^0.14.2",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.12.4",
"@angular/cli": "^6.2.9",
"@angular/compiler-cli": "^6.1.10",
"@types/aws-sdk": "^2.7.0",
"@types/jasmine": "2.5.52",
"@types/jquery": "3.2.0",
"@types/node": "^8.10.46",
"aws-sdk": "^2.443.0",
"codelyzer": "~4.1.0",
"html-minifier": "^4.0.0",
"jasmine-core": "2.6.3",
"jasmine-spec-reporter": "4.1.0",
"karma": "1.7.0",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "5.1.2",
"sass-loader": "^7.1.0",
"terser": "^5.5.1",
"ts-node": "~5.0.0",
"tslint": "~5.9.1",
"typescript": "^2.7.2"
}
}

644
ng6-seed/prepros-6.config Normal file
View File

@ -0,0 +1,644 @@
{
"name": "ng5",
"firstRun": false,
"exportConfig": true,
"fileConfigs": [
{
"path": "src/assets/styles/app.scss",
"configJson": "{\"forceCompile\":false,\"customOutput\":\"../../../../../../../../../Desktop/app.css\",\"autoCompile\":true,\"sourceMap\":false,\"compiler-node-sass\":{\"enabled\":true,\"outputStyle\":\"nested\"},\"compiler-autoprefixer\":{\"enabled\":true},\"compiler-minify-css\":{\"enabled\":false}}"
}
],
"fileTree": {
"expandedDirs": [
"src",
"src/assets",
"src/assets/styles"
],
"hideSystemFiles": true,
"systemFiles": [
".*",
"desktop.ini",
"prepros.config",
"$RECYCLE.BIN",
"prepros.cfg",
"prepros-6.config",
"Prepros Export"
],
"hideUnwatchedFiles": false
},
"imports": [
{
"path": "src/assets/styles/app.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/_material.themes.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/_core.scss",
"src/assets/styles/scss/_material.scss",
"src/assets/styles/scss/utilities/utilities.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss",
"src/assets/styles/scss/core/_scaffolding.scss",
"src/assets/styles/scss/core/_typography.scss",
"src/assets/styles/scss/core/_main-sidebar.scss",
"src/assets/styles/scss/core/_main-header.scss",
"src/assets/styles/scss/core/_main-panel.scss",
"src/assets/styles/scss/core/_notification-sidebar.scss",
"src/assets/styles/scss/core/_sessions.scss",
"src/assets/styles/scss/components/_perfect-scrollbar.scss",
"src/assets/styles/scss/components/_table.scss",
"src/assets/styles/scss/components/_custom.scss",
"src/assets/styles/scss/material/_buttons.scss",
"src/assets/styles/scss/material/_cards.scss",
"src/assets/styles/scss/material/_dialog.scss",
"src/assets/styles/scss/material/_lists.scss",
"src/assets/styles/scss/material/_select.scss",
"src/assets/styles/scss/material/_menus.scss",
"src/assets/styles/scss/material/_tabs.scss",
"src/assets/styles/scss/utilities/_background.scss",
"src/assets/styles/scss/utilities/_general.scss",
"src/assets/styles/scss/utilities/_spacing.scss",
"src/assets/styles/scss/utilities/_text.scss"
]
},
{
"path": "src/app/apps/chat/chat.component.scss",
"imports": [
"src/assets/styles/scss/components/_chat.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/apps/fullcalendar/fullcalendar.component.scss",
"imports": [
"src/assets/styles/scss/components/_calendar.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/apps/mail/mail.component.scss",
"imports": [
"src/assets/styles/scss/components/_messages.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/apps/social/social.component.scss",
"imports": [
"src/assets/styles/scss/components/_social.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/forms/editor/editor.component.scss",
"imports": [
"src/assets/styles/scss/components/_editor.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/forms/form-tree/form-tree.component.scss",
"imports": [
"src/assets/styles/scss/components/_treeview.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/forms/form-upload/form-upload.component.scss",
"imports": [
"src/assets/styles/scss/components/_upload.scss",
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/app/maps/map-google/map-google.component.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss"
]
},
{
"path": "src/assets/styles/scss/_core.scss",
"imports": [
"src/assets/styles/scss/core/_scaffolding.scss",
"src/assets/styles/scss/core/_typography.scss",
"src/assets/styles/scss/core/_main-sidebar.scss",
"src/assets/styles/scss/core/_main-header.scss",
"src/assets/styles/scss/core/_main-panel.scss",
"src/assets/styles/scss/core/_notification-sidebar.scss",
"src/assets/styles/scss/core/_sessions.scss",
"src/assets/styles/scss/components/_perfect-scrollbar.scss",
"src/assets/styles/scss/components/_table.scss",
"src/assets/styles/scss/components/_custom.scss"
]
},
{
"path": "src/assets/styles/scss/_material.scss",
"imports": [
"src/assets/styles/scss/material/_buttons.scss",
"src/assets/styles/scss/material/_cards.scss",
"src/assets/styles/scss/material/_dialog.scss",
"src/assets/styles/scss/material/_lists.scss",
"src/assets/styles/scss/material/_select.scss",
"src/assets/styles/scss/material/_menus.scss",
"src/assets/styles/scss/material/_tabs.scss"
]
},
{
"path": "src/assets/styles/scss/_mixins.scss",
"imports": [
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_calendar.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_chat.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_editor.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_messages.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_pricing.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_social.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_timeline.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_treeview.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/components/_upload.scss",
"imports": [
"src/assets/styles/scss/_material.variables.scss",
"src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"src/assets/styles/scss/_app.variables.scss",
"src/assets/styles/scss/_mixins.scss",
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss",
"src/assets/styles/scss/mixins/_breakpoints.scss",
"src/assets/styles/scss/mixins/_hover.scss",
"src/assets/styles/scss/mixins/_text-emphasis.scss",
"src/assets/styles/scss/mixins/_clearfix.scss",
"src/assets/styles/scss/mixins/_flex.scss",
"src/assets/styles/scss/mixins/_misc.scss"
]
},
{
"path": "src/assets/styles/scss/utilities/utilities.scss",
"imports": [
"src/assets/styles/scss/utilities/_background.scss",
"src/assets/styles/scss/utilities/_general.scss",
"src/assets/styles/scss/utilities/_spacing.scss",
"src/assets/styles/scss/utilities/_text.scss"
]
},
{
"path": "src/assets/styles/scss/mixins/bi-app/_bi-app-ltr.scss",
"imports": [
"src/assets/styles/scss/mixins/bi-app/_variables-ltr.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss"
]
},
{
"path": "src/assets/styles/scss/mixins/bi-app/_bi-app-rtl.scss",
"imports": [
"src/assets/styles/scss/mixins/bi-app/_variables-rtl.scss",
"src/assets/styles/scss/mixins/bi-app/_mixins.scss"
]
}
],
"projectView": {
"selectedView": "log"
},
"fileWatcher": {
"enabled": true,
"watchedExtensions": [
"less",
"sass",
"scss",
"styl",
"md",
"markdown",
"coffee",
"js",
"jade",
"haml",
"slim",
"ls",
"kit",
"png",
"jpg",
"jpeg",
"ts",
"pug",
"css",
"html",
"htm",
"php"
]
},
"pathFilters": [
"node_modules",
".*",
"bower_components",
"prepros.config",
"Prepros Export",
"prepros-6.config",
"prepros.cfg",
"wp-admin",
"wp-includes"
],
"server": {
"port": 7879,
"assignNewPortAutomatically": true,
"enable": true,
"proxy": {
"enable": false,
"url": ""
}
},
"browser-sync": {
"enable": false,
"clicks": true,
"forms": true,
"scroll": true
},
"live-reload": {
"enable": true,
"animate": true,
"delay": 0
},
"ftp-deploy": {
"connectionType": "ftp",
"remotePath": "",
"uploadTimeout": 20000,
"uploadOnChange": false,
"ftp": {
"secure": false,
"host": "",
"port": 21,
"user": "",
"password": ""
},
"sftp": {
"host": "",
"port": 22,
"usePrivateKey": false,
"username": "",
"password": "",
"privateKey": "",
"passphrase": ""
},
"pathFilters": [
"config.rb",
"prepros.config",
"prepros-6.config",
"node_modules",
"Prepros Export",
".git",
".idea",
".sass-cache",
".hg",
".svn",
".cache",
".DS_Store",
"*.sass",
"*.scss",
"*.less",
"*.pug",
"*.jade",
"*.styl",
"*.haml",
"*.slim",
"*.coffee",
"*.ls",
"*.kit",
"*.ts"
],
"history": []
},
"file-type-sass": "{\"compilers\":[\"node-sass\",\"autoprefixer\",\"minify-css\"]}",
"file-type-less": "{\"compilers\":[\"less\",\"autoprefixer\",\"minify-css\"]}",
"autoprefixer": {
"browsers": "last 5 versions"
},
"file-type-pug": "{\"compilers\":[\"pug\"]}",
"file-type-css": "{\"compilers\":[\"autoprefixer\",\"cssnext\",\"minify-css\"]}",
"file-type-javascript": "{\"compilers\":[\"concat-js\",\"babel\",\"uglify-js\"]}",
"file-type-stylus": "{\"compilers\":[\"stylus\",\"autoprefixer\",\"minify-css\"]}",
"file-type-markdown": "{\"compilers\":[\"markdown\"]}",
"file-type-haml": "{\"compilers\":[\"haml\"]}",
"file-type-slim": "{\"compilers\":[\"slim\"]}",
"file-type-coffee-script": "{\"compilers\":[\"coffee-script\",\"uglify-js\"]}",
"file-type-livescript": "{\"compilers\":[\"livescript\",\"uglify-js\"]}",
"file-type-kit": "{\"compilers\":[\"kit\"]}",
"uglify-js": {
"ie8": false,
"compress": {
"sequences": true,
"properties": true,
"dead_code": true,
"drop_debugger": true,
"unsafe": false,
"unsafe_comps": false,
"unsafe_math": false,
"unsafe_proto": false,
"unsafe_regexp": false,
"conditionals": true,
"comparisons": true,
"evaluate": true,
"booleans": true,
"loops": true,
"unused": true,
"toplevel": false,
"top_retain": "",
"hoist_funs": true,
"hoist_vars": false,
"if_return": true,
"join_vars": true,
"cascade": true,
"collapse_vars": true,
"reduce_vars": true,
"warnings": true,
"negate_iife": true,
"pure_getters": false,
"pure_funcs": [],
"drop_console": false,
"expression": false,
"keep_fargs": true,
"keep_fnames": false,
"passes": 1,
"keep_infinity": false,
"side_effects": true,
"global_defs": []
},
"output": {
"ascii_only": false,
"beautify": true,
"bracketize": false,
"comments": "",
"indent_level": 4,
"indent_start": 0,
"inline_script": false,
"keep_quoted_props": false,
"max_line_len": false,
"preamble": "",
"preserve_line": false,
"quote_keys": false,
"quote_style": 0,
"semicolons": true,
"shebang": true,
"width": 80
}
},
"cssnext": {
"customProperties": true,
"applyRule": true,
"calc": false,
"nesting": true,
"customMedia": true,
"mediaQueriesRange": true,
"customSelectors": true,
"attributeCaseInsensitive": true,
"colorRebeccapurple": true,
"colorHwb": true,
"colorGray": true,
"colorHexAlpha": true,
"colorFunction": true,
"fontVariant": true,
"filter": true,
"initial": true,
"rem": true,
"pseudoElements": true,
"pseudoClassMatches": true,
"pseudoClassNot": true,
"pseudoClassAnyLink": true,
"colorRgba": true,
"overflowWrap": true
},
"file-type-typescript": "{\"compilers\":[\"typescript\",\"uglify-js\"]}",
"babel": {
"useBabelRc": true,
"presets": {
"babel-preset-es2015": true
},
"plugins": {
"babel-plugin-syntax-jsx": true,
"babel-plugin-transform-react-jsx": true,
"babel-plugin-transform-async-to-generator": true,
"babel-plugin-transform-class-properties": true,
"babel-plugin-transform-object-rest-spread": true
}
},
"file-type-png": "{\"compilers\":[\"png\"]}",
"file-type-jpg": "{\"compilers\":[\"jpg\"]}"
}

View File

@ -0,0 +1,30 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

View File

@ -0,0 +1,769 @@
import { Injectable } from "@angular/core";
import {
AuthenticationDetails,
CognitoUserPool,
CognitoUser,
CognitoUserAttribute,
ICognitoUserAttributeData,
ISignUpResult,
CognitoUserSession
} from "amazon-cognito-identity-js";
import * as AWS from "aws-sdk";
import { Observable } from "rxjs/Observable";
import "rxjs/add/operator/map";
// import AWS from "aws-sdk/dist/aws-sdk";
//environment
import { environment } from '../../environments/environment';
import { Http, Headers, RequestOptions } from '@angular/http';
import { HttpClient } from '@angular/common/http';
import 'rxjs/add/operator/map';
import { CognitoService } from './cognito.service';
// const sineedge_poolData = {
// UserPoolId: "ap-south-1_y7dt3iEaX", //ap-south-1_qQ85yQZJO UserName :SPARQ_SINEEDGE_DEV
// ClientId: "291qt4smn5pql6o8cc2hi201lj" // ClientName: SINEEDGE_DEV_WEB
// };
const sineedgedev_poolData = {
UserPoolId: "ap-south-1_qQ85yQZJO", // UserName :SPARQ_SINEEDGE_DEV
ClientId: "67b4fnbuols5upms5to8bvqddh"// ClientName: SINEEDGE_DEV_WEB
}
// client id changed on 12-04-2019 by kms
//ClientId: "2o5c3cs9k3als16nqhp3irh8rs"
const lender_poolData = {
UserPoolId: environment.lenUserPoolId, // Username :SPARQ_LENDER_DEV
ClientId: environment.lenClientId // ClientName:LENDER_DEV_WEB
};
const vendor_poolData = {
UserPoolId: "ap-south-1_K57yPaWxV",
ClientId: ""
}
// const sineedgeUserPool = new CognitoUserPool(sineedge_poolData);
const lenderUserPool = new CognitoUserPool(lender_poolData);
const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
/**
* Identity PoolID
*/
const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
const vendorIdenttiy = "ap-south-1:5ad3ce43-4260-4273-87b2-e6a377b8e874";
// serviceProvider
const apiurl = environment.apiEndpoint;
//const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
//const apiurl = "http://localhost/sparqapi/api/";
@Injectable({
providedIn: "root"
})
export class AwsService {
//public static _REGION = environment.region;
mySecData: any;
cognitoUser: any;
jwttoken: any;
cognitousers: any;
localUserId:any = '';
constructor(public http: Http, public RequestOptions: RequestOptions,public shared:CognitoService) { }
/**
* Login Function
* @param authenticationData inside of(email and password for login user)
* By sriram
*/
dologin(authenticationData) {
//(authenticationData);
const authenticationDetails = new AuthenticationDetails(authenticationData);
let Newpassword = authenticationData.newpassword;
let attributesData = [];
const userData = {
Username: authenticationData.Username, // User email id
Pool: lenderUserPool // user Pool ID
};
let cognitoUser = new CognitoUser(userData);
return Observable.create(observer => {
cognitoUser.authenticateUser(authenticationDetails, {
newPasswordRequired: (userAttributes, requiredAttributes) => { // new password set
cognitoUser.completeNewPasswordChallenge(
Newpassword,
attributesData,
{
onSuccess: function (result) {
observer.next(result);
observer.complete();
},
onFailure: function (err) {
//(err);
observer.error(err);
//LoginComponent.prototype.open();
}
}
);
},
onSuccess: function (result) { // success user login
// let accessToken = result.getAccessToken().getJwtToken();
////(result);
//window.localStorage.setItem('Currentuser', '1');
observer.next(result);
observer.complete();
},
onFailure: function (err) { // error user login
alert(err.message);
observer.error(err);
}
});
});
}
/**
* End of the login function
*/
/**
* User forget password
*/
userforgotpass(auth) {
////(auth);
const userData = {
Username: auth.Username,
Pool: lenderUserPool
};
let cognitoUser = new CognitoUser(userData);
return Observable.create(observe => {
cognitoUser.forgotPassword({
onSuccess: function (data) {
// successfully initiated reset password request
//('CodeDeliveryData from forgotPassword: ' + data);
observe.next(data);
},
onFailure: function (err) {
alert(err.message || JSON.stringify(err));
},
//Optional automatic callback
inputVerificationCode: function (data) {
//('Code sent to: ' + data);
var verificationCode = prompt('Enter Verification Code Sent to Mobile ', '');
var newPassword = prompt('Enter New Password ', '');
cognitoUser.confirmPassword(verificationCode, newPassword, {
onSuccess() {
//('Password confirmed!');
},
onFailure(err) {
//('Password not confirmed!');
}
});
}
});
});
}
/**
* End of the function
*/
/**
* Logout function
*/
logout(){
return Observable.create(observe=>{
this.shared.getCurrentUser().signOut();
localStorage.clear();
observe.next();
observe.complete();
});
}
/**
* Config function
*/
getconfig() {
let session:any = this.shared.getAccessToken() || "";
let config = "";
config += AWS.config.region = "ap-south-1";
config += AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: lenderIdentity, // for sineedge_DEV
Logins: {
"cognito-idp.ap-south-1.amazonaws.com/ap-south-1_qQ85yQZJO": session
.getIdToken()
.getJwtToken()
}
// NOTE: getSession must be called to authenticate user before calling getUserAttributes
});
return config;
}
/**
* admin Disable user
* @param userdata
* @param awsName
*/
admindisabelUser(userdata, awsName) {
let session:any = this.shared.getAccessToken() || "";
this.getconfig();
// let config = "";
// AWS.config.region = "ap-south-1";//environment.region;
// AWS.config.credentials = new AWS.CognitoIdentityCredentials({
// IdentityPoolId: sineedgeIdentity, // for sineedge_DEV
// Logins: {
// "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_qQ85yQZJO": session
// .getIdToken()
// .getJwtToken()
// }
// // NOTE: getSession must be called to authenticate user before calling getUserAttributes
// });
let userGroup = session.idToken.payload["cognito:groups"].filter(
usergroup => usergroup == "ADMIN"
)[0];
//cognitosdata = 7;
let params: any;
if (userGroup == 'ADMIN') {
if (userdata.fk_entity_type_id == 1) {
params = {
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
Username: awsName /* required */
};
} else if (userdata.fk_entity_type_id == 2) {
params = {
UserPoolId: lender_poolData.UserPoolId, /* required */
Username: awsName /* required */
};
}
return Observable.create(observe => {
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminDisableUser(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
observe.next("0"); // successful response
});
});
}
}
/**
* Admin enable user
* @param userdata
* @param awsName
*/
adminenableUser(userdata, awsName) {
let session:any = this.shared.getAccessToken() || "";
// this.getconfig();
let config = "";
AWS.config.region = "ap-south-1";
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: lenderIdentity, // for lender_DEV
Logins: {
"cognito-idp.ap-south-1.amazonaws.com/ap-south-1_qQ85yQZJO": session
.getIdToken()
.getJwtToken()
}
// NOTE: getSession must be called to authenticate user before calling getUserAttributes
});
let userGroup = session.idToken.payload["cognito:groups"].filter(
usergroup => usergroup == "ADMIN"
)[0];
//cognitosdata = 7;
let params: any;
if (userGroup == 'ADMIN') {
if (userdata.fk_entity_type_id == 1) {
params = {
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
Username: awsName /* required */
};
} else if (userdata.fk_entity_type_id == 2) {
params = {
UserPoolId: lender_poolData.UserPoolId, /* required */
Username: awsName /* required */
};
}
return Observable.create(observe => {
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminEnableUser(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
observe.next("1"); // successful response
});
});
}
}
/**
*
*/
register(userData) {
let session:any = this.shared.getAccessToken() || "";
this.getconfig();
let registeredData: any = "";
let params: any;
let userGroup = session.idToken.payload["cognito:groups"].filter(
usergroup => usergroup == "ADMIN"
)[0];
// (userGroup);
if (userGroup == "ADMIN") {
if (userData.type.entity_type_id == 1) {
params = {
UserPoolId: sineedgedev_poolData.UserPoolId /* required */,
Username: userData.email /* required */,
DesiredDeliveryMediums: [
"EMAIL"
/* more items */
],
// ForceAliasCreation: true || false,
MessageAction: "SUPPRESS",
TemporaryPassword: "temp1234",
UserAttributes: [
{
Name: "email" /* required */,
Value: userData.email
},
{
Name: "phone_number" /* required */,
Value: "+91" + userData.phone
},{
Name: "custom:role_id" /* required */,
Value: userData.role.role_id
}
/* more items */
]
};
} else if (userData.type.entity_type_id == 2) {
params = {
UserPoolId: lender_poolData.UserPoolId /* required */,
Username: userData.email /* required */,
DesiredDeliveryMediums: [
"EMAIL"
/* more items */
],
// ForceAliasCreation: true || false,
MessageAction: "SUPPRESS",
TemporaryPassword: "temp1234",
UserAttributes: [
{
Name: "email" /* required */,
Value: userData.email
},
{
Name: "phone_number" /* required */,
Value: "+91" + userData.phone
},{
Name: "custom:role_id" /* required */,
Value: userData.role.role_id
}
/* more items */
]
};
}else if(userData.type.entity_type_id == 3){
params = {
UserPoolId: vendor_poolData.UserPoolId /* required */,
Username: userData.email /* required */,
DesiredDeliveryMediums: [
"EMAIL"
/* more items */
],
// ForceAliasCreation: true || false,
MessageAction: "SUPPRESS",
TemporaryPassword: "temp1234",
UserAttributes: [
{
Name: "email" /* required */,
Value: userData.email
},
{
Name: "phone_number" /* required */,
Value: "+91" + userData.phone
},{
Name: "custom:role_id" /* required */,
Value: userData.role.role_id
}
/* more items */
]
};
}
return Observable.create(observe => {
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminCreateUser(params, (
err,
data
) => {
if (err) { alert(err.message); }
// an error occurred
observe.next(data);
// successful response
});
});
}else{
return alert('Admin Only create user');
}
}
UserGroup(cognitodata, userData) {
//console.log(cognitodata);
this.getconfig();
//console.log(userData);
//let cognitodata = "539bfefa-ae42-4bee-bf79-4b15d1a2af7f";
let params: any;
if(userData.userid === undefined){
params = {
GroupName: "ADMIN" /* required */,
UserPoolId: sineedgedev_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */,
Username: cognitodata.User.Username //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */
};
}else
{
params = {
GroupName: "ADMIN" /* required */,
UserPoolId: sineedgedev_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */,
Username: userData.aws_name //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */
};
}
//console.log(params);
return Observable.create(observe=>{
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminAddUserToGroup(params, function (
err,
data
) {
if (err) {
alert(err.message);
}//(err, err.stack);
// an error occurred
else {//(data);
observe.next(cognitodata);
}
})
});
}
/**
* admin User update
* @param username,clientid params
**/
adminUpdateuser(user, cognitosdata) {
console.log('inside - updateuser');
let session:any = this.shared.getAccessToken() || "";
this.getconfig();
//let cognitodata = "539bfefa-ae42-4bee-bf79-4b15d1a2af7f";
let userGroup = session.idToken.payload["cognito:groups"].filter(
usergroup => usergroup == "ADMIN"
)[0];
//cognitosdata = 7;
let params:any;
if (userGroup == 'ADMIN') {
if(user.type.entity_type_id ==1){
params = {
UserAttributes: [ /* required */
{
Name: 'locale', /* required */
Value: cognitosdata.toString()
},{
Name:"email_verified",
Value:"true"
},{
Name:"phone_number_verified",
Value:"true"
}
/* more items */
],
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
Username: user.email /* required */
};
}else if(user.type.entity_type_id ==2){
params = {
UserAttributes: [ /* required */
{
Name: 'locale', /* required */
Value: cognitosdata.toString()
},{
Name:"email_verified",
Value:"true"
},{
Name:"phone_number_verified",
Value:"true"
}
/* more items */
],
UserPoolId: lender_poolData.UserPoolId, /* required */
Username: user.email /* required */
};
}else if(user.type.entity_type_id ==3){
params = {
UserAttributes: [ /* required */
{
Name: 'locale', /* required */
Value: cognitosdata.toString()
},{
Name:"email_verified",
Value:"true"
},{
Name:"phone_number_verified",
Value:"true"
}
/* more items */
],
UserPoolId: vendor_poolData.UserPoolId, /* required */
Username: user.email /* required */
};
}
//console.log(params);
return Observable.create(observe => {
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminUpdateUserAttributes(params, function (err, data) {
if (err) //(err, err.stack);
//console.log(data); // an error occurred
observe.next(data); // successful response
});
});
}
}
getlocale(){
let session:any = this.shared.getAccessToken() || "";
if(session && session != "") {
return session.idToken.payload.locale;
}
else{
return session
}
}
adminchangeData(userData,changeusers){
console.log('inside - changeData');
let session:any = this.shared.getAccessToken() || "";
this.getconfig();
let registeredData: any = "";
let params:any='';
let userGroup = session.idToken.payload["cognito:groups"].filter(
usergroup => usergroup == "ADMIN"
)[0];
// (userGroup);
if (userGroup == "ADMIN") {
if (userData.fk_entity_type_id == 1) {
params = {
UserPoolId: sineedgedev_poolData.UserPoolId /* required */,
Username: userData.aws_name,//userData.email /* required */,
// ForceAliasCreation: true || false,
UserAttributes: [
{
Name: "email" /* required */,
Value: changeusers.email,//userData.email
},
{
Name: "phone_number" /* required */,
Value: "+91"+ changeusers.phone
},
{
Name: "custom:role_id" /* required */,
Value: userData.user_role
}
/* more items */
]
};
} else if (userData.fk_entity_type_id == 2) {
params = {
UserPoolId: lender_poolData.UserPoolId /* required */,
Username: userData.aws_name /* required */,
UserAttributes: [
{
Name: "email" /* required */,
Value: changeusers.email
},
{
Name: "phone_number" /* required */,
Value: "+91" + changeusers.phone
},{
Name: "custom:role_id" /* required */,
Value: userData.user_role
}
/* more items */
]
};
}else if(userData.fk_entity_type_id == 3)
{
params = {
UserPoolId: vendor_poolData.UserPoolId /* required */,
Username: userData.aws_name /* required */,
UserAttributes: [
{
Name: "email" /* required */,
Value: changeusers.email
},
{
Name: "phone_number" /* required */,
Value: "+91" + changeusers.phone
},{
Name: "custom:role_id" /* required */,
Value: userData.user_role
}
/* more items */
]
};
}
return Observable.create(observe=>{
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminUpdateUserAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
observe.next(data); // successful response
});
})
}
}
// adminremoveGroup(roles,users){
// console.log(roles);
// console.log(users);
// if(users !==undefined){
// let session:any = this.shared.getAccessToken() ||"";
// this.getconfig();
// let params:any;
// if(users.fk_entity_type_id ==1){
// params = {
// GroupName: roles.GroupName, /* required */
// UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
// Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */
// };
// }else if(users.fk_entity_id ==2){
// params = {
// GroupName: roles.GroupName, /* required */
// UserPoolId: lender_poolData.UserPoolId, /* required */
// Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */
// };
// }
// let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
// cognitoidentityserviceprovider.adminRemoveUserFromGroup(params, function(err, data) {
// if (err) console.log(err, err.stack); // an error occurred
// else console.log(data); // successful response
// });
// }
// }
adminresetpassword(awsuser){
this.getconfig();
let params:any;
if(awsuser.fk_entity_id ==1){
params= {
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
Username: awsuser.email /* required */
};
}else if(awsuser.fk_entity_id ==2){
params= {
UserPoolId: lender_poolData.UserPoolId, /* required */
Username: awsuser.email /* required */
};
}
return Observable.create(observe=>{
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.changePassword(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
observe.next(data);
} // successful response
});
});
}
changepassword(passData) {
let session:any = this.shared.getAccessToken() || "";
this.getconfig();
var params = {
AccessToken: session.accessToken.jwtToken, /* required */
PreviousPassword: passData.oldPassword, /* required */
ProposedPassword: passData.newPassword /* required */
};
return Observable.create(observe => {
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.changePassword(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
observe.next(data);
// successful response
});
})
}
admindelete(aws){
this.getconfig();
let params:any;
if(aws.fk_entity_id ==1){
params= {
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
Username: aws.email /* required */
};
}else if(aws.fk_entity_id ==2){
params= {
UserPoolId: lender_poolData.UserPoolId, /* required */
Username: aws.email /* required */
};
}
return Observable.create(observe=>{
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminDeleteUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
observe.next(data);
} // successful response
});
});
}
adminlistgroup(enitiy){
// console.log(enitiy);
this.getconfig();
let params:any;
if(enitiy ==1){
params = {
UserPoolId:sineedgedev_poolData.UserPoolId,
}
}else if(enitiy ==2){
params = {
UserPoolId:lender_poolData.UserPoolId
}
}
//console.log(enitiy);
return Observable.create(observe=>{
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.listGroups(params,function(err,data){
if(err) alert(err.stack);
else {observe.next(data.Groups);}
})
});
}
}

View File

@ -0,0 +1,210 @@
import { Injectable } from '@angular/core';
import * as AWS from "aws-sdk";
import { CanActivateChild, Router } from '@angular/router';
import {
AuthenticationDetails,
CognitoUserPool,
CognitoUser,
CognitoUserAttribute,
ICognitoUserAttributeData,
ISignUpResult,
CognitoUserSession
} from "amazon-cognito-identity-js";
import { environment } from '../../environments/environment';
import { BehaviorSubject,Observable,of } from 'rxjs';
const sineedge_poolData = {
UserPoolId: "ap-south-1_y7dt3iEaX", //ap-south-1_qQ85yQZJO UserName :SPARQ_SINEEDGE_DEV
ClientId: "291qt4smn5pql6o8cc2hi201lj" // ClientName: SINEEDGE_DEV_WEB
};
const sineedgedev_poolData = {
UserPoolId: "ap-south-1_qQ85yQZJO", // UserName :SPARQ_SINEEDGE_DEV
ClientId: "67b4fnbuols5upms5to8bvqddh" // ClientName: SINEEDGE_DEV_WEB
}
const lender_poolData = {
UserPoolId: environment.lenUserPoolId, // Username :SPARQ_LENDER_DEV
ClientId: environment.lenClientId // ClientName:LENDER_DEV_WEB
};
const vendor_poolData = {
UserPoolId: "",
ClientId: ""
}
const sineedgeUserPool = new CognitoUserPool(sineedge_poolData);
const lenderUserPool = new CognitoUserPool(lender_poolData);
const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
/**
* Identity PoolID
*/
const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
const vendorIdenttiy = "";
// serviceProvider
//const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
const apiurl = environment.apiEndpoint;
// const apiurl = "http://localhost/sparqapi/api/";
export interface Callback {
callback(): void;
callbackWithParam(result: any): void;
}
@Injectable({
providedIn: 'root'
})
export class CognitoService implements CanActivateChild {
public loggedIn :boolean = false;
// public static _REGION = environment.region;
// public static _IDENTITY_POOL_ID = environment.identityPoolId;
// public static _USER_POOL_ID = environment.UserPoolId;
// public static _CLIENT_ID = environment.ClientId;
// public static _POOL_DATA: any = {
// UserPoolId: CognitoService._USER_POOL_ID,
// ClientId: CognitoService._CLIENT_ID
// };
get isLoggedIn() {
if(lenderUserPool.getCurrentUser() !=null){
this.loggedIn = true;
}else{
this.loggedIn = false;
}
return this.loggedIn; // {2}
}
canActivateChild(){
if(this.getToken()){
//alert('session valid')
return true;
}else{
this.route.navigate(['/authentication/login']);
//alert('session valid timeout');
return false;
}
}
public cognitoCreds: AWS.CognitoIdentityCredentials;
isloggin:boolean = false;
// getUserPool() {
// if (environment.cognito_idp_endpoint) {
// CognitoService.sineedgedev_poolData.endpoint = environment.cognito_idp_endpoint;
// }
// return new CognitoUserPool(CognitoService.sineedgedev_poolData);
// }
getCurrentUser() {
return lenderUserPool.getCurrentUser();
}
constructor(public route:Router) { }
// getAccessToken(callback: Callback): void {
// if (callback == null) {
// throw("CognitoUtil: callback in getAccessToken is null...returning");
// }
// if (this.getCurrentUser() != null) {
// this.getCurrentUser().getSession(function (err, session) {
// if (err) {
// console.log("CognitoUtil: Can't set the credentials:" + err);
// callback.callbackWithParam(null);
// }
// else {
// if (session.isValid()) {
// console.log("62");
// callback.callbackWithParam(session.getAccessToken().getJwtToken());
// }
// }
// });
// }
// else {
// callback.callbackWithParam(null);
// }
// }
refresh() {
let tokenexp:boolean;
return Observable.create(observer=>{
console.log("Current user check in token refresh fun",this.getCurrentUser())
return this.getCurrentUser().getSession(function (err, session) {
if (err) {
console.log("Error Refreshing token",err);
}
else {
if (session.isValid()) {
tokenexp = session.isValid();
of(tokenexp)
console.log("CognitoUtil: refreshed successfully");
} else {
tokenexp = session.isValid();
console.log("CognitoUtil: refreshed but session is still not valid");
}
}
observer.next(tokenexp)
observer.complete()
});
});
}
getAccessToken(){
this.refresh();
let jwttoken = '';
if (this.getCurrentUser() != null) {
//console.log(JSON.stringify(this.getCurrentUser()));
// console.log('76 if');
this.getCurrentUser().getSession(function (err, session) {
if (err) {
jwttoken ='';
// console.log('81 if')
}
else {
if (session.isValid()) {
// console.log('85 else if');
jwttoken = session;
} else {
}
}
});
}
else {
//console.log("else");
}
return jwttoken;
}
getToken():boolean {
let isloggin = false;
if (this.getCurrentUser() != null) {
//console.log(JSON.stringify(this.getCurrentUser()));
//console.log('76 if');
this.getCurrentUser().getSession(function (err, session) {
if (err) {
// console.log("CognitoUtil: Can't set the credentials:" + err);
isloggin = false;
//console.log('81 if')
}
else {
if (session.isValid()) {
// console.log('85 else if');
isloggin = true;
} else {
isloggin = false;
}
}
});
}
else {
// console.log("else");
isloggin = false;
}
return isloggin;
}
}

View File

@ -0,0 +1,48 @@
import { Injectable } from '@angular/core';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, CanActivateChild } from '@angular/router';
import { Observable , of } from 'rxjs';
import { CognitoService } from '../AwsService/cognito.service';
@Injectable()
export class AuthGuard implements CanActivate, CanActivateChild {
constructor(private router: Router,public shared:CognitoService) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
if (this.shared.getToken()) {
alert("if");
// this.router.navigate(['']);
return true
} else {
alert("else");
this.router.navigate(['/login']);
return false;
}
}
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
if (this.shared.getToken()) {
// alert("if");
return true;
} else {
// alert("else");
setTimeout(() => {
this.router.navigate(['authentication/login']);
return false;
},1000);
}
}
// public getToken(): string {
// return localStorage.getItem('token');
// }
// public logOut() {
// localStorage.clear();
// if(localStorage.getItem('token') === null){
// this.router.navigate(['/login']);
// }
// }
}

View File

@ -0,0 +1,260 @@
import { Injectable, Injector } from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpInterceptor,
HttpSentEvent,
HttpHeaderResponse,
HttpProgressEvent,
HttpResponse,
HttpUserEvent,
HttpEvent
} from '@angular/common/http';
// import { AuthGuard } from './auth.guard';
import { Observable, of, BehaviorSubject, throwError} from 'rxjs';
// import { Router } from '@angular/router';
import { switchMap, tap, catchError, finalize } from 'rxjs/operators';
import { HttpErrorResponse } from "@angular/common/http";
import { Router } from '@angular/router';
import { CognitoService } from 'app/AwsService/cognito.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { environment } from '../../environments/environment';
import { AwsService } from 'app/AwsService/aws.service';
@Injectable({
providedIn: 'root'
})
export class ReqTokenInterceptor implements HttpInterceptor{
constructor( private router: Router,public shared:CognitoService,private loaderService:LoaderService,private awsService:AwsService) {
}
isRefreshingToken: boolean = false;
tokenSubject: BehaviorSubject<string> = new BehaviorSubject<string>(null);
addToken(req: HttpRequest<any>, token: string): HttpRequest<any> {
return req.clone({
setHeaders: {
'Authorization': environment.authorization,
'Token': token
}
})
}
// addToken1(req: HttpRequest<any>, token: string): HttpRequest<any> {
// console.log("Token 1",token,req);
// return req.clone({ setHeaders: {'Authorization': environment.authorization,
// 'Token':token,
// // 'From':'2',
// }})
// }
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {
let token:any = this.shared.getAccessToken() ||"";
// console.log("Token From Interceptor >>",cognitoService.getToken())
if(token!=''){
token=token.getIdToken().getJwtToken()
}
this.showLoader();
// return <any>next.handle(this.addToken(req, token)).pipe(
// catchError(error => {
// this.onEnd();
// console.log("Initial Error",error);
// if (error instanceof HttpErrorResponse) {
// if((<HttpErrorResponse>error).status) {
// return this.handle401Error(req,next,error)
// }
// else{
// return this.handle401Error(req,next,error)
// }
// } else {
// console.log("observable error")
// return Observable.throw(error);
// }
// }));
return <any>next.handle(this.addToken(req, token)).pipe(
catchError(error => {
console.log("Initial Error",error);
if (error instanceof HttpErrorResponse) {
if((<HttpErrorResponse>error).status) {
return this.handle401Error(req,next,error)
}
else{
return this.handle401Error(req,next,error)
}
} else {
console.log("observable error")
return Observable.throw(error);
}
}),
finalize(()=>{
this.onEnd()
})
)
}
handle401Error(req: HttpRequest<any>, next: HttpHandler,err) {
console.log("err",err)
console.log("entered",this.isRefreshingToken,this.tokenSubject);
if (err instanceof HttpErrorResponse) {
if(err.status == 401 && err.error.error.toLowerCase() == 'invalid token!'){
console.log("Refreshing Token",err.status)
if (!this.isRefreshingToken) {
this.isRefreshingToken = true;
// Reset here so that the following requests wait until the token
// comes back from the refreshToken call.
this.tokenSubject.next(null);
console.log("STARTING TOKEN REFRESH")
// return this.shared.refresh()
// .subscribe((newToken: string) => {
// console.log("new",newToken)
// if (newToken) {
// let token:any = this.shared.getAccessToken() ||"";
// this.tokenSubject.next( token.getIdToken().getJwtToken());
// console.log(this.tokenSubject);
// return next.handle(this.addToken1(req, token.getIdToken().getJwtToken()))
// // .pipe(tap((event:HttpEvent<any>)=>{
// // if (event instanceof HttpResponse) {
// // this.onEnd();
// // }
// // },
// // (err: any) => {
// // this.handleError<any>('role',err);
// // console.log("Error on Refresh token",err)
// // this.onEnd();
// // }));
// }
// // If we don't get a new token, we are in trouble so logout.
// return this.awsService.logout();
// },err=>console.log("Error refresh",err))
return this.shared.refresh().pipe(
switchMap((newToken: string) =>{
console.log("New Token",newToken)
if(newToken){
this.isRefreshingToken=false
this.tokenSubject.next(newToken);
let token:any = this.shared.getAccessToken() ||"";
this.showLoader();
return next.handle(this.addToken(req, token.getIdToken().getJwtToken())).pipe(tap((event:HttpEvent<any>)=>{
if (event instanceof HttpResponse) {
this.onEnd();
}
},
(err: any) => {
this.handleError<any>('role',err);
console.log("Error on Refresh token",err)
this.onEnd();
}));
}
return this.awsService.logout();
})
)
// .catch(error => {
// // If there is an exception calling 'refreshToken', bad news so logout.
// return this.logoutUser();
// })
// .finally(() => {
// this.isRefreshingToken = false;
// });
} else {
console.log("Else Part 1201")
// return this.tokenSubject
// // .filter(token => token != null)
// .take(1)
// .switchMap(token => {
let token:any = this.shared.getAccessToken() ||"";
this.showLoader();
return next.handle(this.addToken(req,token.getIdToken().getJwtToken())).pipe(tap((event:HttpEvent<any>)=>{
if (event instanceof HttpResponse) {
this.onEnd();
}
},
(err: any) => {
this.handleError<any>('role',err);
console.log("Error on Refresh token",err)
this.onEnd();
}));
// });
}
}
else{
// return Observable.throw("Observable throw",err);
return this.handleError('',err)
}
}
else{
return Observable.throw("Observable throw",err);
}
}
private handleError<T> (operation = 'operation', error?: T) {
// return (error: any): Observable<T> => {
console.log("d",error)
if(error instanceof HttpErrorResponse){
// this.onEnd();
console.log("Error from interceptor >>>",error)
console.error("Error: " + error.status);
if(error.status == 401){
localStorage.clear();
this.router.navigate(['/authentication/login']);
}
else if(error.status == 404){
this.router.navigate(['/error/404']);
}
else if(error.status == 503){
this.router.navigate(['/error/503']);
}
else if(error.status == 0){
console.log("NO Internet")
// this.router.navigate(['/error/404']);
}
else{
// alert("Please Check your Internet connection");
let errorMessage = '';
let type : number;
if (error.error instanceof ErrorEvent) {
// client-side error
errorMessage = `Error: ${error.error.message}`;
type = 1;
} else {
// server-side error
errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`;
type = 2;
}
return throwError({error_status :type == 2 ? error.status : '',
error_message:error.message,
error_text :type == 2 ? error.statusText : '',
html_format :errorMessage,
error_type :type,
});
}
return throwError(error);
}
// };
}
// };
// }
private onEnd(): void {
this.hideLoader();
}
private showLoader(): void {
this.loaderService.show();
}
private hideLoader(): void {
this.loaderService.hide();
}
}

View File

@ -0,0 +1,72 @@
import { Injectable } from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor,
HttpHeaders,
HttpResponse
} from '@angular/common/http';
// import { AuthGuard } from './auth.guard';
import { Observable, of } from 'rxjs';
import { Router } from '@angular/router';
import { catchError, map, tap } from 'rxjs/operators';
import { HttpErrorResponse } from "@angular/common/http";
import { CognitoService } from '../AwsService/cognito.service';
import {environment} from '../../environments/environment'
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Injectable()
export class TokenInterceptor implements HttpInterceptor{
constructor( private router: Router,public shared:CognitoService,private loaderService:LoaderService) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
// request = request.clone({
// setHeaders: {
// Authorization: `${this.auth.getToken()}`
// }
// });
this.showLoader();
let token:any = this.shared.getAccessToken() ||"";
//console.log(token);
let requests = request.clone({
headers:new HttpHeaders({
'Authorization': environment.authorization,
'Token': token.getIdToken().getJwtToken()
})
});
return next.handle(requests).pipe(tap((event:HttpEvent<any>)=>{
if (event instanceof HttpResponse) {
this.onEnd();
}
},
(err: any) => {
this.onEnd();
this.handleError<any>('role',err);
}));
}
private handleError<T> (operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
if(error instanceof HttpErrorResponse){
console.error("Error: " + error.status);
if(error.status == 401){
localStorage.clear();
this.router.navigate(['/authentication/login']);
}
return of(result as T);
}
};
}
private onEnd(): void {
this.hideLoader();
}
private showLoader(): void {
this.loaderService.show();
}
private hideLoader(): void {
this.loaderService.hide();
}
}

View File

@ -0,0 +1,3 @@
<h1>
{{title}}
</h1>

View File

@ -0,0 +1,5 @@
describe('App: Optima', () => {
it('should expect true to be true', () => {
expect(true).toBe(true);
});
});

View File

@ -0,0 +1,36 @@
import { Component, OnInit } from '@angular/core';
import { SwUpdate } from '@angular/service-worker';
import { TranslateService} from '@ngx-translate/core';
@Component({
selector: 'app-root',
template: '<router-outlet></router-outlet>'
})
export class AppComponent implements OnInit {
promptEvent: Event;
constructor(translate: TranslateService,private swUpdate:SwUpdate) {
translate.addLangs(['en', 'fr']);
translate.setDefaultLang('en');
const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
window.addEventListener('beforeinstallprompt', event => {
this.promptEvent = event;
// this.Pwa.promptEvent=event
console.log("beforeinstall Prompt Listener",event);
// alert("Install as App");
});
}
ngOnInit() {
if (this.swUpdate.isEnabled) {
this.swUpdate.available.subscribe(() => {
if(confirm("New version available. Load New Version?")) {
window.location.reload();
}
});
}
}
}

140
ng6-seed/src/app/app.module.ts Executable file
View File

@ -0,0 +1,140 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { PreloadAllModules, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule, Http } from '@angular/http';
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS} from '@angular/common/http';
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar';
import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {TranslateService} from '@ngx-translate/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { DemoMaterialModule } from './shared/demo.module';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatInputModule} from '@angular/material/input';
import {MatIconModule} from '@angular/material/icon';
import {MatListModule} from '@angular/material/list';
import {MatMenuModule} from '@angular/material/menu';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatTabsModule} from '@angular/material/tabs';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatSelectModule} from '@angular/material/select';
import {MatCardModule} from '@angular/material/card';
import {MatBadgeModule} from '@angular/material/badge';
import {ChangePasswordDialog} from './settings/users/user-profile/user-profile.component';
import { MatFormFieldModule,MatProgressSpinnerModule, MatRadioModule } from '@angular/material';
import { AppRoutes } from './app.routing';
import { AppComponent } from './app.component';
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
import { SharedModule } from './shared/shared.module';
import { AwsService } from './AwsService/aws.service';
import { TokenInterceptor } from './_guard/token.interceptor';
import { NewPasswordDialog, ForgotPass } from './session/login/login.component';
import { AuthGuard } from './_guard/auth.guard';
import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe';
import { ResizableModule } from 'angular-resizable-element';
// import { SalesPdComponent, DialogOverviewExampleDialog } from './sales-pd/sales-pd.component';
import { PdTrigerService } from './personal-discussion/pd-service/pd-triger.service';
import { LoaderService } from './shared/loaderService/loader.service';
import { HttpLoaderComponent } from './layouts/http-loader/http-loader.component';
// import { AdvanceFilterComponent } from './sales-pd/advance-filter/advance-filter.component';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
import { ReqTokenInterceptor } from './_guard/req-token.interceptor';
import { MatVideoModule } from 'mat-video';
import { MAT_DATE_LOCALE } from '@angular/material/core';
import { DialogOverviewExampleDialog } from './sales-pd/sales-pd-list/sales-pd.component';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
// const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
// suppressScrollX: true
// };
@NgModule({
declarations: [
AppComponent,
AdminLayoutComponent,
AuthLayoutComponent,
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe,
HttpLoaderComponent,
DialogOverviewExampleDialog
],
imports: [
BrowserModule,
BrowserAnimationsModule,
SharedModule,
RouterModule.forRoot(AppRoutes,{preloadingStrategy:PreloadAllModules}),
FormsModule,
HttpModule,
MatSidenavModule,
MatInputModule,
MatIconModule,
MatListModule,
MatMenuModule,
MatRadioModule,
MatToolbarModule,
MatTabsModule,
MatCheckboxModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatSelectModule,
MatCardModule,
MatBadgeModule,
DemoMaterialModule,
MatFormFieldModule,
HttpClientModule,
ResizableModule,
ReactiveFormsModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
}),
FlexLayoutModule,
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
MatVideoModule
],
providers: [
{
provide: LocationStrategy,
useClass: HashLocationStrategy,
},
AwsService,AuthGuard,
TranslateService,
PdTrigerService,LoaderService,
// {
// provide: PERFECT_SCROLLBAR_CONFIG,
// useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG
// },
{
provide:HTTP_INTERCEPTORS,
useClass: ReqTokenInterceptor,
multi: true
},
{ provide:MAT_DATE_LOCALE, useValue: 'en-GB' }
],
entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog],
bootstrap: [AppComponent]
})
export class AppModule { }

60
ng6-seed/src/app/app.routing.ts Executable file
View File

@ -0,0 +1,60 @@
import { Routes } from '@angular/router';
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
import { CognitoService} from './AwsService/cognito.service';
import { AuthGuard } from './_guard/auth.guard';
// import { SalesPdComponent } from './sales-pd/sales-pd.component';
export const AppRoutes: Routes = [{
path: '',
redirectTo: 'personal_discussion',
pathMatch: 'full',
}, {
path: '',
component: AdminLayoutComponent,
canActivateChild:[AuthGuard],
children: [
// {
// path: 'home',
// loadChildren: './dashboard/dashboard.module#DashboardModule'
// },{
// path:'setting',
// loadChildren:'./settings/settings.module#SettingsModule'
// }
// ,
{
path:'personal_discussion',
loadChildren:'./personal-discussion/personal-discussion.module#PersonalDiscussionModule'
},
// {
// path:'quality_check_discussion',
// loadChildren:'./quality-check/quality-check.module#QualityCheckModule'
// },
// {
{
path:'sales-pd-list',
loadChildren:'./sales-pd/sales-pd.module#SalesPdModule'
},
// {
// path:'credit_pd',
// loadChildren:'./lender-credit-pd/lender-credit-pd.module#LenderCreditPdModule'
// },
// {
// path:'reports',
// loadChildren:'./reports/reports.module#ReportsModule'
// },
]
}, {
path: '',
component: AuthLayoutComponent,
children: [{
path: 'authentication',
loadChildren: './session/session.module#SessionModule'
},{
path: 'error',
loadChildren: './error/error.module#ErrorModule'
},]
}, {
path: '**',
redirectTo: 'session/404'
}];

View File

@ -0,0 +1,270 @@
export const single = [
{
name: 'Germany',
value: 40632
},
{
name: 'USA',
value: 49737
},
{
name: 'France',
value: 36745
},
{
name: 'UK',
value: 36240
},
{
name: 'Spain',
value: 33000
},
{
name: 'Italy',
value: 35800
}
];
export const multi = [
{
name: 'Draft',
series: [
{
name: 'Full PD',
value: 16
},
{
name: 'Smart PD',
value: 13
},
{
name: 'Tele PD',
value: 12
},
]
},
{
name: 'Triggered',
series: [
{
name: 'Full PD',
value: 16
},
{
name: 'Smart PD',
value: 17
},
{
name: 'Tele PD',
value: 12
},
]
},
{
name: 'Allocated',
series: [
{
name: 'Full PD',
value: 12
},
{
name: 'Smart PD',
value: 32
},
{
name: 'Tele PD',
value: 20
},
]
},{
name: 'Scheduled',
series: [
{
name: 'Full PD',
value: 15
},
{
name: 'Smart PD',
value: 24
},
{
name: 'Tele PD',
value: 14
}
]
},
{
name: 'Inprogress',
series: [
{
name: 'Full PD',
value: 24
},
{
name: 'Smart PD',
value: 20
},
{
name: 'Tele PD',
value: 23
},
]
},
{
name: 'Completed',
series: [
{
name: 'Full PD',
value: 14
},
{
name: 'Smart PD',
value: 22
},
{
name: 'Tele PD',
value: 14
},
]
},
{
name: 'QC Completed',
series: [
{
name: 'Full PD',
value: 22
},
{
name: 'Smart PD',
value: 17
},
{
name: 'Tele PD',
value: 21
},
]
}
];
export const bubble = [
{
name: 'Germany',
series: [
{
name: '2009',
x: new Date(2009, 0, 1),
y: 80.3,
r: 80.4
},
{
name: '2006',
x: new Date(2006, 0, 1),
y: 80.3,
r: 78
},
{
name: '1995',
x: new Date(1995, 0, 1),
y: 77.7,
r: 58.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.4,
r: 79
}
]
},
{
name: 'USA',
series: [
{
name: '2010',
x: new Date(2010, 0, 1),
y: 78.8,
r: 310
},
{
name: '2005',
x: new Date(2005, 0, 1),
y: 76.9,
r: 283
},
{
name: '1996',
x: new Date(1996, 0, 1),
y: 78.7,
r: 59.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.4,
r: 253
}
]
},
{
name: 'France',
series: [
{
name: '2008',
x: new Date(2008, 0, 1),
y: 81.4,
r: 63
},
{
name: '2000',
x: new Date(2000, 0, 1),
y: 79.1,
r: 59.4
},
{
name: '1994',
x: new Date(1994, 0, 1),
y: 76.7,
r: 58.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 77.2,
r: 56.9
}
]
},
{
name: 'UK',
series: [
{
name: '2007',
x: new Date(2007, 0, 1),
y: 80.2,
r: 62.7
},
{
name: '2003',
x: new Date(2003, 0, 1),
y: 77.8,
r: 58.9
},
{
name: '1995',
x: new Date(1995, 0, 1),
y: 78.7,
r: 59.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.7,
r: 57.1
}
]
}
];

View File

@ -0,0 +1,141 @@
<div class="pad-wrap" [style.minHeight]="'100%'">
<div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
<mat-card>
<mat-card-title style="background-color:#e00201;padding: 23px;">TAT Charts</mat-card-title>
<mat-card-subtitle></mat-card-subtitle>
<mat-card-content>
<div class="w-100 h-300px">
<ngx-charts-bar-horizontal-stacked [scheme]="colorScheme" [results]="multi" [gradient]="gradient" [xAxis]="showXAxis" [yAxis]="showYAxis" [legend]="showLegend" [showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel" [xAxisLabel]="yAxisLabel" [yAxisLabel]="xAxisLabel" (select)="onSelect($event)">
</ngx-charts-bar-horizontal-stacked>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
<div class="pad-wrap" [style.minHeight]="'100%'">
<div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
<mat-card>
<mat-card-title style="background-color:#e00201;padding: 23px;">
PD Report
</mat-card-title>
<mat-card-content>
<div fxFlex="row">
<div fxFlex="100">
<div fxFlex="50" algin="center">
<div fxLayout="row wrap">
<mat-card style="background-color:#c1c1c1;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h2>892</h2>
<h6 style="margin-top: 0px;">Draft</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#f44336;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>265</h4>
<h6 style="margin-top: 0px;">Triggered</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#ffa500;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>452</h4>
<h6 style="margin-top: 0px;">Allocated</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#ffeb3b;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">Scheduled</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#3f51b5;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">InProgress</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#3f51b5;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">Completed</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#4caf50;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">QC Completed</h6>
</mat-card-content>
</mat-card>
<!-- </div> -->
</div>
</div>
<div fxFlex="50" algin="center">
<div fxLayout="row wrap">
<!-- <div fxFlex="100"> -->
<mat-card style="background-color:#c1c1c1;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h2>892</h2>
<h6 style="margin-top: 0px;">Draft</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#f44336;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>265</h4>
<h6 style="margin-top: 0px;">Triggered</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#ffa500;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>452</h4>
<h6 style="margin-top: 0px;">Allocated</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#ffeb3b;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">Scheduled</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#3f51b5;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">InProgress</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#3f51b5;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">Completed</h6>
</mat-card-content>
</mat-card>
<mat-card style="background-color:#4caf50;color: #fff;height: 100px;text-align: center;width: 125px;margin: 1px;">
<mat-card-content>
<h4>56</h4>
<h6 style="margin-top: 0px;">QC Completed</h6>
</mat-card-content>
</mat-card>
<!-- </div> -->
<div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
<!-- <mat-card>
<mat-card-title>Bar Chart 4</mat-card-title>
<mat-card-subtitle></mat-card-subtitle>
<hr>
<mat-card-content>
<div class="w-100 h-300px">
<ngx-charts-bar-horizontal-stacked [scheme]="colorScheme" [results]="multi" [gradient]="gradient" [xAxis]="showXAxis" [yAxis]="showYAxis" [legend]="showLegend" [showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel" [xAxisLabel]="yAxisLabel" [yAxisLabel]="xAxisLabel" (select)="onSelect($event)">
</ngx-charts-bar-horizontal-stacked>
</div>
</mat-card-content>
</mat-card> -->
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>

View File

@ -0,0 +1,74 @@
$red: #f5515f;
$blue: #05abe0;
$grey: #343434;
$p: 12px;
::ng-deep .ngx-mat-drp-date-input{text-overflow:ellipsis !important;color:#fff !important;}
mat-card-title{
background-color:#E00201 !important;
color:#fff;
}
.mat-input-wrapper {
background: #fff;
}
li
{
display:inline-block;
//float:left;
}
.example-full-width {
width: 95%;
}
.oval {
height: 13px;
width: 25px;
border-radius: 50%;
}
// .ngx-mat-drp-date-input[_ngcontent-c17] {
// text-overflow: ellipsis;
// color: #fff;
// }
//.lengend-list {
// list-style-type: none;
//margin: 0;
// padding: 0;
// overflow: hidden;
// text-align:justify;
//}
.lengend-element {
font-size: 1rem !important;
padding-right: 3%;
}
.donut-inner{
margin-top: -165px;
// margin-left: 120px;
}
.donut-inner h5 {
margin-bottom: 5px;
margin-top: 0;
}
.donut-inner span{
font-size:1rems;
}
mat-card-content{
min-height: 400px;
}
.chart{
padding: 0.8rem;
}
::ng-deep .body-container{
padding: 0rem !important;
}

View File

@ -0,0 +1,41 @@
import { Component } from '@angular/core';
import { DashboardService } from './dashboard.service';
import { single, multi } from './charts.data';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent {
dashboardTitle = 'PD Report';
public single: any[];
public multi: any[];
public showXAxis = true;
public showYAxis = true;
public gradient = false;
public showLegend = false;
public showXAxisLabel = true;
public xAxisLabel = 'PD Process';
public showYAxisLabel = true;
public yAxisLabel = 'PD`s';
public colorScheme = {
domain: ['#ffeb3b', '#ffa500', '#f44336']
};
constructor(private _dashboardService: DashboardService) {
Object.assign(this, {single, multi});
}
ngOnInit(){}
public onSelect(event) {
console.log(event);
}
}

View File

@ -0,0 +1,38 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { FlexLayoutModule } from '@angular/flex-layout';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { NgxChartsModule} from '@swimlane/ngx-charts';
import { MatIconModule,
MatCardModule,
MatTabsModule,
MatButtonModule} from '@angular/material';
import { DashboardComponent } from './dashboard.component';
import { DashboardRoutes } from './dashboard.routing';
/** Dashboard Service */
import { DashboardService } from './dashboard.service';
import { PersonalDiscussionModule } from 'app/personal-discussion/personal-discussion.module';
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(DashboardRoutes),
MatIconModule,
MatCardModule,
MatTabsModule,
MatButtonModule,
ChartsModule,
NgxChartsModule,
MatCardModule,
FlexLayoutModule
],
providers: [ DashboardService ],
declarations: [ DashboardComponent ]
})
export class DashboardModule {}

View File

@ -0,0 +1,17 @@
import { Routes } from '@angular/router';
export const DashboardRoutes: Routes = [
// {
// path: '',
// component: DashboardComponent
// },
// {
// path: '',
// redirectTo: 'personal_discussion',
// pathMatch: 'full',
// },
// {
// path:'personal_discussion',
// loadChildren:'./personal-discussion/personal-discussion.module#PersonalDiscussionModule'
// }
];

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { DashboardService } from './dashboard.service';
describe('DashboardService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: DashboardService = TestBed.get(DashboardService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,28 @@
/** Common Import Section */
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';//for Datatables
import { HttpClient } from '@angular/common/http';
import { catchError } from 'rxjs/operators';
import { of } from 'rxjs';
/** Imported Service Files Are., */
import { AwsService } from '../AwsService/aws.service';
/** Environment */
import { environment } from 'environments/environment';
@Injectable({
providedIn: 'root'
})
export class DashboardService {
private apiUrl = environment.apiEndpoint;
constructor(private _http: HttpClient,
private _aws:AwsService) { }
getCommonSettingsConfig(){
return this._http.post(this.apiUrl+'getCommonConfig', '');
}
}

View File

@ -0,0 +1,17 @@
<div class="relative">
<div class="form-bg">
<div class="relative error-wrapper">
<h1>
Oops!</h1>
<span class="error-text">404</span>
<h2>
Not Found</h2>
<div class="error-details">
<p> Sorry, an error has occured, Requested page not found!</p>
</div>
<div class="error-actions">
<button class="mat-blue" mat-raised-button [routerLink]="[ '/' ]" >Take me to home</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,20 @@
import { Component, OnInit,ViewEncapsulation } from '@angular/core';
@Component({
selector: 'ms-error-404',
templateUrl:'./error-404-component.html',
styleUrls: ['./error-404-component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ErrorOneComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

View File

@ -0,0 +1,17 @@
<div class="relative">
<div class="form-bg">
<div class="relative error-wrapper">
<h1>
Error!</h1>
<span class="error-text">505</span>
<h2>
Service is currently unavailbale</h2>
<div class="error-details">
<p>Sorry, but the page you were trying to view does not exist</p>
</div>
<div class="error-actions">
<button class="mat-blue" mat-raised-button>Take me to home</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,20 @@
import { Component, OnInit,ViewEncapsulation } from '@angular/core';
@Component({
selector: 'ms-error-503',
templateUrl:'./error-503-component.html',
styleUrls: ['./error-503-component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ErrorTwoComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

View File

@ -0,0 +1,38 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { MatIconModule} from '@angular/material';
import {
MatCardModule,
MatInputModule,
MatRadioModule,
MatButtonModule,
MatProgressBarModule,
MatToolbarModule } from '@angular/material';
import { ErrorOneComponent} from './404/error-404.component';
import { ErrorTwoComponent} from './503/error-503.component';
import { ErrorRoutes } from './error.routing';
@NgModule({
imports: [
CommonModule,
FormsModule,
MatIconModule,
MatCardModule,
MatIconModule,
MatInputModule,
MatRadioModule,
MatButtonModule,
MatProgressBarModule,
MatToolbarModule,
RouterModule.forChild(ErrorRoutes)
],
declarations: [
ErrorOneComponent,
ErrorTwoComponent,
]
})
export class ErrorModule {}

View File

@ -0,0 +1,19 @@
import { Routes } from '@angular/router';
import { ErrorOneComponent} from './404/error-404.component';
import { ErrorTwoComponent} from './503/error-503.component';
export const ErrorRoutes: Routes = [{
path: '',
redirectTo: '404',
pathMatch: 'full',
},{
path: '',
children: [{
path: '404',
component: ErrorOneComponent
}, {
path: '503',
component: ErrorTwoComponent
}]
}];

View File

@ -0,0 +1,603 @@
<div class="app search-i" [dir]="layoutDir" [ngClass]="[ menuLayout, selectedSidebarImage, selectedSidebarColor, selectedHeaderColor, collapsedClass]" [class.app-dark]="dark" [class.boxed]="boxed" [class.collapsed-sidebar]="collapseSidebar" [class.compact-sidebar]="compactSidebar" [class.bg-img-disable]="!sidebarBg">
<mat-sidenav-container class="app-inner">
<mat-sidenav #sidemenu class="sidebar-panel" id="sidebar-panel" [mode]="isOver() ? 'over' : 'side'" [opened]="!isOver()" (mouseover)="menuMouseOver()" (mouseout)="menuMouseOut()">
<div class="opt-side relative ">
<div class="sidebar-container ">
<div class="branding text-center">
<!-- <h2><i class="fa fa-superpowers" aria-hidden="true"></i> <span> OPTIMA</span>
</h2> -->
<h2>
<img src="assets/images/PD_Genie_TM1.jpg" style="height: 50px;"> <!-- <span> {{userDep}} </span> -->
</h2>
</div>
<div class="main-nav">
<div class="user-pro-wrap">
<div class="user-profile-thumb text-center">
<div class="user-i">
<div><h3>{{userDep}} </h3></div>
<img [src]="profileurl ||'https://image.ibb.co/mGjZB9/usernew.png'" class="rad-full mb-1" width="100" height="100" alt="">
<div><h4>{{fullName}}</h4></div>
<div><h5>{{roleName}}</h5></div>
</div>
</div>
<div class="most-used text-center">
<a class="most-link" color="primary" (click)="menunav('HOME')">
<mat-icon>home</mat-icon>
</a>
<a class="most-link" color="primary" (click)="menunav('USERS')">
<mat-icon>person</mat-icon>
</a>
<!---- <a class="most-link" color="primary" (click)="menunav('SETTINGS')">
<mat-icon>settings</mat-icon>
</a>-->
</div>
</div>
<mat-nav-list appAccordion class="navigation relative">
<mat-list-item appAccordionLink *ngFor="let menuitem of currentUser.short_name == 'MWISE' ? menuItems.salesgetAll() : menuItems.getAll() | roleMenuItems:'2'">
<a appAccordionToggle class="relative" mat-ripple [routerLink]="['/', menuitem.state]" *ngIf="menuitem.type === 'link'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
</a>
<a appAccordionToggle class="relative" mat-ripple href="{{menuitem.state}}" *ngIf="menuitem.type === 'extLink'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
</a>
<a appAccordionToggle class="relative" mat-ripple href="{{menuitem.state}}" target="_blank" *ngIf="menuitem.type === 'extTabLink'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
</a>
<a appAccordionToggle class="relative" mat-ripple href="javascript:;" *ngIf="menuitem.type === 'sub'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
<mat-icon class="menu-caret">arrow_drop_down</mat-icon>
</a>
<mat-nav-list class="sub-menu" *ngIf="menuitem.type === 'sub'">
<mat-list-item *ngFor="let childitem of menuitem.children" routerLinkActive="open">
<a [routerLink]="['/', menuitem.state, childitem.state ]" class="relative" mat-ripple>{{ childitem.name | translate }}</a>
</mat-list-item>
</mat-nav-list>
<!-- Multi-->
<a appAccordionToggle class="relative" mat-ripple href="javascript:;" *ngIf="menuitem.type === 'multi'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
<mat-icon class="menu-caret">arrow_drop_down</mat-icon>
</a>
<div *ngFor="let multichild of menuitem.multichild" >
<mat-nav-list class="sub-menu" *ngIf="multichild.type === 'sub'">
<mat-list-item *ngFor="let childitem of multichild.children" routerLinkActive="open">
<a [routerLink]="['/', multichild.state, childitem.state ]" class="relative" mat-ripple>{{ childitem.name | translate }}</a>
</mat-list-item>
</mat-nav-list>
</div>
<!--End-->
</mat-list-item>
<mat-divider></mat-divider>
<!-- <mat-list-item>
<a (click)="addMenuItem()">
<mat-icon>add</mat-icon>
<span>Add</span>
</a>
</mat-list-item> -->
</mat-nav-list>
</div>
</div>
</div>
<div class="bg-overlay"></div>
</mat-sidenav>
<mat-toolbar class="main-header" style="border-bottom:2px solid #f44336;">
<div class="horizontal-top-bar w-100">
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
<div class="horizontal-logo">
<div class="branding">
<!-- <h2><i class="fa fa-superpowers" aria-hidden="true"></i> <span> OPTIMA</span>
</h2> -->
<!--<h2><i class="fa fa-superpowers" aria-hidden="true"></i> <span> {{userDep}}({{fullName}})</span>
</h2>-->
<a (click)="menunav('HOME')">
<img [routerLink]="['/dashboard']" src="assets/images/PD_Genie_TM1.jpg" style="height: 35px;"> <strong> | </strong> <span> {{userDep}} </span>
</a>
</div>
</div>
</div>
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
<!--<div class="search-bar" fxFlex>
<form class="search-form">
<mat-icon>search</mat-icon>
<input type="text" placeholder="Search" autofocus="true" />
</form>
</div>-->
</div>
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
<div class="menu-links">
<span *ngFor="let menuitem of currentUser.short_name == 'MWISE' ? horizontalMenuItems.salesgetAll() : horizontalMenuItems.getAll() | roleMenuItems:'1'">
<button mat-icon-button matTooltip="{{ menuitem.name}}" matTooltipPosition="below" [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'link'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<!--<span>{{ menuitem.name | translate }}</span>-->
</button>
</span>
<!-- <span *ngFor="let menuitem of horizontalMenuItems.getAll()">
<span *ngIf="menuitem.type === 'multi'">
<button [mat-menu-trigger-for]="multi" matTooltip="{{ menuitem.name}}" matTooltipPosition="below" mat-icon-button class="ml-xs" *ngIf="userRoleType=='10'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
</button>
<mat-menu #multi="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
{{ menuitem.name}}
</div>
<div class="dropdown">
<div *ngFor="let childitem of menuitem.children">
<button mat-menu-item [routerLink]="['/'+childitem.state ]">{{ childitem.name | translate }}</button>
</div>
</div>
</mat-menu>
</span>
</span> -->
<!-- <button appToggleFullscreen matTooltip="Fullscreen" matTooltipPosition="below" mat-icon-button>
<mat-icon>fullscreen</mat-icon>
</button> -->
<!--<button [mat-menu-trigger-for]="user2" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>message</mat-icon>
</button>
<mat-menu #user2="matMenu" class="opt-menu" x-position="after">
<div mat-menu-item class="head-menu grad-blue">
Message Menu
</div>
<button mat-menu-item>
<img width="40" src="assets/images/user-1.jpg" alt="">
Next Update for angular 5
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-2.jpg" alt="">
Check out our new admin theme
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-3.jpg" alt="">
Expedita quo, laboriosam officia.
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-4.jpg" alt="">
Lorem ipsum dolor sit amet consectetur.
</button>
</mat-menu>
<button [mat-menu-trigger-for]="user1" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>reorder</mat-icon>
<span class="notification-label">3</span>
</button> -->
<!-- <mat-menu #user1="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
User Menu
</div>
<button mat-menu-item>
<mat-icon>show_chart</mat-icon>
Charts
</button>
<button mat-menu-item>
<mat-icon>navigation</mat-icon>
Maps
</button>
<button mat-menu-item>
<mat-icon>web</mat-icon>
Calendar Settings
</button>
</mat-menu> -->
<!-- <button (click)="end.toggle()" matTooltip="Notifications" matTooltipPosition="below" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>notifications</mat-icon> -->
<!-- <span class="notification-label">2</span> -->
<!-- <span *ngIf="alertCount != 0" style = "width:23px" class="notification-label" >{{alertCount}}</span>
</button> -->
<button [mat-menu-trigger-for]="user" mat-icon-button class="ml-xs">
<mat-icon>person</mat-icon>
</button>
<mat-menu #user="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
Settings
</div>
<button mat-menu-item>
<mat-icon>settings</mat-icon>
Setting
</button>
<button mat-menu-item (click)="userprofile()">
<mat-icon>account_box</mat-icon>
Profile
</button>
<!-- <button mat-menu-item>
<mat-icon>notifications_off</mat-icon>
Disable notifications
</button> -->
<button mat-menu-item (click)="logout()">
<mat-icon>exit_to_app</mat-icon>
Sign Out
</button>
</mat-menu>
</div>
</div>
</div>
<div class="vertical-menu w-100">
<button (click)="menuToggleFunc()" mat-icon-button class="lines-btn">
<mat-icon>menu</mat-icon>
</button>
<!-- <div class="search-bar" fxFlex>
<form class="search-form" fxShow="false" fxShow.gt-xs>
<mat-icon>search</mat-icon>
<input type="text" placeholder="Search" autofocus="true" />
</form>
</div> -->
<span fxFlex></span>
<!-- <button appToggleFullscreen mat-icon-button>
<mat-icon>fullscreen</mat-icon>
</button> -->
<!-- <button [mat-menu-trigger-for]="user2" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>message</mat-icon>
</button>
<mat-menu #user2="matMenu" class="opt-menu" x-position="after">
<div mat-menu-item class="head-menu grad-blue">
Message Menu
</div>
<button mat-menu-item>
<img width="40" src="assets/images/user-1.jpg" alt="">
Next Update for angular 5
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-2.jpg" alt="">
Check out our new admin theme
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-3.jpg" alt="">
Expedita quo, laboriosam officia.
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-4.jpg" alt="">
Lorem ipsum dolor sit amet consectetur.
</button>
</mat-menu>
<button [mat-menu-trigger-for]="user1" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>reorder</mat-icon>
<span class="notification-label">3</span>
</button>
<mat-menu #user1="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
User Menu
</div>
<button mat-menu-item>
<mat-icon>show_chart</mat-icon>
Charts
</button>
<button mat-menu-item>
<mat-icon>navigation</mat-icon>
Maps
</button>
<button mat-menu-item>
<mat-icon>web</mat-icon>
Calendar Settings
</button>
</mat-menu> -->
<!-- <button (click)="end.toggle()" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>notifications</mat-icon>
</button> -->
<button [mat-menu-trigger-for]="user" matTooltip="Person" matTooltipPosition="below" mat-icon-button class="ml-xs">
<mat-icon>person</mat-icon>
</button>
<mat-menu #user="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
{{fullName}}
</div>
<!--<button mat-menu-item>
<mat-icon>settings</mat-icon>
Setting
</button>-->
<button mat-menu-item (click)="userprofile()">
<mat-icon>account_box</mat-icon>
Profile
</button>
<!-- <button mat-menu-item>
<mat-icon>notifications_off</mat-icon>
Disable notifications
</button> -->
<button mat-menu-item (click)="logout()">
<mat-icon>exit_to_app</mat-icon>
Sign Out
</button>
</mat-menu>
</div>
</mat-toolbar>
<!--<div class="horizontal-menu text-center">
<nav>
<ul class="main-h-list">
<li *ngFor="let menuitem of horizontalMenuItems.getAll()">
<a [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'link'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
</a>
<a [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'sub'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
</a>
<ul class="dropdown" *ngIf="menuitem.type === 'sub'">
<li *ngFor="let childitem of menuitem.children">
<a [routerLink]="['/'+childitem.state ]">{{ childitem.name | translate }}</a>
<ul class="dropdown" *ngIf="childitem.type === 'super-sub'">
<li *ngFor="let subchild of childitem.subchildren">
<a [routerLink]="['/'+subchild.state ]">{{subchild.name | translate}}</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>-->
<app-http-loader></app-http-loader>
<div class="body-container">
<router-outlet></router-outlet>
</div>
<mat-sidenav #end position="end" mode="over" opened="false">
<div style="text-align: center;">Not Yet Scheduled</div>
<mat-tab-group [selectedIndex]="1" mat-stretch-tabs>
<mat-tab>
<ng-template mat-tab-label>Triggered</ng-template>
<div class="scroll">
<mat-nav-list>
<ng-template let-item let-last="last" ngFor [ngForOf]="alertMsgTriggerType">
<mat-list-item>
<h3 mat-line> {{item.applicant_name}} </h3>
<p mat-line> {{item.lender_applicant_id}}</p>
<p mat-line> {{item.entity_name}} - {{item.pd_status}} </p>
</mat-list-item>
</ng-template>
</mat-nav-list>
</div>
</mat-tab>
<!--<mat-tab>
<ng-template mat-tab-label>Today</ng-template>
<ng-template mat-tab-label>Allocated</ng-template>
<div class="scroll">
<mat-list class="pt-1 pb-1">
<mat-list-item>
<div fxLayout="column">
<h2 class="ma-0">{{ today | date:'EEEE' }}</h2>
<h6 class="mat-text-muted ma-0"><span>{{ today | date:'dd' }}</span>&nbsp;<span>{{ today | date:'MMMM' }}</span></h6>
</div>
</mat-list-item>
</mat-list>
<mat-nav-list>
<mat-divider></mat-divider>
<h3 mat-subheader class="text-uppercase font-weight-bold">Projects Stats</h3>
<mat-list-item>
<p class="text-mat" mat-line>Project A</p>
<mat-progress-bar mat-line mode="determinate" color="warn" value="20"></mat-progress-bar>
</mat-list-item>
<mat-list-item>
<p class="text-mat" mat-line>Project B </p>
<mat-progress-bar mat-line mode="determinate" color="accent" value="80"></mat-progress-bar>
</mat-list-item>
<mat-list-item>
<p class="text-mat" mat-line>Project C</p>
<mat-progress-bar mat-line mode="determinate" value="30"></mat-progress-bar>
</mat-list-item>
<mat-divider></mat-divider>
<h3 mat-subheader class="text-uppercase font-weight-bold">Todo</h3>
<mat-list-item>
<a mat-line href="javascript:;">Consectetur adipisicing elit. Nemo omnis.</a>
<p mat-line class="mat-text-muted text-mat">2:45PM</p>
</mat-list-item>
<mat-list-item>
<a mat-line href="javascript:;"> Temporibus cumque cupiditate </a>
<p mat-line class="mat-text-muted text-mat">3:20PM</p>
</mat-list-item>
<mat-list-item>
<a mat-line href="javascript:;">Libero voluptatibus harum quis accusamus</a>
<p mat-line class="mat-text-muted text-mat">16:00PM</p>
</mat-list-item>
</mat-nav-list>
</div>
</mat-tab>-->
<mat-tab>
<ng-template mat-tab-label>Allocated</ng-template>
<div class="scroll">
<mat-nav-list>
<ng-template let-item let-last="last" ngFor [ngForOf]="alertMsgAllocateType">
<mat-list-item>
<h3 mat-line> {{item.applicant_name}} </h3>
<p mat-line> {{item.lender_applicant_id}}</p>
<p mat-line> {{item.entity_name}} - {{item.pd_status}} </p>
</mat-list-item>
</ng-template>
</mat-nav-list>
<!-- <mat-nav-list>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-text-primary">people</mat-icon>
<h4 mat-line>Social</h4>
<p mat-line> 5 new members joined today</p>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-text-warn">local_offer</mat-icon>
<h4 mat-line>Promotions</h4>
<p mat-line>Updated your email
</p>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-text-accent">info</mat-icon>
<h4 mat-line>Updates</h4>
<p mat-line> 15 new product added</p>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-deep-purple">delete_sweep</mat-icon>
<h4 mat-line> 2 order cancelled</h4>
<span class="text-mat mat-text-muted" mat-line>{{ 1427207139000 | date: 'fullDate' }}</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar>check_circle</mat-icon>
<h4 mat-line>System Scan completed</h4>
<span class="text-mat mat-text-muted" mat-line>{{ 1427412725000 | date: 'fullDate' }}</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar>person_add</mat-icon>
<h4 mat-line>4 Users connected</h4>
<span class="text-mat mat-text-muted" mat-line>{{ 1428275520000 | date: 'fullDate' }}</span>
</mat-list-item>
</mat-nav-list> -->
</div>
</mat-tab>
</mat-tab-group>
</mat-sidenav>
</mat-sidenav-container>
<!-- Settings icon -->
<!-- <button mat-fab color="warn" class="mat-fab-bottom-right" (click)="showSettings = true">
<mat-icon class="mat-24">settings</mat-icon>
</button>-->
<mat-card class="settings-panel" *ngIf="showSettings">
<mat-toolbar color="warn">
<span fxFlex>Options</span>
<button mat-icon-button (click)="showSettings = false">
<mat-icon>close</mat-icon>
</button>
</mat-toolbar>
<mat-card-content class="demo-checkbox">
<span class="mb-2 d-block"><strong>Sidebar Image</strong></span>
<div class="bg-img clearfix">
<div class="pb-1" [ngClass]="{'border-active' : isBgActive('bg-1')}">
<a (click)="onSelectSidebarImage('bg-1')">
<img src="assets/images/bg-5.jpg" alt="">
</a>
</div>
<div class="pb-1" [ngClass]="{'border-active' : isBgActive('bg-2')}">
<a (click)="onSelectSidebarImage('bg-2')">
<img src="assets/images/bg-2.jpg" alt="">
</a>
</div>
<div class="pb-1" [ngClass]="{'border-active' : isBgActive('bg-3')}">
<a (click)="onSelectSidebarImage('bg-3')">
<img src="assets/images/bg-3.jpg" alt="">
</a>
</div>
<div class="pb-2" [ngClass]="{'border-active' : isBgActive('bg-4')}">
<a (click)="onSelectSidebarImage('bg-4')">
<img src="assets/images/bg-4.jpg" alt="">
</a>
</div>
</div>
<div class="color-sidebar clearfix">
<div class="pb-1">
<mat-checkbox [(ngModel)]="sidebarBg">Sidebar Image</mat-checkbox>
</div>
<span class="mb-2 d-block"><strong>Sidebar Color</strong></span>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-default')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-default')"><i aria-hidden="true" class="color-default fa fa-circle fa-lg def"></i>
Default</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-green')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-green')"><i aria-hidden="true" class="color-green fa fa-circle fa-lg"></i>
Green</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-red')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-red')"><i aria-hidden="true" class="color-red fa fa-circle fa-lg"></i>
Red</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-purple')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-purple')"><i aria-hidden="true" class="color-purple fa fa-circle fa-lg"></i>
Purple</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-pink')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-pink')"><i aria-hidden="true" class="color-pink fa fa-circle fa-lg"></i>
Pink</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-blue')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-blue')"><i aria-hidden="true" class="color-blue fa fa-circle fa-lg"></i>
Blue</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-green-deep')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-green-deep')"><i aria-hidden="true" class="color-green-deep fa fa-circle fa-lg"></i>
Green Deep</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-brown')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-brown')"><i aria-hidden="true" class="color-brown fa fa-circle fa-lg"></i>
Brown</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-orange')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-orange')"><i aria-hidden="true" class="color-orange fa fa-circle fa-lg"></i>
Orange</a>
</div>
</div>
<div class="color-header clearfix">
<span class="mb-2 d-block"><strong>Header Color</strong></span>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-default')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-default')"><i aria-hidden="true" class="color-default fa fa-circle fa-lg def"></i>
Default</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-green')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-green')"><i aria-hidden="true" class="color-green fa fa-circle fa-lg"></i>
Green</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-red')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-red')"><i aria-hidden="true" class="color-red fa fa-circle fa-lg"></i>
Red</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-purple')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-purple')"><i aria-hidden="true" class="color-purple fa fa-circle fa-lg"></i>
Purple</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-pink')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-pink')"><i aria-hidden="true" class="color-pink fa fa-circle fa-lg"></i>
Pink</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-blue')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-blue')"><i aria-hidden="true" class="color-blue fa fa-circle fa-lg"></i>
Blue</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-green-deep')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-green-deep')"><i aria-hidden="true" class="color-green-deep fa fa-circle fa-lg"></i>
Green Deep</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-brown')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-brown')"><i aria-hidden="true" class="color-brown fa fa-circle fa-lg"></i>
Brown</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-orange')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-orange')"><i aria-hidden="true" class="color-orange fa fa-circle fa-lg"></i>
Orange</a>
</div>
</div>
<div class="pb-1">
<mat-checkbox (change)="changeMenuLayout($event.checked)">Horizontal Menu</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="collapseSidebar" (change)="compactSidebar = false">Collapsed Sidebar</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="compactSidebar" (change)="collapseSidebar = false">Compact Sidebar</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="boxed">Boxed Layout</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="dark" >Dark Mode</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox (change)="layoutDir = (layoutDir == 'rtl' ? 'ltr' : 'rtl')" >RTL</mat-checkbox>
</div>
<div class="pb-3">
<mat-form-field>
<mat-select placeholder="Language" class="mt-1" [(ngModel)]="currentLang" #langSelect="ngModel" (ngModelChange)="translate.use(currentLang)">
<mat-option *ngFor="let lang of translate.getLangs()" [value]="lang">{{ lang }}</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-card-content>
</mat-card>
<!-- /Demo Purposes Only -->
</div>

View File

@ -0,0 +1,318 @@
import { Component, OnInit, OnDestroy, ViewChild, HostListener } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { MenuItems } from '../../shared/menu-items/menu-items';
import { HorizontalMenuItems } from '../../shared/menu-items/horizontal-menu-items';
import { Subscription } from 'rxjs';
import { filter } from 'rxjs/operators';
import {TranslateService} from '@ngx-translate/core';
import PerfectScrollbar from 'perfect-scrollbar';
import { PerfectScrollbarConfigInterface,
PerfectScrollbarComponent, PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { UserService } from '../../settings/service/user.service';
import { DashboardService } from '../../dashboard/dashboard.service';
import { AwsService } from '../../AwsService/aws.service';
import { RoleMenuItemsPipe } from './../role-menu-items.pipe';
@Component({
selector: 'app-layout',
templateUrl: './admin-layout.component.html',
providers: [RoleMenuItemsPipe],
})
export class AdminLayoutComponent implements OnInit, OnDestroy {
profileurl: any;
commonDetails: any;
userDep: string;
fullName: any;
roleName:any;
currentUser: any={short_name : ''};
private _router: Subscription;
today: number = Date.now();
url: string;
showSettings = false;
dark: boolean;
boxed: boolean;
collapseSidebar: boolean;
compactSidebar: boolean;
sidebarBg: boolean = true;
currentLang = 'en';
layoutDir = 'ltr';
menuLayout : any = 'top-menu';
selectedSidebarImage : any = 'bg-1';
selectedSidebarColor : any = 'sidebar-red';
selectedHeaderColor : any = 'header-default';
collapsedClass : any = 'side-panel-opened';
@ViewChild('sidemenu') sidemenu;
public config: PerfectScrollbarConfigInterface = {};
alertMsgTriggerType : any[];
alertMsgAllocateType : any[];
alertCount: any;
userRoleType: String;
userDetails: any;
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) {
const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
this.users.getroles().subscribe(res=>{
this.currentUser = res;
this.userDetails = this.currentUser.records[0]
localStorage.setItem("user_details",JSON.stringify(this.userDetails));
if(this.currentUser.dataStatus == true){
this.currentUser = this.currentUser.records[0];
localStorage.setItem("LocalSetEntity",this.currentUser.fk_entity_id);
this.fullName = this.currentUser.user_first_name +' '+this.currentUser.user_last_name;
this.roleName = this.currentUser.role_name;
console.log('this.currentUser',this.currentUser);
window.localStorage.setItem('LenderRoleID', this.currentUser.user_role);
// FOR TELLING entity id updated to localstorage for list pd component
this.users.messageSubject.next('all_tab')
// "urls": [
// "https://fonts.googleapis.com/**",
// "https://fonts.gstatic.com/**"
// ]
if(this.currentUser.fk_entity_type_id == 1 ){
this.userDep = "SineEdge";
}else if(this.currentUser.fk_entity_type_id == 2 ){
// this.userDep = "Lender";
this.userDep = this.currentUser.full_name;
}else{
this.userDep = "Vendor";
}
let users= {
'userid':this.currentUser.userid,
'entityid':this.currentUser.fk_entity_type_id,
'profilepic':this.currentUser.profilepic
}
this.users.getprofilepic(users).subscribe(res=>{
this.profileurl = res;
if(this.profileurl.dataStatus == true){
this.profileurl = this.profileurl.records;
}
})
}
});
/** 3) Getting PD Details For Alert Message */
// this._dashboardService.getAlertDetail().subscribe(data => {
// console.log(' *****Layout Alert Message *****');
// console.log('Layout Alert Message Whole Data',data);
// this.alertCount = data.records.length;
// this.alertMsgTriggerType = data.records.filter(trigger=>trigger.pd_status == "TRIGGERED" );
// this.alertMsgAllocateType = data.records.filter(allocate=>allocate.pd_status == "ALLOCATED" );
// console.log('Layout Alert Message',this.alertMsgTriggerType);
// console.log('Layout Alert Message',this.alertMsgAllocateType);
// console.log('Layout Alert Count',this.alertCount);
// });
}
ngOnInit(): void {
this.userRoleType=localStorage.getItem('user_role');
// console.clear();
const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container ');
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac() && !this.compactSidebar && this.layoutDir != 'rtl') {
const ps = new PerfectScrollbar(elemSidebar, {
wheelSpeed: 2,
suppressScrollX: true
});
}
this._router = this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe((event: NavigationEnd) => {
this.url = event.url;
if (this.isOver()) {
this.sidemenu.close();
}
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac() && !this.compactSidebar && this.layoutDir != 'rtl') {
// Ps.update(elemContent);
}
});
this.getCommonSettings();
}
@HostListener('click', ['$event'])
onClick(e: any) {
const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container ');
setTimeout(() => {
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac() && !this.compactSidebar && this.layoutDir != 'rtl') {
const ps = new PerfectScrollbar(elemSidebar, {
wheelSpeed: 2,
suppressScrollX: true
});
}
}, 350);
}
ngOnDestroy() {
this._router.unsubscribe();
}
isOver(): boolean {
if (this.url === '/apps/messages' || this.url === '/apps/calendar' || this.url === '/apps/media' || this.url === '/maps/leaflet') {
return true;
} else {
return window.matchMedia(`(max-width: 960px)`).matches;
}
}
isMac(): boolean {
let bool = false;
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
bool = true;
}
return bool;
}
menuMouseOver(): void {
if (window.matchMedia(`(min-width: 960px)`).matches && this.collapseSidebar) {
this.sidemenu.mode = 'over';
}
}
menuMouseOut(): void {
if (window.matchMedia(`(min-width: 960px)`).matches && this.collapseSidebar) {
this.sidemenu.mode = 'side';
}
}
menuToggleFunc()
{
this.sidemenu.toggle();
if(this.collapsedClass == 'side-panel-opened')
{
this.collapsedClass = 'side-panel-closed';
}
else
{
this.collapsedClass= 'side-panel-opened';
}
}
changeMenuLayout(value)
{
// console.log(value)
if(value)
{
this.menuLayout = 'top-menu';
}
else
{
this.menuLayout = 'vertical-menu';
}
}
onSelectSidebarImage(selectedClass, event)
{
this.selectedSidebarImage = selectedClass;
}
onSelectedSidebarColor(selectedClass)
{
this.selectedSidebarColor = selectedClass;
}
onSelectedHeaderColor(selectedClass)
{
this.selectedHeaderColor = selectedClass;
}
isBgActive(value)
{
if(value == this.selectedSidebarImage)
{
return true;
}
else
{
return false;
}
}
isSidebarActive(value)
{
if(value == this.selectedSidebarColor)
{
return true;
}
else
{
return false;
}
}
isHeaderActive(value)
{
if(value == this.selectedHeaderColor)
{
return true;
}
else
{
return false;
}
}
addMenuItem(): void {
this.menuItems.add({
state: 'menu',
name: 'MENU',
type: 'sub',
icon: 'trending_flat',
children: [
{state: 'menu', name: 'MENU'},
{state: 'timelmenuine', name: 'MENU'}
]
});
}
userprofile(){
this.router.navigate(['setting/users/userprofile']);
}
logout(){
//alert();
this.aws.logout().subscribe(res=>{
//alert("res");
this.router.navigate(['/authentication/login']);
})
}
menunav(active){
switch(active){
case 'HOME':
this.router.navigate(['/']);
break;
case 'USERS':
this.router.navigate(['/setting/users/userprofile']);
break;
case 'SETTING':
break;
}
}
getCommonSettings(){
this._dashboardService.getCommonSettingsConfig().subscribe(res=>{
this.commonDetails = res;
if(this.commonDetails.dataStatus == true){
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
}
})
}
}

View File

@ -0,0 +1,3 @@
<mat-sidenav-container>
<router-outlet></router-outlet>
</mat-sidenav-container>

View File

@ -0,0 +1,8 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-layout',
styles: [':host /deep/ .mat-sidenav-content {padding: 0;} .mat-sidenav-container {z-index: 1000}'],
templateUrl: './auth-layout.component.html'
})
export class AuthLayoutComponent {}

View File

@ -0,0 +1,6 @@
<div [class.hidden]="!show">
<div class="loader-overlay">
<!-- <div *ngIf="show" class="loader"></div> -->
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
</div>
</div>

View File

@ -0,0 +1,34 @@
.hidden {
visibility: hidden;
}
.loader-overlay {
position: absolute;
width: 100%;
z-index: 500000;
top: 0;
}
// .loader {
// height: 4px;
// width: 100%;
// position: relative;
// overflow: hidden;
// background-color: #FFF;
// }
// .loader:before {
// display: block;
// position: absolute;
// content: "";
// left: -200px;
// width: 200px;
// height: 4px;
// background-color: red;
// animation: loading 2s linear infinite;
// }
// @keyframes loading {
// from {left: -200px; width: 30%;}
// 50% {width: 30%;}
// 70% {width: 70%;}
// 80% {left: 50%;}
// 95% {left: 120%;}
// to {left: 100%;}
// }

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpLoaderComponent } from './http-loader.component';
describe('HttpLoaderComponent', () => {
let component: HttpLoaderComponent;
let fixture: ComponentFixture<HttpLoaderComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HttpLoaderComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HttpLoaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { Subscription } from 'rxjs';
export interface LoaderState {
show: boolean;
}
@Component({
selector: 'app-http-loader',
templateUrl: './http-loader.component.html',
styleUrls: ['./http-loader.component.scss']
})
export class HttpLoaderComponent implements OnInit {
show = false;
private subscription: Subscription;
constructor( private loaderService: LoaderService) { }
ngOnInit() {
this.subscription = this.loaderService.loaderState
.subscribe((state: LoaderState) => {
this.show = state.show;
});
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
}

View File

@ -0,0 +1,8 @@
import { RoleMenuItemsPipe } from './role-menu-items.pipe';
describe('RoleMenuItemsPipe', () => {
it('create an instance', () => {
const pipe = new RoleMenuItemsPipe();
expect(pipe).toBeTruthy();
});
});

View File

@ -0,0 +1,51 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'roleMenuItems'
})
export class RoleMenuItemsPipe implements PipeTransform {
transform(value: any, type: any): any {
// this is for horizontal menu filter
// if(type=="1"){
// switch(localStorage.getItem('user_role')){
// case '1': return value.filter(val=>val.state!="quality_check_discussion");
// case '2': return value.filter(val=>val.state!="quality_check_discussion");
// case '4': return value.filter(val=>val.state!="quality_check_discussion" && val.state!="reports");
// case '5': return value.filter(val=>val.state!="quality_check_discussion" && val.state!="reports");
// case '6': return value.filter(val=>val.state!="personal_discussion" && val.state!="reports");
// case '7': return value.filter(val=>val.state!="personal_discussion" && val.state!="reports");
// case '10': return value;
// default: return value.filter(val=>val.state!="quality_check_discussion");
// }
// }
// // this is for vertical menu filter
// else if(type=="2"){
// switch(localStorage.getItem('user_role')){
// case '1': return value.filter(val=>val.state!="quality_check_discussion");
// case '2': return value.filter(val=>val.state!="quality_check_discussion");
// case '4': return value.filter(val=>val.state!="quality_check_discussion" && val.state!="reports");
// case '5': return value.filter(val=>val.state!="quality_check_discussion" && val.state!="reports");
// case '6': return value.filter(val=>val.state!="personal_discussion" && val.state!="reports");
// case '7': return value.filter(val=>val.state!="personal_discussion" && val.state!="reports");
// case '10': return value;
// default: return value.filter(val=>val.state!="quality_check_discussion");
// }
// }
// else{
// return [];
// }
// if(localStorage.getItem('user_role')=="10"){
// return value
// }
// else if(localStorage.getItem('user_role')=="6" || localStorage.getItem('user_role')=="7"){
// return value.filter(val=>val.state!='' && val.state!="personal_discussion" && val.state!="reports")
// }
// else{
// return value.filter(val=>val.state!='' && val.state!="quality_check_discussion")
// }
return value;
}
}

View File

@ -0,0 +1,15 @@
<h1 mat-dialog-title>{{data.title}}</h1>
<div mat-dialog-content>
<p>{{data.msg}}</p>
<!-- <div>
<mat-radio-group [(ngModel)]="choosedPD">
<mat-label>Choose the PD Type :</mat-label><br/>
<mat-radio-button style="margin:10px;" *ngFor="let item of pd_type_list" [value]="item.id">{{item.dis_name}}</mat-radio-button>
</mat-radio-group>
</div> -->
</div><br/>
<div mat-dialog-actions align="end">
<button *ngIf="data.buttons[1].visible" mat-stroked-button color="primary" (click)="onSubmit(data.buttons[1].id)">{{data.buttons[1].name}}</button>&nbsp;&nbsp;&nbsp;&nbsp;
<button *ngIf="data.buttons[0].visible" mat-raised-button color="primary" (click)="onSubmit(data.buttons[0].id)" cdkFocusInitial>{{data.buttons[0].name}}</button>
</div>

View File

@ -0,0 +1,6 @@
h1 {
font-size: 1.7rem;
}
p {
font-size: 1rem;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AlertDialogComponent } from './alert-dialog.component';
describe('AlertDialogComponent', () => {
let component: AlertDialogComponent;
let fixture: ComponentFixture<AlertDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AlertDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AlertDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,30 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
@Component({
selector: 'app-alert-dialog',
templateUrl: './alert-dialog.component.html',
styleUrls: ['./alert-dialog.component.scss']
})
export class AlertDialogComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<AlertDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data) {
// this.notifier=notifier
}
onNoClick(): void {
this.dialogRef.close();
}
onSubmit(btn_id){
console.log(btn_id);
// if(this.choosedPD != '' && !this.choosedPD) {
// alert("Please choose the PD Type");
// return
// }
this.dialogRef.close(btn_id)
}
ngOnInit() {}
}

View File

@ -0,0 +1,78 @@
<!-- <p>
advance-filter works!
</p> -->
<mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left">
<mat-toolbar-row>
<mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span>
<span>Advanced Filter</span>
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-list class="m-gap p-gap" >
<div [formGroup]="searchForm" fxLayout="row wrap" fxFlex="100%" fxLayoutGap="35px" fxLayoutAlign="flex-start stretch">
<mat-form-field style="width: 20%">
<mat-select multiple formControlName="pd_status" placeholder="PD Status">
<mat-option *ngFor="let status of pdStatus" [value]="status">{{status}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:20%">
<input matInput [matDatepicker]="picker" [max]="todaydate"
formControlName="pd_from_date" placeholder="Choose a From date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
<mat-form-field style="width:20%">
<input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate"
formControlName="pd_to_date" placeholder="Choose a To date">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
</mat-form-field>
<mat-form-field style="width:20%">
<mat-select multiple formControlName="pd_products" placeholder="Products">
<mat-option *ngFor="let pro of PRODUCTS" [value]="pro.product_id">{{pro.abbr}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_city" placeholder="City">
<mat-option *ngFor="let city of CITY" [value]="city.city_id">{{city.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp; -->
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_lender" placeholder="Lender Name">
<mat-option *ngFor="let ent of ENTITY" [value]="ent.entity_id">{{ent.full_name}}</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field style="width:30%">
<input matInput type="text" formControlName="pd_applicant_name" placeholder="Company/Firm Name">
</mat-form-field>
<!-- <mat-form-field style="width: 30%">
<input matInput type="text" formControlName="pd_officer" placeholder="PD Officer Name">
</mat-form-field> -->
<!-- <div fxLayout="row wrap">
<div fxFlex.xs="100%" fxFlex.sm="100%" fxFlex="45%">
<mat-checkbox class="example-margin" color="primary" formControlName="is_include_archived">Include Archived</mat-checkbox>
</div>
</div> --> </div>
</mat-list>
<div align="right" fxLayout="row" fxLayoutAlign="flex-end">
<button type="button" mat-raised-button mat-icon-button (click)="onReset()" matTooltip="Reset"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary">
<mat-icon>settings_backup_restore</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="searchItem()" matTooltip="Search"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>search</mat-icon>
</button>
</div>
</mat-expansion-panel>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CreditAdvanceFilterComponent } from './credit-advance-filter.component';
describe('CreditAdvanceFilterComponent', () => {
let component: CreditAdvanceFilterComponent;
let fixture: ComponentFixture<CreditAdvanceFilterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreditAdvanceFilterComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CreditAdvanceFilterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,121 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder } from '@angular/forms';
import { DatePipe } from '@angular/common';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { SalesPdService } from 'app/sales-pd/services/sales-pd.service';
@Component({
selector: 'app-credit-advance-filter',
templateUrl: './credit-advance-filter.component.html',
styleUrls: ['./credit-advance-filter.component.scss']
})
export class CreditAdvanceFilterComponent implements OnInit {
searchForm:FormGroup;
todaydate: any;
pdStatus: any=[];
// pdStatus_all: any=[];
ENTITY: any =[];
@Input()drop_down_datas
@Output() filteredlistData = new EventEmitter();
@Output() resetFilter = new EventEmitter();
PRODUCTS: any =[];
xpandStatus:boolean=false;
pipe=new DatePipe('en-US');
constructor(private _fb:FormBuilder,private _pd:PdTrigerService,private salesPDService:SalesPdService) {
this.todaydate = new Date();
this.getDropdown();
}
ngOnInit() {
let entity_id=localStorage.getItem('LocalSetEntity');
this.searchForm=this._fb.group({
pd_status:[''],
pd_from_date:[''],
pd_to_date:[''],
pd_products:[''],
pd_lender:[entity_id],
pd_applicant_name:[''],
pd_officer:[''],
})
console.log(this.drop_down_datas)
}
getDropdown(){
// this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=>
// {
// if(res.dataStatus==true)
// {
// this.pdStatus_all = res.records.filter(status=>status.isactive==1);
// }
// });
this._pd.getAllMasterDatas('ENTITY').subscribe(res=>
{
if(res.dataStatus==true)
{
this.ENTITY = res.records.filter(ent=>ent.isactive==1);
}
});
this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=>
{
if(res.dataStatus==true)
{
this.PRODUCTS = res.records.filter(pro=>pro.isactive==1);
}
});
}
ngOnChanges(){
console.log(this.drop_down_datas)
if(this.drop_down_datas != undefined){
this.pdStatus=this.drop_down_datas.pd_status
if(this.ENTITY.length != 0) {
this.entityCheck()
}
else{
setTimeout(()=>{this.entityCheck()},500)
}
if(this.PRODUCTS.length != 0) {
this.productCheck()
}
else{
setTimeout(()=>{this.productCheck()},500)
}
}
}
productCheck(){
this.PRODUCTS=this.PRODUCTS.filter(val=>{
if(this.drop_down_datas.product_ids.filter(dp=>dp == val.product_id).length > 0){
return val
}
})
}
entityCheck(){
this.ENTITY=this.ENTITY.filter(val=>{
if(this.drop_down_datas.lender_ids.filter(dp=>dp == val.entity_id).length > 0){
return val
}
})
}
searchItem(){
this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd');
this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd');
// console.log(JSON.stringifythis.searchForm.value);
this.xpandStatus=true;
this.salesPDService.advancedFilter(this.searchForm.value).subscribe(res=>{
if(res.dataStatus){
console.log(res);
this.filteredlistData.emit(res);
this.xpandStatus=false
}
else{
this.filteredlistData.emit(res)
}
})
}
onReset(){
this.searchForm.reset();
this.xpandStatus=false
this.resetFilter.emit(true);
}
}

View File

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PdListComponent } from './pd-list/pd-list.component';
import { PdQuestionsComponent } from './pd-questions/pd-questions.component';
const routes: Routes = [
{
path:'',
redirectTo:'pdlist',
pathMatch:'full'
},
{
path:'pdlist',
component:PdListComponent
},
{
path:'pdQuestions',
component:PdQuestionsComponent
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LenderCreditPdRoutingModule { }

View File

@ -0,0 +1,13 @@
import { LenderCreditPdModule } from './lender-credit-pd.module';
describe('LenderCreditPdModule', () => {
let lenderCreditPdModule: LenderCreditPdModule;
beforeEach(() => {
lenderCreditPdModule = new LenderCreditPdModule();
});
it('should create an instance', () => {
expect(lenderCreditPdModule).toBeTruthy();
});
});

View File

@ -0,0 +1,123 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LenderCreditPdRoutingModule } from './lender-credit-pd-routing.module';
import { PdListComponent } from './pd-list/pd-list.component';
import { PdQuestionsComponent } from './pd-questions/pd-questions.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatCardModule, MatInputModule, MatFormFieldModule, MatSelectModule, MatRadioButton, MatCheckboxModule, MatRadioModule, MatToolbarModule, MatIconModule, MatButtonModule, MatSidenavModule, MatListModule, MatExpansionModule, MatProgressSpinnerModule, MatTableModule, MatPaginatorModule, MatTabsModule, MatDatepickerModule } from '@angular/material';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { QuesTemplateComponent } from './ques-template/ques-template.component';
import { NotifierOptions, NotifierModule } from 'angular-notifier';
import { NumberToWordsPipe } from 'app/personal-discussion/pd-pipes/number-to-words.pipe';
import { SharedModule } from 'app/shared/shared.module';
import { FlexLayoutModule } from '@angular/flex-layout';
// import { AdvanceFilterComponent } from 'app/sales-pd/advance-filter/advance-filter.component';
import { CreditAdvanceFilterComponent } from './credit-advance-filter/credit-advance-filter.component';
import { AlertDialogComponent } from './alert-dialog/alert-dialog.component';
const pdCustomNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 2000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
imports: [
FormsModule,
ReactiveFormsModule,
MatCardModule,
MatInputModule,
MatFormFieldModule,
MatSelectModule,
MatCheckboxModule,
NgxMatSelectSearchModule,
MatRadioModule,
MatToolbarModule,
MatIconModule,
MatButtonModule,
MatSidenavModule,
MatListModule,
MatExpansionModule,
MatProgressSpinnerModule,
FlexLayoutModule,
MatTabsModule,
MatDatepickerModule,
],
exports: [
FormsModule,
ReactiveFormsModule,
MatCardModule,
MatInputModule,
MatFormFieldModule,
MatSelectModule,
MatCheckboxModule,
NgxMatSelectSearchModule,
MatRadioModule,
MatToolbarModule,
MatIconModule,
MatButtonModule,
MatSidenavModule,
MatListModule,
MatExpansionModule,
MatProgressSpinnerModule,
FlexLayoutModule,
MatTabsModule,
MatDatepickerModule,
],
declarations: []
})
export class MaterialModule { }
@NgModule({
imports: [
CommonModule,
LenderCreditPdRoutingModule,
MaterialModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
SharedModule,
MatTableModule,
MatPaginatorModule
],
entryComponents:[AlertDialogComponent],
declarations: [PdListComponent,PdQuestionsComponent,QuesTemplateComponent,CreditAdvanceFilterComponent,AlertDialogComponent]
})
export class LenderCreditPdModule { }

View File

@ -0,0 +1,95 @@
<mat-card class="p-2" style="box-shadow: 0 0 1px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.15) !important">
<div fxLayout="row">
<div fxFlex="50" class="pb-0 text-sm-left">
<mat-form-field dividerColor="primary" style="width: 50%;">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
</div>
<mat-tab-group class="mt-1">
<mat-tab>
<ng-template mat-tab-label>Credit PD</ng-template>
<mat-card-content>
<!-- <app-credit-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
(resetFilter)= "loadSalesPDDetails()"></app-credit-advance-filter> -->
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
<ng-container matColumnDef="SalesPdId">
<mat-cell class="cell" *matCellDef="let details;" fxFlex.xs="7" fxFlex.sm="7" fxFlex.md="7" fxFlex.lg="7" fxFlex.xl="10">
<small mat-line>{{details.smc_credit_pd}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="SalesPdSno">
<mat-cell fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="16" fxFlex.xl="15" class="cell" *matCellDef="let details;" style="color:rgb(224, 2, 1);font-weight: bold;text-align: left" >
<small mat-line>{{details.smc_credit_pd_sno}}</small><br/>
<small style="color: black;text-align:center;font-weight: normal;font-size: 15px;">{{details.smc_credit_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Applicant Name">
<mat-cell class="cell" *matCellDef="let details;" fxFlex.xs="20" fxFlex.sm="17" fxFlex.md="18" fxFlex.lg="20" fxFlex.xl="18">
<span *ngIf="!details.applicant_name" mat-line>
<small>--</small>
</span>
<span *ngIf="details.applicant_name" mat-line>
<b>{{details.applicant_name}}</b>
</span><br>
<span class="fontsize" mat-line> {{details.applicant_id}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Short Name">
<mat-cell class="cell" *matCellDef="let details" fxLayoutAlign="center start" fxFlex.xs="9" fxFlex.sm="9" fxFlex.md="9" fxFlex.lg="9">
<span style="font-weight:500"> <small mat-line>{{details.short_name}}</small></span><br/>
<span style="text-align: center;font-weight:400;font-size: 17px;"> <small mat-line>{{details.abbr}}</small></span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Officer Name">
<mat-cell fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="13" class="cell" *matCellDef="let details;" fxLayoutAlign="center start">
<span *ngIf="!details.officer_name" mat-line>
<small>--</small>
</span>
<span *ngIf="details.officer_name" mat-line>
<small mat-line >{{details.officer_name}}</small>
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="status">
<mat-cell fxFlex.xs="10" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="18" class="cell" *matCellDef="let details;" style="justify-content: flex-start;;text-align: center;font-weight: bold" fxLayoutAlign="start">
<span *ngIf="!details.status" mat-line>
<small>--</small>
</span>
<span *ngIf="details.status" mat-line>
<small mat-line [ngStyle]="{'color':details.status == 'COMPLETED' ? 'green' :'orange'}">{{details.status}}</small>
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Create On">
<mat-cell class="cell" *matCellDef="let details;" fxFlex.xs="10" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="10" fxLayoutAlign="center end">
<small mat-line>{{details.createdon | date: 'dd/MM/yyyy'}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell" *matCellDef="let details;" >
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PDF Download" *ngIf="details.status == 'COMPLETED'"
matTooltipPosition="above" color="primary" (click)="salesPDpdf(details.sales_pd_id)"><mat-icon>file_download</mat-icon></button>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="View PD" *ngIf="details.status != 'COMPLETED'"
matTooltipPosition="above" color="primary" (click)="openCurrPD(details)"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-paginator *ngIf="!recordStatus" #paginator class="mat-elevation-z1" [length]="salesPdData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>
<mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content>
</mat-tab>
</mat-tab-group>
</mat-card>

View File

@ -0,0 +1,30 @@
.ic-change:hover {
transform: scale(1.1);
color: green;
}
.cell{
display:inline !important;
// text-align: center !important;
}
.cellhide{
display: none !important;
}
.center{
text-align:center;
}
.fontsize{
font-size:14px;
}
.toolbar-space {
flex: 0.01 0 auto;
}
p.note {
// float: right;
text-align: right;
font-size: 12px;
color: grey;
font-weight: bold;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PdListComponent } from './pd-list.component';
describe('PdListComponent', () => {
let component: PdListComponent;
let fixture: ComponentFixture<PdListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PdListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PdListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,165 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { PageEvent, MatTableDataSource, MatPaginator, MatSort } from '@angular/material';
import { UserService } from 'app/settings/service/user.service';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { Router } from '@angular/router';
import { ApiServiceService } from '../services/apiService/api-service.service';
@Component({
selector: 'app-pd-list',
templateUrl: './pd-list.component.html',
styleUrls: ['./pd-list.component.scss']
})
export class PdListComponent implements OnInit {
public dataLengthTab4: number;
public dataSourceTab4 = new MatTableDataSource();
displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Officer Name','status','Create On','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
// data source variable details
salesPdData:any[] = [];
salesPdpdf:any[] = [];
errorMessage:any[]=[];
recordStatus: boolean;
xpandStatus: boolean = false;
// pagination variable details
length = 5;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
todaydate:Date = new Date();
filter_drop_down_data:any;
limitMsg: boolean = false;
common: any;
constructor(private _pdSales: PdTrigerService,private router:Router,private _pdCreditService:ApiServiceService) {
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() {
this.loadSalesPDDetails();
// this.salesPDpdf();
}
loadSalesPDDetails() {
this._pdCreditService.listSMCCreditPD()
.subscribe(
data => {
if (data.status == 200) {
this.salesPdData = data.records;
this.dataLengthTab4 = data.records.length;
this.dataSourceTab4.data = this.salesPdData;
this.recordStatus=false
this.limitMsg = true
if(this.salesPdData.length > 0){
let products=[]
let lenders=[]
let pd_status=[]
this.salesPdData.map(val=>{
if(products.length > 0 ){
if(products.filter(pro=>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=>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=>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.filter_drop_down_data);
}
}
else{
this.salesPdData=[];
this.dataLengthTab4= null;
this.recordStatus=true;
this.limitMsg = false
}
}
// , error => this.errorMessage = <any> error);
,error => {
this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
alert(error.html_format);
});
}
filteredDataSource(data){
console.log("From Parent",data);
if(data.dataStatus){
this.salesPdData=data.records
this.dataLengthTab4 = data.records.length;
this.dataSourceTab4.data = this.salesPdData;
this.recordStatus=false
this.limitMsg = false
}
else{
this.salesPdData=[];
this.dataLengthTab4= null;
this.recordStatus=true;
this.limitMsg = false
}
}
salesPDpdf(pdfdetail){
this._pdSales.getSalesPdpdf(pdfdetail)
.subscribe(
data => {
if (data.status == 200) {
// window.location.href=data.records;
window.open(data.records, '_blank');
}
}
// , error => this.errorMessage = <any> error);
,error => {
this.errorMessage.push(error);
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
alert(error.html_format);
});
}
pageChange(e) {
console.log(e);
}
ngAfterViewInit() {
this.dataSourceTab4.paginator = this.paginator;
this.dataSourceTab4.sort = this.sort;
}
applyFilter(filterValue: string) {
this.dataSourceTab4.filter = filterValue.trim().toLowerCase();
}
openCurrPD(curr_pd_data) {
this._pdCreditService.curr_credit_pd_data=curr_pd_data
this.router.navigate(['../credit_pd/pdQuestions']);
}
}

View File

@ -0,0 +1,65 @@
<div >
<mat-toolbar color="primary" class="example-toolbar">
<button mat-icon-button (click)="sidenav.toggle()" *ngIf="sidenav_mode">
<mat-icon>menu</mat-icon>
</button>
<!-- <div fxLayout="row" align="left" fxFlex="100"> -->
<div fxFlex="80%" style="font-size:1.3rem;font-weight: bold;padding-top: 0.5rem;">{{curr_pd_info.applicant_name}} <span *ngIf="curr_pd_info.smc_credit_pd_sno">({{curr_pd_info.smc_credit_pd_sno}})</span><br/>
<span style="font-size:1rem;font-weight: normal">{{curr_pd_info.abbr}} - {{curr_pd_info.smc_credit_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</span>
</div>
<!-- <h1 fxFlex="90" class="example-app-name">{{question_data?.section_name}}</h1> -->
<div fxFlex="20%" align="end" *ngIf="!sidenav_mode">
<button *ngIf="curr_pd_info.smc_credit_pd_type == '2' && customer_link" align="end" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Copy Customer Link" matTooltipPosition="left" (click)="copyToClipBoard(customer_link, 'Customer Link is copied')"><mat-icon>link</mat-icon></button>
<button *ngIf="curr_pd_info.smc_credit_pd_type == '2' && customer_link" align="end" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="left" (click)="go_back()" disabled="true"><mat-icon>sms</mat-icon></button>
<button align="end" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="left" (click)="go_back()"><mat-icon>close</mat-icon></button>
</div>
<!-- </div> -->
</mat-toolbar>
<mat-sidenav-container class="example-container" autosize >
<mat-sidenav [fixedInViewport]="false" #sidenav class="example-sidenav" [mode]="sidenav_mode ? 'over' : 'side'" opened=true>
<mat-nav-list >
<mat-list-item *ngFor="let item of section_template;let i=index" (click)="gotoSection(item)" [ngClass]="{'selectedSection': selectedSecIndex == i,'border-disabled': sales_pd_id == null && item.is_disabled,
'border-saved': sales_pd_id != null && item.hasOwnProperty('status') &&
item.status == '1' }"
>
<!-- <div > -->
<!-- <div fxLayout="row"> -->
<!-- <div fxFlex="90"> -->
<p matLine>{{item.section_name}} </p>
<ng-container >
<mat-icon *ngIf="sales_pd_id != null && item.hasOwnProperty('status') &&
item.status == '1' " >check_circle</mat-icon>
</ng-container>
<!-- </div>
<div fxFlex="10"> -->
<!-- </div> -->
<mat-divider></mat-divider>
<!-- </div> -->
<!-- </div> -->
</mat-list-item>
</mat-nav-list>
</mat-sidenav>
<div class="form-container">
<mat-card>
<mat-card-content *ngIf="question_data.questions.length > 0">
<app-ques-template (emitter)="navigate($event)" [questions_JSON]="question_data" (imageUploadCheck)="setGroupControl($event)"></app-ques-template>
<!-- <button ion-button (click)="onChange()"></button> -->
</mat-card-content>
<mat-card-content *ngIf="question_data.questions.length == 0">
<h5>No Templates Found</h5>
</mat-card-content>
</mat-card>
<!-- </div> -->
</div>
</mat-sidenav-container>
</div>
<notifier-container></notifier-container>

View File

@ -0,0 +1,90 @@
::ng-deep .body-container{
padding: 0.2rem!important;
// height: ;
margin-bottom: 0px;
}
.example-app-name {
white-space: pre-wrap;
}
.example-sidenav-content {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
}
.example-sidenav {
user-select: none;
background-color: aliceblue;
height: 75vh !important;
// top:100px;
}
.full-width {
width: 100%;
}
.menu-button {
transition: 300ms ease-in-out;
transform: rotate(0deg);
}
.menu-button.rotated {
transform: rotate(180deg);
}
.submenu {
overflow-y: hidden;
transition: transform 300ms ease;
transform: scaleY(0);
transform-origin: top;
padding-left: 30px;
}
.submenu.expanded {
transform: scaleY(1);
}
.form-container {
height: 75vh !important;
overflow-x: hidden;
overflow-y: auto;
position: relative;
// padding: 2rem;
// margin-bottom: 2rem;
}
// #sidenav, .site-sidenav.md-locked-open-add-active, .site-sidenav.md-locked-open {
// width: 256px;
// min-width: 256px;
// max-width: 256px;
// }
.selectedSection {
p{
color:white !important
}
color:white !important;
background-color: #c80000;
}
.selectedSection :hover {
// color:black;
// p {
// color:black !important
// }
background-color: rgb(209, 209, 209);
}
.border-disabled{
// border-left: 2px solid #00000075 !important;
p{
margin: 0px !important;
color: darkgray;
}
}
.border-saved{
// border-left: 2px solid #008828 !important;
p{
margin: 0px !important;
color:#00611d;
}
mat-icon {
color:#12bd45;
}
// #009b2e
}
::ng-deep .mat-line{
word-wrap: break-word !important;
white-space: pre-wrap !important;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PdQuestionsComponent } from './pd-questions.component';
describe('PdQuestionsComponent', () => {
let component: PdQuestionsComponent;
let fixture: ComponentFixture<PdQuestionsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PdQuestionsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PdQuestionsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,260 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatSidenav } from '@angular/material';
import { ApiServiceService } from '../services/apiService/api-service.service';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { NotifierService } from 'angular-notifier';
import { UserService } from 'app/settings/service/user.service';
@Component({
selector: 'app-pd-questions',
templateUrl: './pd-questions.component.html',
styleUrls: ['./pd-questions.component.scss']
})
export class PdQuestionsComponent implements OnInit {
@ViewChild('sidenav') sidenav: MatSidenav;
isExpanded = true;
showSubmenu: boolean = false;
isShowing = false;
showSubSubMenu: boolean = false;
menuItems = [
{
display_name:"General Info",
id:'1'
},
{
display_name:"Fund Requirement",
id:'2'
},
{
display_name:"Details of Stackeholder in Business",
id:'3'
},
{
display_name:"Other Family Member Details",
id:'4'
},
{
display_name:"Business Info",
id:'5'
},
{
display_name:"Asset Details",
id:'6'
},
{
display_name:"Final Remarks",
id:'7'
}
]
raw_data: any;
section_template: any = [];
sales_pd_id: any =null;
selectedSecIndex: number;
sidenav_mode: boolean;
question_data: any ={questions:[]};
curr_pd_info:any={}
notifier:NotifierService
all_sections: any;
customer_link: string = '';
constructor(private apiService:ApiServiceService,private _location:Location,private router:Router,notifier:NotifierService,private _userService:UserService) {
this.notifier = notifier
this._userService.getroles().subscribe(res=>{
if(res['dataStatus'] && res['records'] && res['records'].length > 0) {
this.apiService.user_login_details = res['records'][0]
}
})
this.curr_pd_info = this.apiService.curr_credit_pd_data
if(!this.curr_pd_info || (Object.keys(this.curr_pd_info).length === 0 && this.curr_pd_info.constructor === Object)) {
this._location.back();
}
console.log(this.curr_pd_info);
this.sales_pd_id = this.curr_pd_info.smc_credit_pd
if(this.sales_pd_id != null) {
this.customer_link = window.location.origin+'/customer/#/salespd-images/'+this.curr_pd_info.rand_string
}
}
ngOnInit() {
if(this.curr_pd_info.smc_credit_pd != null) {
this.getSectionStatus()
}
this.getTemplate();
this.sidenav_mode =window.matchMedia(`(max-width: 840px)`).matches
}
getSectionStatus() {
let params = {"smc_credit_pd":this.curr_pd_info.smc_credit_pd,"section_id":'all'}
this.apiService.getSMCCreditPDSectionData(params).subscribe(res=>{
if(this.section_template.length > 0)
{
console.log("if part")
this.merge_saved_status(res);
}
else{
setTimeout(()=>{
console.log("Else part",this.section_template.length)
if(this.section_template.length > 0)
{
this.merge_saved_status(res);
}
},500)
}
})
}
merge_saved_status(res){
let saved_sections=res['records'].map(val=>{return {'section_id':val.section_id , 'status':val.status}});
console.log("saved",saved_sections);
if(saved_sections) {
this.curr_pd_info.saved_sections = saved_sections
}
const mergeById = (a1, a2) =>
a1.map(itm => ({
...a2.find((item) => (item.section_id === itm.section_id) && item),
...itm
}));
this.section_template = mergeById(this.section_template,saved_sections);
console.log("##########",this.section_template);
if(this.section_template.length > 0) {
// this.is_sync_btn = this.section_template.filter(val=>val.is_synced == false && val.section_id != 'all').length > 0
}
}
getTemplate(){
this.apiService.loadTemplate().subscribe(result=>{
console.log(result);
// debugger;
// return
// })
// this.SalesPDService.getData(this.product_id,this.sales_pd_type).subscribe(result=>{
console.log("result",result)
if(result['dataStatus'] && result.hasOwnProperty('records')){
this.raw_data=JSON.parse(result['records'].template)
this.raw_data.sections.forEach((val,index)=>{
val.order_id=index+1
})
this.section_template=this.raw_data.sections.map(val=> {
let temp={section_id:val.section_id,section_name:val.section_name,order_id:val.order_id,is_disabled:val.section_id != '1' ? this.sales_pd_id == null ? true : false : false}
return temp
})
console.log(this.section_template)
this.gotoSection(this.section_template[0])
// this.SalesPDService.original_rawData=this.raw_data
// localStorage.setItem('question_temp_salespd',JSON.stringify(this.raw_data))
// console.log("sales pd",this.SalesPDService.original_rawData)
this.all_sections=this.raw_data.sections.map(val=>val.section_id)
// this.SalesPDService.available_sections=this.all_sections
// this.SalesPDService.current_section='1';
}
else{
let message = result['msg'] ? result['msg'] : 'Something went wrong'
alert(message);
}
})
}
mouseenter() {
if (!this.isExpanded) {
this.isShowing = true;
}
}
mouseleave() {
if (!this.isExpanded) {
this.isShowing = false;
}
}
menuToggle() {
console.log(this.sidenav,this.sidenav.opened)
if(this.sidenav.opened) {
this.sidenav.close()
}
else {
this.sidenav.open();
}
}
gotoSection(curr_obj) {
console.log(curr_obj)
if(curr_obj.hasOwnProperty('is_disabled') && curr_obj.is_disabled && this.sales_pd_id == null) {
let msg = 'Please Fill the '+this.section_template[0].section_name+' First!!'
this.notifier.notify('warning',msg)
return;
}
let selectedSecIndex = curr_obj.order_id-1
this.selectedSecIndex = selectedSecIndex
console.log(selectedSecIndex);
if(this.sidenav_mode) {
this.sidenav.close()
}
this.question_data=this.raw_data.sections.filter(val => val.order_id == curr_obj.order_id)[0]
console.log(this.question_data)
}
go_back() {
this.router.navigate(['../credit_pd'])
}
navigate(event){
this.sales_pd_id = this.apiService.curr_credit_pd_data.smc_credit_pd
this.customer_link = window.location.origin+'/customer/#/salespd-images/'+this.curr_pd_info.rand_string
console.log("emitter navigate",event,this.all_sections[this.all_sections.length - 1]);
if(this.all_sections[this.all_sections.length - 1] != event.section_id){
// this.navCtrl.pop()
let nextSection = this.section_template.findIndex(vv=>vv.section_id == event.section_id)
console.log("find index",nextSection,this.section_template);
// if(nextSection ) {
this.gotoSection(this.section_template[nextSection+1])
this.getSectionStatus()
// }
}
else{
// this.sendData()
console.log("else part")
// this.sendDatatoApi()
// this.SalesPDService.clearLocalData()
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
// if(event.hasO)
this.apiService.curr_credit_pd_data = {}
this.apiService.raw_credit_pd_template = {}
let msg=event.hasOwnProperty('is_completed') && event.is_completed == true ? "Completed Successfully" : 'Saved Successfully..!'
// this.toastProvider.lenderappmessage(msg);
this.notifier.notify('success',msg)
// this.SalesPDService.clearLocalData()
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
// localStorage.removeItem('product_id_salesPD')
setTimeout(()=>{
this.router.navigate(['../credit_pd'])
},2000)
}
}
copyToClipBoard(message,user_msg?) {
const selBox = document.createElement('textarea');
selBox.style.position = 'fixed';
selBox.style.left = '0';
selBox.style.top = '0';
selBox.style.opacity = '0';
selBox.value = message;
document.body.appendChild(selBox);
selBox.focus();
selBox.select();
document.execCommand('copy');
document.body.removeChild(selBox);
if(message == '') {
user_msg = "Something went wrong"
}
this.notifier.notify('info',user_msg)
}
shareViaSMS() {
// this.socialSharing.shareViaSMS(this.customer_link_with_text,'').then(result=>{
// console.log(result)
// },err=>{
// console.log(err);
// alert("SMS Error "+JSON.stringify(err));
// })
}
}

View File

@ -0,0 +1,425 @@
<!-- Generated template for the QuesTemplateComponent component -->
<div *ngIf="questions_JSON.questions.length > 0" #whole_form>
<form [formGroup]="quesAnsForm" >
<!-- (ngSubmit)="onSubmit(1)" -->
<div *ngIf="quesAnsForm.controls['questions']" >
<div formArrayName="questions" fxLayout="row wrap" fxFlex="100" fxLayoutAlign="space-between" fxLayout.xs="column" >
<span *ngFor="let parent_ques of quesAnsForm.controls['questions'].controls;let p_i=index" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="parent_ques.hasOwnProperty('field_width') && parent_ques.field_width ? parent_ques.field_width : '100'"
[formGroupName]="p_i">
<!-- <div> -->
<div *ngIf="parent_ques.get('is_repeatable').value != '1'">
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '1'" [ngStyle]="{'margin-bottom':parent_ques.get('field_type').value == 'numtoword' ? '5%' : '0' }">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<input matInput [type]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'number' : parent_ques.get('field_type').value == 'string' ? 'text' : parent_ques.get('field_type').value" formControlName="answer_value"
[placeholder]="parent_ques.get('place_holder').value"
autocomplete="off" (change)="onChangeProperty($event,parent_ques,'','',p_i)"
>
<!-- [placeholder]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'Entert the Number' : 'Enter the Text'" -->
<mat-hint *ngIf="parent_ques.get('answer_value').value != '' && parent_ques.get('field_type').value == 'numtoword'" align="end" style="font-size: 12px;">{{"&#8377;"}}{{parent_ques.get('answer_value').value | numberToWords}}</mat-hint>
<!-- <mat-hint align="end" style="font-size: 11.5px;color: gray;" *ngIf="parent_ques.get('is_amt_in_words').value == true">One Lack</mat-hint> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<!-- <mat-form-field> -->
<div class="radio-gap" *ngIf="parent_ques.get('type').value == '2'">
<mat-label>{{parent_ques.get('question').value}}</mat-label><br/>
<mat-radio-group aria-label="Select an option" formControlName="answer_value" (change)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-radio-button class="radio-btn-gap" *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-radio-button><br />
</mat-radio-group>
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '3'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-option *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" formArrayName="answer_value" *ngIf="parent_ques.get('type').value == '5'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" (change)="onChange_checkbox($event,parent_ques)">{{val.answer}}</mat-checkbox><br />
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '4'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select multiple formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-option *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div *ngIf="parent_ques.get('type').value == '6'">
<!-- <ion-grid > -->
<div fxLayout="row">
<div fxLayout ="column" style="padding:none;align-self:center;text-align:center">
<div >
<img *ngIf="parent_ques.get('answer_value').value != ''" [src]="parent_ques.get('answer_value').value" imageViewer class="doc-image-bucket"><br/>
<p *ngIf="parent_ques.get('answer_value').value == ''">Image is not captured.</p>
<label ><strong>{{parent_ques.get('question').value}}</strong></label>
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
<!-- <button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><mat-icon style="font-size:22px" name="md-trash"></mat-icon></button> -->
</div>
<div fxLayout="row" style="justify-content: center">
<div fxLayout="column">
<!-- <button mat-raised clear color="optblue" [disabled]="sales_pd_type == '2'" (click)="captureImg(p_i,parent_ques)"><mat-icon style="font-size: 30px" name="md-camera"></mat-icon></button> -->
</div>
<!-- IMAGE STATUS ICON FOR INPROGRESS, COMPLETED AND FAILED -->
<!-- <ion-col col-4 *ngIf="parent_ques.get('is_image_status').value == true">
<ion-spinner name="crescent" style="width: 20px;
height: 20px;" (click)="cancelLoader(parent_ques)"
*ngIf="parent_ques.get('is_loader').value == true"></ion-spinner>
<mat-icon style="color: #008828;float: right;
margin-right: 30%;" *ngIf="parent_ques.get('is_saved').value == true" name="checkmark-circle-outline"></mat-icon>
<span style="margin:0px;" *ngIf="(parent_ques.get('is_saved').value == false &&
parent_ques.get('is_loader').value == false) && (parent_ques.value.hasOwnProperty('is_saved') &&
parent_ques.value.hasOwnProperty('is_loader'))" (click)="imageReupload(parent_ques)">
<ion-row style="margin-top: -17px;padding:0px;"><button ion-button clear><mat-icon style="color:lightcoral;" name="refresh-circle"></mat-icon></button></ion-row>
<ion-row style="margin-top: -20px;padding:0px;"><p style="font-size: 10px">Click to ReUpload</p></ion-row>
</span>
</ion-col> -->
</div>
<!-- <ng-container ngProjectAs="mat-hint">
<mat-error >Please capture the image</mat-error>
</ng-container> -->
</div>
<hr/>
</div>
<!-- </ion-grid> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
<!-- <ng-container ngProjectAs="mat-hint">
<mat-error align="end">Please capture the image</mat-error>
</ng-container> -->
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '7'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<textarea matInput type="text" rows="3" formControlName="answer_value" placeholder="Enter the Text"
autocomplete="off" ></textarea>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '8'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-option>
<ngx-mat-select-search formControlName="select_search"
[placeholderLabel]="'Search'"
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(parent_ques,p_i)">
<mat-icon ngxMatSelectSearchClear>close</mat-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>--</mat-option>
<mat-option *ngFor="let val of fileredSearchValue.length > 0 ? fileredSearchValue[p_i] : parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
</div>
<div class="radio-gap" *ngIf="parent_ques.get('is_repeatable').value == '1' && parent_ques.controls['questions_group']">
<!-- <mat-card> -->
<!-- <mat-card-header>
<mat-card-title>
{{parent_ques.get('group_title').value}}
</mat-card-title>
</mat-card-header> -->
<div formArrayName="questions_group" *ngIf="parent_ques.get('group_type').value != '6'">
<span
*ngFor="let group_ques of parent_ques.controls.questions_group['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i">
<mat-accordion *ngIf="parent_ques.get('group_type').value != '6'" #accordion="matAccordion">
<mat-expansion-panel [expanded]="step === g_i" #mapanel="matExpansionPanel">
<mat-expansion-panel-header>
<mat-panel-title>
{{parent_ques.get('group_title').value}} {{g_i+1}}
</mat-panel-title>
<!-- <mat-panel-description>
Type your name and age
</mat-panel-description> -->
</mat-expansion-panel-header>
<div formArrayName="questions" *ngIf="group_ques.controls['questions']">
<div
*ngFor="let single_ques of group_ques.controls.questions['controls'];let s_i=index;let s_l=last"
[formGroupName]="s_i">
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '1'" [ngStyle]="{'margin-bottom':single_ques.value.hasOwnProperty('field_type') ? single_ques.get('field_type').value == 'numtoword' ? '5%' : '0' : '' }">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<input matInput [type]="single_ques.value.hasOwnProperty('field_type') ? single_ques.get('field_type').value == 'num' || single_ques.get('field_type').value == 'numtoword' ? 'number' : single_ques.get('field_type').value == 'string' ? 'text' : single_ques.get('field_type').value: ''" formControlName="answer_value"
[placeholder]="single_ques.value.hasOwnProperty('place_holder') ? single_ques.get('place_holder').value : ''"
autocomplete="off" (change)="onChangeProperty($event,single_ques,group_ques,2,s_i)">
<mat-hint *ngIf="single_ques.get('answer_value').value != '' && single_ques.value.hasOwnProperty('field_type') && single_ques.get('field_type').value == 'numtoword'" align="end" style="font-size: 10px;">{{"&#8377;"}}{{single_ques.get('answer_value').value | numberToWords}}</mat-hint>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" *ngIf="single_ques.get('type').value == '2'">
<mat-label>{{single_ques.get('question').value}}</mat-label><br/>
<mat-radio-group aria-label="Select an option" formControlName="answer_value" (change)="onChangeProperty($event,single_ques,group_ques,2,s_i)">
<mat-radio-button class="radio-btn-gap" *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-radio-button><br />
</mat-radio-group>
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '3'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,single_ques,group_ques,2,s_i)">
<mat-option *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" formArrayName="answer_value" *ngIf="single_ques.get('type').value == '5'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-checkbox class="radio-btn-gap" *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" (change)="onChange_checkbox($event,single_ques)">{{val.answer}}</mat-checkbox><br />
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '4'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-select multiple formControlName="answer_value">
<mat-option *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '7'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<textarea matInput type="text" rows="3" formControlName="answer_value" placeholder="Enter the Text"
autocomplete="off" ></textarea>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '8'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,single_ques,p_i)">
<mat-option>
<ngx-mat-select-search formControlName="select_search"
[placeholderLabel]="'Search'"
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(single_ques,p_i)">
<mat-icon ngxMatSelectSearchClear>close</mat-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>--</mat-option>
<mat-option *ngFor="let val of fileredSearchValue.length > 0 ? fileredSearchValue[p_i] : single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div *ngIf="single_ques.controls['subfield_key']">
<!-- <div *ngIf="parent_ques.controls[parent_ques.get('subfield_key').value]"> -->
<mat-form-field style="width: 100%" >
<mat-label>{{single_ques.get('subfield_caption').value}}</mat-label>
<input matInput type="text" formControlName="subfield_value" placeholder="Enter the Text"
autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="flex-end" *ngIf="parent_ques.get('is_multi_disabled').value != '1'">
<div >
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Delete"
matTooltipPosition="above" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div>
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Delete"
matTooltipPosition="above" *ngIf="g_l"
(click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event)">
<mat-icon>add</mat-icon>
</button>
</div>
</div>
<!-- <ion-buttons fxLayout="">
<ion-col col-3 offset-3>
<button ion-button clear color="optblue" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<mat-icon style="font-size: 22px" name="md-trash"></mat-icon>
</button>
</ion-col>
<ion-col col-2 offset-1>
<button ion-button clear color="optblue" *ngIf="g_l"
(click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event)">
<mat-icon style="font-size: 24px" name="add-circle"></mat-icon>
</button>
</ion-col>
</ion-buttons> -->
</mat-expansion-panel>
</mat-accordion>
</span>
</div>
<div formArrayName="questions_group" *ngIf="parent_ques.get('group_type').value == '6'">
<hr class="hr">
<mat-card-header>
<mat-card-title>
<h5> {{parent_ques.get('group_title').value}}</h5>
</mat-card-title>
</mat-card-header>
<!-- <ion-grid > -->
<div fxLayout="row">
<span
*ngFor="let group_ques of parent_ques.controls.questions_group['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i">
<!-- </mat-card> -->
<span formArrayName="questions" *ngIf="group_ques.controls['questions'] && parent_ques.get('group_type').value == '6'" >
<!-- <div > -->
<!-- <div *ngIf="single_ques.get('type').value == '10'"> -->
<!-- {{parent_ques.value.questions_group.length}} -->
<p style="margin-left: 45px;font-weight:bold;" *ngIf="parent_ques.value.questions_group.length == 1 &&
group_ques.value.questions[0].answer_value == ''">Image is not captured.</p>
<div fxLayout="column" style="align-self: center;text-align: center;padding: 0" *ngFor="let single_ques of group_ques.controls.questions['controls'];let s_i=index;let s_l=last"
[formGroupName]="s_i">
<div style="width: 100%;justify-content: center;text-align: center;align-content: center;margin:2%;" *ngIf="single_ques.get('answer_value').value != ''">
<div fxLayout="row" style="width: 100%">
<img [src]="single_ques.get('answer_value').value" imageViewer class="doc-image-bucket" ><br/>
</div>
<div fxLayout="row" style="width: 130px;margin-bottom: 5px;text-align: left">
<div >
<span style="font-size: 12px;padding: 0px;margin: 0px;">{{single_ques.get('question').value}} {{g_i+1}}</span>
</div>
<!-- IMAGE STATUS ICON FOR INPROGRESS, COMPLETED AND FAILED -->
<div *ngIf="single_ques.get('is_image_status').value == true">
<!-- <ion-spinner name="crescent" style="width: 20px;
height: 20px;" (click)="cancelLoader(single_ques)"
*ngIf="single_ques.get('is_loader').value == true"></ion-spinner> -->
<mat-icon style="color: #008828;float: right;
margin-right: 30%;" *ngIf="single_ques.get('is_saved').value == true" name="checkmark-circle-outline"></mat-icon>
<span style="margin:0px;" *ngIf="(single_ques.get('is_saved').value == false &&
single_ques.get('is_loader').value == false) && (single_ques.value.hasOwnProperty('is_saved') &&
single_ques.value.hasOwnProperty('is_loader'))" (click)="imageReupload(single_ques)">
<div style="margin-top: -17px;padding:0px;"><button mat-ion-button clear><mat-icon style="color:lightcoral;" name="refresh-circle"></mat-icon></button></div>
<div style="margin-top: -20px;padding:0px;"><p style="font-size: 10px">Click to ReUpload</p></div>
</span>
</div>
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
<!-- <button ion-button clear color="optblue" (click)="removeData(g_i,parent_ques)"><mat-icon style="font-size:22px" name="md-trash"></mat-icon></button> -->
</div>
</div>
<!-- <div style="justify-content: center">
<button ion-button clear color="optblue" (click)="captureImg()"><mat-icon style="font-size: 30px" name="md-camera"></mat-icon></button>
</div> -->
<!-- {{single_ques.value | json}} -->
<div class="add-more-image" *ngIf="g_l">
<button class="ml-1 mr-1 hover-icon" mat-raised-button clear style="color: black" [disabled]="sales_pd_type == '2'" (click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event,'camera',single_ques)"><mat-icon style="font-size:35px" name="md-camera"></mat-icon>+</button>
</div>
</div>
<!-- </div> -->
<!-- </div> -->
</span>
<div *ngIf="g_l" style="justify-content: flex-end">
</div>
</span>
</div>
<!-- <ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container> -->
<!-- </ion-grid> -->
<hr class="hr">
</div>
</div>
<div *ngIf="parent_ques.controls['subfield_key']">
<!-- <div *ngIf="parent_ques.controls[parent_ques.get('subfield_key').value]"> -->
<mat-form-field style="width: 100%" >
<mat-label>{{parent_ques.get('subfield_caption').value}}</mat-label>
<input matInput type="text" formControlName="subfield_value" placeholder="Enter the Text"
autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
<!-- </div> -->
</span>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="flex-end" class="save-btn">
<!-- <ion-col *ngIf="!spinner_access">
<button class="btn-no-pad" medium ion-button round outline color="optblue" (click)="onSubmit(0)">Save as Draft</button>
</ion-col> -->
<div *ngIf="!spinner_access">
<!-- <button class="btn-no-pad" medium ion-button type="submit" round color="optblue" (click)="onSubmit(1)"><mat-icon style="color:gray;font-size: 24px;" name="md-arrow-dropright-circle"></mat-icon>&nbsp; {{submit_btn ? 'Complete' : 'Save'}} </button> -->
<button type="submit" color="primary" class="ml-1 mr-1 hover-icon" mat-raised-button
matTooltip="Submit"
matTooltipPosition="above"
(click)="onSubmit(1)">
<mat-icon>save</mat-icon> &nbsp; {{submit_btn ? 'Complete' : 'Save'}}
</button>
</div>
<!-- <ion-spinner name="dots" color="optblue" style="font-size: 24px;width:50px;height: 50px;" *ngIf="spinner_access"></ion-spinner> -->
<div *ngIf="spinner_access">
<mat-spinner diameter="25" > </mat-spinner><span style="font-weight: bold">&nbsp; Saving...</span>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,39 @@
mat-radio-button,mat-checkbox{
margin-top: 13px;
}
.radio-gap{
margin-top: 10px;
margin-bottom: 10px;
}
.radio-btn-gap{
margin:10px;
}
.doc-image-bucket{
padding:0 5px 0 0 !important;
width: 120px;
height: 80px !important;
color:black;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
}
.add-more-image{
width: 60%;
padding:0 5px 0 0 !important;
width: 120px;
height: 80px !important;
// border: 2px solid gainsboro;
// border-style: dashed;
// border-radius: 10px;
}
.hr, hr{
font-size: 25px;
}
// .btn-no-pad{
// padding: 8px 8px 8px 5px;
// }
.save-btn{
// margin-top: 3%;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { QuesTemplateComponent } from './ques-template.component';
describe('QuesTemplateComponent', () => {
let component: QuesTemplateComponent;
let fixture: ComponentFixture<QuesTemplateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ QuesTemplateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(QuesTemplateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { ApiServiceService } from './api-service.service';
describe('ApiServiceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ApiServiceService = TestBed.get(ApiServiceService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,74 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { AwsService } from 'app/AwsService/aws.service';
const apiUrl = environment.apiEndpoint
@Injectable({
providedIn: 'root'
})
export class ApiServiceService {
// for pd questions component
public curr_credit_pd_data:any = {}
public raw_credit_pd_template:any;
public user_login_details:any ={}
constructor(private http:HttpClient,private _awsService:AwsService) { }
loadTemplate() {
return this.http.get('assets/credit_pd_template.json').map(rr=>{
let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
this.raw_credit_pd_template= returnValue.records.template
return returnValue
})
}
getCityPincode(value){
let params={records:{state_id:value}}
return this.http.post(apiUrl+"getListOfStatesAndCities",params)
}
api_post_method(api_name:string,params,api_method?){
if(api_method.toUpperCase() == 'POST'){
return this.http.post(apiUrl+api_name,params)
}
else{
return this.http.get(apiUrl+api_name)
}
}
getSalesPDSectionData(params) {
return this.http.post(apiUrl+'getSalesPDSectionData',{records:params})
}
listSMCCreditPD():Observable<any> {
let value= localStorage.getItem('LocalSetEntity')
// let params = new HttpParams().set("paramName",value) //Create new HttpParams
return this.http.get(apiUrl+'listSMCCreditPD/'+value);
}
saveSMCCreditPD(params) {
let params_defined:any={"smc_credit_pd":this.curr_credit_pd_data.smc_credit_pd == null ? '' : this.curr_credit_pd_data.smc_credit_pd
,"fk_sales_pd_id":this.curr_credit_pd_data.fk_sales_pd_id,"lender_id":this.curr_credit_pd_data.lender_id,"product_id":this.curr_credit_pd_data.product_id,"smc_credit_pd_type":this.curr_credit_pd_data.smc_credit_pd_type,"createdby":this._awsService.getlocale(),"status":params.status}
return this.http.post(apiUrl+'saveSMCCreditPD',{records:params_defined});
}
loadSalesPDTemplate():Observable<any> {
let lender_id= localStorage.getItem('LocalSetEntity')
let params = {"records":{"lender_id":lender_id,"product_id":this.curr_credit_pd_data.product_id,"sales_pd_type":this.curr_credit_pd_data.smc_credit_pd_type,"pd_type":"2"}}
return this.http.post(apiUrl+'loadSalesPDTemplate',params).map((res:any)=>{
if(res['dataStatus'] && res.hasOwnProperty('records') && res.records.hasOwnProperty('template')){
this.raw_credit_pd_template = res.records.template
}
return res
})
}
saveSMCCreditPDsection(params1):Observable<any> {
let params = {"records":{"smc_credit_pd":this.curr_credit_pd_data.smc_credit_pd,"lender_id":this.curr_credit_pd_data.lender_id,"product_id":this.curr_credit_pd_data.product_id,"fk_createdby":this._awsService.getlocale(),"geo_location":"","section_id":params1.section_id,"questions":params1.questions,"is_complete":"0"}}
return this.http.post(apiUrl+'saveSMCCreditPDsection',params)
}
getSalesPDImgDataCusLink(params) {
return this.http.post(apiUrl+'getSalesPDImgDataCusLink',params)
}
getSMCCreditPDSectionData(params) {
return this.http.post(apiUrl+'getSMCCreditPDSectionData',{records:params})
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { QuesTemplateService } from './ques-template.service';
describe('QuesTemplateService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: QuesTemplateService = TestBed.get(QuesTemplateService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,412 @@
import { Injectable } from '@angular/core';
import { DatePipe } from '@angular/common';
import { FormBuilder, FormGroup, FormArray, FormControl, Validators } from '@angular/forms';
import { ApiServiceService } from '../apiService/api-service.service';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class QuesTemplateService {
datepipe: DatePipe;
public curr_pd_info: any = {};
constructor(public http: HttpClient,private _fb:FormBuilder,private salesPDProvider:ApiServiceService) {
console.log('Hello QuesServiceProvider Provider');
this.datepipe=new DatePipe('en-US')
}
// FOR CREATING A FORM CONTROL DYNAMICALLY
assignFormControl_array(formgroup: FormGroup, ques_data: any) {
this.curr_pd_info = this.salesPDProvider.curr_credit_pd_data
const control: any = formgroup.get('questions') as FormArray
ques_data.forEach((val, index) => {
if (val.hasOwnProperty('is_repeatable') && val.is_repeatable == '1') {
control.push(this._fb.group({
"is_repeatable": [val.is_repeatable || null],
"is_multi_disabled":[val.is_multi_disabled || '0'],
"group_title": [val.group_title || null], "group_type": [val.group_type || null]
,"question_key":[val.question[0].question_key]
}))
// let temp=val
// control.push(this.createValue(temp))
control.controls[index].addControl('questions_group', this._fb.array([]))
let childControl: any = control.controls[index].get('questions_group') as FormArray
childControl.push(this._fb.group({ 'questions': this._fb.array([]) }))
let sub_childControl: any = childControl.controls[0].get('questions') as FormArray
val.question.forEach((group_indi, arr_index) => {
// if(group_indi.api_properties != null && typeof(group_indi.api_properties) == 'object'){
// let param
// val.api_properties.forEach(val=>param=val)
group_indi.raw_validations = group_indi.validations
sub_childControl.push(this.createValue(group_indi))
this.addAdditionalControl(group_indi, sub_childControl, arr_index)
// if(group_indi.type == '5'){
// sub_childControl.controls[arr_index].removeControl('answer_value');
// sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([]))
// }
// if(group_indi.type == '1'){
// sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type))
// }
// if(val.type == '8'){
// sub_childControl.controls[index].addControl('select_search',new FormControl(val.field_type))
// }
if (group_indi.api_properties != null) {
this.apiPropertiesCall(group_indi).then(res => {
if (res != false) {
group_indi.answers = []
// group_indi.answers=this.convertArrayNames(val.api_properties.fields,res)
sub_childControl.controls[arr_index]['controls'].answers.setValue(this.convertArrayNames(group_indi.api_properties.fields, res))
}
})
}
// else{
// setTimeout(()=>{
// sub_childControl.push(this.createValue(group_indi))
// },200)
// }
// sub_childControl.push(this.createValue(group_indi))
})
// }
// else{
// sub_childControl.push(this.createValue(group_indi))
// }
// setTimeout(()=>{
// },500)
// let key_list=Object.keys(val)
// key_list.forEach(key=>{
// childControl.controls
// })
}
else {
// let key_list=Object.keys(val)
// let curr_object
// if(val.api_properties != null && typeof(val.api_properties) == 'object'){
val.raw_validations = val.validations
control.push(this.createValue(val))
// for checkbox remove the form control and add the formarray for multiple values
this.addAdditionalControl(val, control, index)
// if(val.type == '5'){
// control.controls[index].removeControl('answer_value');
// control.controls[index].addControl('answer_value',this._fb.array([]))
// }
// if(val.type == '1'){
// control.controls[index].addControl('field_type',new FormControl(val.field_type))
// }
// if(val.type == '8'){
// control.controls[index].addControl('select_search',new FormControl(val.field_type))
// }
if (val.api_properties != null) {
this.apiPropertiesCall(val).then(res => {
if (res != false) {
// val.answers=[]
// val.answers=this.convertArrayNames(val.api_properties.fields,res)
control.controls[index]['controls'].answers.setValue(this.convertArrayNames(val.api_properties.fields, res))
}
}, err => console.log(err))
}
// else{
// setTimeout(()=>{
// control.push(this.createValue(val))
// },200)
// }
// }
// else{
// control.push(this.createValue(val))
// }
console.log(formgroup)
}
}, err => console.log(err))
return formgroup
}
// END OF FORM CREATION
// FOR CREATING THE FORM CONTROL FOR SPECIFIC FORM ARRAY
createValue(data){
let is_amt_in_words=false
let answer_value_loc='';
let answers_from_client=[]
if(data.hasOwnProperty('answer_value') && data.answer_value != '' || null){
let values_for_cli:any = this.getAnswerValue(data)
if(values_for_cli.flag == 1){
answer_value_loc=values_for_cli.values
}
else{
answers_from_client=values_for_cli.values
}
}
// if(data.hasOwnProperty('field_type')){
// if(data.field_type == 'num'){
// is_amt_in_words=true
// }
// }
return this._fb.group({
"answer_value":[{value:answer_value_loc,disabled:answer_value_loc != '' ? true : false}], // OLD VALIDATION >>>> data.type != '6' ? Validators.compose([Validators.required]) : ''
"question":[data.question],
"question_key":[data.question_key],
"type":[data.type],
"raw_validations":[data.raw_validations],
"validations":[data.raw_validations],
"api_properties":[data.api_properties],
"onchange_properties":[data.onchange_properties],
"answers":[answers_from_client.length != 0 ? answers_from_client: data.answers],
"is_repeatable":[data.is_repeatable || null],
"group_title":[data.group_title || null]
})
}
// END OF CREATEVALUE FUN
// FOR REQUESTING THE API AUTOMATICALLY FROM JSON
apiPropertiesCall(val){
return new Promise((resolve,reject)=>{
if(val.api_properties != null && typeof(val.api_properties) == 'object'){
let pd_info = this.curr_pd_info
let params = val.api_properties.params
if(val.api_properties.hasOwnProperty('params_type') && val.api_properties.params_type == 'expression') {
params = eval(val.api_properties.params)
// debugger;
}
this.salesPDProvider.api_post_method(val.api_properties.api,params,val.api_properties.api_method).subscribe(res=>{
if(res['dataStatus']){
if(res.hasOwnProperty('records')){
res=res['records']
}
resolve(res)
// val.answers=res
}
else{
resolve(false)
}
})
}
else{
resolve(false)
}
})
}
// END OF API PROPERTIES CALL
// ---FOR CONVERTING THE ANSWER KEYS UNIQUE
convertArrayNames(fieldName,data_from_api){
let val1=[]
let modified_json = data_from_api.map(
obj => {
if(fieldName.length > 0) {
return {
"answer_id" : obj[fieldName[0]],
"answer":obj[fieldName[1]],
}
}
else {
return {
"answer_id" : obj,
"answer":obj,
}
}
});
return modified_json
}
// END OF CONVERTARRAYNAMES FUN--
// --- FOR SETTING THE VALUE DEFAULT WITH DISABLED AND GENERATE THE ANSWERS FOR FIELDS(EX. refer 'GET_FY_YEARS' switch)
getAnswerValue(value_obj) {
if (value_obj != null && value_obj.hasOwnProperty('answer_value')) {
let return_value = { flag: 1, values: '' };
let user_det: any = this.salesPDProvider.user_login_details
// user_det = JSON.parse(user_det);
switch (value_obj.answer_value) {
case 'CURRENT_USER':
return_value.values = user_det.user_first_name + ' ' + user_det.user_last_name
break;
case "CURRENT_DESIGNATION":
return_value.values = user_det.designation_name != null ? user_det.designation_name : ''
break;
case "CURRENT_DATE":
let date = new Date()
return_value.values = this.datepipe.transform(date, 'dd-MM-yyyy, h:mm:ss a')
break;
case "GET_FY_YEARS":
return_value.values = this.getCurrentFyYears()
return_value.flag = 2
break;
default:
return_value.values = ''
break
}
return return_value
}
return ''
}
// --END OF GETANSWERVALUE FUN
addAdditionalControl(data,curr_control,curr_index,purpose?){
//FOR CHECKBOX CHANGE THE VALUE STORAGE AS ARRAY
if(data.type == '5'){
curr_control.controls[curr_index].removeControl('answer_value');
curr_control.controls[curr_index].addControl('answer_value',this._fb.array([]))
}
//FOR numeric of string field
if(data.type == '1'){
curr_control.controls[curr_index].addControl('field_type',new FormControl(data.field_type))
curr_control.controls[curr_index].addControl('place_holder',new FormControl(data.place_holder))
}
//FOR SEARCHABLE FIELD VALUE KEY ()
if(data.type == '8'){
curr_control.controls[curr_index].addControl('select_search',new FormControl(data.field_type))
}
if(purpose == 'additional_field'){
curr_control.controls[curr_index].addControl('additional_field',new FormControl(1))
}
// FOR IMAGE STATUS
if(data.type == '6'){
curr_control.controls[curr_index].addControl('is_loader',new FormControl(''))
curr_control.controls[curr_index].addControl('is_saved',new FormControl(''))
curr_control.controls[curr_index].addControl('is_image_status',new FormControl(false))
}
//FOR SETTING THE VALIDATORS
this.settingArrayofValidators(data,curr_control.controls[curr_index],curr_index)
}
// FOR SETTING THE ARRAY OF VALIDATORS COMING FROM JSON Temp,
settingArrayofValidators(data,curr_control,curr_index){
if(data.hasOwnProperty('validations') && data.validations.length > 0 ){
const validList :any= [];
let validator_value
data.validations=data.validations.filter(val=>val.isactive != '0')
data.validations.forEach(valid => {
if(valid.value != null && !valid.hasOwnProperty('validation_to')){
validator_value= this.getvalidatorValue(valid)
}
else{
validator_value=this.setValueForValidator(valid)
}
validList.push(validator_value);
});
// console.log("valid",validList,curr_control)
// let val="Validators.required"
// console.log(typeof(Validators))
// console.log(typeof(`${val}`))
// let val1=`${val}`
// console.log(typeof(eval(val)))
// console.log(eval(val))
// curr_control.controls[curr_index].controls.answer_value.setValidators(validList)
curr_control.controls.answer_value.setValidators(validList)
curr_control.controls.answer_value.updateValueAndValidity()
}
}
// END OF SETTINGARRAYOFVALIDATORS FUN
// FOR GETTING THE VALIDATION VALUE
getvalidatorValue(value_obj){
if(value_obj != null && value_obj.hasOwnProperty('value')){
let value_of_validator
switch(value_obj.value){
case 'CURRENT_YEAR':
value_of_validator=new Date().getFullYear()
break;
default:
value_of_validator=''
break;
}
value_obj.validator=String(value_of_validator)
return this.setValueForValidator(value_obj)
}
}
// END OF GETVALIDATORVALUE FUN
// FOR GENERATING THE FY YEAR FIELD ANSWERS
getCurrentFyYears(){
let month=new Date().getMonth()
let year=new Date().getFullYear()
let fy:any=[];
if(month >=3){
fy.push({fy_year:year-1+'-'+(year),curr:year})
}
else{
fy.push({fy_year:year-2+'-'+(year-1),curr:year-1})
}
for(let i=0;i<=2;i++){
fy.push({fy_year:(fy[i].curr-2)+'-'+(fy[i].curr-1),curr:fy[i].curr-1})
}
return fy.map(val=>({answer:val.fy_year,answer_id:val.fy_year}))
}
// END OF GETCURRFYYEARS FUN
// FOR CREATING THE CORRECT VALIDATION
setValueForValidator(value_obj){
let return_value
if(value_obj != null && value_obj.hasOwnProperty('validator')){
switch(value_obj.name)
{
case 'required':
return_value=Validators.required
break;
case 'minLength':
return_value=Validators.minLength(value_obj.validator)
break;
case 'maxLength':
return_value=Validators.maxLength(value_obj.validator)
break;
case 'min':
return_value=Validators.min(value_obj.validator)
break;
case 'max':
return_value=Validators.max(value_obj.validator)
break;
case 'pattern':
return_value=Validators.pattern(value_obj.validator)
break;
default:
return_value=''
break;
}
return return_value
}
else{
return false
}
}
// END OF SETVALUEFORVALIDATOR FUN
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { GetGeometricLocationService } from './get-geometric-location.service';
describe('GetGeometricLocationService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: GetGeometricLocationService = TestBed.get(GetGeometricLocationService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,24 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';//for Datatables
import { Http } from '@angular/http';
@Injectable()
export class GetGeometricLocationService {
MAP_API_KEY: string;
MAP_API_URL: string;
constructor(private _http: Http) {
this.MAP_API_KEY = 'AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg'
this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
}
findLocations(address:string, postalCode?: string,state?:string, city?: string): Observable<any> {
let compositeAddress = [address];
if (postalCode) compositeAddress.push(postalCode);
if (state) compositeAddress.push(state);
if (city) compositeAddress.push(city);
let url = `${this.MAP_API_URL}${compositeAddress.join(',')}`;
return this._http.get(url).map(response => <any> response.json());
}
}

View File

@ -0,0 +1,468 @@
<mat-card>
<mat-card-content style="padding: 0px !important;">
<div *ngIf="!loadControl">
<div fxLayoutAlign="center">
<mat-progress-spinner mode="indeterminate" class="primary"></mat-progress-spinner>
</div>
<p class="nocontent" style="text-align: center;">Loading....</p>
</div>
<form [formGroup]="_PDtriggerForm" *ngIf="loadControl">
<mat-card-content>
<div style="width: 100%;text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdListCompoent(cancelStatus)"><mat-icon>close</mat-icon></button>
</div>
<div *ngIf="lenderShortName == 'MWISE'">
<mat-card-header>
<!-- <mat-card-title> Step 1 : -Excel Upload </mat-card-title> -->
</mat-card-header>
<div fxLayoutAlign="flex-end" *ngIf="(productname == 'NBFC/MFI' && role_id != '26' && role_id != '27') || (productname != 'NBFC/MFI')">
<button [ngStyle.xs]="{'width':'100%'}" style="font-size: 1.5rem;width: 32%;" mat-raised-button color="primary" (click)="openExcelUploadModal()">
Upload Excel <mat-icon>publish</mat-icon>
</button>
</div>
<br/>
</div>
<!-- [ngStyle]="{'background':lenderShortName == 'MWISE' ? 'gray' : ''}" -->
<mat-card >
<mat-card-header>
<mat-card-title> PD Details </mat-card-title>
</mat-card-header>
<mat-card-content fxLayout="row wrap" >
<mat-form-field fxFlex="28%" fxFlex.xs="100%" *ngIf="lenderShortName !='MWISE'">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson();getProCusType($event.value)">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option> Select </mat-option>
<mat-option (click)="selectedLender(LL.entity_id)" *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%" *ngIf="lenderShortName !='MWISE'">
<mat-select placeholder="Case Booked In" formControlName="sub_entity_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option> Select </mat-option>
<mat-option *ngFor="let LL of billingtolist" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%">
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id" >
{{LB.branch_name}}
</mat-option>
</mat-select>
<mat-error *ngIf="pdMain.pd_branch_id.hasError('required')">Branch Required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" (change)="checkExistPd($event.target.value,1)">
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
</mat-form-field>
<!-- <div *ngIf="sales_and_credit_enable"> -->
<mat-form-field fxFlex="28%" fxFlex.xs="100%" *ngIf="userDetails.short_name != 'IIB' && lenderShortName != 'MWISE'">
<mat-select placeholder="Lender Sales Person" formControlName="lender_sales_person">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of sales_and_credit_person.sales_person" [value]="person.userid">{{person.user_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%" *ngIf="lenderShortName == 'MWISE'">
<mat-label>Lender Sales Person</mat-label>
<input matInput type="text" formControlName="mwise_sales_person"/>
<mat-error *ngIf="_PDtriggerForm.controls['mwise_sales_person'].hasError('required')">Required</mat-error>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%" *ngIf="lenderShortName != 'MWISE'">
<mat-select placeholder="Lender Credit Person" formControlName="lender_credit_person">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of sales_and_credit_person.credit_person" [value]="person.userid">{{person.user_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%" *ngIf="sales_and_credit_enable">
<!-- <input matInput autocomplete="off" placeholder="Financial Institution" formControlName="imgc_fin_institute"> -->
<mat-select placeholder="Financial Institution" formControlName="imgc_fin_institute">
<mat-option>Select</mat-option>
<mat-option *ngFor="let insti of finInstitutionList" [value]="insti.entity_fin_institution_id">{{insti.institute_name}}</mat-option>
</mat-select>
</mat-form-field><br/>
<!-- </div> -->
<!-- <mat-form-field fxFlex="28%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" >
<mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error>
</mat-form-field>
<mat-form-field fxFlex="28%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" ForMobileNumbers maxlength="10" minlength="10">
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field> -->
<!--<mat-form-field fxFlex="32%">
<input matInput autocomplete="off" placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" OnlyNumber maxlength="10" required>
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>-->
<!-- <mat-form-field style="width: 8%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5" ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter Valid STD Code Number.</mat-error>
</mat-form-field> -
<mat-form-field style="width: 17%">
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="lender_landline" type="text" maxlength="8" ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
</mat-form-field> -->
<mat-form-field fxFlex="28%" fxFlex.xs="100%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
{{PL.product_name}}
</mat-option>
</mat-select>
<mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error>
</mat-form-field>
<mat-form-field *ngIf="isSubproductShown" fxFlex="28%" fxFlex.xs="100%">
<mat-select placeholder="Sub Product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option>
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
{{SPL.subproduct_name}}
</mat-option>
</mat-select>
<mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error>
</mat-form-field>
<!-- {{customerSegmentList | json}} -->
<mat-form-field *ngIf="isCustomerSegmentShown" fxFlex="28%" fxFlex.xs="100%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment" (selectionChange)="cusSegChange($event.value)">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
{{CSL.abbr}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</mat-form-field>
<!-- {{pdMain.fk_customer_segment.value}} -->
<!-- <mat-form-field fxFlex="28%" fxFlex.xs="100%">
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
{{PDL.type_name}}
</mat-option>
</mat-select>
</mat-form-field> -->
<div class="radio-gap" *ngIf="lenderShortName == 'MWISE'" fxFlex="30%" fxFlex.xs="100%">
<mat-label>Is this Tele PD ?</mat-label>
<!-- <mat-radio-group formControlName="fk_pd_type">
<mat-radio-button class="radio-btn-gap" *ngFor="let item of pdTypeList" [value]="item.pd_type_id">{{item.type_name}}</mat-radio-button>
</mat-radio-group> -->
<mat-slide-toggle color="primary" style="float: right;" [checked]="_PDtriggerForm.controls['fk_pd_type'] == '3' ? true : false"
(change)="changePDTypeSlideValue($event)" >
</mat-slide-toggle>
</div>
<mat-form-field fxFlex="60%" fxFlex.xs="100%">
<mat-label>{{lenderShortName == 'MWISE' ? "Loan amount applied for (Rs)" :'Loan Amount'}}</mat-label>
<input matInput autocomplete="off" formControlName="loan_amount" OnlyNumber required autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field>
</mat-card-content>
</mat-card>
<mat-card >
<mat-card-header>
<mat-card-title>Address Details</mat-card-title>
</mat-card-header>
<mat-form-field style="width:95%" *ngIf="lenderShortName == 'MWISE' && excel_file_id != null">
<mat-select [formControl] = "choosed_address" placeholder="Choose the Address" (selectionChange) = "onChangeSelectedAddress($event.value)" required>
<mat-option class="large-select-option" *ngFor="let val of addressList" [value]="val.id"><span > {{ val.display }}</span> </mat-option>
</mat-select>
<mat-error *ngIf="choosed_address.hasError('required')">Required.</mat-error>
</mat-form-field>
<div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index;">
<mat-card-content [formGroupName]="i" fxLayout="row wrap" fxLayout.xs="column">
<mat-form-field fxFlex="100%">
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done" formControlName="addressline1"
[value]="addresses.get('addressline1').value | titlecase"></textarea>
<!-- oninput="this.value = this.value.toUpperCase()" -->
<mat-error *ngIf="addresses.controls.addressline1.hasError('required')">Address required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="32%">
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList($event.value,i)">
<mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(addresses,i,'state')"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.name}}
</mat-option>
</mat-select>
<mat-error *ngIf="addresses.controls.fk_state.hasError('required')">State Required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="32%">
<mat-select placeholder="City" formControlName="fk_city">
<mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(addresses,i,'city')"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityList[i]" [value]="CL.city_id">
{{CL.city_name}}
</mat-option>
</mat-select>
<mat-error *ngIf="addresses.controls.fk_city.hasError('required')">City Required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="24%">
<mat-select placeholder="Pincode" formControlName="pincode" (selectionChange)="getPincode($event.value,i)">
<mat-option>
<ngx-mat-select-search formControlName="pinSearch" (keyup)="searchFun(addresses,i,'pin')"
[placeholderLabel]="'Search Pincode...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let PL of pincodeList[i]" [value]="PL.pincode_id">{{PL.pincode}}</mat-option>
</mat-select>
<mat-error *ngIf="addresses.controls.pincode.hasError('required')">Pincode Required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="24%" *ngIf="pincodeflag[i]">
<!-- *ngIf="pdAddresses.pincode.value == 1" -->
<input matInput autocomplete="off" placeholder="Specify Pincode" formControlName="other_pincode" OnlyNumber>
<!-- <mat-error *ngIf="pdAddresses.other_pincode.hasError('maxlength') || pdMain.other_pincode.hasError('minlength')">Enter Valid Pincode. </mat-error> -->
</mat-form-field>
<div align="end" *ngIf="pdAddresses.controls.length > 1">
<button mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="removeAddresses(i)" type="button"><mat-icon>delete</mat-icon></button>
</div>
</mat-card-content>
</div>
<mat-card-actions align="end" *ngIf="lenderShortName != 'MWISE'">
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses()"
matTooltip="Add More Additional Addresses" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</mat-card>
<div #applicant_details></div>
<mat-card >
<mat-card-header>
<mat-card-title>Applicant Details</mat-card-title>
</mat-card-header>
<mat-card-content fxLayout="row wrap" fxLayout.xs="column">
<h5 fxFlex="100%">Applicant 1</h5><br/>
<mat-form-field fxFlex="12%" fxFlex.xs="100%">
<mat-select placeholder="Title" formControlName="applicant_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="38%" fxFlex.xs="100%">
<mat-label>Name of <span *ngIf="lenderShortName != 'MWISE'">Individual </span>Applicant</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="applicant_name"
[value]="pdMain.applicant_name.value | titlecase" (change)="checkExistPd($event.target.value,2)">
<!-- <mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is Required.</mat-error> -->
</mat-form-field>
<mat-form-field fxFlex="38%" fxFlex.xs="100%" *ngIf="pdMain.fk_customer_segment.value != '8'">
<input matInput autocomplete="off" [placeholder]="cus_abbr_value == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field fxFlex="38%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" ForMobileNumbers maxlength="10" minlength="10" (change)="checkExistPd($event.target.value,2)">
<mat-error *ngIf="pdMain.mobile_no.hasError('required')">Mobile No is Required . </mat-error>
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field fxFlex="12%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="applicant_stdcode" type="text" ForMobileNumbers maxlength="5">
<mat-error *ngIf="pdMain.applicant_stdcode.hasError('maxlength') || pdMain.applicant_stdcode.hasError('minlength')">Enter Valid STD Code Number. </mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field fxFlex="22%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="applicant_landline" type="text" ForMobileNumbers maxlength="8">
<mat-error *ngIf="pdMain.applicant_landline.hasError('maxlength') || pdMain.applicant_landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
</mat-form-field>
<div formArrayName="coapplicants">
<!-- <div class="row" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100"> -->
<div *ngFor="let coDetails of pdCoApplicant.controls; let i = index;" fxLayout="row wrap" fxLayout.xs="column" [formGroupName]="i">
<h5 fxFlex="100%">{{coDetails.controls.label.value}} {{i+2}}</h5><br/>
<mat-form-field fxFlex="12%" fxFlex.xs="100%">
<mat-select placeholder="Title" formControlName="applicant_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="38%" fxFlex.xs="100%">
<mat-label>Name of <span *ngIf="lenderShortName != 'MWISE'">Individual </span>Applicant</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="coapplicant_name" type="text"
[value]="coDetails['controls'].coapplicant_name.value | titlecase" required>
<!-- <mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is Required.</mat-error> -->
</mat-form-field>
<mat-form-field fxFlex="38%" fxFlex.xs="100%" *ngIf="pdMain.fk_customer_segment.value != '8'">
<input matInput autocomplete="off" [placeholder]="cus_abbr_value == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<!-- <mat-form-field style="width: 100%">
<input matInput placeholder="Name" formControlName="coapplicant_name" type="text" required>
</mat-form-field> -->
<mat-form-field fxFlex="38%" fxFlex.xs="100%">
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" ForMobileNumbers>
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field fxFlex="12%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" maxlength="5" ForMobileNumbers>
<mat-error *ngIf="coDetails['controls'].coapplicant_stdcode.hasError('maxlength') || coDetails['controls'].coapplicant_stdcode.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field fxFlex="22%" fxFlex.xs="100%">
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="coapplicant_landline" type="text" maxlength="8" ForMobileNumbers>
<mat-error *ngIf="coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
<div align="end" >
<button mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="removeCoApplicant(i)" type="button"><mat-icon>delete</mat-icon></button>
</div>
</div>
<!-- </div> -->
</div>
<!-- Phone field to be split into 2 parts. Mobile Number mandatory and optional land line number with std code. ---->
</mat-card-content>
<mat-card-actions align="end">
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Applicant" matTooltipPosition="above" style="opacity: 0.8;border:2px;border-radius: 50%;" (click)="addCoApplicant()"><mat-icon>group_add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
</mat-card-actions>
</mat-card>
<mat-card *ngIf="lenderShortName != 'MWISE'">
<mat-card-header>
<mat-card-title>Credit Managers Specific Queries</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="addtional_requirements" *ngFor="let requirements of pdRequirements.controls; let i = index;">
<mat-card>
<mat-card-content [formGroupName]="i">
<mat-form-field style="width: 90%;">
<input matInput autocomplete="off" placeholder="Queries" formControlName="add_requirement">
</mat-form-field>
<button mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="removeRequirements(i)" type="button"><mat-icon>delete</mat-icon></button>
</mat-card-content>
</mat-card>
</mat-card-content>
<mat-card-actions align="end">
<button type="button" mat-raised-button mat-icon-button (click)="addRequiremnts()"
matTooltip="Add More Credit Managers Specific Queries" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</mat-card>
<mat-card *ngIf="lenderShortName != 'MWISE'">
<mat-card-header>
<mat-card-title>Documents to be collected</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="docs_to_be_collected" *ngFor="let Documentstobecollected of pdDocumentstobecollected.controls; let i = index;">
<mat-card>
<mat-card-content [formGroupName]="i">
<mat-form-field style="width: 90%;">
<input matInput autocomplete="off" placeholder="Documents to be collected" formControlName="doc_name">
</mat-form-field>
<button mat-raised-button mat-icon-button matTooltip="Delete" matTooltipPosition="above" (click)="removeDocumentstobecollected(i)" type="button"><mat-icon>delete</mat-icon></button>
</mat-card-content>
</mat-card>
</mat-card-content>
<mat-card-actions align="end">
<button type="button" mat-raised-button mat-icon-button (click)="addDocumentstobecollected()"
matTooltip="Add More Documents to be collected" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</mat-card>
<mat-card formArrayName="documents" *ngIf="lenderShortName != 'MWISE'">
<mat-card-header>
<mat-card-title>
Document
</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-list *ngFor="let docList of documents.controls; let d = index;" [formGroupName]="d">
<!-- <h3 mat-subheader>Upload Documents</h3> -->
<mat-list-item>
<mat-form-field style="width: 70%">
<input matInput autocomplete="off" placeholder="Document Name" formControlName="doc_name" type="text">
</mat-form-field>
<div style="width:50%">
<input type="file" title="Browse Document" (change)="fileSelectionEvent($event,d)" formControlName="documentFile">
<span (click)="removeItem(d)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" type="button"><mat-icon>delete</mat-icon></button>
</span>
</div>
</mat-list-item>
</mat-list>
</mat-card-content>
<mat-card-actions align="end">
<button mat-raised-button mat-icon-button matTooltip="Add Document" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" (click)="addMoreDocs()" type="button"><mat-icon>attach_file</mat-icon></button>
</mat-card-actions>
</mat-card>
</mat-card-content>
<mat-card-actions>
<div fxFlex="70" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<!-- <mat-label>Remarks</mat-label> -->
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.getRawValue(),draftStatus)" matTooltip="Save as Draft" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger PD" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.getRawValue(),PDTriggerStatus)" [disabled]="disableAfterSubmit===true"><mat-icon>save</mat-icon></button>
</div>
</mat-card-actions>
</form>
</mat-card-content>
</mat-card>
<notifier-container></notifier-container>

View File

@ -0,0 +1,60 @@
mat-form-field {
margin: 0 2%;
}
.mat-form-field-appearance-legacy .mat-hint{
color:rgba(0, 0, 0, 0.8) !important;
}
.mat-error {
float: right;
}
mat-radio-button,mat-checkbox{
margin-top: 13px;
}
.radio-gap{
// margin-top: 10px;
// margin-bottom: 10px;
margin: 20px;
}
.radio-btn-gap{
margin:10px;
}
::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{
border-color:rgb(212, 15, 15);
}
::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{
color:rgb(212, 15, 15);
background-color:rgb(212, 15, 15);
}
::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element {
background-color:rgba(224, 22, 22, 0.308);
}
::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar {
background-color: rgb(212, 15, 15);
}
::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb {
background-color:rgb(212, 15, 15);
}
// .large-select {
// ::ng-deep .mat-select-panel .mat-optgroup-label, .mat-select-panel .mat-option {
// height: unset;
// }
// ::ng-deep .mat-option-text {
// white-space: normal;
// }
// }
.large-select-option {
height: unset !important;
line-height: 1.2em !important;
padding-top: 0.9em !important;
padding-bottom: 0.9em !important;
span {
white-space: normal;
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddPdComponent } from './add-pd.component';
describe('AddPdComponent', () => {
let component: AddPdComponent;
let fixture: ComponentFixture<AddPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
<div fxLayout="row" fxLayoutAlign="center">
<p style="color: red;margin: 0;">Allowed Format .xls, .xlsx</p>
</div>
<div fxLayout="row">
<label class="custom-file-upload">
<input type="file" id='excel-upload' accept=".xlsx, .xls" multiple="false"
(change)="inputExcelOnClick($event)" />
Choose Excel File
</label>
</div>
<div fxLayout="row" *ngIf="sheetJsExcelName">
<p style="font-size: 17px;font-weight: bold;white-space: pre-wrap;
overflow: hidden;
word-break: break-all;">{{sheetJsExcelName}}</p>
</div>
<div align="end" style="margin-top: 10px;">
<button [disabled]="!sheetJsExcelName || !sheetBufferRender" mat-raised-button color="primary" (click)="uploadExcel()">Upload</button>
</div>

View File

@ -0,0 +1,13 @@
input[type="file"] {
display: none;
}
.custom-file-upload {
border: 1px solid red;
display: inline-block;
padding: 6px 12px;
cursor: pointer;
}
.custom-file-upload :hover{
background-color: rgba(255, 0, 0, 0.317);
color: rgba(255, 0, 0, 0.317);
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ExcelUploadDialogComponent } from './excel-upload-dialog.component';
describe('ExcelUploadDialogComponent', () => {
let component: ExcelUploadDialogComponent;
let fixture: ComponentFixture<ExcelUploadDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ExcelUploadDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ExcelUploadDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,87 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MatSnackBar, MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-excel-upload-dialog',
templateUrl: './excel-upload-dialog.component.html',
styleUrls: ['./excel-upload-dialog.component.scss']
})
export class ExcelUploadDialogComponent implements OnInit {
sheetJsExcelName: any;
sheetBufferRender: File;
constructor(private snackBar:MatSnackBar,private loaderService:LoaderService,private _pdService:PdTrigerService,
private dialogRef:MatDialogRef<ExcelUploadDialogComponent>, @Inject(MAT_DIALOG_DATA)public data:any) { }
ngOnInit() {
}
inputExcelOnClick(evt) {
const target: HTMLInputElement = evt.target;
if (target.files.length === 0) {
this.openSnackBar("No files Choosen",'')
this.sheetJsExcelName = ''
throw new Error('未上傳');
}
if (target.files.length > 1) {
this.openSnackBar("Please Upload Single Excel File",'')
this.sheetJsExcelName = ''
throw new Error('Cannot use multiple files');
}
let is_excel = this.checkFileExtension(evt.target.files.item(0).name)
if(!is_excel) {
this.openSnackBar("Please Upload the file with allowed format .xls or .xlsx",'')
return
}
this.sheetJsExcelName = evt.target.files.item(0).name;
const reader: FileReader = new FileReader();
// this.readerExcel(reader);
reader.readAsArrayBuffer(target.files[0]);
this.sheetBufferRender = target.files[0];
console.log(this.sheetJsExcelName,this.sheetBufferRender)
// this.isEmptyDrop = false;
// this.isExcelDrop = true;
}
checkFileExtension(uploadpath) {
var fileExtension = uploadpath.substring(uploadpath.lastIndexOf(".") + 1, uploadpath.length);
if (fileExtension == "xls" || fileExtension == "xlsx") {
//write code for success
return true;
}
else {
//error code - select only excel files
return false;
}
}
openSnackBar(message: string, action: string) {
this.snackBar.open(message, action, {
duration: 2000,
});
}
uploadExcel() {
console.log("clicked")
if(!this.sheetBufferRender || !this.sheetJsExcelName) {
this.openSnackBar("File is missing please choose the file again",'')
return;
}
this.loaderService.showMatSpinnerDialog("Upload is in progress.. Please wait..")
let pd_id = this.data && this.data.hasOwnProperty('pd_id') ? this.data.pd_id : null
this._pdService.uploadSMCDataFile(this.sheetBufferRender,pd_id).subscribe(res=>{
if(res['dataStatus']) {
this.dialogRef.close(res)
}
else{
this.openSnackBar("Something went wrong",'')
}
this.loaderService.closeMatSpinnerDialog()
},err=>{
this.loaderService.closeMatSpinnerDialog()
console.log(err)
this.openSnackBar("Network Error",'')
})
}
}

View File

@ -0,0 +1,277 @@
<mat-card-content style="padding: 0;">
<mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left">
<mat-toolbar-row>
<mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span>
<span>Advance Filter</span>
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-list class="m-gap p-gap">
<div [formGroup]="searchForm">
<!-- <mat-form-field style="width:20%" class="matfieldblock">
<mat-select multiple formControlName="pd_type" placeholder="PD Type">
<mat-option *ngFor="let type of PDType" [value]="type.pd_type_id">{{type.type_name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp; -->
<mat-form-field style="width:20%" class="matfieldblock">
<mat-select multiple formControlName="pd_status" placeholder="PD Status">
<mat-option *ngFor="let status of pdStatus" [value]="status.pd_status_name">{{status.pd_status_name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:20%" class="matfieldblock">
<input matInput [matDatepicker]="picker" (blur)="checkDate($event)" [max]="todaydate" formControlName="pd_from_date" placeholder="Choose a From date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:20%" class="matfieldblock">
<input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate" formControlName="pd_to_date" placeholder="Choose a todate">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:20%" class="matfieldblock">
<mat-select formControlName="date_type" placeholder="Date Type">
<mat-option value="1">PD Trigger Date</mat-option>
<mat-option value="2">PD Completed Date</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%" class="matfieldblock">
<mat-select multiple formControlName="pd_products" placeholder="Products">
<mat-option *ngFor="let pro of PRODUCTS" [value]="pro.product_id">{{pro.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%" class="matfieldblock">
<mat-select multiple formControlName="pd_city" placeholder="City">
<mat-option *ngFor="let city of CITY" [value]="city.city_id">{{city.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_lender" placeholder="Lender Name">
<mat-option *ngFor="let ent of ENTITY" [value]="ent.entity_id">{{ent.full_name}}</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field style="width:30%" class="matfieldblock">
<input matInput type="text" formControlName="pd_name" placeholder="Applicant Name">
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%" class="matfieldblock">
<input matInput type="text" formControlName="pd_applicant_id" placeholder="Applicant Id">
</mat-form-field>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="onReset()"
matTooltip="Reset" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary">
<mat-icon>settings_backup_restore</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="searchItem()"
matTooltip="Search" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>search</mat-icon>
</button>
</div>
</div>
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)=" details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<!--Start Mobile View Code-->
<!-- <div (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" class="webhide"> -->
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
<p class="lettericon">{{details.pd_sno_split.lender_name}}<br/>
<span style="font-size: 90%">{{details.pd_sno_split.serial_no}}</span></p>
<span *ngIf="(details.lender_short_name == 'MWISE' && details.fk_pd_type == '3') || (details.lender_short_name != 'MWISE')" class="lettertext" style="color: #e2412f;">{{details.pd_type_name}}</span>
</div>
<div fxFlex.xs="80" fxFlex.sm="80" class="webhide">
<div fxLayout="row wrap" style="margin-left: 6px;">
<div fxFlex.xs="75" fxFlex.sm="75" class="webhide">
<span style="font-size: 100%;" *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span>
</div>
<div fxFlex.xs="25" fxFlex.sm="25" class="webhide" style="text-align: right;">
<span class="lettertext" *ngIf="details.pd_status!='QC_COMPLETED'"> {{details.pd_status}}</span>
<span class="lettertext" *ngIf="details.pd_status=='QC_COMPLETED'"> QC COMPLETED</span>
</div>
</div>
<div fxLayout="row wrap" style="margin-left: 6px;">
<div fxFlex.xs="50" fxFlex.sm="50" class="webhide">
<span class="lettertext" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="lettertext" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" class="webhide" style="text-align: right;">
<span *ngIf="details.product_abbr" mat-line class="lettertext"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span>
</div>
</div>
<div fxLayout="row wrap" style="margin-left: 6px;">
<div fxFlex.xs="55" fxFlex.sm="55" class="webhide">
<span class="lettertext" *ngIf="details.pd_status!='SCHEDULED' && details.pd_status!='QC_COMPLETED'" [matTooltip]="details.pd_status | titlecase"
matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="lettertext" *ngIf="details.pd_status=='QC_COMPLETED'" matTooltip="QC Completed" matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="lettertext" *ngIf="details.pd_status=='SCHEDULED'" [matTooltip]="details.pd_status | titlecase" matTooltipPosition="above">{{details.scheduled_on}}
</span>
</div>
<div fxFlex.xs="45" fxFlex.sm="45" class="webhide" style="text-align: right;">
<p class="fontsize" style="margin:0;font-weight: bold;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</p>
</div>
</div>
</div>
<mat-divider></mat-divider>
</div>
<!-- </div>-->
<!--End Mobile View Code-->
<!--Start Web View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList | async">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="12" fxFlex.lg="12" fxFlex.xl="12" class="cell" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<span mat-line class="cell" *ngIf="(details.lender_short_name == 'MWISE' && details.fk_pd_type == '3') || (details.lender_short_name != 'MWISE')">{{details.pd_type_name}}</span>
</div>
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" class="cell" style="justify-content:flex-end">
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span>
<br>
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</div>
<div fxFlex.xs="40" fxFlex.sm="40" fxFlex.md="13.66" fxFlex.lg="13.66" fxFlex.xl="13.66" class="cell" style="justify-content:flex-end">
<span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span>
<br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span>
<br>
<span *ngIf="details.loan_amount" class="fontsize">
<i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</div>
<div fxFlex.xs="40" fxFlex.sm="40" fxFlex.md="15.66" fxFlex.lg="15.66" fxFlex.xl="15.66" class="cell center" style="justify-content:flex-end">
<span matTooltip="Initiated Date" matTooltipPosition="above">{{details.pd_date_of_initiation}}</span>
<br>
<span class="fontsize" *ngIf="details.city_name">
<i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode_id == 1 ? details.other_pincode : details.pincode }} </span>
</div>
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="center no-pad cell" style="justify-content:flex-end">
<span *ngIf="details.pd_status!='QC_COMPLETED'"> {{details.pd_status}}</span>
<span *ngIf="details.pd_status=='QC_COMPLETED'"> QC COMPLETED</span>
<br>
<span class="fontsize cell" *ngIf="details.pd_status!='SCHEDULED' && details.pd_status!='QC_COMPLETED'" [matTooltip]="details.pd_status | titlecase"
matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="fontsize" *ngIf="details.pd_status=='QC_COMPLETED'" matTooltip="QC Completed" matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="fontsize" *ngIf="details.pd_status=='SCHEDULED'" [matTooltip]="details.pd_status | titlecase" matTooltipPosition="above">{{details.scheduled_on}}
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<!-- *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27' || LenderRoleID == '25' -->
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">
<mat-icon>my_location</mat-icon>
</button>
</a>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>
</div>
<!--End Web View Code-->
<mat-divider></mat-divider>
</div>
</div>
<!-- <mat-table [dataSource]="dataSourceTab1" matSort *ngIf="PdListData.length > 0">
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="15" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span>
<br>
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span>
<br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span>
<br>
<span *ngIf="details.loan_amount" class="fontsize">
<i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span matTooltip="Initiated Date" matTooltipPosition="above">{{details.pd_date_of_initiation}}</span>
<br>
<span class="fontsize" *ngIf="details.city_name">
<i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode_id == 1 ? details.other_pincode : details.pincode }} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span *ngIf="details.pd_status!='QC_COMPLETED'"> {{details.pd_status}}</span>
<span *ngIf="details.pd_status=='QC_COMPLETED'"> QC COMPLETED</span>
<br>
<span class="fontsize" *ngIf="details.pd_status!='SCHEDULED' && details.pd_status!='QC_COMPLETED'" [matTooltip]="details.pd_status | titlecase"
matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="fontsize" *ngIf="details.pd_status=='QC_COMPLETED'" matTooltip="QC Completed" matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="fontsize" *ngIf="details.pd_status=='SCHEDULED'" [matTooltip]="details.pd_status | titlecase" matTooltipPosition="above">{{details.scheduled_on}}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">
<mat-icon>my_location</mat-icon>
</button>
</a>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table> -->
<!-- <ng-template #noRecord>
<div> No Record found </div>
</ng-template> -->
</mat-card-content>
<div [hidden]="recordStatus">
<mat-paginator #paginator class="mat-elevation-z1" [length]="length" [pageIndex]="pageIndex"
[pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent=OnPageChange($event)" showFirstLastButtons>
</mat-paginator>
</div>
<mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content>
<notifier-container></notifier-container>

View File

@ -0,0 +1,92 @@
.ic-change:hover {
transform: scale(1.1);
color: green;
}
.center{
text-align:center;
}
.fontsize{
font-size:14px;
}
.toolbar-space {
flex: 0.01 0 auto;
}
p.note {
// float: right;
text-align: right;
font-size: 12px;
color: grey;
font-weight: bold;
}
// .example-container {
// display: flex;
// flex-direction: column;
// max-height: 500px;
// min-width: 300px;
// }
// .mat-table {
// overflow: auto;
// max-height: 500px;
// }
.mobile-label {
display: none;
}
@media(min-width: 600px) {
.webhide{
display: none !important;
}
}
@media(max-width: 600px) {
.body-container {
padding: 0px !important;
}
.mat-expansion-panel-body {
padding: 0 10px 16px !important;
}
.cell{
display: none !important;
}
.mat-form-field{
display: inline !important;
}
// .no-pad{
// text-align: left !important;
// padding-left: 0px !important;
// }
.mobile-label {
width: 80px;
display: inline-block;
font-weight: bold;
}
.mat-header-row {
display: none;
}
.mat-row {
flex-direction: column;
align-items: start;
padding: 8px 24px;
}
.lettericon{
// background-color: cadetblue;
// padding: 6px 7px 6px 7px;
border-radius: 10px;
color: #e2412f;
font-size: 75%;
font-weight: bold;
min-width: 4.4em;
text-align: center;
margin: 10px 0px 0px 0px !important;
}
.lettertext{
font-size: 80%;
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AllPdComponent } from './all-pd.component';
describe('AllPdComponent', () => {
let component: AllPdComponent;
let fixture: ComponentFixture<AllPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AllPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AllPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,368 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
import { PdTrigerService } from './../../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
import { FormGroup, FormBuilder} from '@angular/forms';
import { DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { AwsService } from 'app/AwsService/aws.service';
import { UserService } from 'app/settings/service/user.service';
import { ReplaySubject } from 'rxjs';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-all-pd',
templateUrl: './all-pd.component.html',
styleUrls: ['./all-pd.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class AllPdComponent implements OnInit, OnChanges {
xpandStatus: boolean = false;
PRODUCTS:any[]=[];
ENTITY: any[]=[]
CITY: any[]=[]
PDType: any[]=[]
pdStatus: any[]=[]
searchForm:FormGroup;
pipe = new DatePipe('en-US');
private notifier: NotifierService;
recordStatus: boolean;
errorMessage:any[]=[];
tabStatus:string="ALL";
public dataLengthTab1: number;
public dataSourceTab1 = new MatTableDataSource();
displayedColumns = ['PDType','Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// data source variable details
PdListData:any[] = [];
// pagination variable details
length = 0;
pageIndex = 0;
pageSize = 10;
pageEvent: any;
todaydate:Date = new Date();
user_role_name: string;
limitMsg: boolean = false;
common: any;
pagedList: ReplaySubject<any> = new ReplaySubject<any>(1);
user_id: any;
startIndex: number;
endIndex: any;
filtered_raw_data: any[];
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService,
private _aws:AwsService,private loaderService:LoaderService) {
this.LenderRoleID = localStorage.getItem('LenderRoleID');
this.notifier = notifier;
this.searchForm = this._fb.group(
{
pd_type:[null],
pd_status:[null],
pd_from_date:[null],
pd_to_date:[null],
date_type:['1'],
pd_city:[null],
pd_products:[null],
pd_lender:[null],
pd_name:[null],
pd_applicant_id:[null],
});
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings'))
if(this.common) {
this.common =this.common.default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
else{
setTimeout(()=>{
this.common = JSON.parse(localStorage.getItem('commonSettings'))
if(this.common) {
this.common =this.common.default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
},2000)
}
this.user_id = this._aws.getlocale();
}
ngOnInit() {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
localStorage.setItem('len_user_role',role_name);
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
//this.getcommonDropDown();
console.log(this.displayedColumns)
}
// get changes for filter from parent componnet filter
ngOnChanges(changes: SimpleChanges) {
let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
// this.dataSourceTab1.filter = filteredText;
// console.log("changes",this.bindFilterValue)
this.filterData(filteredText)
}
filterData(text) {
if(!text) {
setTimeout(()=>{
this.filtered_raw_data = []
this.pagedList .next(this.PdListData.slice(0, 10));
},0)
this.length = this.PdListData.length;
return
}
let temp = this.PdListData.filter(v=>{
if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1
|| v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1
||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) {
return true;
}
return false
})
setTimeout(()=>{
console.log(temp)
this.filtered_raw_data = temp
this.length = this.filtered_raw_data.length
this.pagedList.next(temp.slice(0, 10))
},0)
// this.pa
// this.length = this.pagedList.length
// console.log(this.PdListData,this.pagedList,text)
}
// load inprogress pd list
public LenderRoleID : string = localStorage.getItem('LenderRoleID');
loadPDDetails() {
this.LenderRoleID = localStorage.getItem('LenderRoleID');
if(this.PdListData.length == 0) {
this.loaderService.showMatSpinnerDialog("Loading...")
}
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._pd.getPdDetails(this.LenderRoleID)
.subscribe(
data => {
this.loaderService.closeMatSpinnerDialog();
if (data.status == 200) {
this.PdListData = data.records;
// this.PdListData = <GetOrInitializeYourListHere>;
if(this.startIndex && this.endIndex) {
this.pagedList.next(this.PdListData.slice(this.startIndex, this.endIndex));
}
else {
this.pagedList.next(this.PdListData.slice(0, 10));
}
this.length = this.PdListData.length;
this.PdListData.forEach(value=>{
let original=value.pd_sno
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
})
// this.dataLengthTab1 = data.records.length;
// this.dataSourceTab1.data = this.PdListData;
this.recordStatus=false;
this.limitMsg = true
}
else{
this.PdListData=[];
this.pagedList.next([])
// this.pagedList.forEach(value=>{
// let original=value.pd_sno
// value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
// })
// this.dataSourceTab1.data = [];
this.recordStatus=true;
this.limitMsg = false
}
}
// , error => {this.errorMessage = <any> error});
,error => {
this.loaderService.closeMatSpinnerDialog();
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
});
}
OnPageChange(event: PageEvent){
this.startIndex = event.pageIndex * event.pageSize;
this.endIndex = this.startIndex + event.pageSize;
if(this.endIndex > this.length){
this.endIndex = this.length;
}
let raw_data = this.filtered_raw_data && this.filtered_raw_data.length > 0 ? this.filtered_raw_data : this.PdListData
this.pagedList.next(raw_data.slice(this.startIndex, this.endIndex));
}
pageChange(e) {
console.log(e);
}
viewPD(pdid:string,randomString){
// console.log(pdid,randomString);
let pdidwithRandomString:any = {'id':pdid,'string': randomString};
// console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word:string) {
if (!word) return word;
return word[0].toUpperCase() + word.substr(1).toLowerCase();
}
/**
* Common Search
* sriram
*/
getcommonDropDown(): void
{
this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=>
{
if(res.dataStatus==true)
{
this.pdStatus = res.records.filter(status=>status.isactive==1);
}
});
this._pd.getAllMasterDatas('PDTYPE').subscribe(res=>
{
if(res.dataStatus==true)
{
this.PDType = res.records.filter(type=>type.isactive==1);
}
});
this._pd.getListOfCities().subscribe(res=>
{
if(res.dataStatus==true)
{
this.CITY = res.records;
}
});
this._pd.getAllMasterDatas('ENTITY').subscribe(res=>
{
if(res.dataStatus==true)
{
this.ENTITY = res.records.filter(ent=>ent.isactive==1);
}
});
this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=>
{
if(res.dataStatus==true)
{
this.PRODUCTS = res.records.filter(pro=>pro.isactive==1);
}
});
}
checkDate(e)
{
console.log(e);
}
searchItem()
{
if(this.searchForm.value.pd_type !=null)
{
}else
{
this.searchForm.value.pd_type = [];
}
if(this.searchForm.value.pd_status !=null)
{
}else
{
this.searchForm.value.pd_status = [];
}
this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd');
this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd');
// console.log(JSON.stringify(this.searchForm.value));
let dt =this.searchForm.value.date_type;
let ldt: number = +dt;
this.searchForm.value.date_type=ldt;
console.log(this.searchForm.value);
this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=>
{
this.xpandStatus = false;
console.log("Res",res['dataStatus'])
if(res['dataStatus'])
{
this.PdListData = res['records'];
this.pagedList .next( this.PdListData.slice(0, 10));
this.length = this.PdListData.length;
this.PdListData.forEach(value=>{
let original=value.pd_sno
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
})
// this.dataSourceTab1.data = res['records'];
// // console.log('records',res['records']);
// this.dataSourceTab1.paginator = this.paginator;
this.recordStatus=false
this.limitMsg = false
}else{
this.notifier.notify('warning', 'No Records Found !');
// this.dataSourceTab1.paginator['length'] = 0;
// this.dataSourceTab1.paginator['pageIndex'] = 0;
// this.dataSourceTab1.data = [];
this.PdListData = [];
this.pagedList .next([]);
// this.length = this.PdListData.length;
this.recordStatus = true;
this.limitMsg = false
// console.log('records-records',res['records']);
}
},error => {
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Went Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
});
}
onReset(){
this.searchForm.reset();
this.searchForm.controls['date_type'].setValue('1');
this.loadPDDetails();
this.xpandStatus = false;
}
ngAfterViewInit() {
this.dataSourceTab1.paginator = this.paginator;
this.dataSourceTab1.sort = this.sort;
}
}

View File

@ -0,0 +1,239 @@
<mat-card-content style="padding: 0;">
<mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left">
<!-- <h6 class="mt-0"><mat-icon>filter_list</mat-icon> Filter</h6> -->
<mat-toolbar-row>
<mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span>
<span>Advance Filter</span>
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-list class="m-gap p-gap">
<div [formGroup]="searchForm">
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_type" placeholder="PD Type">
<mat-option *ngFor="let type of PDType" [value]="type.pd_type_id">{{type.type_name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp; -->
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_status" placeholder="PD Status">
<mat-option *ngFor="let status of pdStatus" [value]="status.pd_status_name">{{status.pd_status_name}}</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field style="width:30%">
<input matInput [max]="todaydate" [matDatepicker]="picker" (blur)="checkDate($event)" formControlName="pd_from_date" placeholder="Choose a From date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<input matInput [max]="todaydate" [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" formControlName="pd_to_date" placeholder="Choose a todate">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%" class="matfieldblock">
<mat-select formControlName="date_type" placeholder="Date Type">
<mat-option value="1">PD Trigger Date</mat-option>
<mat-option value="2">PD Completed Date</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_products" placeholder="Products">
<mat-option *ngFor="let pro of PRODUCTS" [value]="pro.product_id">{{pro.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_city" placeholder="City">
<mat-option *ngFor="let city of CITY" [value]="city.city_id">{{city.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_lender" placeholder="Lender Name">
<mat-option *ngFor="let ent of ENTITY" [value]="ent.entity_id">{{ent.full_name}}</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field style="width:30%">
<input matInput type="text" formControlName="pd_name" placeholder="Applicant Name">
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:30%">
<input matInput type="text" formControlName="pd_applicant_id" placeholder="Applicant Id">
</mat-form-field>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="onReset()"
matTooltip="Reset" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary">
<mat-icon>settings_backup_restore</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="searchItem()"
matTooltip="Search" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>search</mat-icon>
</button>
</div>
</div>
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
<!--Start Mobile View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
<p class="lettericon">{{details.pd_sno_split.lender_name}}<br/>
<span style="font-size: 90%">{{details.pd_sno_split.serial_no}}</span></p>
<span *ngIf="(details.lender_short_name == 'MWISE' && details.fk_pd_type == '3') || (details.lender_short_name != 'MWISE')" class="lettertext" style="color: #e2412f;">{{details.pd_type_name}}</span>
</div>
<div fxFlex.xs="80" fxFlex.sm="80" class="webhide">
<div fxLayout="row wrap" style="margin-left: 6px;">
<div fxFlex.xs="75" fxFlex.sm="75" class="webhide">
<span style="font-size: 100%;" *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD'}}</b>
</span>
</div>
<div fxFlex.xs="25" fxFlex.sm="25" class="webhide" style="text-align: right;">
<span class="lettertext" *ngIf="details.pd_status!='QC_COMPLETED'"> {{details.pd_status}}</span>
<span class="lettertext" *ngIf="details.pd_status=='QC_COMPLETED'"> QC COMPLETED</span>
</div>
</div>
<div fxLayout="row wrap" style="margin-left: 6px;">
<div fxFlex.xs="50" fxFlex.sm="50" class="webhide">
<span class="lettertext" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="lettertext" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" class="webhide" style="text-align: right;">
<span *ngIf="details.product_abbr" mat-line class="lettertext"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span>
</div>
</div>
<div fxLayout="row wrap" style="margin-left: 6px;">
<div fxFlex.xs="55" fxFlex.sm="55" class="webhide">
<span class="lettertext" [matTooltip]="details.pd_status | titlecase" matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}</span>
</div>
<div fxFlex.xs="45" fxFlex.sm="45" class="webhide" style="text-align: right;">
<p class="fontsize" style="margin:0;font-weight: bold;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</p>
</div>
</div>
</div>
<mat-divider></mat-divider>
</div>
<!--End Mobile View Code-->
<!--Start Web View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList | async">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="12" fxFlex.lg="12" fxFlex.xl="12" class="cell" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<span *ngIf="(details.lender_short_name == 'MWISE' && details.fk_pd_type == '3') || (details.lender_short_name != 'MWISE')" mat-line class="cell">{{details.pd_type_name}}</span>
</div>
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" class="cell" style="justify-content:flex-end">
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span>
<br>
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</div>
<div fxFlex.xs="40" fxFlex.sm="40" fxFlex.md="13.66" fxFlex.lg="13.66" fxFlex.xl="13.66" class="cell" style="justify-content:flex-end">
<span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span>
<br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span>
<br>
<span *ngIf="details.loan_amount" class="fontsize">
<i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</div>
<div fxFlex.xs="40" fxFlex.sm="40" fxFlex.md="15.66" fxFlex.lg="15.66" fxFlex.xl="15.66" class="cell center" style="justify-content:flex-end">
<span matTooltip="Initiated Date" matTooltipPosition="above">{{details.pd_date_of_initiation}}</span>
<br>
<span class="fontsize" *ngIf="details.city_name">
<i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode_id == 1 ? details.other_pincode : details.pincode }} </span>
</div>
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="center no-pad cell" style="justify-content:flex-end">
<span *ngIf="details.pd_status!='QC_COMPLETED'"> {{details.pd_status}}</span>
<span *ngIf="details.pd_status=='QC_COMPLETED'"> QC COMPLETED</span>
<br>
<span class="fontsize cell" *ngIf="details.pd_status!='SCHEDULED' && details.pd_status!='QC_COMPLETED'" [matTooltip]="details.pd_status | titlecase"
matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="fontsize" *ngIf="details.pd_status=='QC_COMPLETED'" matTooltip="QC Completed" matTooltipPosition="above">{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
<span class="fontsize" *ngIf="details.pd_status=='SCHEDULED'" [matTooltip]="details.pd_status | titlecase" matTooltipPosition="above">{{details.scheduled_on}}
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">
<mat-icon>my_location</mat-icon>
</button>
</a>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>
</div>
<mat-divider></mat-divider>
</div>
<!--End Web View Code-->
</div>
<!-- <mat-table #table_element [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="15" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span><br>
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Lenderid">
<mat-cell class="cell" *matCellDef="let details">
<span *ngIf="details.lender_short_name" mat-line> {{details.lender_short_name}} </span><br>
<span *ngIf="details.product_abbr" mat-line class="fontsize"> {{details.product_abbr}}<span *ngIf="details.subproduct_abbr">/{{details.subproduct_abbr}}</span></span> <br>
<span *ngIf="details.loan_amount" class="fontsize"><i class="fa-1x fa fa-rupee"></i> {{details.loan_amount}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Address">
<mat-cell class="cell" *matCellDef="let details;">
<span matTooltip="Initiated Date" matTooltipPosition="above">{{details.pd_date_of_initiation}}</span><br>
<span class="fontsize" *ngIf="details.city_name"> <i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}-{{details.pincode_id == 1 ? details.other_pincode : details.pincode }} </span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Status">
<mat-cell class="cell center" *matCellDef="let details;">
<span> {{details.pd_status}}</span><br>
<span class="fontsize" [matTooltip]="details.pd_status | titlecase" >{{ (details.updatedon)? (details.updatedon | slice:0:10):(details.updatedon) }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View"
matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table> -->
</mat-card-content>
<div [hidden]="recordStatus">
<mat-paginator #paginator class="mat-elevation-z1" [length]="length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent=OnPageChange($event)" showFirstLastButtons>
</mat-paginator>
</div>
<mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content>

View File

@ -0,0 +1,91 @@
.ic-change:hover {
transform: scale(1.1);
color: green;
}
.center{
text-align:center;
}
.fontsize{
font-size:14px;
}
.toolbar-space {
flex: 0.01 0 auto;
}
p.note {
// float: right;
text-align: right;
font-size: 12px;
color: grey;
font-weight: bold;
}
// .example-container {
// display: flex;
// flex-direction: column;
// max-height: 500px;
// min-width: 300px;
// }
// .mat-table {
// overflow: auto;
// max-height: 500px;
// }
.mobile-label {
display: none;
}
@media(min-width: 600px) {
.webhide{
display: none !important;
}
}
@media(max-width: 600px) {
.body-container {
padding: 0px !important;
}
.mat-expansion-panel-body {
padding: 0 10px 16px !important;
}
.cell{
display: none !important;
}
.mat-form-field{
display: inline !important;
}
// .no-pad{
// text-align: left !important;
// padding-left: 0px !important;
// }
.mobile-label {
width: 80px;
display: inline-block;
font-weight: bold;
}
.mat-header-row {
display: none;
}
.mat-row {
flex-direction: column;
align-items: start;
padding: 8px 24px;
}
.lettericon{
// background-color: cadetblue;
// padding: 6px 7px 6px 7px;
border-radius: 10px;
color: #e2412f;
font-size: 75%;
font-weight: bold;
min-width: 4.4em;
text-align: center;
margin: 10px 0px 0px 0px !important;
}
.lettertext{
font-size: 80%;
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CompletedPdComponent } from './completed-pd.component';
describe('CompletedPdComponent', () => {
let component: CompletedPdComponent;
let fixture: ComponentFixture<CompletedPdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CompletedPdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CompletedPdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,356 @@
import { Component,ViewChild, OnInit, ViewEncapsulation, Input, Output, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
import { PdTrigerService } from './../../../pd-service/pd-triger.service';
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
import { FormGroup, FormBuilder } from '@angular/forms';
import { DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { UserService } from 'app/settings/service/user.service';
import { AwsService } from 'app/AwsService/aws.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { ReplaySubject } from 'rxjs';
@Component({
selector: 'app-completed-pd',
templateUrl: './completed-pd.component.html',
styleUrls: ['./completed-pd.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CompletedPdComponent implements OnInit, OnChanges {
xpandStatus: boolean = false;
PRODUCTS: any[]=[];
CITY: any[]=[];
ENTITY: any[]=[];
PDType: any[]=[];
pdStatus: any[]=[];
searchForm:FormGroup;
pipe = new DatePipe('en-US');
private notifier: NotifierService;
recordStatus: boolean;
errorMessage:any[]=[];
tabStatus:string="COMPLETED";
public dataLengthTab4: number;
public dataSourceTab4 = new MatTableDataSource();
displayedColumns = ['PDType','Name','Lenderid','Address','Status','Action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@Input() bindFilterValue: string;
@Output() loadPdView = new EventEmitter<string>();
// data source variable details
completedPdListData:any[] = [];
// pagination variable details
length = 5;
pageIndex = 0;
pageSize = 10;
pageEvent: any;
todaydate:Date = new Date();
user_role_name: string;
limitMsg: boolean = false;
common: any;
pagedList: ReplaySubject<any> = new ReplaySubject<any>(1);
user_id: any;
startIndex: any;
endIndex: any;
filtered_raw_data: any[];
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService,
private _aws:AwsService, private loaderService:LoaderService) {
this.notifier = notifier;
this.searchForm = this._fb.group(
{
pd_type:[null],
pd_status:['COMPLETED'],
pd_from_date:[null],
pd_to_date:[null],
date_type:['1'],
pd_city:[null],
pd_products:[null],
pd_lender:[null],
pd_name:[null],
pd_applicant_id:[null],
});
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings'))
if(this.common) {
this.common =this.common.default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
else{
setTimeout(()=>{
this.common = JSON.parse(localStorage.getItem('commonSettings'))
if(this.common) {
this.common =this.common.default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
},2000)
}
this.user_id = this._aws.getlocale();
}
ngOnInit() {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
// this.getcommonDropDown();
}
// get changes for filter from parent componnet filter
ngOnChanges(changes: SimpleChanges) {
// let filteredText = changes.bindFilterValue.currentValue;
let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue;
// filteredText = filteredText ? filteredText.trim() : filteredText;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
// this.dataSourceTab4.filter = filteredText;
this.filterData(filteredText)
}
// load inprogress pd list
public LenderRoleID : any = localStorage.getItem('LenderRoleID');
loadPDDetails() {
if(this.completedPdListData.length == 0) {
this.loaderService.showMatSpinnerDialog("Loading...")
}
this._pd.getTabStatusPdDetails(this.tabStatus,this.LenderRoleID)
.subscribe(
data => {
this.loaderService.closeMatSpinnerDialog();
if (data.status == 200) {
this.completedPdListData = data.records;
// this.dataLengthTab4 = data.records.length;
// this.dataSourceTab4.data = this.completedPdListData;
if(this.startIndex && this.endIndex) {
this.pagedList.next(this.completedPdListData.slice(this.startIndex, this.endIndex));
}
else {
this.pagedList.next(this.completedPdListData.slice(0, 10));
}
this.length = this.completedPdListData.length;
this.completedPdListData.forEach(value=>{
let original=value.pd_sno
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
})
this.recordStatus = false
this.limitMsg = true
}
else{
this.completedPdListData=[];
// this.dataSourceTab4.data =[]
// this.dataLengthTab4= null;
this.recordStatus=true;
this.limitMsg = false
}
}
// , error => this.errorMessage = <any> error);
,error => {
this.loaderService.closeMatSpinnerDialog();
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
});
}
OnPageChange(event: PageEvent){
this.startIndex = event.pageIndex * event.pageSize;
this.endIndex = this.startIndex + event.pageSize;
if(this.endIndex > this.length){
this.endIndex = this.length;
}
let raw_data = this.filtered_raw_data && this.filtered_raw_data.length > 0 ? this.filtered_raw_data : this.completedPdListData
this.pagedList.next(raw_data.slice(this.startIndex, this.endIndex));
}
pageChange(e) {
console.log(e);
}
viewPD(pdid:string,randomString){
console.log(pdid,randomString);
let pdidwithRandomString:any = {'id':pdid,'string': randomString};
// console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);
}
titleCaseWord(word:string) {
if (!word) return word;
return word[0].toUpperCase() + word.substr(1).toLowerCase();
}
/**
* Common Search
* sriram
*/
getcommonDropDown(): void
{
this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=>
{
if(res.dataStatus==true)
{
this.pdStatus = res.records.filter(status=>status.isactive==1 && status.pd_status_name==this.tabStatus);
// this.searchForm.controls['pd_status'].setValue(this.pdStatus[0]);
}
});
this._pd.getAllMasterDatas('PDTYPE').subscribe(res=>
{
if(res.dataStatus==true)
{
this.PDType = res.records.filter(type=>type.isactive==1);
}
});
// this._pd.getAllMasterDatas('CITY').subscribe(res=>
// {
// if(res.dataStatus==true)
// {
// this.CITY = res.records.filter(city=>city.isactive==1);
// }
// });
this._pd.getListOfCities().subscribe(res=>
{
if(res.dataStatus==true)
{
this.CITY = res.records;
}
});
this._pd.getAllMasterDatas('ENTITY').subscribe(res=>
{
if(res.dataStatus==true)
{
this.ENTITY = res.records.filter(ent=>ent.isactive==1);
}
});
this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=>
{
if(res.dataStatus==true)
{
this.PRODUCTS = res.records.filter(pro=>pro.isactive==1);
}
});
}
checkDate(e)
{
console.log(e);
}
searchItem()
{
if(this.searchForm.value.pd_type !=null)
{
}else
{
this.searchForm.value.pd_type = [];
}
if(this.searchForm.value.pd_status !=null)
{
}else
{
this.searchForm.value.pd_status = [];
}
this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd');
this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd');
let dt =this.searchForm.value.date_type;
let ldt: number = +dt;
this.searchForm.value.date_type=ldt;
console.log(this.searchForm.value);
this._pd.overAllSearchFormDetails(this.searchForm.value).subscribe(res=>
{
this.xpandStatus = false;
if(res['dataStatus']==true)
{
this.completedPdListData=res['records'];
// this.dataSourceTab4.data = res['records'];
// this.dataSourceTab4.paginator = this.paginator;
this.pagedList .next(this.completedPdListData.slice(0, 10));
this.length = this.completedPdListData.length;
this.completedPdListData.forEach(value=>{
let original=value.pd_sno
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
})
this.recordStatus=false;
this.limitMsg = false
}else{
this.notifier.notify('warning', 'No Records Found !');
// this.dataSourceTab4.paginator['length'] = 0;
// this.dataSourceTab4.paginator['pageIndex'] = 0;
// this.dataSourceTab4.data = [];
// this.completedPdListData = [];
this.pagedList.next([]);
this.recordStatus=true
this.limitMsg = false
}
},error => {
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Went Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
});
}
filterData(text) {
if(!text) {
setTimeout(()=>{
this.filtered_raw_data = []
this.pagedList .next(this.completedPdListData.slice(0, 10));
},0)
this.length = this.completedPdListData.length;
return
}
let temp = this.completedPdListData.filter(v=>{
if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1
|| v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1
||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) {
return true;
}
return false
})
setTimeout(()=>{
console.log(temp)
this.filtered_raw_data = temp
this.length = this.filtered_raw_data.length
this.pagedList.next(temp.slice(0, 10))
},0)
// this.pa
// this.length = this.pagedList.length
// console.log(this.PdListData,this.pagedList,text)
}
onReset(){
this.searchForm.reset();
this.searchForm.controls['date_type'].setValue('1');
this.loadPDDetails();
this.xpandStatus = false;
}
ngAfterViewInit() {
this.dataSourceTab4.paginator = this.paginator;
this.dataSourceTab4.sort = this.sort;
}
}

View File

@ -0,0 +1,120 @@
<form [formGroup]="_EditApplicantForm">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content>
<mat-card>
<mat-card-header>
<mat-card-title>Applicant 1</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="applicant_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 65%">
<!-- <input matInput placeholder="Name of Individual Applicant" formControlName="applicant_name"
[value]="pdMainApplicant.applicant_name.value | titlecase" required> -->
<input matInput placeholder="Name of Individual Applicant" formControlName="applicant_name" required>
</mat-form-field>
<mat-form-field style="width: 40%" *ngIf="CSAbbr != 'SE-RI'">
<input matInput [placeholder]="CSAbbr == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" ForMobileNumbers>
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('maxlength') || pdMainApplicant.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput placeholder="STD Code" formControlName="stdcode" type="text" maxlength="5" ForMobileNumbers>
<!-- <span matPrefix>+91</span> -->
<mat-error *ngIf="pdMainApplicant.stdcode.hasError('maxlength') || pdMainApplicant.stdcode.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
<mat-form-field style="width: 60%">
<input matInput placeholder="LandLine Number" formControlName="landline" maxlength="8" type="text" ForMobileNumbers>
<mat-error *ngIf="pdMainApplicant.landline.hasError('maxlength') || pdMainApplicant.landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
</mat-card-content>
</mat-card>
<mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
<mat-card-header>
<mat-card-title>Applicant {{i+2}}</mat-card-title>
</mat-card-header>
<mat-card-content [formGroupName]="i">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="applicant_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 65%">
<input matInput placeholder="Name of Individual Applicant" formControlName="coapplicantName" type="text" required>
</mat-form-field>
<mat-form-field style="width: 40%" *ngIf="CSAbbr != 'SE-RI'">
<input matInput [placeholder]="CSAbbr == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" minlength="10" ForMobileNumbers>
<mat-error *ngIf=" coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<!-- <mat-form-field style="width: 40%" >
<input matInput placeholder="LandLine Number" formControlName="coapplicant_landline" type="text" OnlyNumber>
<mat-error *ngIf=" coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field> -->
<mat-form-field style="width: 15%">
<input matInput placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" maxlength="5" ForMobileNumbers>
<!-- <span matPrefix>+91</span> -->
<mat-error *ngIf="coDetails['controls'].coapplicant_stdcode.hasError('maxlength') || coDetails['controls'].coapplicant_stdcode.hasError('minlength')">Enter Valid STD Number. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
<mat-form-field style="width: 60%">
<input matInput placeholder="LandLine Number" formControlName="coapplicant_landline" type="text" maxlength="8" ForMobileNumbers>
<mat-error *ngIf="coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
<!-- <mat-form-field style="width: 82%">
<mat-select placeholder="Relationship With Main Applicant" formControlName="relationship">
<mat-option>Select</mat-option>
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
{{rel.name}}
</mat-option>
</mat-select>
</mat-form-field> -->
</mat-card-content>
</mat-card>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1" matTooltip="Add More Co-Applicant" matTooltipPosition="above" color="primary" type="button" (click)="addCoApplicant(emptyData)"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="updatePdApplicant(_EditApplicantForm.value)"><mat-icon>save</mat-icon></button>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

View File

@ -0,0 +1,8 @@
mat-form-field {
margin: 0 2%;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
// padding: 10px !important;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EditPdApplicantComponent } from './edit-pd-applicant.component';
describe('EditPdApplicantComponent', () => {
let component: EditPdApplicantComponent;
let fixture: ComponentFixture<EditPdApplicantComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EditPdApplicantComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EditPdApplicantComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,339 @@
import { Component, OnInit,ViewEncapsulation, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { CustomValidators } from 'ng2-validation';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { TitleCasePipe } from '@angular/common';
@Component({
selector: 'app-edit-pd-applicant',
templateUrl: './edit-pd-applicant.component.html',
styleUrls: ['./edit-pd-applicant.component.scss'],
providers:[TitleCasePipe],
encapsulation: ViewEncapsulation.None,
})
export class EditPdApplicantComponent implements OnInit {
public pageTitle: string = "Applicant Details";
errorMessage: any;
public _EditApplicantForm:FormGroup;
public notifier: NotifierService;
mainApplicantData: any[];
coApplicantData: any[];
coApplicantItems:FormArray;
emptyData:any;
relationShipList:any;
titleList: any;
CSAbbr:any;
disableAfterSubmit: boolean;
constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService, private dialogRef: MatDialogRef<EditPdApplicantComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) {
this.notifier=notifier;
this.disableAfterSubmit = false;
}
ngOnInit() {
this.CSAbbr = this.data.SegmentAbbr != '' ? this.data.SegmentAbbr != null ? this.data.SegmentAbbr : '' :'' ;
if(this.data.records.length>0){
this.mainApplicantData= this.data.records.filter(item => item.applicant_type == 1);
this.coApplicantData= this.data.records.filter(item => item.applicant_type == 0);
this.loadApplicantFormData();
}
else{
this.loadEmptyFormData()
}
this.getRelationMaster();
this.getTitleMaster();
}
loadEmptyFormData() {
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [null],
applicant_name: [null, Validators.compose([Validators.required])],
mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
stdcode: [null, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
landline: [null, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
company_name: [null],
applicant_type: [1],
coApplicantItems: this._fb.array([]),
});
}
loadApplicantFormData() {
let stdcode;
let landline;
if(this.mainApplicantData[0].landline != null){
let stdcodesearch = this.mainApplicantData[0].landline.search("-");
stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch) ;
landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8) ;
}else{
stdcode = '';
landline = '';
}
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
applicant_name: [this.titleCase.transform(this.mainApplicantData[0].applicant_name), Validators.compose([Validators.required])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
company_name: [this.mainApplicantData[0].company_name],
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
applicant_title_name: [this.mainApplicantData[0].applicant_title_name, Validators.compose([Validators.required])],
coApplicantItems: this._fb.array([]),
});
// bind dynamic co applicant data
if(this.coApplicantData.length > 0){
for(let value of this.coApplicantData){
this.addCoApplicant(value);
}
}
}
createItem(listData): FormGroup {
if(listData){
let stdcode;
let landline;
if(listData.landline != null){
let stdcodesearch = listData.landline.search("-");
stdcode = listData.landline.substr(0,stdcodesearch);
landline = listData.landline.substr(+stdcodesearch + 1,8);}
else{
stdcode = '';
landline = '';
}
return this._fb.group({
label: ['Co Applicant'],
fk_applicant_primary_id: [listData.pd_co_applicant_id],
applicant_title_name: [listData.applicant_title_name, Validators.compose([Validators.required])],
coapplicantName: [this.titleCase.transform(listData.applicant_name), Validators.compose([Validators.required])],
coapplicant_mobile_no: [listData.mobile_no,Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
coapplicant_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
// landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
coapplicant_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
// relationship: [listData.relation],
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
company_name: [listData.company_name],
});
}
else{
return this._fb.group({
label: ['Co Applicant'],
fk_applicant_primary_id: [null],
applicant_title_name: [null, Validators.compose([Validators.required])],
coapplicantName: [null, Validators.compose([Validators.required])],
coapplicant_mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
coapplicant_stdcode: [null, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
coapplicant_landline: [null,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
//coapplicant_landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
// relationship: [null],
applicant_type: [0],
company_name: [null],
});
}
};
addCoApplicant(listData) {
if(this._EditApplicantForm.valid){
this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray;
this.coApplicantItems.push(this.createItem(listData));
}
else if(!listData){
this.notifier.notify("info","Please Fill all the fields")
}
}
get pdMainApplicant() { return this._EditApplicantForm.controls; }
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
updatePdApplicant(formValue: any) {
if(this._EditApplicantForm.invalid) {
this.validateAllFormFields(this._EditApplicantForm);
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
else {
if(this.data.lender_short_name != 'MWISE' && (formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else if(this.data.lender_short_name != 'MWISE' && formValue.mobile_no.length != 10){
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
return;
}
else{
let concat_landline1
// if(formValue.stdcode != null && formValue.landline != null){
// if(formValue.stdcode == '' && formValue.landline == ''){
// concat_landline1 = null;
// }else {
// let std = formValue.stdcode == '' ? '' : formValue.stdcode;
// let landline = formValue.landline == '' ? '' : formValue.landline;
// concat_landline1 = std+'-'+landline;
// }
// }
// else if(formValue.stdcode == '' && formValue.landline == ''){
// concat_landline1 = null;
// }else{
// concat_landline1 = null;
// }
if(!formValue.stdcode || !formValue.landline){
concat_landline1 = null;
}
else if(!formValue.stdcode && !formValue.landline){
concat_landline1 = null;
}
else if(formValue.stdcode && formValue.landline){
let std = formValue.stdcode == '' ? '' : formValue.stdcode;
let landline = formValue.landline == '' ? '' : formValue.landline;
concat_landline1 = std+'-'+landline;
}
else{
concat_landline1 = null;
}
let pd_applicant_details : any=[{
"fk_pd_id": this.data.pdID,
"pd_co_applicant_id": formValue.fk_applicant_primary_id,
"applicant_name":this.titleCase.transform(formValue.applicant_name),
"company_name":formValue.company_name,
"mobile_no":formValue.mobile_no,
"landline":concat_landline1,
"applicant_type":formValue.applicant_type,
// "relation":formValue.relationship,
"applicant_title_name": formValue.applicant_title_name,
"isactive":1
}];
formValue.coApplicantItems.forEach((itemElement, itemIndex) => {
let concat_landline
// if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){
// if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
// concat_landline = null;
// }else{
// let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode;
// let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline;
// concat_landline = std+'-'+landline;
// }
// }else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
// concat_landline = null;
// }else{
// concat_landline = null;
// }
if(!itemElement.coapplicant_stdcode || !itemElement.coapplicant_landline){
concat_landline = null;
}
else if(!itemElement.coapplicant_stdcode && !itemElement.coapplicant_landline){
concat_landline = null;
}
else if(itemElement.coapplicant_stdcode && itemElement.coapplicant_landline){
let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode;
let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline;
concat_landline = std+'-'+landline;
}
else{
concat_landline = null;
}
let obj1 = {
"fk_pd_id": this.data.pdID,
"pd_co_applicant_id": itemElement.fk_applicant_primary_id,
"applicant_title_name":itemElement.applicant_title_name,
"applicant_name":this.titleCase.transform(itemElement.coapplicantName),
// "relation":itemElement.relationship,
"mobile_no":itemElement.coapplicant_mobile_no,
"landline":concat_landline,
"applicant_type":itemElement.applicant_type,
"company_name":itemElement.company_name,
"isactive":1
}
pd_applicant_details.push(obj1)
});
// FOR MOBILE NUMBER CHECK FOR MWISE LENDER -- ATLEAST ONE NUMBER TO BE PROVIDED FOR MWISE
if(this.data.lender_short_name == 'MWISE') {
let mobile_number_check = pd_applicant_details.filter(vv=>vv.mobile_no != '' && vv.mobile_no != null)
console.log(mobile_number_check)
if(mobile_number_check == 0 || mobile_number_check == -1) {
// this.applicant_details_element.nativeElement.scrollIntoView({'behaviour':'smooth'})
this.notifier.notify("info", "Please provide atleast 1 Mobile Number")
return;
}
}
this.disableAfterSubmit = true;
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
if (result.status == 200) {
this.disableAfterSubmit = false;
this.notifier.notify('success', 'PD Details Updated.');
this.dialogRef.close();
}
else {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
});
}
}
}
// get relation master details
getRelationMaster(){
let relation ="RELATIONSHIPS";
this._pd.getAllMasterDatas(relation).subscribe(
data => {
if (data.status == 200) {
this.relationShipList=data.records;
}
}, error => this.errorMessage = <any> error);
}
// get title master
getTitleMaster() {
let relation ="TITLES";
this._pd.getAllMasterDatas(relation).subscribe(
data => {
if (data.status == 200) {
this.titleList=data.records.filter(val=>val.isactive==1);
}
}, error => this.errorMessage = <any> error);
}
/** To Reset Popup Data */
onReset() {
this.disableAfterSubmit = false;
if(this.data.records.length>0){
this.loadApplicantFormData();
}
else{
this.loadEmptyFormData();
}
}
/** For Popup Close Button */
closeEditComponent(): void {
this.dialogRef.close();
}
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control);
}
});
}
}

View File

@ -0,0 +1,307 @@
<form [formGroup]="_EditPDtriggerForm" novalidate *ngIf="loadControl">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
matTooltipPosition="right" mat-dialog-close>
<mat-icon>close</mat-icon>
</button>
</div>
</h2>
<mat-dialog-content>
<mat-card>
<!-- <mat-card-header>
<mat-card-title>PD Details</mat-card-title>
</mat-card-header> -->
<mat-card-content>
<mat-form-field style="width: 29%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson();getProCusType($event.value,true)">
<mat-option>
Select
</mat-option>
<!-- <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > -->
<mat-option (click)="selectedLender(LL)" *ngFor="let LL of lenderList"
[value]="LL.entity_id">
{{LL.full_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 29%">
<mat-select placeholder="Case Booked In" formControlName="sub_entity_id">
<mat-option>
Select
</mat-option>
<!-- <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > -->
<mat-option *ngFor="let LL of billingtolist"
[value]="LL.entity_id">
{{LL.full_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id" >
{{LB.branch_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 29%">
<input matInput placeholder=" Loan Application ID" formControlName="lender_applicant_id"
type="text">
</mat-form-field>
<!-- <div *ngIf="sales_and_credit_enable"> -->
<mat-form-field style="width: 28%" *ngIf="userDetails.short_name != 'IIB'">
<mat-select placeholder="Lender Sales Person" formControlName="lender_sales_person">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of sales_and_credit_person.sales_person" [value]="person.userid">{{person.user_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-select placeholder="Lender Credit Person" formControlName="lender_credit_person">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of sales_and_credit_person.credit_person" [value]="person.userid">{{person.user_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%" *ngIf="sales_and_credit_enable">
<!-- <input matInput autocomplete="off" placeholder="Financial Institution" formControlName="imgc_fin_institute"> -->
<!-- <input matInput autocomplete="off" placeholder="Financial Institution" formControlName="imgc_fin_institute"> -->
<mat-select placeholder="Financial Institution" formControlName="imgc_fin_institute">
<mat-option>Select</mat-option>
<mat-option *ngFor="let insti of finInstitutionList" [value]="insti.entity_fin_institution_id">{{insti.institute_name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- </div> -->
<!-- <mat-form-field style="width: 28%">
<input matInput placeholder="Lender Contact Person" formControlName="pd_contact_person"
type="text" >
</mat-form-field>
<mat-form-field style="width: 23%">
<input matInput placeholder="Lender Mobile Number" formControlName="pd_contact_mobileno"
type="text" maxlength="10" ForMobileNumbers>
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter
Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 10%">
<input matInput placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5"
ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter
Valid STD Code. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
<mat-form-field style="width: 15%">
<input matInput placeholder="LandLine Number" formControlName="lender_landline"
type="text" maxlength="8" ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter
Valid Landline Number. </mat-error>
</mat-form-field> -->
<!-- <span matPrefix>+91</span> -->
<!-- <mat-form-field style="width: 21.5%">
<mat-select placeholder="Branch" formControlName="pd_branch_id"> -->
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<!-- <mat-option>
Select
</mat-option>
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id">
{{LB.branch_name}}
</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field style="width: 29%">
<mat-select placeholder="Product Name" formControlName="fk_product_id"
(selectionChange)="getSubproductList(pdMain.fk_product_id.value,2)">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PL of productList" [value]="PL.product_id">
{{PL.product_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field>
<!-- <mat-form-field style="width: 29%"> -->
<mat-form-field *ngIf="isSubproductShown" style="width: 29%">
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option>
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id">
{{SPL.subproduct_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 29%" *ngIf="isCustomerSegmentShown">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-option>Select</mat-option>
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id">
<!-- {{CSL.customer_segment}} -->{{CSL.abbr}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</mat-form-field>
<!-- <mat-form-field style="width: 29%">
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
<mat-option>Select</mat-option>
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id">
{{PDL.type_name}}
</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field style="width: 62%">
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
<input matInput placeholder="Loan Amount" formControlName="loan_amount"
OnlyNumber required
autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value != ''">{{"&#8377;"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount.
</mat-error>
</mat-form-field>
<br>
<br>
<div class="radio-gap" style="width: 25% ;padding-left: 30px;" *ngIf="lenderShortName == 'MWISE'" >
<mat-label>Is this Tele PD ?</mat-label>
<mat-slide-toggle color="primary" style="float: right;" [checked]="_EditPDtriggerForm.controls['fk_pd_type'].value == '3' ? true : false"
(change)="changePDTypeSlideValue($event)" >
</mat-slide-toggle>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</div>
</mat-card-content>
</mat-card>
<div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index; let last = last">
<mat-card [formGroupName]="i">
<mat-card-header>
<mat-card-title>Address Details #{{i+1}} <span *ngIf="!addressesDeactivited[i]" style="color: red;" align="end"><i> Deactivited </i></span> </mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 96%">
<textarea matInput autocomplete="off" placeholder="Address at which PD is to be done"
formControlName="addressline1" [value]="addresses.get('addressline1').value | titlecase"></textarea>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="State" formControlName="fk_state"
(selectionChange)="getCityList($event.value,i)">
<mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(addresses,i,'state')"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option> Select </mat-option>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="City" formControlName="fk_city">
<mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(addresses,i,'city')"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option> Select </mat-option>
<mat-option *ngFor="let CL of cityList[i]" [value]="CL.city_id">
{{CL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 24%">
<mat-select placeholder="Pincode" formControlName="pincode"
(selectionChange)="getPincode($event.value,i)">
<mat-option>
<ngx-mat-select-search formControlName="pinSearch" (keyup)="searchFun(addresses,i,'pin')"
[placeholderLabel]="'Search Pincode...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option>
<mat-option *ngFor="let PL of pincodeList[i]" [value]="PL.pincode_id">{{PL.pincode}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 24%" *ngIf="pincodeflag[i]">
<!-- *ngIf="pdAddresses.pincode.value == 1" -->
<input matInput autocomplete="off" placeholder="Specify Pincode"
formControlName="other_pincode" OnlyNumber>
<!-- <mat-error *ngIf="pdAddresses.other_pincode.hasError('maxlength') || pdMain.other_pincode.hasError('minlength')">Enter Valid Pincode. </mat-error> -->
</mat-form-field>
</mat-card-content>
<mat-card-actions align="end">
<button mat-raised-button mat-icon-button matTooltip="Delete"
matTooltipPosition="above" (click)="removeAddresses(i,'Deactivited')"
type="button" *ngIf="pdAddresses.controls.length > 1 && addressesDeactivited[i]">
<mat-icon>delete</mat-icon>
</button>
<button type="button" mat-flat-button (click)="removeAddresses(i,'Activited')"
matTooltipPosition="above" color="primary" *ngIf="!addressesDeactivited[i]">
<strong>Deleted</strong>
</button>
&nbsp;&nbsp;
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses(i)" *ngIf="last"
matTooltip="Add More Additional Addresses" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</mat-card>
</div>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="70" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="30" align="end">
<!-- <button *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button> -->
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Trigger PD" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save PD"
matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value,'')" [disabled]="disableAfterSubmit===true">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

Some files were not shown because too many files have changed in this diff Show More