{"version":3,"sources":["./src/app/resource-hub/resource-hub/resource-hub.component.html","./src/app/resource-hub/resource-hub-routing.module.ts","./src/app/resource-hub/resource-hub.module.ts","./src/app/resource-hub/resource-hub.service.ts","./src/app/resource-hub/resource-hub/resource-hub.component.scss","./src/app/resource-hub/resource-hub/resource-hub.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAe,gYAAiU,gUAAgU,mGAAmG,sgB;;;;;;;;;;;;;;;;;;;;;;;;;;;ACA9rB;AACE;AAEf;AACqC;AAE7E,IAAM,MAAM,GAAW;IACtB;QACC,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,yFAAoB;QAC/B,WAAW,EAAE,CAAC,oDAAS,CAAC;KACxB;CACD,CAAC;AAKF;IAAA;IAAwC,CAAC;IAA5B,wBAAwB;QAJpC,8DAAQ,CAAC;YACT,OAAO,EAAE,CAAC,4DAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACxC,OAAO,EAAE,CAAC,4DAAY,CAAC;SACvB,CAAC;OACW,wBAAwB,CAAI;IAAD,+BAAC;CAAA;AAAJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjBI;AACM;AAES;AACiB;AACI;AACjB;AAiB5D;IAAA;IAAiC,CAAC;IAArB,iBAAiB;QAf7B,8DAAQ,CAAC;YACT,OAAO,EAAE;gBACR,4DAAY;gBACZ,qEAAY;gBACZ,qFAAwB;aACxB;YACD,YAAY,EAAE;gBACb,yFAAoB;aACpB;YACD,SAAS,EAAE;gBACV,wEAAkB;aAClB;YACD,eAAe,EAAE,EAChB;SACD,CAAC;OACW,iBAAiB,CAAI;IAAD,wBAAC;CAAA;AAAJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBa;AAGa;AAOlC;AAGtB;IAAwC,sCAAW;IAClD,4BAAY,MAAqB;eAChC,kBAAM,MAAM,CAAC;IACd,CAAC;IAED,2CAAc,GAAd;QACC,IAAM,MAAM,GAAuB,EAAE;QAC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;IAVlB,oBAAoB;QALhC,+DAAS,CAAC;YACV,QAAQ,EAAE,iBAAiB;YAC3B,+MAA4C;;SAE5C,CAAC;yCAQQ,0DAAa;YACJ,wEAAkB;YACvB,0DAAW;YACP,0DAAa;OAVlB,oBAAoB,CA2GhC;IAAD,2BAAC;CAAA,CA3GyC,0FAAiB,GA2G1D;AA3GgC","file":"resource-hub-resource-hub-module.js","sourcesContent":["export default \"<div cdkTrapFocus class=\\\"component-container\\\">\\r\\n\\t<mat-card fxLayout=\\\"column\\\" fxFlex>\\r\\n\\t\\t<mat-card-title>\\r\\n\\t\\t\\t<div fxLayout=\\\"row\\\" fxLayoutAlign=\\\"start center\\\">\\r\\n\\t\\t\\t\\t<div>Resource Hub</div>\\r\\n\\t\\t\\t</div>\\r\\n\\t\\t</mat-card-title>\\r\\n\\r\\n\\t\\t<div fxLayout=\\\"column\\\" fxFlex *tdLoading=\\\"let data; until: !loading\\\" class=\\\"container\\\">\\r\\n\\t\\t\\t<mat-expansion-panel [(ngModel)]=\\\"i.expanded\\\" ngDefaultControl  [expanded]=\\\"i.expanded\\\" *ngFor=\\\"let i of folders\\\" class=\\\"folder\\\">\\r\\n\\t\\t\\t\\t<mat-expansion-panel-header (click)=\\\"toggle(i)\\\" class=\\\"folder-header\\\">\\r\\n\\t\\t\\t\\t  <mat-panel-title >\\r\\n\\t\\t\\t\\t\\t{{i.expanded? i.folderName : i.folderName + ' (' + (i.fileCount>0?i.fileCount:'No Documents') + ')'}}\\r\\n\\t\\t\\t\\t  </mat-panel-title>\\r\\n\\t\\t\\t\\t</mat-expansion-panel-header>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<div [style.height.px]=\\\"i.fileCount * 50 + 50\\\">\\r\\n\\t\\t\\t\\t\\t<pp-selection-grid\\r\\n\\t\\t\\t\\t\\tfxFlex\\r\\n\\t\\t\\t\\t\\t[columnDefs]=\\\"columnDefs\\\"\\r\\n\\t\\t\\t\\t\\t[rowData]=\\\"i.files\\\"\\r\\n\\t\\t\\t\\t\\t[rowClickIsEdit]=\\\"true\\\"\\r\\n\\t\\t\\t\\t\\t[readOnly]=\\\"true\\\"\\r\\n\\t\\t\\t\\t\\t(edit)=\\\"openFile($event)\\\"\\r\\n\\t\\t\\t\\t\\t></pp-selection-grid>\\r\\n\\t\\t\\t\\t</div>\\r\\n\\t\\t\\t</mat-expansion-panel>\\r\\n\\t\\t</div>\\r\\n\\t</mat-card>\\r\\n</div>\\r\\n\"","import { NgModule, Injectable } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\n\r\nimport { AuthGuard } from 'app/_guards';\r\nimport { ResourceHubComponent } from './resource-hub/resource-hub.component';\r\n\r\nconst routes: Routes = [\r\n\t{\r\n\t\tpath: '',\r\n\t\tcomponent: ResourceHubComponent,\r\n\t\tcanActivate: [AuthGuard]\r\n\t},\r\n];\r\n@NgModule({\r\n\timports: [RouterModule.forChild(routes)],\r\n\texports: [RouterModule],\r\n})\r\nexport class ResourceHubRoutingModule { }\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { SharedModule } from 'app/shared/shared.module';\r\nimport { ResourceHubRoutingModule } from './resource-hub-routing.module';\r\nimport { ResourceHubComponent } from './resource-hub/resource-hub.component';\r\nimport { ResourceHubService } from './resource-hub.service';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tSharedModule,\r\n\t\tResourceHubRoutingModule\r\n\t],\r\n\tdeclarations: [\r\n\t\tResourceHubComponent\r\n\t],\r\n\tproviders: [\r\n\t\tResourceHubService\r\n\t],\r\n\tentryComponents: [\r\n\t]\r\n})\r\nexport class ResourceHubModule { }\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { BaseService } from 'app/services/base-service';\r\n\r\nimport {\r\n\tResourceHubParams,\r\n\tCommonService,\r\n\tResourceHubDto,\r\n\tResourceHubFileDto,\r\n} from 'app/services';\r\n\r\n@Injectable()\r\nexport class ResourceHubService extends BaseService {\r\n\tconstructor(common: CommonService) {\r\n\t\tsuper(common);\r\n\t}\r\n\r\n\tgetResourceHub(): Observable<ResourceHubDto> {\r\n\t\tconst params = <ResourceHubParams> {}\r\n\t\treturn this.crud.loadWithGet('api/openResourceHub', params);\r\n\t}\r\n\r\n\tgetFile(file : ResourceHubFileDto) : Observable<ArrayBuffer> {\r\n\t\tconst params = <ResourceHubParams> {}\r\n\t\tconst url = `api/openFile/${file.id}`;\r\n\t\tconst httpOptions = {\r\n\t\t\t'responseType'  : 'arraybuffer' as 'json'\r\n\t\t\t//'responseType'  : 'blob' as 'json'        //This also worked\r\n\t\t};\r\n\t\treturn this.http.get<any>(url, httpOptions);\r\n\t}\r\n\r\n}\r\n","export default \":host {\\n  height: 100%; }\\n\\n:host > div {\\n  height: 100%;\\n  position: relative; }\\n\\n.header {\\n  margin-bottom: 8px; }\\n\\nform.dates-form {\\n  position: absolute;\\n  top: 4px;\\n  right: 8px; }\\n\\nform.xs-dates-form {\\n  padding-left: 16px; }\\n\\n.container {\\n  padding-left: 16px; }\\n\\n.folder {\\n  margin-bottom: 10px;\\n  margin-right: 10px; }\\n\\n.folder-header {\\n  background-color: #c4c4c4 !important;\\n  font-weight: bold;\\n  height: 40px !important; }\\n\\npp-date {\\n  display: inline-block;\\n  width: 160px; }\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvcmVzb3VyY2UtaHViL3Jlc291cmNlLWh1Yi9DOlxcR2l0UmVwb3NcXEVhcENvcmVcXHNyY1xcd2ViXFxQcm9mZXNzaW9uYWxQb3J0YWwuQW5ndWxhci9zcmNcXGFwcFxccmVzb3VyY2UtaHViXFxyZXNvdXJjZS1odWJcXHJlc291cmNlLWh1Yi5jb21wb25lbnQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNDLFlBQVksRUFBQTs7QUFHYjtFQUN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3I6ICNjNGM0YzQgIWltcG9ydGFudDtcclxuICAgIGZvbnQtd2VpZ2h0OiBib2xkO1xyXG5cdGhlaWdodDogNDBweCAhaW1wb3J0YW50O1xyXG59XHJcblxyXG5wcC1kYXRlIHtcclxuXHRkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XHJcblx0d2lkdGg6IDE2MHB4O1xyXG59Il19 */\"","import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';\r\nimport { DecimalPipe } from '@angular/common';\r\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\r\nimport * as moment from 'moment';\r\nimport * as _ from 'lodash';\r\nimport { finalize, catchError } from 'rxjs/operators';\r\nimport { EMPTY } from 'rxjs';\r\nimport { DateComponent } from 'app/shared/forms/date-component';\r\nimport { SelectionGridComponent } from 'app/shared/selection-grid/selection-grid.component';\r\nimport { BaseViewComponent } from 'app/shared/base-view/base-view-component';\r\nimport { saveAs } from 'file-saver';\r\n\r\nimport {\r\n\tResourceHubDto,\r\n\tResourceHubFolderDto,\r\n\tResourceHubFileDto,\r\n\tCommonService,\r\n\tAgGridService,\r\n\tUtilsService,\r\n} from 'app/services';\r\n\r\nimport { ResourceHubService } from '../resource-hub.service';\r\nimport { GridReadyEvent } from 'ag-grid';\r\n\r\n\r\n@Component({\r\n\tselector: 'pp-resource-hub',\r\n\ttemplateUrl: './resource-hub.component.html',\r\n\tstyleUrls: ['./resource-hub.component.scss'],\r\n})\r\nexport class ResourceHubComponent extends BaseViewComponent implements OnInit, AfterViewInit {\r\n\t// Template variables\r\n\tcolumnDefs: any[];\r\n\tform: FormGroup;\r\n\tfolders: ResourceHubFolderDto[];\r\n\t\r\n\tconstructor(\r\n\t\tcommon: CommonService,\r\n\t\tprivate service: ResourceHubService,\r\n\t\tprivate fb: FormBuilder,\r\n\t\tprivate agGrid: AgGridService,\r\n\t) {\r\n\t\tsuper(common);\r\n\t}\r\n\r\n\tngOnInit() {\r\n\t\tthis.buildForm();\r\n\t\tthis.setUpAgGrid();\r\n\t\tsetTimeout(() => {\r\n\t\t\tthis.display();\r\n\t\t});\r\n\t}\r\n\r\n\tngAfterViewInit() {\r\n\r\n\t}\r\n\r\n\tdisplay() {\r\n\t\tthis.loading = true;\r\n\r\n\t\tconst formValue = this.form.value;\r\n\t\tthis.service\r\n\t\t\t.getResourceHub()\r\n\t\t\t.pipe(\r\n\t\t\t\tcatchError((err) => {\r\n\t\t\t\t\tthis.handleError(err, 'loading resource hub');\r\n\t\t\t\t\treturn EMPTY;\r\n\t\t\t\t}),\r\n\t\t\t\tfinalize(() => (this.loading = false))\r\n\t\t\t)\r\n\t\t\t.subscribe(\r\n\t\t\t\t(result) => this.handleResult(result),\r\n\t\t\t\t(err) => this.handleError(err, 'running resource hub query')\r\n\t\t);\r\n\t}\r\n\r\n\tprivate setUpAgGrid() {\r\n\r\n\t\tconst renderLink = (row: any) => {\r\n\t\t\tconst data = row.data as ResourceHubFileDto;\r\n\t\t\tlet render = `<div style=\"cursor:pointer;\">${data.fileName}</div>`;\r\n\t\t\treturn render;\r\n\t\t};\r\n\r\n\t\tthis.columnDefs = [\r\n\t\t\tthis.agGrid.makeTextColumn('File Name', 'fileName', {\r\n\t\t\t\tcellRenderer: renderLink.bind(this),\r\n\t\t\t\tminWidth: 150,\r\n\t\t\t\tmaxWidth: 600,\r\n\t\t\t}),\r\n\t\t\tthis.agGrid.makeDateColumn('Uploaded date', 'loadedDate', {\r\n\t\t\t\tfixedWidth: 120,\r\n\t\t\t}),\r\n\t\t];\r\n\t}\r\n\r\n\r\n\texportToCsv() {\r\n\t}\r\n\r\n\texportToExcel() {\r\n\t}\r\n\r\n\tprivate setDefaults() {\r\n\t}\r\n\r\n\tprivate handleResult(result: ResourceHubDto) {\r\n\t\tthis.folders = result.folders;\r\n\t}\r\n\r\n\tprivate buildForm() {\r\n\t\tthis.form = this.fb.group({\t\t\t\r\n\t\t});\r\n\t}\r\n\r\n\topenFile(file : ResourceHubFileDto) {\r\n\t\tthis.service.getFile(file)\r\n\t\t\t.subscribe(\r\n\t\t\t(result) => {\r\n\t\t\t\tlet attachment = new Blob([result], { type: file.mimeType });      \r\n\t\t\t\tvar fileURL = URL.createObjectURL(attachment);\r\n\t\t\t\t// window.open(fileURL); << open in a new tab, however file name is random (refer https://stackoverflow.com/questions/41947735/custom-name-for-blob-url/41947861#41947861)\r\n\t\t\t\tvar link = document.createElement('a');\r\n\t\t\t\tlink.href = fileURL;\r\n\t\t\t\tlink.target = '_blank';\r\n\t\t\t\tlink.download = file.fileName;\r\n\t\t\t\tlink.click();\r\n\t\t\t},\r\n\t\t\t(err) => {\r\n\t\t\t\talert(\"Can't Open File: \" + file.fileName)\r\n\t\t\t}\r\n\t\t\t);\r\n\t}\r\n\r\n\tprivate toggle(folder : ResourceHubFolderDto) {\r\n\t\tfolder.expanded = !folder.expanded;\r\n\t}\r\n}\r\n"],"sourceRoot":"webpack:///"}