From f99edf725bdb043e83bb4ecaf861325df9cc99b1 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Sat, 17 Nov 2018 18:57:55 +0530 Subject: [PATCH] CSS changes --- .../app/dashboard/dashboard.component.html | 111 +------- .../app/dashboard/dashboard.component.scss | 20 +- .../src/app/dashboard/dashboard.component.ts | 238 ++---------------- .../client-info/client-info.component.html | 12 +- .../client-info/client-info.component.ts | 12 +- 5 files changed, 48 insertions(+), 345 deletions(-) diff --git a/ng6-seed/src/app/dashboard/dashboard.component.html b/ng6-seed/src/app/dashboard/dashboard.component.html index e9ced0e0b..058c6c795 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.html +++ b/ng6-seed/src/app/dashboard/dashboard.component.html @@ -1,19 +1,4 @@ - - - -
+
@@ -28,21 +13,6 @@
- - @@ -53,23 +23,12 @@ {{ cd.name }} / {{cd.state_name}} - +
- + @@ -81,32 +40,11 @@ {{ ld.full_name }} ({{ ld.short_name }}) - +
-
@@ -166,44 +104,5 @@
- +
diff --git a/ng6-seed/src/app/dashboard/dashboard.component.scss b/ng6-seed/src/app/dashboard/dashboard.component.scss index 103cf1481..69e8f2f0f 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.scss +++ b/ng6-seed/src/app/dashboard/dashboard.component.scss @@ -22,16 +22,16 @@ li float:left; } -::ng-deep { - .mat-form-field-appearance-outline .mat-form-field-outline { - color: white; - } - mat-form-field { - .mat-hint, input, ::placeholder, .mat-form-field-label { - color: white; - } - } - } +//::ng-deep { + // .mat-form-field-appearance-outline .mat-form-field-outline { + // color: white; + //} + //mat-form-field { + // .mat-hint, input, ::placeholder, .mat-form-field-label { + // color: white; + //} + //} + //} .example-full-width { width: 95%; diff --git a/ng6-seed/src/app/dashboard/dashboard.component.ts b/ng6-seed/src/app/dashboard/dashboard.component.ts index 8fc7cd27d..5d0e576f0 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.ts +++ b/ng6-seed/src/app/dashboard/dashboard.component.ts @@ -116,7 +116,7 @@ export class DashboardComponent { ngOnInit(){ - this.getPDSubCardData(); + this.getDoughnutChartData(); @@ -126,13 +126,18 @@ export class DashboardComponent { const toMin = new Date(today.getFullYear(), today.getMonth()-1, 1); const toMax = new Date(today.getFullYear(), today.getMonth()+2, 0); - const thismonth = new Date(today.getFullYear(), today.getMonth(), 0); -console.log(fromMin); -console.log(fromMax); -console.log(toMin); -console.log(toMax); - //const resetRange = {fromDate: today, toDate: today}; - //this.dateRangePicker.resetDates(resetRange); // will trigger selectedDateRangeChanged + const LastDateForPreMonth = new Date(today.getFullYear(), today.getMonth(), 0); + const FirstDateForPreMonth = new Date(today.getFullYear(), today.getMonth()-1, 1); + + console.log('FromDateMin:',fromMin); + console.log('FromDateMax:',fromMax); + console.log('ToDateMin',toMin); + console.log('ToDateMax',toMax); + console.log('LastDateForPreMonth',LastDateForPreMonth); + console.log('FirstDateForPreMonth',FirstDateForPreMonth); + +// const resetRange = {fromDate: today, toDate: today}; +// this.dateRangePicker.resetDates(resetRange); // will trigger selectedDateRangeChanged this.setupPresets(); @@ -184,102 +189,7 @@ console.log(toMax); ] } - /** - * To Get and Display PD Details As Per - * 1) LenderWise PD Details, - * 2) Citywise PD Details, - * 3) Alert Message of PD Details. - **/ - getPDSubCardData(){ - - /** 1) Getting Lenderwise PD Details - Daily , Weekly and Monthly Data **/ - this._dashboardService.getLenderDetail().subscribe(data => { - - console.log(' ***** Lender Wise *****'); - console.log('Lender Wise Whole Data',data); - - /** Daily Lender Datas */ - if(data.records.current_day.length != '0'){ - //console.log('If Condition day'); - } - else{ - //console.log('Else Condition day'); - } - - - /** Weekly Lender Datas */ - if(data.records.current_week.length != '0'){ - //console.log('If Condition week'); - } - else{ - //console.log('Else Condition week'); - } - - - /** Monthly Lender Datas */ - if(data.records.current_month.length != '0'){ - - this.lenderWisePD = Object.keys(data.records.current_month).map(function(key) { - return data.records.current_month[key]; - }); - console.log('Monthly Status Lenderwise PD',this.lenderWisePD); - - } - else{ - //console.log('Else Condition month'); - } - }); - - /** 2) Getting Citywise PD Details - Daily , Weekly and Monthly Data **/ - this._dashboardService.getCityDetail().subscribe(data => { - console.log(' ***** City Wise *****'); - console.log('City Wise Whole Data',data); - - /** Daily City Datas */ - if(data.records.current_day.length != '0'){ - //console.log('If Condition day'); - } - else{ - //console.log('Else Condition day'); - } - - /** Weekly City Datas */ - if(data.records.current_week.length != '0'){ - //console.log('If Condition week'); - } - else{ - //console.log('Else Condition week'); - } - - /** Monthly City Datas */ - if(data.records.current_month.length != '0'){ - - //this.cityWisePD = this.TodayFullPD.current_month; - - this.cityWisePD = Object.keys(data.records.current_month).map(function(key) { - return data.records.current_month[key]; - }); - - console.log('Monthly Status Citywise PD',this.cityWisePD); - - } - else{ - //console.log('Else Condition month'); - } - }); - - /** 3) Getting Alert Message of PD Details */ - this._dashboardService.getAlertDetail().subscribe(data => { - - console.log(' ***** Alert Message *****'); - console.log('Alert Message Whole Data',data); - this.alertMessage = data.records; - console.log('Alert Message',this.alertMessage); - }); - -} - - + /** * To Get and Display Doughnut Chart Data Based on PDType **/ @@ -613,59 +523,11 @@ getDoughnutChartData(){ console.log('total3',this.total3); console.log('total2',this.total2); console.log('total1',this.total1); -//console.log(this.tempDataTelePD.__proto__); -//console.log(this.tempDataTelePD._chartjs); -//console.log(this.doughnutChartDataForTelePD['event'].listeners["0"].chart.boxes["0"].legendItems); -//chart.chart.ctx; - /*beforeDraw: function (this.doughnutChartDataForTelePD.chart) { - if (chart.config.options.elements.center) { - //Get ctx from string - var ctx = chart.chart.ctx; - - //Get options from the center object in options - var centerConfig = chart.config.options.elements.center; - var fontStyle = centerConfig.fontStyle || 'Arial'; - var txt = centerConfig.text; - var color = centerConfig.color || '#000'; - var sidePadding = centerConfig.sidePadding || 20; - var sidePaddingCalculated = (sidePadding/100) * (chart.innerRadius * 2) - //Start with a base font of 30px - ctx.font = "30px " + fontStyle; - - //Get the width of the string and also the width of the element minus 10 to give it 5px side padding - var stringWidth = ctx.measureText(txt).width; - var elementWidth = (chart.innerRadius * 2) - sidePaddingCalculated; - - // Find out how much the font can grow in width. - var widthRatio = elementWidth / stringWidth; - var newFontSize = Math.floor(30 * widthRatio); - var elementHeight = (chart.innerRadius * 2); - - // Pick a new font size so it will not be larger than the height of label. - var fontSizeToUse = Math.min(newFontSize, elementHeight); - - //Set font settings to draw it correctly. - ctx.textAlign = 'center'; - ctx.textBaseline = 'middle'; - var centerX = ((chart.chartArea.left + chart.chartArea.right) / 2); - var centerY = ((chart.chartArea.top + chart.chartArea.bottom) / 2); - ctx.font = fontSizeToUse+"px " + fontStyle; - ctx.fillStyle = color; - - //Draw text in center - ctx.fillText(txt, centerX, centerY); - } - }*/ }) } -// setTimeout(() => { -// this.datasets = [{ -// data: [12, 19, 3, 5, 2, 3] -// }]; -// }, 100); doughnutOptions: any = Object.assign({ elements: { @@ -673,11 +535,6 @@ doughnutOptions: any = Object.assign({ borderWidth: 0 } }, - // title: { - // display: true, - // position: "top", - // text: 'Full', - // fontSize: 15, centertext:'One' },this.globalChartOptions); @@ -693,17 +550,6 @@ onChange(e :any,flag: any) { } if(flag == 2){ - // if(e.source._selected == true ){ - // let data = e.source.value.city_id; - // this.selectedCity.push(data); - // console.log('true'); - // } - // else if(e.source._selected == false){ - // let data = e.source.value.city_id; - // let index = this.selectedCity.indexOf(data); - // this.selectedCity.splice(index,1); - // console.log('false'); - // } let data = e.source.value.city_id; e.source._selected == true ? this.selectedCity.push(data) : this.selectedCity.splice(this.selectedCity.indexOf(data),1); @@ -720,11 +566,6 @@ onChange(e :any,flag: any) { } - // this._dashboardService.get2(fromdate,todate,this.selectedLender,this.selectedCity).subscribe( - - // dataresult=>{ - - // }); this._dashboardService.getPDDetailForDoughnut(fromdate,todate,this.selectedLender,this.selectedCity).subscribe(data => { @@ -758,7 +599,7 @@ onChange(e :any,flag: any) { let DraftFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'DRAFT'); if(DraftFullPDvalue.length != '0'){ - //console.log('console triggered value',TriggerFullPDvalue); + for(let FPD of DraftFullPDvalue){ let y = +FPD.count; this.total1 = this.total1+y; @@ -771,7 +612,7 @@ onChange(e :any,flag: any) { let TriggerFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); if(TriggerFullPDvalue.length != '0'){ - //console.log('console triggered value',TriggerFullPDvalue); + for(let FPD of TriggerFullPDvalue){ let y = +FPD.count; this.total1 = this.total1+y; @@ -1054,52 +895,9 @@ onChange(e :any,flag: any) { console.log('Final Tele Data Completed',this.doughnutChartDataForTelePD); console.log('temp Tele Data',this.tempDataTelePD); console.log('total3',this.total3); - console.log('total2',this.total2); - console.log('total1',this.total1); -//console.log(this.tempDataTelePD.__proto__); -//console.log(this.tempDataTelePD._chartjs); -//console.log(this.doughnutChartDataForTelePD['event'].listeners["0"].chart.boxes["0"].legendItems); -//chart.chart.ctx; + console.log('total2',this.total2); + console.log('total1',this.total1); -/*beforeDraw: function (this.doughnutChartDataForTelePD.chart) { - if (chart.config.options.elements.center) { - //Get ctx from string - var ctx = chart.chart.ctx; - - //Get options from the center object in options - var centerConfig = chart.config.options.elements.center; - var fontStyle = centerConfig.fontStyle || 'Arial'; - var txt = centerConfig.text; - var color = centerConfig.color || '#000'; - var sidePadding = centerConfig.sidePadding || 20; - var sidePaddingCalculated = (sidePadding/100) * (chart.innerRadius * 2) - //Start with a base font of 30px - ctx.font = "30px " + fontStyle; - - //Get the width of the string and also the width of the element minus 10 to give it 5px side padding - var stringWidth = ctx.measureText(txt).width; - var elementWidth = (chart.innerRadius * 2) - sidePaddingCalculated; - - // Find out how much the font can grow in width. - var widthRatio = elementWidth / stringWidth; - var newFontSize = Math.floor(30 * widthRatio); - var elementHeight = (chart.innerRadius * 2); - - // Pick a new font size so it will not be larger than the height of label. - var fontSizeToUse = Math.min(newFontSize, elementHeight); - - //Set font settings to draw it correctly. - ctx.textAlign = 'center'; - ctx.textBaseline = 'middle'; - var centerX = ((chart.chartArea.left + chart.chartArea.right) / 2); - var centerY = ((chart.chartArea.top + chart.chartArea.bottom) / 2); - ctx.font = fontSizeToUse+"px " + fontStyle; - ctx.fillStyle = color; - - //Draw text in center - ctx.fillText(txt, centerX, centerY); - } -}*/ }) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index c7e265ff5..8ad3212fd 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -1,5 +1,6 @@ +

Client Details

@@ -28,7 +29,7 @@
- + {{ pm.name }} @@ -49,7 +50,7 @@
- + {{ feq.name }} @@ -63,17 +64,18 @@
- +
- +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts index 7d03785e4..0edbad0cb 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts @@ -13,6 +13,7 @@ import { FormArray, } from '@angular/forms'; + import { NotifierService } from 'angular-notifier'; import { @@ -84,10 +85,13 @@ export class ClientInfoComponent implements OnInit { // 'name': 'Others' // } // ] +private notifier: NotifierService; constructor( +notifier: NotifierService, private _formBuilder: FormBuilder, - private pdTrigerService: PdTrigerService) { } + private pdTrigerService: PdTrigerService) { +this.notifier = notifier;} ngOnInit() { this.getM_FreqOfPurchase(); @@ -254,16 +258,16 @@ var result = Object.keys(supp_data).map(function(key) { dataresult => { if (dataresult.status == 200) { // console.log(dataresult); - // this.notifier.notify('success', 'Record Saved Successfully.!'); + this.notifier.notify('success', 'Record Saved Successfully.!'); // this.dialogRef.close(); // alert("sample alert for Saving"); } else { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); // this.errorMessage = "Some Thing Wents Wrong Try Again !"; } }, error => { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); // this.errorMessage = "Something Wents Wrong Try Again !"; // this.dialogRef.close(); });