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BgD,KAAKhD,qBAAuBgD,KAAK/C,gBAAgBC,OAAOC,OAAS,EAAI6C,KAAKhD,mBAAqBgD,KAAKhD,mBAAqB,CACrJ,CAEAiG,cACEjD,KAAKY,WAAWsC,aAClB,CAACC,SAAAnD,KAAA,mBAAAoD,iBA9FUzD,GAAkBnD,MAAA6G,KAAA7G,MAAA8G,KAAA9G,MAAA+G,KAAA,EAAAJ,SAAAnD,KAAA,UAAAwD,EAAAC,IAAA,MAAlB9D,EAAkB+D,UAAA,oBAAAC,MAAA,GAAAC,KAAA,EAAAC,OAAA,ylCAAAC,SAAA,SAAAC,EAAAC,GAAA,EAAAD,IDf/BvH,MAAA,UAAAA,CAAuB,UAAvBA,CAAuB,UAAvBA,CAAuB,OAAvBA,CAAuB,YAISA,MAAA,cAAQA,QAAQA,MAAA,GACxCA,MAAA,EAAAyH,EAAA,WAGFzH,UAEFA,MAAA,EAAA0H,EAAA,sBAyCF1H,QAEAA,MAAA,EAAA2H,GAAA,sBA2DF3H,eA5GgDA,MAAA,GAAAA,MAAA,IAAAwH,EAAA9D,cAAA,MACP1D,cAAA,aAAAA,MAAA,EAAA4H,KAKtB5H,cAAA,OAAAwH,EAAA/G,iBA2CFT,cAAA,OAAAwH,EAAA/G,m6LCtCJ0C,CAAkB,qBCH/B,MAAM0E,GAAiB,CACrB,CACEC,KAAM,GACNC,UAAW5E,KAiBR,IAAM6E,GAAe,MAAtB,MAAOA,EACX5E,cAAe,CAACuD,SAAAnD,KAAA,mBAAAoD,iBADLoB,EAAe,EAAArB,SAAAnD,KAAA,UAAAwD,EAAAiB,GAAA,MAAfD,IAAerB,SAAAnD,KAAA,UAAAwD,EAAAkB,IAAA,WAJf,CACTC,KACDC,QAAA,CARCC,KACAC,IACAC,KAAaC,SAASX,IACtBY,KACAC,eAMSV,CAAe","names":["i0","_r7","ctx_r6","navigateToPrevPhase","ctx_r8","navigateToNextPhase","_c0","ctx_r4","selectedPhaseIndex","dashboardConfig","phases","length","_c1","phase_r9","phaseProgress","DashboardComponent_ng_container_8_ng_container_1_mat_tab_5_ng_template_1_span_5_Template","phaseTitle","phaseDateLabel","DashboardComponent_ng_container_8_ng_container_1_mat_tab_5_ng_template_1_Template","DashboardComponent_ng_container_8_ng_container_1_div_2_Template","$event","_r15","ctx_r14","DashboardComponent_ng_container_8_ng_container_1_mat_tab_5_Template","_c2","ctx_r3","DashboardComponent_ng_container_8_ng_container_1_Template","ctx_r1","widget_r18","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_3_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_4_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_5_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_6_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_7_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_8_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_9_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_10_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_11_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_12_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_13_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_14_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_15_Template","DashboardComponent_ng_container_9_div_1_ng_container_2_ng_container_16_Template","_c3","widgetHorizontalPercentageSize","widgetType","DashboardComponent_ng_container_9_div_1_ng_container_2_Template","ctx_r16","widgets","DashboardComponent_ng_container_9_div_1_Template","ctx_r2","DashboardComponent","constructor","tabTitleService","ssoAuthService","dashboardService","this","userRoleId","userFirstName","nowISO","DateTime","fromJSDate","Date","setZone","toISO","ngOnInit","_this","setTabTitle","ssoAuthSub","currentRpUser$","pipe","filter","rpUser","subscribe","_ref","_asyncToGenerator","currentRole","id","firstName","resp","getDashboardConfig","toPromise","JSON","parse","config","value","dashboardSettings","forEach","phase","index","phaseStartDate","phaseEndDate","luxonPhaseStartDate","fromISO","luxonPhaseEndDate","phaseDateDiffInSeconds","diff","toObject","seconds","nowDiffToPhaseEndDateInSeconds","Math","round","_x","apply","arguments","ngOnDestroy","unsubscribe","static","t","i1","i2","i3","core","VBU","selectors","decls","vars","consts","template","rf","ctx","DashboardComponent_a_7_Template","DashboardComponent_ng_container_8_Template","DashboardComponent_ng_container_9_Template","_c4","routes","path","component","DashboardModule","$C","G2t","DashboardService","imports","CommonModule","SharedModule","RouterModule","forChild","WidgetsModule","MatTabsModule"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/dashboard/dashboard.component.html","./src/app/dashboard/dashboard.component.ts","./src/app/dashboard/dashboard.module.ts"],"sourcesContent":["
\r\n
\r\n
\r\n

\r\n Welcome {{userFirstName}}!\r\n \r\n settings\r\n \r\n

\r\n
\r\n \r\n 1\">\r\n
\r\n
2\">\r\n \r\n chevron_left\r\n \r\n \r\n chevron_right\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
{{ phase.phaseTitle }}
\r\n {{ phase.phaseDateLabel }}\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n

This widget is a work in progress and not yet available.

\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n","import { Component, OnInit, ViewEncapsulation } from \"@angular/core\";\r\nimport { TabTitleService } from \"../shared/services/tab-title.service\";\r\nimport { SsoAuthService } from \"../shared/services/sso-auth.service\";\r\nimport { Subscription } from \"rxjs\";\r\nimport { DashboardConfig } from \"../shared/model/dashboard-config.model\";\r\nimport { DashboardService } from \"../shared/services/dashboard.service\";\r\nimport { DateTime } from \"luxon\";\r\nimport { filter } from \"rxjs/operators\";\r\n\r\n@Component({\r\n selector: 'app-dashboard',\r\n templateUrl: './dashboard.component.html',\r\n styleUrls: ['./dashboard.component.scss'],\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class DashboardComponent implements OnInit {\r\n\r\n private ssoAuthSub: Subscription;\r\n private userRoleId: string = '';\r\n public userFirstName: string = '';\r\n\r\n public selectedPhaseIndex: number = 0;\r\n\r\n public dashboardConfig: DashboardConfig = null;\r\n\r\n nowISO: string = DateTime.fromJSDate(new Date()).setZone(\"UTC\").toISO();\r\n\r\n constructor(\r\n private tabTitleService: TabTitleService,\r\n private ssoAuthService: SsoAuthService,\r\n private dashboardService: DashboardService\r\n ) { }\r\n\r\n ngOnInit() {\r\n this.tabTitleService.setTabTitle('Dashboard');\r\n this.ssoAuthSub = this.ssoAuthService.currentRpUser$\r\n .pipe(\r\n filter(rpUser => !!rpUser)\r\n )\r\n .subscribe(async rpUser => {\r\n this.userRoleId = rpUser.currentRole.id;\r\n this.userFirstName = rpUser.firstName;\r\n\r\n // getting dashboard config for the current role of the user\r\n const resp: any = await this.dashboardService.getDashboardConfig(this.userRoleId).toPromise();\r\n // try catching if the config value coming from RP is JSON parsable\r\n try {\r\n this.dashboardConfig = JSON.parse(resp.config.value);\r\n } catch (e) {\r\n this.dashboardConfig = {\r\n dashboardSettings: '',\r\n phases: [],\r\n }\r\n };\r\n\r\n if (this.dashboardConfig.phases.length > 0) {\r\n this.dashboardConfig.phases.forEach((phase, index) => {\r\n // if we have both start and end date for a phase, we display a progress bar for it\r\n if (phase.phaseStartDate && phase.phaseEndDate) {\r\n const luxonPhaseStartDate = DateTime.fromISO(phase.phaseStartDate);\r\n const luxonPhaseEndDate = DateTime.fromISO(phase.phaseEndDate);\r\n // difference is negative number\r\n const phaseDateDiffInSeconds = luxonPhaseStartDate.diff(luxonPhaseEndDate, 'seconds').toObject().seconds;\r\n // difference is negative number if phase end date has not occured yet, otherwise it's positive\r\n const nowDiffToPhaseEndDateInSeconds = DateTime.fromJSDate(new Date()).setZone(\"UTC\").diff(luxonPhaseEndDate, 'seconds').toObject().seconds;\r\n\r\n if (nowDiffToPhaseEndDateInSeconds > 0) {\r\n // phase ended\r\n phase.phaseProgress = 100;\r\n } else if (nowDiffToPhaseEndDateInSeconds < phaseDateDiffInSeconds) {\r\n // phase hasn't started\r\n phase.phaseProgress = 0;\r\n } else {\r\n // phase is in progress\r\n // (1) phase progress in percentage is:\r\n // (2) the difference between the current time and the phase end date\r\n // (3) divided by the total difference between phase start and end date \r\n // (4) times 100 to get percentage difference between them\r\n // (5) however, since the now difference is declinining (because it's a negative number)\r\n // (6) we substract the given percentage from 100 to get the real percentage\r\n let phaseProgressInPercentage = 100 - ((nowDiffToPhaseEndDateInSeconds / phaseDateDiffInSeconds) * 100);\r\n phase.phaseProgress = Math.round(phaseProgressInPercentage * 1e2 ) / 1e2;\r\n }\r\n } else {\r\n // if we don't have start and end dates, the phase progress is null\r\n phase.phaseProgress = null;\r\n }\r\n\r\n // increase active phase index if current date has passed any phase end date\r\n if (index !== (this.dashboardConfig.phases.length - 1)) {\r\n if (phase.phaseEndDate < this.nowISO) {\r\n this.selectedPhaseIndex++;\r\n }\r\n }\r\n });\r\n };\r\n });\r\n }\r\n\r\n navigateToPrevPhase() {\r\n this.selectedPhaseIndex = this.selectedPhaseIndex === 0 ? this.selectedPhaseIndex : this.selectedPhaseIndex - 1;\r\n }\r\n\r\n navigateToNextPhase() {\r\n this.selectedPhaseIndex = this.selectedPhaseIndex === this.dashboardConfig.phases.length - 1 ? this.selectedPhaseIndex : this.selectedPhaseIndex + 1;\r\n }\r\n\r\n ngOnDestroy() {\r\n this.ssoAuthSub.unsubscribe();\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { RouterModule, Routes } from '@angular/router';\r\n\r\nimport { SharedModule } from '../shared/shared.module';\r\nimport { DashboardComponent } from './dashboard.component';\r\nimport { WidgetsModule } from '../widgets/widgets.module';\r\nimport { MatTabsModule } from '@angular/material/tabs';\r\n\r\nimport { DashboardService } from '../shared/services/dashboard.service';\r\n\r\nconst routes: Routes = [\r\n {\r\n path: \"\",\r\n component: DashboardComponent,\r\n },\r\n];\r\n\r\n@NgModule({\r\n declarations: [DashboardComponent],\r\n imports: [\r\n CommonModule,\r\n SharedModule,\r\n RouterModule.forChild(routes),\r\n WidgetsModule,\r\n MatTabsModule\r\n ],\r\n providers: [\r\n DashboardService\r\n ]\r\n})\r\nexport class DashboardModule {\r\n constructor() {}\r\n }\r\n"],"x_google_ignoreList":[]}