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tZ,MAAAsZ,OAAAtZ,MAAAugB,KAAA,0BAVhBzM,EAA6B3M,UAAA,mBAAAuZ,UAAA,SAAAjZ,EAAAC,MAAA,EAAAD,6mBDnB1CzH,MAAA,eACEA,MAAA,uFAIAA,MAAA,eACEA,MAAA,EAAAsiB,EAAA,gBASAtiB,MAAA,yBACFA,QACAA,MAAA,kBAAoEA,MAAA,yBAAAA,aAAAC,GAAAD,MAAe0H,EAAAsH,uBAAsB,GAC3GhP,gBAhBIA,cAAA,QAAAA,MAAA,qCAAAA,MAAA,GAAAuiB,EAAAviB,MAAA,IAAAA,MAAA,qDAAAA,MAAA,GAAAS,QAKGT,MAAA,GAAAA,MAAA,mBAAA0H,EAAAqZ,kCAQwD/gB,QAAoDA,MAApD,cAAA0H,EAAAwZ,oCAAoDlhB,CAAD,UAAA0H,EAAAqR,uBAEpG/Y,MAAA,GAAsCA,MAAtC,UAAA0H,EAAA6Z,0BAAsCvhB,CAAD,qGCEtC8T,CAA8B","names":["i0","_r1","ctx_r1","downloadImageManually","_c0","DownloadDrawingComponent_p_10_span_3_Template","successMessage","objectTranslationKey","smartCreelTranslationKey","_c1","errorMessage","_r3","reloadPage","DownloadDrawingComponent","_DownloadDrawingComponent","BaseComponent","constructor","data","drawings","yarnConsumption","realtimeYarnConsumption","dialogRef","_data$drawingImageId","super","this","showErrorMessage","showSuccessMessage","showWaitingMessage","header","waitingMessage","COMPLETED_SVG","FAILED_SVG","LOADING_SVG","errorContextForMissingMachineQualityParameters","downloadFailedTranslation","cancelDownloadSubject","Subject","cancelDownload","asObservable","drawingImageId","designId","colorSetId","yarnSetId","qualityId","finishingId","machineId","drawingDimensionsInPx","designName","ngOnInit","setIllustration","showWaitingScreen","calculateYarnConsumption","saveAsEp","bmpBlob","Blob","bmpFile","pvdBlob","pvdFile","downloadLink","document","createElement","href","URL","createObjectURL","setAttribute","body","appendChild","click","location","reload","retryDownload","getCancelEventName","cancelEvent","close","next","calculateYarnConsumptionForDesign","pipe","takeUntil","unSubscribeOnViewDestroy","subscribe","getCalculatedYarnConsumption","error","errorCode","toString","calculatedYarnConsumption","downloadFiles","id","showErrorScreen","name","illustrationSource","showSuccessScreen","yarnConsumptionId","forkJoin","downloadFile","downloadPVDFile","delay","merge","downloadEp","epId","epFile","epBlob","bmpObservable","getSingleBmpProcessed","processDrawingConfigurationIntoEpDrawing","filter","file","AssertionUtils","isNullOrUndefined","fileId","take","MAT_DIALOG_DATA","DRAWINGS","YARN_CONSUMPTION","REALTIME_YARN_CONSUMPTION","i1","selectors","features","decls","vars","consts","template","rf","ctx","DownloadDrawingComponent_p_9_Template","DownloadDrawingComponent_p_10_Template","DownloadDrawingComponent_p_11_Template","DownloadDrawingComponent_p_12_Template","DownloadDrawingComponent_button_14_Template","BaseDrawingConfigurationComponent","_BaseDrawingConfigurationComponent","qualities","translate","dialogBuilderFactoryService","existingQualitiesAndColorSets","recoloringImage","canShowErrorForFormControl","formControlName","canShowErrorForErrorCodeAndFormControlForFormGroup","form","getDialogBuiderForBasicDialogPanel","getBuilder","withClass","isQualitySelected","isNil","value","quality","isColorSetSelected","colorSet","isMachineSelected","machine","getQualityId","get","getMachineId","getColorSetId","selectQuality","openSelectGridDialog","SelectMachineQualityComponent","title","instant","object","lowerCase","count","selectedQualities","rowSelection","AgGridRowSelection","SINGLE","allowEmptySelection","machineQualities","length","oldMachineQuality","chosenMachineQuality","setQuality","getQuality","getAll","showOnlyLatestVersion","newQuality","find","selectColorSet","SelectColorSetComponent","existingColorSets","currentColorSet","isEmpty","isEqual","getRecoloredImage","confirmMachineQualitySelection","machineQuality","openAlertDialog","titleText","messageText","reasonForWarning","WARNING_REASON","type","DialogType","CONFIRM","result","AlertDialogResult","onConfirmMachineQualitySelection","drawingsSubscription","getRecoloredImageConfiguration","getDrawingImageId","TargetForListOfDrawingsEnum","DRAWING_LIBRARY","output","widthInPx","heightInPx","input","getDrawingNumberOfSelectionColumns","getDrawingThreadByThread","retry","drawingRecolorInformation","handleColorSetSelection","_error$message","message","INFORMATION","unsubscribe","handleMachineQualitySelection","DrawingConfigurationWeaveQuality","fromOverviewListMachineQuality","inputs","PanelState","OPEN","CLOSED","$event","stopPropagation","deleteConfiguration","DrawingConfigurationComponent_ng_container_7_button_1_Template","texeditWritePermission","DrawingConfigurationComponent_div_22_mat_error_9_Template","DrawingConfigurationComponent_div_22_mat_error_10_Template","DrawingConfigurationComponent_div_22_mat_error_19_Template","DrawingConfigurationComponent_div_22_mat_error_20_Template","_r5","selectYarnSet","YARN_SET_BASE_ROUTER_LINK","_r4","removeColorSet","DrawingConfigurationComponent_ng_container_24_div_1_mat_error_8_Template","DrawingConfigurationComponent_ng_container_24_div_1_mat_form_field_9_Template","COLOR_SET_BASE_ROUTER_LINK","_r6","selectColoredYarnSet","DrawingConfigurationComponent_ng_container_24_mat_form_field_2_mat_error_7_Template","COLORED_YARN_SET_BASE_ROUTER_LINK","DrawingConfigurationComponent_ng_container_24_div_1_Template","DrawingConfigurationComponent_ng_container_24_mat_form_field_2_Template","useColoredYarnSet","creelPosition_r8","percentageOfColorsInDrawingImage","_r7","$implicit","deselectCurrentMainColorsCreelPosition","deselectCurrentBorderColorsCreelPosition","updateCreelPosition","DrawingConfigurationComponent_div_25_div_21_div_9_Template","isCurrentMainColorsCreelPosition","isCurrentBorderColorsCreelPosition","needsToBeFromSameBath","canEditInputs","TEXEDIT_SHOW_YARN_PERCENTAGES","items","yarnSet","drawingId","_r9","onSaveAsEp","DrawingConfigurationComponent_div_25_div_24_button_1_Template","requiredPermissionToSaveAsEp","_r10","downloadSmartCreelFiles","isDownloadSmartCreelFilesDisabled","DrawingConfigurationComponent_div_25_div_25_button_1_Template","getInvalidSmartCreelDownloadIndication","requiredPermissionToDownloadPVDFile","DrawingConfigurationComponent_div_25_div_15_Template","DrawingConfigurationComponent_div_25_div_21_Template","DrawingConfigurationComponent_div_25_app_colored_yarn_set_preview_22_Template","DrawingConfigurationComponent_div_25_div_24_Template","DrawingConfigurationComponent_div_25_div_25_Template","creelPositions","canShowColoredYarnSetPreview","allowToSaveAsEp","canDownloadSmartCreelFiles","DrawingConfigurationComponent","_DrawingConfigurationComponent","coloredYarnSets","yarnSets","navigationHelperService","canShowInvalidFormMessageError","canDelete","canDeleteQuality","allowNumberOfCreelPositions","hasMissingDesign","delete","EventEmitter","qualitySelected","QUALITY_CHIP_VALUE_KEY","QUALITY_BASE_ROUTER_LINK","RouteUtils","paths","texStyle","editMachineQuality","absolutePath","editYarnSet","editColorSet","coloredYarnSet","editColoredYarnSet","Permission","TEXEDIT_EDIT","TEXEDIT_PROC","TEXFAB_YARNCONSUMPTION_FOR_SMARTCREEL_PVD_FILE","TEXEDIT_DESIGN_YARN_PERCENTAGES","panelState","getFunctionsBasedOnDialogComponent","Map","loadNewItem","newItemId","reopenDialog","SelectYarnSetComponent","setYarnSet","SelectColoredYarnSetComponent","setColoredYarnSet","disable","getColorSet","getYarnSet","updateDrawingConfiguration","ngOnChanges","changes","dialogComponent","onNavigationHelperDestroy","savePartialState","drawingConfigurationIndex","getDrawingImage","image","emit","openPanel","closePanel","isPanelOpen","canShowColorListPreview","isColorItemSelected","creelPosition","currentMainColor","mainColorsCreelPosition","position","currentBorderColor","borderColorsCreelPosition","event","preventDefault","controls","reset","checked","imageDownloaded","drawingImage","setValue","cloneDeep","withWidth","withHeight","openDialog","_this$form$value$imag","_this$form$value$colo","_this$form$value$yarn","_this$form$value$qual","isColoredYarnSetSelected","getById","openSelectYarnComponent","numberOfCreelPositions","singleWidth","doubleWidth","topWeaveStructure","weaveStructure","isYarnSetSelected","removeYarnSet","resetFormFields","overviewListColorSet","heightInCm","convertToCommercialUnitCentimeter","unit","Unit","MILLIMETER","commercialDimensionsInMm","heightInMM","widthInCm","widthInMM","getRawValue","nrColumnsForWeftSelection","threadByThread","emptyDrawingConfigurationIndexState","drawingConfigurationIndexState","getPartialState","Object","keys","ObjectUtils","isDeepEqual","setNewItemOrReopenDialogIfPresent","listOfYarnSets","OverviewListColorSet","orderBy","_this$form$value$colo2","overviewListYarnSet","dialogData","_this$form$value$colo3","listOfColoredYarnSets","newlyCreatedColoredYarnSet","canShowWidthAndHeight","getMinimumValueForWidthAndHeight","MACHINE_QUALITIES","COLORED_YARN_SETS","YARN_SETS","i2","outputs","DrawingConfigurationComponent_app_color_list_preview_6_Template","DrawingConfigurationComponent_ng_container_7_Template","DrawingConfigurationComponent_mat_error_21_Template","DrawingConfigurationComponent_div_22_Template","DrawingConfigurationComponent_ng_container_24_Template","DrawingConfigurationComponent_div_25_Template","_SelectMachineQualityComponent","l10nIntlService","gridOptionsBuilderFactoryService","colDefBuilderFactory","weaveStructureColumnPipe","_data$selectedQualiti","MULTIPLE","listOfCustomSettings","BehaviorSubject","machineQualityTranslationKey","selectedMachineQualities","listOfMachineQualities","filterItems","gridOptionsForListOfMachineQualities","listOfGridOptions","setGridOptionsForListOfMachineQualities","propertyValues","getMachineQualities","ngAfterViewInit","_this$machineQualitie","listOfGridApis","machineQualitiesGrid","api","canSelectMachineQualities","_this$machineQualitie2","getSelectedRows","selectMachineQualities","isMultiRowSelectionAllowed","showOnlyLatestVersionChanged","change","navigateToAddQuality","equipmentId","navigateToNextRouteWithPartialState","addMachineQuality","getColumnDefsForListOfMachineQualities","GridIdentifier","SELECT_MACHINE_QUALITY","withRowSelection","withOnRowSelected","updateSelectedMachineQualities","withOnGridReady","getListOfCustomSettings","withOnRowDoubleClicked","row","node","isSelected","setSelected","withOnRowDataUpdated","selectSelectedMachineQualities","withLoadingOverlay","scale","withNoRowsOverlay","getNoRowsOverlayTitleParameters","hideDescription","withRememberStateForNavigationHelper","withOnFirstDataRendered","build","withField","withHeaderName","withComparator","StringUtils","stringComparator","withValueGetter","params","getValueForWeaveStructureCell","withRightAlignment","withCellRenderer","buildAgGridCellTextWithUnit","getValue","DENTS_PER_MILLIMETER","withTooltipValueGetter","buildAgGridCellTooltipWithUnit","PICKS_PER_MILLIMETER","WEFTS_PER_MILLIMETER","hasNumberOfCreelPositions","defaultUnit","customSettingsUnitPropertyName","customSettingsUnitProperty","propertyValue","propertyName","customSettingsUnit","AgGridUtils","buildAgGridCellTextWithUnitConversion","buildAgGridCellTooltipWithUnitConversion","parameters","titleKey","titleParam","toLower","objects","transform","request","getPossibleMachineQualitiesForMachine","rxjsMap","carpetWeaveQualities","map","carpetWeaveQuality","OverviewListMachineQuality","fromCarpetWeaveQuality","gridApi","forEachNode","isMachineQualitySelected","some","currentSelectedMachineQuality","push","selectedMachineQuality","i3","i4","i5","viewQuery","_r2","ctx_r2","navigateToAddColoredYarnSet","_SelectColoredYarnSetComponent","COLORED_YARN_SET_EDIT_PERMISSION","LastModifiedCardUtils","getPermissionToModifyItems","gridOptionsForListOfColoredYarnSets","initializeGridOptionsForListOfColoredYarnSets","getColoredYarnSets","_this$coloredYarnSets","coloredYarnSetsGrid","canSelectColoredYarnSet","_this$coloredYarnSets2","addColoredYarnSet","getColumnDefsForListOfColoredYarnSets","SELECT_COLORED_YARN_SET","withOnCellDoubleClicked","remove","getCreelPositions","valueA","valueB","nodeA","nodeB","withoutFilter","GridColoredYarnSetPreviewComponent","withSortable","SelectColoredYarnSetComponent_button_6_Template","_c2"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./apps/texconnect/src/app/presentation/components/download/download-drawing.component.html","./apps/texconnect/src/app/presentation/components/download/download-drawing.component.ts","./apps/texconnect/src/app/presentation/components/drawing-configuration/base-drawing-configuration.component.ts","./apps/texconnect/src/app/domain/panel-state.enum.ts","./apps/texconnect/src/app/presentation/components/drawing-configuration/drawing-configuration.component.html","./apps/texconnect/src/app/presentation/components/drawing-configuration/drawing-configuration.component.ts","./apps/texconnect/src/app/presentation/components/select-machine-quality/select-machine-quality.component.ts","./apps/texconnect/src/app/presentation/components/select-machine-quality/select-machine-quality.component.html","./apps/texconnect/src/app/presentation/pages/textile-data/creel/add/select-colored-yarn-set/select-colored-yarn-set.component.html","./apps/texconnect/src/app/presentation/pages/textile-data/creel/add/select-colored-yarn-set/select-colored-yarn-set.component.ts"],"sourcesContent":["
\n \n
\n
\n \"download\n
\n

{{ header | bmsTranslate }}

\n

{{ 'DESIGN_LIBRARY.SMART_CREEL.KEEP_THIS_WINDOW_OPEN' | bmsTranslate }}

\n

\n {{ successMessage | bmsTranslate: {object: 'x'} }}\n {{\n 'DESIGN_LIBRARY.SMART_CREEL.DOWNLOAD_FILES_MANUALLY' | bmsTranslate: {object: 'x'}\n }}\n

\n

{{ 'DESIGN_LIBRARY.SMART_CREEL.ERROR_MESSAGE' | bmsTranslate }}

\n

{{ 'DESIGN_LIBRARY.SMART_CREEL.ERROR_DESCRIPTION' | bmsTranslate: {error: errorMessage} }}

\n
\n \n \n \n
\n","import {Component, Inject, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {BackendErrorContext} from '@application/helper/backend-error-context';\nimport {DimensionsInPx} from '@domain/dimensions-in-px';\nimport {Drawings, DRAWINGS} from '@infrastructure/http/drawing/drawings';\nimport {YARN_CONSUMPTION, YarnConsumption} from '@infrastructure/http/yarn-consumption/yarn-consumption';\nimport {REALTIME_YARN_CONSUMPTION, RealtimeYarnConsumption} from '@infrastructure/signalr/yarn-consumption/realtime-yarn-consumption';\nimport {AssertionUtils, BaseComponent} from '@vdw/angular-component-library';\nimport {forkJoin, merge, Subject} from 'rxjs';\nimport {delay, filter, take, takeUntil} from 'rxjs/operators';\n\n@Component({\n templateUrl: './download-drawing.component.html',\n styleUrls: ['./download-drawing.component.scss']\n})\nexport class DownloadDrawingComponent extends BaseComponent implements OnInit {\n public showErrorMessage = false;\n public showSuccessMessage = false;\n public showWaitingMessage = true;\n public objectTranslationKey: string;\n public illustrationSource: string;\n public header = 'DESIGN_LIBRARY.SMART_CREEL.PREPARING_YOUR_FILES';\n public errorMessage = 'DESIGN_LIBRARY.SMART_CREEL.CHECK_YOUR_CONNECTION';\n public successMessage = 'DESIGN_LIBRARY.SMART_CREEL.SUCCESS_MESSAGE';\n public waitingMessage = 'DESIGN_LIBRARY.SMART_CREEL_KEEP_THIS_WINDOW_OPEN';\n public drawingImageId: string;\n public readonly COMPLETED_SVG = 'uploading.svg';\n public readonly FAILED_SVG = 'report-warning.svg';\n public readonly LOADING_SVG = 'img-loading.svg';\n public readonly smartCreelTranslationKey = 'DESIGN_LIBRARY.SMART_CREEL.DOWNLOAD_SMART_CREEL_FILES';\n private designId: number;\n private colorSetId: number;\n private yarnSetId: number;\n private qualityId: number;\n private machineId: number;\n private designName: string;\n private drawingDimensionsInPx: DimensionsInPx;\n private finishingId: number;\n private errorContextForMissingMachineQualityParameters = 'YARN_CONSUMPTION_INSUFFICIENT_INFORMATION';\n private readonly downloadFailedTranslation = 'DESIGN_LIBRARY.SMART_CREEL.DOWNLOAD_FAILED';\n private readonly bmpFile: ArrayBuffer;\n private readonly pvdFile: ArrayBuffer;\n private readonly cancelDownloadSubject: Subject = new Subject();\n private readonly cancelDownload = this.cancelDownloadSubject.asObservable();\n\n public constructor(\n @Inject(MAT_DIALOG_DATA)\n public data: {\n objectTranslationKey: string;\n drawingImageId: string;\n designId: number;\n colorSetId: number;\n yarnSetId: number;\n qualityId: number;\n finishingId: number;\n machineId: number;\n designName: string;\n drawingDimensionsInPx: DimensionsInPx;\n },\n @Inject(DRAWINGS) protected readonly drawings: Drawings,\n @Inject(YARN_CONSUMPTION) private readonly yarnConsumption: YarnConsumption,\n @Inject(REALTIME_YARN_CONSUMPTION) private realtimeYarnConsumption: RealtimeYarnConsumption,\n private readonly dialogRef: MatDialogRef\n ) {\n super();\n this.objectTranslationKey = data?.objectTranslationKey;\n this.drawingImageId = data?.drawingImageId ?? 'image';\n this.designId = data?.designId;\n this.colorSetId = data?.colorSetId;\n this.yarnSetId = data?.yarnSetId;\n this.qualityId = data?.qualityId;\n this.finishingId = data?.finishingId;\n this.machineId = data?.machineId;\n this.drawingDimensionsInPx = data?.drawingDimensionsInPx;\n this.designName = data?.designName;\n }\n\n public ngOnInit(): void {\n this.setIllustration(this.LOADING_SVG);\n this.showWaitingScreen();\n this.objectTranslationKey === this.smartCreelTranslationKey ? this.calculateYarnConsumption() : this.saveAsEp();\n }\n\n public downloadImageManually(): void {\n const bmpBlob = new Blob([this.bmpFile]);\n const pvdBlob = new Blob([this.pvdFile]);\n const downloadLink = document.createElement('a');\n downloadLink.href = URL.createObjectURL(bmpBlob);\n downloadLink.setAttribute('download', `${this.designName}.bmp`);\n document.body.appendChild(downloadLink);\n downloadLink.click();\n downloadLink.href = URL.createObjectURL(pvdBlob);\n downloadLink.setAttribute('download', `${this.designName}.pvd`);\n document.body.appendChild(downloadLink);\n downloadLink.click();\n }\n\n public reloadPage(): void {\n location.reload();\n }\n\n public retryDownload(): void {\n this.objectTranslationKey === this.smartCreelTranslationKey ? this.calculateYarnConsumption() : this.saveAsEp();\n }\n\n public getCancelEventName(): string {\n return this.showSuccessMessage ? 'GENERAL.ACTIONS.CLOSE' : 'GENERAL.ACTIONS.CANCEL';\n }\n\n public cancelEvent(): void {\n this.dialogRef.close();\n if (!this.showSuccessMessage) {\n this.cancelDownloadSubject.next(true);\n }\n }\n\n private calculateYarnConsumption(): void {\n this.yarnConsumption\n .calculateYarnConsumptionForDesign(this.designId, this.colorSetId, this.yarnSetId, this.qualityId, true)\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe({\n next: () => {\n this.getCalculatedYarnConsumption();\n },\n error: (error: BackendErrorContext) => {\n if (error.errorCode.toString() === this.errorContextForMissingMachineQualityParameters) {\n this.errorMessage = 'TEXTILE_DATA.YARN_TYPE.CALCULATE_YARN_CONSUMPTION_ERROR_FOR_DOWNLOAD';\n }\n this.header = this.downloadFailedTranslation;\n this.showWaitingMessage = false;\n this.showErrorMessage = true;\n this.setIllustration(this.FAILED_SVG);\n }\n });\n }\n\n private getCalculatedYarnConsumption(): void {\n this.realtimeYarnConsumption\n .getCalculatedYarnConsumption()\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe({\n next: (calculatedYarnConsumption: any) => {\n this.downloadFiles(calculatedYarnConsumption.yarnConsumption.id);\n },\n error: () => {\n this.showErrorScreen();\n }\n });\n }\n\n private setIllustration(name: string): void {\n this.illustrationSource = `/assets/icons/illustrations/${name}`;\n }\n\n private showErrorScreen(): void {\n this.showWaitingMessage = false;\n this.showErrorMessage = true;\n this.header = this.downloadFailedTranslation;\n this.setIllustration(this.FAILED_SVG);\n }\n\n private showWaitingScreen(): void {\n this.showWaitingMessage = true;\n this.waitingMessage = this.objectTranslationKey === this.smartCreelTranslationKey ? 'DESIGN_LIBRARY.SMART_CREEL_KEEP_THIS_WINDOW_OPEN' : 'DESIGN_LIBRARY.DETAILS.SAVE_AS_EP.PROCESSED_EP';\n }\n\n private showSuccessScreen(): void {\n this.showWaitingMessage = false;\n this.showSuccessMessage = true;\n this.header = 'DESIGN_LIBRARY.SMART_CREEL.DOWNLOAD_HAS_STARTED';\n this.setIllustration(this.COMPLETED_SVG);\n this.successMessage = this.objectTranslationKey === this.smartCreelTranslationKey ? 'DESIGN_LIBRARY.SMART_CREEL.SUCCESS_MESSAGE' : 'DESIGN_LIBRARY.DETAILS.SAVE_AS_EP.SUCCESS_MESSAGE';\n }\n\n private downloadFiles(yarnConsumptionId: number): void {\n forkJoin([this.drawings.downloadFile(this.drawingImageId), this.drawings.downloadPVDFile(yarnConsumptionId)])\n .pipe(delay(1500), takeUntil(merge(this.unSubscribeOnViewDestroy && this.cancelDownload)))\n .subscribe({\n next: ([bmpFile, pvdFile]: [ArrayBuffer, ArrayBuffer]) => {\n this.showSuccessScreen();\n const bmpBlob = new Blob([bmpFile]);\n const pvdBlob = new Blob([pvdFile]);\n const downloadLink = document.createElement('a');\n downloadLink.href = URL.createObjectURL(bmpBlob);\n downloadLink.setAttribute('download', `${this.designName}.bmp`);\n document.body.appendChild(downloadLink);\n downloadLink.click();\n downloadLink.href = URL.createObjectURL(pvdBlob);\n downloadLink.setAttribute('download', `${this.designName}.pvd`);\n document.body.appendChild(downloadLink);\n downloadLink.click();\n },\n error: () => {\n this.showErrorScreen();\n }\n });\n }\n\n private downloadEp(epId: string): void {\n forkJoin([this.drawings.downloadFile(epId)])\n .pipe(takeUntil(merge(this.unSubscribeOnViewDestroy && this.cancelDownload)))\n .subscribe({\n next: ([epFile]: [ArrayBuffer]) => {\n this.showSuccessScreen();\n const epBlob = new Blob([epFile]);\n const downloadLink = document.createElement('a');\n downloadLink.href = URL.createObjectURL(epBlob);\n downloadLink.setAttribute('download', `${this.designName}.ep`);\n document.body.appendChild(downloadLink);\n downloadLink.click();\n },\n error: () => {\n this.showErrorScreen();\n }\n });\n }\n\n private saveAsEp(): void {\n const bmpObservable = merge(\n this.realtimeYarnConsumption.getSingleBmpProcessed(),\n this.drawings.processDrawingConfigurationIntoEpDrawing(this.drawingImageId, this.designName, this.qualityId, this.colorSetId, this.drawingDimensionsInPx, this.finishingId, this.machineId)\n );\n\n bmpObservable\n .pipe(\n takeUntil(merge(this.unSubscribeOnViewDestroy && this.cancelDownload)),\n filter((file: any) => !AssertionUtils.isNullOrUndefined(file?.fileId)),\n take(1)\n )\n .subscribe({\n next: (file: any) => this.downloadEp(file.fileId),\n error: () => this.showErrorScreen()\n });\n }\n}\n","import {Directive, Input} from '@angular/core';\nimport {DimensionsInPx} from '@domain/dimensions-in-px';\nimport {DrawingConfigurationWeaveQuality} from '@domain/production-schedule/drawing-configuration-weave-quality';\nimport {DrawingRecolorInformation} from '@domain/production-schedule/drawing-recolor-information';\nimport {TargetForListOfDrawingsEnum} from '@domain/target-for-list-of-drawings.enum';\nimport {Drawings} from '@infrastructure/http/drawing/drawings';\nimport {GetAllMachineQualitiesParameters, MachineQualities} from '@infrastructure/http/machine-quality/machine-qualities';\nimport {SelectMachineQualityComponent} from '@presentation/components/select-machine-quality/select-machine-quality.component';\nimport {ConfigurationForm} from '@presentation/pages/texedit/drawing-library/drawing-form/drawing-form';\nimport {DrawingConfigurationForm} from '@presentation/pages/texedit/drawing-library/drawing-library-details/drawing-configuration-form';\nimport {OverviewListColorSet} from '@presentation/pages/textile-data/color-set/overview/overview-list-color-set';\nimport {SelectColorSetComponent} from '@presentation/pages/textile-data/colored-yarn-set/add/select-color-set/select-color-set.component';\nimport {OverviewListMachineQuality} from '@presentation/pages/textile-data/machine-quality/overview/overview-list-machine-quality';\nimport {\n AgGridRowSelection,\n AlertDialogResult,\n AssertionUtils,\n BackendError,\n BaseComponent,\n canShowErrorForErrorCodeAndFormControlForFormGroup,\n DialogBuilder,\n DialogBuilderFactoryService,\n DialogType,\n TranslateService\n} from '@vdw/angular-component-library';\nimport {get, isEmpty, isEqual, isNil, lowerCase} from 'lodash-es';\nimport {Subscription} from 'rxjs';\nimport {retry, takeUntil} from 'rxjs/operators';\n\n@Directive()\nexport abstract class BaseDrawingConfigurationComponent extends BaseComponent {\n @Input() public drawingDimensionsInPx: DimensionsInPx;\n @Input() public existingQualitiesAndColorSets: {[qualityId: string]: number[]} = {};\n public recoloringImage = false;\n protected drawingsSubscription: Subscription;\n public abstract form: DrawingConfigurationForm | ConfigurationForm;\n protected abstract readonly WARNING_REASON: string;\n\n protected constructor(\n protected readonly qualities: MachineQualities,\n protected readonly drawings: Drawings,\n protected readonly translate: TranslateService,\n protected readonly dialogBuilderFactoryService: DialogBuilderFactoryService\n ) {\n super();\n }\n\n public canShowErrorForFormControl(errorCode: string, formControlName: string): boolean {\n return canShowErrorForErrorCodeAndFormControlForFormGroup(errorCode, formControlName, this.form);\n }\n\n protected getDialogBuiderForBasicDialogPanel(): DialogBuilder {\n return this.dialogBuilderFactoryService.getBuilder().withClass('basic-dialog-panel');\n }\n\n public isQualitySelected(): boolean {\n return !isNil(this.form.value.quality);\n }\n\n public isColorSetSelected(): boolean {\n return !isNil(this.form.value.colorSet);\n }\n\n public isMachineSelected(): boolean {\n return !isNil((this.form as DrawingConfigurationForm).value.machine);\n }\n\n public getQualityId(): number {\n return get(this.form.value.quality, 'id', null);\n }\n\n public getMachineId(): number {\n return get((this.form as DrawingConfigurationForm).value.machine, 'id', null);\n }\n\n public getColorSetId(): number {\n return get(this.form.value.colorSet, 'id', null);\n }\n\n public selectQuality(): void {\n this.getDialogBuiderForBasicDialogPanel()\n .openSelectGridDialog(SelectMachineQualityComponent, {\n title: this.translate.instant('GENERAL.ACTIONS.SELECT_OBJECT', {object: lowerCase(this.translate.instant('TEXTILE_DATA.MACHINE_QUALITY.MACHINE_QUALITY', {count: 1}))}),\n selectedQualities: [this.form.value.quality],\n rowSelection: AgGridRowSelection.SINGLE,\n allowEmptySelection: false\n })\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((machineQualities: OverviewListMachineQuality[]) => {\n if (machineQualities?.length) {\n const oldMachineQuality: DrawingConfigurationWeaveQuality = this.form.value.quality;\n const chosenMachineQuality: OverviewListMachineQuality = machineQualities[0];\n if (AssertionUtils.isNullOrUndefined(oldMachineQuality) || oldMachineQuality.id !== chosenMachineQuality.id) {\n this.setQuality(chosenMachineQuality);\n }\n }\n });\n }\n\n public getQuality(id: number): void {\n const parameters: Partial = {showOnlyLatestVersion: true};\n this.qualities\n .getAll(parameters)\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((qualities: OverviewListMachineQuality[]) => {\n const newQuality = qualities.find((quality: OverviewListMachineQuality) => quality.id === id);\n this.setQuality(newQuality);\n });\n }\n\n public selectColorSet(): void {\n const qualityId = this.getQualityId();\n\n this.getDialogBuiderForBasicDialogPanel()\n .openSelectGridDialog(SelectColorSetComponent, {\n qualityId: this.getQualityId(),\n existingColorSets: !isNil(this.existingQualitiesAndColorSets[qualityId]) ? this.existingQualitiesAndColorSets[qualityId] : []\n })\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((colorSet: OverviewListColorSet) => {\n const currentColorSet: OverviewListColorSet = this.form.value.colorSet;\n if (!isEmpty(colorSet) && (isNil(currentColorSet) || !isEqual(currentColorSet.id, colorSet.id))) {\n this.getRecoloredImage(colorSet.id);\n }\n });\n }\n\n protected confirmMachineQualitySelection(machineQuality: DrawingConfigurationWeaveQuality): void {\n this.dialogBuilderFactoryService\n .getBuilder()\n .openAlertDialog({\n titleText: this.translate.instant('GENERAL.ACTIONS.SELECT_OBJECT', {object: lowerCase(this.translate.instant('TEXTILE_DATA.MACHINE_QUALITY.MACHINE_QUALITY', {count: 1}))}),\n messageText: this.translate.instant('GENERAL.WARNINGS.CONFIRMATION', {reasonForWarning: this.translate.instant(this.WARNING_REASON)}),\n type: DialogType.CONFIRM\n })\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((result: AlertDialogResult) => {\n if (isEqual(result, AlertDialogResult.CONFIRM)) {\n this.onConfirmMachineQualitySelection(machineQuality);\n }\n });\n }\n\n protected getRecoloredImage(id: number): void {\n this.recoloringImage = true;\n this.drawingsSubscription = this.drawings\n .getRecoloredImageConfiguration(\n this.getDrawingImageId(),\n this.getQualityId(),\n id,\n null,\n null,\n TargetForListOfDrawingsEnum.DRAWING_LIBRARY,\n {\n output: {widthInPx: 200, heightInPx: 200},\n input: this.drawingDimensionsInPx\n },\n null,\n null,\n null,\n this.getDrawingNumberOfSelectionColumns(),\n this.getDrawingThreadByThread()\n )\n .pipe(retry(2))\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe({\n next: (drawingRecolorInformation: DrawingRecolorInformation) => {\n this.handleColorSetSelection(drawingRecolorInformation);\n },\n error: (error: BackendError) => {\n this.recoloringImage = false;\n\n this.dialogBuilderFactoryService.getBuilder().openAlertDialog({\n titleText: this.translate.instant('TEXTILE_DATA.COLOR_SET.COLOR_SET', {count: 1}),\n messageText: error.message ?? this.translate.instant('PRODUCTION_ORDER.WEAVE_PLAN.WARNINGS.COULD_NOT_RECOLOR'),\n type: DialogType.INFORMATION\n });\n }\n });\n }\n\n protected abstract handleMachineQualitySelection(chosenMachineQuality: DrawingConfigurationWeaveQuality): void;\n\n protected abstract onConfirmMachineQualitySelection(machineQuality: DrawingConfigurationWeaveQuality): void;\n\n protected abstract handleColorSetSelection(drawingRecolorInformation: DrawingRecolorInformation): void;\n\n protected abstract getDrawingImageId(): string;\n protected abstract getDrawingNumberOfSelectionColumns(): number;\n protected abstract getDrawingThreadByThread(): boolean;\n\n private setQuality(quality: OverviewListMachineQuality): void {\n if (!AssertionUtils.isNullOrUndefined(this.drawingsSubscription)) {\n this.recoloringImage = false;\n this.drawingsSubscription.unsubscribe();\n }\n this.handleMachineQualitySelection(DrawingConfigurationWeaveQuality.fromOverviewListMachineQuality(quality));\n }\n}\n","export enum PanelState {\n OPEN,\n CLOSED\n}\n","\n \n \n

{{ 'DESIGN_LIBRARY.DETAILS.CONFIGURATION.CONFIGURATION' | bmsTranslate: {count: 1} }} {{ drawingConfigurationIndex }}

\n \n \n \n \n \n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n \n {{ 'TEXTILE_DATA.MACHINE_QUALITY.MACHINE_QUALITY' | bmsTranslate: {count: 1} }}\n \n \n {{ 'GENERAL.ERRORS.REQUIRED' | bmsTranslate }}\n \n \n
\n \n {{ 'GENERAL.DIMENSIONS.WIDTH' | bmsTranslate }}\n \n {{ 'GENERAL.UNIT.CENTIMETER' | bmsTranslate }}\n \n {{ 'GENERAL.ERRORS.REQUIRED' | bmsTranslate }}\n \n \n {{ 'GENERAL.VALIDATION.MINIMUM' | bmsTranslate }}\n : 1\n \n \n \n {{ 'GENERAL.DIMENSIONS.HEIGHT' | bmsTranslate }}\n \n {{ 'GENERAL.UNIT.CENTIMETER' | bmsTranslate }}\n \n {{ 'GENERAL.ERRORS.REQUIRED' | bmsTranslate }}\n \n \n {{ 'GENERAL.VALIDATION.MINIMUM' | bmsTranslate }}\n : 1\n \n \n
\n
\n
\n \n
\n \n {{ 'TEXTILE_DATA.COLOR_SET.COLOR_SET' | bmsTranslate: {count: 1} }}\n \n \n {{ 'GENERAL.ERRORS.REQUIRED' | bmsTranslate }}\n \n \n \n \n {{ 'TEXTILE_DATA.YARN_SET.YARN_SET' | bmsTranslate: {count: 1} }}\n ({{ 'GENERAL.OPTIONAL' | bmsTranslate | lowercase }})\n \n \n \n
\n \n {{ 'TEXTILE_DATA.COLORED_YARN_SET.COLORED_YARN_SET' | bmsTranslate: {count: 1} }}\n \n \n {{ 'GENERAL.ERRORS.REQUIRED' | bmsTranslate }}\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n

{{ 'DESIGN_LIBRARY.DETAILS.CONFIGURATION.MAIN_COLOR' | bmsTranslate }}

\n
\n
\n

{{ 'DESIGN_LIBRARY.DETAILS.CONFIGURATION.BORDER_COLOR' | bmsTranslate }}

\n
\n
\n

{{ 'DESIGN_LIBRARY.DETAILS.CONFIGURATION.SAME_BATH' | bmsTranslate }}

\n
\n
\n

%

\n
\n
\n

{{ 'DESIGN_LIBRARY.DETAILS.CONFIGURATION.COLOR_RGB' | bmsTranslate }}

\n
\n
\n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n
\n
\n {{ creelPosition.percentageOfColorsInDrawingImage | number: '1.0-2' }}\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n","import {Component, EventEmitter, Inject, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';\nimport {MatCheckboxChange} from '@angular/material/checkbox';\nimport {NavigationFunctionData} from '@application/helper/navigation-helper/navigation-function-data.interface';\nimport {NavigationHelperService} from '@application/helper/navigation-helper/navigation-helper.service';\nimport {NavigationNewItemData} from '@application/helper/navigation-helper/navigation-new-item-data.interface';\nimport {RouteUtils} from '@application/helper/routing/route-utils';\nimport {PanelState} from '@domain/panel-state.enum';\nimport {DrawingConfigurationWeaveQuality} from '@domain/production-schedule/drawing-configuration-weave-quality';\nimport {DrawingImage} from '@domain/production-schedule/drawing-image';\nimport {DrawingRecolorInformation} from '@domain/production-schedule/drawing-recolor-information';\nimport {Permission} from '@domain/profile/permission.enum';\nimport {OverviewListCreelPosition} from '@domain/textile-data/creel/overview-list-creel-position';\nimport {WeaveQuality} from '@domain/textile-data/machine-quality/weave-quality';\nimport {COLORED_YARN_SETS, ColoredYarnSets} from '@infrastructure/http/colored-yarn-set/colored-yarn-sets';\nimport {DRAWINGS, Drawings} from '@infrastructure/http/drawing/drawings';\nimport {MACHINE_QUALITIES, MachineQualities} from '@infrastructure/http/machine-quality/machine-qualities';\nimport {YARN_SETS, YarnSets} from '@infrastructure/http/yarn-set/yarn-sets';\nimport {ConfigurationForm} from '@presentation/pages/texedit/drawing-library/drawing-form/drawing-form';\nimport {OverviewListColorSet} from '@presentation/pages/textile-data/color-set/overview/overview-list-color-set';\nimport {SelectColorSetComponent} from '@presentation/pages/textile-data/colored-yarn-set/add/select-color-set/select-color-set.component';\nimport {SelectYarnSetComponent} from '@presentation/pages/textile-data/colored-yarn-set/add/select-yarn-set/select-yarn-set.component';\nimport {OverviewListColoredYarnSet} from '@presentation/pages/textile-data/colored-yarn-set/overview/overview-list-colored-yarn-set';\nimport {SelectColoredYarnSetComponent} from '@presentation/pages/textile-data/creel/add/select-colored-yarn-set/select-colored-yarn-set.component';\nimport {OverviewListYarnSet} from '@presentation/pages/textile-data/yarn-set/overview/overview-list-yarn-set';\nimport {AssertionUtils, convertToCommercialUnitCentimeter, DialogBuilderFactoryService, DialogComponentData, ObjectUtils, TranslateService, Unit} from '@vdw/angular-component-library';\nimport {cloneDeep, isEmpty, isEqual, isNil, orderBy} from 'lodash-es';\nimport {takeUntil} from 'rxjs/operators';\nimport {DrawingConfigurationForEpDrawing} from '../../pages/texedit/drawing-library/drawing-configuration-for-ep-drawing';\nimport {DownloadDrawingComponent} from '../download/download-drawing.component';\nimport {SelectMachineQualityComponent} from '../select-machine-quality/select-machine-quality.component';\nimport {BaseDrawingConfigurationComponent} from './base-drawing-configuration.component';\nimport {NavigationDrawingConfigurationIndexData} from './navigation-drawing-configuration-index-data.interface';\n\n@Component({\n selector: 'app-drawing-configuration',\n templateUrl: './drawing-configuration.component.html',\n styleUrls: ['./drawing-configuration.component.scss']\n})\nexport class DrawingConfigurationComponent extends BaseDrawingConfigurationComponent implements OnInit, OnChanges {\n @Input() public drawingId: number;\n @Input() public form: ConfigurationForm;\n @Input() public drawingConfigurationIndex: number;\n @Input() public canShowInvalidFormMessageError = false;\n @Input() public designName: string;\n @Input() public allowToSaveAsEp = false;\n @Input() public canEditInputs = true;\n @Input() public canDelete = true;\n @Input() public canDeleteQuality = false;\n @Input() public useColoredYarnSet = false;\n @Input() public allowNumberOfCreelPositions = false;\n @Input() public hasMissingDesign = false;\n @Input() public canDownloadSmartCreelFiles = false;\n @Input() public newItemId: number;\n @Input() public dialogComponent: any;\n @Output() public delete: EventEmitter = new EventEmitter();\n @Output() public saveAsEp: EventEmitter = new EventEmitter();\n @Output() public qualitySelected: EventEmitter = new EventEmitter();\n\n public readonly QUALITY_CHIP_VALUE_KEY = '%(technicalNameWithVersion)';\n public readonly QUALITY_BASE_ROUTER_LINK = RouteUtils.paths.texStyle.machineQuality.editMachineQuality.absolutePath;\n public readonly YARN_SET_BASE_ROUTER_LINK = RouteUtils.paths.texStyle.yarnSet.editYarnSet.absolutePath;\n public readonly COLOR_SET_BASE_ROUTER_LINK = RouteUtils.paths.texStyle.colorSet.editColorSet.absolutePath;\n public readonly COLORED_YARN_SET_BASE_ROUTER_LINK = RouteUtils.paths.texStyle.coloredYarnSet.editColoredYarnSet.absolutePath;\n public texeditWritePermission: Permission = Permission.TEXEDIT_EDIT;\n public requiredPermissionToSaveAsEp: Permission = Permission.TEXEDIT_PROC;\n public requiredPermissionToDownloadPVDFile: Permission = Permission.TEXFAB_YARNCONSUMPTION_FOR_SMARTCREEL_PVD_FILE;\n public readonly TEXEDIT_SHOW_YARN_PERCENTAGES: Permission = Permission.TEXEDIT_DESIGN_YARN_PERCENTAGES;\n public colorSet: OverviewListColorSet;\n public yarnSet: OverviewListYarnSet;\n\n protected WARNING_REASON = 'DESIGN_LIBRARY.DETAILS.CONFIGURATION.CONFIRM_MACHINE_QUALITY_SELECTION';\n\n private panelState: PanelState = PanelState.CLOSED;\n private coloredYarnSet: OverviewListColoredYarnSet;\n private readonly getFunctionsBasedOnDialogComponent = new Map([\n [SelectMachineQualityComponent, {loadNewItem: ({newItemId}: NavigationNewItemData): void => this.getQuality(newItemId), reopenDialog: (): void => this.selectQuality()}],\n [SelectColorSetComponent, {loadNewItem: ({newItemId}: NavigationNewItemData): void => this.getRecoloredImage(newItemId), reopenDialog: (): void => this.selectColorSet()}],\n [SelectYarnSetComponent, {loadNewItem: ({newItemId}: NavigationNewItemData): void => this.setYarnSet(newItemId), reopenDialog: (): void => this.selectYarnSet()}],\n [SelectColoredYarnSetComponent, {loadNewItem: ({newItemId}: NavigationNewItemData): void => this.setColoredYarnSet(newItemId), reopenDialog: (): void => this.selectColoredYarnSet()}]\n ]);\n\n public constructor(\n @Inject(MACHINE_QUALITIES) qualities: MachineQualities,\n @Inject(DRAWINGS) drawings: Drawings,\n @Inject(COLORED_YARN_SETS) public coloredYarnSets: ColoredYarnSets,\n @Inject(YARN_SETS) private yarnSets: YarnSets,\n translate: TranslateService,\n dialogBuilderFactoryService: DialogBuilderFactoryService,\n private readonly navigationHelperService: NavigationHelperService\n ) {\n super(qualities, drawings, translate, dialogBuilderFactoryService);\n }\n\n public ngOnInit(): void {\n if (!this.canEditInputs) {\n this.form.disable();\n }\n this.colorSet = this.getColorSet();\n this.yarnSet = this.getYarnSet();\n\n this.updateDrawingConfiguration();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if ('dialogComponent' in changes) {\n if (!AssertionUtils.isNullOrUndefined(this.newItemId)) {\n this.getFunctionsBasedOnDialogComponent.get(this.dialogComponent).loadNewItem({newItemId: this.newItemId});\n } else if (!AssertionUtils.isNullOrUndefined(this.dialogComponent)) {\n this.getFunctionsBasedOnDialogComponent.get(this.dialogComponent).reopenDialog();\n }\n }\n }\n\n public onNavigationHelperDestroy(): void {\n this.navigationHelperService.savePartialState({drawingConfigurationIndex: this.drawingConfigurationIndex});\n }\n\n public getDrawingImage(): DrawingImage {\n return this.form.value.image;\n }\n\n public deleteConfiguration(): void {\n this.delete.emit();\n }\n\n public openPanel(): void {\n this.panelState = PanelState.OPEN;\n }\n\n public closePanel(): void {\n this.panelState = PanelState.CLOSED;\n }\n\n public isPanelOpen(): boolean {\n return isEqual(this.panelState, PanelState.OPEN);\n }\n\n public canShowColorListPreview(): boolean {\n return !this.isPanelOpen() && this.isColorItemSelected();\n }\n\n public isCurrentMainColorsCreelPosition(creelPosition: OverviewListCreelPosition): boolean {\n const currentMainColor: OverviewListCreelPosition = this.form.value.mainColorsCreelPosition;\n\n return !isNil(currentMainColor) && isEqual(currentMainColor.position, creelPosition.position);\n }\n\n public isCurrentBorderColorsCreelPosition(creelPosition: OverviewListCreelPosition): boolean {\n const currentBorderColor: OverviewListCreelPosition = this.form.value.borderColorsCreelPosition;\n\n return !isNil(currentBorderColor) && isEqual(currentBorderColor.position, creelPosition.position);\n }\n\n public deselectCurrentMainColorsCreelPosition(event: Event, creelPosition: OverviewListCreelPosition): void {\n const currentMainColor: OverviewListCreelPosition = this.form.value.mainColorsCreelPosition;\n if (!this.useColoredYarnSet && currentMainColor != null && currentMainColor.position === creelPosition.position) {\n event.preventDefault();\n this.form.controls.mainColorsCreelPosition.reset();\n }\n }\n\n public deselectCurrentBorderColorsCreelPosition(event: Event, creelPosition: OverviewListCreelPosition): void {\n const currentBorderColor: OverviewListCreelPosition = this.form.value.borderColorsCreelPosition;\n if (!this.useColoredYarnSet && currentBorderColor != null && currentBorderColor.position === creelPosition.position) {\n event.preventDefault();\n this.form.controls.borderColorsCreelPosition.reset();\n }\n }\n\n public updateCreelPosition(creelPosition: OverviewListCreelPosition, event: MatCheckboxChange): void {\n creelPosition.needsToBeFromSameBath = event.checked;\n }\n\n public imageDownloaded(image: string): void {\n const drawingImage = this.getDrawingImage();\n drawingImage.data = image;\n this.form.controls.image.setValue(drawingImage);\n }\n\n public onSaveAsEp(): void {\n const quality: DrawingConfigurationWeaveQuality = this.form.value.quality;\n const colorSet: OverviewListColorSet = this.form.value.colorSet;\n const image: DrawingImage = cloneDeep(this.form.value.image);\n\n this.saveAsEp.emit({quality, colorSet, image});\n }\n\n public downloadSmartCreelFiles(): void {\n const image = this.getDrawingImage();\n\n this.getDialogBuiderForBasicDialogPanel().withWidth('720px').withHeight('472px').openDialog(DownloadDrawingComponent, {\n objectTranslationKey: 'DESIGN_LIBRARY.SMART_CREEL.DOWNLOAD_SMART_CREEL_FILES',\n drawingImageId: image.id,\n designId: this.drawingId,\n colorSetId: this.form.value.colorSet.id,\n yarnSetId: this.form.value.yarnSet.id,\n qualityId: this.form.value.quality.id,\n designName: this.designName\n });\n }\n\n public isDownloadSmartCreelFilesDisabled(): boolean {\n return (\n AssertionUtils.isNullOrUndefined(this.form.value.image?.id) ||\n AssertionUtils.isNullOrUndefined(this.drawingId) ||\n AssertionUtils.isNullOrUndefined(this.form.value.colorSet?.id) ||\n AssertionUtils.isNullOrUndefined(this.form.value.yarnSet?.id) ||\n AssertionUtils.isNullOrUndefined(this.form.value.quality?.id)\n );\n }\n\n public getInvalidSmartCreelDownloadIndication(): string {\n return this.translate.instant('GENERAL.HINTS.INSUFFICIENT_INFORMATION');\n }\n\n public isColoredYarnSetSelected(): boolean {\n return !AssertionUtils.isNullOrUndefined(this.form.value.coloredYarnSet);\n }\n\n public selectColoredYarnSet(): void {\n if (this.allowNumberOfCreelPositions) {\n this.qualities\n .getById(this.form.value.quality.id)\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((quality: WeaveQuality) => {\n this.openSelectYarnComponent({\n numberOfCreelPositions: AssertionUtils.isNullOrUndefined(quality.singleWidth)\n ? quality.doubleWidth.topWeaveStructure.numberOfCreelPositions\n : quality.singleWidth.weaveStructure.numberOfCreelPositions\n });\n });\n } else {\n this.openSelectYarnComponent();\n }\n }\n\n public isYarnSetSelected(): boolean {\n return !AssertionUtils.isNullOrUndefined(this.form.value.yarnSet);\n }\n\n public canShowColoredYarnSetPreview(): boolean {\n return this.isYarnSetSelected() && !isNil(this.drawingId);\n }\n\n public selectYarnSet(): void {\n this.getDialogBuiderForBasicDialogPanel()\n .openSelectGridDialog(SelectYarnSetComponent, {numberOfCreelPositions: this.isColorSetSelected() ? this.form.controls.colorSet.value.creelPositions.length : null})\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((yarnSet: OverviewListYarnSet) => {\n if (!isEmpty(yarnSet)) {\n this.form.controls.yarnSet.setValue(yarnSet);\n this.yarnSet = this.getYarnSet();\n }\n });\n }\n\n public removeYarnSet(): void {\n this.form.controls.yarnSet.setValue(null);\n this.yarnSet = null;\n }\n\n public isColorItemSelected(): boolean {\n return this.useColoredYarnSet ? this.isColoredYarnSetSelected() : this.isColorSetSelected();\n }\n\n protected handleMachineQualitySelection(chosenMachineQuality: DrawingConfigurationWeaveQuality): void {\n if (this.isColorItemSelected()) {\n this.confirmMachineQualitySelection(chosenMachineQuality);\n } else {\n this.form.controls.quality.setValue(chosenMachineQuality);\n this.qualitySelected.emit(chosenMachineQuality);\n }\n }\n\n protected onConfirmMachineQualitySelection(machineQuality: DrawingConfigurationWeaveQuality): void {\n this.form.controls.quality.setValue(machineQuality);\n this.resetFormFields();\n this.qualitySelected.emit(machineQuality);\n }\n\n protected handleColorSetSelection(drawingRecolorInformation: DrawingRecolorInformation): void {\n if (this.useColoredYarnSet) {\n this.coloredYarnSet.overviewListColorSet = drawingRecolorInformation.colorSet;\n this.form.controls.coloredYarnSet.setValue(this.coloredYarnSet);\n this.coloredYarnSet = null;\n } else {\n this.form.controls.colorSet.setValue(drawingRecolorInformation.colorSet);\n }\n\n this.form.controls.mainColorsCreelPosition.setValue(drawingRecolorInformation.mainColorsCreelPosition);\n this.form.controls.borderColorsCreelPosition.setValue(drawingRecolorInformation.borderColorsCreelPosition);\n this.form.controls.image.setValue({id: this.form.value.image.id, data: drawingRecolorInformation.image} as DrawingImage);\n this.form.controls.heightInCm.setValue(\n convertToCommercialUnitCentimeter({\n unit: Unit.MILLIMETER,\n value: drawingRecolorInformation.commercialDimensionsInMm.heightInMM\n })\n );\n this.form.controls.widthInCm.setValue(\n convertToCommercialUnitCentimeter({\n unit: Unit.MILLIMETER,\n value: drawingRecolorInformation.commercialDimensionsInMm.widthInMM\n })\n );\n\n this.recoloringImage = false;\n this.colorSet = this.getColorSet();\n }\n\n protected getDrawingNumberOfSelectionColumns(): number {\n return this.form.getRawValue().nrColumnsForWeftSelection;\n }\n\n protected getDrawingThreadByThread(): boolean {\n return this.form.getRawValue().threadByThread;\n }\n\n protected getDrawingImageId(): string {\n return this.form.value.image.id;\n }\n\n private updateDrawingConfiguration(): void {\n const emptyDrawingConfigurationIndexState = {drawingConfigurationIndex: null} as NavigationDrawingConfigurationIndexData;\n const drawingConfigurationIndexState = this.navigationHelperService.getPartialState(Object.keys(emptyDrawingConfigurationIndexState));\n\n if (\n !AssertionUtils.isNullOrUndefined(drawingConfigurationIndexState) &&\n !ObjectUtils.isDeepEqual(drawingConfigurationIndexState, emptyDrawingConfigurationIndexState) &&\n drawingConfigurationIndexState.drawingConfigurationIndex === this.drawingConfigurationIndex\n ) {\n this.navigationHelperService.setNewItemOrReopenDialogIfPresent(\n ({newItemId}: NavigationNewItemData, {dialogComponent}: DialogComponentData) => this.getFunctionsBasedOnDialogComponent.get(dialogComponent).loadNewItem({newItemId}),\n ({dialogComponent}: DialogComponentData) => this.getFunctionsBasedOnDialogComponent.get(dialogComponent).reopenDialog()\n );\n }\n }\n\n private setYarnSet(id: number): void {\n this.yarnSets\n .getAll()\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((listOfYarnSets: OverviewListYarnSet[]) => {\n this.form.controls.yarnSet.setValue(listOfYarnSets.find((yarnSet: OverviewListYarnSet) => yarnSet.id === id));\n this.yarnSet = this.getYarnSet();\n });\n }\n\n private resetFormFields(): void {\n if (this.useColoredYarnSet) {\n this.form.controls.coloredYarnSet.reset();\n } else {\n this.form.controls.colorSet.reset();\n }\n this.form.controls.mainColorsCreelPosition.reset();\n this.form.controls.borderColorsCreelPosition.reset();\n }\n\n private getColorSet(): OverviewListColorSet {\n let colorSet: OverviewListColorSet;\n\n if (this.useColoredYarnSet && !AssertionUtils.isNullOrUndefined(this.form.value.coloredYarnSet)) {\n colorSet = this.form.value.coloredYarnSet.overviewListColorSet;\n } else if (!this.useColoredYarnSet && !AssertionUtils.isNullOrUndefined(this.form.value.colorSet)) {\n colorSet = this.form.value.colorSet;\n }\n\n return !isNil(colorSet) && new OverviewListColorSet(colorSet.id, colorSet.name, orderBy(colorSet.creelPositions, ['position'], ['desc']));\n }\n\n private getYarnSet(): OverviewListYarnSet {\n return this.useColoredYarnSet ? this.form.value.coloredYarnSet?.overviewListYarnSet : this.form.value.yarnSet;\n }\n\n private openSelectYarnComponent(dialogData?: {numberOfCreelPositions: number}): void {\n this.getDialogBuiderForBasicDialogPanel()\n .openSelectGridDialog(SelectColoredYarnSetComponent, dialogData)\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((coloredYarnSet: OverviewListColoredYarnSet) => {\n if (coloredYarnSet && this.form.value.coloredYarnSet?.id !== coloredYarnSet.id) {\n this.coloredYarnSet = coloredYarnSet;\n this.getRecoloredImage(coloredYarnSet.overviewListColorSet.id);\n }\n });\n }\n\n private setColoredYarnSet(id: number): void {\n this.coloredYarnSets\n .getAll()\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((listOfColoredYarnSets: OverviewListColoredYarnSet[]) => {\n const newlyCreatedColoredYarnSet: OverviewListColoredYarnSet = listOfColoredYarnSets.find((coloredYarnSet: OverviewListColoredYarnSet) => coloredYarnSet.id === id);\n\n this.coloredYarnSet = newlyCreatedColoredYarnSet;\n this.getRecoloredImage(newlyCreatedColoredYarnSet.overviewListColorSet.id);\n });\n }\n\n public removeColorSet(): void {\n this.form.controls.colorSet.setValue(null);\n this.form.controls.mainColorsCreelPosition.setValue(null);\n this.form.controls.borderColorsCreelPosition.setValue(null);\n this.colorSet = null;\n }\n\n public canShowWidthAndHeight(): boolean {\n return this.useColoredYarnSet ? this.isColoredYarnSetSelected() : this.isQualitySelected();\n }\n\n public getMinimumValueForWidthAndHeight(): string {\n return this.useColoredYarnSet ? '1' : '0';\n }\n}\n","import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {GridIdentifier} from '@application/grids/grid-identifier.enum';\nimport {NavigationHelperService} from '@application/helper/navigation-helper/navigation-helper.service';\nimport {NavigationNumberOfCreelPositionsData} from '@application/helper/navigation-helper/navigation-number-of-creel-positions-data.interface';\nimport {RouteUtils} from '@application/helper/routing/route-utils';\nimport {StringUtils} from '@application/helper/string-utils';\nimport {WeaveStructureColumnPipe} from '@application/pipes/weave-structure-column.pipe';\nimport {PropertyValue} from '@domain/property-value';\nimport {CarpetWeaveQuality} from '@domain/textile-data/machine-quality/carpet-weave-quality';\nimport {GetAllMachineQualitiesParameters, MACHINE_QUALITIES, MachineQualities} from '@infrastructure/http/machine-quality/machine-qualities';\nimport {NavigationMachineOverviewData} from '@presentation/pages/machine-overview/navigation-machine-overview-data.interface';\nimport {OverviewListMachineQuality} from '@presentation/pages/textile-data/machine-quality/overview/overview-list-machine-quality';\nimport {\n AgGridRowSelection,\n AgGridUtils,\n AssertionUtils,\n BaseComponent,\n ColDefBuilderFactoryService,\n GridOptionsBuilderFactoryService,\n NoDataOverlayComponentParams,\n SelectGridDialog,\n TranslateService,\n Unit\n} from '@vdw/angular-component-library';\nimport {AgGridAngular} from 'ag-grid-angular';\nimport {\n ColDef,\n FirstDataRenderedEvent,\n GridApi,\n GridOptions,\n ICellRendererParams,\n ITooltipParams,\n RowDataUpdatedEvent,\n RowDoubleClickedEvent,\n RowNode,\n RowSelectedEvent,\n ValueGetterParams\n} from 'ag-grid-community';\nimport {L10nIntlService} from 'angular-l10n';\nimport {isEmpty, isNil, toLower} from 'lodash-es';\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {filter, map as rxjsMap, takeUntil} from 'rxjs/operators';\n\n@Component({\n selector: 'app-select-machine-quality',\n templateUrl: './select-machine-quality.component.html',\n styleUrls: ['./select-machine-quality.component.scss']\n})\nexport class SelectMachineQualityComponent extends BaseComponent implements OnInit, AfterViewInit, SelectGridDialog {\n @ViewChild('machineQualitiesGrid') public machineQualitiesGrid: AgGridAngular;\n public listOfGridOptions: GridOptions[];\n public listOfGridApis: GridApi[];\n public listOfMachineQualities: OverviewListMachineQuality[];\n public title: string;\n public selectedMachineQualities: OverviewListMachineQuality[];\n\n private readonly rowSelection = AgGridRowSelection.MULTIPLE;\n private readonly numberOfCreelPositions: number;\n private readonly allowEmptySelection: boolean;\n private readonly listOfCustomSettings = new BehaviorSubject([]);\n private readonly machineId: number;\n private readonly machineQualityTranslationKey = 'TEXTILE_DATA.MACHINE_QUALITY.MACHINE_QUALITY';\n private readonly filterItems: (overview: OverviewListMachineQuality[]) => OverviewListMachineQuality[];\n\n public constructor(\n @Inject(MACHINE_QUALITIES) public readonly machineQualities: MachineQualities,\n @Inject(MAT_DIALOG_DATA) public data: any,\n private readonly dialogRef: MatDialogRef,\n private readonly l10nIntlService: L10nIntlService,\n private readonly translate: TranslateService,\n private readonly gridOptionsBuilderFactoryService: GridOptionsBuilderFactoryService,\n private readonly colDefBuilderFactory: ColDefBuilderFactoryService,\n private readonly weaveStructureColumnPipe: WeaveStructureColumnPipe,\n private readonly navigationHelperService: NavigationHelperService\n ) {\n super();\n this.selectedMachineQualities = data.selectedQualities ?? [];\n this.listOfMachineQualities = data.machineQualities;\n this.rowSelection = data.rowSelection;\n this.numberOfCreelPositions = data.numberOfCreelPositions;\n this.title = data.title;\n this.allowEmptySelection = data.allowEmptySelection;\n this.machineId = data.machineId;\n this.filterItems = data.filterItems;\n }\n\n public get gridOptionsForListOfMachineQualities(): GridOptions {\n return this.listOfGridOptions[0];\n }\n\n public ngOnInit(): void {\n this.setGridOptionsForListOfMachineQualities();\n this.listOfCustomSettings\n .pipe(\n takeUntil(this.unSubscribeOnViewDestroy),\n filter((propertyValues: PropertyValue[]) => !AssertionUtils.isEmpty(propertyValues))\n )\n .subscribe(() => {\n this.getMachineQualities();\n });\n }\n\n public ngAfterViewInit(): void {\n this.listOfGridApis = [this.machineQualitiesGrid?.api];\n }\n\n public canSelectMachineQualities(): boolean {\n let canSelectMachineQualities = false;\n\n if (!isEmpty(this.listOfMachineQualities)) {\n if (this.allowEmptySelection) {\n canSelectMachineQualities = true;\n } else if (!AssertionUtils.isNullOrUndefined(this.machineQualitiesGrid?.api)) {\n canSelectMachineQualities = this.machineQualitiesGrid.api.getSelectedRows().length > 0;\n }\n }\n\n return canSelectMachineQualities;\n }\n\n public selectMachineQualities(): void {\n this.dialogRef.close(this.isMultiRowSelectionAllowed() ? this.selectedMachineQualities : this.machineQualitiesGrid.api.getSelectedRows());\n }\n\n public isMultiRowSelectionAllowed(): boolean {\n return this.rowSelection === AgGridRowSelection.MULTIPLE;\n }\n\n public showOnlyLatestVersionChanged(change: boolean): void {\n this.getMachineQualities(change);\n }\n\n public navigateToAddQuality(): void {\n const data = {\n dialogComponent: SelectMachineQualityComponent,\n ...(this.machineId ? ({equipmentId: this.machineId} as NavigationMachineOverviewData) : ({numberOfCreelPositions: this.numberOfCreelPositions} as NavigationNumberOfCreelPositionsData))\n };\n this.navigationHelperService.navigateToNextRouteWithPartialState(data, RouteUtils.paths.texStyle.machineQuality.addMachineQuality.absolutePath);\n }\n\n private setGridOptionsForListOfMachineQualities(): void {\n this.listOfGridOptions = [\n this.gridOptionsBuilderFactoryService\n .getBuilder(this.getColumnDefsForListOfMachineQualities(), GridIdentifier.SELECT_MACHINE_QUALITY)\n .withRowSelection(this.isMultiRowSelectionAllowed())\n .withOnRowSelected((event: RowSelectedEvent) => this.updateSelectedMachineQualities(event))\n .withOnGridReady(() => {\n this.getListOfCustomSettings().subscribe((listOfCustomSettings: PropertyValue[]) => {\n this.listOfCustomSettings.next(listOfCustomSettings);\n });\n })\n .withOnRowDoubleClicked((row: RowDoubleClickedEvent) => {\n if (!this.isMultiRowSelectionAllowed()) {\n if (!row.node.isSelected()) {\n row.node.setSelected(true);\n }\n this.selectMachineQualities();\n }\n })\n .withOnRowDataUpdated(({api}: RowDataUpdatedEvent) => this.selectSelectedMachineQualities(api))\n .withLoadingOverlay({\n scale: 0.7\n })\n .withNoRowsOverlay({\n scale: 0.7,\n ...this.getNoRowsOverlayTitleParameters(),\n hideDescription: true\n })\n .withRememberStateForNavigationHelper()\n .withOnFirstDataRendered(({api}: FirstDataRenderedEvent) => {\n this.selectSelectedMachineQualities(api);\n })\n .build()\n ];\n }\n\n private getColumnDefsForListOfMachineQualities(): ColDef[] {\n return [\n this.colDefBuilderFactory.getBuilder().withField('technicalNameWithVersion', true).withHeaderName('GENERAL.TECHNICAL_NAME').withComparator(StringUtils.stringComparator).build(),\n this.colDefBuilderFactory\n .getBuilder()\n .withField('weaveStructure')\n .withHeaderName('TEXTILE_DATA.WEAVE_STRUCTURE.WEAVE_STRUCTURE')\n .withComparator(StringUtils.stringComparator)\n .withValueGetter((params: ValueGetterParams) => this.getValueForWeaveStructureCell(params.data), true)\n .build(),\n this.colDefBuilderFactory\n .getBuilder()\n .withField('reedDensityInDentsPerMM')\n .withHeaderName('TEXTILE_DATA.MACHINE_QUALITY.REEDDENSITY')\n .withRightAlignment()\n .withCellRenderer((params: ICellRendererParams) => this.buildAgGridCellTextWithUnit(params.getValue(), Unit.DENTS_PER_MILLIMETER, 'reedDensityUnit'))\n .withTooltipValueGetter((params: ITooltipParams) => this.buildAgGridCellTooltipWithUnit(params.value, Unit.DENTS_PER_MILLIMETER, 'reedDensityUnit'))\n .build(),\n this.colDefBuilderFactory\n .getBuilder()\n .withField('pickDensityInPicksPerMM')\n .withHeaderName('TEXTILE_DATA.MACHINE_QUALITY.PICKDENSITY')\n .withRightAlignment()\n .withCellRenderer((params: ICellRendererParams) => this.buildAgGridCellTextWithUnit(params.getValue(), Unit.PICKS_PER_MILLIMETER, 'pickDensityUnit'))\n .withTooltipValueGetter((params: ITooltipParams) => this.buildAgGridCellTooltipWithUnit(params.value, Unit.PICKS_PER_MILLIMETER, 'pickDensityUnit'))\n .build(),\n this.colDefBuilderFactory\n .getBuilder()\n .withField('practicalPickDensityInPicksPerMM')\n .withHeaderName('TEXTILE_DATA.MACHINE_QUALITY.PRACTICALPICKDENSITY')\n .withRightAlignment()\n .withCellRenderer((params: ICellRendererParams) => this.buildAgGridCellTextWithUnit(params.getValue(), Unit.PICKS_PER_MILLIMETER, 'pickDensityUnit'))\n .withTooltipValueGetter((params: ITooltipParams) => this.buildAgGridCellTooltipWithUnit(params.value, Unit.PICKS_PER_MILLIMETER, 'pickDensityUnit'))\n .build(),\n this.colDefBuilderFactory\n .getBuilder()\n .withField('weftDensityInDentsPerMM')\n .withHeaderName('TEXTILE_DATA.MACHINE_QUALITY.WEFTDENSITY')\n .withRightAlignment()\n .withCellRenderer((params: ICellRendererParams) => this.buildAgGridCellTextWithUnit(params.getValue(), Unit.WEFTS_PER_MILLIMETER, 'weftDensityUnit'))\n .withTooltipValueGetter((params: ITooltipParams) => this.buildAgGridCellTooltipWithUnit(params.value, Unit.WEFTS_PER_MILLIMETER, 'weftDensityUnit'))\n .build()\n ];\n }\n\n private hasNumberOfCreelPositions(): boolean {\n return !isNil(this.numberOfCreelPositions);\n }\n\n private getListOfCustomSettings(): Observable {\n return this.machineQualities.getListOfCustomSettings().pipe(takeUntil(this.unSubscribeOnViewDestroy));\n }\n\n private buildAgGridCellTextWithUnit(value: number, defaultUnit: Unit, customSettingsUnitPropertyName: string): string {\n const customSettingsUnitProperty: PropertyValue = this.listOfCustomSettings.value.find((propertyValue: PropertyValue) => propertyValue.propertyName === customSettingsUnitPropertyName);\n let customSettingsUnit: Unit = defaultUnit;\n if (!isNil(customSettingsUnitProperty)) {\n customSettingsUnit = Unit[customSettingsUnitProperty.propertyValue as string];\n }\n return AgGridUtils.buildAgGridCellTextWithUnitConversion(value, defaultUnit, customSettingsUnit, this.l10nIntlService);\n }\n\n private buildAgGridCellTooltipWithUnit(value: number, defaultUnit: Unit, customSettingsUnitPropertyName: string): string {\n const customSettingsUnitProperty: PropertyValue = this.listOfCustomSettings.value.find((propertyValue: PropertyValue) => propertyValue.propertyName === customSettingsUnitPropertyName);\n let customSettingsUnit: Unit = defaultUnit;\n if (!isNil(customSettingsUnitProperty)) {\n customSettingsUnit = Unit[customSettingsUnitProperty.propertyValue as string];\n }\n return AgGridUtils.buildAgGridCellTooltipWithUnitConversion(value, defaultUnit, customSettingsUnit, this.l10nIntlService);\n }\n\n private getNoRowsOverlayTitleParameters(): Partial {\n const parameters: Partial = {titleKey: null, titleParam: null};\n\n if (!AssertionUtils.isNullOrUndefined(this.machineId)) {\n parameters.titleKey = 'PLANNING.ADD_ITEM.MACHINE_NO_OBJECT_SELECTED';\n parameters.titleParam = {object: toLower(this.translate.instant('GENERAL.POSSIBLE_OBJECTS', {objects: this.translate.instant(this.machineQualityTranslationKey, {count: 2})}))};\n } else if (this.hasNumberOfCreelPositions()) {\n parameters.titleKey = 'TEXTILE_DATA.MACHINE_QUALITY.OVERLAY.NO_MACHINE_QUALITIES_OF_POSITIONS';\n parameters.titleParam = {numberOfCreelPositions: this.numberOfCreelPositions};\n } else {\n parameters.titleParam = this.machineQualityTranslationKey;\n }\n\n return parameters;\n }\n\n private getValueForWeaveStructureCell(machineQuality: OverviewListMachineQuality): string {\n return this.weaveStructureColumnPipe.transform(machineQuality);\n }\n\n private getMachineQualities(showOnlyLatestVersion: boolean = true): void {\n let request: Observable;\n\n if (!AssertionUtils.isNullOrUndefined(this.machineId)) {\n request = this.machineQualities.getPossibleMachineQualitiesForMachine(this.machineId, {showOnlyLatestVersion}).pipe(\n rxjsMap((carpetWeaveQualities: CarpetWeaveQuality[]) => {\n return carpetWeaveQualities.map((carpetWeaveQuality: CarpetWeaveQuality) => {\n return OverviewListMachineQuality.fromCarpetWeaveQuality(carpetWeaveQuality);\n });\n })\n );\n } else if (this.hasNumberOfCreelPositions()) {\n const parameters: Partial = {numberOfCreelPositions: this.numberOfCreelPositions, showOnlyLatestVersion};\n\n request = this.machineQualities.getAll(parameters);\n } else {\n const parameters: Partial = {showOnlyLatestVersion};\n\n request = this.machineQualities.getAll(parameters);\n }\n\n request.pipe(takeUntil(this.unSubscribeOnViewDestroy)).subscribe((machineQualities: OverviewListMachineQuality[]) => {\n this.listOfMachineQualities = this.filterItems ? this.filterItems(machineQualities) : machineQualities;\n });\n }\n\n private selectSelectedMachineQualities(gridApi: GridApi): void {\n gridApi.forEachNode((node: RowNode) => {\n node.setSelected(this.isMachineQualitySelected(node));\n });\n }\n\n private updateSelectedMachineQualities(event: RowSelectedEvent): void {\n if (!event.node.isSelected() && this.listOfMachineQualities.some((machineQuality: OverviewListMachineQuality) => machineQuality.id === event.data.id)) {\n this.selectedMachineQualities = this.selectedMachineQualities.filter((currentSelectedMachineQuality: OverviewListMachineQuality) => currentSelectedMachineQuality?.id !== event.data.id);\n } else {\n if (!this.isMachineQualitySelected(event)) {\n this.selectedMachineQualities.push(event.data);\n }\n }\n if (this.rowSelection === AgGridRowSelection.MULTIPLE) {\n this.selectSelectedMachineQualities(event.api);\n }\n }\n\n private isMachineQualitySelected(data: RowSelectedEvent | RowNode): boolean {\n return this.selectedMachineQualities.some((selectedMachineQuality: OverviewListMachineQuality) => {\n return selectedMachineQuality?.id === data.data.id;\n });\n }\n}\n\ninterface NavigationSelectMachineQualityData {\n dialogComponent: typeof SelectMachineQualityComponent;\n}\n","
\n \n \n \n
\n \n \n
\n \n
\n","
\n \n
\n \n \n \n \n
\n \n
\n","import {AfterViewInit, Component, Inject, OnInit, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {GridIdentifier} from '@application/grids/grid-identifier.enum';\nimport {LastModifiedCardUtils} from '@application/helper/last-modified-card-utils';\nimport {NavigationHelperService} from '@application/helper/navigation-helper/navigation-helper.service';\nimport {RouteUtils} from '@application/helper/routing/route-utils';\nimport {StringUtils} from '@application/helper/string-utils';\nimport {COLORED_YARN_SETS, ColoredYarnSets} from '@infrastructure/http/colored-yarn-set/colored-yarn-sets';\nimport {GridColoredYarnSetPreviewComponent} from '@presentation/pages/textile-data/colored-yarn-set/overview/grid-colored-yarn-set-preview/grid-colored-yarn-set-preview.component';\nimport {OverviewListColoredYarnSet} from '@presentation/pages/textile-data/colored-yarn-set/overview/overview-list-colored-yarn-set';\nimport {AssertionUtils, BaseComponent, ColDefBuilderFactoryService, GridOptionsBuilderFactoryService, SelectGridDialog} from '@vdw/angular-component-library';\nimport {AgGridAngular} from 'ag-grid-angular';\nimport {ColDef, GridApi, GridOptions, ICellRendererParams, ITooltipParams, RowNode} from 'ag-grid-community';\nimport {isNil, remove} from 'lodash-es';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n templateUrl: './select-colored-yarn-set.component.html'\n})\nexport class SelectColoredYarnSetComponent extends BaseComponent implements OnInit, AfterViewInit, SelectGridDialog {\n @ViewChild('coloredYarnSetsGrid') public coloredYarnSetsGrid: AgGridAngular;\n public listOfColoredYarnSets: OverviewListColoredYarnSet[];\n public numberOfCreelPositions: number;\n public listOfGridOptions: GridOptions[];\n public listOfGridApis: GridApi[];\n public readonly COLORED_YARN_SET_EDIT_PERMISSION = LastModifiedCardUtils.getPermissionToModifyItems('coloredYarnSet');\n\n public constructor(\n @Inject(MAT_DIALOG_DATA) public data: any,\n @Inject(COLORED_YARN_SETS) public coloredYarnSets: ColoredYarnSets,\n private readonly dialogRef: MatDialogRef,\n private readonly colDefBuilderFactory: ColDefBuilderFactoryService,\n private readonly gridOptionsBuilderFactoryService: GridOptionsBuilderFactoryService,\n private readonly navigationHelperService: NavigationHelperService\n ) {\n super();\n this.numberOfCreelPositions = data?.numberOfCreelPositions;\n }\n\n public get gridOptionsForListOfColoredYarnSets(): GridOptions {\n return this.listOfGridOptions[0];\n }\n\n public ngOnInit(): void {\n this.initializeGridOptionsForListOfColoredYarnSets();\n this.getColoredYarnSets();\n }\n\n public ngAfterViewInit(): void {\n this.listOfGridApis = [this.coloredYarnSetsGrid?.api];\n }\n\n public onNavigationHelperDestroy(): void {\n this.navigationHelperService.savePartialState({dialogComponent: SelectColoredYarnSetComponent});\n }\n\n public selectColoredYarnSet(): void {\n this.dialogRef.close(this.coloredYarnSetsGrid.api.getSelectedRows()[0]);\n }\n\n public canSelectColoredYarnSet(): boolean {\n return !AssertionUtils.isEmpty(this.coloredYarnSetsGrid?.api?.getSelectedRows());\n }\n\n public navigateToAddColoredYarnSet(): void {\n const data = {\n dialogComponent: SelectColoredYarnSetComponent,\n numberOfCreelPositions: this.numberOfCreelPositions\n };\n this.navigationHelperService.navigateToNextRouteWithPartialState(data, RouteUtils.paths.texStyle.coloredYarnSet.addColoredYarnSet.absolutePath);\n }\n\n private initializeGridOptionsForListOfColoredYarnSets(): void {\n this.listOfGridOptions = [\n this.gridOptionsBuilderFactoryService\n .getBuilder(this.getColumnDefsForListOfColoredYarnSets(), GridIdentifier.SELECT_COLORED_YARN_SET)\n .withLoadingOverlay({\n scale: 0.7\n })\n .withNoRowsOverlay({\n scale: 0.7,\n titleKey: 'TEXTILE_DATA.COLORED_YARN_SET.OVERLAY.NO_COLORED_YARN_SETS_OF_POSITIONS',\n titleParam: {numberOfCreelPositions: this.numberOfCreelPositions},\n hideDescription: true\n })\n .withOnCellDoubleClicked(() => this.selectColoredYarnSet())\n .withRememberStateForNavigationHelper()\n .build()\n ];\n }\n\n private getColoredYarnSets(): void {\n this.coloredYarnSets\n .getAll()\n .pipe(takeUntil(this.unSubscribeOnViewDestroy))\n .subscribe((listOfColoredYarnSets: OverviewListColoredYarnSet[]) => {\n this.listOfColoredYarnSets = listOfColoredYarnSets;\n if (!isNil(this.numberOfCreelPositions)) {\n remove(this.listOfColoredYarnSets, (coloredYarnSet: OverviewListColoredYarnSet) => {\n return this.numberOfCreelPositions !== coloredYarnSet.overviewListColorSet.creelPositions.length;\n });\n }\n });\n }\n\n private getColumnDefsForListOfColoredYarnSets(): ColDef[] {\n return [\n this.colDefBuilderFactory.getBuilder().withField('name', true).withHeaderName('GENERAL.NAME').withComparator(StringUtils.stringComparator).build(),\n this.colDefBuilderFactory\n .getBuilder()\n .withHeaderName('TEXTILE_DATA.MATERIAL_SET.NUMBER_OF_CREEL_POSITIONS')\n .withCellRenderer((params: ICellRendererParams) => this.getCreelPositions(params))\n .withTooltipValueGetter((params: ITooltipParams) => this.getCreelPositions(params))\n .withComparator((valueA: any, valueB: any, nodeA: RowNode, nodeB: RowNode) => {\n return (nodeA.data as OverviewListColoredYarnSet).overviewListColorSet.creelPositions.length - (nodeB.data as OverviewListColoredYarnSet).overviewListColorSet.creelPositions.length;\n })\n .withoutFilter()\n .build(),\n this.colDefBuilderFactory.getBuilder().withField('overviewListColorSet.name', true).withHeaderName('TEXTILE_DATA.COLOR_SET.COLOR_SET').build(),\n this.colDefBuilderFactory.getBuilder().withField('overviewListYarnSet.name', true).withHeaderName('TEXTILE_DATA.YARN_SET.YARN_SET').build(),\n this.colDefBuilderFactory.getBuilder().withHeaderName('GENERAL.PREVIEW').withCellRenderer(GridColoredYarnSetPreviewComponent).withSortable(false).withValueGetter('data').withoutFilter().build()\n ];\n }\n\n private getCreelPositions(params: any): string {\n return `${(params.data as OverviewListColoredYarnSet).overviewListColorSet.creelPositions.length}`;\n }\n}\n\ninterface NavigationSelectColoredYarnSetData {\n dialogComponent: typeof SelectColoredYarnSetComponent;\n}\n"],"x_google_ignoreList":[]}