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b,EAAAzG,KAAKuC,gBAAQ,eAAEkE,WAC5D,GAAIA,EAAY,CAEfzG,KAAKX,mBAAoB,EAEzB,MAAMqL,EAAejE,EAAWkE,YAAclE,EAAWmE,aACnDC,EAAmBpE,EAAWqE,gBAAkBrE,EAAWsE,kBAEhD,QAAb,EAAA/K,KAAKuC,gBAAQ,eAAEyI,gBAEdH,GAAoBH,KACvB1K,KAAKX,mBAAoB,GAKtBqL,IACH1K,KAAKX,mBAAoB,E,CAI7B,GA3mBA,GAAC,EAAA4L,W,8DACD,GAAC,EAAAA,W,mEAdW/M,EAAc,GAD1B,EAAAgN,W,uBA0B+B,IAA2B,EAAAC,gBAAqC,IAAyC,IAAiC,EAAAC,UAA0B,IAAkC,IAAmC,IAAsC,IAA+B,KAAsB,EAAAC,QAzBvVnN,E","sources":["webpack://client-app/./src/app/project/tender/settings/tender-settings.ts"],"sourcesContent":["import { EventAggregator, Subscription } from 'aurelia-event-aggregator';\r\nimport { DnDService } from 'app/services/d-n-d-service';\r\nimport { ModalService } from 'app/services/modal-service';\r\nimport { autoinject, TaskQueue, observable } from \"aurelia-framework\";\r\nimport { ApiClient } from \"../../../services/api-client\";\r\nimport { RequestErrorHandling } from 'app/services/RequestErrorHandling';\r\nimport { RequestMethod } from 'app/services/RequestMethod';\r\n\r\nimport { ProjectDto } from \"app/models/project-dto\";\r\n\r\nimport { TenderSettingsDto } from 'app/models/tender/tender-settings-dto';\r\nimport { GroupingLevel } from 'app/models/tender/grouping-level';\r\nimport { TenderFilterSetting } from 'app/models/tender/tender-filter-settings';\r\nimport { SimpleParameterDefinition } from 'app/models/tender/grouping-settings';\r\nimport { TenderService } from \"../../../services/tender/tender-service\";\r\nimport { GuidGenerator } from \"../../../../resources/utilities/GuidGenerator\";\r\nimport { AppContextService } from \"../../../services/app-context-service\";\r\nimport { Router } from \"aurelia-router\";\r\nimport { ErrorService } from \"../../../services/error-service\";\r\nimport {I18N} from \"aurelia-i18n\";\r\nimport {SyncStatusDto} from \"../../../models/tender/sync-status-dto\";\r\n\r\nimport * as environment from '../../../../../config/environment.json';\r\nimport { HttpResponseMessage } from 'aurelia-http-client';\r\nimport { CustomInformationSetting } from 'app/models/tender/custom-information-setting';\r\nimport { PreviewNode } from './preview-node';\r\n\r\n/* Uha, man må åbenbart ikke have ekstra klasser stående forrest i AURELIA,\r\nligegyldigt hvad de hedder :-/.\r\nexport class SaveSettingsResult {\r\n\t tenderList:string;\r\n\t tenderSettingId:string;\r\n};\r\n*/\r\n\r\n@autoinject\r\nexport class TenderSettings {\r\n\tpublic modelId: string = \"\";\r\n\tpublic errorMessage: string = \"\";\r\n\tpublic activeStep: number = 1;\r\n\tpublic totalSteps: number = -1;\r\n\tpublic searchTerm: string = \"\";\r\n\tpublic viewContext: string;\r\n\tprivate subscriptions: Subscription[] = [];\r\n\tpublic settings: TenderSettingsDto | undefined;\r\n\tpublic isPartiallySynced: boolean = false;\r\n\tpublic dragLevel: GroupingLevel | undefined;\r\n\tpublic dragFilter: TenderFilterSetting | undefined;\r\n\tpublic project: ProjectDto | undefined;\r\n\t@observable public tenderListType: string = \"Single\";\r\n\t@observable public selectedOfferPageId: string | null = null;\r\n\tpublic offerPagePreview: PreviewNode[] = [];\r\n\tpublic tenderListStructure: PreviewNode[] = [];\r\n\tpublic offerPageParams: PreviewNode[] = [];\r\n\tpublic frontPagePreviewOfferAmount: number = 1000000;\r\n\tpublic includeProjectInfoOnFrontPagePreview: boolean = false;\r\n\tpublic includeBuildingOwnerOnFrontPagePreview: boolean = false;\r\n\tgeneratingTenderList: boolean = false;\r\n\t\r\n\tpublic isPrerelease_RegOpt: boolean = environment.debug; // prerelease // grep fodder.\r\n\r\n\tconstructor(private apiClient: ApiClient, private events: EventAggregator, private appContext: AppContextService, private errorService: ErrorService, private taskQueue: TaskQueue, private modal: ModalService, private dndService: DnDService, private tenderService: TenderService, private guidGenerator: GuidGenerator, private router: Router, private i18n: I18N) {\r\n\t\tthis.viewContext = \"AvailableParams\";\r\n\t\tconsole.log('isPrerelease_RegOpt:', this.isPrerelease_RegOpt);\r\n\t}\r\n\r\n\tasync activate(model: any) {\r\n\t\t// model er vist noget aurelia sender med, i navigation?\r\n\t\tconsole.log('tenderSettings.activate, model:', model);\r\n\r\n\t\tif (model.projectId) {\r\n\t\t\tthis.appContext.setProject(model.projectId);\r\n\t\t\tthis.modelId = model.id;\r\n\t\t}\r\n\r\n\t\t// if (this.appContext.projectId) {\r\n\t\t// \t this.router.navigate('project/' + this.appContext.projectId + '/tender-settings/' + model.id);\r\n\t\t// } \r\n\r\n\t\tthis.project = await this.apiClient.project(model.projectId).get('Project/GetProject').jsonResult();//activate\r\n\t}\r\n\r\n\tattached() {\r\n\t\tthis.getTotalSteps();\r\n\r\n\t\tthis.getSettingsData(this.modelId).then(() => {\r\n\t\t\tthis.updateProjectDataOnSettings();\r\n\t\t\tthis.setListLevelEconomyPage();\r\n\t\t\tthis.setTenderListType();\r\n\t\t\tthis.updateSummingPageCheckboxes();//attached.\r\n\t\t\tthis.frontPagePreviewIncludeBuildingOwner();\r\n\t\t\tthis.frontPagePreviewIncludeProjectInfo();\r\n\t\t\tthis.determineSyncStatus();\r\n\t\t}).finally(() => {\t\t\t\r\n\t\t\tthis.renderOfferPagePreview();//attached\r\n\t\t\tthis.renderStructure();//attached\r\n\t\t});\r\n\r\n\t\tlet draggedLevelItem: GroupingLevel | undefined;\r\n\t\tthis.dndService.attachListInteraction(\"selected-level-list\", {\r\n\t\t\tanimation: 150,\r\n\t\t\tforceFallback: true,\r\n\t\t\tgroup: \"tender-level-settings\",\r\n\t\t\thandle: \".drag-handle\",\r\n\t\t\tdraggable: \".draggable-item\",\r\n\t\t\tdragClass: \"draggable-item--dragged\",\r\n\t\t\tchosenClass: \"draggable-item--chosen\",\r\n\t\t\tghostClass: \"draggable-item--ghost\",\r\n\t\t\tonChoose: (event: any) => {\r\n\t\t\t\tdraggedLevelItem = this.settings?.groupingSettings.selected[event.oldDraggableIndex];\r\n\t\t\t\tthis.dragLevel = draggedLevelItem;\r\n\t\t\t},\r\n\t\t\tonMove: (event: any) => {\r\n\t\t\t\tthis.dragLevel = event.to.id === \"selected-level-list\" ? draggedLevelItem : undefined\r\n\t\t\t},\r\n\t\t\tonEnd: (event: any) => {\r\n\t\t\t\tif (event.to.id === \"selected-level-list\" && draggedLevelItem) {\r\n\t\t\t\t\tthis.settings?.groupingSettings.selected.splice(event.oldDraggableIndex, 1); // remove from old index\r\n\t\t\t\t\tthis.settings?.groupingSettings.selected.splice(event.newDraggableIndex, 0, draggedLevelItem); // add to new index\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.dragLevel = undefined;\r\n\t\t\t\tdraggedLevelItem = undefined;\r\n\t\t\t\tthis.updateSummingPageCheckboxes();//on-drag-End.\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tlet draggedFilterItem: TenderFilterSetting | undefined;\r\n\t\tthis.dndService.attachListInteraction(\"selected-filter-settings-list\", {\r\n\t\t\tanimation: 150,\r\n\t\t\tforceFallback: true,\r\n\t\t\tgroup: \"tender-filter-settings\",\r\n\t\t\thandle: \".drag-handle\",\r\n\t\t\tdraggable: \".draggable-item\",\r\n\t\t\tdragClass: \"draggable-item--dragged\",\r\n\t\t\tchosenClass: \"draggable-item--chosen\",\r\n\t\t\tghostClass: \"draggable-item--ghost\",\r\n\t\t\tonChoose: (event: any) => {\r\n\t\t\t\tdraggedFilterItem = this.settings?.filterSettings.selected[event.oldDraggableIndex];\r\n\t\t\t},\r\n\t\t\tonMove: (event: any) => {\r\n\t\t\t\tthis.dragFilter = event.to.id === \"selected-filter-settings-list\" ? draggedFilterItem : undefined\r\n\t\t\t},\r\n\t\t\tonEnd: (event: any) => {\r\n\t\t\t\tif (event.to.id === \"selected-filter-settings-list\" && draggedFilterItem) {\r\n\t\t\t\t\tthis.settings?.filterSettings.selected.splice(event.oldDraggableIndex, 1); // remove from old index\r\n\t\t\t\t\tthis.settings?.filterSettings.selected.splice(event.newDraggableIndex, 0, draggedFilterItem); // add to new index\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.dragFilter = undefined;\r\n\t\t\t\tdraggedFilterItem = undefined;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst searchHandler = (data: any) => this.handleSearchEvent(data);\r\n\t\tthis.subscriptions = [\r\n\t\t\tthis.events.subscribe(this.viewContext + \":SearchTermChanged\", searchHandler)\r\n\t\t];\r\n\t}\r\n\r\n\tdetached() {\r\n\t\tthis.dndService.detachListInteraction(\"selected-level-list\");\r\n\t\tthis.dndService.detachListInteraction(\"selected-filter-settings-list\");\r\n\r\n\t\tthis.subscriptions.forEach(subscription => (\r\n\t\t\tsubscription.dispose()\r\n\t\t));\r\n\t}\r\n\r\n\tprivate handleSearchEvent(data: string) {\r\n\t\tif (data === undefined) return;\r\n\t\tthis.searchTerm = data;\r\n\t}\r\n\r\n\r\n\tfrontPagePreviewIncludeProjectInfo() { // UB attached.\r\n\t\tlet projectInformation: boolean | undefined = this.settings?.projectInformation.projectInformation.some(x => x.includeOnFrontPage);\r\n\t\tlet addressInformation: boolean | undefined = this.settings?.projectInformation.addressInformation.some(x => x.includeOnFrontPage);\r\n\t\tthis.includeProjectInfoOnFrontPagePreview = Boolean(projectInformation) || Boolean(addressInformation); \r\n\t}\r\n\r\n\tfrontPagePreviewIncludeBuildingOwner() { // UB attached.\r\n\t\tthis.includeBuildingOwnerOnFrontPagePreview = Boolean(this.settings?.projectInformation.facilityManagerInformation.some(x => x.includeOnFrontPage));\r\n\t}\r\n\r\n\ttenderListTypeChanged(newValue: string, oldValue: string) { // UB:GUI\r\n\t\tif (oldValue === undefined || !this.settings) { return; }\r\n\t\tthis.settings.groupingSettings.contractType = newValue;\r\n\t}\r\n\r\n\tselectedOfferPageIdChanged(newValue: string, oldValue: string) { // UB:GUI\r\n\t\tif (oldValue === undefined || !this.settings) {return;}\t\t\r\n\t\tif (this.selectedOfferPageId) {\r\n\t\t\tthis.settings.groupingSettings.offerPageId = this.selectedOfferPageId;\r\n\t\t\tthis.updateSummingPageCheckboxes();//selectedOfferPageIdChanged\r\n\t\t\tthis.renderOfferPagePreview();//selectedOfferPageIdChanged\r\n\t\t}\r\n\t}\r\n\r\n\tprivate updateSummingPageCheckboxes() {\r\n\t\tlet canNotDoSumming = true;\r\n\t\tthis.settings?.groupingSettings.selected.forEach(x => {\r\n\t\t\tif (x.selectedId == this.settings?.groupingSettings.offerPageId) {\r\n\t\t\t\tcanNotDoSumming = false;\r\n\t\t\t}\r\n\t\t\tif (canNotDoSumming) {\r\n\t\t\t\tif (x.isSummingPage)\r\n\t\t\t\t\tx.isSummingPage = false;\r\n\r\n\t\t\t}\r\n\t\t\tx.canNotDoSumming = canNotDoSumming;\r\n\t\t});\r\n\t}\r\n\r\n\tprivate updateProjectDataOnSettings() {\r\n\t\tif (this.settings) {\r\n\t\t\tif (this.project?.location?.region) {\r\n\t\t\t\tthis.settings.region = this.project.location.region;\r\n\t\t\t\tthis.settings.projectInformation.projectInformation.forEach((x: CustomInformationSetting) => {\r\n\t\t\t\t\tif (this.project) {\r\n\t\t\t\t\t\tif (x.fieldName === \"Project name\") {\r\n\t\t\t\t\t\t\tx.value = this.project.name;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (x.fieldName === \"Project number\") {\r\n\t\t\t\t\t\t\tx.value = this.project.number ? this.project.number : \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.settings.projectInformation.addressInformation.forEach(x => {\r\n\t\t\t\tif (this.project?.location)\r\n\t\t\t\tif (x.fieldName === \"Address\") {\r\n\t\t\t\t\tx.value = this.project.location.address ? this.project.location.address : \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (x.fieldName === \"ZIP Code\") {\r\n\t\t\t\t\tx.value = this.project.location.zipCode ? this.project.location.zipCode : \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (x.fieldName === \"City\") {\r\n\t\t\t\t\tx.value = this.project.location.city ? this.project.location.city : \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse if (x.fieldName === \"Region\") {\r\n\t\t\t\t\tx.value = this.project.location.region ? this.project.location.region : \"\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.settings.projectInformation.facilityManagerInformation.forEach(x => {\r\n\t\t\t\tif (this.project?.facilityManager?.location) {\r\n\t\t\t\t\tif (x.fieldName === \"Name\") {\r\n\t\t\t\t\t\tx.value = this.project.facilityManager.name ? this.project.facilityManager.name : \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (x.fieldName === \"Address\") {\r\n\t\t\t\t\t\tx.value = this.project.facilityManager.location.address ? this.project.facilityManager.location.address : \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (x.fieldName === \"ZIP Code\") {\r\n\t\t\t\t\t\tx.value = this.project.facilityManager.location.zipCode ? this.project.facilityManager.location.zipCode : \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (x.fieldName === \"City\") {\r\n\t\t\t\t\t\tx.value = this.project.facilityManager.location.city ? this.project.facilityManager.location.city : \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\tgetTotalSteps() {\r\n\t\tthis.taskQueue.queueTask(() => {\r\n\t\t\tthis.totalSteps = document.querySelectorAll('[data-step]').length;\r\n\t\t});\r\n\t}\r\n\r\n\tpublic previousStep() {\r\n\t\tif (this.activeStep > 1) {\r\n\t\t\tthis.activeStep -= 1;\r\n\t\t\tthis.searchTerm = '';\r\n\t\t}\r\n\t}\r\n\r\n\tpublic nextStep() {\r\n\t\tif (this.activeStep < this.totalSteps) {\r\n\t\t\tthis.activeStep += 1;\r\n\t\t\tthis.searchTerm = '';\r\n\t\t}\r\n\t}\r\n\r\n\tpublic async submit() { // NB, submit is button SAVE.\r\n\t\tlet api:RequestMethod = this.apiClient.project(this.appContext.projectId);\r\n\t\tconsole.log('submit-save, sending settings/TenderSettingsDto:', this.settings);\r\n\t\tlet errorHandler:RequestErrorHandling = api.postJson(\"TenderList/SaveTenderSettings\", this.settings);\r\n\r\n\t\t// now returns SaveSettingsResult\t\t\r\n\t\t//await errorHandler.noResponse();\r\n\t\t//let response:Response = await errorHandler.response();\r\n\t\tlet response:HttpResponseMessage = await errorHandler.response();\r\n\t\t\r\n\t\tif (response.content) { //}.text) {\r\n\t\t\tconsole.log(response.content);\r\n\t\t\tlet str:string = await response.content; //text();\r\n\t\t\tconsole.log(`response was:~${str}~`);\r\n\t\t} else {\r\n\t\t\tconsole.log('response has no .text', response);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate async getLatestFullSyncStatus():Promise {\r\n\t\treturn await this.apiClient.project(this.appContext.projectId)\r\n\t\t .get(`Project/GetLatestFullSyncStatus`)\r\n\t\t .jsonResult();\r\n\t}\r\n\r\n\tprivate async srcChangedSinceLast():Promise {\r\n\t\treturn await this.apiClient.project(this.appContext.projectId)\r\n\t\t.get(\"TenderList/HasSourceChangedSinceLastCalculation/\" + this.settings?.id)\r\n\t\t.jsonResult();\r\n\t}\r\n\r\n\tpublic async generateTenderList() {\r\n\t\tthis.generatingTenderList = true;\r\n\r\n\t\tlet latestFullSync: SyncStatusDto = await this.getLatestFullSyncStatus();\t \r\n\t\tlet sourceHasChangedSinceLastCalculation = await this.srcChangedSinceLast();\t\t\t\r\n\t\tif (sourceHasChangedSinceLastCalculation) {\r\n\t\t\tawait this.askForRecalc(latestFullSync);\t\t\t\r\n\t\t} \t\t\t\t\t\r\n\t\tthis.downloadTenderList();\r\n\t}\r\n\r\n\tprivate async askForRecalc(latestFullSync: SyncStatusDto) {\r\n\t\tif (this.settings?.syncStatus) {\r\n\t\t\tlet dlg = await this.modal.OpenConfirmSyncStatus(\r\n\t\t\t\tthis.i18n.tr('Tender sources has changed'),\r\n\t\t\t\t`${this.i18n.tr('Tender sources has changed')}. ${this.i18n.tr('Do you want to recalculate before download')}? ${this.i18n.tr('Click \"No\" to get current state')}`,\r\n\t\t\t\tlatestFullSync,\r\n\t\t\t\tthis.settings?.syncStatus\r\n\t\t\t\t);\t\r\n\t\t\tif (!dlg.wasCancelled) { // was: dialogCloseResult\r\n\t\t\t\tawait this.implRecalc(); //recalculate(); \r\n\t\t\t} \r\n\t\t}\r\n\t}\r\n\r\n\tprivate async forceRecalc() { await this.implRecalc(); } // triggered by button.\t\t\r\n\r\n\tprivate async implRecalc() { \r\n\t\tconsole.log('ts.implRecalc');\r\n\t\tlet api = this.apiClient.project(this.appContext.projectId);\r\n\t\tlet recal:string = await api.postJson(\"TenderList/Recalculate\", this.settings)\r\n\t\t .stringResult(); // noResponse();\r\n\t\tconsole.log('ts.recal:', recal);\r\n\t}\r\n\r\n\r\n\t//private async recalculate():Promise {\t\t\r\n //\t\tawait this.implRecalc();\r\n\t//\tawait this.downloadTenderList(); \r\n\t//}\r\n\t\r\n\tprivate async downloadTenderList() {\r\n\t\tconsole.log('ts.downloadTenderList');\r\n\r\n\t\tawait this.apiClient.project(this.appContext.projectId).get(\"Excel/GenerateTenderList/\" + this.settings?.id)\r\n\t\t.downloadFile(\"TenderList.xlsx\") // becomes sendXhrCall(\"arraybuffer\").\r\n\t\t//.catch( async reason => console.log('raisin?', reason)) // hmm, we get an arraybuffer back?\r\n\t\t.finally(() => {\r\n\t\t\tthis.generatingTenderList = false;\r\n\t\t});\r\n\t}\r\n\r\n\tpublic goToStep(event: any) {\r\n\t\tthis.activeStep = parseInt(event.target.closest('.step').dataset.step);\r\n\t\tthis.searchTerm = '';\r\n\t}\r\n\r\n\tprivate async getSettingsData(id: string) {\r\n\t\tthis.settings = await this.tenderService.getTenderSettings(id);\r\n\t\tconsole.log('getSettingsData, for modelId:',id,'got:', this.settings );\r\n\t}\r\n\r\n\tprivate setListLevelEconomyPage() { // UB attached.\r\n\t\tif (this.settings) {\r\n\t\t\tthis.selectedOfferPageId = this.settings.groupingSettings.offerPageId;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate setTenderListType() { // UB attached.\r\n\t\tif (this.settings) {\r\n\t\t\tthis.tenderListType = this.settings.groupingSettings.contractType;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic addListLevel(level: SimpleParameterDefinition) { // UB: GUI\r\n\t\tthis.settings?.groupingSettings.selected.push(\r\n\t\t\t{\r\n\t\t\t\tid: this.guidGenerator.createGuid(),\r\n\t\t\t\tselectedId: level.id,\r\n\t\t\t\tname: level.name,\r\n\t\t\t\tisSummingPage: false,\r\n\t\t\t\tisAssemblePage: false,\r\n\t\t\t\torder: this.settings.groupingSettings.selected.length,\r\n\t\t\t\tcanNotDoSumming: true,\r\n\t\t\t\tisSubLevelParameter: false\r\n\t\t\t}\r\n\t\t);\r\n\t\tif (this.settings?.groupingSettings.selected.length === 1) {\r\n\t\t\tthis.selectedOfferPageId = level.id;\r\n\t\t}\r\n\t\tlet index = this.settings?.groupingSettings.available.findIndex(x => x.id === level.id);\r\n\t\tif (index && this.settings) {\r\n\t\t\tthis.settings?.groupingSettings.available.splice(index, 1);\r\n\t\t\tthis.settings.filterSettings.available = [...this.settings?.filterSettings.available];\r\n\t\t\tthis.updateSummingPageCheckboxes();//addListLevel\r\n\t\t\tthis.renderOfferPagePreview();//addListLevel\r\n\t\t\tthis.renderStructure();//addListLevel\r\n\t\t}\r\n\t}\r\n\r\n\tpublic removeListLevel(level: GroupingLevel, index: number) { // UB: GUI\r\n\t\tthis.settings?.groupingSettings.selected.splice(index, 1);\r\n\t\tthis.settings?.groupingSettings.available.push(\r\n\t\t\t{\r\n\t\t\t\tid: level.selectedId,\r\n\t\t\t\tname: level.name\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tlet foundOfferPageId = false;\r\n\t\tif (this.settings) {\r\n\t\t\tfor (let i = 0; i < this.settings.groupingSettings.selected.length; i++) {\r\n\t\t\t\tif (this.settings.groupingSettings.selected[i].selectedId === this.settings.groupingSettings.offerPageId)\r\n\t\t\t\tfoundOfferPageId = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (!foundOfferPageId && this.settings.groupingSettings.selected.length > 0) {\r\n\t\t\t\tthis.selectedOfferPageId = this.settings.groupingSettings.selected[0].selectedId;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.settings.filterSettings.available = [...this.settings.filterSettings.available];\r\n\t\t\tthis.renderOfferPagePreview();//removeListLevel\r\n\t\t\tthis.renderStructure();//removeListLevel\r\n\t\t}\r\n\t}\r\n\r\n\t// public addTextOnPages() {\r\n\t// \tthis.settings.texts.push(\r\n\t// \t\t{\r\n\t// \t\t\tid: this.guidGenerator.createGuid(),\r\n\t// \t\t\tfieldName: \"Text \" + (this.settings.texts.length + 1),\r\n\t// \t\t\tvalue: \"\",\r\n\t// \t\t\tvalueType: \"textarea\",\r\n\t// \t\t\tnameOnTenderList: \"\",\r\n\t// \t\t\tincludeOnFrontPage: false,\r\n\t// \t\t\tincludeOnSummingPage: false,\r\n\t// \t\t\tincludeOnAssemblePage: false,\r\n\t// \t\t\tcustomInformationSettingType : 5, //Text \r\n\t// \t\t\torder: this.settings.texts.length\r\n\t// \t\t}\r\n\t// \t)\r\n\t// }\r\n\r\n\t// public removeTextOnPages(index: number) {\r\n\t// \tthis.modal.OpenConfirm('Confirm remove', 'Are you sure you wish to remove this item?').whenClosed(x => {\r\n\t// \t\tif (!x.wasCancelled) {\r\n\t// \t\t\tthis.settings.texts.splice(index, 1);\r\n\t// \t\t}\r\n\t// \t});\r\n\t// }\r\n\r\n\tpublic addFilterSetting(filterSetting: TenderFilterSetting) { // UB GUI\r\n\t\tif (this.settings) {\r\n\t\t\tfilterSetting.order = this.settings.filterSettings.selected.length;\r\n\t\t\tthis.settings.filterSettings.selected.push({\r\n\t\t\t\tid: filterSetting.id,\r\n\t\t\t\tparameterId: filterSetting.parameterId,\r\n\t\t\t\tname: filterSetting.name,\r\n\t\t\t\ttenderListName: filterSetting.name,\r\n\t\t\t\torder: filterSetting.order\r\n\t\t\t});\r\n\t\t\tlet index = this.settings.filterSettings.available.findIndex(x => x.id === filterSetting.id);\r\n\t\t\tthis.settings.filterSettings.available.splice(index, 1);\r\n\t\t\tthis.settings.groupingSettings.available = [...this.settings.groupingSettings.available];\r\n\t\t}\r\n\t}\r\n\r\n\tpublic removeFilterSetting(filterSetting: TenderFilterSetting, index: number) { // UB GUI\r\n\t\tif (this.settings) {\r\n\r\n\t\t\tfilterSetting.order = 0;\r\n\t\t\tfilterSetting.tenderListName = \"\";\r\n\t\t\tthis.settings.filterSettings.selected.splice(index, 1);\r\n\t\t\tthis.settings.filterSettings.available.push({\r\n\t\t\t\tid: filterSetting.id,\r\n\t\t\t\tparameterId: filterSetting.parameterId,\r\n\t\t\t\tname: filterSetting.name,\r\n\t\t\t\ttenderListName: \"\",\r\n\t\t\t\torder: filterSetting.order\r\n\t\t\t});\r\n\t\t\tthis.settings.groupingSettings.available = [...this.settings.groupingSettings.available];\r\n\t\t}\r\n\t}\r\n\r\n\tprivate renderStructure() { // UB attached, addListLevel, and removeListLevel.\r\n\t\tlet arr: PreviewNode[] = [];\r\n\t\tif (!this.settings || !Boolean(this.settings) || !Boolean(this.settings?.groupingSettings) || this.settings?.groupingSettings.selected.length === 0) {\r\n\t\t\tthis.tenderListStructure = arr;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.tenderListStructure = this.createStructureListTreeNodes(this.settings.groupingSettings.selected);\r\n\t\tthis.getTotalSteps();\r\n\t}\r\n\r\n\tprivate renderOfferPagePreview() { // UB: selectedOfferPageIdChanged & addListLevel & removeListLevel\r\n\t\tlet arr: any = [];\r\n\t\tlet offpageLevelFound = false;\r\n\r\n\t\tif (!this.settings || !Boolean(this.settings) || !Boolean(this.settings.groupingSettings) || this.settings.groupingSettings.selected.length === 0) {\r\n\t\t\tthis.offerPagePreview = arr;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.settings.groupingSettings.selected.forEach(x => {\r\n\t\t\tif (x.selectedId !== this.selectedOfferPageId && !offpageLevelFound) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (x.selectedId === this.selectedOfferPageId) {\r\n\t\t\t\toffpageLevelFound = true;\r\n\t\t\t}\r\n\t\t\tarr.push(Object.assign({}, x));\r\n\t\t});\r\n\r\n\t\tthis.offerPagePreview = this.createOfferListTreeNodes(arr, 1, \"\");\r\n\t\tthis.offerPageParams = this.flattenOfferPagePreview(this.offerPagePreview);\r\n\t}\r\n\r\n\tprivate flattenOfferPagePreview(nodes: PreviewNode[]) { // UB: renderOfferPagePreview and itself(flattenOfferPagePreview)\r\n\t\tlet flattenArray: PreviewNode[] = [];\r\n\t\tnodes.forEach((node, index) => {\r\n\t\t\tif (index === 0) {\r\n\t\t\t\tflattenArray.push(node);\r\n\t\t\t\tflattenArray.push(...this.flattenOfferPagePreview(node.children));\r\n\t\t\t}\r\n\t\t\tif (node.children.length === 0 && index > 0) {\r\n\t\t\t\tflattenArray.push(node);\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn flattenArray;\r\n\t}\r\n\r\n\tcreateOfferListTreeNodes(copy: GroupingLevel[], count: number, parentPosition: string): PreviewNode[] { // UB: renderOfferPagePreview and itself:createStructureListTreeNodes.\r\n\t\tlet currentParam = copy.splice(0, 1);\r\n\t\tlet arr: PreviewNode[] = [];\r\n\t\tif (currentParam[0] === undefined)\r\n\t\t\treturn arr;\r\n\t\tfor (let i = 0; i < count; i++) {\r\n\t\t\tlet children: PreviewNode[] = [];\r\n\t\t\tlet pos = parentPosition === \"\" ? `${i + 1}` : `${parentPosition}.${i + 1}`;\r\n\t\t\tif (copy.length > 0)\r\n\t\t\t\tchildren = this.createOfferListTreeNodes([...copy], count > 1 ? 2 : count + 1, pos);\r\n\t\t\tarr.push(new PreviewNode(currentParam[0].name, children, pos));\r\n\t\t}\r\n\t\treturn arr;\r\n\t}\r\n\r\n\tcreateAssemblyNodes(copy: GroupingLevel[], currentCount: any): PreviewNode[] { // UB createStructureListTreeNodes and itself(createAssemblyNodes)\r\n\r\n\t\tlet arr: PreviewNode[] = [];\r\n\t\twhile (copy.length > 0) {\r\n\t\t\tlet currentParam = copy.splice(0, 1);\r\n\t\t\tif (currentParam[0].isAssemblePage) {\r\n\t\t\t\tlet children = this.createAssemblyNodes(copy, currentCount + 1);\r\n\t\t\t\tarr.push(new PreviewNode(`Assemble Page : ${currentParam[0].name}`, children));\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn arr;\r\n\t}\r\n\r\n\tcreateSummingNodes(copy: GroupingLevel[]): PreviewNode[] { // UB: createStructureListTreeNodes\r\n\r\n\t\tlet arr: PreviewNode[] = [];\r\n\t\tlet passedOfferListLevel = false;\r\n\r\n\t\tfor (let i = 0; i < copy.length; i++) {\r\n\t\t\tif (copy[i].selectedId === this.selectedOfferPageId)\r\n\t\t\t\tpassedOfferListLevel = true;\r\n\r\n\t\t\tif (passedOfferListLevel) {\r\n\t\t\t\tif (this.tenderListType === \"Single\" && copy[i].isSummingPage)\r\n\t\t\t\t\tarr.push(new PreviewNode(`Summing Page : ${copy[i].name}`, []));\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn arr;\r\n\t}\r\n\r\n\tcreateStructureListTreeNodes(selectedParameters: GroupingLevel[]): PreviewNode[] { // UB:renderStructure\r\n\t\tlet copy = selectedParameters.map(x => Object.assign({}, x));\r\n\t\tlet assemblyNodes = this.createAssemblyNodes(copy, 1);\r\n\t\tlet summingNodes = this.createSummingNodes(selectedParameters)\r\n\t\tlet nodes: PreviewNode[] = [];\r\n\r\n\t\tif (assemblyNodes.length > 0) {\r\n\t\t\tlet topNode = assemblyNodes[0];\r\n\t\t\tlet lastNode = topNode.getDeepestChild();\r\n\r\n\t\t\tif (this.tenderListType === \"Single\") {\r\n\t\t\t\tlastNode.children = [...summingNodes, new PreviewNode(\"Offer page\", [])]\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlastNode.children.push(new PreviewNode(\"Offer page\", []));\r\n\t\t\t}\r\n\r\n\t\t\tif (this.settings?.groupingSettings.includeFrontPage) {\r\n\t\t\t\tnodes.push(new PreviewNode(\"Front page\", [topNode]));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnodes.push(topNode);\r\n\t\t\t}\r\n\t\t\tif (this.tenderListType === \"Multiple\") {\r\n\t\t\t\tnodes.push(new PreviewNode(\"Front page\", [topNode]));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.tenderListType === \"Single\") {\r\n\t\t\t\tif (this.settings?.groupingSettings.includeFrontPage)\r\n\t\t\t\t\tnodes.push(new PreviewNode(\"Front page\", []));\r\n\t\t\t\tnodes = [...nodes, ...summingNodes, new PreviewNode(\"Offer page\", [])]\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\tnodes = [...nodes, new PreviewNode(\"Offer page\", []), new PreviewNode(\"Offer page\", [])];\r\n\t\t\t\t\r\n\t\t\t\tif (this.settings?.groupingSettings.includeFrontPage) {\r\n\t\t\t\t\tlet fp1 = new PreviewNode(\"Front page\", nodes.map(x => Object.assign({}, x)));\r\n\t\t\t\t\tlet fp2 = new PreviewNode(\"Front page\", nodes.map(x => Object.assign({}, x)));\r\n\t\t\t\t\tnodes = [fp1, fp2];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nodes;\r\n\t}\r\n\t\r\n\tprivate determineSyncStatus() : void { // UB: attached\r\n\t\tlet syncStatus : SyncStatusDto | undefined = this.settings?.syncStatus;\r\n\t\tif (syncStatus) {\r\n\r\n\t\t\tthis.isPartiallySynced = false;\r\n\t\t\t\r\n\t\t\tconst missingTypes = syncStatus.typesInSync < syncStatus.typesInTotal;\r\n\t\t\tconst missingInstances = syncStatus.instancesInSync < syncStatus.instancesInTotal;\r\n\t\t\t\r\n\t\t\tif (this.settings?.useQuantities) {\r\n\t\t\t\t\r\n\t\t\t\tif (missingInstances || missingTypes) {\r\n\t\t\t\t\tthis.isPartiallySynced = true\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t// Ignore instances when we are not using quantities\r\n\t\t\t\tif (missingTypes) {\r\n\t\t\t\t\tthis.isPartiallySynced = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n//Dont put multiple classes in the same file containing a module class.\r\n// export class PreviewNode {\r\n// \tpublic name: string;\r\n// \tpublic children: PreviewNode[];\r\n// \tpublic position: string;\r\n\r\n// \tconstructor(name: string, children: PreviewNode[], position: string = \"\") {\r\n// \t\tthis.name = name;\r\n// \t\tthis.children = children;\r\n// \t\tthis.position = position;\r\n// \t}\r\n\r\n// \tpublic getDeepestChild(): PreviewNode {\r\n// \t\tif (this.children.length > 0)\r\n// \t\t\treturn this.children[this.children.length - 1].getDeepestChild();\r\n// \t\treturn this;\r\n// \t}\r\n// }\r\n"],"names":["TenderSettings","constructor","apiClient","events","appContext","errorService","taskQueue","modal","dndService","tenderService","guidGenerator","router","i18n","modelId","errorMessage","activeStep","totalSteps","searchTerm","subscriptions","isPartiallySynced","tenderListType","selectedOfferPageId","offerPagePreview","tenderListStructure","offerPageParams","frontPagePreviewOfferAmount","includeProjectInfoOnFrontPagePreview","includeBuildingOwnerOnFrontPagePreview","generatingTenderList","isPrerelease_RegOpt","this","viewContext","console","log","activate","model","projectId","setProject","id","project","get","jsonResult","attached","draggedLevelItem","draggedFilterItem","getTotalSteps","getSettingsData","then","updateProjectDataOnSettings","setListLevelEconomyPage","setTenderListType","updateSummingPageCheckboxes","frontPagePreviewIncludeBuildingOwner","frontPagePreviewIncludeProjectInfo","determineSyncStatus","finally","renderOfferPagePreview","renderStructure","attachListInteraction","animation","forceFallback","group","handle","draggable","dragClass","chosenClass","ghostClass","onChoose","event","settings","groupingSettings","selected","oldDraggableIndex","dragLevel","onMove","to","undefined","onEnd","splice","newDraggableIndex","filterSettings","dragFilter","subscribe","data","handleSearchEvent","detached","detachListInteraction","forEach","subscription","dispose","projectInformation","some","x","includeOnFrontPage","addressInformation","Boolean","facilityManagerInformation","tenderListTypeChanged","newValue","oldValue","contractType","selectedOfferPageIdChanged","offerPageId","canNotDoSumming","selectedId","isSummingPage","location","region","fieldName","value","name","number","address","zipCode","city","facilityManager","queueTask","document","querySelectorAll","length","previousStep","nextStep","submit","api","errorHandler","postJson","response","content","str","getLatestFullSyncStatus","srcChangedSinceLast","generateTenderList","latestFullSync","askForRecalc","downloadTenderList","syncStatus","OpenConfirmSyncStatus","tr","wasCancelled","implRecalc","forceRecalc","recal","stringResult","downloadFile","goToStep","parseInt","target","closest","dataset","step","getTenderSettings","addListLevel","level","push","createGuid","isAssemblePage","order","isSubLevelParameter","index","available","findIndex","removeListLevel","foundOfferPageId","i","addFilterSetting","filterSetting","parameterId","tenderListName","removeFilterSetting","createStructureListTreeNodes","arr","offpageLevelFound","Object","assign","createOfferListTreeNodes","flattenOfferPagePreview","nodes","flattenArray","node","children","copy","count","parentPosition","currentParam","pos","P","createAssemblyNodes","currentCount","createSummingNodes","passedOfferListLevel","selectedParameters","map","assemblyNodes","summingNodes","topNode","lastNode","getDeepestChild","includeFrontPage","fp1","fp2","missingTypes","typesInSync","typesInTotal","missingInstances","instancesInSync","instancesInTotal","useQuantities","observable","autoinject","EventAggregator","TaskQueue","I18N"],"sourceRoot":""}