Skip to content

Commit

Permalink
Updated logs in events page
Browse files Browse the repository at this point in the history
  • Loading branch information
NandiniAV committed Jun 16, 2022
1 parent c4ef4c1 commit 54b48fd
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 26 deletions.
50 changes: 36 additions & 14 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/favicon.png", "src/mdo-assets"],
"assets": [
"src/favicon.ico",
"src/favicon.png",
"src/mdo-assets"
],
"stylePreprocessorOptions": {
"includePaths": ["src/styles"]
"includePaths": [
"src/styles"
]
},
"styles": [
{
Expand Down Expand Up @@ -95,7 +101,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
Expand All @@ -121,7 +127,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
Expand All @@ -147,7 +153,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
Expand All @@ -173,7 +179,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
Expand All @@ -199,7 +205,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
Expand Down Expand Up @@ -246,16 +252,27 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/mdo-assets"],
"styles": ["src/styles.scss"],
"assets": [
"src/favicon.ico",
"src/mdo-assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
"exclude": ["**/node_modules/**"]
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
Expand Down Expand Up @@ -296,8 +313,13 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["project/ws/app/tsconfig.lib.json", "project/ws/app/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"tsConfig": [
"project/ws/app/tsconfig.lib.json",
"project/ws/app/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
Expand All @@ -312,4 +334,4 @@
"cli": {
"analytics": false
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AfterViewInit, Component, OnInit, OnDestroy } from '@angular/core'
import { Router, ActivatedRoute } from '@angular/router'
import { EventsService } from '../../services/events.service'
import { ConfigurationsService, EventService, LoggerService } from '@sunbird-cb/utils'
import { ConfigurationsService, EventService } from '@sunbird-cb/utils'
import * as moment from 'moment'
/* tslint:disable */
import _ from 'lodash'
Expand Down Expand Up @@ -34,19 +34,20 @@ export class ListEventComponent implements OnInit, AfterViewInit, OnDestroy {
private eventSvc: EventsService,
private configSvc: ConfigurationsService,
private activeRoute: ActivatedRoute,
private events: EventService,
private logger: LoggerService,
private events: EventService
) {
this.math = Math
if (this.configSvc.userProfile) {
this.currentUser = this.configSvc.userProfile && this.configSvc.userProfile.userId
this.department = this.configSvc.userProfile && this.configSvc.userProfile.departmentName
this.departmentID = this.configSvc.userProfile && this.configSvc.userProfile.rootOrgId
this.logger.log(this.departmentID)
// tslint:disable-next-line:no-console
console.log('departmentID', this.departmentID)
} else {
if (_.get(this.activeRoute, 'snapshot.data.configService.userProfile.rootOrgId')) {
this.departmentID = _.get(this.activeRoute, 'snapshot.data.configService.userProfile.rootOrgId')
this.logger.log(this.departmentID)
// tslint:disable-next-line:no-console
console.log('departmentID', this.departmentID)
}
if (_.get(this.activeRoute, 'snapshot.data.configService.userProfile.departmentName')) {
this.department = _.get(this.activeRoute, 'snapshot.data.configService.userProfile.departmentName')
Expand Down Expand Up @@ -106,7 +107,8 @@ export class ListEventComponent implements OnInit, AfterViewInit, OnDestroy {
}

this.eventSvc.getEventsList(requestObj).subscribe((events: any) => {
this.logger.log(events)
// tslint:disable-next-line:no-console
console.log('events', events)
this.setEventListData(events)
})
}
Expand Down Expand Up @@ -141,7 +143,8 @@ export class ListEventComponent implements OnInit, AfterViewInit, OnDestroy {
}
const isPast = this.compareDate(expiryDateFormat);
(isPast) ? this.eventData['pastEvents'].push(eventDataObj) : this.eventData['upcomingEvents'].push(eventDataObj)
this.logger.log(eventDataObj)
// tslint:disable-next-line:no-console
console.log('eventDataObj', eventDataObj)
}
})
this.filter('upcoming')
Expand All @@ -164,7 +167,8 @@ export class ListEventComponent implements OnInit, AfterViewInit, OnDestroy {
filter(key: string | 'timestamp' | 'best' | 'saved') {
const upcomingEventsData: any[] = []
const pastEventsData: any[] = []
this.logger.log(this.eventData)
// tslint:disable-next-line:no-console
console.log('eventData', this.eventData)
if (this.eventData['pastEvents'] && this.eventData['pastEvents'].length > 0) {
this.eventData['pastEvents'].forEach((event: any) => {
pastEventsData.push(event)
Expand All @@ -182,15 +186,18 @@ export class ListEventComponent implements OnInit, AfterViewInit, OnDestroy {
switch (key) {
case 'upcoming':
this.data = upcomingEventsData
this.logger.log(this.data)
// tslint:disable-next-line:no-console
console.log('data', this.data)
break
case 'past':
this.data = pastEventsData
this.logger.log(this.data)
// tslint:disable-next-line:no-console
console.log('data', this.data)
break
default:
this.data = upcomingEventsData
this.logger.log(this.data)
// tslint:disable-next-line:no-console
console.log('data', this.data)
break
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/component/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ export class RootComponent implements OnInit, AfterViewInit {

raiseAppStartTelemetry() {
if (!this.appStartRaised) {
this.logger.log(WsEvents.WsEventLogLevel.Info)
// tslint:disable-next-line:no-console
console.log('WsEvents.WsEventLogLevel', WsEvents.WsEventLogLevel)
const event = {
eventType: WsEvents.WsEventType.Telemetry,
eventLogLevel: WsEvents.WsEventLogLevel.Info,
Expand Down

0 comments on commit 54b48fd

Please sign in to comment.