Procházet zdrojové kódy

remove console logs

onunez před 6 roky
rodič
revize
3c61fd7167

+ 3 - 15
src/app/components/assets/assets.component.ts

@@ -21,15 +21,12 @@ import { formatDate } from '@angular/common';
 
 import {AngularMyDatePickerDirective,IAngularMyDpOptions, IMyDateModel} from 'angular-mydatepicker';
 
-
-
 @Component({
   selector: 'app-assets',
   templateUrl: './assets.component.html',
   styleUrls: ['./assets.component.scss']
 })
 
-
 export class AssetsComponent implements OnInit {
   
   title = "Plantas";
@@ -92,10 +89,7 @@ export class AssetsComponent implements OnInit {
       
       this.route.queryParams.subscribe(params => {
         this.organizationId = params['id'];
-        console.log("organization");
-        console.log(this.organizationId); 
       });
-
       
       Swal.fire({
         allowOutsideClick: false,
@@ -136,13 +130,11 @@ export class AssetsComponent implements OnInit {
       this.onMeasureClickRange(this.view, this.initialDate);
 
       let energy_produced = this.logsService.getEnergySummaryByAsset(this.organizationId).subscribe(resp => {
-        console.log(resp);
         this.eProduced = resp["data"]["energy"];//results[1];
         this.energyDay = this.eProduced.today.total_energy_kWh;
-        this.energyWeek = this.eProduced.thisWeek.total_energy_kWh > 0 ? this.eProduced.thisWeek.total_energy_kWh/1000 : this.eProduced.thisWeek.total_energy_kWh
-        this.energyMonth = this.eProduced.thisMonth.total_energy_kWh > 0 ? this.eProduced.thisMonth.total_energy_kWh/1000 : this.eProduced.thisMonth.total_energy_kWh
-        this.energyYear = this.eProduced.lifeTime.total_energy_kWh > 0 ? this.eProduced.lifeTime.total_energy_kWh/1000 : this.eProduced.lifeTime.total_energy_kWh
-        console.log(this.energyYear);
+        this.energyWeek = this.eProduced.thisWeek.total_energy_kWh > 0 ? (this.eProduced.thisWeek.total_energy_kWh/1000).toFixed(2) : this.eProduced.thisWeek.total_energy_kWh
+        this.energyMonth = this.eProduced.thisMonth.total_energy_kWh > 0 ? (this.eProduced.thisMonth.total_energy_kWh/1000).toFixed(2) : this.eProduced.thisMonth.total_energy_kWh
+        this.energyYear = this.eProduced.lifeTime.total_energy_kWh > 0 ? (this.eProduced.lifeTime.total_energy_kWh/1000).toFixed(2) : this.eProduced.lifeTime.total_energy_kWh
       });
 
     }, (err) => {
@@ -153,8 +145,6 @@ export class AssetsComponent implements OnInit {
       });
     });
 
-
-
     //this.chartjs = true;
     setTimeout(()=>{
       Swal.close();
@@ -263,8 +253,6 @@ export class AssetsComponent implements OnInit {
 
     this.logsService.getEnergyProducedByParams(assetId,interval,dateRange).toPromise()
     .then((data: any) => {
-      console.log("meters");
-      console.log(data);
       this.metersData = [];      
       this.metersKeys = Object.keys(data["data"]["dataset"]);
 

+ 0 - 5
src/app/components/dashboard/dashboard.component.ts

@@ -86,9 +86,7 @@ export class DashboardComponent implements OnInit {
     
     this.plantsService.getAllAssets().subscribe(res => {
       this.listAssets = res["data"]["assets"];
-      console.log(this.listAssets);
       this.assetKeys = Object.keys(this.listAssets);
-      console.log("assetKeys");
       for (let prop in this.assetKeys){
         this.meterKeys2 = Object.keys(this.listAssets.map(item => item["meters_installed"])[prop]);
         for (let prop2 in this.meterKeys2){
@@ -152,9 +150,6 @@ export class DashboardComponent implements OnInit {
     let lat, long, address, name2;
 
     for (const plant of this.listAssets) {
-      console.log(plant.meters_installed[0]);
-
-      console.log("assets");
       if (localStorage.getItem("email") == "inverlec@grupomerelec.com") {
         lat = "13.6613819";
         long = "-89.2514334";

+ 1 - 2
src/app/components/organizations/edit-organization/edit-organization.component.ts

@@ -16,13 +16,12 @@ export class EditOrganizationComponent implements OnInit {
   listOrganization: any;
   organizationExists:boolean;
   organizationForm: FormGroup;
+  organizationId:any;
 
   constructor(private orgService: OrganizationsService, private formBuilder: FormBuilder, private route: ActivatedRoute) {
     this.route.params.subscribe(params => {
       console.log(params);
       this.organizationId = params['id'];
-      console.log("organization");
-      console.log(this.organizationId); 
     });
 
     this.orgService.getOrganization(this.organizationId).subscribe(res => {

+ 0 - 2
src/app/components/organizations/organizations.component.ts

@@ -47,11 +47,9 @@ export class OrganizationsComponent implements OnInit {
     this.orgService.getListOrganizations().subscribe(res =>
       this.listData = res
     );
-    console.log(this.listData);
     
     this.orgService.getAllOrganizations().subscribe(ans => {
       this.listOrganization = ans["data"]["organizations"];
-      console.log(this.listOrganization);
       this.dataSource.data = this.listOrganization;
       this.dataSource.paginator = this.paginator;
       this.dataSource.sort = this.sort;

+ 0 - 1
src/app/components/plants/plants.component.ts

@@ -39,7 +39,6 @@ export class PlantsComponent implements OnInit {
   ngOnInit() {
     this.orgService.getAllAssets().subscribe(ans => {
       this.listPlant = ans["data"]["assets"];
-      console.log(this.listPlant);
       this.dataSource.data = this.listPlant;
       this.dataSource.paginator = this.paginator;
       this.dataSource.sort = this.sort;

+ 0 - 3
src/app/components/shared/sidebar/sidebar.component.ts

@@ -43,11 +43,8 @@ export class SidebarComponent implements OnInit {
   role_number:any;
 
   constructor(private auth: AuthService, private router: Router) {
-    console.log("encryted user menu");
-    console.log(localStorage.getItem("USER_MENU"));
     var bytes  = CryptoJS.AES.decrypt(localStorage.getItem("USER_MENU"), 'soma-inverlec-2019');
     this.role_number = bytes.toString(CryptoJS.enc.Utf8);
-    console.log(this.role_number);
   }
 
   ngOnInit() {

+ 0 - 1
src/app/components/users/users.component.ts

@@ -39,7 +39,6 @@ export class UsersComponent implements OnInit {
   ngOnInit() {
     this.userService.getAllUsers().subscribe(ans => {
       this.listUsers = ans["data"]["users"];
-      console.log(this.listUsers);
       this.dataSource.data = this.listUsers;
       this.dataSource.paginator = this.paginator;
       this.dataSource.sort = this.sort;

+ 0 - 2
src/app/services/plants.service.ts

@@ -35,7 +35,6 @@ export class PlantsService extends PlantData {
   }
 
   getAllAssets(){
-    console.log("get assetss");
     return this.http.get<any>(`${environment.productionApiUrl}/assets`, {})
     .pipe(
       map(response => {
@@ -46,7 +45,6 @@ export class PlantsService extends PlantData {
   }
 
   getAssetById(assetId:string){
-    console.log("get asset by id");
     return this.http.get<any>(`${environment.productionApiUrl}/asset/${assetId}`, {})
     .pipe(
       map(response => {

+ 1 - 1
src/app/services/user.service.ts

@@ -21,7 +21,7 @@ export class UserService {
 
   createUser(user: { first_name :string, last_name :string, 
     email :string, role :string }): Observable<boolean> {
-      return this.http.post<any>(`${environment.productionApiUrl}/organizations`, user)
+      return this.http.post<any>(`${environment.productionApiUrl}/users`, user)
       .pipe(
         map(response => {
           return response;