diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index 31f7995ee..7119b427d 100644 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -4273,8 +4273,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -4295,14 +4294,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4317,20 +4314,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -4447,8 +4441,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -4460,7 +4453,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4475,7 +4467,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4483,14 +4474,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -4509,7 +4498,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -4590,8 +4578,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -4603,7 +4590,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -4689,8 +4675,7 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -4726,7 +4711,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4746,7 +4730,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4790,14 +4773,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -9991,6 +9972,11 @@ "has-flag": "^3.0.0" } }, + "sweetalert2": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-7.28.4.tgz", + "integrity": "sha512-HEAfIAPactjB8CvgsJClxT+6wv2OGh/KkgvgJ8xR28uAXtx9BUQAlws1mruaS7Jzn8gIt6esx4BEZLaZSGvBZw==" + }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -11377,4 +11363,4 @@ "integrity": "sha512-W9Nj+UmBJG251wkCacIkETgra4QgBo/vgoEkb4a2uoLzpQG7qF9nzwoLXWU5xj3Fg2mxGvEDh47mg24vXccYjA==" } } -} \ No newline at end of file +} diff --git a/ng6-seed/package.json b/ng6-seed/package.json index 299250298..77f4ff8ef 100644 --- a/ng6-seed/package.json +++ b/ng6-seed/package.json @@ -60,6 +60,7 @@ "screenfull": "^3.2.2", "simple-line-icons": "^2.4.1", "sortablejs": "^1.6.0", + "sweetalert2": "^7.28.4", "tether": "^1.4.0", "zone.js": "^0.8.26" }, diff --git a/ng6-seed/src/app/AwsService/aws.service.ts b/ng6-seed/src/app/AwsService/aws.service.ts index 221bb775c..36ddffe86 100755 --- a/ng6-seed/src/app/AwsService/aws.service.ts +++ b/ng6-seed/src/app/AwsService/aws.service.ts @@ -223,12 +223,12 @@ export class AwsService { let params: any; if (userGroup == 'ADMIN') { console.log(userdata); - if (userdata.fk_entity_id == 1) { + if (userdata.fk_entity_type_id == 1) { params = { UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ Username: awsName /* required */ }; - } else if (userdata.fk_entity_id == 2) { + } else if (userdata.fk_entity_type_id == 2) { params = { UserPoolId: lender_poolData.UserPoolId, /* required */ Username: awsName /* required */ @@ -253,7 +253,7 @@ export class AwsService { adminenableUser(userdata, awsName) { let session:any = this.shared.getAccessToken() || ""; // this.getconfig(); - + console.log(userdata); let config = ""; AWS.config.region = "ap-south-1"; AWS.config.credentials = new AWS.CognitoIdentityCredentials({ @@ -271,13 +271,13 @@ export class AwsService { //cognitosdata = 7; let params: any; if (userGroup == 'ADMIN') { - console.log(userdata); - if (userdata.fk_entity_id == 1) { + + if (userdata.fk_entity_type_id == 1) { params = { UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ Username: awsName /* required */ }; - } else if (userdata.fk_entity_id == 2) { + } else if (userdata.fk_entity_type_id == 2) { params = { UserPoolId: lender_poolData.UserPoolId, /* required */ Username: awsName /* required */ @@ -308,7 +308,7 @@ export class AwsService { )[0]; // (userGroup); if (userGroup == "ADMIN") { - if (userData.type.entity_type_id == 1) { + if (userData.type.fk_entity_type_id == 1) { params = { UserPoolId: sineedgedev_poolData.UserPoolId /* required */, Username: userData.email /* required */, @@ -331,7 +331,7 @@ export class AwsService { /* more items */ ] }; - } else if (userData.type.entity_type_id == 2) { + } else if (userData.type.fk_entity_type_id == 2) { console.log(2); params = { UserPoolId: lender_poolData.UserPoolId /* required */, @@ -355,7 +355,7 @@ export class AwsService { /* more items */ ] }; - }else if(userData.type.entity_type_id == 3){ + }else if(userData.type.fk_entity_type_id == 3){ params = { UserPoolId: vendor_poolData.UserPoolId /* required */, Username: userData.email /* required */, @@ -409,7 +409,7 @@ export class AwsService { //console.log(cognitodata); - + console.log(userData); this.getconfig(); //let cognitodata = "539bfefa-ae42-4bee-bf79-4b15d1a2af7f"; @@ -418,13 +418,20 @@ export class AwsService { 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 */ + }; + } //(params); return Observable.create(observe=>{ @@ -466,7 +473,7 @@ export class AwsService { //cognitosdata = 7; let params:any; if (userGroup == 'ADMIN') { - if(user.type.entity_type_id ==1){ + if(user.type.fk_entity_type_id ==1){ params = { UserAttributes: [ /* required */ { @@ -484,7 +491,7 @@ export class AwsService { UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ Username: user.email /* required */ }; - }else if(user.type.entity_type_id ==2){ + }else if(user.type.fk_entity_type_id ==2){ params = { UserAttributes: [ /* required */ { @@ -558,6 +565,24 @@ export class AwsService { 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 + } + /* 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 */, @@ -581,34 +606,34 @@ export class AwsService { }) } } -adminremoveGroup(roles,users){ - console.log(roles); - console.log(users); - if(users !==undefined){ +// 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_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 - }); -} -} +// 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(); diff --git a/ng6-seed/src/app/app.routing.ts b/ng6-seed/src/app/app.routing.ts index deeef0a53..5eefaa6c7 100644 --- a/ng6-seed/src/app/app.routing.ts +++ b/ng6-seed/src/app/app.routing.ts @@ -20,8 +20,8 @@ export const AppRoutes: Routes = [{ loadChildren:'./settings/settings.module#SettingsModule' } ,{ - path:'pdtrigger', - loadChildren:'./pd-triger/pd-triger.module#PdTrigerModule' + path:'personal_discussion', + loadChildren:'./personal-discussion/personal-discussion.module#PersonalDiscussionModule' },{ path:'template', loadChildren:'./template/template.module#TemplateModule' diff --git a/ng6-seed/src/app/dashboard/dashboard.component.html b/ng6-seed/src/app/dashboard/dashboard.component.html index 6b07abff7..d02b0aefb 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.html +++ b/ng6-seed/src/app/dashboard/dashboard.component.html @@ -1,5 +1,171 @@
-

- Dashboard! -

+
+
+ +
+
+

PD Triggered

+
+
+
+

Full PD

+

13

+
+
+

Smart PD

+

13

+
+
+
+
+
+
+ +
+
+

PD Allocated

+
+
+
+

Full PD

+

33

+
+
+

Smart PD

+

5

+
+
+
+
+
+
+ +
+
+

PD Scheduled

+
+
+
+

Full PD

+

20

+
+
+

Smart PD

+

6

+
+
+
+
+
+
+ +
+
+ +
+
+

PD Progress

+
+
+
+

Full PD

+

34

+
+
+

Smart PD

+

9

+
+
+
+
+
+
+ +
+
+

PD Completed

+
+
+
+

Full PD

+

65

+
+
+

Smart PD

+

24

+
+
+
+
+
+
+ +
+
+

QC Completed

+
+
+
+

Full PD

+

47

+
+
+

Smart PD

+

29

+
+
+
+
+
+
+ +
+
+ + Lender + PD Triggered Today +
+ + + +

{{item.lendername}} / {{item.billingaddr}}

+

Full PD -{{item.fullpd}} / Smart PD -{{item.smartpd}}

+
+
+
+
+
+
+ + Citywise + PD Triggered Today +
+ + + +

{{item.cityname}}

+

Full PD -{{item.fullpd}} / Smart PD -{{item.smartpd}}

+
+
+
+
+
+
+ + Information + PD In Same Status +
+ + + + +

{{item.applicantname}}

+

{{item.applicantid}}

+

{{item.lendername}} - {{item.status}}

+
+
+
+
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/dashboard/dashboard.component.ts b/ng6-seed/src/app/dashboard/dashboard.component.ts index de294a8f4..d22f38292 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.ts +++ b/ng6-seed/src/app/dashboard/dashboard.component.ts @@ -9,4 +9,57 @@ export class DashboardComponent { constructor() { } + //Lender wise PD Triggered + lenderpd: Object[] = [{ + lendername:'ICICI', + billingaddr:'Bangalore', + fullpd:'9', + smartpd:'6', + }, { + lendername:'IOB', + billingaddr:'Chennai', + fullpd:'10', + smartpd:'5', + }, { + lendername:'SBI', + billingaddr:'Pune', + fullpd:'16', + smartpd:'3', + }, ]; + + //City Wise PD Triggered + citywisepd: Object[] = [{ + cityname: 'Bangalore', + fullpd:'45', + smartpd:'17', + }, { + cityname: 'Chennai', + fullpd:'33', + smartpd:'16', + }, { + cityname: 'Salem', + fullpd:'22', + smartpd:'12', + }, ]; + + //Same status + message: Object[] = [{ + applicantname: 'Saravana', + applicantid:'ICICITN0118000354', + lendername:'ICICI', + status:'Allocated', + photo: 'assets/images/face3.jpg', + }, { + applicantname: 'Kumaran', + applicantid:'IOBKA0418000578', + lendername:'IOB', + status:'Allocated', + photo: 'assets/images/face6.jpg', + }, { + applicantname: 'Priya', + applicantid:'SBIGA0118000241', + lendername:'SBI', + status:'Triggered', + photo: 'assets/images/face4.jpg', + }, ]; } diff --git a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html b/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html deleted file mode 100644 index 198e3fb58..000000000 --- a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html +++ /dev/null @@ -1,75 +0,0 @@ - -
- - -
-
- -
Main Applicant
- - - - - Name is required. - - - - - Email number is required. - - - - - - Mobile number is required. - - - -
-
-
-
-
- - -
{{coDetails.controls.label.value}} {{i+1}}
- -
- - - - - - - - - - - - - -
-
-
-
-
- -
- - - - -
-
- -
- - - - -
-
- - - \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.ts deleted file mode 100644 index 7d42232cf..000000000 --- a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core'; -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'; -@Component({ - selector: 'app-edit-pd-applicant', - templateUrl: './edit-pd-applicant.component.html', - styleUrls: ['./edit-pd-applicant.component.scss'], - encapsulation: ViewEncapsulation.None, -}) -export class EditPdApplicantComponent implements OnInit { - errorMessage: any; - @Input() applicantChild: any; - @Output() loadPdView = new EventEmitter(); - public _EditApplicantForm:FormGroup; - public notifier: NotifierService; - mainApplicantData: any[]; - coApplicantData: any[]; - coApplicantItems:FormArray; - emptyData:any; - constructor(private _fb: FormBuilder, - private _pd: PdTrigerService, notifier: NotifierService,) { - this.notifier=notifier - } - - ngOnInit() { - this.mainApplicantData= this.applicantChild.filter(item => item.applicant_type == 1); - this.coApplicantData= this.applicantChild.filter(item => item.applicant_type == 0); - this.loadApplicantFormData(); - } - loadApplicantFormData() { - this._EditApplicantForm = this._fb.group({ - fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], - applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])], - mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required])], - email: [this.mainApplicantData[0].email, Validators.compose([Validators.required, CustomValidators.email])], - applicant_type: [this.mainApplicantData[0].applicant_type, 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){ - return this._fb.group({ - label: ['Co Applicant'], - fk_applicant_primary_id: [listData.pd_co_applicant_id], - coapplicantName: [listData.applicant_name, Validators.compose([Validators.required])], - coapplicant_mobile_no: [listData.mobile_no], - relationship: [listData.relation], - applicant_type: [listData.applicant_type, Validators.compose([Validators.required])], - }); - } - else{ - return this._fb.group({ - label: ['Co Applicant'], - fk_applicant_primary_id: [null], - coapplicantName: [null, Validators.compose([Validators.required])], - coapplicant_mobile_no: [], - relationship: [null], - applicant_type: [0], - }); - } - - }; - addCoApplicant(listData) { - if(this._EditApplicantForm.valid){ - this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray; - this.coApplicantItems.push(this.createItem(listData)); - } - } - get pdMainApplicant() { return this._EditApplicantForm.controls; } - get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; } - updatePdApplicant(formValue: any) { - if(this._EditApplicantForm.valid){ - let pd_applicant_details : any=[{ - "fk_pd_id": this.mainApplicantData[0].fk_pd_id, - "pd_co_applicant_id": formValue.fk_applicant_primary_id, - "applicant_name":formValue.applicant_name, - "email":formValue.email, - "mobile_no":formValue.mobile_no, - "applicant_type":formValue.applicant_type, - "relation":formValue.relationship, - "isactive":1 - }]; - formValue.coApplicantItems.forEach((itemElement, itemIndex) => { - let obj1 = { - "fk_pd_id": this.mainApplicantData[0].fk_pd_id, - "pd_co_applicant_id": itemElement.fk_applicant_primary_id, - "applicant_name":itemElement.coapplicantName, - "relation":itemElement.relationship, - "email":"", - "mobile_no":itemElement.coapplicant_mobile_no, - "applicant_type":itemElement.applicant_type, - "isactive":1 - } - pd_applicant_details.push(obj1) - }); - - this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => { - if (result.status == 200) { - this.notifier.notify('success', 'Applicants updated..'); - this.loadPdMasterCompoent(); - } - else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - }); - } - } - loadPdMasterCompoent() { - this.loadPdView.emit('2') - } -} diff --git a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html deleted file mode 100644 index b1145bcb8..000000000 --- a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html +++ /dev/null @@ -1,117 +0,0 @@ - -
- -
-
-
-
- - - - {{LL.full_name}} - - - Lender name is required. - - - - - Applicant id is required. - - - - - {{PL.product_name}} - - - Product is required. - - - - - - - {{SPL.subproduct_name}} - - - - Sub product is required. - - - - - - {{CSL.customer_segment}} - - - Customer segment is required. - - - - - {{PDL.type_name}} - - - - PD type is required. - - - - - Amount is required. - - - - - Address1 required. - - - - - - - - - - - - - - {{SL.state_name}} - - - - State is required. - - - - - ` - {{CL.city_name}} - - - - City is required. - - - - - - Pincode is required. - - - -
- -
-
- - -
- - - - -
-
diff --git a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts deleted file mode 100644 index 9ed6604ac..000000000 --- a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core'; -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'; -@Component({ - selector: 'app-edit-pd-master', - templateUrl: './edit-pd-master.component.html', - styleUrls: ['./edit-pd-master.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class EditPdMasterComponent implements OnInit { - errorMessage: any; - productList:any; - subProductList:any; - lenderList:any; - customerSegmentList:any; - stateList:any; - cityList:any; - pdTypeList:any; - @Input() masterChild: any; - @Output() loadPdView = new EventEmitter(); - public _EditPDtriggerForm:FormGroup; - public notifier: NotifierService; - constructor(private _fb: FormBuilder, - private _pd: PdTrigerService, notifier: NotifierService,) { - this.notifier=notifier - } - - ngOnInit() { - this.getLenderList(); - this.getProductsList(); - this.getCustomerSegmentList(); - this.getStateCityList(); - this.getPDTypeList(); - this.loadFormData(); - } - - getLenderList(){ - this._pd.getLenderDetails().subscribe( - data => { - if (data.status == 200) { - this.lenderList=data.records - } - }, error => this.errorMessage = error); - } - getProductsList(){ - this._pd.getProductsDetails().subscribe( - data => { - if (data.status == 200) { - this.productList=data.records - this.getSubproductList(this.masterChild.fk_product_id); - - } - }, error => this.errorMessage = error); - } - getCustomerSegmentList(){ - this._pd.getCustomersDetails().subscribe( - data => { - if (data.status == 200) { - this.customerSegmentList=data.records - } - }, error => this.errorMessage = error); - } - getStateCityList(){ - this._pd.getStateCityDetails().subscribe( - data => { - if (data.status == 200) { - this.stateList=data.records - this.getCityList(this.masterChild.fk_state); - } - }, error => this.errorMessage = error); - } - getPDTypeList(){ - this._pd.getPDTypeDetails().subscribe( - data => { - if (data.status == 200) { - this.pdTypeList=data.records.pd_type; - - } - }, error => this.errorMessage = error); - } - - loadFormData() { - this._EditPDtriggerForm = this._fb.group({ - fk_primary_id: [this.masterChild.pd_id], - fk_lender_id: [this.masterChild.fk_lender_id, Validators.compose([Validators.required])], - lender_applicant_id: [this.masterChild.lender_applicant_id, Validators.compose([Validators.required])], - fk_product_id: [this.masterChild.fk_product_id, Validators.compose([Validators.required])], - fk_subproduct_id: [this.masterChild.fk_subproduct_id, Validators.compose([Validators.required])], - fk_pd_type: [this.masterChild.fk_pd_type, Validators.compose([Validators.required])], - fk_customer_segment: [this.masterChild.fk_customer_segment, Validators.compose([Validators.required])], - loan_amount: [this.masterChild.loan_amount, Validators.compose([Validators.required])], -   addressline1: [this.masterChild.addressline1, Validators.compose([Validators.required])], - addressline2: [this.masterChild.addressline2], - addressline3: [this.masterChild.addressline3], - fk_city: [this.masterChild.fk_city, Validators.compose([Validators.required])], - fk_state: [this.masterChild.fk_state, Validators.compose([Validators.required])], -   pincode : [this.masterChild.pincode, Validators.compose([Validators.required])], - }); - } - get pdMain() { return this._EditPDtriggerForm.controls; } - - //get sub product list based on prokduct id - getSubproductList(productID:string){ - - this.subProductList= this.productList.filter(item => item.product_id == productID); - this.subProductList=this.subProductList[0].subproducts; - } - - //get city list details based on state id - getCityList(stateID:string){ - this.cityList= this.stateList.filter(item => item.state_id == stateID); - this.cityList=this.cityList[0].cities; - } - submitPdDetails(formValue: any) { - if(this._EditPDtriggerForm.valid){ - let my_array = this._EditPDtriggerForm.value; - Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); - this._pd.editPdMasterDetails(my_array).subscribe(); - } - } - loadPdMasterCompoent() { - // this.notifier.notify('success', 'Your Changes Updated.!'); - - this.loadPdView.emit('1') - } - - -} diff --git a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.html b/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.html deleted file mode 100644 index 2089d0ef3..000000000 --- a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.html +++ /dev/null @@ -1,123 +0,0 @@ - -
- -
-
-
- -
PD Details
- -
- - - - {{LL.full_name}} - - - Lender name is required. - - - - - Applicant id is required. - - - - - {{PL.product_name}} - - - Product is required. - - - - - - - {{SPL.subproduct_name}} - - - - Sub product is required. - - - - - - {{CSL.customer_segment}} - - - Customer segment is required. - - - - - {{PDL.type_name}} - - - - PD type is required. - - - - - Amount is required. - - - - - Address1 required. - - - - - - - - - - - - - - {{SL.state_name}} - - - - State is required. - - - - - ` - {{CL.name}} - - - - City is required. - - - - - - Pincode is required. - - - -
- -
-
-
- - -
-
- -
-
- \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.ts b/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.ts deleted file mode 100644 index 99ab0e723..000000000 --- a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; -import { CustomValidators } from 'ng2-validation'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; -import { AwsService } from '../../AwsService/aws.service'; -@Component({ - selector: 'app-edit-pd', - templateUrl: './edit-pd.component.html', - styleUrls: ['./edit-pd.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class EditPdComponent implements OnInit { - errorMessage: any; - public editData: any; - public productList:any; - subProductList:any; - lenderList:any; - customerSegmentList:any; - public stateList:any; - cityList:any; - pdTypeList:any; - @Input() childData: string; - @Output() loadParent = new EventEmitter(); - public _EditPDtriggerForm:FormGroup; - constructor(private _fb: FormBuilder, - private _pd: PdTrigerService, private _aws:AwsService) { - - } - - ngOnInit() { - this.getLenderList(); - this.getProductsList(); - this.getCustomerSegmentList(); - this.getStateCityList(); - this.getPDTypeList(); - this.editPdDetails(this.childData); - this.beforeLoadFormData(); - } - editPdDetails(editID:string){ - this._pd.editPdDetails(editID).subscribe( - data => { - if (data.status == 200) { - this.editData=data.records - this.afterLoadFormData(); - } -}, error => this.errorMessage = error); - } - - loadPdListCompoent() { - this.loadParent.emit('2') - } - getLenderList(){ - this._pd.getLenderDetails().subscribe( - data => { - if (data.status == 200) { - this.lenderList=data.records - } - }, error => this.errorMessage = error); - } - getProductsList(){ - this._pd.getProductsDetails().subscribe( - data => { - if (data.status == 200) { - this.productList=data.records - } - }, error => this.errorMessage = error); - } - getCustomerSegmentList(){ - this._pd.getCustomersDetails().subscribe( - data => { - if (data.status == 200) { - this.customerSegmentList=data.records - } - }, error => this.errorMessage = error); - } - getStateCityList(){ - this._pd.getStateCityDetails().subscribe( - data => { - if (data.status == 200) { - this.stateList=data.records - } - }, error => this.errorMessage = error); - } - getPDTypeList(){ - this._pd.getPDTypeDetails().subscribe( - data => { - if (data.status == 200) { - this.pdTypeList=data.records.pd_type; - - } - }, error => this.errorMessage = error); - } - - - beforeLoadFormData(){ - this._EditPDtriggerForm = this._fb.group({ - fk_lender_id: [null, Validators.compose([Validators.required])], - lender_applicant_id: [null, Validators.compose([Validators.required])], - fk_product_id: [null, Validators.compose([Validators.required])], - fk_subproduct_id: [null, Validators.compose([Validators.required])], - fk_pd_type: [null, Validators.compose([Validators.required])], - fk_customer_segment: [null, Validators.compose([Validators.required])], - loan_amount: [null, Validators.compose([Validators.required])], - applicant_name: [null, Validators.compose([Validators.required])], - mobile_no: [null, Validators.compose([Validators.required])], - email: [null, Validators.compose([Validators.required, CustomValidators.email])], -   addressline1: [null, Validators.compose([Validators.required])], - addressline2: [null], - addressline3: [null], - fk_city: [null, Validators.compose([Validators.required])], - fk_state: [null, Validators.compose([Validators.required])], -   pincode : [null, Validators.compose([Validators.required])], - items: this._fb.array([]), - documents: this._fb.array([]) - }); - } - afterLoadFormData() { - this._EditPDtriggerForm = this._fb.group({ - fk_lender_id: [null, Validators.compose([Validators.required])], - lender_applicant_id: [null, Validators.compose([Validators.required])], - fk_product_id: [null, Validators.compose([Validators.required])], - fk_subproduct_id: [null, Validators.compose([Validators.required])], - fk_pd_type: [null, Validators.compose([Validators.required])], - fk_customer_segment: [null, Validators.compose([Validators.required])], - loan_amount: [null, Validators.compose([Validators.required])], - applicant_name: [null, Validators.compose([Validators.required])], - mobile_no: [null, Validators.compose([Validators.required])], - email: [null, Validators.compose([Validators.required, CustomValidators.email])], -   addressline1: [null, Validators.compose([Validators.required])], - addressline2: [null], - addressline3: [null], - fk_city: [null, Validators.compose([Validators.required])], - fk_state: [null, Validators.compose([Validators.required])], -   pincode : [null, Validators.compose([Validators.required])], - items: this._fb.array([]), - documents: this._fb.array([]) - }); - } - get pdMain() { return this._EditPDtriggerForm.controls; } - - //get sub product list based on prokduct id - getSubproductList(productID:string){ - this.subProductList= this.productList.filter(item => item.product_id == productID); - this.subProductList=this.subProductList[0].subproducts; - } - - //get city list details based on state id - getCityList(stateID:string){ - this.cityList= this.stateList.filter(item => item.state_id == stateID); - this.cityList=this.cityList[0].city; - } - submitPdDetails(formValue: any) { - if(this._EditPDtriggerForm.valid){ - } - } -} diff --git a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts b/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts deleted file mode 100644 index 7ecdb00de..000000000 --- a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { Component, ViewChild, OnInit, ViewEncapsulation, EventEmitter, Output } from '@angular/core'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; -import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; -//import { MapPdViewComponent } from '../map-pd-view/map-pd-view.component'; -@Component({ - selector: 'app-list-pd', - templateUrl: './list-pd.component.html', - styleUrls: ['./list-pd.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class ListPdComponent implements OnInit { - recordStatus: boolean; - parentEditData :string; - parentViewData :string; - showParentComponent:boolean; - showAddComponent:boolean; - showEditComponent:boolean; - showViewComponent:boolean; - showMapViewComponent:boolean; - errorMessage: any; - public paginationList: any[] = []; - // pagination variable details - length = 50; - pageIndex = 0; - pageSize = 10; - pageEvent: PageEvent; - - // data source variable details - pdListData = null; - public dataLength: number; - public dataSource = new MatTableDataSource(); - @ViewChild(MatPaginator) paginator: MatPaginator; - @ViewChild(MatSort) sort: MatSort; - pdList:any[] = []; - tiles: any[] = [{ - text: 'One', - cols: 3, - rows: 1, - color: 'lightblue' - }, { - text: 'Two', - cols: 1, - rows: 1, - color: 'lightgreen' - }, { - text: 'Three', - cols: 1, - rows: 1, - color: 'lightpink' - }, { - text: 'Four', - cols: 2, - rows: 1, - color: '#DDBDF1' - }]; - - dogs: Object[] = [{ - name: 'Porter', - human: 'Kara' - }, { - name: 'Mal', - human: 'Jeremy' - }, { - name: 'Koby', - human: 'Igor' - }, { - name: 'Razzle', - human: 'Ward' - }, { - name: 'Molly', - human: 'Rob' - }, { - name: 'Husi', - human: 'Matias' - }]; - - basicRowHeight = 80; - fixedCols = 4; - fixedRowHeight = 50; - ratioGutter = 1; - fitListHeight = '400px'; - ratio = '8:1'; - - addTileCols() { - this.tiles[2].cols++; - } - constructor(private _pd: PdTrigerService) { - } - - ngOnInit() { - this.recordStatus=false - this.showParentComponent=true - this.showAddComponent=false - this.showEditComponent=false - this.showViewComponent=false - this.showMapViewComponent=false - this._pd.getPdDetails() - .subscribe( - data => { - if (data.status == 200) { - this.pdList = data.records; - this.pdListData = data.records; - this.dataLength = data.records.length; - this.dataSource.data = this.pdListData; - - } - else{ - this.pdList=[]; - this.dataLength = null; - this.recordStatus=true; - } - }, error => this.errorMessage = error); - } - addPdDetails(){ - this.showParentComponent=false - this.showEditComponent=false - this.showViewComponent=false - this.showAddComponent=!this.showAddComponent - } - - editPdDetails(editID:string){ - this.showParentComponent=false - this.showAddComponent=false - this.showViewComponent=false - this.showEditComponent=!this.showEditComponent - this.parentEditData=editID - } - viewPdDetails(editID:string){ - this.showParentComponent=false - this.showAddComponent=false - this.showEditComponent=false - this.showViewComponent=!this.showViewComponent - this.parentViewData=editID - } - viewMapPdDetails(){ - this.showParentComponent=false - this.showAddComponent=false - this.showEditComponent=false - this.showMapViewComponent=!this.showMapViewComponent; -} - updateParentComponent(event:string) { - this.showParentComponent=!this.showParentComponent - if(event=='1'){ - this.showAddComponent=!this.showAddComponent - } - else if(event=='2'){ - this.showEditComponent=!this.showEditComponent - } - else if(event=='3'){ - this.showViewComponent=!this.showViewComponent - } - this._pd.getPdDetails() - .subscribe( - data => { - if (data.status == 200) { - this.pdList = data.records; - this.pdListData = data.records; - this.dataLength = data.records.length; - this.dataSource.data = this.pdListData; - - } - else{ - this.pdList=[]; - this.dataLength = null; - this.recordStatus=true; - } - }, error => this.errorMessage = error); -} - - -pageChange(e) { - console.log(e); -} - -} diff --git a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.html b/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.html deleted file mode 100644 index f9af0c590..000000000 --- a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.html +++ /dev/null @@ -1,213 +0,0 @@ -
-
- - - - Search Options - Header subtitle - - - -
- - - - - - - - - - - {{details.applicat_details[0].applicant_name}} - - - {{details.product_abbr}}/{{details.subproduct_abbr}} - - -

Lendor ID:{{details.lender_applicant_id}}

-

Lendor Name:{{details.lender_full_name}}

-

Date Of Initiation:{{details.pd_date_of_initiation}}

-

 {{details.loan_amount}} -

-

- - -

- - -
- - - - - -

No Record Found ...

- -
-
- - - - - -
-
- - - - - -
-
-
-
-
-
-
- -
- - - - All - -
- - - - -

{{details.applicat_details[0].applicant_name}}

- -

{{details.lender_full_name}} {{details.lender_applicant_id}}{{details.pd_date_of_initiation}}

-

{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}} {{details.loan_amount}}  {{details.city_name}}/{{details.state_name}}-{{details.pincode}}

- - - -
- - - -
- -
-
-
- - -

No Record Found ...

- -
-
-
-
- - - - - -
- - - In Progress - - - - - - Scheduled - - - - - - Completed - - - - - -
-
-
diff --git a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.ts b/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.ts deleted file mode 100644 index 441823679..000000000 --- a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Component, ViewChild, OnInit } from '@angular/core'; -import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; - -import { NotifierService } from 'angular-notifier'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; - - -@Component({ - selector: 'app-map-pd-view', - templateUrl: './map-pd-view.component.html', - styleUrls: ['./map-pd-view.component.scss'] -}) -export class MapPdViewComponent implements OnInit { - lat = -34.397; - lng = 150.644; - recordStatus: boolean; - errorMessage: any; - // pagination variable details - length = 50; - pageIndex = 0; - pageSize = 10; - pageEvent: PageEvent; -// data source variable details -pdListData = null; -public dataLength: number; -public dataSource = new MatTableDataSource(); -@ViewChild(MatPaginator) paginator: MatPaginator; -@ViewChild(MatSort) sort: MatSort; -pdList:any[] = []; - constructor(private _pd: PdTrigerService) { - - } - - ngOnInit() { - this.recordStatus=false - this._pd.getPdDetails() - .subscribe( - data => { - if (data.status == 200) { - this.pdList = data.records; - this.pdListData = data.records; - this.dataLength = data.records.length; - this.dataSource.data = this.pdListData; - - } - else{ - this.pdList=[]; - this.dataLength = null; - this.recordStatus=true; - } - }, error => this.errorMessage = error); - } - -} diff --git a/ng6-seed/src/app/pd-triger/pd-triger-routing.module.ts b/ng6-seed/src/app/pd-triger/pd-triger-routing.module.ts deleted file mode 100644 index cf23e2a3d..000000000 --- a/ng6-seed/src/app/pd-triger/pd-triger-routing.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { ListPdComponent } from './list-pd/list-pd.component'; -import { AddPdComponent } from './add-pd/add-pd.component'; - -export const PdTrigerRoutes: Routes = [ - { - path: '', - component: ListPdComponent - // children: - // [{ - // path: 'pdtriggerlist', - // component: AddPdComponent - // }] - } - -]; - - diff --git a/ng6-seed/src/app/pd-triger/pd-triger.module.spec.ts b/ng6-seed/src/app/pd-triger/pd-triger.module.spec.ts deleted file mode 100644 index f82d79b3e..000000000 --- a/ng6-seed/src/app/pd-triger/pd-triger.module.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { PdTrigerModule } from './pd-triger.module'; - -describe('PdTrigerModule', () => { - let pdTrigerModule: PdTrigerModule; - - beforeEach(() => { - pdTrigerModule = new PdTrigerModule(); - }); - - it('should create an instance', () => { - expect(pdTrigerModule).toBeTruthy(); - }); -}); diff --git a/ng6-seed/src/app/personal-discussion/location-service/get-geometric-location.service.spec.ts b/ng6-seed/src/app/personal-discussion/location-service/get-geometric-location.service.spec.ts new file mode 100644 index 000000000..faa0a9fba --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/location-service/get-geometric-location.service.spec.ts @@ -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(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/location-service/get-geometric-location.service.ts b/ng6-seed/src/app/personal-discussion/location-service/get-geometric-location.service.ts new file mode 100644 index 000000000..44fc0f092 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/location-service/get-geometric-location.service.ts @@ -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 = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk' + 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 { + 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 => response.json()); + } +} diff --git a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html similarity index 61% rename from ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index c98778f50..3e43f0da0 100644 --- a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -1,7 +1,11 @@ -
- -
+ + + +
+ +
@@ -11,67 +15,81 @@ - - + {{LL.full_name}} - Lender name is required. + + - Applicant id is required. + Applicant ID Required + + + + {{billL.billing_name}} + + + + + + + Contact Person Required + + + + Contact Number Required + - + {{PL.product_name}} - Product is required. + - + {{SPL.subproduct_name}} - Sub product is required. + - + {{CSL.customer_segment}} - Customer segment is required. + - + {{PDL.type_name}} - PD type is required. + - - Amount is required. - + + - - Address1 required. - + + @@ -82,31 +100,31 @@ - + {{SL.state_name}} - State is required. + - + ` {{CL.city_name}} - City is required. + - - Pincode is required. + + -
+
@@ -133,22 +151,23 @@ - - Name is required. + + - + - - Email number is required. + + + + + + + + - - - Mobile number is required. - - - +
@@ -169,8 +188,19 @@ - - + + + + {{rel.name}} + + + + +
+ + + +
@@ -182,7 +212,7 @@
Co-Applicant
- + @@ -197,7 +227,7 @@ - + @@ -213,7 +243,12 @@ - + +
+ + + +
@@ -228,10 +263,15 @@ --> - - + + + + + +
+ \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss similarity index 100% rename from ng6-seed/src/app/pd-triger/add-pd/add-pd.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss diff --git a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.spec.ts similarity index 100% rename from ng6-seed/src/app/pd-triger/add-pd/add-pd.component.spec.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.spec.ts diff --git a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts similarity index 58% rename from ng6-seed/src/app/pd-triger/add-pd/add-pd.component.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 1613e5c92..0ed9a60ae 100644 --- a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -1,17 +1,23 @@ -import { Component, OnInit, ViewEncapsulation, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; import { CustomValidators } from 'ng2-validation'; import { NotifierService } from 'angular-notifier'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; -import { AwsService } from '../../AwsService/aws.service'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; +import { ListPdComponent } from '../list-pd.component'; +import { AwsService } from '../../../../AwsService/aws.service'; @Component({ selector: 'app-add-pd', templateUrl: './add-pd.component.html', styleUrls: ['./add-pd.component.scss'], encapsulation: ViewEncapsulation.None }) -export class AddPdComponent implements OnInit { - @Output() loadParent = new EventEmitter(); +export class AddPdComponent implements OnInit, OnDestroy { + //@Output() loadParent = new EventEmitter(); + cancelStatus: boolean; + enablePDButton: boolean; + draftStatus: boolean; + PDTriggerStatus: boolean; private notifier: NotifierService; public _PDtriggerForm: FormGroup; items: FormArray; @@ -22,53 +28,75 @@ export class AddPdComponent implements OnInit { stateList:any; cityList:any; pdTypeList:any; + billingList: any; + relationShipList: any; errorMessage: any; // Dynamic co applicant createWithLongContent = false; dynamicCoApplicant = []; - allocationTypeModel: number; - allocationTypeCheck: boolean; - subAllocationTypeCheck: boolean; - allocationLabel: string; - subAllocationLabel: string; - constructor(notifier: NotifierService,private _fb: FormBuilder, - private _pd: PdTrigerService, private _aws:AwsService) { + //allocationTypeModel: number; + //allocationTypeCheck: boolean; + //subAllocationTypeCheck: boolean; + //allocationLabel: string; + //subAllocationLabel: string; + constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute, + private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) { this.notifier = notifier; } public totalfiles: Array =[]; public totalFileName = []; public lengthCheckToaddMore =0; ngOnInit() { + this.draftStatus=false; + this.PDTriggerStatus=true; + this.enablePDButton=false; + this.cancelStatus = false; + this.ListPdComponent.pdListLoad(false); this.getLenderList(); this.getProductsList(); this.getCustomerSegmentList(); this.getStateCityList(); this.getPDTypeList(); + this.getRelationMaster(); this._PDtriggerForm = this._fb.group({ - fk_lender_id: [null, Validators.compose([Validators.required])], + fk_lender_id: [null], lender_applicant_id: [null, Validators.compose([Validators.required])], - fk_product_id: [null, Validators.compose([Validators.required])], - fk_subproduct_id: [null, Validators.compose([Validators.required])], - fk_pd_type: [null, Validators.compose([Validators.required])], - fk_customer_segment: [null, Validators.compose([Validators.required])], - loan_amount: [null, Validators.compose([Validators.required])], - applicant_name: [null, Validators.compose([Validators.required])], - mobile_no: [null, Validators.compose([Validators.required])], - email: [null, Validators.compose([Validators.required, CustomValidators.email])], -   addressline1: [null, Validators.compose([Validators.required])], + lender_contact_person: [null, Validators.compose([Validators.required])], + lender_contact_mobile: [null, Validators.compose([Validators.required])], + lender_billing: [null], + fk_product_id: [null], + fk_subproduct_id: [null], + fk_pd_type: [null], + fk_customer_segment: [null], + loan_amount: [null], + applicant_name: [null], + mobile_no: [null], + email: [null], +   addressline1: [null], addressline2: [null], addressline3: [null], - fk_city: [null, Validators.compose([Validators.required])], - fk_state: [null, Validators.compose([Validators.required])], -   pincode : [null, Validators.compose([Validators.required])], -   allocation_type: [null], -   sub_allocation_type: [null], + fk_city: [null], + fk_state: [null], +   pincode : [null], +   // allocation_type: [null], +   // sub_allocation_type: [null], items: this._fb.array([]), documents: this._fb.array([]) }); - + this.OnChanges(); } + // enable pd trigger submit function + OnChanges(): void{ + this._PDtriggerForm.valueChanges.subscribe(val => { + if(val.fk_lender_id && val.fk_product_id && val.fk_subproduct_id && val.fk_pd_type && val.fk_customer_segment && val.loan_amount && val.applicant_name && val.mobile_no && val.addressline1 && val.fk_city && val.fk_state && val.pincode){ + this.enablePDButton=true; + } + else{ + this.enablePDButton=false; + } + }); + } getLenderList(){ this._pd.getLenderDetails().subscribe( data => { @@ -107,29 +135,34 @@ export class AddPdComponent implements OnInit { data => { if (data.status == 200) { this.pdTypeList=data.records.pd_type; - if(data.records.pd_allocation_type){ - let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1); - if(getDefaultAllocation[0].pd_allocation_type_id==1){ - this.allocationTypeModel=1; - this.allocationTypeCheck=false; - this.subAllocationTypeCheck=false; - this.allocationLabel="Auto"; - this.subAllocationLabel="Load Balance"; - } - else if(this.allocationTypeModel[0].pd_allocation_type_id==2){ - this.allocationTypeModel=2; - this.allocationTypeCheck=false; - this.subAllocationTypeCheck=true; - this.allocationLabel="Auto"; - this.subAllocationLabel="Nearest"; - } - else if(this.allocationTypeModel[0].pd_allocation_type_id==3){ - this.allocationTypeModel=3; - this.allocationTypeCheck=true; - this.allocationLabel="Manual"; - } + + //start hide pd allocation type functinality + + // if(data.records.pd_allocation_type){ + // let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1); + // if(getDefaultAllocation[0].pd_allocation_type_id==1){ + // this.allocationTypeModel=1; + // this.allocationTypeCheck=false; + // this.subAllocationTypeCheck=false; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Load Balance"; + // } + // else if(this.allocationTypeModel[0].pd_allocation_type_id==2){ + // this.allocationTypeModel=2; + // this.allocationTypeCheck=false; + // this.subAllocationTypeCheck=true; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Nearest"; + // } + // else if(this.allocationTypeModel[0].pd_allocation_type_id==3){ + // this.allocationTypeModel=3; + // this.allocationTypeCheck=true; + // this.allocationLabel="Manual"; + // } - } + // } + + // end } }, error => this.errorMessage = error); @@ -146,6 +179,23 @@ export class AddPdComponent implements OnInit { this.cityList= this.stateList.filter(item => item.state_id == stateID); this.cityList=this.cityList[0].cities; } + + // lendor billing address + getBillingDetails(lendorID:string){ + this.billingList= this.lenderList.filter(item => item.entity_id == lendorID); + this.billingList=this.billingList[0].billing_address; + } + // 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 = error); + } createItem(): FormGroup { return this._fb.group({ label: ['Co Applicant'], @@ -186,10 +236,14 @@ export class AddPdComponent implements OnInit { get documents(): FormArray { return this._PDtriggerForm.get('documents') as FormArray; }; - get pdMain() { return this._PDtriggerForm.controls; } + get pdMain() { + return this._PDtriggerForm.controls; } get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; } - + removeCoApplicant(i: number) { + const control = this._PDtriggerForm.controls['items']; + control.removeAt(i); + } removeItem(index: number) { this.totalfiles.splice(index,1); this.totalFileName.splice(index,1); @@ -224,13 +278,16 @@ export class AddPdComponent implements OnInit { this.lengthCheckToaddMore=1; } } - submitPdDetails(formValue: any) { + submitPdDetails(formValue: any, status:boolean) { if(this._PDtriggerForm.valid){ // let my_array = this.PDtriggerForm.value; // Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); let pd_details:any={ "fk_lender_id":formValue.fk_lender_id, "lender_applicant_id":formValue.lender_applicant_id, + "lender_billing_id":formValue.lender_billing, + "lender_contact_person":formValue.lender_contact_person, + "lender_contact_mobile":formValue.lender_contact_mobile, "fk_product_id":formValue.fk_product_id, "fk_subproduct_id":formValue.fk_subproduct_id, "fk_pd_type":formValue.fk_pd_type, @@ -242,7 +299,8 @@ export class AddPdComponent implements OnInit { "fk_city":formValue.fk_city, "fk_state":formValue.fk_state, "pincode":formValue.pincode , - "fk_pd_allocation_type":this.allocationTypeModel , + "pd_status": status, + //"fk_pd_allocation_type":this.allocationTypeModel , "fk_createdby" : this._aws.getlocale(), "createdon": new Date().toJSON().slice(0,19).replace('T',' ') }; @@ -291,7 +349,7 @@ export class AddPdComponent implements OnInit { this._pd.addPdDetails(pd_form).subscribe(result => { if (result.status == 200) { this.notifier.notify('success', 'PD Saved.'); - this.loadPdListCompoent(); + this.loadPdListCompoent(true); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); @@ -301,30 +359,44 @@ export class AddPdComponent implements OnInit { }); } } - changeAllocationType(status: boolean) { - if(status){ - this.allocationTypeModel=3; - this.allocationLabel="Manual"; - } - else{ - this.allocationTypeModel=1; - this.allocationLabel="Auto"; - this.subAllocationLabel="Load Balance"; - } - } - changeSubAllocationType(status: boolean){ - if(status){ - this.allocationTypeModel=2; - this.allocationLabel="Auto"; - this.subAllocationLabel="Nearest"; + // start hide allocation type functionality + + // changeAllocationType(status: boolean) { + // if(status){ + // this.allocationTypeModel=3; + // this.allocationLabel="Manual"; + // } + // else{ + // this.allocationTypeModel=1; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Load Balance"; + // } + // } + // changeSubAllocationType(status: boolean){ + // if(status){ + // this.allocationTypeModel=2; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Nearest"; + // } + // else{ + // this.allocationTypeModel=1; + // this.allocationLabel="Auto"; + // this.subAllocationLabel="Load Balance"; + // } + // } + // end + loadPdListCompoent(from:boolean) { + if(from){ + this.router.navigate([ '../../' ], { relativeTo: this.route }); + this.ListPdComponent.pdListLoad(true); } else{ - this.allocationTypeModel=1; - this.allocationLabel="Auto"; - this.subAllocationLabel="Load Balance"; + this.router.navigate([ '../../' ], { relativeTo: this.route }); + this.ListPdComponent.showListView(true); } + } - loadPdListCompoent() { - this.loadParent.emit('1') + ngOnDestroy(): void { + this.ListPdComponent.showListView(true); } } diff --git a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html similarity index 85% rename from ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html index 70baa691b..fa3855b93 100644 --- a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html @@ -1,8 +1,16 @@ -
- - +
+
+ + +
- + +
+ + +
+
+ All @@ -25,7 +33,7 @@
- + @@ -124,9 +132,7 @@ - - - - - + + + diff --git a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss similarity index 95% rename from ng6-seed/src/app/pd-triger/list-pd/list-pd.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss index b1e122b24..d143ad302 100644 --- a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.scss @@ -1,5 +1,4 @@ .ic-change:hover { transform: scale(1.1); color: green; -} - +} \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.spec.ts similarity index 100% rename from ng6-seed/src/app/pd-triger/list-pd/list-pd.component.spec.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.spec.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts new file mode 100644 index 000000000..3de4e7979 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts @@ -0,0 +1,97 @@ +import { Component,ViewChild, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from '../../pd-service/pd-triger.service'; +import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +@Component({ + selector: 'app-list-pd', + templateUrl: './list-pd.component.html', + styleUrls: ['./list-pd.component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class ListPdComponent implements OnInit, OnDestroy { + private notifier: NotifierService; + recordStatus: boolean; + viewPdList:boolean; + viewMapPdList:boolean; + errorMessage: any; + // pagination variable details + length = 50; + pageIndex = 0; + pageSize = 10; + pageEvent: PageEvent; + + // data source variable details + pdListData = null; + public dataLength: number; + public dataSource = new MatTableDataSource(); + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + pdList:any[] = []; + constructor( notifier: NotifierService, private route: ActivatedRoute, + private router: Router, private _pd: PdTrigerService) { + this.notifier = notifier; + } + + ngOnInit() { + this.viewPdList = true; + this.recordStatus=false; + this.loadPDDetails(); + } +//load pd details + loadPDDetails() { + this._pd.getPdDetails() + .subscribe( + data => { + if (data.status == 200) { + this.pdList = data.records; + this.pdListData = data.records; + this.dataLength = data.records.length; + this.dataSource.data = this.pdListData; + + } + else{ + this.pdList=[]; + this.dataLength = null; + this.recordStatus=true; + } + }, error => this.errorMessage = error); + } + pageChange(e) { + console.log(e); + } + // view pd list in map view + viewMapPdDetails(){ + this.viewPdList = !this.viewPdList; + this.router.navigate([ '../pdlist/pdmaplist'], { relativeTo: this.route }); + + } + // add pd + addPdDetails() { + this.viewPdList = !this.viewPdList; + this.router.navigate([ '../pdlist/addpd'], { relativeTo: this.route }); + + } + showListView(status: boolean){ + this.viewPdList = status; + } + pdListLoad(status: boolean){ + this.viewPdList = status; + this.loadPDDetails(); + } + viewPDDetails(pdid:string){ + this.viewPdList = !this.viewPdList; + this.router.navigate([ '../pdlist/viewpd',pdid], { relativeTo: this.route }); + + } + //Global filter + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + this.dataSource.filter = filterValue; + } + ngOnDestroy(): void { + this.viewPdList=false; + } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html new file mode 100644 index 000000000..9996d99eb --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html @@ -0,0 +1,73 @@ +
+
+
+ +
+ + + Search Options + Header subtitle + + +
+ + + + {{details.applicat_details[0].applicant_name}} +

 {{details.city_name}}/{{details.state_name}}-{{details.pincode}}

+

{{details.lender_full_name}}({{details.lender_applicant_id}})

+

{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}

+

{{details.pd_date_of_initiation}}  {{details.loan_amount}}

+
+ + + + +
+
+ + +

No Record Found ...

+ +
+
+ + + + + +
+
+ + + + + +
+
+
+
+
+ diff --git a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.scss similarity index 91% rename from ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.scss index 3944ca03d..1cf171a27 100644 --- a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.scss @@ -1,4 +1,4 @@ -@import "../../../assets/styles/scss/material.variables"; +@import "../../../../../assets/styles/scss/material.variables"; :host { margin-left: -5px; diff --git a/ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.spec.ts similarity index 100% rename from ng6-seed/src/app/pd-triger/map-pd-view/map-pd-view.component.spec.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.spec.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts new file mode 100644 index 000000000..73532956b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts @@ -0,0 +1,94 @@ +import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core'; +import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; +import { GetGeometricLocationService } from '../../../location-service/get-geometric-location.service'; +import { ListPdComponent } from '../list-pd.component'; + +@Component({ + selector: 'app-map-pd-view', + templateUrl: './map-pd-view.component.html', + styleUrls: ['./map-pd-view.component.scss'] +}) +export class MapPdViewComponent implements OnInit, OnDestroy { + + lat:string + lng:string + mapDetails:any[] = []; + recordStatus: boolean; + errorMessage: any; + // pagination variable details + length = 50; + pageIndex = 0; + pageSize = 10; + pageEvent: PageEvent; +// data source variable details +pdListData = null; +public dataLength: number; +public dataSource = new MatTableDataSource(); +@ViewChild(MatPaginator) paginator: MatPaginator; +@ViewChild(MatSort) sort: MatSort; +pdList:any[] = []; + constructor(private route: ActivatedRoute, + private router: Router,private _pd: PdTrigerService,private _geolocation: GetGeometricLocationService, private ListPdComponent : ListPdComponent) { + + } + + ngOnInit() { + this.ListPdComponent.showListView(false); + this.recordStatus=false + this._pd.getPdDetails() + .subscribe( + data => { + if (data.status == 200) { + this.pdList = data.records; + this.pdListData = data.records; + this.dataLength = data.records.length; + this.dataSource.data = this.pdListData; + this.getMapViewLocations(this.pdList); + + } + else{ + this.pdList=[]; + this.dataLength = null; + this.recordStatus=true; + } + }, error => this.errorMessage = error); + } + + + getMapViewLocations(getData:any){ + getData.forEach(element => { + this._geolocation.findLocations(element.addressline1,element.pincode,element.state_name,element.city_name) + .subscribe(response => { + if (response.status == 'OK') { + this.lat = response.results[0].geometry.location.lat; + this.lng = response.results[0].geometry.location.lng; + this.mapDetails.push(response.results[0].geometry.location) + } + // else if (response.status == 'ZERO_RESULTS') { + // console.log('geocodingAPIService', 'ZERO_RESULTS', response.status); + // } else { + // console.log('geocodingAPIService', 'Other error', response.status); + // } + }); + + }); + } + + pageChange(e) { + console.log(e); + } + // go list view + goList(){ + this.ListPdComponent.showListView(true); + this.router.navigate([ '../../' ], { relativeTo: this.route }); + + } + ngOnDestroy(): void { + this.ListPdComponent.showListView(true); + + } + +} diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html similarity index 100% rename from ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss similarity index 100% rename from ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.scss diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts similarity index 97% rename from ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts index ac56fdf9e..842a1884f 100644 --- a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; import { NotifierService } from 'angular-notifier'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; @Component({ selector: 'app-pd-allocation', diff --git a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html similarity index 90% rename from ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index f5d233149..ecb9de82e 100644 --- a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -1,7 +1,6 @@
-
@@ -26,11 +25,9 @@ -
- - +
@@ -56,7 +53,6 @@
- diff --git a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss similarity index 100% rename from ng6-seed/src/app/pd-triger/view-pd/view-pd.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss diff --git a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.spec.ts similarity index 100% rename from ng6-seed/src/app/pd-triger/view-pd/view-pd.component.spec.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.spec.ts diff --git a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts similarity index 56% rename from ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index f0324f37e..ee8a7e8cc 100644 --- a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -1,41 +1,42 @@ -import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core'; +import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDestroy } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; import { MatDialog } from '@angular/material'; import { NotifierService } from 'angular-notifier'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; +import { ListPdComponent } from '../list-pd.component'; @Component({ selector: 'app-view-pd', templateUrl: './view-pd.component.html', styleUrls: ['./view-pd.component.scss'], encapsulation: ViewEncapsulation.None }) -export class ViewPdComponent implements OnInit { +export class ViewPdComponent implements OnInit, OnDestroy { + private notifier:NotifierService; errorMessage: any; pdMasterData: any; pdApplicantData: any; pdDocumentsData: any; pdLogsData: any; - editMasterData: any[]; - editApplicantData: any[]; - showEditMasterComponent: boolean; - showEditApplicantComponent: boolean; - showEditDocumentComponent: boolean; - @Input() childData: string; - @Output() loadParent = new EventEmitter(); + viewID:string; + viewParams:any; + // @Input() childData: string; + // @Output() loadParent = new EventEmitter(); public _EditPDtriggerForm:FormGroup; constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, - private _pd: PdTrigerService) { + private _pd: PdTrigerService,private route: ActivatedRoute,private router: Router, private ListPdComponent: ListPdComponent) { this.notifier=notifier } ngOnInit() { + this.ListPdComponent.pdListLoad(false); + this.route.params.subscribe(params => { + this.viewID = params['pdid']; + }); - this.viewPdDetails(this.childData); - this.showEditMasterComponent=false; - this.showEditApplicantComponent=false; - this.showEditDocumentComponent=false; + this.viewPdDetails(this.viewID); } viewPdDetails(editID:string){ this._pd.editPdDetails(editID).subscribe( @@ -50,16 +51,15 @@ export class ViewPdComponent implements OnInit { } loadPdListCompoent() { - this.loadParent.emit('3') + this.router.navigate([ '../../' ], { relativeTo: this.route }); + this.ListPdComponent.showListView(true); } editPdMaster(masterData:any){ - this.editMasterData=masterData; - this.showEditMasterComponent=!this.showEditMasterComponent; + } editPdApplicant(applicantData:any){ - this.editApplicantData=applicantData; - this.showEditApplicantComponent=!this.showEditApplicantComponent; + } // pd allocation to // edit questions master details popup model @@ -71,22 +71,24 @@ export class ViewPdComponent implements OnInit { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.viewPdDetails(this.childData) + // this.viewPdDetails(this.childData) }); } - updateViewComponent(editBack:string) { +// updateViewComponent(editBack:string) { - if(editBack=='1'){ - this.showEditMasterComponent=!this.showEditMasterComponent - } - else if(editBack=='2'){ - this.showEditApplicantComponent=!this.showEditApplicantComponent - } - else if(editBack=='3'){ - this.showEditMasterComponent=!this.showEditMasterComponent - } - this.viewPdDetails(this.childData); - } +// if(editBack=='1'){ +// this.showEditMasterComponent=!this.showEditMasterComponent +// } +// else if(editBack=='2'){ +// this.showEditApplicantComponent=!this.showEditApplicantComponent +// } +// else if(editBack=='3'){ +// this.showEditMasterComponent=!this.showEditMasterComponent +// } +// this.viewPdDetails(this.childData); +// } + ngOnDestroy(): void { + this.ListPdComponent.showListView(true); } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.html new file mode 100644 index 000000000..92d06be8b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.html @@ -0,0 +1,3 @@ +

+ manage-pd works! +

diff --git a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.scss similarity index 100% rename from ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.scss diff --git a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.spec.ts similarity index 55% rename from ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.spec.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.spec.ts index ad598b308..bd5932b0c 100644 --- a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.spec.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { EditPdComponent } from './edit-pd.component'; +import { ManagePdComponent } from './manage-pd.component'; -describe('EditPdComponent', () => { - let component: EditPdComponent; - let fixture: ComponentFixture; +describe('ManagePdComponent', () => { + let component: ManagePdComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditPdComponent ] + declarations: [ ManagePdComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(EditPdComponent); + fixture = TestBed.createComponent(ManagePdComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.ts new file mode 100644 index 000000000..1d31fea9f --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +@Component({ + template: ` +
+ +
+ ` +}) +export class ManagePdComponent { +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.spec.ts new file mode 100644 index 000000000..dc60f4b0e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.spec.ts @@ -0,0 +1,13 @@ +import { ManagePdModule } from './manage-pd.module'; + +describe('ManagePdModule', () => { + let managePdModule: ManagePdModule; + + beforeEach(() => { + managePdModule = new ManagePdModule(); + }); + + it('should create an instance', () => { + expect(managePdModule).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/pd-triger/pd-triger.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts similarity index 71% rename from ng6-seed/src/app/pd-triger/pd-triger.module.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 4ed7f07a8..59e77c3fd 100644 --- a/ng6-seed/src/app/pd-triger/pd-triger.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; import { MatCardModule, MatIconModule, @@ -18,20 +17,19 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { MatTooltipModule } from '@angular/material/tooltip'; import { NgxMatSelectSearchModule } from 'ngx-mat-select-search'; +import 'hammerjs'; import { NotifierModule, NotifierOptions } from 'angular-notifier'; import { AgmCoreModule } from '@agm/core'; - -import 'hammerjs'; -import { PdTrigerRoutes } from './pd-triger-routing.module'; -import { AddPdComponent } from './add-pd/add-pd.component'; -import { PdTrigerService } from './pd-service/pd-triger.service'; +import { ManagePdRoutingModule } from './manage-pd.routing'; import { ListPdComponent } from './list-pd/list-pd.component'; -import { EditPdComponent } from './edit-pd/edit-pd.component'; -import { ViewPdComponent } from './view-pd/view-pd.component'; -import { EditPdMasterComponent } from './edit-pd-master/edit-pd-master.component'; -import { EditPdApplicantComponent } from './edit-pd-applicant/edit-pd-applicant.component'; -import { PdAllocationComponent } from './pd-allocation/pd-allocation.component'; -import { MapPdViewComponent } from './map-pd-view/map-pd-view.component'; +import { ManagePdComponent } from './manage-pd.component'; +import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component'; +import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component'; +import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component'; +import { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-allocation.component'; +import { PdTrigerService } from '../pd-service/pd-triger.service'; +import { GetGeometricLocationService } from '../location-service/get-geometric-location.service'; + /** * Custom angular notifier options */ @@ -78,7 +76,7 @@ const pdCustomNotifierOptions: NotifierOptions = { @NgModule({ imports: [ CommonModule, - RouterModule.forChild(PdTrigerRoutes), + ManagePdRoutingModule, NotifierModule.withConfig(pdCustomNotifierOptions), MatCardModule, MatIconModule, @@ -100,8 +98,7 @@ const pdCustomNotifierOptions: NotifierOptions = { NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), ], - declarations: [AddPdComponent, ListPdComponent, EditPdComponent, ViewPdComponent, EditPdMasterComponent, EditPdApplicantComponent, PdAllocationComponent, MapPdViewComponent], - entryComponents:[PdAllocationComponent], - providers: [PdTrigerService] + declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent], + providers: [PdTrigerService, GetGeometricLocationService] }) -export class PdTrigerModule { } +export class ManagePdModule { } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts new file mode 100644 index 000000000..3b30f5bd6 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts @@ -0,0 +1,47 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { ManagePdComponent } from './manage-pd.component'; +import { ListPdComponent } from './list-pd/list-pd.component'; +import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component'; +import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component'; +import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component'; + +/* +* manage pd router +*/ +const routes: Routes = [ + { + path: '', + component: ManagePdComponent, + children: [ + { + path: '', + pathMatch: 'full', + redirectTo: 'pdlist' + },{ + path: 'pdlist', + component: ListPdComponent, + children: [ + { + path: 'pdmaplist', + component: MapPdViewComponent, + }, + { + path: 'addpd', + component: AddPdComponent, + }, + { + path: 'viewpd/:pdid', + component: ViewPdComponent, + }, + ] + } + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class ManagePdRoutingModule { } diff --git a/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.spec.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.spec.ts similarity index 100% rename from ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.spec.ts rename to ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.spec.ts diff --git a/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts similarity index 56% rename from ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts rename to ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index dc2cbe7bb..808767907 100644 --- a/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs';//for Datatables import { HttpClient,HttpParams } from '@angular/common/http'; -import { catchError } from 'rxjs/operators'; +import { catchError, map } from 'rxjs/operators'; import { of } from 'rxjs'; /** Imported Service Files Are., */ @@ -23,9 +23,13 @@ export class PdTrigerService { //private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; //private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/"; private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; - + MAP_API_KEY: string; + MAP_API_URL: string; constructor(private _http: HttpClient, - private _aws:AwsService) { } + private _aws:AwsService) { + this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk' + this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`; + } // get add pd master details getAllMasterDatas(TableName:string): Observable { return this._http.post(this.apiUrl+'getListOfMaster', { "master_name":TableName }) @@ -87,55 +91,54 @@ export class PdTrigerService { return this._http.get(this.apiUrl+"listLessPDDetails/get") .pipe( catchError(this.handleError('operation', [])) - ) + ) + } + + // get edit row pd details + editPdDetails(editId:string):Observable{ + let httpParams = new HttpParams().set('pdid', editId); + return this._http.post(this.apiUrl+"getFullPDDetails",httpParams) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // update pd master details + editPdMasterDetails(editData:any):Observable{ + editData.fk_updatedby = this._aws.getlocale(); + editData.updatedon = currentdate; + return this._http.post(this.apiUrl+"triggerNewPD",{records:editData}) + + .pipe( + catchError(this.handleError('operation', [])) + ) } + // update pd applicant + updatePdApplicant(editData:any):Observable{ + // editData.fk_updatedby = this._aws.getlocale(); + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData}) - // get edit row pd details - editPdDetails(editId:string):Observable{ - let httpParams = new HttpParams().set('pdid', editId); - return this._http.post(this.apiUrl+"getFullPDDetails",httpParams) .pipe( - catchError(this.handleError('operation', [])) - ) + catchError(this.handleError('operation', [])) + ) } - // update pd master details - editPdMasterDetails(editData:any):Observable{ - editData.fk_updatedby = this._aws.getlocale(); - editData.updatedon = currentdate; - return this._http.post(this.apiUrl+"triggerNewPD",{records:editData}) - - .pipe( - catchError(this.handleError('operation', [])) - ) - } - // update pd applicant - updatePdApplicant(editData:any):Observable{ - // editData.fk_updatedby = this._aws.getlocale(); - // editData.updatedon = currentdate; - console.log(editData) - return this._http.post(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData}) - - .pipe( - catchError(this.handleError('operation', [])) - ) - } - - // get pd allocation to details - getPdOfficerList(pdID:string): Observable { - return this._http.post(this.apiUrl+"getListPDOfficers",{"pdid":pdID}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } - // update pd officer - updatePdOfficer(updateData: any): Observable { - updateData.fk_updatedby = this._aws.getlocale(); - updateData.updatedon = currentdate; - return this._http.post(this.apiUrl+"allocatePD",{"records":updateData}) - .pipe( - catchError(this.handleError('operation', [])) - ) - } + + // get pd allocation to details + getPdOfficerList(pdID:string): Observable { + return this._http.post(this.apiUrl+"getListPDOfficers",{"pdid":pdID}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // update pd officer + updatePdOfficer(updateData: any): Observable { + updateData.fk_updatedby = this._aws.getlocale(); + updateData.updatedon = currentdate; + return this._http.post(this.apiUrl+"allocatePD",{"records":updateData}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } private handleError(operation = 'operation', result?: T) { return (error: any): Observable => { diff --git a/ng6-seed/src/app/personal-discussion/personal-discussion.module.spec.ts b/ng6-seed/src/app/personal-discussion/personal-discussion.module.spec.ts new file mode 100644 index 000000000..5d317556a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/personal-discussion.module.spec.ts @@ -0,0 +1,13 @@ +import { PersonalDiscussionModule } from './personal-discussion.module'; + +describe('PersonalDiscussionModule', () => { + let personalDiscussionModule: PersonalDiscussionModule; + + beforeEach(() => { + personalDiscussionModule = new PersonalDiscussionModule(); + }); + + it('should create an instance', () => { + expect(personalDiscussionModule).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts new file mode 100644 index 000000000..c0ecf82ed --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts @@ -0,0 +1,52 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import { + MatCardModule, + MatIconModule, + MatInputModule, + MatRadioModule, + MatButtonModule,MatTableModule,MatPaginatorModule, + MatProgressBarModule,MatDialogModule, MatSortModule, + MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule } from '@angular/material'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; +import { TreeModule } from 'angular-tree-component'; +import { NgxDatatableModule } from '@swimlane/ngx-datatable'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { NgxMatSelectSearchModule } from 'ngx-mat-select-search'; +import 'hammerjs'; +import { ManagePdModule } from './manage-pd/manage-pd.module'; + +import { personalDiscussionRoutes } from './personal-discussion.routing'; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(personalDiscussionRoutes), + ManagePdModule, + MatCardModule, + MatIconModule, + MatInputModule, + MatRadioModule, + MatTableModule, + MatPaginatorModule, + MatButtonModule, + MatProgressBarModule, + MatToolbarModule, + FlexLayoutModule, + NgxDatatableModule, + FormsModule,MatSlideToggleModule, + MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, + ReactiveFormsModule, + FileUploadModule, + TreeModule, + MatDialogModule,MatSortModule, + NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, + ], + declarations: [] +}) +export class PersonalDiscussionModule { } diff --git a/ng6-seed/src/app/personal-discussion/personal-discussion.routing.ts b/ng6-seed/src/app/personal-discussion/personal-discussion.routing.ts new file mode 100644 index 000000000..2854d0c1a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/personal-discussion.routing.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { ManagePdModule } from './manage-pd/manage-pd.module'; +export const personalDiscussionRoutes: Routes = [{ + path: '', + loadChildren:'./manage-pd/manage-pd.module#ManagePdModule', +// children:[{ +// path:'managepd', +// loadChildren:'./manage-pd/manage-pd.module#ManagePdModule' +// } +// ] +}]; + +// @NgModule({ +// imports: [RouterModule.forChild(routes)], +// exports: [RouterModule] +// }) +// export class PersonalDiscussionRoutingModule { } diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html index c35582094..da96ed323 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html @@ -17,11 +17,11 @@ fxLayoutAlign="center">
- + {{ cd.name }} - You must Pickup City Name. + City Name Required.
@@ -29,7 +29,7 @@ fxLayoutAlign="center">
- You must inculde a Branch Name + Branch Name Required
diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html index ac51af616..f2fd5b7a5 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html @@ -17,7 +17,7 @@
- + diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html index 4d1ddc672..c18a1fa26 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html @@ -31,17 +31,17 @@ fxLayoutAlign="center">
- + {{ sd.name }} - You must Pickup State Name. + State Name Required.
- You must include a Name. + City Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html index 4de4790c4..da88ac6b3 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html @@ -32,7 +32,7 @@ fxLayoutAlign="center">
- You must include a Rating. + Rating Required.
diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html index 618130537..f0df83f71 100644 --- a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html @@ -16,38 +16,38 @@
- You must include a Name. + Company Name Required.
- - You must include a addressline1. + + Company Address Line1 Required.
- - You must include a Name. + + Company Address Line2 Required.
- - You must include a Name. + + Company Address Line3 Required.
- + {{ cd.name }} - You must include a City. + City Name Required.
@@ -55,7 +55,7 @@
- pincode should be in 6 digit format + Pincode should be in 6 digit format Your pincode must be at least 5 characters long. @@ -65,10 +65,10 @@
- + {{ sd.name }} - You must Pickup a State. + State Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html index 7198faac0..c445f8fe6 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html @@ -34,7 +34,7 @@ fxLayoutAlign="center">
- You must include a Name. + Description Required.
diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html index af713ed41..98f96e5e6 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html @@ -34,7 +34,7 @@ fxLayoutAlign="center">
- You must include a Name. + Name Required.
@@ -42,7 +42,7 @@ fxLayoutAlign="center">
- You must include a Abbrevation. + Abbrevation Required.
diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html index fd3e2e99a..c50de886e 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html @@ -32,7 +32,7 @@ fxLayoutAlign="center">
- You must include a Name. + Name Required.
@@ -42,7 +42,7 @@ fxLayoutAlign="center">
- You must include a Short Name. + Short Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html index caa3b9348..706429f5d 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html @@ -34,7 +34,7 @@ fxLayoutAlign="center">
- You must include a Name. + Frequency Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html index 9fae64052..5cae4c53a 100644 --- a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html @@ -33,7 +33,7 @@ fxLayoutAlign="center">
- You must include a Classified Name. + Classified Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html index e176790fd..3fba64166 100644 --- a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html @@ -32,7 +32,7 @@ fxLayoutAlign="center">
- You must include a Lender Hierarchy Name. + Lender Hierarchy Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html index 21bb919a7..c6ca49362 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html @@ -32,7 +32,7 @@ fxLayout="row">
- You must include a Name. + Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html index bf39530f1..7cc5879cf 100644 --- a/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html @@ -33,8 +33,8 @@ fxLayoutAlign="center">
- - You must include a Description. + + Description Required.
diff --git a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html index bbc649150..643c7122a 100644 --- a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html @@ -33,8 +33,8 @@ fxLayoutAlign="center">
- - You must include a type_name. + + Type Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html index 5793c6d43..bd8c0551a 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html @@ -32,7 +32,7 @@ fxLayoutAlign="center">
- You must include a Product name. + Product Name Required.
@@ -41,7 +41,7 @@ fxLayoutAlign="center"> - You must include a Product abbrevation. + Product Abbrevation Required.
diff --git a/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html b/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html index 4158e2813..b54a9f9fd 100644 --- a/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html @@ -16,7 +16,7 @@ fxLayoutAlign="center">
- You must include a category name. + Category Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html index 92891a919..f652efa2a 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html @@ -34,7 +34,7 @@ fxLayoutAlign="center">
- You must include a Name. + Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html index 415e9ff95..3cce82541 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html @@ -34,7 +34,7 @@ fxLayoutAlign="center">
- You must include a Name. + Name Required.
diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html index 78827813d..fe54686e3 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html @@ -32,17 +32,17 @@ fxLayoutAlign="center">
- + {{ sd.name }} - You must include a Region. + Region Name Required.
- You must include a Name. + Name Required.
@@ -58,7 +58,7 @@ fxLayoutAlign="center">
- You must include a Code. + Code Required.
diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html index e0193cf07..387c6daae 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html @@ -41,10 +41,10 @@ fxLayoutAlign="center"> -->
- + {{ sd.name }} - You must include a Product name. + Product Name Required.
+
+
+
+ + +
+
+
+ +
+
+ + + {{pdteamdetails.team_name | titlecase}} info + +
+ {{pdteamdetails.short_name}} + +
+ + + + + +
+ {{ users.user_full_name |titlecase}} + +
+ + +
+
+ + +
+ + +
+
+ +
+
+
+
+ {{pdTeamManageData}} +
+
+ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss new file mode 100644 index 000000000..38135d397 --- /dev/null +++ b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss @@ -0,0 +1,24 @@ + + .tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; + } + + .tooltip .tooltiptext { + visibility: hidden; + width: 120px; + background-color: black; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + + /* Position the tooltip */ + position: absolute; + z-index: 1; + } + + .tooltip:hover .tooltiptext { + visibility: visible; + } diff --git a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.spec.ts b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.spec.ts similarity index 53% rename from ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.spec.ts rename to ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.spec.ts index c2b08e200..e80ff730f 100644 --- a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.spec.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { EditPdMasterComponent } from './edit-pd-master.component'; +import { PdTeamManageComponent } from './pd-team-manage.component'; -describe('EditPdMasterComponent', () => { - let component: EditPdMasterComponent; - let fixture: ComponentFixture; +describe('PdTeamManageComponent', () => { + let component: PdTeamManageComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditPdMasterComponent ] + declarations: [ PdTeamManageComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(EditPdMasterComponent); + fixture = TestBed.createComponent(PdTeamManageComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts new file mode 100644 index 000000000..1f8368b2a --- /dev/null +++ b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts @@ -0,0 +1,120 @@ +import { Output, EventEmitter,Component, OnInit,ViewEncapsulation, Directive, ViewChild } from '@angular/core'; +import { PdTeamService } from '../../service/masters/pd-team.service'; +import { DragulaService } from 'ng2-dragula'; + +/**sweet alert */ +import Swal from 'sweetalert2' +@Component({ + selector: 'app-pd-team-manage', + templateUrl: './pd-team-manage.component.html', + styleUrls: ['./pd-team-manage.component.scss'] +}) + +export class PdTeamManageComponent implements OnInit { + saveData: any; + viewpage:boolean = false; + pdTeamManageData:any; + pdTeamColor:any =[]; + pdTeamNewList:any = []; + transferData: any; + btnsave:boolean = true; + teamDetails:any = []; + loader:boolean = false; + mapDetails:any =[]; + @ViewChild('bag1') bag1: any; + constructor( public pdteammanage:PdTeamService,private dragulaService:DragulaService) { + this.getPDTeamManageDetails(); + this.getpdteamchange(); + + } + + ngOnInit() { + + } + + getPDTeamManageDetails() + { + this.loader = true; + this.pdteammanage.getPdTeam().subscribe(res=>{ + this.pdTeamManageData = res; + if(this.pdTeamManageData.dataStatus == true) + { + this.loader = false; + this.btnsave = true; + this.viewpage = true; + this.pdTeamManageData = this.pdTeamManageData.records; + + console.log(this.pdTeamManageData); + + }else + { + this.viewpage = false; + this.pdTeamManageData = "No Records Found"; + } + }) + } + + getpdteamchange(){ + let that = this; + + //console.log(this.bag1); + that.dragulaService.dropModel.subscribe((args: any) => { + + let [bagName, el, target, source] = args; + //console.log(el); + console.log(this.bag1.nativeElement); + console.log(this.bag1.nativeElement === target); + if(this.bag1.nativeElement){ // needed since dropModel triggers for all bags, not only on the dropped bag + console.log(this.bag1.nativeElement); + + let transferData:any = { + userid: el.dataset.id, + oldTeamName: source.dataset.id, + newTeamName: target.dataset.id, + oldIndex: el.dataset.index + } + console.log(el); + for(let i = 0; i < that.pdTeamManageData.length; i++){ + let users = that.pdTeamManageData[i].USERPROFILE; + for(let us of users){ + if(us.userid == transferData.userid){ + transferData.newIndex = i; + //console.log(transferData); + this.pdTeamNewList.push(transferData); + //console.log(that.transferData); + console.log(this.pdTeamNewList); + this.btnsave = false; + break; + } + } + } + + } + }); + + } + getnewTeamDetails(){ + if(this.pdTeamNewList.length ==0) + { + + }else{ + + + this.pdteammanage.savePdTeamManage(this.pdTeamNewList).subscribe(res=> + { + this.saveData = res; + if(this.saveData.dataStatus == true) + { + this.getPDTeamManageDetails(); + } + }) + } + } + cityinfo(id) { + Swal("
CITY:
"+this.pdTeamManageData[id].CITYMAP+'
'+"PRODUCTS: "+this.pdTeamManageData[id].PRODUCTS+"
"+"CS: "+this.pdTeamManageData[id].CUSTOMERSEGMENT+"..
"); + + + + +} +} diff --git a/ng6-seed/src/app/settings/pd-team/pd-team.module.ts b/ng6-seed/src/app/settings/pd-team/pd-team.module.ts index cc7958bc3..dac9173f9 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team.module.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team.module.ts @@ -3,6 +3,9 @@ import { RouterModule } from '@angular/router'; import { CommonModule } from '@angular/common'; import { NotifierModule, NotifierOptions } from 'angular-notifier'; import { FlexLayoutModule } from '@angular/flex-layout'; +import { PdTeamManageComponent } from './pd-team-manage/pd-team-manage.component'; +import {MatListModule} from '@angular/material/list'; + import { MatCardModule, MatIconModule, @@ -30,6 +33,7 @@ import { PdTeamRoutes } from './pd-team.routing'; /** Service */ import { PdTeamService } from '../service/masters/pd-team.service'; +import { DragulaModule } from 'ng2-dragula'; /** * Custom angular notifier options @@ -97,13 +101,14 @@ const customNotifierOptions: NotifierOptions = { NgxDatatableModule, MatSortModule, MatSlideToggleModule, - MatTooltipModule, + MatTooltipModule,MatListModule,DragulaModule, NotifierModule.withConfig(customNotifierOptions), ], declarations: [ PdTeamListComponent, PdTeamAddComponent, - PdTeamEditComponent], + PdTeamEditComponent, + PdTeamManageComponent], providers: [PdTeamService] diff --git a/ng6-seed/src/app/settings/pd-team/pd-team.routing.ts b/ng6-seed/src/app/settings/pd-team/pd-team.routing.ts index e792e720a..6c6fa741b 100755 --- a/ng6-seed/src/app/settings/pd-team/pd-team.routing.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team.routing.ts @@ -2,6 +2,7 @@ import { Routes } from '@angular/router'; import { PdTeamAddComponent } from '../pd-team/pd-team-add/pd-team-add.component'; import { PdTeamEditComponent } from '../pd-team/pd-team-edit/pd-team-edit.component'; import { PdTeamListComponent } from '../pd-team/pd-team-list/pd-team-list.component'; +import { PdTeamManageComponent } from './pd-team-manage/pd-team-manage.component'; export const PdTeamRoutes: Routes = [{ @@ -16,6 +17,9 @@ export const PdTeamRoutes: Routes = [{ },{ path:'editpdteam', component:PdTeamEditComponent + },{ + path:'pdteammanage', + component:PdTeamManageComponent }] }]; diff --git a/ng6-seed/src/app/settings/service/masters/pd-team.service.ts b/ng6-seed/src/app/settings/service/masters/pd-team.service.ts index 0a90bc3e8..f6b8c606e 100644 --- a/ng6-seed/src/app/settings/service/masters/pd-team.service.ts +++ b/ng6-seed/src/app/settings/service/masters/pd-team.service.ts @@ -23,8 +23,8 @@ export interface Master { export class PdTeamService { -//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; -private apiUrl = "http://localhost/sparqapi/api/"; +private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; +//private apiUrl = "http://localhost/sparqapi/api/"; pk: { "primary_key": any; }; @@ -215,5 +215,31 @@ return this._http.post(this.apiUrl+"savePDTeam", ArrayData) // catchError(this.handleError('role', [])) // ) // } +/** + * PD Team Manage + * sriram + */ +getPdTeam() +{ + return this._http.get(this.apiUrl+'getPdManage').pipe(catchError(this.handleError('role',[]))); +} +/** +* Save pd Team Manage +* sriram +*/ + +savePdTeamManage(teamDetails:any) +{ +let records = {records:{teamDetails,fk_updatedby:this._aws.getlocale(),updatedon :currentdate}}; + + + +// console.log(records); +return this._http.post(this.apiUrl+'savePdTeamManage',records); +} + +/** +* End of the function +*/ } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/service/user.service.ts b/ng6-seed/src/app/settings/service/user.service.ts index a3d4b5e40..47019ca84 100644 --- a/ng6-seed/src/app/settings/service/user.service.ts +++ b/ng6-seed/src/app/settings/service/user.service.ts @@ -150,8 +150,8 @@ export class UserService { let pdtypeid:any; let pdteam:any; - if(users.pdteam !=null && users.pdtype !=null){ - pdtypeid = users.pdtype.pd_type_id; + if(users.pdteam !=null){ + pdteam = users.pdteam.pdteam_id; @@ -161,7 +161,7 @@ export class UserService { userid = users.userid } let pdofficer = { - 'fk_pd_type_id':pdtypeid, + 'fk_team_id':pdteam, 'fk_user_id':userid diff --git a/ng6-seed/src/app/settings/users/register/register.component.html b/ng6-seed/src/app/settings/users/register/register.component.html index 8eff3a4f4..5065050f5 100755 --- a/ng6-seed/src/app/settings/users/register/register.component.html +++ b/ng6-seed/src/app/settings/users/register/register.component.html @@ -1,9 +1,9 @@ - User Registrations + USER REGISTRATION + @@ -33,27 +33,45 @@ - +
- Account Details
+ Account Details

- - You must include an email address. - You must include a valid email address. + + email Address Required. + Invalid Email Address. - - You must include phone number. - You must include a valid phone number. + + Phone Number Required. + Invalid Phone Number. - + + + -- + + {{s.name}} + + + State Required. + + + + + -- + + {{c.name}} + + + city Required. +
@@ -95,7 +113,7 @@ --> -
+ Role Information

- - + -- {{types.name}} - Select User Role - Select User Role + Enitity Type Required + Enitity Type Required - + -- {{ent.full_name}} + Lender Name Required. - + -- {{ent.full_name}} - - - - - + Vendor Name Required. + + {{role.role_name}} +
- Select User Role - Select User Role + User Role Required + User Role Required
- - - -
+ +
- + -- @@ -194,7 +211,7 @@ - +
-
- UserProfile - -
-
- -
- - {{img}} - +
+
+ User Profile + +
+
+ +
+ + {{img}} + +
+
+ + Isactive + +
- - - - Isactive - - +
- - - - - + + + + + + +
- +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/users/register/register.component.ts b/ng6-seed/src/app/settings/users/register/register.component.ts index 17e26be41..790abd315 100755 --- a/ng6-seed/src/app/settings/users/register/register.component.ts +++ b/ng6-seed/src/app/settings/users/register/register.component.ts @@ -10,7 +10,7 @@ import { MatOption } from '@angular/material'; import { UserService } from '../../service/user.service'; import { ifStmt } from '@angular/compiler/src/output/output_ast'; const pdoff = "PD Officer"; - +const pdexu = "PD Executive"; @Component({ selector: 'app-register', templateUrl: './register.component.html', @@ -232,9 +232,9 @@ this.loader = true; // this.roleAccess = false; // } // } - if (this.usersData != '' && this.usersData !==undefined || e.value.role_name == pdoff && enitiyid.entity_type_id == 1) { - console.log(e); - if(e.role_name == pdoff && enitiyid.entity_type_id == 1 || e.value.role_name == pdoff && enitiyid.entity_type_id == 1){ + if (this.usersData != '' && this.usersData !==undefined || e.value.role_name == pdoff && enitiyid.entity_type_id == 1 || e.value.role_name == pdexu && enitiyid.entity_type_id == 1) { + + if(e.role_name == pdoff && enitiyid.entity_type_id == 1 ||e.role_name == pdexu && enitiyid.entity_type_id == 1 || e.value.role_name == pdoff && enitiyid.entity_type_id == 1 || e.value.role_name == pdexu && enitiyid.entity_type_id == 1){ this.roleAccess = true; }else{ diff --git a/ng6-seed/src/app/settings/users/user-list/user-list.component.html b/ng6-seed/src/app/settings/users/user-list/user-list.component.html index cc5a4df7a..b5a3a6fed 100644 --- a/ng6-seed/src/app/settings/users/user-list/user-list.component.html +++ b/ng6-seed/src/app/settings/users/user-list/user-list.component.html @@ -36,19 +36,41 @@ Mobile No {{us.mobile_no}} - + + Roles + {{us.role_name}} + + + Entities + {{us.entitytypename}} + Is Active - done - close + + + + + + Actions - edit + edit @@ -61,6 +83,6 @@ - +
diff --git a/ng6-seed/src/app/settings/users/user-list/user-list.component.ts b/ng6-seed/src/app/settings/users/user-list/user-list.component.ts index 6e6e4be5d..29f23fae9 100644 --- a/ng6-seed/src/app/settings/users/user-list/user-list.component.ts +++ b/ng6-seed/src/app/settings/users/user-list/user-list.component.ts @@ -5,6 +5,8 @@ import { MatPaginator, MatTableDataSource,MatSort } from '@angular/material'; import { UserService } from '../../service/user.service'; import { DataSource } from '@angular/cdk/table'; import { CognitoService } from '../../../AwsService/cognito.service'; + + @Component({ selector: 'app-user-list', templateUrl: './user-list.component.html', @@ -13,11 +15,13 @@ import { CognitoService } from '../../../AwsService/cognito.service'; export class UserListComponent implements OnInit { public dataLength: number; public dataSource = new MatTableDataSource(); - displayedColumns = ['SerialNo','FullName','Email','Mobile','Actions', 'IsActive']; + displayedColumns = ['SerialNo','FullName','Email','Mobile','Roles','Entity','Actions', 'IsActive']; @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; - + color="primary"; + // pagination variable details + pageSize = 10; userdata: any = []; loader: boolean = false; @@ -41,9 +45,6 @@ export class UserListComponent implements OnInit { } - - - ngOnInit() { delete this.aws.localUserId; diff --git a/ng6-seed/src/app/shared/menu-items/menu-items.ts b/ng6-seed/src/app/shared/menu-items/menu-items.ts index 55f03f401..528934907 100644 --- a/ng6-seed/src/app/shared/menu-items/menu-items.ts +++ b/ng6-seed/src/app/shared/menu-items/menu-items.ts @@ -72,7 +72,7 @@ const MENUITEMS : Menu[] = [ }, { - state:'pdtrigger', + state:'personal_discussion', name:'Personal Discussion', type:'link', icon:'forum', diff --git a/ng6-seed/src/app/template/questions/add/add.component.html b/ng6-seed/src/app/template/questions/add/add.component.html index c088d4150..fe8959ae8 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.html +++ b/ng6-seed/src/app/template/questions/add/add.component.html @@ -3,7 +3,7 @@

{{pageTitle}}

-
+
diff --git a/ng6-seed/src/app/template/service/templates/templates.service.spec.ts b/ng6-seed/src/app/template/service/templates/templates.service.spec.ts new file mode 100644 index 000000000..1e482017f --- /dev/null +++ b/ng6-seed/src/app/template/service/templates/templates.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { TemplatesService } from './templates.service'; + +describe('TemplatesService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: TemplatesService = TestBed.get(TemplatesService); + expect(service).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/template/service/templates/templates.service.ts b/ng6-seed/src/app/template/service/templates/templates.service.ts new file mode 100644 index 000000000..875551de0 --- /dev/null +++ b/ng6-seed/src/app/template/service/templates/templates.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class TemplatesService { + + constructor() { } +} diff --git a/ng6-seed/src/app/template/template.module.ts b/ng6-seed/src/app/template/template.module.ts index 732349611..880c418bf 100644 --- a/ng6-seed/src/app/template/template.module.ts +++ b/ng6-seed/src/app/template/template.module.ts @@ -8,7 +8,10 @@ import { MatRadioModule, MatButtonModule,MatTableModule,MatPaginatorModule, MatProgressBarModule,MatDialogModule, MatSortModule, - MatToolbarModule,MatSelectModule } from '@angular/material'; + MatToolbarModule,MatSelectModule, +MatListModule, MatMenuModule, + MatCheckboxModule, MatStepperModule, MatTabsModule, + MatExpansionModule } from '@angular/material'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; @@ -44,6 +47,9 @@ import { MastersService } from './service/masters/masters.service'; MatButtonModule,MatTableModule,MatPaginatorModule, MatProgressBarModule,MatDialogModule, MatSortModule, MatToolbarModule,MatSelectModule, + MatListModule, MatMenuModule, + MatCheckboxModule, MatStepperModule, MatTabsModule, + MatExpansionModule , FormsModule,ReactiveFormsModule, // HttpClientModule, ], diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html new file mode 100644 index 000000000..217c94345 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html @@ -0,0 +1,38 @@ +
+
+ + +
+
+
+ + + {{ category.name }} + + + +
+
+ + + % +
+
+ + +
+
+ + +
+
+
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.scss b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.scss similarity index 100% rename from ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.scss rename to ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.scss diff --git a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.spec.ts b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.spec.ts similarity index 51% rename from ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.spec.ts rename to ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.spec.ts index 73b41f696..962cea890 100644 --- a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.spec.ts +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { EditPdApplicantComponent } from './edit-pd-applicant.component'; +import { EditCategoryComponent } from './edit-category.component'; -describe('EditPdApplicantComponent', () => { - let component: EditPdApplicantComponent; - let fixture: ComponentFixture; +describe('EditCategoryComponent', () => { + let component: EditCategoryComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditPdApplicantComponent ] + declarations: [ EditCategoryComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(EditPdApplicantComponent); + fixture = TestBed.createComponent(EditCategoryComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.ts b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.ts new file mode 100644 index 000000000..2687c5cf1 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.ts @@ -0,0 +1,103 @@ +import { Component, ViewChild, OnInit, OnDestroy, Input } from '@angular/core'; +import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material'; +import { FormGroup, FormControl, FormBuilder, Validators , FormArray} from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DataSource } from '@angular/cdk/table'; +import { Observable } from 'rxjs/Observable'; + +@Component({ + selector: 'app-template-edit-category', + templateUrl: './edit-category.component.html', + styleUrls: ['./edit-category.component.scss'] +}) +export class EditCategoryComponent implements OnInit, OnDestroy { + + @Input() questionId: number; + + public _editTempCategoryFrom: FormGroup; + public submitted = false; + constructor( + private _formBuilder: FormBuilder, + public dialog: MatDialog) { + } + + + ngOnInit() { + this.initalLoadFormData(); + if(this.categoryList.length > 0){ + for (let val of this.categoryList) { + // alert(JSON.stringify(val)); + let vals = val; + this.addLanguage(vals['fk_category_id'], vals['name'], vals['weightage'], null); + } + } + } + + initalLoadFormData(){ + this._editTempCategoryFrom = this._formBuilder.group({ + temp_category: this._formBuilder.array([ + // this.initAnswers(), + ]) + }) + } + + // convenience getter for easy access to form fields + get f() { return this._editTempCategoryFrom.controls; } + + public m_categoryList = [{ + fk_category_id: 1, + name: 'Category List 1', + weightage: 2, + },{ + fk_category_id: 2, + name: 'Category List 2', + weightage: 5, + },{ + fk_category_id: 3, + name: 'Category List 2', + weightage: 5, + }]; + + public categoryList = [{ + fk_category_id: 1, + name: 'Category List 1', + weightage: 2, + },{ + fk_category_id: 2, + name: 'Category List 2', + weightage: 5, + }]; + + // Dynamic Form field creation Functionality : START ===> + initAnswers(fk_cat_id, name, weightage) { + return this._formBuilder.group({ + fk_category_id: [fk_cat_id, Validators.compose([Validators.required])], + name: [name, Validators.compose([Validators.required])], + weightage: [weightage, Validators.compose([Validators.required])], + }); + } + addLanguage(fk_cat_id, name, weightage, e) { + const control = this._editTempCategoryFrom.controls['temp_category']; + control.push(this.initAnswers(fk_cat_id, name, weightage)); + } + removeLanguage(i: number) { + const control = this._editTempCategoryFrom.controls['temp_category']; + control.removeAt(i); + } + + // END ===> + + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + } + + ngOnDestroy(): void { + //Called once, before the instance is destroyed. + //Add 'implements OnDestroy' to the class. + } + + +} diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html new file mode 100644 index 000000000..af969774d --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html @@ -0,0 +1,46 @@ +
+
+
+
+
+ + + {{ enti.name }} + + You must Select Lender Type. + + + + + {{ enti.name }} + + You must Select Product. + + + + + {{ enti.name }} + + You must Select Category Segment. + + + + + + +
+
+
+ +
+
+ + +
+
\ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.scss b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.scss similarity index 100% rename from ng6-seed/src/app/pd-triger/edit-pd/edit-pd.component.scss rename to ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.scss diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.spec.ts b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.spec.ts new file mode 100644 index 000000000..7a62261c3 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditLenderComponent } from './edit-lender.component'; + +describe('EditLenderComponent', () => { + let component: EditLenderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditLenderComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditLenderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.ts b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.ts new file mode 100644 index 000000000..7c8ba8437 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.ts @@ -0,0 +1,74 @@ +import { Component, ViewChild, OnInit, OnDestroy, Input } from '@angular/core'; +import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material'; +import { FormGroup, FormControl, FormBuilder, Validators , FormArray} from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DataSource } from '@angular/cdk/table'; +import { Observable } from 'rxjs/Observable'; + +@Component({ + selector: 'app-template-edit-lender', + templateUrl: './edit-lender.component.html', + styleUrls: ['./edit-lender.component.scss'] +}) +export class EditLenderComponent implements OnInit { + + + @Input() questionId: number; + + public _editTempLenderFrom: FormGroup; + public submitted = false; + constructor( + private _formBuilder: FormBuilder) { + } + + ngOnInit() { + this._editTempLenderFrom = this._formBuilder.group({ + temp_lender: this._formBuilder.array([ + this.initAnswers(), + ]) + }) + } + + // convenience getter for easy access to form fields + get f() { return this._editTempLenderFrom.controls; } + + + public entityOptions = [{ + fk_lender_id: 1, + name: 'Lender1' + },{ + fk_lender_id: 2, + name: 'Lender2' + }]; + + // Dynamic Form field creation Functionality : START ===> + initAnswers() { + return this._formBuilder.group({ + fk_lender_id: ['', Validators.compose([Validators.required])], + fk_product_id: ['', Validators.compose([Validators.required])], + fk_category_segment_id: ['', Validators.compose([Validators.required])], + }); + } + addLanguage(e) { + const control = this._editTempLenderFrom.controls['temp_lender']; + control.push(this.initAnswers()); + } + removeLanguage(i: number) { + const control = this._editTempLenderFrom.controls['temp_lender']; + control.removeAt(i); + } + + // END ===> + + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + } + + ngOnDestroy(): void { + //Called once, before the instance is destroyed. + //Add 'implements OnDestroy' to the class. + } +} diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.html new file mode 100644 index 000000000..c8a3175eb --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.html @@ -0,0 +1,100 @@ + + + + + + + Category 1 + + + 50% + + + + + + + + + Category 2 + + + 50% + + +

I'm visible because I am open

+
+
+
diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.scss b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.spec.ts b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.spec.ts new file mode 100644 index 000000000..f9cb80e43 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditQuestionAnswerComponent } from './edit-question-answer.component'; + +describe('EditQuestionAnswerComponent', () => { + let component: EditQuestionAnswerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditQuestionAnswerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditQuestionAnswerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.ts b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.ts new file mode 100644 index 000000000..7c53dca47 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-question-answer/edit-question-answer.component.ts @@ -0,0 +1,104 @@ +import { Component, ViewChild, OnInit, OnDestroy, Input } from '@angular/core'; +import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material'; +import { FormGroup, FormControl, FormBuilder, Validators , FormArray} from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DataSource } from '@angular/cdk/table'; +import { Observable } from 'rxjs/Observable'; + +@Component({ + selector: 'app-template-edit-question-answer', + templateUrl: './edit-question-answer.component.html', + styleUrls: ['./edit-question-answer.component.scss'] +}) +export class EditQuestionAnswerComponent implements OnInit { + + + @Input() questionId: number; + + public _editTempCategoryFrom: FormGroup; + public submitted = false; + public panelOpenState : boolean; + constructor( + private _formBuilder: FormBuilder, + public dialog: MatDialog) { + } + + + ngOnInit() { + this.initalLoadFormData(); + if(this.categoryList.length > 0){ + for (let val of this.categoryList) { + // alert(JSON.stringify(val)); + let vals = val; + this.addLanguage(vals['fk_category_id'], vals['name'], vals['weightage'], null); + } + } + } + + initalLoadFormData(){ + this._editTempCategoryFrom = this._formBuilder.group({ + temp_category: this._formBuilder.array([ + // this.initAnswers(), + ]) + }) + } + + // convenience getter for easy access to form fields + get f() { return this._editTempCategoryFrom.controls; } + + public m_categoryList = [{ + fk_category_id: 1, + name: 'Category List 1', + weightage: 2, + },{ + fk_category_id: 2, + name: 'Category List 2', + weightage: 5, + },{ + fk_category_id: 3, + name: 'Category List 2', + weightage: 5, + }]; + + public categoryList = [{ + fk_category_id: 1, + name: 'Category List 1', + weightage: 2, + },{ + fk_category_id: 2, + name: 'Category List 2', + weightage: 5, + }]; + + // Dynamic Form field creation Functionality : START ===> + initAnswers(fk_cat_id, name, weightage) { + return this._formBuilder.group({ + fk_category_id: [fk_cat_id, Validators.compose([Validators.required])], + name: [name, Validators.compose([Validators.required])], + weightage: [weightage, Validators.compose([Validators.required])], + }); + } + addLanguage(fk_cat_id, name, weightage, e) { + const control = this._editTempCategoryFrom.controls['temp_category']; + control.push(this.initAnswers(fk_cat_id, name, weightage)); + } + removeLanguage(i: number) { + const control = this._editTempCategoryFrom.controls['temp_category']; + control.removeAt(i); + } + + // END ===> + + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + } + + ngOnDestroy(): void { + //Called once, before the instance is destroyed. + //Add 'implements OnDestroy' to the class. + } + +} diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html index a2d2f3f4e..abf8dcde4 100644 --- a/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html +++ b/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html @@ -1,56 +1,38 @@ + -
-

{{pageTitle}}

-
-
+
-
-
-
+
Template Name
+
+ +
- - You must Include Pan Number. - -
+ + + +
+ + +
+
+
- - - - -
- Fill out your name - - - -
- -
-
-
- -
- Fill out your address - - - -
- - -
-
-
- - Done - You are now done. -
- - -
-
-
+ + + + + + + + + + + + + + + diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.ts b/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.ts index 6881ca31f..9f15b1428 100644 --- a/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.ts +++ b/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.ts @@ -16,11 +16,14 @@ import { TemplateListComponent } from './../templates.list.component'; templateUrl: './templates.edit.component.html' }) export class TemplateEditComponent implements OnInit, OnDestroy { - public pageTitle: string = "Edit Template"; + public pageTitle: string = "Edit Template"; + public question_id : number; + public submitted: boolean = false; constructor( private route: ActivatedRoute, private router: Router, private templateListComponent : TemplateListComponent) { + this.question_id = this.route.snapshot.params['question-id']; } ngOnInit() { @@ -32,6 +35,12 @@ export class TemplateEditComponent implements OnInit, OnDestroy { this.router.navigate([ '../../' ], { relativeTo: this.route }); } + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + } + ngOnDestroy(): void { //Called once, before the instance is destroyed. //Add 'implements OnDestroy' to the class. diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.html b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.html index efc3cdd58..ab73ed692 100644 --- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.html +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.html @@ -1,11 +1,73 @@
- - - - + + +
+ + +
+
Template Master
+
List of Templates
+
+
+
+ +
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+ {{ template.template_name }} +
+
+
+ {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} , +
+
+
+
+
+ +
+
+
+
+
+ +
No Record Found ...
+
+ + + +
+
+ + -
+
- -
\ No newline at end of file + +
+ + + \ No newline at end of file diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss new file mode 100644 index 000000000..fa863a272 --- /dev/null +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss @@ -0,0 +1,52 @@ +// mat table css + +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +.mat-form-field { + font-size: 14px; +// width: 100%; +} + +.mat-table { + overflow: auto; + max-height: 500px; +} + +.text-line-limit { + text-overflow: ellipsis; + overflow: hidden; + // white-space: nowrap; + display: -webkit-box; + line-height: 16px; /* fallback */ + max-height: 32px; /* fallback */ + -webkit-line-clamp: 2; /* number of lines to show */ + -webkit-box-orient: vertical; + + // text-overflow: ellipsis; + // overflow: hidden; + // width: 160px; + // height: 1.2em; + // white-space: nowrap; +} + +.category-label { + padding: 2px 6px; + background: #629cff; + color: #fff; + box-shadow: 0 2px 3px #c8bbbb; +} + +.no-record-found { + font-size: 18px; + color: #03a9f4; + padding : 12px 8px; +} \ No newline at end of file diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts index 6062bc415..12501d0ab 100644 --- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts @@ -11,25 +11,81 @@ import { Observable } from 'rxjs/Observable'; */ @Component({ selector: 'app-list', + styleUrls: ['./templates.list.component.scss'], templateUrl: './templates.list.component.html' }) export class TemplateListComponent implements OnInit, OnDestroy { - public listView: boolean = true; + + public templateList = []; + public listView: boolean; public names: string; + public noTemplMasterRecrdFound: boolean = false; + + // pagination variable details + length = 50; + pageIndex = 0; + pageSize = 10; + pageEvent: PageEvent; + + // data source variable details + templateListData = null; + public dataLength: number; + public dataSource = new MatTableDataSource(); + displayedColumns = ['categroy_name', 'question', 'actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + constructor( private route: ActivatedRoute, private router: Router) { + this.listView = true; // this.names = 'dinesh'; } ngOnInit() { - // alert(1); - alert(); this.listView = true; + this.getTemplateMastersListDetails(); + } + + + // get question master list details + getTemplateMastersListDetails() { + this.templateList = this.m_templateList.records; + this.templateListData = this.m_templateList.records; + this.dataLength = this.m_templateList.records.length; + this.dataSource.data = this.templateListData; + + // this.noTemplMasterRecrdFound = false; + // this.search_cid = this.filterFormGroupCtrl.controls.category.value; + // console.log(this.search_cid + ", " + this.filterFormGroupCtrl); + // this.questionsService.getQuestionMasterDetails(this.search_cid).subscribe( + // data => { + // if (data) { + // if (data.records) { + // this.templateList = data.records; + // this.templateListData = data.records; + // this.dataLength = data.records.length; + // this.dataSource.data = this.templateListData; + // } else { + // this.templateList = []; + // this.dataLength = null; + // this.noTemplMasterRecrdFound = true; + // } + // } else { + // this.templateList = []; + // this.dataLength = null; + // this.noTemplMasterRecrdFound = true; + // } + // } + // ) } - goToEdit(){ - this.router.navigate([ '../list/edit', '1' ], { relativeTo: this.route }); + + + + goToEdit(template_id : number){ + this.router.navigate([ '../list/edit', template_id ], { relativeTo: this.route }); this.listView = false; } @@ -41,7 +97,112 @@ export class TemplateListComponent implements OnInit, OnDestroy { ngOnDestroy(): void { //Called once, before the instance is destroyed. //Add 'implements OnDestroy' to the class. - alert(); } + + public m_templateList = { + "dataStatus": true, + "status": 200, + "records": + [ + { + "template_id": "1", + "template_name": "sample dev template", + "createdon": "28/09/2018", + "fk_createdby": "1", + "updatedon": null, + "fk_updatedby": null, + "isactive": "1", + "createdby": "sriram v", + "updatedby": null, + "lender_details": [] + }, + { + "template_id": "2", + "template_name": "two template", + "createdon": "28/09/2018", + "fk_createdby": "1", + "updatedon": null, + "fk_updatedby": null, + "isactive": "1", + "createdby": "sriram v", + "updatedby": null, + "lender_details": [] + }, + { + "template_id": "3", + "template_name": "ABCD template redd", + "createdon": "11/10/2018", + "fk_createdby": "1", + "updatedon": null, + "fk_updatedby": null, + "isactive": "1", + "createdby": "sriram v", + "updatedby": null, + "lender_details": [ + { + "template_lender_map_id": "1", + "fk_template_id": "3", + "fk_lender_id": "1", + "full_name": "ICICIedited", + "short_name": "checkee", + "fk_product_id": "1", + "product_name": "Home Loan ", + "product_abbr": "HL", + "fk_customer_segment": "1", + "customer_segment_name": "Salaried Non Professional ", + "customer_segment_abbr": "SNP", + "createdon": "11/10/2018", + "fk_createdby": "1", + "updatedon": null, + "isactive": "1", + "fk_updatedby": null, + "createdby": "sriram v", + "updatedby": null + }, + { + "template_lender_map_id": "2", + "fk_template_id": "3", + "fk_lender_id": "1", + "full_name": "ICICIedited", + "short_name": "checkee", + "fk_product_id": "2", + "product_name": "Non Residential Premises Loans", + "product_abbr": "NRPL", + "fk_customer_segment": "2", + "customer_segment_name": "Salaried Professional ", + "customer_segment_abbr": "SP", + "createdon": "11/10/2018", + "fk_createdby": "1", + "updatedon": "11/10/2018", + "isactive": "1", + "fk_updatedby": null, + "createdby": "sriram v", + "updatedby": null + }, + { + "template_lender_map_id": "2", + "fk_template_id": "3", + "fk_lender_id": "1", + "full_name": "ICICIedited", + "short_name": "checkee", + "fk_product_id": "2", + "product_name": "Non Residential Premises Loans", + "product_abbr": "NRPL", + "fk_customer_segment": "2", + "customer_segment_name": "Salaried Professional ", + "customer_segment_abbr": "SP", + "createdon": "11/10/2018", + "fk_createdby": "1", + "updatedon": "11/10/2018", + "isactive": "1", + "fk_updatedby": null, + "createdby": "sriram v", + "updatedby": null + } + ] + } + ] +} + } diff --git a/ng6-seed/src/app/template/templates/templates.component.ts b/ng6-seed/src/app/template/templates/templates.component.ts index ace2651e4..4440478d4 100644 --- a/ng6-seed/src/app/template/templates/templates.component.ts +++ b/ng6-seed/src/app/template/templates/templates.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; @Component({ - template: `

Templates Master Details List

+ template: `
diff --git a/ng6-seed/src/app/template/templates/templates.module.ts b/ng6-seed/src/app/template/templates/templates.module.ts index f7ca24067..a7c1b6938 100644 --- a/ng6-seed/src/app/template/templates/templates.module.ts +++ b/ng6-seed/src/app/template/templates/templates.module.ts @@ -12,7 +12,8 @@ import { MatProgressBarModule,MatDialogModule, MatSortModule, MatToolbarModule,MatSelectModule, MatListModule, MatMenuModule, - MatCheckboxModule, MatStepperModule + MatCheckboxModule, MatStepperModule, MatTabsModule, + MatExpansionModule } from '@angular/material'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -24,6 +25,9 @@ import { TemplatesRouting } from './templates.routing'; import { TemplatesComponent } from './templates.component'; import { TemplateListComponent } from './templates-list/templates.list.component'; import { TemplateEditComponent } from './templates-list/edit/templates.edit.component'; +import { EditCategoryComponent } from './templates-list/edit/edit-category/edit-category.component'; +import { EditLenderComponent } from './templates-list/edit/edit-lender/edit-lender.component'; +import { EditQuestionAnswerComponent } from './templates-list/edit/edit-question-answer/edit-question-answer.component'; // import { QuestionsService } from './../service/questions/questions.service'; /* @@ -86,7 +90,9 @@ const customNotifierOptions: NotifierOptions = { MatButtonModule,MatTableModule,MatPaginatorModule, MatProgressBarModule,MatDialogModule, MatSortModule, MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule, + MatExpansionModule, MatStepperModule, + MatTabsModule, MatSlideToggleModule, MatCheckboxModule, FormsModule, @@ -96,7 +102,10 @@ const customNotifierOptions: NotifierOptions = { declarations: [ TemplatesComponent, TemplateListComponent, - TemplateEditComponent + TemplateEditComponent, + EditCategoryComponent, + EditLenderComponent, + EditQuestionAnswerComponent ], entryComponents: [ ], diff --git a/ng6-seed/src/index.html b/ng6-seed/src/index.html index 3a317457e..5e6c787ef 100644 --- a/ng6-seed/src/index.html +++ b/ng6-seed/src/index.html @@ -121,6 +121,9 @@ transform: scale3D(0, 0, 1); } } + .mat-cell{ + font-size:1.2em !important; + }