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4BAA2B,MAE/D0B,aAAM,EAANA,EAAQf,UAIlB,OAHSjD,EAASiD,UAAW,EACA,QAApB,EAAA7D,KAAKI,uBAAe,SAAE0D,wBAAuB,QAC7C9D,KAAKR,MAAM0D,YAAY,oBAAqB,yBAAyB0B,EAAOG,kCAKhF,GAFAnE,EAASiD,UAAW,EACA,QAApB,EAAA7D,KAAKI,uBAAe,SAAE0D,wBAAuB,GACzC9D,KAAKI,gBACL,KAAM,0DAId,CAEA,eAAA4E,CAAgBjC,EAAckC,GAC1B,IAAIC,EAAiB,GACrBA,EAAQpG,KAAK,CAAEqG,QAAS,OAAQC,MAAO,CAAEC,QAASJ,KAClDjF,KAAKN,mBAAmB4F,KAAKvC,EAAOmC,EACxC,GA7KShG,E,mUAAS,EADrB,EAAAqG,W,kIAYiC,IAA6B,IAChC,KAAwBC,QAAuB,IAAkC,IACrE,OAb9BtG,E","sources":["webpack://client-app/./src/app/project/model-revision/revision/revisions.scss","webpack://client-app/./src/app/project/model-revision/revision/revisions.html","webpack://client-app/./src/app/project/model-revision/revision/revisions.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.revision-content-block{display:block}.add-new-version{position:relative;display:block}.add-new-version-inner{width:100%;min-height:30px;position:relative;display:block;margin-bottom:20px}.add-new-version-inner .note-text-area{resize:none}.fixed-size-revision-table{table-layout:fixed;min-width:200px}.fixed-size-revision-table tr .rightAlignedContent{text-align:right}.fixed-size-revision-table tr .rightAlignedContent .revision-button{margin-left:2px;padding:2px}.fixed-size-revision-table tr .revision-info-td div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-size-revision-table tr .note-td{position:relative;width:20px;padding:0px}.fixed-size-revision-table tr .note-td .revision-note-icon::before{position:absolute;top:10px;font-size:1.5em !important}.fixed-size-revision-table tr .fixed-rev-td{overflow:hidden;width:90px}.delete-button{float:right;margin-top:10px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/project/model-revision/revision/revisions.scss\"],\"names\":[],\"mappings\":\"AAAA,wBACI,aAAA,CAIJ,iBACI,iBAAA,CACA,aAAA,CAGJ,uBACI,UAAA,CACA,eAAA,CACA,iBAAA,CACA,aAAA,CACA,kBAAA,CACA,uCACI,WAAA,CAIR,2BACI,kBAAA,CACA,eAAA,CAEI,mDACI,gBAAA,CACA,oEACI,eAAA,CACA,WAAA,CAKJ,oDACI,eAAA,CACA,sBAAA,CACA,kBAAA,CAIR,uCACI,iBAAA,CACA,UAAA,CACA,WAAA,CACA,mEACI,iBAAA,CACA,QAAA,CACA,0BAAA,CAGR,4CACI,eAAA,CACA,UAAA,CAKZ,eACI,WAAA,CACA,eAAA\",\"sourcesContent\":[\".revision-content-block {\\r\\n display: block;\\r\\n\\r\\n}\\r\\n\\r\\n.add-new-version {\\r\\n position: relative;\\r\\n display: block;\\r\\n}\\r\\n\\r\\n.add-new-version-inner {\\r\\n width: 100%;\\r\\n min-height: 30px;\\r\\n position: relative;\\r\\n display: block;\\r\\n margin-bottom: 20px;\\r\\n .note-text-area {\\r\\n resize: none;\\r\\n }\\r\\n}\\r\\n\\r\\n.fixed-size-revision-table {\\r\\n table-layout: fixed;\\r\\n min-width: 200px;\\r\\n tr {\\r\\n .rightAlignedContent {\\r\\n text-align: right;\\r\\n .revision-button {\\r\\n margin-left: 2px;\\r\\n padding: 2px;\\r\\n } \\r\\n }\\r\\n\\r\\n .revision-info-td {\\r\\n div {\\r\\n overflow: hidden;\\r\\n text-overflow:ellipsis;\\r\\n white-space: nowrap;\\r\\n }\\r\\n \\r\\n }\\r\\n .note-td {\\r\\n position: relative;\\r\\n width: 20px;\\r\\n padding: 0px;\\r\\n .revision-note-icon::before {\\r\\n position: absolute;\\r\\n top: 10px;\\r\\n font-size: 1.5em!important;//Setting icon size.\\r\\n }\\r\\n }\\r\\n .fixed-rev-td {\\r\\n overflow: hidden;\\r\\n width:90px;\\r\\n }\\r\\n }\\r\\n}\\r\\n\\r\\n.delete-button {\\r\\n float: right;\\r\\n margin-top: 10px;\\r\\n \\r\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","module.exports = \"\\r\\n\";","import { ApiClient} from \"app/services/api-client\";\r\nimport { RequestMethod } from 'app/services/RequestMethod';\r\nimport { AppContextService } from \"app/services/app-context-service\";\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { Router } from 'aurelia-router';\r\nimport { ModalService } from 'app/services/modal-service';\r\nimport { BimViewerService } from \"app/services/bim-viewer-service\";\r\nimport {BimViewerFileDto, BimViewerRevisionDto, CheckRevisionSyncStatusResponseDto} from \"../../../models/viewer-dtos/Dtos/bimviewer-dtos\";\r\nimport { ModelRevision } from \"../model-revision\";\r\nimport { UserService } from \"app/services/user-service\";\r\nimport { ContextMenuService } from \"app/services/context-menu-service\";\r\nimport { DialogCloseResult } from \"aurelia-dialog\";\r\nimport { DateTimeFormatter } from \"app/services/date-time-formatter\";\r\n\r\n@autoinject\r\nexport class Revisions {\r\n private revisionNote: string = \"\";\r\n private modelFiles: File[] = []\r\n private selectedRevisionFileName = \"Upload model\"\r\n private chosenFileToUpload?: File;\r\n private revisionList: BimViewerRevisionDto[] = [];\r\n private bimViewerService: BimViewerService\r\n private parentComponent?: ModelRevision;\r\n private isRevitPlugin: boolean = false;\r\n private fileInputElement?: HTMLInputElement;\r\n\r\n constructor(public apiClient: ApiClient, public appContext:AppContextService, \r\n public router: Router, public element: Element, public modal: ModalService, public userService: UserService, \r\n public contextMenuService: ContextMenuService){\r\n this.bimViewerService = new BimViewerService(apiClient,appContext);\r\n }\r\n\r\n\tasync bind(params: ModelRevision): Promise {\r\n this.parentComponent = params;\r\n console.log('revision-activate, params:', params);\r\n }\r\n \r\n attached(): void {\r\n this.fileInputElement = document.getElementById('revFileInput');\r\n }\r\n\r\n open2DViewerRevision(revision: BimViewerRevisionDto): void {\r\n let revisionId: string = revision.id;\r\n let modelId: string[] = [revision.bimViewerFile_Id];\r\n let projectId: string | undefined = this.appContext?.getSelectedProject()?.id;\r\n if (projectId) {\r\n this.router.navigateToRoute('project/work-area', {projectId: projectId, revisionId, modelId, is2d: true}, {replace: true});\r\n }\r\n }\r\n\r\n open3DViewerRevision(revision: BimViewerRevisionDto): void {\r\n let revisionId: string = revision.id;\r\n let modelId: string[] = [revision.bimViewerFile_Id];\r\n let projectId: string | undefined = this.appContext?.getSelectedProject()?.id;\r\n if (projectId) {\r\n this.router.navigateToRoute('project/work-area', {projectId: projectId, revisionId, modelId, is2d: false}, {replace: true});\r\n }\r\n }\r\n\r\n async fillList(revisionList: BimViewerRevisionDto[]): Promise {\r\n this.revisionList = revisionList;\r\n this.revisionList = await this.userService.fillUsernames(this.revisionList,'fillList');\r\n this.formatRevisionTime();\r\n this.sortRevisions();\r\n }\r\n \r\n formatRevisionTime(): void {\r\n this.revisionList.forEach((revision: BimViewerRevisionDto) => {\r\n revision.created = DateTimeFormatter.formatDate(revision.created);\r\n });\r\n }\r\n \r\n sortRevisions(): void {\r\n this.revisionList.sort((element1: BimViewerRevisionDto, element2: BimViewerRevisionDto) => {\r\n return Number(element2.revision) - Number(element1.revision);\r\n });\r\n }\r\n \r\n changeIcon(className: string): void {\r\n let element: Element | null = document.querySelector(className);\r\n if (element) {\r\n if (element.classList.contains(\"fa-angle-up\")) {\r\n element.classList.add(\"fa-angle-down\");\r\n element.classList.remove(\"fa-angle-up\");\r\n } else {\r\n element.classList.add(\"fa-angle-up\");\r\n element.classList.remove(\"fa-angle-down\");\r\n }\r\n this.resetInputs();\r\n }\r\n }\r\n\r\n resetInputs(): void {\r\n this.selectedRevisionFileName = \"Upload model\";\r\n this.chosenFileToUpload = undefined;\r\n this.revisionNote = \"\";\r\n if (this.fileInputElement) {\r\n this.fileInputElement.value = \"\";\r\n }\r\n\r\n }\r\n\r\n setIsRevitPlugin(isPlugin: boolean): void {\r\n this.isRevitPlugin = isPlugin;\r\n }\r\n\r\n async saveNewRevision(event:PointerEvent): Promise {\r\n\t\tconsole.log('saveNewRevision, event:', event);\r\n\t\tconsole.log('A saveNewRevision, event:', event.shiftKey);\r\n\t\tconst withShift = event.shiftKey;\r\n\t\tconst altUpload = withShift;\r\n\r\n\t\tif (!this.chosenFileToUpload) {\r\n\t\t\tthis.modal.OpenMessage(\"Attach file\",\"You must attach a file to add a new revision.\");\r\n\t\t\treturn;\r\n\t\t}\r\n if (!this.chosenFileToUpload.name.endsWith(\".ifc\")) {\r\n\t\t\tthis.modal.OpenMessage(\"Wrong file type\", \"Please select a file with a valid file type.\");\r\n\t\t\treturn;\r\n\t\t}\r\n let currentModel: BimViewerFileDto | undefined = this.parentComponent?.getSelectedModel();\r\n if (currentModel) {\r\n let revisionDto: BimViewerRevisionDto = await this.bimViewerService.uploadRevision(this.chosenFileToUpload, this.revisionNote, currentModel.id, altUpload);\r\n if (revisionDto == null) {\r\n return;\r\n }\r\n revisionDto.created = DateTimeFormatter.formatDate(revisionDto.created);\r\n let username: string | undefined = await this.userService.getUsername(revisionDto.createdByUser_Id,'saveNewRevision');\r\n revisionDto.username = username ? username : \"Unknown\";\r\n this.revisionList.push(revisionDto);\r\n this.parentComponent?.updateRevisionNumber(revisionDto.revision, revisionDto.created); \r\n this.sortRevisions();\r\n this.resetInputs();\r\n revisionDto.isSynced = false;\r\n this.parentComponent?.setSelectedModelSynced(false);\r\n }\r\n\r\n }\r\n\r\n fileSelected(): void {\r\n if (this.modelFiles.length > 0) {\r\n this.chosenFileToUpload = this.modelFiles[0];\r\n this.selectedRevisionFileName = this.chosenFileToUpload.name;\r\n }\r\n }\r\n\r\n async deleteModel(): Promise {\r\n document.getElementById(\"delete-button\")?.blur();\r\n console.log(\"Deleted\");\r\n let response: boolean = await this.modal.OpenConfirm(\"Delete model\",\"Are you sure you want to delete this model?\").whenClosed((response: DialogCloseResult) => {\r\n\t\t\treturn !response.wasCancelled;\r\n });\r\n if (response == true) {\r\n this.parentComponent?.deleteModel();\r\n }\r\n }\r\n async downloadModelRevision(revision: BimViewerRevisionDto, normalize: boolean): Promise {\r\n console.log(\"Download\")\r\n console.log(revision)\r\n let prj: string = this.appContext.projectId;\r\n let api: RequestMethod = this.apiClient.project(prj);\r\n\t\t\r\n\t\t// this approach in its existing form will probably break,not work, for openBim variant:\r\n let result: CheckRevisionSyncStatusResponseDto = await api.get(`BimViewer/GetCatendaRevision?revisionId=${revision.id}`).jsonResult();\r\n if (!result) {\r\n revision.isSynced = false;\r\n this.parentComponent?.setSelectedModelSynced(false);\r\n this.modal.OpenMessage(\"File error\", `Error fetching the file.`,true);\r\n }\r\n if (!result?.isSynced) {\r\n revision.isSynced = false;\r\n this.parentComponent?.setSelectedModelSynced(false);\r\n this.modal.OpenMessage(\"(Processing file)\", `The requested file is ${result.syncProgress}% done processing.`);\r\n\t\t\treturn;\r\n }\r\n revision.isSynced = true;\r\n this.parentComponent?.setSelectedModelSynced(true);\r\n if (this.parentComponent) {\r\n throw 'This has not been implemented yet in the OpenBim version'\r\n\t\t\t//await this.bimsyncApi.setTokenAndProject(this.parentComponent.appContext.projectId);\r\n //await this.bimsyncApi.downloadRevisionFile(result, normalize);\r\n }\r\n }\r\n\r\n openContextMenu(event: Event, note: string): void {\r\n let actions: any[] = [];\r\n actions.push({ viewKey: \"text\", setup: { textKey: note}});\r\n this.contextMenuService.open(event, actions);\r\n }\r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","Revisions","constructor","apiClient","appContext","router","element","modal","userService","contextMenuService","revisionNote","modelFiles","selectedRevisionFileName","revisionList","isRevitPlugin","this","bimViewerService","bind","params","parentComponent","console","log","attached","fileInputElement","document","getElementById","open2DViewerRevision","revision","revisionId","modelId","bimViewerFile_Id","projectId","getSelectedProject","navigateToRoute","is2d","replace","open3DViewerRevision","fillList","fillUsernames","formatRevisionTime","sortRevisions","forEach","created","formatDate","sort","element1","element2","Number","changeIcon","className","querySelector","classList","contains","add","remove","resetInputs","chosenFileToUpload","undefined","value","setIsRevitPlugin","isPlugin","saveNewRevision","event","shiftKey","altUpload","OpenMessage","name","endsWith","currentModel","getSelectedModel","revisionDto","uploadRevision","username","getUsername","createdByUser_Id","updateRevisionNumber","isSynced","setSelectedModelSynced","fileSelected","length","deleteModel","blur","OpenConfirm","whenClosed","response","wasCancelled","downloadModelRevision","normalize","prj","api","project","result","get","jsonResult","syncProgress","openContextMenu","note","actions","viewKey","setup","textKey","open","autoinject","Element"],"sourceRoot":""}