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C6K,EAAOouB,QAF9DvwC,EAAMf,WAKT4wC,iBAAiB7vC,GACvB,MAAMwwC,EAAS70C,KAAKkyC,+BAA+B4C,cAAc9uC,KAAKlD,GAAKA,EAAEwE,KAAOjD,GACpF,OAAKwwC,EAGE70C,KAAKgW,iBAAiB2F,mCAAmCk5B,EAAOE,QAF9D1wC,EAAMf,WAKT+wC,YAAYhwC,GAClB,MAAMkmB,EAAUvqB,KAAK8lB,aAAa0E,QAAQxkB,KAAKlD,GAAKA,EAAEwE,KAAOjD,GAC7D,OAAKkmB,EAGEvqB,KAAKgW,iBAAiB2F,mCAAmC4O,EAAQE,KAF/DpmB,EAAMf,WAKT8vC,SAAS/uC,GACf,OAAOrE,KAAKwlB,YAAYwB,WAAW,IAAI5H,KAAKuF,SAAStgB,EAAMf,WAAa,MAAO,MAAM8iB,OAAO,sDAtOnF6rB,GAA8BpxC,sIAA9BoxC,EAA8B5R,QAA9B4R,EAA8B,qBADlB,SACZA,GAAb","names":["ApDynGridColumnConfigBase","constructor","options","super","this","ApDynGridColumnControlType","key","width","field","undefined","showHeaderTitle","title","tooltip","filterable","CropRotationOperations","NextSortOperation","FilterType","i0","ctx_r5","oxw","ctx_r8","ctx_r12","ctx_r13","ApCropRotationFilterComponent","EventEmitter","ProcessFilterDisabled","filterType","selected","length","MeaningKey","mapKey","ngOnChanges","changes","source","setTimeout","_createDistinctSource","bind","keydown","event","keyCode","show","documentClick","_contains","target","processFilter","_processRange","_processMultiSelect","clearFilter","_resetRangeValues","handleFilter","e","filteredSource","distinctSource","includes","filter","i","r","o","toString","_a","toLowerCase","_b","t","numberFilterChanged","filterDescriptor","minValue","maxValue","max","minFilter","find","_","operator","maxFilter","value","recentNumberFilter","logic","filters","isFilterActive","filterLink","nativeElement","contains","popup","uniqKeyValues","uniq","map","sortBy","FindAll","_myFilter","filterChange","emit","Add","buildFilter","meta","year","selectors","ElementRef","ctx","FindSortPipe","transform","args","Find","pure","SortComponent","DetailHeaderComponent","AllCropsPipe","croptypeStore","keys","Yields","Convert","MainCrop","Unique","getDefaultCroptype","DEFAULT_SORT","ApCropRotationHeaderComponent","dir","searchPhrases","propertyName","resultFilter","search","matchingCroptypeIds","allCropTypes","c","Id","matchingCroptypeId","push","CanScrollLeft","leftAnchor","CanScrollRight","yearInterval","maxIntervals","start","tmp","selectAllFields","selectedFieldsChange","selectedFields","filteredAndSortedItems","x","clearAllFiltersInFilterComponents","filterComponents","forEach","filterComponent","sortByName","processSort","sortByTNr","sortBySubNr","sortByArea","onFutureClick","newInterval","createNewInterval","yearIntervalChange","onBackClick","sortDescriptor","sort","detectOperation","nextSortOperations","sortChange","s","op","DetailOffCellComponent","ctx_r10","ctx_r14","ctx_r15","ctx_r16","ctx_r20","ctx_r21","ctx_r22","ctx_r23","ctx_r24","ctx_r25","ctx_r27","ctx_r28","ctx_r30","ctx_r32","ctx_r33","ctx_r34","ctx_r35","ctx_r36","ctx_r40","ctx_r41","ctx_r42","ctx_r43","ctx_r44","DetailCellComponent","cropTypeStore","notifyStore","changeDetectorRef","Year","YearIndex","FieldId","MainCropYield","MainCropStraw","SecondCrop","SecondCropYield","DefaultCrop","availableCropTypes","data","mainCrop","currentValue","secondCrop","mainCropSource","secondCropSource","Any","concat","changeStrawHarvested","saveCell","ObjectFactory","onMainCropChange","ct","console","warn","ExpectedYield","lostFocus","onSecondCropChange","onMainCropYieldChange","parseYield","onSecondCropYieldChange","onAddMainCrop","getFocus","detectChanges","mainCropComboBox","focus","addMessage","NoSelectedCropNotification","onAddSecondCrop","secondCropComboBox","onYieldKeyUp","onGetFocus","onLostFocus","handleMainCropFilter","valueToSearch","Shortname","handleSecondCropFilter","onKeyDown","$event","parsedYield","parseFloat","Counter","DisplayTimeout","ErrorKey","Level","Parameters","UserName","UserId","ctx_r3","ctx_r6","DetailComponent","ToCellValuePipe","currentYear","yearIdx","itemIndex","Array","isArray","FieldIsActivePipe","vf","ValidFrom","DateTime","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","vt","ValidTo","fieldInterval","DateRange","Overlaps","GetMappedChildrenPipe","cropTypeStateService","cropTypeIds","Children","store","cropTypeId","crop","join","IdCreatorPipe","GetSavingStatePipe","ctx_r7","ctx_r9","ctx_r19","item_r2","ListComponent","jobStore","fieldStore","FarmJobs$","pipe","jobs","connectJobWithFields","ApDynGridStatusColumnConfig","class","pending","BlockedFieldIdsCe$","pendingTooltip","BlockedFieldIdsCeTooltip$","trackFieldList","index","item","FieldName","FieldNumber","FieldSubNumber","AreaHa","fields","visibleState","id","visibleValues","switchVisibleState","fieldId","hasOwnProperty","selectField","findItem","without","union","onChildBeginAnimation","fromState","toState","onChildDoneAnimation","trigger","state","style","height","transition","animate","changeDetection","ctx_r11","button_r17","CHM","PagerComponent","BehaviorSubject","APP_CONFIGURATION","pageSize","skip","currentPage","total","itemCount","contextChanges","changePage","page","getDimensions","next","buttonCountOffset","Math","floor","buttonCount","currentPageChange","onSelectedColumnChange","selectedColumn","selectedColumnChange","onSelectedValueChange","selectedValue","selectedValueChange","numOfPages","ceil","dimensions","onPageSizeChanged","pageSizeChanged","ApCropRotationGridComponent","translationStore","campaignYearStore","mapViewStore","modalDialogStore","modalDialogPresets","campaignYearService","ApDynformsValidator","validator","yieldRequiredIfCropIsSet","errorKey","fromEvent","window","SidebarMode","MapViewMode","take","_sort","ResizeObserver","entries","entry","dataWrapperHeight","contentRect","frm","get","mainCropYieldControl","mainCropYield","a","secondCropYieldControl","validationError","missingYield","p","setErrors","ngOnInit","dataWrapperObserver","observe","_dataWrapper","_subscriptions","Listen","selectedYear","subscribe","d","sidebarChange$","_lastSidebarMode","mapViewChange$","_lastMapViewMode","merge","windowResize","setAvailableInterval","innerWidth","ApMapInstance","updatedSelectedFields","_c","slice","_d","selectedFieldIndex","_e","FindIndex","u","RemoveAt","_f","onSelectionChange","searchText","filterMainItems","clearAllFilters","clear","clearAllFiltersLogic","setWizardOptions","result","_modalDialogOkClicked","_state","itemsFilteredNoPaging","process","items","itemView","fullItems","headerComponent","mapItems","ngOnDestroy","unsubscribe","pagerDataSubscription","onPageChange","pageNumber","onSort","descriptors","onFilter","onMassEditApply","fieldsAmount","_massEditPagerData","setModalDialogData","ExistPlanBooksDialog","confirmKey","message","FindTranslationForSelectedLanguage","applyMassEditAction","object","massEditChange","Ids","Value","form","massEditRemoveMainCrop","massEditRemoveSecondCrop","selectedItems","some","selectedId","onMultiSelectionChange","getMapViewMode","getMapViewCurrentMenu","MapViewCurrentMenu","changeSelectedField","mainCropMassEditChanged$","secondCropMassEditChanged$","formConfig","currentMultiSelect","ApDynformsConfigFieldset","legend","config","ApDynformsConfigComboBox","valueField","textField","valuePrimitive","label","validators","ApDynformsConfigNumerictextbox","min","cssClass","value$","cropType","ApDynformsConfigCheckbox","ApDynformsConfigPlaceholder","getValue","fieldNameSearchText","ignoreCase","fieldNumberSearchText","fieldSubNumberSearchText","fullTextFilters","cofIdx","f","__","sidebarOffset","anzColumns","columnWidth","combineLatest","SelectedCampaignYear$","yearValues","iterationYear","disabled","campaignYearRange","getCampaignYearRange","isCampaignYearIntersects","Date","values","listMassEditing$","name","type","ApGridPagerType","_pager","onFormValueChanges","v","control","ApCropRotationComponent","ComponentCanDeactivate","cropRotationStore","menuStore","settingsStore","statisticStore","cropStatisticService","statisticService","FieldCropRotations$","of","FieldCropSaving$","mode","hideMapView","loading$","FieldCropRotationsLoading$","Loading$","loadingItems","ngAfterContentInit","CropTypes$","cropTypes","Selected","SortBy","ListSortOrder","FirstSetting$","settings","_selectedItemsOnGrid$","asObservable","fieldCropRotation","selectedItemsOnGrid","_generateStatistic","removeStatisticData","canDeactivate","forceSaveMarkedCells","onSelectedItem","selectedFieldCropRotations","onSaveCell","revision","getCellRevision","MarkForSaving","checkForSave","onCellGetFocus","_focusCells","onCellLostFocus","onMassEditChange","ProcessCells","original","CropRotation","mainYield","secondYield","isNaN","onMassEditRemoveMainCrop","dataset","i2","Object","onMassEditRemoveSecondCrop","totalItems","dataForTitles","z","generateFieldsAreaTitle","SelectedCampaignYear","gatherFieldCropRotationData","setStatisticData","ApStatsType","rev","cell","saveChanges","resetCellRevision","revisionId","cellIdInfo","fromRevisionId","moveMarked","MarkedForSaving","UnmarkFromSaving","dataToSave","toRevisionId","_revisions","split","parseInt","performSearch","searchText$","clearFilters","clearAllFilters$","ctx_r37","ctx_r46","ctx_r49","SoilSampleReportComponent","mapStore","languageStore","loginStore","dataProviders","dateService","roundNumericService","elementService","nutrientService","sampleMethodService","fieldStatisticHistogramService","landUseStore","errorHandlerService","ApElementType","ApElementOxydTypeEnum","font","padding","format","margin","top","elem","method","convertElementOxid","currentFarm","l","farm","selectedFarm","selectedLanguage","currentDateTime","toFarmDate","DateFormat","TimeFormat","soilSampleFieldLayer","Layers","SampleFieldLayer","soilGroupLegend","SOIL_GROUP_LEGEND","soilGroupChartData","categories","getValuesList","colorValues","color","colorFunc","createAndSaveReport","isSaving","setLongOperationStatus","digitsAfterPoint","FirstSetting","DigitsAfterDecimalPoint","itemsFieldLevelPerPage","statisticByField","Map","renderedMaps","problematicFieldsAmount","itemsFieldLevel","b","FieldPart","localeCompare","itemsSampleTrackByField","SampleField","samplesArray","y","GpsNumber","fieldNames","findIndex","SourceItem","errorMessage","LogClientError","SelectedFarmId","fieldsFirstPageCount","fieldsPerPageCount","reportName","FarmName","sf","set","getHistogramStatistic","Status","Histograms","k","h","areaSum","histograms","resize","getLandUseTranslation","landuse","LandUse","Key","saveReport","landscapePages","from","_report","element","querySelectorAll","pageBreaks","export","then","group","pageIndex","el","children","landscape","paperSize","log","exportPDF","saveAs","exportDone","getSamplesNumber","st","singleTrack","calculateIfPageBreakNeededForSamples","fieldIndex","sampleIndex","samplesPerPageCount","onRenderCompleted","getDistributionMapUrl","elementId","url","SoilSampleDistributionUrl","replaceAll","replace","getFeatureUrl","getSampleTrackMapUrl","getSoilGroupMapUrl","getFieldIndex","sampleFieldId","displayValueWithGreaterSign","isGreater","digitsToDisplay","round","displayAvgValueWithGreaterSign","displayValueByClass","valueClass","ApSamplefieldsComponent","soilSampleFieldStore","permissionPipe","soilSampleFieldClassColorPipe","roundNumericPipe","jobsStore","soilSampleService","_exportFilenameParts","DateExpr","CustomerExpr","Filename","EnableDistributionView","_gridBuilder","_getDataFromStore","dynComponent","SelectedItems$","_selectionChange","SelectedSoilSampleFields$","exportedShapeFile","filename","Blob","Uint8Array","resetDownloads","currentMenu","mapViewMenu","getSelectedItems","DisableDistributionView","getSelectedCampaignYear","items$","SoilSampleFields$","Fields$","ssF","soilSample","classP","_soilClassColor","ClassP","classK","ClassK","classMG","ClassMg","classPH","ClassPh","pIsGreaterE","kIsGreaterE","mgIsGreaterE","phIsGreaterE","pValue","P","MethodP","kValue","K","MethodK","mgValue","Mg","MethodPh","phValue","Ph","pValueRounded","roundAsNumber","kValueRounded","mgValueRounded","phValueRounded","StatusClass","SoilGroups","NrSNr","getFieldNumberAndSubNumber","Area","SampleDate","getDateMidnight","PValue","KValue","MgValue","PhValue","PIsGreaterE","KIsGreaterE","MgIsGreaterE","PhIsGreaterE","PValueTooltip","formatClassificationTooltip","KValueTooltip","MgValueTooltip","MethodMg","PhValueTooltip","PContentTooltip","getUnitWithMethod","KContentTooltip","MgContentTooltip","PhContentTooltip","columns$","SelectedLanguage$","nameOf","BlockedSoilSampleFieldIdsBu$","BlockedSoilSampleFieldIdsBuTooltip$","ApDynGridPropertyColumnConfig","hide","headerFilterable","ApDynGridColumnHideConfig","mapHide","selfHide","m","sortIndex","pipes","ApDynGridGroupColumnConfig","headerStyle","border","groupColumns","ApDynGridClassColorColumnConfig","GetElementStringByString","dataItem","formatCallback","ApDynGridEditColumnConfig","ApPermissions","permissions","pager","ApDynGridPagerConfig","listMassEditing","_listMassEditing","apply","_applyClicked","hasPermission","iconButtons","icon","Icon","callback","ApUtilService","_onExportPdf","_onExportPdfReport","_onExportXls","_onExportShape","dynGrid","pdfExportFileName","_generateExportFilename","exportAsPdf","sampleTracksInfo","watchStream","action","SampleTracksInfoSuccess","todo","payload","Error","SetLoadFailState","SetLoadFinishState","soilSampleReportComponent","Data","changeSelectedSampleField","soilSampleIds","samplePointsExcelExport","sampleTracksShapeExport","formatExpr","SelectedFarm","CustomerNumber","itemsToSelect","zoomFarmFields","statisticData","_getTitleForStatistic","generateHistogramStatistic","restoreSelection","ApDynComponentComponent","NdiActiveView","SatelliteMassEditAction","NdiComponent","ndiStore","nUptakeFactorsStore","translationService","cropService","ndiService","agriportConstantsService","updateLayerVisibility","loading","_halfViewModeChange","_halfViewMode$","mapInitialized","distinctUntilChanged","previous","current","selectedCampaignYear","currentFarmDate","getFarmDate","isNeedToShowComponent","getCampaignYearByDate","CampaignYear","Legends","onNdiLegendShow","showDynComponent$","NdiStatistics$","nUptakeFactors$","nIndexData","nUptakeFactors","_getItems","_statisticUpdateRequested","debounceTime","_generateStats","mapMode","mapMenu","_onApplyClicked","fieldCropsSaved","_invokeWhenFieldCropsUpdated","ndiStatistics","fieldCrop","getFieldCrop","getCropType","ndiSatScan","FieldGeomId","E","DefaultGeom","createdDate","Created","gridStatus","getCustomStatusForNdiRecord","satelliteNValues","getSatelliteNValues","nUptakeValue","_getNUptakeStatus","isNdiScanValid","StatusDesc","description","Name","Nr","TNr","FieldSubnumber","FieldCrop","Description","EcValue","CropType","AdminArea","NUptakeStatus","NUptakeStatusClass","NUptakeStatusDesc","SatelliteNValues","User$","_1","defaultFilter","ApColumnState","sortDesc","CurrentDateFormat","GetRoundNumericPipeConfig","groupIndex","groupDesc","headerButtons","nextClicked","previousClicked","nextDisabled","previousDisabled","xlsExport","pager$","FieldMassEditAction","translate","onSubmit","GetConstant","decimals","Validators","satelliteValues","nUptakeFactor","getNUptakeFactor","Number","isFinite","NUptakeAvg","selectedFieldCrops","copiedFieldCrops","EcValueToUpdate","saveFieldCrops","isUpdated","showSaveSuccessMessage","showSaveFailMessage","clearStyleCache","NUptakeLayer","reload","currentSelected","gridRow","orderBy","gridPaging","getDescriptors","Cells","NIndexMin","NIndexMax","NIndexAvg","NIndexHistogram","NUptakeMin","NUptakeMax","_g","S","_h","NUptakeHistogram","_j","Visibility","NdiLayer","ApElevationComponent","ngAfterViewInit","ApSoilScanComponent","MonitoringConfig","getMainGridColumns","burgerMenuButtons","setting","language","template","PropertyTemplate","getDetailsGridColumns","ApDynGridDetailsGridConfig","checkboxDisabled","Details","columns","getPager","factory","routes","path","component","FieldOverviewComponent","canActivate","ApPermissionGuard","login","layout","PageMode","ApDeactivateGuard","ApPageNotFoundComponent","formStore","nFertilizationStore","monitoringTypeStore","monitoringFieldStore","monitoringDetailStore","plantProtectionPlanBooksStore","nFertilizationService","plantProtectionService","monitoringConfig","cropGroupStore","baseFertilizationSummaryStore","_handleHalfMapAndGridView","_setLoading","_buildGrid","_buildItems","_handleSelectionChange","FormClose$","loadMonitoringTypes","loadMonitoringFields","loadMonitoringDetails","loadPlanBooks","LoadNFertilizationPlanningSummaries","LoadLogfiles","onCreate","openForm","ApMonitoringFieldEntryComponent","loadings","loaded","menuButtons","text","_createMonitoringDetail","_deleteMonitoringField","detailsColumns$","_editMonitoringDetail","_deleteMonitoringDetail","MonitoringFields$","MonitoringDetails$","MonitoringTypes$","PlanBooks$","Logfiles$","Summaries$","monitoringFields","monitoringDetails","monitoringTypes","nPlanBooks","nLogFiles","ppPlanBooks","detailsLoading","baseFertSummaries","monitoringField","fieldGeom","getCurrentFieldGeom","mainCropDescription","parseMainCrop","details","_getDetailsForMonitoringField","latestDetailDate","_getLatestDetail","highestDetailEcValue","_getHighestEcValueFromDetails","_getMonitoringFieldStatus","baseFertPlanBooks","BasicFertilisationPlanBooks","flat","BookedAt","nFertilizationApplications","getContentNRelatedPlanBooks","planProtectionApplications","getPpApplications","latestNApplicationDate","_getLatestApplicationDateForField","latestPpApplicationDate","FieldDefaultGeom","FieldSecondNumber","FieldCombinedNumber","CropName","LatestMeasurementDate","LatestNApplicationDate","LatestPpApplicationDate","ContentNRelatedPlanBooks","displayDetailsPositions","GeoPointsLayer","deleteAllPoints","detail","Position","addPoint","coordinates","monitoringFieldId","MonitoringFieldId","fieldName","getFieldNameById","monitoringType","TypeId","TypeName","TranslationKey","Type","Recommendation","EcStage","Notes","FilesCount","Attachments","status","dateTimeUtc","getUtc","dateDiffInDays","getDateDiff","DateDiffType","reduce","getTime","planBooks","planBooksForCurrentField","pb","ApplicationDate","planBook","goIntoMapMenu","selectedFieldIds","MonitoringDetails","DeleteDialog","resultDelegate","dialogData","ModalDialogButtonKeys","deleteMonitoringField","fieldPolygon","FieldsLayer","layer","getSource","getFeatureById","getGeometry","getCoordinates","ApMonitoringDetailEntryComponent","MonitoringDetailId","setSelectedKeys","deleteMonitoringDetail","emptyTitle","chartConfigs","ValueUnit","monitoringDates","valueOf","minDate","Min","maxDate","getEndOfDayDate","Max","statRelatedNApplications","_findStatRelatedNApplications","foundNApplicationDates","PlanBookApplicationDate","minDateApplications","maxDateApplications","monitoringDetailsByType","GroupBy","monitoringTypeId","MonitoringTypes","FirstOrDefault","N","chartConfig","_generateStatChartConfig","noteField","_generateAppliedNSeries","GenericChartConfig","xAxisConfig","labelDelegate","xAxisValue","pannable","zoomable","baseUnit","axisCrossingValue","MIN_VALUE","MAX_VALUE","yAxisConfig","GenericYAxisConfig","yAxisConfigs","monitoringDetailsByField","detailsByField","seriesConfig","GenericSeriesConfig","_calculateSeriesColor","seriesData","GenericSeriesData","xValue","yValue","seriesConfigs","statNApplications","fieldIds","yAxisNApplicationConfig","ApGuidUtil","nApplicationsByField","relatedMonitoringSeries","nApplicationsForField","seriesConfigNApplication","axisId","hideLegend","nApplicationsByDate","nApplicationDate","nApplications","appliedN","n","Y","NFertilization","Average","avgAppliedN","minDateMonitoring","fieldIdsRelevantForNApplications","campaignYearStart","DefaultStart","newYear","minDatePlanBookFilter","colors","getCropGroups","Colordefault","MonitoringComponent","decls","ApFieldmanagementRoutes","RouterModule","ApCampaignyearCropConverterPipe","counter","selectedValues","FieldCrops","moment","Cropkey","main_second_crop_type","MainSecondCropType","avg","sum","count","cropkey","ApCropRotationModule","imports","CommonModule","ApTranslationModule","ApCoreModule","ApResponsiveTextModule","PopupModule","MultiSelectModule","InputsModule","FormsModule","ButtonModule","ComboBoxModule","TextBoxModule","ApUtilsModule","SliderModule","ButtonsModule","ApDynGridsModule","ApTooltipModule","ApGetFieldNamePipe","getFieldName","getFieldById","ApFieldManagementModule","PagerContextService","ReactiveFormsModule","ApIconModule","LayoutModule","ApStatisticsModule","ApLayoutModule","SplitButtonModule","DateInputsModule","DropDownsModule","GridModule","SharedModule","BodyModule","PagerModule","HeaderModule","ApSectionHeaderModule","ApDynComponentModule","ApPermissionModule","ApReportsModule","ApSoilSampleService","soilSampleField","getStatus","sampleDate","difference","getCampaignYear","FieldStatisticHistogramService","fieldNutrientDistributionStore","soilGroupFormatService","soilSampleClassColorService","soilSampleClassNamePipe","Reduce","Create","_createStatistic","ChartSetValueType","soilPlanningYears","fieldSoilPlanningYears","hist","val","Values","category","date","cells","Counters","dateName","_mapDate","found","dates","percent","allCells","Sum","counters","fill","res","dis","valueType","axes","getStatisticAxesConfig","step","_mapSampleRegion","_mapSampleMethods","mapSingle","_mapLanduse","decimalPlaces","getColor","colorCode","years","fieldYears","SampleMethods","Method","region","SampleRegions","Region"],"sources":["./src/app/ap-dyngrids/config/ap-dyn-grid-class-color-column-config.ts","./src/app/ap-crop-rotation/enums/crop-rotation-operations.enum.ts","./src/app/ap-crop-rotation/enums/next-sort-operation.ts","./src/app/ap-crop-rotation/enums/filter-type.ts","./src/app/ap-crop-rotation/components/header/filter/ap-crop-rotation-filter.component.html","./src/app/ap-crop-rotation/components/header/filter/ap-crop-rotation-filter.component.ts","./src/app/ap-crop-rotation/pipes/find-sort.pipe.ts","./src/app/ap-crop-rotation/components/header/sort/sort.component.html","./src/app/ap-crop-rotation/components/header/sort/sort.component.ts","./src/app/ap-crop-rotation/components/header/detail-header/detail-header.component.ts","./src/app/ap-crop-rotation/components/header/detail-header/detail-header.component.html","./src/app/ap-crop-rotation/pipes/all-crops.pipe.ts","./src/app/ap-crop-rotation/components/header/ap-crop-rotation-header.component.html","./src/app/ap-crop-rotation/components/header/ap-crop-rotation-header.component.ts","./src/app/ap-crop-rotation/components/list/detail/detail-off-cell/detail-off-cell.component.ts","./src/app/ap-crop-rotation/components/list/detail/detail-cell/detail-cell.component.html","./src/app/ap-crop-rotation/components/list/detail/detail-cell/detail-cell.component.ts","./src/app/ap-crop-rotation/components/list/detail/detail.component.html","./src/app/ap-crop-rotation/components/list/detail/detail.component.ts","./src/app/ap-crop-rotation/pipes/to-cell-value.pipe.ts","./src/app/ap-crop-rotation/pipes/field-is-active.pipe.ts","./src/app/ap-crop-rotation/pipes/get-mapped-children.pipe.ts","./src/app/ap-crop-rotation/pipes/id-creator.pipe.ts","./src/app/ap-crop-rotation/pipes/get-saving-state.pipe.ts","./src/app/ap-crop-rotation/components/list/list.component.html","./src/app/ap-crop-rotation/components/list/list.component.ts","./src/app/ap-crop-rotation/components/pager.component.html","./src/app/ap-crop-rotation/components/pager.component.ts","./src/app/ap-crop-rotation/components/ap-crop-rotation-grid.component.ts","./src/app/ap-crop-rotation/components/ap-crop-rotation-grid.component.html","./src/app/field-management/components/ap-crop-rotation/ap-crop-rotation.component.ts","./src/app/field-management/components/ap-crop-rotation/ap-crop-rotation.component.html","./src/app/ap-reports/components/soil-sample-report/soil-sample-report.component.html","./src/app/ap-reports/components/soil-sample-report/soil-sample-report.component.ts","./src/app/field-management/components/ap-samplefields/ap-samplefields.component.ts","./src/app/field-management/types/ndi.types.ts","./src/app/field-management/components/ndi/ndi.component.html","./src/app/field-management/components/ndi/ndi.component.ts","./src/app/field-management/components/ap-elevation.component.ts","./src/app/field-management/components/ap-soil-scan.component.ts","./src/app/field-management/components/ap-monitoring/monitoring.config.ts","./src/app/field-management/ap-fieldmanagement.routes.ts","./src/app/field-management/components/ap-monitoring/monitoring.component.ts","./src/app/field-management/pipes/ap-campaignyear-crop-converter.pipe.ts","./src/app/ap-crop-rotation/ap-crop-rotation.module.ts","./src/app/field-management/pipes/ap-get-field-name.pipe.ts","./src/app/field-management/ap-field-management.module.ts","./src/app/nutrient-management/service/ap-soil-sample.service.ts","./src/app/services/data/field-statistic-histogram.service.ts"],"sourcesContent":["import {\n ApDynGridColumnConfigBase,\n ApDynGridColumnControlType,\n ApDynGridColumnHideConfig,\n IPipeDefinition\n} from './ap-dyn-grid-column-config-base';\n\nexport class ApDynGridClassColorColumnConfig extends ApDynGridColumnConfigBase {\n public type = ApDynGridColumnControlType.ClassColor;\n public field: string;\n public showHeaderTitle: boolean;\n public title: string;\n public key: string;\n public width: number;\n public tooltip: string;\n public filterable: boolean;\n\n constructor(options: {\n hide?: boolean | ApDynGridColumnHideConfig,\n sortIndex?: number,\n sortDesc?: boolean,\n groupIndex?: number,\n groupDesc?: boolean,\n headerStyle?: any,\n style?: any,\n pdfExport?: boolean,\n xlsExport?: boolean,\n field?: string,\n showHeaderTitle?: boolean,\n title?: string,\n class?: string,\n key?: string,\n description?: string,\n width?: number,\n tooltip?: string,\n cssClass?: 'left' | 'right' | 'center',\n pipes?: IPipeDefinition[],\n tooltipPipes?: IPipeDefinition[],\n filterable?: boolean,\n } = {}) {\n super(options);\n this.key = options.key;\n this.width = options.width;\n this.field = options.field ? options.field : undefined;\n this.showHeaderTitle = options.showHeaderTitle ? options.showHeaderTitle : false;\n this.title = options.title ? options.title : ' ';\n this.tooltip = options.tooltip ? options.tooltip : '';\n this.filterable = options.filterable === false ? false : true; // default is true and can explicitly set to false in component\n }\n}\n","/**\n * The MassEdit Operations of the Crop Rotation Grid\n */\nexport enum CropRotationOperations {\n CHANGE,\n REMOVE_SECOND_CROP,\n REMOVE_MAIN_CROP\n}\n","/**\n * The Sort Operations\n */\nexport enum NextSortOperation {\n ON = 1,\n OFF,\n SWITCH\n}\n","export enum FilterType {\n MULTI_SELECT,\n RANGE\n}\n","\n \n\n\n
\n \n \n \n \n \n \n \n
\n
\n \n \n
\n
\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {CompositeFilterDescriptor, FilterDescriptor} from '@progress/kendo-data-query';\nimport {map, max, sortBy, uniq} from 'lodash';\nimport {FilterType} from '../../../enums/filter-type';\n\n/**\n * the DataSource Filter Component inspired by Kendo\n */\n@Component({\n selector: 'ap-crop-rotation-filter',\n templateUrl: './ap-crop-rotation-filter.component.html',\n styleUrls: ['./ap-crop-rotation-filter.component.scss']\n})\nexport class ApCropRotationFilterComponent implements OnChanges {\n public get ProcessFilterDisabled(): boolean {\n switch (this.filterType) {\n case FilterType.MULTI_SELECT:\n return !this.selected || this.selected.length < 1;\n case FilterType.RANGE:\n return false;\n }\n }\n\n private get MeaningKey(): string {\n return this.mapKey || this.key;\n }\n\n @ViewChild('Filter', {static: false}) private filterLink: ElementRef;\n @ViewChild('pop', {static: false, read: ElementRef}) private popup: ElementRef;\n /**\n * the Kendo Filter Descriptor\n */\n @Input() public filter: CompositeFilterDescriptor;\n /**\n * the DataSource of Values to select\n */\n @Input() public source: any[] = [];\n /**\n * the Key of the Property from DataSource (Grid)\n */\n @Input() public key = '';\n /**\n * other Property Key when the Grid DataSource Property is different to this selection Source (optional)\n */\n @Input() public mapKey: string;\n /**\n * some Metadata that is used in the buildFilter Method (optional)\n */\n @Input() public meta: any;\n /**\n * logic to build a Filter definition (optional)\n */\n @Input() public buildFilter: (s: any[], year: number, propertyName: string) => Array = null;\n /**\n * the type of the Control\n */\n @Input() public filterType: FilterType = FilterType.MULTI_SELECT;\n\n /**\n * fires when the Filter was changed\n */\n @Output() public filterChange = new EventEmitter();\n\n /**\n * is the Filter visible\n */\n public show = false;\n public minValue: number;\n public maxValue: number;\n public recentNumberFilter: CompositeFilterDescriptor = null;\n public filterTypes = FilterType;\n /**\n * a List of selected Values for the Filter\n */\n public selected: any[] = [];\n\n /**\n * get the Selection Source as unique List\n */\n public distinctSource: any[] = [];\n public filteredSource: any[] = [];\n\n private _myFilter: CompositeFilterDescriptor = null;\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.source) {\n setTimeout(this._createDistinctSource.bind(this), 1);\n }\n }\n\n @HostListener('keydown', ['$event'])\n public keydown(event: any): void {\n if (event.keyCode === 27) {\n this.show = false;\n }\n }\n\n @HostListener('document:click', ['$event'])\n public documentClick(event: any): void {\n if (!this._contains(event.target)) {\n this.show = false;\n }\n }\n\n /**\n * updates the current Filter with new Values\n */\n public processFilter(): void {\n if (this.filterType === FilterType.RANGE) {\n this._processRange();\n } else {\n this._processMultiSelect();\n }\n }\n\n /**\n * delete the current Filter\n */\n public clearFilter(): void {\n this.selected = [];\n this._resetRangeValues();\n this.show = false;\n this.processFilter();\n }\n\n public handleFilter(e: string): void {\n if (!e) {\n this.filteredSource = [...this.distinctSource];\n }\n if (this.distinctSource[0]) {\n if (typeof this.distinctSource[0].includes === typeof function (): void {\n } || typeof this.distinctSource[0] === typeof 0) {\n this.filteredSource = this.distinctSource.filter(i => i?.toString()?.toLowerCase()?.includes(e?.toLowerCase()));\n }\n }\n }\n\n public numberFilterChanged(filterDescriptor: FilterDescriptor[]): void {\n if (!filterDescriptor || filterDescriptor.length) {\n this.minValue = 0;\n this.maxValue = max(this.distinctSource);\n }\n\n const minFilter = filterDescriptor.find(_ => _.operator === 'gte');\n const maxFilter = filterDescriptor.find(_ => _.operator === 'lte');\n\n if (minFilter) {\n this.minValue = minFilter.value;\n } else {\n this.minValue = 0;\n }\n\n if (maxFilter) {\n this.maxValue = maxFilter.value;\n } else {\n this.maxValue = max(this.distinctSource);\n }\n\n this.recentNumberFilter = {logic: 'and', filters: filterDescriptor};\n }\n\n public isFilterActive(): boolean {\n if (this.filterType === FilterType.RANGE) {\n return this.recentNumberFilter && this.recentNumberFilter.filters?.length > 0;\n } else {\n return this.selected && this.selected?.length > 0;\n }\n }\n\n private _contains(target: any): boolean {\n return this.filterLink.nativeElement.contains(target) ||\n (this.popup ? this.popup.nativeElement.contains(target) : false);\n }\n\n private _createDistinctSource(): void {\n const uniqKeyValues = uniq(map(this.source, (i: any) => i ? i[this.key] : undefined));\n this.distinctSource = sortBy(uniqKeyValues, (i: any) => i);\n this.filteredSource = [...this.distinctSource];\n if (this.filterType === FilterType.RANGE) {\n this.minValue = 0;\n this.maxValue = max(this.distinctSource);\n }\n }\n\n private _processRange(): void {\n if (!this.filter) {\n this.filter = {\n logic: 'and',\n filters: [],\n };\n }\n this.filter.filters = this.filter.filters.FindAll(_ => _ !== this._myFilter);\n if (this.minValue === 0 && this.maxValue === max(this.filteredSource)) {\n this.filterChange.emit(this.filter);\n this.show = false;\n return;\n }\n this._myFilter = {\n logic: 'and',\n filters: [\n {\n field: this.MeaningKey,\n value: this.minValue,\n operator: 'gte'\n },\n {\n field: this.MeaningKey,\n value: this.maxValue,\n operator: 'lte'\n }\n ],\n };\n this.filter.filters.Add(this._myFilter);\n this.filterChange.emit(this.filter);\n this.show = false;\n }\n\n private _resetRangeValues(): void {\n if (this.filterType === FilterType.RANGE) {\n this.recentNumberFilter = null;\n this.minValue = 0;\n this.maxValue = max(this.distinctSource);\n }\n }\n\n private _processMultiSelect(): void {\n if (!this.filter) {\n this.filter = {\n logic: 'and',\n filters: [],\n };\n }\n this.filter.filters = this.filter.filters.FindAll(_ => _ !== this._myFilter);\n if (this.selected.length < 1) {\n this.filterChange.emit(this.filter);\n this.show = false;\n return;\n }\n let filters: CompositeFilterDescriptor = {\n logic: 'or',\n filters: this.selected.map(i => {\n return {\n field: this.MeaningKey,\n value: i,\n operator: 'eq'\n };\n }),\n };\n if (typeof this.buildFilter === 'function') {\n filters = {\n logic: 'or',\n filters: this.buildFilter(this.selected, this.meta.year, this.key),\n };\n }\n this._myFilter = filters.filters.length < 1 ? {\n logic: 'or',\n filters: [],\n } : filters;\n this.filter.filters.Add(this._myFilter);\n this.filterChange.emit(this.filter);\n this.show = false;\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {SortDescriptor} from '@progress/kendo-data-query';\n\n/**\n * find a SortDescriptor by FieldId\n */\n@Pipe({\n name: 'findSort'\n})\nexport class FindSortPipe implements PipeTransform {\n\n transform(value: SortDescriptor[], args?: string): SortDescriptor {\n return value.Find(i => i.field === args);\n }\n\n}\n","
\n \n
\n","import {Component, Input} from '@angular/core';\nimport {SortDescriptor} from '@progress/kendo-data-query';\n\n/**\n * the Sorting Control inspired by Kendo\n */\n@Component({\n selector: 'ap-crop-rotation-sort',\n templateUrl: './sort.component.html',\n styleUrls: ['./sort.component.scss']\n})\nexport class SortComponent {\n /**\n * the Sort Description\n */\n @Input() public sort: SortDescriptor[] = [];\n /**\n * the Field in the DataSource to Sort\n */\n @Input() public field = '';\n}\n","import {Component, Input} from '@angular/core';\n\n/**\n * the Header for a Detail Cell\n */\n@Component({\n selector: 'ap-crop-rotation-detail-header-big',\n templateUrl: './detail-header.component.html'\n})\nexport class DetailHeaderComponent {\n /**\n * is this Cell stands for the current Campaign Year then highlight it\n */\n @Input() isHighlighted = false;\n /**\n * the Label for the Main Crop\n */\n @Input() mainCropLabel = '';\n\n /**\n * the Label for Straw Harvested\n */\n @Input() mainCropStrawHarvestedLabel = '';\n /**\n * the Label for the Main Crop Yield\n */\n @Input() mainCropYieldLabel = '';\n /**\n * the Label for the Second Crop\n */\n @Input() secondCropLabel = '';\n /**\n * the Label for the Second Crop Yield\n */\n @Input() secondCropYieldLabel = '';\n}\n","
\n
\n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {CropTypeStore} from '../../stores/base-data/crop.types.store';\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\nimport ICropTypes = Data.BaseData.ICropTypes;\n\n@Pipe({\n name: 'allCrops'\n})\nexport class AllCropsPipe implements PipeTransform {\n\n constructor(private croptypeStore: CropTypeStore) {\n }\n\n transform(value: IFieldCropRotation[], args?: number): ICropTypes[] {\n if (!value || !(args >= 0)) {\n return [];\n }\n const keys = value\n .FindAll(_ => !!_.Yields[args])\n .Convert(_ => _.Yields[args].MainCrop)\n .FindAll(_ => _ >= 0)\n .Unique();\n return keys.Convert(i => this.croptypeStore.getDefaultCroptype(i));\n }\n\n}\n","
\n
\n
\n
\n \n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n","import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output, QueryList, ViewChildren} from '@angular/core';\nimport {CompositeFilterDescriptor, FilterDescriptor, SortDescriptor} from '@progress/kendo-data-query';\nimport {NextSortOperation} from '../../enums/next-sort-operation';\nimport {FilterType} from '../../enums/filter-type';\nimport IGuid = System.IGuid;\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\nimport ICropTypes = Data.BaseData.ICropTypes;\nimport {BehaviorSubject} from 'rxjs';\nimport {\n ApCropRotationFilterComponent\n} from './filter/ap-crop-rotation-filter.component';\n\nconst DEFAULT_SORT = 'asc';\n\n/**\n * The Header of the CropRotation Grid\n */\n@Component({\n selector: 'ap-crop-rotation-header',\n templateUrl: './ap-crop-rotation-header.component.html',\n styleUrls: ['./ap-crop-rotation-header.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ApCropRotationHeaderComponent {\n @ViewChildren(ApCropRotationFilterComponent) filterComponents: QueryList;\n\n /**\n * the current selected Field Ids\n */\n @Input() public selectedFields: IGuid[] = [];\n /**\n * the filtered and sorted ItemView from the Grid\n */\n @Input() public fields: IFieldCropRotation[] = [];\n /**\n * full list ItemView from the Grid\n */\n @Input() public fullItems: IFieldCropRotation[] = [];\n /**\n * the filtered and sorted ItemView from the Grid\n * without paging!\n */\n @Input() public filteredAndSortedItems: IFieldCropRotation[] = [];\n /**\n * the FieldName Translation Text\n */\n @Input() public nameText = '';\n /**\n * the FieldNumber Translation Text\n */\n @Input() public numberText = '';\n /**\n * the FieldSubNumber Translation Text\n */\n @Input() public subNumberText = '';\n /**\n * the AreaHa Translation Text\n */\n @Input() public areaText = '';\n /**\n * the current CampaignYear\n */\n @Input() public currentYear: number;\n /**\n * the Interval of Years to Display\n */\n @Input() public yearInterval: number[];\n /**\n * the Width of one Cell\n */\n @Input() public columnWidth: number;\n /**\n * the Kendo FilterDescriptor that filters the Grid DataSource\n */\n @Input() public filter: CompositeFilterDescriptor;\n /**\n * the available Croptypes for the Farm\n */\n @Input() public availableCropTypes: ICropTypes[];\n @Input() public allCropTypes: ICropTypes[];\n\n /**\n * fires when the selected Field was changed\n */\n @Output() public selectedFieldsChange = new EventEmitter();\n /**\n * fires when the Sorting was changed\n */\n @Output() public sortChange = new EventEmitter();\n /**\n * fires when the Kendo Filter was changed\n */\n @Output() public filterChange = new EventEmitter();\n /**\n * fires when the Years Interval was changed\n */\n @Output() public yearIntervalChange = new EventEmitter();\n\n public filterTypes = FilterType;\n\n /**\n * can move the Years View to the left Side\n */\n public get CanScrollLeft(): boolean {\n return this.leftAnchor > -1;\n }\n\n /**\n * can move the Years View to the right Side\n */\n public get CanScrollRight(): boolean {\n return (this.leftAnchor + this.yearInterval.length + 1) < this.maxIntervals;\n }\n\n /**\n * the Sort Operation that was processed when the User hits Sort\n */\n public nextSortOperations: { [key: string]: NextSortOperation } = {};\n\n /**\n * the Kendo SortDescriptor that sorts the DataSource of the Grid\n */\n public sort: SortDescriptor[] = [\n {\n dir: DEFAULT_SORT,\n field: 'FieldName'\n }\n ];\n\n /**\n * the current Position of the Years View\n */\n public leftAnchor = -1;\n\n /**\n * the Years Interval Length\n */\n public maxIntervals = 7;\n\n private static createNewInterval(start: number, length: number): number[] {\n const tmp: number[] = [];\n for (let i = start; i < (length + start); i++) {\n tmp.push(i);\n }\n return tmp;\n }\n\n /**\n * select all Fields in the DataSource\n */\n public selectAllFields(): void {\n setTimeout(() => {\n if (this.selectedFields.length === this.filteredAndSortedItems.length) {\n this.selectedFieldsChange.emit([]);\n } else {\n this.selectedFieldsChange.emit(this.filteredAndSortedItems.map(x => x.Id));\n }\n }, 1);\n }\n\n public clearAllFiltersInFilterComponents(): void {\n this.filterComponents?.forEach((filterComponent) => {\n filterComponent.clearFilter();\n });\n }\n\n /**\n * sort the DataSource by FieldName\n */\n public sortByName(): void {\n this.processSort('FieldName');\n }\n\n /**\n * sort the DataSource by FieldNumber\n */\n public sortByTNr(): void {\n this.processSort('FieldNumber');\n }\n\n /**\n * sort the DataSource by FieldSubNumber\n */\n public sortBySubNr(): void {\n this.processSort('FieldSubNumber');\n }\n\n /**\n * sort the DataSource by AreaHa\n */\n public sortByArea(): void {\n this.processSort('AreaHa');\n }\n\n /**\n * build the Filter Description for the CropKey Filter\n */\n public createCropKeyFilter: (searchPhrases: any[], year: number, propertyName: string) => FilterDescriptor[] = (searchPhrases, year, propertyName) => {\n // allowing to filter for undefined/empty crops\n const resultFilter = [];\n for (const search of searchPhrases) {\n const matchingCroptypeIds: number[] = search ? this.allCropTypes?.FindAll(_ => _?.[propertyName] === search).map(_ => _.Id) : [0];\n for (const matchingCroptypeId of matchingCroptypeIds) {\n // filter on id '0' if search is undefined(=empty selection)\n if (matchingCroptypeId >= 0) {\n resultFilter.push({\n logic: 'and',\n filters: [\n {\n field: `Yields[${year + 1}].MainCrop`,\n value: matchingCroptypeId,\n operator: 'eq'\n }\n ]\n } as CompositeFilterDescriptor);\n }\n }\n }\n return resultFilter;\n }\n\n /**\n * moves the Years View into Future\n */\n public onFutureClick(): void {\n this.leftAnchor++;\n const newInterval = ApCropRotationHeaderComponent.createNewInterval(\n this.leftAnchor, this.yearInterval.length);\n this.yearIntervalChange.emit(newInterval);\n }\n\n /**\n * moves the Years View into Past\n */\n public onBackClick(): void {\n this.leftAnchor--;\n const newInterval = ApCropRotationHeaderComponent.createNewInterval(\n this.leftAnchor, this.yearInterval.length);\n this.yearIntervalChange.emit(newInterval);\n }\n\n private processSort(field: string): void {\n const sortDescriptor = this.sort.find(i => i.field === field);\n switch (this.detectOperation(sortDescriptor, this.nextSortOperations[field])) {\n case NextSortOperation.SWITCH:\n this.sort = [\n {\n dir: sortDescriptor && sortDescriptor.dir === 'asc' ? 'desc' : DEFAULT_SORT,\n field: sortDescriptor ? sortDescriptor.field : field,\n }\n ];\n this.nextSortOperations[field] = NextSortOperation.OFF;\n break;\n case NextSortOperation.ON:\n this.sort = [\n {\n dir: DEFAULT_SORT,\n field,\n }\n ];\n this.nextSortOperations[field] = NextSortOperation.SWITCH;\n break;\n case NextSortOperation.OFF:\n this.sort = [];\n this.nextSortOperations[field] = NextSortOperation.ON;\n break;\n }\n this.sortChange.emit(this.sort);\n }\n\n private detectOperation(s: SortDescriptor, op?: NextSortOperation): NextSortOperation {\n if (!op) {\n if (s) {\n return s.dir === DEFAULT_SORT ? NextSortOperation.SWITCH : NextSortOperation.OFF;\n } else {\n return NextSortOperation.ON;\n }\n }\n return op;\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'detail-off-cell',\n template: `\n \n
\n
\n `,\n styles: [\n `\n .ap-crop-rotation-off-cell {\n height: 100%;\n width: 160px;\n margin-left: 10px;\n margin-top: 5px;\n background: linear-gradient(to top left,\n rgba(0, 0, 0, 0) 0%,\n rgba(0, 0, 0, 0) calc(48% - 0.8px),\n rgba(44, 50, 55, 0.5) 50%,\n rgba(0, 0, 0, 0) calc(52% + 0.8px),\n rgba(0, 0, 0, 0) 100%),\n linear-gradient(to top right,\n rgba(0, 0, 0, 0) 0%,\n rgba(0, 0, 0, 0) calc(48% - 0.8px),\n rgba(44, 50, 55, 0.5) 50%,\n rgba(0, 0, 0, 0) calc(52% + 0.8px),\n rgba(0, 0, 0, 0) 100%);\n color: rgba(44, 50, 55, 0.75);\n cursor: not-allowed;\n }\n `,\n ]\n})\nexport class DetailOffCellComponent {\n}\n","\n
\n
\n \n \n
\n
\n \n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {filter, includes} from 'lodash';\nimport {CropTypeStore} from '../../../../../stores/base-data/crop.types.store';\nimport {ObjectFactory} from 'ts-tooling';\nimport {NotifyStore} from '../../../../../stores/dialog/notify.store';\nimport {ComboBoxComponent} from '@progress/kendo-angular-dropdowns';\nimport ICropTypes = Data.BaseData.ICropTypes;\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\nimport IApValidationResult = Data.Api.Validation.IApValidationResult;\n\n/**\n * displays the Controls to change the current MainCrop or SecondCrop\n */\n@Component({\n selector: 'ap-crop-rotation-detail-big-cell',\n templateUrl: './detail-cell.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DetailCellComponent implements OnChanges {\n public static NoSelectedCropNotification: IApValidationResult = {\n Counter: 1,\n DisplayTimeout: 3,\n ErrorKey: 'Global__CropType_NotSelected',\n Level: Data.Api.Validation.ApValidationLevel.Error,\n Parameters: [],\n UserName: null,\n UserId: null,\n };\n @ViewChild('mainCropComboBox', {static: false}) mainCropComboBox: ComboBoxComponent;\n @ViewChild('secondCropComboBox', {static: false}) secondCropComboBox: ComboBoxComponent;\n /**\n * the Cell Data\n */\n @Input() public data: ICropRotationCell = {\n Year: null,\n YearIndex: null,\n FieldId: null,\n MainCrop: null,\n MainCropYield: 0,\n MainCropStraw: false,\n SecondCrop: null,\n SecondCropYield: 0,\n };\n /**\n * the Checkbox Id for the Straw Harvested Checkbox\n */\n @Input() public strawHarvestedId: string;\n /**\n * a List of CropTypes for the current Farm\n */\n @Input() public availableCropTypes: ICropTypes[] = [];\n /**\n * are the Controls available for edit?\n */\n @Input() public disableControls = false;\n /**\n * is the current Cell saving by the Backend?\n */\n @Input() public saving = false;\n /**\n * fires when the Value in the Cell was changed\n */\n @Output() public saveCell = new EventEmitter();\n /**\n * fires when the Cell gets a focus\n */\n @Output() public getFocus = new EventEmitter<[string, number]>();\n /**\n * fires when the Cell lost the Focus\n */\n @Output() public lostFocus = new EventEmitter<[string, number]>();\n\n /**\n * the Default CropType that was set when a new Main/Second Crop was created\n */\n public get DefaultCrop(): ICropTypes {\n return this.availableCropTypes[0];\n }\n\n /**\n * the MainCrop Object\n */\n public mainCrop: ICropTypes;\n /**\n * the SecondCrop Object\n */\n public secondCrop: ICropTypes;\n\n public mainCropSource: ICropTypes[] = [];\n public secondCropSource: ICropTypes[] = [];\n\n constructor(private cropTypeStore: CropTypeStore,\n private notifyStore: NotifyStore,\n private changeDetectorRef: ChangeDetectorRef) {\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.data) {\n this.mainCrop = changes.data.currentValue.MainCrop ?\n this.cropTypeStore.getDefaultCroptype(changes.data.currentValue.MainCrop) :\n null;\n this.secondCrop = changes.data.currentValue.SecondCrop ?\n this.cropTypeStore.getDefaultCroptype(changes.data.currentValue.SecondCrop) :\n null;\n }\n\n if (changes.availableCropTypes) {\n this.mainCropSource = changes.availableCropTypes.currentValue;\n this.secondCropSource = changes.availableCropTypes.currentValue;\n\n if (this.mainCrop && !this.mainCropSource.Any(_ => _.Id === this.mainCrop?.Id)) {\n this.mainCropSource = [this.mainCrop].concat(this.mainCropSource);\n }\n if (this.secondCrop && !this.secondCropSource.Any(_ => _.Id === this.secondCrop?.Id)) {\n this.secondCropSource = [this.secondCrop].concat(this.secondCropSource);\n }\n }\n }\n\n /**\n * Starw Harvested was changed\n */\n public changeStrawHarvested(): void {\n this.data.MainCropStraw = !this.data.MainCropStraw;\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n }\n\n /**\n * MainCrop was selected\n */\n public onMainCropChange(e: ICropTypes): void {\n if (!e) {\n this.mainCrop = null;\n this.data.MainCrop = null;\n this.data.MainCropYield = 0;\n this.data.MainCropStraw = false;\n this.lostFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n } else {\n const ct = this.mainCropSource.Find(_ => _.Id === e.Id);\n if (!ct) {\n console.warn(`croptype with Shortname ${e} not found`);\n return;\n }\n this.data.MainCrop = ct.Id;\n this.data.MainCropYield = ct.ExpectedYield;\n this.data.MainCropStraw = false;\n }\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n }\n\n /**\n * a Second Crop was selected\n */\n public onSecondCropChange(e: ICropTypes): void {\n if (!e) {\n this.secondCrop = null;\n this.data.SecondCrop = null;\n this.data.SecondCropYield = 0;\n this.lostFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n return;\n }\n const ct = this.secondCropSource.Find(_ => _.Id === e.Id);\n if (!ct) {\n console.warn(`croptype with Shortname ${e} not found`);\n return;\n }\n this.data.SecondCrop = ct.Id;\n this.data.SecondCropYield = 0;\n this.secondCrop = this.cropTypeStore.getDefaultCroptype(ct.Id);\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n }\n\n /**\n * the MainCrop Yield was changed\n */\n public onMainCropYieldChange(e: Event): void {\n this.data.MainCropYield = this.parseYield((e.target as HTMLInputElement).value);\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n }\n\n /**\n * the SecondCrop Yield was changed\n */\n public onSecondCropYieldChange(e: Event): void {\n this.data.SecondCropYield = this.parseYield((e.target as HTMLInputElement).value);\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n }\n\n /**\n * a new MainCrop was created\n */\n public onAddMainCrop(): void {\n if (!this.DefaultCrop) {\n this.notifyStore.addMessage(DetailCellComponent.NoSelectedCropNotification);\n return;\n }\n this.mainCrop = this.DefaultCrop;\n this.data.MainCrop = this.DefaultCrop.Id;\n this.data.MainCropYield = this.DefaultCrop.ExpectedYield;\n this.data.MainCropStraw = false;\n this.getFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n // give a Copy otherwise this.data mutates to read only\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n // make sure the mainCropComboBox is shown\n this.changeDetectorRef.detectChanges();\n // ...and set focus to fix APV49-1832\n this.mainCropComboBox?.focus();\n }\n\n /**\n * a Second Crop was created\n */\n public onAddSecondCrop(): void {\n if (!this.DefaultCrop) {\n this.notifyStore.addMessage(DetailCellComponent.NoSelectedCropNotification);\n return;\n }\n this.secondCrop = this.DefaultCrop;\n this.data.SecondCrop = this.DefaultCrop.Id;\n this.data.SecondCropYield = 0;\n this.getFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n // make sure the secondCropComboBox is shown\n this.changeDetectorRef.detectChanges();\n // ...and set focus to fix APV49-1832\n this.secondCropComboBox?.focus();\n }\n\n public onYieldKeyUp(): void {\n setTimeout(() => {\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n }, 1000);\n }\n\n public onGetFocus(): void {\n this.getFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n }\n\n public onLostFocus(): void {\n this.lostFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n }\n\n public handleMainCropFilter(valueToSearch: string): void {\n if (!valueToSearch) {\n this.mainCropSource = this.availableCropTypes;\n }\n this.mainCropSource = filter(this.availableCropTypes,\n (i: any) => includes(i.Shortname.toLowerCase(), valueToSearch.toLowerCase()));\n }\n\n public handleSecondCropFilter(valueToSearch: string): void {\n if (!valueToSearch) {\n this.secondCropSource = this.availableCropTypes;\n }\n this.secondCropSource = filter(this.availableCropTypes,\n (i: any) => includes(i.Shortname.toLowerCase(), valueToSearch.toLowerCase()));\n }\n\n public onKeyDown($event: KeyboardEvent): void {\n if (!$event || $event?.key?.toLowerCase() !== 'enter') {\n return;\n }\n this.saveCell.emit(ObjectFactory.Copy(this.data));\n this.lostFocus.emit([this.data.FieldId.toString(), this.data.Year]);\n }\n\n private parseYield(value: string): number {\n const parsedYield = parseFloat(value);\n return parsedYield > 0 ? parsedYield : 0;\n }\n}\n","\n
\n
\n \n \n
\n
\n","import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core';\nimport ICropTypes = Data.BaseData.ICropTypes;\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\n\n/**\n * The Cell Wrapper Component\n */\n@Component({\n selector: 'ap-crop-rotation-detail',\n templateUrl: './detail.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DetailComponent {\n /**\n * has the Field Childes so the Cell Full View is rendered\n * otherwise the Detail Cell was rendered\n */\n @Input() public fieldIsActive = false;\n /**\n * The Id of the Straw Harvested Checkbox\n */\n @Input() public strawHarvestedId: string;\n /**\n * a List of the CropTypes for the Farm\n */\n @Input() public availableCropTypes: ICropTypes[] = [];\n /**\n * are the Controls of the Cell available for change?\n */\n @Input() public disableControls = false;\n /**\n * ???\n */\n @Input() public mappedChildCropTypes = '';\n /**\n * if this Cell was saving by the Backend?\n */\n @Input() public saving = false;\n /**\n * the Cell Data\n */\n @Input() public data: ICropRotationCell;\n\n /**\n * fires when the a Value in the Cell was changed\n */\n @Output() public saveCell = new EventEmitter();\n /**\n * fires when the Cell gets a focus\n */\n @Output() public getFocus = new EventEmitter<[string, number]>();\n /**\n * fires when the Cell lost the Focus\n */\n @Output() public lostFocus = new EventEmitter<[string, number]>();\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\nimport ICropRotation = Data.FieldManagement.ICropRotation;\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\n\n/**\n * convert the Field Row to a Cell Value\n */\n@Pipe({\n name: 'toCellValue'\n})\nexport class ToCellValuePipe implements PipeTransform {\n\n transform(value: IFieldCropRotation | ICropRotation, args?: [number, number]): ICropRotationCell {\n const currentYear = args[1];\n const yearIdx = args[0];\n const itemIndex = yearIdx + 1;\n return Array.isArray(value.Yields) && !!value.Yields[itemIndex] ? {\n FieldId: value.Id,\n YearIndex: yearIdx,\n Year: currentYear + yearIdx,\n MainCrop: value.Yields[itemIndex].MainCrop,\n MainCropYield: value.Yields[itemIndex].MainCropYield,\n MainCropStraw: value.Yields[itemIndex].MainCropStraw,\n SecondCrop: value.Yields[itemIndex].SecondCrop,\n SecondCropYield: value.Yields[itemIndex].SecondCropYield\n } as ICropRotationCell : {\n FieldId: value.Id,\n YearIndex: yearIdx,\n Year: currentYear + yearIdx,\n MainCrop: 0,\n MainCropYield: 0,\n MainCropStraw: false,\n SecondCrop: 0,\n SecondCropYield: 0\n };\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {DateRange, DateTime} from 'ts-tooling';\n\nexport interface IValidity {\n ValidFrom: Date | string;\n ValidTo: Date | string;\n}\n\n@Pipe({\n name: 'fieldIsActive',\n})\nexport class FieldIsActivePipe implements PipeTransform {\n transform(value: IValidity, args: [number, number]): boolean {\n if (!value) {\n return true;\n }\n const year = args[0] + args[1];\n if (year > 2) {\n const vf = typeof value.ValidFrom === typeof '' ?\n DateTime.FromISOString(value.ValidFrom as string, 'UTC') :\n new DateTime('UTC', (value.ValidFrom as Date).getFullYear(), (value.ValidFrom as Date).getMonth() + 1, (value.ValidFrom as Date).getDate(),\n (value.ValidFrom as Date).getHours(), (value.ValidFrom as Date).getMinutes(), (value.ValidFrom as Date).getSeconds());\n const vt = typeof value.ValidTo === typeof '' ?\n DateTime.FromISOString(value.ValidTo as string, 'UTC') :\n new DateTime('UTC', (value.ValidTo as Date).getFullYear(), (value.ValidTo as Date).getMonth() + 1, (value.ValidTo as Date).getDate(),\n (value.ValidTo as Date).getHours(), (value.ValidTo as Date).getMinutes(), (value.ValidTo as Date).getSeconds());\n const fieldInterval = new DateRange(vf, vt);\n const yearInterval = new DateRange(\n new DateTime('UTC', year - 1, 8, 1, 0, 0, 0, 0),\n new DateTime('UTC', year, 7, 31, 23, 59, 59, 0)\n );\n return yearInterval.Overlaps(fieldInterval);\n }\n return true;\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {filter, includes, map} from 'lodash';\nimport {CropTypeStore} from '../../stores/base-data/crop.types.store';\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\n\n/**\n * get the Childes MainCrop Short Name`s as a Comma separated String\n */\n@Pipe({\n name: 'getMappedChildren'\n})\nexport class GetMappedChildrenPipe implements PipeTransform {\n constructor(private cropTypeStateService: CropTypeStore) {\n }\n\n transform(value: IFieldCropRotation, args?: number): string {\n const cropTypeIds = map(filter(value.Children, (i) => i.Yields[0].MainCrop), i => i.Yields[0].MainCrop);\n if (cropTypeIds.length < 1) {\n return '';\n }\n const store = [];\n for (const cropTypeId of cropTypeIds) {\n const crop = this.cropTypeStateService.getDefaultCroptype(cropTypeId);\n if (!crop) {\n console.warn(`CropKey ${cropTypeId} not found`);\n continue;\n }\n if (includes(store, crop.Shortname)) {\n continue;\n }\n store.push(crop.Shortname);\n }\n return store.join(',');\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\nimport ICropRotation = Data.FieldManagement.ICropRotation;\n\n/**\n * creates a unique Cell Id\n */\n@Pipe({\n name: 'idCreator'\n})\nexport class IdCreatorPipe implements PipeTransform {\n\n transform(value: IFieldCropRotation | ICropRotation, args?: number): string {\n if (!value) {\n return '';\n }\n return value.Id.toString() + '_' + args + '_' + (Array.isArray(value.Yields) && !!value.Yields[args] ? value.Yields[args].MainCrop : 'null');\n }\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport IGuid = System.IGuid;\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\n\n/**\n * get the Saving State for a Cell\n */\n@Pipe({\n name: 'getSavingState'\n})\nexport class GetSavingStatePipe implements PipeTransform {\n\n transform(value: ICropRotationCell[], args?: [IGuid, number]): boolean {\n return !!value.Find(i => i.FieldId === args[0] && i.Year === args[1]);\n }\n\n}\n","
\n \n
\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n","import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges} from '@angular/core';\nimport {find, union, without} from 'lodash';\nimport {\n animate,\n state,\n style,\n transition,\n trigger\n} from '@angular/animations';\nimport {\n filter,\n map\n} from 'rxjs/operators';\nimport {\n connectJobWithFields,\n JobsStore\n} from '../../../stores/administration/jobs.store';\nimport {\n FieldStore\n} from '../../../stores/farm/field.store';\nimport {\n ApDynGridStatusColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-status-column-config';\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\nimport IGuid = System.IGuid;\nimport ICropTypes = Data.BaseData.ICropTypes;\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\n\n/**\n * renders the Data for the CropRotation\n */\n@Component({\n selector: 'ap-crop-rotation-list',\n templateUrl: './list.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [\n trigger('fadeInOutChildes', [\n state('in', style({})),\n state('out', style({height: '0'})),\n transition('in => out', animate(300)),\n transition('out => in', animate(300)),\n ]),\n ]\n})\nexport class ListComponent implements OnChanges {\n\n constructor(private jobStore: JobsStore,\n private fieldStore: FieldStore) {\n }\n\n /**\n * the number of decimal places\n */\n @Input() public numericRound = 2;\n /**\n * the Loading Indicator\n */\n @Input() public loading: boolean;\n /**\n * a List of the Selected Field Ids\n */\n @Input() public selectedFields: IGuid[];\n /**\n * the sorted and filtered Items\n */\n @Input() public fields: IFieldCropRotation[];\n /**\n * the Years to display\n */\n @Input() public yearInterval: number[];\n /**\n * the current Campaign Year\n */\n @Input() public currentYear: number;\n /**\n * a List of CropTypes from the current Farm\n */\n @Input() public availableCropTypes: ICropTypes[] = [];\n /**\n * the Width of a single Cell\n */\n @Input() public columnWidth: number;\n /**\n * a List of Cells that currently was saving\n */\n @Input() public saving: ICropRotationCell[] = [];\n\n @Input() public wrapperHeight = 0;\n\n /**\n * fires when the Fields selection was changed\n */\n @Output() public selectedFieldsChange = new EventEmitter();\n /**\n * fires when a cell change its data\n */\n @Output() public saveCell = new EventEmitter();\n /**\n * fires when a Cell gets a Focus\n */\n @Output() public getFocus = new EventEmitter<[string, number]>();\n /**\n * fires when a Cell lost the Focus\n */\n @Output() public lostFocus = new EventEmitter<[string, number]>();\n\n /**\n * the animation State of the Children if visible or not\n */\n public visibleState: { [key: string]: string } = {};\n\n /**\n * the Value indicates if the Childes was rendered or not\n */\n public visibleValues: { [key: string]: boolean } = {};\n\n public fieldJobs$ = this.jobStore.FarmJobs$\n .pipe(\n filter(jobs => Array.isArray(jobs) && jobs.length > 0),\n map(jobs => connectJobWithFields(jobs, this.fieldStore))\n );\n\n public statusConfig = new ApDynGridStatusColumnConfig({\n field: 'Status',\n class: 'StatusClass',\n pending: this.jobStore.BlockedFieldIdsCe$,\n pendingTooltip: this.jobStore.BlockedFieldIdsCeTooltip$,\n });\n\n /**\n * track By Function for the fields ngFor\n * important for view re-rendering !!!!\n */\n public trackFieldList(index: number, item: IFieldCropRotation): string {\n return `${item.Id}-${item.FieldName}-${item.FieldNumber}-${item.FieldSubNumber}-${item.AreaHa}-` +\n `${item.Yields[0].MainCrop}-${item.Yields[0].MainCropYield}-${item.Yields[0].MainCropStraw}-${item.Yields[0].SecondCrop}-${item.Yields[0].SecondCropYield}` +\n `${item.Yields[1].MainCrop}-${item.Yields[1].MainCropYield}-${item.Yields[1].MainCropStraw}-${item.Yields[1].SecondCrop}-${item.Yields[1].SecondCropYield}` +\n `${item.Yields[2].MainCrop}-${item.Yields[2].MainCropYield}-${item.Yields[2].MainCropStraw}-${item.Yields[2].SecondCrop}-${item.Yields[2].SecondCropYield}` +\n `${item.Yields[3].MainCrop}-${item.Yields[3].MainCropYield}-${item.Yields[3].MainCropStraw}-${item.Yields[3].SecondCrop}-${item.Yields[3].SecondCropYield}` +\n `${item.Yields[4].MainCrop}-${item.Yields[4].MainCropYield}-${item.Yields[4].MainCropStraw}-${item.Yields[4].SecondCrop}-${item.Yields[4].SecondCropYield}` +\n `${item.Yields[5].MainCrop}-${item.Yields[5].MainCropYield}-${item.Yields[5].MainCropStraw}-${item.Yields[5].SecondCrop}-${item.Yields[5].SecondCropYield}` +\n `${item.Yields[6].MainCrop}-${item.Yields[6].MainCropYield}-${item.Yields[6].MainCropStraw}-${item.Yields[6].SecondCrop}-${item.Yields[6].SecondCropYield}`;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes && changes.fields) {\n this.fields = changes.fields.currentValue;\n this.visibleState = {};\n if (changes.fields.currentValue.length) {\n for (const c of changes.fields.currentValue as IFieldCropRotation[] | ICropRotationCell[]) {\n const id = (c as ICropRotationCell).FieldId ?\n (c as ICropRotationCell).FieldId :\n (c as IFieldCropRotation).Id;\n this.visibleState[id.toString()] = 'out';\n this.visibleValues[id.toString()] = false;\n }\n }\n }\n }\n\n /**\n * show/hide Child Rows\n */\n public switchVisibleState(fieldId: string): void {\n if (!this.visibleState.hasOwnProperty(fieldId)) {\n return;\n }\n this.visibleState[fieldId] = this.visibleState[fieldId] === 'in' ? 'out' : 'in';\n this.visibleValues[fieldId] = !this.visibleValues[fieldId];\n }\n\n /**\n * select/unselect a Field Id\n */\n public selectField(Id: IGuid): void {\n if (this.findItem(Id)) {\n this.selectedFieldsChange.emit(without(this.selectedFields, Id));\n } else {\n this.selectedFieldsChange.emit(union(this.selectedFields, [Id]));\n }\n }\n\n /**\n * when a Child Animation begins\n */\n public onChildBeginAnimation(e, Id: IGuid): void {\n if (e.fromState === 'out' && e.toState === 'in') {\n this.visibleValues[Id.toString()] = true;\n }\n }\n\n /**\n * when a Child Animation is done\n */\n public onChildDoneAnimation(e, Id: IGuid): void {\n if (e.fromState === 'in' && e.toState === 'out') {\n this.visibleValues[Id.toString()] = false;\n }\n }\n\n /**\n * exists a Field with a Id\n */\n public findItem(Id: IGuid): boolean {\n return !!find(this.selectedFields, i => i === Id);\n }\n}\n","
\n
\n
\n {{selectedKeys && selectedKeys.length}} {{'Global__Selected' | translate}}\n
\n
\n \n
\n \n
\n {{((currentPage - 1) * pageSize) + 1}}\n -\n {{(currentPage * pageSize > itemCount ? itemCount : currentPage * pageSize)}}\n {{'kendo.grid.pagerOf' | translate}}\n {{itemCount}}\n
\n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n
\n","import {Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild} from '@angular/core';\nimport {\n ApGridMultiSelectComponent\n} from '../../ap-core/components/ap-grid-multi-select/ap-grid-multi-select.component';\nimport {ApGridPagerType, IGridPagerData, IWizardChoiceData, IWizardChoiceDataValue} from '../../ap-interface';\nimport {\n ApDynformsConfigFieldset\n} from '../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {\n ApDynformsConfigTabs\n} from '../../ap-dynforms/config/ap-dynforms-config-tabs';\nimport {\n PagerIconButton\n} from '../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {\n ItemDisabledFn\n} from '@progress/kendo-angular-dropdowns';\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {APP_CONFIGURATION} from '../../ap-core/config';\nimport {\n ApDynformsValidator\n} from '../../ap-dynforms/ap-dynforms-validator';\nimport {ValidatorFn} from '@angular/forms';\n\n@Component({\n selector: 'ap-crop-rotation-grid-pager',\n templateUrl: './pager.component.html',\n styleUrls: ['pager.component.scss'],\n})\nexport class PagerComponent implements OnChanges {\n @ViewChild('gridMultiSelectComponent', {static: false}) gridMultiSelect: ApGridMultiSelectComponent;\n\n public selectedColumn: IWizardChoiceData;\n public selectedValue: IWizardChoiceDataValue;\n public type: ApGridPagerType;\n public numOfPages = 0;\n public buttonCountOffset = 0;\n public dimensions: number[] = [1];\n\n @Input() public formConfig: ApDynformsConfigFieldset[] | ApDynformsConfigTabs[] = null;\n @Input() public formValidators: ApDynformsValidator[];\n @Input() public formDefaultValue = {};\n @Input() public currentPage = 0;\n @Input() public objects: Observable;\n @Input() public values: IWizardChoiceDataValue[];\n @Input() public showOnlyValues = true;\n @Input() public hasMultiSelect = true;\n @Input() public showWithoutSelection = false;\n @Input() public showDefaultValue = true;\n @Input() public selectedKeys: any[];\n @Input() public pageSize = 25;\n @Input() public itemCount = 0;\n @Input() public preselect = true;\n @Input() public buttonCount = 3;\n @Input() public iconButtons: PagerIconButton[];\n @Output() public formValueChanges = new EventEmitter<{ control: string, value: any }>(true);\n @Output() public applyClicked = new EventEmitter();\n @Output() public deleteClicked = new EventEmitter();\n @Output() public currentPageChange = new EventEmitter();\n @Output() public startMultiSelectInAnimation = new EventEmitter();\n @Output() public endMultiSelectInAnimation = new EventEmitter();\n @Output() public startMultiSelectOutAnimation = new EventEmitter();\n @Output() public endMultiSelectOutAnimation = new EventEmitter();\n @Output() public selectedColumnChange = new EventEmitter();\n @Output() public selectedValueChange = new EventEmitter();\n @Output() public pageSizeChanged = new BehaviorSubject(APP_CONFIGURATION.GridPageSize);\n\n contextChanges = new BehaviorSubject<{ total: number, skip: number, pageSize: number }>({\n pageSize: this.pageSize,\n skip: this.currentPage * this.pageSize,\n total: this.itemCount\n });\n\n contextService = {\n total: this.itemCount,\n skip: this.pageSize * this.currentPage,\n pageSize: this.pageSize,\n changes: this.contextChanges,\n changePage: (page: number) => this.changePage(page + 1),\n };\n\n @Input() public columnItemDisabled: ItemDisabledFn = () => false;\n @Input() public valueItemDisabled: ItemDisabledFn = () => false;\n\n constructor() {\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.itemCount) {\n this.getDimensions();\n }\n\n if (changes.itemCount || changes.pageSize || changes.currentPage) {\n this.contextChanges.next({\n pageSize: this.pageSize,\n skip: (this.currentPage - 1) * this.pageSize,\n total: this.itemCount\n });\n }\n }\n\n changePage(page: number): boolean {\n this.buttonCountOffset = (Math.floor(page / this.buttonCount) * this.buttonCount);\n this.currentPageChange.emit(page);\n this.getDimensions();\n return false;\n }\n\n onSelectedColumnChange(e: IWizardChoiceData): void {\n this.selectedColumn = e || null;\n this.selectedColumnChange.emit(e);\n }\n\n onSelectedValueChange(e: IWizardChoiceDataValue): void {\n this.selectedValue = e || null;\n this.selectedValueChange.emit(e);\n }\n\n private getDimensions(): void {\n if (this.itemCount < 1 || this.pageSize < 1) {\n return;\n }\n this.numOfPages = Math.ceil(this.itemCount / this.pageSize);\n const tmp = [];\n for (let i = this.buttonCountOffset; i < this.numOfPages; i++) {\n tmp.push(i + 1);\n if (tmp.length === this.buttonCount) {\n break;\n }\n }\n this.dimensions = tmp;\n }\n\n public onPageSizeChanged(pageSize: number): void {\n this.pageSizeChanged.next(pageSize);\n }\n}\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport {BehaviorSubject, combineLatest, fromEvent, merge, Observable, Subscription} from 'rxjs';\nimport {\n ApGridPagerType,\n IGridPagerData,\n IWizardChoiceData,\n IWizardChoiceDataValue,\n MapViewCurrentMenu,\n MapViewMode,\n SidebarMode\n} from '../../ap-interface';\nimport {CompositeFilterDescriptor, FilterDescriptor, process, SortDescriptor, State} from '@progress/kendo-data-query';\nimport {\n ApGridPagerComponent\n} from '../../ap-core/components/ap-grid-pager/ap-grid-pager.component';\nimport {animate, state, style, transition, trigger} from '@angular/animations';\nimport {\n ApDynformsConfigFieldset\n} from '../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {\n ApDynformsConfigComboBox\n} from '../../ap-dynforms/config/ap-dynforms-config-combobox';\nimport {\n ApDynformsConfigCheckbox\n} from '../../ap-dynforms/config/ap-dynforms-config-checkbox';\nimport {\n ICropRotationMassEdit\n} from '../interfaces/ap-crop-rotation-mass-edit.interface';\nimport {\n CropRotationOperations\n} from '../enums/crop-rotation-operations.enum';\nimport {\n ApDynformsConfigPlaceholder\n} from '../../ap-dynforms/config/ap-dynforms-config-placeholder';\nimport {\n CampaignYearStore\n} from '../../stores/login/campaignyear.store';\nimport {\n TranslationStore\n} from '../../stores/translation/translation.store';\nimport {APP_CONFIGURATION} from '../../ap-core/config';\nimport {\n MapViewStore\n} from '../../stores/layout/mapview.store';\nimport {\n FieldStore\n} from '../../stores/farm/field.store';\nimport {\n ApDynformsConfigNumerictextbox\n} from '../../ap-dynforms/config/ap-dynforms-config-numerictextbox';\nimport {map, skip} from 'rxjs/operators';\nimport {\n ApDynformsValidator\n} from '../../ap-dynforms/ap-dynforms-validator';\nimport {FormGroup, ValidatorFn} from '@angular/forms';\nimport {\n ApCropRotationHeaderComponent\n} from './header/ap-crop-rotation-header.component';\nimport {ApMapInstance} from '../../ap-map';\nimport {\n CampaignYearService\n} from '../../services/data/campaign-year.service';\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\nimport ICropTypes = Data.BaseData.ICropTypes;\nimport IGuid = System.IGuid;\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\nimport {\n ModalDialogStore\n} from '../../stores/dialog/modal.dialog.store';\nimport {\n IModalDialogResult\n} from '../../ap-interface/interfaces/ap-modaldialog-data.interface';\nimport {\n ModalDialogPresets\n} from '../../stores/dialog/modal.dialog.presets';\n\n/**\n * Width of sidebar when fully open\n */\nconst SIDEBAR_WIDTH_FULL = 199.219;\n/**\n * Width of the sidebar if it is open but only the symbols are visible\n */\nconst SIDEBAR_WIDTH_SMALL = 40;\n/**\n * Width of the field view of the Grid crop rotation\n */\nconst FIELD_LIST_WIDTH = 449;\n/**\n * Maximum width a cell may have\n */\nconst MAX_COLUMN_WIDTH = 175;\n/**\n * Width of the placeholder for the right scrollbar\n */\nconst RIGHT_SCROLL_PLACEHOLDER = 30;\n\n/**\n * Draws a grid which represents the crop rotation of a farm from the current Campaign Year + 5 years and - 1 year.\n *\n * @example\n * \n */\n@Component({\n selector: 'ap-crop-rotation-grid',\n templateUrl: './ap-crop-rotation-grid.component.html',\n animations: [\n trigger('resizeDataHeight', [\n state('in', style({height: 'calc(100% - 170px)'})),\n state('in-with-form', style({height: 'calc(100% - 435px)'})),\n state('out', style({height: 'calc(100% - 134px)'})),\n transition('in => out', animate(300)),\n transition('out => in', animate('300ms 0.2s')),\n transition('out => in-with-form', animate('300ms 0.2s')),\n transition('in => in-with-form', animate('300ms 0.2s')),\n transition('in-with-form => in', animate(300)),\n transition('in-with-form => out', animate(300)),\n ])\n ]\n})\nexport class ApCropRotationGridComponent implements OnInit, OnChanges, OnDestroy {\n @ViewChild(ApCropRotationHeaderComponent) headerComponent: ApCropRotationHeaderComponent;\n /**\n * the number of decimal places\n */\n @Input() public numericRound = 2;\n /**\n * The data source of the Grid crop rotation\n */\n @Input() public items: IFieldCropRotation[];\n /**\n * The Loading State of the source when it loads from async\n */\n @Input() public loading: boolean;\n /**\n * Available CropTypes of the Farm used for Selection and Filter\n */\n @Input() public availableCropTypes: ICropTypes[];\n @Input() public allCropTypes: ICropTypes[];\n /**\n * the CampaignYear of the Farm that is currently loaded\n */\n @Input() public currentYear = 2019;\n /**\n * the Years to Display represented ba an Array\n *\n * @example\n * This Displays the Years 2018, 2019, 2020 when the current Campaign Year is 2019\n * [-1, 0, 1]\n */\n @Input() public yearInterval: number[];\n /**\n * The Store Reference when MapViewMode is changing\n */\n @Input() public mapViewChange$: Observable;\n /**\n * The Store Reference when the SideBarMode is changing\n */\n @Input() public sidebarChange$: Observable;\n /**\n * A List of Cells that was currently saving\n */\n @Input() public saving: ICropRotationCell[] = [];\n /**\n * Event for searched text\n */\n @Input() public searchText: BehaviorSubject = null;\n\n /**\n * Triggers when clear filters button is clicked on toolbar\n */\n @Input() public clearAllFilters: BehaviorSubject = null;\n\n /**\n * Triggers when a Cell begins to save\n */\n @Output() public saveCell = new EventEmitter();\n /**\n * Triggers when any of the items are selected\n */\n @Output() public selectedItems = new EventEmitter();\n /**\n * Triggers when a MassEdit begins to save Cells for changing Values\n */\n @Output() public massEditChange = new EventEmitter>();\n /**\n * Triggers when a MassEdit begins to save Cells to remove the MainCrop\n * that means the complete Crop was deleted from FieldCrops\n */\n @Output() public massEditRemoveMainCrop = new EventEmitter();\n /**\n * Triggers when a MassEdit begins to save Cells to remove the SecondCrop\n */\n @Output() public massEditRemoveSecondCrop = new EventEmitter();\n /**\n * Triggers when a Cell get the Focus for edit\n */\n @Output() public getFocus = new EventEmitter<[string, number]>();\n /**\n * Triggers when a Cell lost the edit Focus\n */\n @Output() public lostFocus = new EventEmitter<[string, number]>();\n\n public values: IWizardChoiceDataValue[];\n\n public dataWrapperHeight = 0;\n /**\n * A List of Wizard Options\n */\n public listMassEditing$ = new BehaviorSubject([]);\n /**\n * The Dynforms Configuration for the MassEdit Form\n */\n public formConfig: ApDynformsConfigFieldset[] = null;\n /**\n * Mass edit form validators (if more than one control needs validation at one time)\n */\n public formValidators: ApDynformsValidator[] = [\n new ApDynformsValidator({\n validator: ApCropRotationGridComponent.yieldRequiredIfCropIsSet,\n errorKey: 'Yield__required'\n }),\n ];\n /**\n * The Kendo Filter Description for the Data\n */\n public filter: CompositeFilterDescriptor = null;\n /**\n * The Animation State of the MultiSelect (MassEdit)\n */\n public currentMultiSelect = 'out';\n /**\n * The length of the Items at one Page\n */\n public pageSize = APP_CONFIGURATION.GridPageSize;\n /**\n * The currently displayed Page\n */\n public currentPage = 1;\n /**\n * The sorted and filtered Items for the current Page\n */\n public itemView: IFieldCropRotation[] = [];\n /**\n * The selected Fields to processing the MassEdit\n */\n public selectedFields: IGuid[] = [];\n /**\n * The current calculated Cell Width\n */\n public columnWidth = MAX_COLUMN_WIDTH;\n /**\n * the Items filtered and sorted without Paging\n */\n public itemsFilteredNoPaging: IFieldCropRotation[] = [];\n public fullItems: IFieldCropRotation[] = [];\n @ViewChild('dataWrapper', {static: true}) private _dataWrapper: ElementRef;\n @ViewChild('pager', {static: true}) private _pager: ApGridPagerComponent;\n private windowResize = fromEvent(window, 'resize');\n private _subscriptions: Subscription[] = [];\n private _sort: SortDescriptor[] = [\n {field: 'FieldName', dir: 'asc'}\n ];\n private _lastSidebarMode = SidebarMode.OPEN;\n private _lastMapViewMode = MapViewMode.HIDE;\n private _state: State = {\n skip: 0,\n take: this.pageSize,\n sort: this._sort\n };\n private dataWrapperObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n this.dataWrapperHeight = entry.contentRect.height;\n }\n });\n private pagerDataSubscription: Subscription = null;\n private mainCropMassEditChanged$ = new BehaviorSubject(undefined);\n private secondCropMassEditChanged$ = new BehaviorSubject(undefined);\n private _massEditPagerData: IGridPagerData;\n\n /**\n * Validations for mass edit\n * @param frm\n * @private\n */\n private static yieldRequiredIfCropIsSet(frm: FormGroup): { missingYield: boolean } | null {\n const mainCrop = frm.get('MainCrop')?.value;\n const mainCropYieldControl = frm.get('MainCropYield');\n const mainCropYield = mainCropYieldControl?.value;\n const secondCrop = frm.get('SecondCrop')?.value;\n const secondCropYieldControl = frm.get('SecondCropYield');\n const secondCropYield = secondCropYieldControl?.value;\n const validationError = {missingYield: true};\n // Validate if yield is present when crop is selected.\n // This validation is done on form level because 2 form controls are involved.\n // Besides that the error is set at the control directly to avoid having\n // an error message (errorkey) being shown at the control\n if (secondCrop?.Id > 0 && !(parseFloat(secondCropYield) >= 0)) {\n secondCropYieldControl?.setErrors(validationError);\n return validationError;\n }\n if (mainCrop?.Id > 0 && !(parseFloat(mainCropYield) >= 0)) {\n mainCropYieldControl?.setErrors(validationError);\n return validationError;\n }\n return null;\n }\n\n constructor(private translationStore: TranslationStore,\n private campaignYearStore: CampaignYearStore,\n private mapViewStore: MapViewStore,\n private fieldStore: FieldStore,\n private modalDialogStore: ModalDialogStore,\n private modalDialogPresets: ModalDialogPresets,\n private campaignYearService: CampaignYearService,\n private changeDetectorRef: ChangeDetectorRef) {\n }\n\n public ngOnInit(): void {\n this.dataWrapperObserver.observe(this._dataWrapper.nativeElement);\n this._subscriptions.push(this.campaignYearStore.Listen(s => s.selectedYear).subscribe((d) => {\n if (d) {\n this.currentYear = d.Year;\n }\n }));\n this._subscriptions.push(this.sidebarChange$.subscribe(d => this._lastSidebarMode = d));\n this._subscriptions.push(this.mapViewChange$.subscribe(d => this._lastMapViewMode = d));\n this._subscriptions.push(merge(this.mapViewChange$, this.sidebarChange$, this.windowResize).subscribe(() => {\n if (this.yearInterval.length > 0) {\n this.setAvailableInterval(window.innerWidth);\n }\n }));\n // Update grid selection based on clicked fields in map\n this._subscriptions.push(ApMapInstance.onFieldClicked.subscribe(field => {\n if (!(field?.Id?.toString()?.length > 0)) {\n return;\n }\n const updatedSelectedFields = this.selectedFields?.slice() ?? [];\n const selectedFieldIndex = this.selectedFields?.FindIndex(id => id?.toString() === field?.Id?.toString());\n if (selectedFieldIndex >= 0) {\n updatedSelectedFields.RemoveAt(selectedFieldIndex);\n } else {\n updatedSelectedFields.Add(field?.Id?.toString());\n }\n this.onSelectionChange(updatedSelectedFields);\n this.changeDetectorRef.detectChanges();\n }));\n this._subscriptions.push(this.searchText.subscribe(search => {\n this.filterMainItems(search);\n }));\n this._subscriptions.push(this.clearAllFilters.subscribe(clear => {\n if (clear) {\n this.clearAllFiltersLogic();\n }\n }));\n this.setWizardOptions();\n this._subscriptions.push(this.modalDialogStore.Listen(s => s.result).pipe(skip(1)).subscribe(c => {\n this._modalDialogOkClicked(c);\n }));\n }\n\n private clearAllFiltersLogic(): void {\n // Filter\n this._state.filter = {\n logic: 'and',\n filters: [],\n } as CompositeFilterDescriptor;\n\n this.itemsFilteredNoPaging = process(this.items, {\n sort: this._state.sort,\n filter: this._state.filter\n }).data;\n // Pagination\n this.itemView = process(this.itemsFilteredNoPaging, {\n skip: this._state.skip,\n take: this._state.take,\n }).data;\n this.fullItems = [...this.items];\n this.headerComponent?.clearAllFiltersInFilterComponents();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes?.items && changes?.items?.currentValue) {\n this.mapItems();\n }\n }\n\n public ngOnDestroy(): void {\n this._subscriptions?.forEach(x => x?.unsubscribe());\n this.pagerDataSubscription?.unsubscribe();\n }\n\n /**\n * a new Page was selected by pager\n */\n public onPageChange(pageNumber: number): void {\n this.currentPage = pageNumber;\n this.mapItems();\n }\n\n /**\n * a Sort was Triggers\n */\n public onSort(descriptors: SortDescriptor[]): void {\n this._sort = descriptors;\n this.mapItems();\n }\n\n /**\n * fires when the Filter was changed\n */\n public onFilter(filterDescriptor: CompositeFilterDescriptor): void {\n this.filter = filterDescriptor;\n this.mapItems();\n }\n\n /**\n * when the MassEdit was applied\n */\n public onMassEditApply(e: IGridPagerData): void {\n const fieldsAmount = this.selectedFields.length;\n if (fieldsAmount > 10) {\n this._massEditPagerData = e;\n this.modalDialogStore.setModalDialogData(this.modalDialogPresets.ExistPlanBooksDialog(\n {\n confirmKey: 'confirmMassEdit',\n title: 'HdrConfirm',\n message: this.translationStore.FindTranslationForSelectedLanguage('Global_Message_Edit_Fields_Number', [fieldsAmount.toString()])\n }));\n } else {\n this.applyMassEditAction(e);\n }\n }\n\n private applyMassEditAction(e: IGridPagerData): void {\n switch (e.object.id) {\n case CropRotationOperations.CHANGE:\n this.massEditChange.emit({\n Ids: this.selectedFields,\n Value: {\n FieldId: null,\n Year: this.currentYear + e.value.id,\n YearIndex: e.value.id,\n MainCrop: e.form && e.form.MainCrop ? e.form.MainCrop.Id : undefined,\n MainCropYield: e.form && e.form.MainCropYield > 0 ? e.form.MainCropYield : undefined,\n MainCropStraw: e.form && e.form.MainCropStraw ? e.form.MainCropStraw : false,\n SecondCrop: e.form && e.form.SecondCrop ? e.form.SecondCrop.Id : undefined,\n SecondCropYield: e.form && e.form.SecondCropYield > 0 ? e.form.SecondCropYield : undefined,\n }\n });\n break;\n case CropRotationOperations.REMOVE_MAIN_CROP:\n this.massEditRemoveMainCrop.emit({\n Ids: this.selectedFields,\n Value: {\n FieldId: null,\n Year: this.currentYear + e.value.id,\n YearIndex: e.value.id,\n MainCrop: null,\n MainCropYield: null,\n MainCropStraw: false\n }\n });\n break;\n case CropRotationOperations.REMOVE_SECOND_CROP:\n this.massEditRemoveSecondCrop.emit({\n Ids: this.selectedFields,\n Value: {\n FieldId: null,\n Year: this.currentYear + e.value.id,\n YearIndex: e.value.id,\n SecondCrop: null,\n SecondCropYield: null\n }\n });\n break;\n }\n }\n\n /**\n * fires when the selection was changed\n */\n public onSelectionChange(e: IGuid[]): void {\n this.selectedFields = e;\n this.selectedItems.emit(this.items.filter(item => e.some(selectedId => item.Id === selectedId)));\n if (!e || e.length < 1) {\n this.onMultiSelectionChange(null);\n }\n if (this.mapViewStore.getMapViewMode() !== MapViewMode.HIDE && this.mapViewStore.getMapViewCurrentMenu() === MapViewCurrentMenu.MAP) {\n this.fieldStore.changeSelectedField(this.selectedFields.map(_ => _?.toString()));\n }\n }\n\n /**\n * when the Multi Select Option was changed\n */\n public onMultiSelectionChange(e: IWizardChoiceData): void {\n this.mainCropMassEditChanged$.next(undefined);\n this.secondCropMassEditChanged$.next(undefined);\n if (!e) {\n this.formConfig = null;\n this.currentMultiSelect = this.selectedFields && this.selectedFields.length > 0 ? 'in' : 'out';\n return;\n }\n switch (e.id) {\n case CropRotationOperations.CHANGE:\n this.formConfig = [\n new ApDynformsConfigFieldset({\n key: 'grid',\n legend: this.translationStore.FindTranslationForSelectedLanguage('Settings__Lbl_Menu_Croptypes'),\n config: [\n new ApDynformsConfigComboBox({\n key: 'MainCrop',\n valueField: 'Id',\n textField: 'Description',\n valuePrimitive: false,\n label: this.translationStore.FindTranslationForSelectedLanguage('MainCrop'),\n value: null,\n options: this.availableCropTypes,\n validators: []\n\n }),\n new ApDynformsConfigNumerictextbox({\n key: 'MainCropYield',\n label: this.translationStore.FindTranslationForSelectedLanguage('Global__YieldUnit'),\n min: 0,\n validators: [],\n cssClass: 'ap-textbox-white-background',\n value$: this.mainCropMassEditChanged$.pipe(map((cropType) => {\n return cropType?.ExpectedYield;\n }))\n }),\n new ApDynformsConfigCheckbox({\n key: 'MainCropStraw',\n label: this.translationStore.FindTranslationForSelectedLanguage('Nutrients_Pages__StrawRemoved'),\n value: false,\n }),\n new ApDynformsConfigPlaceholder(),\n new ApDynformsConfigComboBox({\n key: 'SecondCrop',\n valueField: 'Id',\n textField: 'Description',\n valuePrimitive: false,\n label: this.translationStore.FindTranslationForSelectedLanguage('SecondCrop'),\n value: null,\n options: this.availableCropTypes,\n validators: [],\n }),\n new ApDynformsConfigNumerictextbox({\n key: 'SecondCropYield',\n label: this.translationStore.FindTranslationForSelectedLanguage('Global__Yield_Removal_Unit'),\n min: 0,\n validators: [],\n cssClass: 'ap-textbox-white-background',\n value$: this.secondCropMassEditChanged$.pipe(map((cropType) => {\n return cropType?.Id > 0 ? 0 : undefined; // if crop is set the yield will be set to 0 - otherwise it is not defined\n }))\n }),\n ],\n }),\n ];\n this.currentMultiSelect = 'in-with-form';\n break;\n case CropRotationOperations.REMOVE_MAIN_CROP:\n case CropRotationOperations.REMOVE_SECOND_CROP:\n this.formConfig = null;\n this.currentMultiSelect = 'in';\n break;\n }\n }\n\n private mapItems(): void {\n this.filterMainItems(this.searchText.getValue());\n }\n\n private filterMainItems(searchText = ''): void {\n this._state.skip = (this.currentPage - 1) * this.pageSize;\n this._state.take = this.pageSize;\n this._state.sort = this._sort;\n if (this.filter) {\n this._state.filter = this.filter;\n }\n const fieldNameSearchText = {\n field: 'FieldName',\n value: searchText,\n operator: 'contains',\n ignoreCase: true,\n } as FilterDescriptor;\n const fieldNumberSearchText = {\n field: 'FieldNumber',\n value: searchText,\n operator: 'contains',\n ignoreCase: true,\n } as FilterDescriptor;\n const fieldSubNumberSearchText = {\n field: 'FieldSubNumber',\n value: searchText,\n operator: 'contains',\n ignoreCase: true,\n } as FilterDescriptor;\n const fullTextFilters = {\n logic: 'or',\n filters: [fieldNameSearchText, fieldNumberSearchText, fieldSubNumberSearchText]\n } as CompositeFilterDescriptor;\n\n if (!this._state.filter) {\n this._state.filter = {\n logic: 'and',\n filters: [fullTextFilters],\n } as CompositeFilterDescriptor;\n } else {\n const f = this._state.filter as CompositeFilterDescriptor;\n const cofIdx = f.filters.FindIndex(_ => _['logic'] === 'or' && Array.isArray(_['filters']) && _['filters'].length === 3 &&\n _['filters'].FindAll(__ => __['field'] === fieldNameSearchText.field ||\n __['field'] === fieldNumberSearchText.field ||\n __['field'] === fieldSubNumberSearchText.field).length === 3);\n if (cofIdx >= 0) {\n this._state.filter.filters[cofIdx] = fullTextFilters;\n } else {\n this._state.filter.filters.Add(fullTextFilters);\n }\n }\n this.fullItems = [...this.items];\n // Filter\n this.itemsFilteredNoPaging = process(this.items, {\n sort: this._state.sort,\n filter: this._state.filter,\n }).data;\n // Pagination\n this.itemView = process(this.itemsFilteredNoPaging, {\n skip: this._state.skip,\n take: this._state.take,\n }).data;\n }\n\n private setAvailableInterval(value: number): void {\n // Sidebar Open → 199.219\n // Sidebar Half → 40\n const sidebarOffset = this._lastSidebarMode === SidebarMode.OPEN ?\n SIDEBAR_WIDTH_FULL : this._lastSidebarMode === SidebarMode.HALF ?\n SIDEBAR_WIDTH_SMALL : 0;\n const mapWidthHalf = (value - sidebarOffset) / 2;\n const mapOffset = this._lastMapViewMode === MapViewMode.HIDE ?\n 0 : this._lastMapViewMode === MapViewMode.NORMAL ?\n mapWidthHalf : 0;\n value = value - sidebarOffset - mapOffset - FIELD_LIST_WIDTH - RIGHT_SCROLL_PLACEHOLDER - 10;\n let anzColumns = Math.floor(value / MAX_COLUMN_WIDTH);\n // we want to display one cell!\n anzColumns = anzColumns < 1 ? 1 : anzColumns;\n this.columnWidth = value / anzColumns - 1;\n const tmp = [];\n for (let i = 0; i < anzColumns; i++) {\n tmp.push(i - 1);\n }\n this.yearInterval = tmp;\n this.setWizardOptions();\n }\n\n private setWizardOptions(): void {\n if (this.pagerDataSubscription) {\n return;\n }\n this.pagerDataSubscription = combineLatest([\n this.selectedItems,\n this.campaignYearStore.SelectedCampaignYear$\n ]).subscribe(([selectedItems, year]) => {\n const yearValues: IWizardChoiceDataValue[] = [];\n for (let i = -1; i < 6; i++) {\n const iterationYear = year.Year + i;\n yearValues.push({\n id: i,\n label: iterationYear.toString(),\n disabled: selectedItems.some(x => {\n const campaignYearRange = this.campaignYearService.getCampaignYearRange(iterationYear);\n return !this.campaignYearService.isCampaignYearIntersects(new Date(x.ValidFrom), new Date(x.ValidTo), campaignYearRange);\n })\n });\n }\n const preSelectedItemId = 0;\n this.values = yearValues;\n this.listMassEditing$.next([\n {\n id: CropRotationOperations.CHANGE,\n name: this.translationStore.FindTranslationForSelectedLanguage('Global__Edit'),\n type: ApGridPagerType.DropDown,\n values: yearValues,\n value: preSelectedItemId\n },\n {\n id: CropRotationOperations.REMOVE_MAIN_CROP,\n name: this.translationStore.FindTranslationForSelectedLanguage('CropRotation__MainCrop_remove'),\n type: ApGridPagerType.DropDown,\n values: yearValues,\n value: preSelectedItemId\n },\n {\n id: CropRotationOperations.REMOVE_SECOND_CROP,\n name: this.translationStore.FindTranslationForSelectedLanguage('CropRotation__SecondCrop_remove'),\n type: ApGridPagerType.DropDown,\n values: yearValues,\n value: preSelectedItemId\n }\n ]);\n });\n }\n\n private _modalDialogOkClicked(result: IModalDialogResult): void {\n if (result?.key === 'confirmMassEdit') {\n this.applyMassEditAction(this._massEditPagerData);\n }\n }\n\n public onPageSizeChanged(pageSize: number): void {\n if (!this._pager || !this.itemView || !this.items) {\n return;\n }\n this.pageSize = pageSize;\n this._pager.pageSize = pageSize;\n this.filterMainItems();\n }\n\n public onFormValueChanges(v: { control: string; value: any }): void {\n if (v.control === 'MainCrop') {\n this.mainCropMassEditChanged$.next(v.value);\n }\n if (v.control === 'SecondCrop') {\n this.secondCropMassEditChanged$.next(v.value);\n }\n }\n}\n","
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n","import {AfterContentInit, Component, EventEmitter, OnDestroy, OnInit, Output} from '@angular/core';\nimport {ComponentCanDeactivate} from '../../../guards/ap-deactivate.guard';\nimport {\n ICropRotationMassEdit\n} from '../../../ap-crop-rotation/interfaces/ap-crop-rotation-mass-edit.interface';\nimport {BehaviorSubject, combineLatest, of, Subscription} from 'rxjs';\nimport {CropTypeStore} from '../../../stores/base-data/crop.types.store';\nimport {SettingsStore} from '../../../stores/base-data/settings.store';\nimport {CampaignYearStore} from '../../../stores/login/campaignyear.store';\nimport {MapViewStore} from '../../../stores/layout/mapview.store';\nimport {MenuStore} from '../../../stores/layout/menu.store';\nimport {CropRotationStore} from '../../../stores/farm/crop.rotation.store';\nimport {ListSortOrder, ObjectFactory} from 'ts-tooling';\nimport {ApGetCropStatisticService} from '../../../stores/services/ap-get-crop-statistic.service';\nimport {StatisticStore} from '../../../stores/statistic/statistic.store';\nimport {ApStatsType} from '../../../ap-interface';\nimport {StatisticService} from '../../../services/data/statistic.service';\nimport {map} from 'rxjs/operators';\nimport ICropRotationCell = Data.FieldManagement.ICropRotationCell;\nimport ICropTypes = Data.BaseData.ICropTypes;\nimport ISettings = Data.BaseData.ISettings;\nimport ICropRotation = Data.FieldManagement.ICropRotation;\nimport IFieldCropRotation = Data.FieldManagement.IFieldCropRotation;\n\nexport const INPUT_IDLE_TIMEOUT = 750;\n\n@Component({\n selector: 'ap-crop-rotation',\n templateUrl: './ap-crop-rotation.component.html',\n styleUrls: ['./ap-crop-rotation.component.scss']\n})\nexport class ApCropRotationComponent extends ComponentCanDeactivate implements OnInit, AfterContentInit, OnDestroy {\n caption = 'Nutrients__CropRotation';\n filter = 'Global_Filter';\n currentYear: number;\n cropTypes: ICropTypes[] = [];\n allCropTypes: ICropTypes[] = [];\n settings: ISettings = null;\n items$ = this.cropRotationStore.FieldCropRotations$;\n loading$ = of(true);\n saving$ = this.cropRotationStore.FieldCropSaving$;\n mapViewMode$ = this.mapViewStore.Listen(s => s.mode);\n menuMode$ = this.menuStore.Listen(s => s.mode);\n searchText$ = new BehaviorSubject('');\n clearAllFilters$ = new BehaviorSubject(false);\n\n private _subscriptions: Subscription[] = [];\n private _revisions: [string, number][] = [];\n private _focusCells: string[] = [];\n private _selectedItemsOnGrid$ = new BehaviorSubject([]);\n\n constructor(private cropRotationStore: CropRotationStore,\n private cropTypeStore: CropTypeStore,\n private campaignYearStore: CampaignYearStore,\n private mapViewStore: MapViewStore,\n private menuStore: MenuStore,\n private settingsStore: SettingsStore,\n private statisticStore: StatisticStore,\n private cropStatisticService: ApGetCropStatisticService,\n private statisticService: StatisticService) {\n super();\n }\n\n @Output()\n public clearAllFilters = new EventEmitter();\n\n ngOnInit(): void {\n this.mapViewStore.hideMapView();\n this.loading$ = combineLatest([\n this.cropRotationStore.FieldCropRotationsLoading$,\n this.settingsStore.Loading$\n ]).pipe(\n map(loadingItems => loadingItems.some(x => x))\n );\n }\n\n ngAfterContentInit(): void {\n this._subscriptions.push(this.cropTypeStore.CropTypes$.subscribe(d => {\n this.allCropTypes = d;\n this.cropTypes = d.FindAll(_ => _.Selected).SortBy(['Description'], [ListSortOrder.ASC]);\n }));\n this._subscriptions.push(this.campaignYearStore.Listen(s => s.selectedYear).subscribe((d) => {\n this.currentYear = !d ? 2019 : d.Year;\n }));\n this._subscriptions.push(this.settingsStore.FirstSetting$.subscribe(s => this.settings = s));\n this._subscriptions.push(combineLatest([\n this.cropRotationStore.FieldCropRotations$,\n this._selectedItemsOnGrid$.asObservable()\n ]).subscribe(([fieldCropRotation, selectedItemsOnGrid]) => {\n if (selectedItemsOnGrid.length <= 0) {\n this._generateStatistic(fieldCropRotation, fieldCropRotation);\n } else {\n this._generateStatistic(fieldCropRotation, selectedItemsOnGrid);\n }\n }));\n }\n\n ngOnDestroy(): void {\n this._subscriptions?.forEach(x => x?.unsubscribe());\n this.statisticStore.removeStatisticData();\n }\n\n canDeactivate(): boolean {\n this.forceSaveMarkedCells();\n return true;\n }\n\n onSelectedItem(selectedFieldCropRotations: IFieldCropRotation[]): void {\n this._selectedItemsOnGrid$.next(selectedFieldCropRotations);\n }\n\n onSaveCell(e: ICropRotationCell): void {\n const revision = this.getCellRevision(e);\n revision[1]++;\n this.cropRotationStore.MarkForSaving([e]);\n setTimeout(this.checkForSave.bind(this, ObjectFactory.Copy(revision[1]), e), INPUT_IDLE_TIMEOUT);\n }\n\n onCellGetFocus(e: [string, number]): void {\n const id = e[0] + '#' + e[1];\n this._focusCells = this._focusCells.filter(c => c !== id);\n this._focusCells.push(id);\n }\n\n onCellLostFocus(e: [string, number]): void {\n this._focusCells = this._focusCells.filter(id => id !== e[0] + '#' + e[1]);\n }\n\n onMassEditChange(e: ICropRotationMassEdit): void {\n this.cropRotationStore.ProcessCells(e.Ids.map(i => {\n const original = this.cropRotationStore.CropRotation.find(c => c.Id === i).Yields[e.Value.YearIndex + 1];\n const mainYield = e.Value.MainCropYield !== undefined ? parseFloat(e.Value.MainCropYield.toString()) : original.MainCropYield;\n const secondYield = e.Value.SecondCropYield !== undefined ? parseFloat(e.Value.SecondCropYield.toString()) : original.SecondCropYield;\n return {\n MainCrop: e.Value.MainCrop !== undefined ? e.Value.MainCrop : original.MainCrop,\n SecondCrop: e.Value.SecondCrop !== undefined ? e.Value.SecondCrop : original.SecondCrop,\n Year: e.Value.Year,\n MainCropStraw: e.Value.MainCropStraw,\n YearIndex: e.Value.YearIndex,\n FieldId: i,\n MainCropYield: isNaN(mainYield) ? 0 : mainYield,\n SecondCropYield: isNaN(secondYield) ? 0 : secondYield,\n };\n }));\n }\n\n onMassEditRemoveMainCrop(e: any): void {\n this.cropRotationStore.ProcessCells(e.Ids.map(i => {\n const dataset: ICropRotation = this.cropRotationStore.CropRotation.find(i2 => i2.Id === i);\n if (!dataset) {\n return null;\n }\n return {\n ...e.Value,\n FieldId: i,\n MainCrop: null,\n SecondCrop: dataset.Yields[e.Value.YearIndex + 1]?.SecondCrop,\n SecondCropYield: dataset.Yields[e.Value.YearIndex + 1]?.SecondCropYield\n };\n }));\n }\n\n onMassEditRemoveSecondCrop(e: any): void {\n this.cropRotationStore.ProcessCells(e.Ids.map(i => {\n const dataset: ICropRotation = this.cropRotationStore.CropRotation.find(i2 => i2.Id === i);\n if (!dataset) {\n return null;\n }\n return {\n ...e.Value,\n FieldId: i,\n MainCrop: dataset.Yields[e.Value.YearIndex + 1]?.MainCrop,\n MainCropYield: dataset.Yields[e.Value.YearIndex + 1]?.MainCropYield,\n MainCropStraw: dataset.Yields[e.Value.YearIndex + 1]?.MainCropStraw,\n SecondCrop: null,\n SecondCropYield: null,\n };\n }).filter(i => !!i));\n }\n\n private _generateStatistic(totalItems: IFieldCropRotation[], selectedItems: IFieldCropRotation[]): void {\n const dataForTitles = totalItems.map(x => ({\n AreaHa: x.AreaHa,\n Selected: selectedItems.some(z => z.Id === x.Id)\n }));\n const title = this.statisticService.generateFieldsAreaTitle(dataForTitles);\n const fieldCropRotations = selectedItems && selectedItems.length > 0\n ? selectedItems\n : totalItems;\n const selectedYear = this.campaignYearStore.SelectedCampaignYear?.Year;\n if (selectedYear) {\n const startYear = selectedYear - 1;\n const endYear = selectedYear + 5;\n const data = this.cropStatisticService.gatherFieldCropRotationData(fieldCropRotations, startYear, endYear);\n this.statisticStore.setStatisticData(data, ApStatsType.FieldsCropRotationStats, title, '');\n }\n }\n\n private checkForSave(rev: number, cell: ICropRotationCell): void {\n const revision = this.getCellRevision(cell);\n if (this._focusCells.find(i => i === cell.FieldId.toString() + '#' + cell.Year)) {\n setTimeout(this.checkForSave.bind(this, rev, cell), INPUT_IDLE_TIMEOUT);\n return;\n }\n if (rev === revision[1]) {\n this.saveChanges(revision[0]);\n this.resetCellRevision(cell);\n }\n }\n\n private saveChanges(revisionId: string): void {\n const cellIdInfo = this.fromRevisionId(revisionId);\n const moveMarked = this.cropRotationStore.MarkedForSaving.filter(i => i.FieldId.toString() === cellIdInfo[0] && i.Year === cellIdInfo[1]);\n this.cropRotationStore.ProcessCells(moveMarked);\n this.cropRotationStore.UnmarkFromSaving(moveMarked);\n }\n\n private forceSaveMarkedCells(): void {\n const dataToSave = this.cropRotationStore.MarkedForSaving.length > 0;\n if (dataToSave) {\n this.cropRotationStore.ProcessCells(this.cropRotationStore.MarkedForSaving);\n this.cropRotationStore.UnmarkFromSaving(this.cropRotationStore.MarkedForSaving);\n }\n }\n\n private getCellRevision(cell: ICropRotationCell): [string, number] {\n const id = this.toRevisionId(cell);\n let revision = this._revisions.find(i => i[0] === id);\n if (!revision) {\n revision = [id, 0];\n this._revisions.push(revision);\n }\n return revision;\n }\n\n private resetCellRevision(cell: ICropRotationCell): void {\n const id = this.toRevisionId(cell);\n this._revisions = this._revisions.filter(i => i[0] !== id);\n }\n\n private toRevisionId(cell: ICropRotationCell): string {\n return cell.FieldId.toString() + '#' + cell.Year;\n }\n\n private fromRevisionId(id: string): [string, number] {\n const tmp = id.split('#');\n return [tmp[0], parseInt(tmp[1], 10)];\n }\n\n public performSearch(searchText: string): void {\n this.searchText$.next(searchText);\n }\n\n public clearFilters(): void {\n this.clearAllFilters$.next(true);\n }\n}\n","\n \n\n\n","\n \n \n
\n \"Agriport\"\n \n \n
\n
\n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
{{'Report__SoilSample' | translate}}
\n \n
\n
{{currentFarm.FarmName}}
\n
\n
{{currentFarm.StreetNo}}
\n
{{'Global__CustomerNumber' | translate}} : {{currentFarm.CustomerNumber}}
\n
{{currentFarm.ZipCode}} {{currentFarm.Town}} {{currentFarm.Country?.Id}}
\n
{{'Global__Farm_RegistryNumber' | translate}} : {{currentFarm.RegistryNumber}}
\n
\n \n
0 ? 'ap-report-page-break':''\">\n \n
{{'Global__NumberAbbr' | translate}}
\n
{{'Global__FieldName' | translate}}
\n
{{'Base__ManagementStyle_ha' | translate}}
\n\n
{{'Report__SampleCount' | translate}}
\n
{{'Nutrients__Region' | translate}}
\n
{{'Global__SampleDate' | translate}}
\n
{{'Nutrients__Soilgroup_separated' | translate}}
\n\n
{{this.elementService.GetElementStringByString(ApElementType.P)}}
\n
{{this.elementService.GetElementStringByString(ApElementType.K)}}
\n
{{this.elementService.GetElementStringByString(ApElementType.Mg)}}
\n
{{'Elem_Ph_short' | translate}}
\n\n \n \n
{{item.NrSNr}}
\n
{{item.FieldName}}
\n
{{item.Area | getRoundNumeric: digitsAfterPoint}}
\n\n
{{getSamplesNumber(item)}}
\n
{{item.SourceItem.Region}}
\n
{{item.SourceItem.SampleDate | date:'dd.MM.YYYY'}}
\n
{{item.SoilGroups}}
\n\n
{{displayValueWithGreaterSign(item.PValue, item.PIsGreaterE)}}
\n
{{item.SourceItem.ClassP}}
\n
{{displayValueWithGreaterSign(item.KValue, item.KIsGreaterE)}}
\n
{{item.SourceItem.ClassK}}
\n
{{displayValueWithGreaterSign(item.MgValue, item.MgIsGreaterE)}}
\n
{{item.SourceItem.ClassMg}}
\n
{{displayValueWithGreaterSign(item.PhValue, item.PhIsGreaterE)}}
\n
{{item.SourceItem.ClassPh}}
\n
\n
\n
\n
\n \n
\n
\n
{{samplesByField[0]?.SampleField?.FieldNumber}} - {{samplesByField[0]?.SampleField?.FieldPart}} {{samplesByField[0]?.SampleField?.FieldName}}
\n \n
GPS {{'Docu_Ini__Number' | translate}}
\n
{{'Global__SampleDate' | translate}}
\n
{{'Nutrients__Soilgroup_separated' | translate}}
\n\n
{{this.elementService.GetElementStringByString(ApElementType.P)}}
{{sampleMethodService.getUnitWithMethod(samplesByField[0]?.MethodP)}}
\n
{{this.elementService.GetElementStringByString(ApElementType.K)}}
{{sampleMethodService.getUnitWithMethod(samplesByField[0]?.MethodK)}}
\n
{{this.elementService.GetElementStringByString(ApElementType.Mg)}}
{{sampleMethodService.getUnitWithMethod(samplesByField[0]?.MethodMg)}}
\n
{{'Elem_Ph_short' | translate}}
{{sampleMethodService.getUnitWithMethod(samplesByField[0]?.MethodPh)}}
\n \n \n \n\n
{{item.GpsNumber}}
\n
{{item.SampleDate | date:'dd.MM.YYYY'}}
\n
{{item.SoilGroup}}
\n\n
{{displayValueByClass(this.nutrientService.convertElementOxid(item.P, ApElementOxydTypeEnum.P, item.MethodP), item.ClassP)}}
\n
{{item.ClassP}}
\n\n
{{displayValueByClass(this.nutrientService.convertElementOxid(item.K, ApElementOxydTypeEnum.K, item.MethodK), item.ClassK)}}
\n
{{item.ClassK}}
\n\n
{{displayValueByClass(this.nutrientService.convertElementOxid(item.Mg, ApElementOxydTypeEnum.Mg, item.MethodMg), item.ClassMg)}}
\n
{{item.ClassMg}}
\n\n
{{displayValueByClass(item.Ph, item.ClassPh)}}
\n
{{item.ClassPh}}
\n
\n
\n \n
\n
\n 0\">\n \n
\n
\n
{{itemsFieldLevel[getFieldIndex(i)].FieldNumber}} - {{itemsFieldLevel[getFieldIndex(i)].FieldPart}} {{itemsFieldLevel[getFieldIndex(i)].FieldName}}
\n
{{itemsFieldLevel[getFieldIndex(i)].Area}} {{'Base__ManagementStyle_ha' | translate}}
\n
{{getLandUseTranslation(itemsFieldLevel[getFieldIndex(i)].SourceItem.LandUse)}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SampleDate | date:'dd.MM.YYYY'}}
\n
{{'Nutrients__Region' | translate}}: {{itemsFieldLevel[getFieldIndex(i)].SourceItem.Region}}
\n
\n
\n \n
\n
\n
\n
{{this.elementService.GetElementStringByString(ApElementType.P)}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SourceItem.ClassP}}
\n
Ø {{displayAvgValueWithGreaterSign(itemsFieldLevel[getFieldIndex(i)].PValue, itemsFieldLevel[getFieldIndex(i)].PIsGreaterE)}}
\n
\n
{{sampleMethodService.getUnitWithMethod(itemsFieldLevel[getFieldIndex(i)].SourceItem.MethodP)}}
\n
\n
\n \n \n
\n\n
\n
{{this.elementService.GetElementStringByString(ApElementType.K)}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SourceItem.ClassK}}
\n
Ø {{displayAvgValueWithGreaterSign(itemsFieldLevel[getFieldIndex(i)].KValue, itemsFieldLevel[getFieldIndex(i)].KIsGreaterE)}}
\n
\n
{{sampleMethodService.getUnitWithMethod(itemsFieldLevel[getFieldIndex(i)].SourceItem.MethodK)}}
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
{{itemsFieldLevel[getFieldIndex(i)].FieldNumber}} - {{itemsFieldLevel[getFieldIndex(i)].FieldPart}} {{itemsFieldLevel[getFieldIndex(i)].FieldName}}
\n
{{itemsFieldLevel[getFieldIndex(i)].Area}} {{'Base__ManagementStyle_ha' | translate}}
\n
{{getLandUseTranslation(itemsFieldLevel[getFieldIndex(i)].SourceItem.LandUse)}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SampleDate | date:'dd.MM.YYYY'}}
\n
{{'Nutrients__Region' | translate}}: {{itemsFieldLevel[getFieldIndex(i)].SourceItem.Region}}
\n
\n
\n \n
\n
\n
\n
{{this.elementService.GetElementStringByString(ApElementType.Mg)}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SourceItem.ClassMg}}
\n
Ø {{displayAvgValueWithGreaterSign(itemsFieldLevel[getFieldIndex(i)].MgValue, itemsFieldLevel[getFieldIndex(i)].MgIsGreaterE)}}
\n
\n
{{sampleMethodService.getUnitWithMethod(itemsFieldLevel[getFieldIndex(i)].SourceItem.MethodMg)}}
\n
\n
\n \n \n
\n\n
\n
{{'Elem_Ph_short' | translate}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SourceItem.ClassPh}}
\n
Ø {{displayAvgValueWithGreaterSign(itemsFieldLevel[getFieldIndex(i)].PhValue, itemsFieldLevel[getFieldIndex(i)].PhIsGreaterE)}}
\n
\n
{{sampleMethodService.getUnitWithMethod(itemsFieldLevel[getFieldIndex(i)].SourceItem.MethodPh)}}
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
{{itemsFieldLevel[getFieldIndex(i)].FieldNumber}} - {{itemsFieldLevel[getFieldIndex(i)].FieldPart}} {{itemsFieldLevel[getFieldIndex(i)].FieldName}}
\n
{{itemsFieldLevel[getFieldIndex(i)].Area}} {{'Base__ManagementStyle_ha' | translate}}
\n
{{getLandUseTranslation(itemsFieldLevel[getFieldIndex(i)].SourceItem.LandUse)}}
\n
{{itemsFieldLevel[getFieldIndex(i)].SampleDate | date:'dd.MM.YYYY'}}
\n
{{'Nutrients__Region' | translate}}: {{itemsFieldLevel[getFieldIndex(i)].SourceItem.Region}}
\n
\n
\n \n
\n
\n
{{'DataContext_InterfaceMapping__Samples' | translate}}
\n\n
\n {{'Nutrients__Soilgroup' | translate}}\n
\n
\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n\n
\n","\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component, EventEmitter, Input,\n OnDestroy,\n OnInit, Output, QueryList,\n ViewChild, ViewChildren\n} from '@angular/core';\nimport IFarm = Data.Authentication.IFarm;\nimport {PDFExportComponent} from '@progress/kendo-angular-pdf-export';\nimport {\n MapStore\n} from '../../../stores/map/map.store';\nimport {\n LanguageStore\n} from '../../../stores/translation/language.store';\nimport {\n LoginStore\n} from '../../../stores/login/login.store';\nimport {\n TaskManagementDataProviders\n} from '../../../task-management/task-management-data-providers/task-management-data-providers';\nimport {\n ApDateService\n} from '../../../ap-core/services/ap-date-service';\nimport {\n CropTypeStore\n} from '../../../stores/base-data/crop.types.store';\nimport {\n SettingsStore\n} from '../../../stores/base-data/settings.store';\nimport {\n GetRoundNumericService\n} from '../../../ap-utils/service/get-round-numeric.service';\nimport {\n TranslationStore\n} from '../../../stores/translation/translation.store';\nimport {Subscription} from 'rxjs';\nimport {\n ISampleFieldGridData\n} from '../../../field-management/types/sample-fields.types';\nimport {drawDOM, exportPDF} from '@progress/kendo-drawing';\nimport {\n saveAs\n} from '@progress/kendo-file-saver';\nimport * as _ from 'lodash';\nimport ISampleTracks = Data.Nutrients.ISampleTracks;\nimport {ApElementOxydTypeEnum, ApStatsType, IBarLineAreaChartData} from '../../../ap-interface';\nimport {\n FieldStatisticHistogramService\n} from '../../../services/data/field-statistic-histogram.service';\nimport {\n IChartSet\n} from '../../../stores/statistic/statistic.store';\nimport {ChartComponent, Margin, ValueAxisLabels} from '@progress/kendo-angular-charts';\nimport {ApBaseVectorLayer} from '../../../ap-map';\nimport {\n MapFactoryLayer\n} from '../../../ap-map/layers/map-factory-layer';\nimport {APP_CONFIGURATION} from '../../../ap-core/config';\nimport {SOIL_GROUP_LEGEND} from '../../../ap-map/layers/layer.legends';\nimport {ILegendValue} from '../../../stores/map/map.legend.store';\nimport {LandUseStore} from '../../../stores/base-data/landuse.store';\nimport {NotifyStore} from '../../../stores/dialog/notify.store';\nimport {ApErrorHandler} from '../../../ap-core/error-handling/ap-errorhandler';\nimport {ApErrorhandlerService} from '../../../ap-core/error-handling/ap-errorhandler.service';\nimport {ApElementType} from '../../../ap-interface/enums/ap-elements-type.enum';\nimport {\n GetElementService\n} from '../../../ap-utils/service/ap-get-element.service';\nimport {ApNutrientService} from '../../../ap-utils/service/ap-nutrient.service';\nimport {FieldNutrientDistributionStore} from '../../../stores/nutrients/field-nutrient-distributions.store';\nimport {UnitsStore} from '../../../stores/common/units.store';\nimport {SampleMethodService} from '../../../services/data/sample.method.service';\n\n@Component({\n selector: 'soil-sample-report',\n templateUrl: './soil-sample-report.component.html',\n styleUrls: ['./soil-sample-report.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SoilSampleReportComponent implements OnInit, OnDestroy {\n @ViewChild('report', {static: true}) private _report: PDFExportComponent;\n @ViewChildren('histogram') histograms: QueryList;\n @Input() itemsFieldLevel: ISampleFieldGridData[] = [];\n @Input() itemsSampleTrackByField: [ISampleTracks[]] = [[]];\n @Output() exportDone = new EventEmitter(true);\n public itemsFieldLevelPerPage: ISampleFieldGridData[][] = [];\n public statisticByField: Map[]>;\n public soilSampleFieldLayer: ApBaseVectorLayer;\n public currentDateTime: string;\n public currentFarm: IFarm;\n public reportName = '';\n public digitsAfterPoint = 0;\n public renderedMaps = 0;\n\n public soilGroupChartData: {\n values: number[],\n categories: string[],\n colorValues: string[],\n colorFunc: (value: any) => string,\n };\n\n protected readonly ApElementType = ApElementType;\n protected readonly ApElementOxydTypeEnum = ApElementOxydTypeEnum;\n protected readonly Math = Math;\n\n // Charts styling\n protected axisTextColor = '#212529';\n protected axisStyling: ValueAxisLabels = {\n font: '7px Arial, sans-serif',\n padding: 0,\n format: '{0}%'\n };\n\n protected categoryStyling: ValueAxisLabels = {\n margin: {top: -8},\n font: '7px Arial, sans-serif',\n padding: 0,\n };\n\n private readonly fieldsFirstPageCount = 22; // 17\n private readonly fieldsPerPageCount = 30; // 25\n\n public readonly samplesPerPageCount = 29;\n\n private _subscriptions: Subscription[] = [];\n private isSaving = false;\n private problematicFieldsAmount = 0;\n\n constructor(private mapStore: MapStore,\n private languageStore: LanguageStore,\n private loginStore: LoginStore,\n private dataProviders: TaskManagementDataProviders,\n private dateService: ApDateService,\n private settingsStore: SettingsStore,\n private roundNumericService: GetRoundNumericService,\n private translationStore: TranslationStore,\n protected elementService: GetElementService,\n protected nutrientService: ApNutrientService,\n protected sampleMethodService: SampleMethodService,\n private changeDetection: ChangeDetectorRef,\n private fieldStatisticHistogramService: FieldStatisticHistogramService,\n private landUseStore: LandUseStore,\n private notifyStore: NotifyStore,\n private errorHandlerService: ApErrorhandlerService) {\n }\n\n ngOnInit(): void {\n this.currentFarm = this.loginStore.Listen(l => l.farm).getValue().selectedFarm;\n const selectedLanguage = this.languageStore.Listen(l => l.selectedLanguage).getValue();\n this.currentDateTime = this.dateService.toFarmDate(new Date()).format(selectedLanguage.DateFormat + ' ' + selectedLanguage.TimeFormat);\n this.soilSampleFieldLayer = this.mapStore.Layers.SampleFieldLayer;\n\n const soilGroupLegend = SOIL_GROUP_LEGEND(this.translationStore.FindTranslationForSelectedLanguage.bind(this.translationStore));\n this.soilGroupChartData = {\n categories: soilGroupLegend.getValuesList().map(x => x.title),\n values: soilGroupLegend.getValuesList().map(_ => 1),\n colorValues: soilGroupLegend.getValuesList().map(x => x.color),\n colorFunc: value => this.soilGroupChartData.colorValues[value?.index]\n };\n }\n\n ngOnDestroy(): void {\n this._subscriptions.forEach(s => s.unsubscribe());\n }\n\n public createAndSaveReport(): void {\n // Lock for being executed twice.\n // Double execution might happen because render complete of Open layers\n // might get triggered again in rare cases.\n if (this.isSaving) {\n return;\n }\n this.isSaving = true;\n\n this.loginStore.setLongOperationStatus(true);\n this.currentFarm = this.loginStore.Listen(l => l.farm).getValue().selectedFarm;\n const selectedLanguage = this.languageStore.Listen(l => l.selectedLanguage).getValue();\n this.currentDateTime = this.dateService.toFarmDate(new Date()).format(selectedLanguage.DateFormat + ' ' + selectedLanguage.TimeFormat);\n\n this.digitsAfterPoint = this.settingsStore.FirstSetting.DigitsAfterDecimalPoint;\n this.itemsFieldLevelPerPage = [];\n this.statisticByField = new Map[]>();\n this.renderedMaps = 0;\n this.problematicFieldsAmount = 0;\n\n // Sorting\n this.itemsFieldLevel.sort((a, b) => {\n if (a.FieldNumber !== b.FieldNumber) {\n return a.FieldNumber - b.FieldNumber;\n }\n\n if (a.FieldPart !== b.FieldPart) {\n return a.FieldPart - b.FieldPart;\n }\n\n return a.FieldName.localeCompare(b.FieldName);\n });\n\n this.itemsSampleTrackByField.sort((a, b) => {\n if (a.length === 0 || b.length === 0) {\n return 0;\n }\n\n if (a[0].SampleField.FieldNumber !== b[0].SampleField.FieldNumber) {\n return a[0].SampleField.FieldNumber - b[0].SampleField.FieldNumber;\n }\n\n if (a[0].SampleField.FieldPart !== b[0].SampleField.FieldPart) {\n return a[0].SampleField.FieldPart - b[0].SampleField.FieldPart;\n }\n\n return a[0].SampleField.FieldName.localeCompare(b[0].SampleField.FieldName);\n });\n\n // Sort by GPS Number of each grid\n this.itemsSampleTrackByField.forEach((samplesArray) => {\n samplesArray.sort((x, y) => x.GpsNumber - y.GpsNumber);\n });\n\n this.problematicFieldsAmount = this.itemsFieldLevel.length - this.itemsSampleTrackByField.length;\n\n if (this.problematicFieldsAmount > 0) {\n let fieldNames = '';\n this.itemsFieldLevel.forEach((field) => {\n if (this.itemsSampleTrackByField.findIndex(s => s[0].SampleField.Id === field.SourceItem.Id) < 0) {\n fieldNames += `${field.SourceItem.FieldNumber} - ${field.SourceItem.FieldPart} ${field.SourceItem.FieldName} `;\n }\n });\n\n const errorMessage = this.translationStore.FindTranslationForSelectedLanguage('Report__No_Sample_Records', [fieldNames]);\n\n this.notifyStore.addMessage({\n Counter: 1,\n DisplayTimeout: 5,\n ErrorKey: errorMessage,\n Level: Data.Api.Validation.ApValidationLevel.Warning,\n Parameters: [],\n UserName: null,\n UserId: null,\n });\n\n this.errorHandlerService.LogClientError(errorMessage, this.loginStore.SelectedFarmId, '', '', '');\n }\n\n // Pagination for the field level grid\n this.itemsFieldLevelPerPage.push(_.take(this.itemsFieldLevel, this.fieldsFirstPageCount));\n _.chunk(\n _.drop(this.itemsFieldLevel, this.fieldsFirstPageCount), this.fieldsPerPageCount)\n .forEach(c => {\n this.itemsFieldLevelPerPage.push(c);\n });\n\n this.reportName = `Soil_Sample_${this.currentFarm.FarmName}_${this.currentDateTime.toString()}`;\n\n this.itemsFieldLevel.forEach(sf =>\n this.statisticByField.set(sf.SourceItem.Id, this.fieldStatisticHistogramService.getHistogramStatistic([{\n Status: 1,\n FieldId: undefined,\n FieldName: sf.FieldName,\n AreaHa: sf.SourceItem.AreaHa ?? 0,\n Histograms: sf.SourceItem.Histograms\n }]).map(x => {\n // Value normalization in order to have percentage values (0 - 100)\n x.data?.data?.forEach((v, k) => x.data.data[k].value = x.data?.data[k].value * 100 / x.meta.areaSum);\n return x;\n })\n ));\n\n this.changeDetection.detectChanges();\n\n // trigger resize event on each chart to be rendered\n this.histograms.forEach(x => x.resize());\n\n // We need to wait for the resize to be completed. Alternative may be to listen to all\n // paneRender emitters and proceed when all of them are fired (haven't checked)\n }\n\n public getLandUseTranslation(value: number): string {\n const landuse = this.landUseStore.LandUse.Find(e => e.Id === value);\n if (!landuse) {\n return value.toString();\n }\n return this.translationStore.FindTranslationForSelectedLanguage(landuse.Key);\n }\n\n private saveReport(): void {\n try {\n // @ts-ignore\n const landscapePages = Array.from(this._report.element?.nativeElement?.querySelectorAll('.ap-landscape-page'));\n // @ts-ignore\n const pageBreaks = Array.from(this._report.element.nativeElement.querySelectorAll('.ap-report-page-break'));\n\n this._report.export().then(group => {\n landscapePages.forEach(page => {\n const pageIndex = pageBreaks.findIndex(el => el === page);\n if (pageIndex >= 0 && (pageIndex + 1) < group.children.length) {\n group.children[pageIndex + 1].options.set('pdf', {\n landscape: true, paperSize: this._report.paperSize, margin: this._report.margin\n });\n } else {\n console.log(`PDF Export : cannot find the correct page for a landscape {pageIndex}`);\n }\n });\n\n exportPDF(group).then(data => {\n // pdf generated => saving it and closing wizard\n saveAs(data, `${this.reportName}.pdf`);\n this.isSaving = false;\n this.loginStore.setLongOperationStatus(false);\n setTimeout(() => this.exportDone?.emit(), 0);\n });\n });\n } catch {\n this.loginStore.setLongOperationStatus(false);\n }\n }\n\n // Page markup support methods\n getSamplesNumber(item: ISampleFieldGridData): number {\n const result = this.itemsSampleTrackByField.find(st =>\n st.length > 0 && st.find(singleTrack => singleTrack.SampleField.Id === item.SourceItem.Id)\n )?.length;\n\n return result ? result : 0;\n }\n\n /**\n * Calculates if page break is needed for a FOLLOWING grid (you should pass i + 1)\n */\n calculateIfPageBreakNeededForSamples(fieldIndex: number, sampleIndex: number): boolean {\n if (sampleIndex >= this.itemsSampleTrackByField[fieldIndex].length) {\n return false;\n }\n\n const currentPage = Math.floor(sampleIndex / this.samplesPerPageCount);\n return currentPage > 0 && sampleIndex % this.samplesPerPageCount === 0;\n }\n\n public onRenderCompleted(): void {\n this.renderedMaps++;\n /* For each field :\n Soil Sample tracks layer + extras\n Soil Group Layer\n P Layer\n K Layer\n Mg Layer\n pH Layer\n */\n if (this.renderedMaps === (this.itemsFieldLevel.length - this.problematicFieldsAmount) * 6) {\n this.saveReport();\n }\n }\n\n getDistributionMapUrl(field: ISampleFieldGridData, elementId: number): string {\n const elements = ['p', 'k', 'mg', 'ph'];\n const url = this.mapStore.Layers.SoilSampleDistributionUrl\n .replaceAll(/_bu_\\w+\\//g, `_bu_sample_id_${elements[elementId]}/`)\n .replace(/\\?params.+/, `?params={${field.SourceItem.Id}}`);\n return APP_CONFIGURATION.MapFactory.Address + url;\n }\n\n getFeatureUrl(field: ISampleFieldGridData, elementId: number): string {\n return APP_CONFIGURATION.MapFactory.Address + `/json/bu_contours/4326/${field.SourceItem.Id}/${elementId}?key=12345`;\n }\n\n getSampleTrackMapUrl(field: ISampleFieldGridData): string {\n return APP_CONFIGURATION.MapFactory.Address + `/json/sampletracks/4326/${field.SourceItem.Id}?key=12345`;\n }\n\n getSoilGroupMapUrl(field: ISampleFieldGridData): string {\n return APP_CONFIGURATION.MapFactory.Address + `/json/bu_soilgroup/4326/${field.SourceItem.Id}?key=12345`;\n }\n\n getFieldIndex(i: number): number {\n const sampleFieldId = this.itemsSampleTrackByField[i][0].SampleField.Id;\n return this.itemsFieldLevel.findIndex(x => x.SourceItem.Id === sampleFieldId);\n }\n\n oxideTransformation = (value: number, elem: ApElementOxydTypeEnum, method: string) => {\n return this.nutrientService.convertElementOxid(value, elem, method);\n }\n\n displayValueWithGreaterSign(value: number, isGreater: boolean, digitsToDisplay: number = 1): string {\n return isGreater ? `> ${this.roundNumericService.round(value, digitsToDisplay)}` : this.roundNumericService.round(value, digitsToDisplay);\n }\n\n displayAvgValueWithGreaterSign(value: number, isGreater: boolean): string {\n return this.displayValueWithGreaterSign(value, isGreater, value >= 10 ? 0 : 1);\n }\n\n displayValueByClass(value: number, valueClass: string): string {\n return this.displayValueWithGreaterSign(value, valueClass === 'E');\n }\n}\n","import {AfterContentInit, Component, EventEmitter, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {BehaviorSubject, combineLatest, Observable, of, Subscription} from 'rxjs';\nimport {ApElementOxydTypeEnum, MapViewCurrentMenu, MapViewMode} from '../../../ap-interface';\nimport {ApPermissions} from 'invoker-transport';\nimport {\n ApDynComponentComponent\n} from '../../../ap-dyncomponent/ap-dyncomponent.component';\nimport {\n ApDynGridColumnConfigBase,\n ApDynGridColumnHideConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApDynGridPagerConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {\n ApDynGridPropertyColumnConfig,\n FilterType\n} from '../../../ap-dyngrids/config/ap-dyn-grid-property-column-config';\nimport {\n ApDynGridEditColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-edit-column-config';\nimport {\n ApDynGridPagerConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {GetRoundNumericPipe, GetSoilSampleFieldClassColorPipe} from '../../../ap-utils';\nimport {\n ApDynGridGroupColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-group-column-config';\nimport {\n ApDynGridClassColorColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-class-color-column-config';\nimport {\n SettingsStore\n} from '../../../stores/base-data/settings.store';\nimport {\n StatisticStore\n} from '../../../stores/statistic/statistic.store';\nimport {\n CampaignYearStore\n} from '../../../stores/login/campaignyear.store';\nimport {\n SoilSampleFieldStore\n} from '../../../stores/evaluation/soilsample.field.store';\nimport {\n TranslationStore\n} from '../../../stores/translation/translation.store';\nimport {MapStore} from '../../../stores/map/map.store';\nimport {\n GetPermissionPipe\n} from '../../../ap-permission/pipes/get-permission.pipe';\nimport {\n GetRoundNumericService\n} from '../../../ap-utils/service/get-round-numeric.service';\nimport {\n ApDynGridStatusColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-status-column-config';\nimport {\n JobsStore\n} from '../../../stores/administration/jobs.store';\nimport {\n FieldStore\n} from '../../../stores/farm/field.store';\nimport {filter, map} from 'rxjs/operators';\nimport {ApMapInstance} from '../../../ap-map';\nimport {\n LanguageStore\n} from '../../../stores/translation/language.store';\nimport {\n ApDateService\n} from '../../../ap-core/services/ap-date-service';\nimport {\n GetElementService\n} from '../../../ap-utils/service/ap-get-element.service';\nimport {\n Icon\n} from '../../../ap-interface/enums/layout/icon.enum';\nimport {\n ApUtilService\n} from '../../../ap-utils/service/ap-util.service';\nimport {\n LoginStore\n} from '../../../stores/login/login.store';\nimport {saveAs} from '@progress/kendo-file-saver';\nimport {\n ApNutrientService\n} from '../../../ap-utils/service/ap-nutrient.service';\nimport {APP_CONFIGURATION} from '../../../ap-core/config';\nimport {\n ApElementType\n} from '../../../ap-interface/enums/ap-elements-type.enum';\nimport {\n ApSoilSampleService\n} from '../../../nutrient-management/service/ap-soil-sample.service';\nimport {\n MapViewStore\n} from '../../../stores/layout/mapview.store';\nimport {ExportFilenameParts, ISampleFieldGridData} from '../../types/sample-fields.types';\nimport {\n nameOf\n} from '../../../ap-core/utils/ap-name-of';\nimport {\n FieldStatisticHistogramService\n} from '../../../services/data/field-statistic-histogram.service';\nimport {\n StatisticService\n} from '../../../services/data/statistic.service';\nimport {\n SampleTracksInfoSuccess\n} from '../../../../../projects/invoker-transport/src/lib/actions/evaluation';\nimport {\n SoilSampleReportComponent\n} from '../../../ap-reports/components/soil-sample-report/soil-sample-report.component';\nimport {\n SampleMethodService\n} from '../../../services/data/sample.method.service';\n\n@Component({\n selector: 'ap-samplefields',\n template: `\n \n \n `\n})\nexport class ApSamplefieldsComponent implements OnInit, AfterContentInit, OnDestroy {\n @ViewChild(SoilSampleReportComponent, {static: true}) soilSampleReportComponent: SoilSampleReportComponent;\n @ViewChild(ApDynComponentComponent, {static: true}) dynComponent: ApDynComponentComponent;\n public loading$: Observable = of(true);\n public columns$: Observable = of([]);\n public items$: Observable = of([]);\n public pager: ApDynGridPagerConfigBase = undefined;\n\n private _applyClicked: EventEmitter = new EventEmitter();\n private _exportFilenameParts: ExportFilenameParts = undefined;\n private _listMassEditing: any[] = [];\n private _subscriptions: Subscription[] = [];\n\n constructor(private soilSampleFieldStore: SoilSampleFieldStore,\n private campaignYearStore: CampaignYearStore,\n private translationStore: TranslationStore,\n private permissionPipe: GetPermissionPipe,\n private mapStore: MapStore,\n private fieldStore: FieldStore,\n private roundNumericService: GetRoundNumericService,\n private settingsStore: SettingsStore,\n private soilSampleFieldClassColorPipe: GetSoilSampleFieldClassColorPipe,\n private statisticStore: StatisticStore,\n private roundNumericPipe: GetRoundNumericPipe,\n private jobsStore: JobsStore,\n private languageStore: LanguageStore,\n private dateService: ApDateService,\n private loginStore: LoginStore,\n private nutrientService: ApNutrientService,\n private soilSampleService: ApSoilSampleService,\n private elementService: GetElementService,\n private mapViewStore: MapViewStore,\n private statisticService: StatisticService,\n private sampleMethodService: SampleMethodService,\n private fieldStatisticHistogramService: FieldStatisticHistogramService) {\n }\n\n public ngOnInit(): void {\n this.loading$ = combineLatest([\n this.soilSampleFieldStore.Loading$,\n this.settingsStore.Loading$,\n this.campaignYearStore.Loading$,\n this.fieldStore.Loading$,\n this.languageStore.Loading$\n ]).pipe(\n map(loadingItems => loadingItems.some(x => x))\n );\n this._exportFilenameParts = {DateExpr: '', CustomerExpr: '', Filename: ''};\n this.mapStore.EnableDistributionView();\n this._gridBuilder();\n this._getDataFromStore();\n }\n\n public ngAfterContentInit(): void {\n this._subscriptions.push(this.dynComponent.SelectedItems$.subscribe(d => {\n this._selectionChange(d);\n }));\n this._subscriptions.push(this.soilSampleFieldStore.SelectedSoilSampleFields$.subscribe(sf => {\n ApMapInstance.selectSampleField(sf);\n }));\n this._subscriptions.push(this.soilSampleFieldStore.Listen(s => s.exportedShapeFile).subscribe(exportedShapeFile => {\n if (exportedShapeFile && this._exportFilenameParts.Filename?.length > 0) {\n const filename = this._exportFilenameParts.Filename;\n saveAs(new Blob([new Uint8Array(exportedShapeFile)], {type: 'application/zip'}),\n `${filename}.zip`);\n }\n this.soilSampleFieldStore.resetDownloads();\n }));\n this._subscriptions.push(this.mapViewStore.Listen(d => d.currentMenu).subscribe(mapViewMenu => {\n if (mapViewMenu === MapViewCurrentMenu.STATS) {\n this._selectionChange(this.dynComponent.getSelectedItems() as ISampleFieldGridData[]);\n }\n }));\n }\n\n public ngOnDestroy(): void {\n this.mapStore.DisableDistributionView();\n this.statisticStore.removeStatisticData();\n this._subscriptions.forEach(d => d?.unsubscribe());\n }\n\n private _getDataFromStore(): void {\n this.soilSampleFieldStore.resetDownloads();\n const currentYear = this.campaignYearStore.getSelectedCampaignYear();\n if (!currentYear || currentYear.Year < 2010) {\n return;\n }\n this.items$ = combineLatest([\n this.soilSampleFieldStore.SoilSampleFields$,\n this.fieldStore.Fields$,\n this.settingsStore.FirstSetting$\n ]).pipe(\n filter(([ssF]) => !!ssF),\n map(([ssF, _, settings]) => {\n return ssF.map(soilSample => {\n const classP = this._soilClassColor(soilSample.ClassP);\n const classK = this._soilClassColor(soilSample.ClassK);\n const classMG = this._soilClassColor(soilSample.ClassMg);\n const classPH = this._soilClassColor(soilSample.ClassPh);\n const pIsGreaterE = soilSample.ClassP === 'E';\n const kIsGreaterE = soilSample.ClassK === 'E';\n const mgIsGreaterE = soilSample.ClassMg === 'E';\n const phIsGreaterE = soilSample.ClassPh === 'E';\n const pValue = this.nutrientService.convertElementOxid(soilSample.P, ApElementOxydTypeEnum.P, soilSample.MethodP);\n const kValue = this.nutrientService.convertElementOxid(soilSample.K, ApElementOxydTypeEnum.K, soilSample.MethodK);\n const mgValue = this.nutrientService.convertElementOxid(soilSample.Mg, ApElementOxydTypeEnum.Mg, soilSample.MethodPh);\n const phValue = soilSample.Ph;\n const pValueRounded = this.roundNumericService.roundAsNumber(pValue, APP_CONFIGURATION.SpecialDecimalPlaces.Distributions);\n const kValueRounded = this.roundNumericService.roundAsNumber(kValue, APP_CONFIGURATION.SpecialDecimalPlaces.Distributions);\n const mgValueRounded = this.roundNumericService.roundAsNumber(mgValue, APP_CONFIGURATION.SpecialDecimalPlaces.Distributions);\n const phValueRounded = this.roundNumericService.roundAsNumber(phValue, APP_CONFIGURATION.SpecialDecimalPlaces.Distributions);\n const item: ISampleFieldGridData = {\n Id: soilSample.Id,\n SourceItem: soilSample,\n Status: 1,\n StatusClass: 'ap-status-green',\n FieldNumber: soilSample.FieldNumber,\n FieldPart: soilSample.FieldPart,\n FieldName: soilSample.FieldName,\n SoilGroups: soilSample.SoilGroups,\n NrSNr: this.soilSampleService.getFieldNumberAndSubNumber(soilSample),\n Area: this.roundNumericService.roundAsNumber(soilSample.AreaHa, settings.DigitsAfterDecimalPoint),\n SampleDate: soilSample.SampleDate ? this.dateService.getDateMidnight(soilSample.SampleDate) : null,\n ClassP: classP,\n ClassK: classK,\n ClassMg: classMG,\n ClassPh: classPH,\n PValue: pValueRounded,\n KValue: kValueRounded,\n MgValue: mgValueRounded,\n PhValue: phValueRounded,\n PIsGreaterE: pIsGreaterE,\n KIsGreaterE: kIsGreaterE,\n MgIsGreaterE: mgIsGreaterE,\n PhIsGreaterE: phIsGreaterE,\n PValueTooltip: this.nutrientService.formatClassificationTooltip(soilSample.P, pIsGreaterE, soilSample.MethodP),\n KValueTooltip: this.nutrientService.formatClassificationTooltip(soilSample.K, kIsGreaterE, soilSample.MethodK),\n MgValueTooltip: this.nutrientService.formatClassificationTooltip(soilSample.Mg, mgIsGreaterE, soilSample.MethodMg),\n PhValueTooltip: this.nutrientService.formatClassificationTooltip(soilSample.Ph, phIsGreaterE, soilSample.MethodPh),\n PContentTooltip: this.sampleMethodService.getUnitWithMethod(soilSample.MethodP),\n KContentTooltip: this.sampleMethodService.getUnitWithMethod(soilSample.MethodK),\n MgContentTooltip: this.sampleMethodService.getUnitWithMethod(soilSample.MethodMg),\n PhContentTooltip: this.sampleMethodService.getUnitWithMethod(soilSample.MethodPh),\n };\n return item;\n });\n }));\n }\n\n private _gridBuilder(): void {\n this.columns$ = combineLatest([\n this.settingsStore.FirstSetting$,\n this.languageStore.SelectedLanguage$\n ]).pipe(\n filter(([settings, selectedLanguage]) => !!settings && !!selectedLanguage),\n map(([settings, selectedLanguage]) => {\n return [\n new ApDynGridStatusColumnConfig({\n field: `${nameOf('Status')}`,\n showHeaderTitle: false,\n class: 'StatusClass',\n pending: this.jobsStore.BlockedSoilSampleFieldIdsBu$,\n pendingTooltip: this.jobsStore.BlockedSoilSampleFieldIdsBuTooltip$,\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('FieldNumber')}`,\n title: 'Global__NumberAbbr',\n filterable: true,\n hide: true,\n width: 60,\n headerFilterable: true,\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('FieldPart')}`,\n title: 'Global__FieldPartShort',\n filterable: true,\n hide: true,\n width: 60,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('NrSNr')}`,\n title: 'Global__NumberAbbr',\n width: 75,\n filterable: true,\n headerFilterable: true,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this.mapViewStore.Listen(s => s.mode).pipe(map((m) => m !== MapViewMode.NORMAL)),\n })\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('FieldName')}`,\n title: 'Global__Name',\n filterable: true,\n width: 180,\n headerFilterable: true,\n sortIndex: 0\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('Area')}`,\n title: 'Base__ManagementStyle_ha',\n filterable: true,\n width: 60,\n headerFilterable: true,\n cssClass: 'right', filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [\n settings.DigitsAfterDecimalPoint,\n ]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('SampleDate')}`,\n title: 'Global__SampleDate',\n filterType: FilterType.DATE,\n format: selectedLanguage.DateFormat,\n filterable: true,\n width: 80,\n hide: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('SoilGroups')}`,\n title: 'Nutrients__Soilgroups',\n filterable: true,\n width: 80,\n hide: true,\n headerFilterable: true\n }),\n new ApDynGridGroupColumnConfig({\n headerStyle: {\n 'text-align': 'center'\n },\n style: {border: '1px solid #2c3237'},\n title: 'Global__Avg_Class',\n groupColumns: [\n new ApDynGridClassColorColumnConfig({\n field: `${nameOf('ClassP')}`,\n title: this.elementService.GetElementStringByString(ApElementType.P),\n key: 'SourceItem.ClassP',\n width: 45,\n tooltip: 'PValueTooltip',\n cssClass: 'center'\n }),\n new ApDynGridClassColorColumnConfig({\n field: `${nameOf('ClassK')}`,\n title: this.elementService.GetElementStringByString(ApElementType.K),\n key: 'SourceItem.ClassK',\n width: 45,\n tooltip: 'KValueTooltip',\n cssClass: 'center'\n }),\n new ApDynGridClassColorColumnConfig({\n field: `${nameOf('ClassMg')}`,\n title: this.elementService.GetElementStringByString(ApElementType.Mg),\n key: 'SourceItem.ClassMg',\n width: 45,\n tooltip: 'MgValueTooltip',\n cssClass: 'center'\n }),\n new ApDynGridClassColorColumnConfig({\n field: `${nameOf('ClassPh')}`,\n title: 'Global__Nutrient_pH_Short',\n key: 'SourceItem.ClassPh',\n width: 45,\n tooltip: 'PhValueTooltip',\n cssClass: 'center'\n }),\n ]\n }),\n new ApDynGridGroupColumnConfig({\n title: 'Global__Content',\n headerStyle: {\n 'text-align': 'center'\n },\n style: {border: '1px solid #2c3237'},\n hide: true,\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('PValue')}`,\n title: this.elementService.GetElementStringByString(ApElementType.P),\n tooltip: (dataItem: ISampleFieldGridData) => dataItem.PContentTooltip,\n width: 45,\n hide: true,\n formatCallback: (dataItem, value) => `${(dataItem?.PIsGreaterE ? '> ' : '')}${value}`,\n cssClass: 'right', filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [\n APP_CONFIGURATION.SpecialDecimalPlaces.Distributions\n ]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('KValue')}`,\n title: this.elementService.GetElementStringByString(ApElementType.K),\n tooltip: (dataItem: ISampleFieldGridData) => dataItem.KContentTooltip,\n width: 45,\n hide: true,\n formatCallback: (dataItem, value) => `${(dataItem?.KIsGreaterE ? '> ' : '')}${value}`,\n cssClass: 'right', filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [\n APP_CONFIGURATION.SpecialDecimalPlaces.Distributions\n ]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('MgValue')}`,\n title: this.elementService.GetElementStringByString(ApElementType.Mg),\n tooltip: (dataItem: ISampleFieldGridData) => dataItem.MgContentTooltip,\n width: 35,\n hide: true,\n formatCallback: (dataItem, value) => `${(dataItem?.MgIsGreaterE ? '> ' : '')}${value}`,\n cssClass: 'right', filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [\n APP_CONFIGURATION.SpecialDecimalPlaces.Distributions\n ]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: `${nameOf('PhValue')}`,\n title: 'Elem_Ph_short',\n tooltip: (dataItem: ISampleFieldGridData) => dataItem.PhContentTooltip,\n width: 45,\n hide: true,\n formatCallback: (dataItem, value) => `${(dataItem?.PhIsGreaterE ? '> ' : '')}${value}`,\n cssClass: 'right', filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [\n APP_CONFIGURATION.SpecialDecimalPlaces.Distributions\n ]\n }]\n })\n ]\n }),\n new ApDynGridEditColumnConfig({\n disabled: true\n })\n ];\n }));\n this._subscriptions.push(this.permissionPipe.transform(ApPermissions.SHOW_SOIL_SAMPLE_FIELDS).subscribe(permissions => {\n this.pager = new ApDynGridPagerConfig(\n {\n listMassEditing: this._listMassEditing,\n apply: this._applyClicked,\n hasPermission: permissions,\n iconButtons: [\n {\n icon: Icon.PDF,\n callback: ApUtilService.createEventEmitter(this._onExportPdf.bind(this), this._subscriptions),\n tooltip: 'Global__Save_PDF'\n },\n {\n icon: Icon.Print,\n callback: ApUtilService.createEventEmitter(this._onExportPdfReport.bind(this), this._subscriptions),\n tooltip: 'Report__GenerateSample'\n },\n {\n icon: Icon.XLS,\n callback: ApUtilService.createEventEmitter(this._onExportXls.bind(this), this._subscriptions),\n tooltip: 'Global__Save_EXCEL'\n },\n {\n icon: Icon.Shape,\n callback: ApUtilService.createEventEmitter(this._onExportShape.bind(this), this._subscriptions),\n tooltip: 'Nutrients_Ips_Pages__ShpExport'\n },\n ]\n });\n })\n );\n }\n\n private _onExportPdf(): void {\n this.dynComponent.dynGrid.pdfExportFileName = this._generateExportFilename('Base_Pages__SampleFields');\n this.dynComponent.dynGrid.exportAsPdf();\n }\n\n private _onExportPdfReport(): void {\n this.dynComponent.dynGrid.pdfExportFileName = this._generateExportFilename('Base_Pages__SampleFields');\n const selectedItems = this.dynComponent.getSelectedItems()?.map(x => x as ISampleFieldGridData);\n this.soilSampleFieldStore.sampleTracksInfo(selectedItems.map(x => x.Id)).watchStream({\n action: SampleTracksInfoSuccess,\n todo: payload => {\n if (!payload.Error) {\n this.soilSampleFieldStore.SetLoadFinishState();\n this.soilSampleReportComponent.itemsFieldLevel = selectedItems;\n this.soilSampleReportComponent.itemsSampleTrackByField = payload.Data;\n this.soilSampleFieldStore.changeSelectedSampleField([]);\n this.soilSampleReportComponent.createAndSaveReport();\n } else {\n this.soilSampleFieldStore.SetLoadFailState();\n }\n },\n });\n\n }\n\n private _onExportXls(): void {\n this._generateExportFilename('SamplePoints');\n const soilSampleIds = this.dynComponent.getSelectedItems()?.length > 0 ?\n this.dynComponent.getSelectedItems()?.map(_ => _?.Id) :\n this.dynComponent.items?.map(_ => _?.Id);\n if (!soilSampleIds || soilSampleIds.length <= 0) {\n return;\n }\n this.soilSampleFieldStore.samplePointsExcelExport(soilSampleIds, this._exportFilenameParts.Filename);\n }\n\n private _onExportShape(): void {\n this._generateExportFilename('SampleTracks');\n const soilSampleIds = this.dynComponent.getSelectedItems()?.length > 0\n ? this.dynComponent.getSelectedItems()?.map(_ => _?.Id)\n : this.dynComponent.items?.map(_ => _?.Id);\n\n if (!soilSampleIds || soilSampleIds.length <= 0) {\n return;\n }\n this.soilSampleFieldStore.sampleTracksShapeExport(soilSampleIds,\n this._exportFilenameParts.DateExpr,\n this._exportFilenameParts.CustomerExpr);\n }\n\n private _generateExportFilename(formatExpr: string): string {\n this._exportFilenameParts.CustomerExpr = this.loginStore.SelectedFarm?.CustomerNumber;\n this._exportFilenameParts.DateExpr = this.dateService.toFarmDate(new Date()).format('YYMMDD');\n this._exportFilenameParts.Filename = `${this._exportFilenameParts.DateExpr}_${this.translationStore.FindTranslationForSelectedLanguage(formatExpr)}_${this._exportFilenameParts.CustomerExpr}`;\n return this._exportFilenameParts.Filename;\n }\n\n private _soilClassColor(value: string): any {\n return this.soilSampleFieldClassColorPipe.transform(value, [false]);\n }\n\n private _selectionChange(items: ISampleFieldGridData[]): void {\n let itemsToSelect: ISampleFieldGridData[] = items;\n if (itemsToSelect && itemsToSelect.length > 0) {\n this.soilSampleFieldStore.changeSelectedSampleField(itemsToSelect.map(x => x.Id));\n } else {\n itemsToSelect = this.dynComponent.items as ISampleFieldGridData[];\n this.soilSampleFieldStore.changeSelectedSampleField([]);\n this.fieldStore.zoomFarmFields();\n }\n // calculate statistic only if user is on statistic tab\n if (this.mapViewStore.getMapViewCurrentMenu() !== MapViewCurrentMenu.STATS) {\n return;\n }\n setTimeout(() => {\n this.statisticStore.removeStatisticData();\n const statisticData = itemsToSelect.map(item => {\n return {\n Status: item.Status,\n FieldId: undefined,\n FieldName: item.FieldName,\n AreaHa: item.Area ?? 0,\n Histograms: item.SourceItem.Histograms\n };\n });\n const title = this._getTitleForStatistic(itemsToSelect);\n this.fieldStatisticHistogramService.generateHistogramStatistic(title, statisticData);\n }, 0);\n }\n\n private _getTitleForStatistic(selectedItems: ISampleFieldGridData[]): string {\n const totalItems = this.dynComponent.items as ISampleFieldGridData[];\n const dataForTitles = totalItems.map(x => ({\n AreaHa: x.Area,\n Selected: selectedItems.some(z => z.Id === x.Id)\n }));\n return this.statisticService.generateFieldsAreaTitle(dataForTitles);\n }\n\n restoreSelection(): void {\n this.soilSampleFieldStore.changeSelectedSampleField((this.dynComponent.getSelectedItems() as ISampleFieldGridData[]).map(x => x.Id));\n }\n}\n","import {IGridData} from '../../ap-interface';\nimport {SatelliteNValues} from '../../types/ndi.types';\nimport IGuid = System.IGuid;\nimport IField = Data.FieldManagement.IField;\nimport IFieldCrop = Data.FieldManagement.IFieldCrop;\n\nexport interface INdiGridData extends IGridData {\n Id: IGuid;\n Nr: number;\n TNr: number;\n NrSNr: string;\n Name: string;\n FieldCrop: IFieldCrop;\n Status: number;\n StatusClass: string;\n StatusDesc: string;\n CropType: string;\n EcValue: number | null;\n Area: number;\n Date: Date;\n NUptakeStatus: number;\n NUptakeStatusClass: string;\n NUptakeStatusDesc: string;\n SatelliteNValues: SatelliteNValues | undefined;\n SourceItem: IField;\n}\n\nexport enum NdiActiveView {\n NIndex,\n NUptake\n}\n\nexport enum SatelliteMassEditAction {\n Edit = 0\n}\n\nexport type NdiGridStatusClass =\n 'ap-status-green-regular-scan'\n | 'ap-status-green-autumn-scan'\n | 'ap-status-yellow'\n | 'ap-status-grey'\n | 'ap-status-red'\n | undefined;\n","\n\n\n\n \n \n \n
\n \n
\n
\n","import {\n AfterContentInit,\n Component,\n EventEmitter,\n OnDestroy,\n OnInit,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {BehaviorSubject, combineLatest, Observable, of, Subscription} from 'rxjs';\nimport {\n ApDynGridColumnConfigBase,\n ApDynGridColumnHideConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApDynGridPagerConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {\n FieldStore\n} from '../../../stores/farm/field.store';\nimport {debounceTime, distinctUntilChanged, filter, map} from 'rxjs/operators';\nimport {ApGridPagerType, ApStatsType, IGridPagerData, MapViewCurrentMenu, MapViewMode} from '../../../ap-interface';\nimport {\n LoginStore\n} from '../../../stores/login/login.store';\nimport {\n CampaignYearStore\n} from '../../../stores/login/campaignyear.store';\nimport {\n ApDynGridStatusColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-status-column-config';\nimport {\n ApDynGridPropertyColumnConfig,\n FilterType\n} from '../../../ap-dyngrids/config/ap-dyn-grid-property-column-config';\nimport {\n NdiStore\n} from '../../../stores/ndi/ndi.store';\nimport {\n ApDynComponentComponent\n} from '../../../ap-dyncomponent/ap-dyncomponent.component';\nimport {\n LanguageStore\n} from '../../../stores/translation/language.store';\nimport {\n ApDynGridPagerConfig,\n IDynGridWizardChoiceData\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {\n ApDateService\n} from '../../../ap-core/services/ap-date-service';\nimport {\n IGridStatus\n} from '../../../ap-interface/interfaces/ap-grid-status.interface';\nimport {\n StatisticStore\n} from '../../../stores/statistic/statistic.store';\nimport {\n MapViewStore\n} from '../../../stores/layout/mapview.store';\nimport {\n ApTranslationService\n} from '../../../ap-utils/service/ap-translation.service';\nimport {\n orderBy\n} from '@progress/kendo-data-query';\nimport {\n ApGetCropService\n} from '../../../stores/services/ap-get-crop.service';\nimport {ObjectFactory} from 'ts-tooling';\nimport {\n NotifyStore\n} from '../../../stores/dialog/notify.store';\nimport {\n ApDynformsConfigFieldset\n} from '../../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {\n ApDynformsConfigNumerictextbox\n} from '../../../ap-dynforms/config/ap-dynforms-config-numerictextbox';\nimport {\n ApDynformsConfigPlaceholder\n} from '../../../ap-dynforms/config/ap-dynforms-config-placeholder';\nimport {\n FieldMassEditAction\n} from '../field-overview.component';\nimport {\n ApDynformsValidator\n} from '../../../ap-dynforms/ap-dynforms-validator';\nimport {Validators} from '@angular/forms';\nimport {GetRoundNumericPipe} from '../../../ap-utils';\nimport {\n SettingsStore\n} from '../../../stores/base-data/settings.store';\nimport {\n NUptakeFactorsStore\n} from '../../../stores/common/nuptake-factors.store';\nimport {\n ApDynGridGroupColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-group-column-config';\nimport {INdiGridData, NdiActiveView, SatelliteMassEditAction} from '../../types/ndi.types';\nimport {\n ApColumnState\n} from '../../../ap-interface/enums/ap-column-state.enum';\nimport {\n MapStore\n} from '../../../stores/map/map.store';\nimport {\n AgriportConstantsService\n} from '../../../services/common/agriport-constants.service';\nimport {\n NdiService\n} from '../../services/ndi.service';\nimport {\n StatisticService\n} from '../../../services/data/statistic.service';\nimport {\n MapFactoryStyler\n} from '../../../map-factory/style';\nimport {\n CampaignYearService\n} from '../../../services/data/campaign-year.service';\nimport {\n IFieldsNdiStatsData\n} from '../../../statistics/components/charts/fields-ndi-stats/fields-ndi-stats.types';\nimport {\n nameOf\n} from '../../../ap-core/utils/ap-name-of';\nimport {SatelliteNValues} from '../../../types/ndi.types';\nimport {\n GetRoundNumericPipeConfig\n} from '../../../ap-utils/pipes/configs/get-round-numeric.pipe.config';\nimport IField = Data.FieldManagement.IField;\nimport INdiStatistic = Data.NDI.INdiStatistic;\nimport IFieldCrop = Data.FieldManagement.IFieldCrop;\nimport ICropTypes = Data.BaseData.ICropTypes;\n\n@Component({\n selector: 'ndi-index',\n templateUrl: 'ndi.component.html',\n styleUrls: ['ndi.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class NdiComponent implements OnInit, AfterContentInit, OnDestroy {\n @ViewChild(ApDynComponentComponent, {static: true}) dynComponent: ApDynComponentComponent;\n\n public columns$: Observable = of([]);\n public pager$: Observable;\n public loading$ = of(true);\n public items$: Observable;\n public showDynComponent$ = new BehaviorSubject(false);\n\n private _halfViewMode$ = new BehaviorSubject(1);\n private _halfViewModeChange = new EventEmitter();\n private _statisticUpdateRequested = new EventEmitter();\n private _applyClicked = new EventEmitter();\n private _subscriptions: Array = [];\n\n constructor(private fieldStore: FieldStore,\n private loginStore: LoginStore,\n private ndiStore: NdiStore,\n private notifyStore: NotifyStore,\n private languageStore: LanguageStore,\n private dateService: ApDateService,\n private mapViewStore: MapViewStore,\n private statisticStore: StatisticStore,\n private settingsStore: SettingsStore,\n private campaignYearStore: CampaignYearStore,\n private nUptakeFactorsStore: NUptakeFactorsStore,\n private translationService: ApTranslationService,\n private cropService: ApGetCropService,\n private mapStore: MapStore,\n private ndiService: NdiService,\n private statisticService: StatisticService,\n private agriportConstantsService: AgriportConstantsService,\n private campaignYearService: CampaignYearService,\n private roundNumericPipe: GetRoundNumericPipe) {\n }\n\n public ngOnInit(): void {\n this.updateLayerVisibility();\n this.loading$ = combineLatest([\n this.ndiStore.Listen(s => s.loading),\n this.fieldStore.Listen(s => s.loading),\n this.nUptakeFactorsStore.Listen(s => s.loading)\n ]).pipe(\n map(loadingItems => loadingItems.some(x => x))\n );\n this._subscriptions.push(this._halfViewModeChange.subscribe(() => {\n const nextView = this._halfViewMode$.value === NdiActiveView.NIndex ?\n NdiActiveView.NUptake : NdiActiveView.NIndex;\n this._halfViewMode$.next(nextView);\n this.updateLayerVisibility();\n }));\n this._subscriptions.push(this.mapViewStore.Listen(m => m.mode).subscribe(() => {\n setTimeout(() => this.updateLayerVisibility(), 500);\n }));\n this._subscriptions.push(\n this.mapStore.mapInitialized.subscribe(_ => this.updateLayerVisibility())\n );\n this._subscriptions.push(\n this.campaignYearStore.SelectedCampaignYear$.pipe(\n distinctUntilChanged((previous, current) => previous?.Year === current?.Year),\n ).subscribe(selectedCampaignYear => {\n const currentFarmDate = this.dateService.getFarmDate();\n const currentCampaignYear = this.campaignYearService.getCampaignYearByDate(currentFarmDate);\n const isNeedToShowComponent = currentCampaignYear.CampaignYear === selectedCampaignYear?.Year;\n this.mapStore.Legends.onNdiLegendShow.emit(isNeedToShowComponent);\n this.showDynComponent$.next(isNeedToShowComponent);\n })\n );\n this.items$ = combineLatest([\n this.ndiStore.NdiStatistics$,\n this.fieldStore.Fields$,\n this.nUptakeFactorsStore.nUptakeFactors$\n ]).pipe(\n filter(([nIndexData, fields, nUptakeFactors]) => !!fields && !!nIndexData && !!nUptakeFactors),\n map(([nIndexData, fields]) => this._getItems(nIndexData, fields)),\n );\n this._subscriptions.push(\n this._statisticUpdateRequested.pipe(debounceTime(100)).subscribe(_ => this._generateStats())\n );\n this._subscriptions.push(\n this.items$.subscribe(_ => this._statisticUpdateRequested.emit())\n );\n this._subscriptions.push(\n combineLatest([\n this.mapViewStore.Listen(s => s.mode),\n this.mapViewStore.Listen(s => s.currentMenu)\n ]).subscribe(([mapMode, mapMenu]) => {\n if (mapMode !== MapViewMode.HIDE && mapMenu === MapViewCurrentMenu.STATS) {\n this._statisticUpdateRequested.emit();\n }\n }\n )\n );\n }\n\n public ngAfterContentInit(): void {\n this._gridBuilder();\n this._subscriptions.push(\n this.dynComponent.SelectedItems$.subscribe(d => this._selectionChange(d))\n );\n this._subscriptions.push(\n this._applyClicked.subscribe((e) => this._onApplyClicked(e))\n );\n this._subscriptions.push(\n this.fieldStore.Listen(x => x.fieldCropsSaved).subscribe(x => this._invokeWhenFieldCropsUpdated(x))\n );\n }\n\n public ngOnDestroy(): void {\n this.statisticStore.removeStatisticData();\n this._subscriptions.forEach(d => d.unsubscribe());\n }\n\n private _getItems(ndiStatistics: INdiStatistic[], fields: IField[]): INdiGridData[] {\n return fields.filter(x => !!x).Convert((field: IField) => {\n if (!field) {\n return null;\n }\n let fieldCrop = this.cropService.getFieldCrop(field);\n const mainCrop = this.cropService.getCropType(fieldCrop, true);\n fieldCrop = mainCrop ? fieldCrop : null;\n const ndiSatScan = ndiStatistics.find(x => x.FieldGeomId === field.DefaultGeom?.Id);\n const createdDate = !!ndiSatScan?.Created ? new Date(ndiSatScan.Created) : undefined;\n const gridStatus = this.ndiService.getCustomStatusForNdiRecord(ndiSatScan);\n const satelliteNValues = this.ndiService.getSatelliteNValues(ndiSatScan, fieldCrop);\n const nUptakeValue = this._getNUptakeStatus(mainCrop, fieldCrop, satelliteNValues);\n const isNdiScanValid = this.ndiService.isNdiScanValid(ndiSatScan);\n const item: INdiGridData = {\n Id: field.Id,\n Status: gridStatus.state,\n StatusClass: gridStatus.class,\n StatusDesc: gridStatus.description,\n Name: field.FieldName,\n Nr: field.FieldNumber,\n TNr: field.FieldSubnumber,\n NrSNr: this.fieldStore.getFieldNumberAndSubNumber(field),\n FieldCrop: mainCrop?.Description ? fieldCrop : null,\n EcValue: fieldCrop?.EcValue,\n CropType: mainCrop?.Description ?? '',\n Area: (field.DefaultGeom?.AdminArea ?? 0) / 10000,\n Date: isNdiScanValid ? this.dateService.getDateMidnight(createdDate) : undefined,\n NUptakeStatus: nUptakeValue.state,\n NUptakeStatusClass: nUptakeValue.class,\n NUptakeStatusDesc: nUptakeValue.description,\n SatelliteNValues: satelliteNValues,\n SourceItem: field\n };\n return item;\n });\n }\n\n private _gridBuilder(): void {\n this.columns$ = combineLatest([\n this.campaignYearStore.SelectedCampaignYear$,\n this.loginStore.User$,\n ]).pipe(map(([_, _1]) => [\n new ApDynGridStatusColumnConfig({\n field: nameOf('Status'),\n class: nameOf('StatusClass'),\n description: nameOf('StatusDesc'),\n showHeaderTitle: false,\n filterable: true,\n defaultFilter: ApColumnState.Green\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__NumberAbbr',\n field: nameOf('Nr'),\n hide: true,\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 60\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldPartShort',\n field: nameOf('TNr'),\n hide: true,\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 60\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__NumberAbbr',\n field: nameOf('NrSNr'),\n width: 75,\n filterable: true,\n headerFilterable: true,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this.mapViewStore.Listen(s => s.mode).pipe(map((m) => m !== MapViewMode.NORMAL)),\n })\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldName',\n field: nameOf('Name'),\n filterable: true,\n headerFilterable: true,\n sortIndex: 0,\n sortDesc: false,\n width: 120,\n cssClass: 'left',\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Area',\n field: nameOf('Area'),\n hide: true,\n headerFilterable: true,\n tooltip: (dataItem: INdiGridData) => dataItem.Area ? dataItem.Area.toString(10) : '-',\n filterType: FilterType.NUMBER,\n width: 40,\n cssClass: 'right',\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [this.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Crop',\n field: nameOf('CropType'),\n filterable: true,\n headerFilterable: true,\n width: 100\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'ECStageShort',\n field: nameOf('EcValue'),\n filterable: true,\n headerFilterable: true,\n width: 40,\n cssClass: 'right',\n filterType: FilterType.NUMBER\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Planning_Date',\n field: nameOf('Date'),\n hide: true,\n filterable: true,\n headerFilterable: true,\n format: this.languageStore.CurrentDateFormat,\n width: 80\n }),\n new ApDynGridGroupColumnConfig({\n title: 'Global__NDI_Name',\n hide: true,\n width: 215,\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NIndexMin')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Avg_Symbol',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NIndexAvg')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NIndexMax')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n })\n ]\n }),\n new ApDynGridGroupColumnConfig({\n title: 'N__UptakeUnit',\n hide: true,\n width: 215,\n groupColumns: [\n new ApDynGridStatusColumnConfig({\n title: 'NUptakeStatus',\n field: nameOf('NUptakeStatus'),\n class: nameOf('NUptakeStatusClass'),\n description: nameOf('NUptakeStatusDesc'),\n showHeaderTitle: false,\n filterable: true,\n groupIndex: 0,\n groupDesc: false\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NUptakeMin')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Avg_Symbol',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NUptakeAvg')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NUptakeMax')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n })\n ]\n }),\n new ApDynGridGroupColumnConfig({\n title: this._halfViewMode$.pipe(map((m) => m === 0 ? 'Global__NDI_Name' : 'N__UptakeUnit')),\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this.mapViewStore.Listen(s => s.mode).pipe(map((m) => m !== MapViewMode.NORMAL)),\n }),\n headerButtons: {\n nextClicked: this._halfViewModeChange,\n previousClicked: this._halfViewModeChange,\n nextDisabled: of(false),\n previousDisabled: of(false)\n },\n xlsExport: false,\n width: 215,\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NIndexMin')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NUptake))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Avg_Symbol',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NIndexAvg')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NUptake))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NIndexMax')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NUptake))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridStatusColumnConfig({\n title: 'NUptakeStatus',\n field: nameOf('NUptakeStatus'),\n class: nameOf('NUptakeStatusClass'),\n description: nameOf('NUptakeStatusDesc'),\n showHeaderTitle: false,\n filterable: true,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NIndex))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NUptakeMin')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NIndex))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Avg_Symbol',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NUptakeAvg')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NIndex))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: `${nameOf('SatelliteNValues')}.${nameOf('NUptakeMax')}`,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n filterable: true,\n width: 65,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this._halfViewMode$.pipe(map((m) => m === NdiActiveView.NIndex))\n }),\n pipes: [{pipe: this.roundNumericPipe, args: [0, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]}]\n })\n ]\n })\n ]));\n\n this.pager$ = new BehaviorSubject(new ApDynGridPagerConfig({\n listMassEditing: [\n {\n id: FieldMassEditAction.EditMainCrop,\n type: ApGridPagerType.None,\n name: this.translationService.translate('Global__Edit'),\n onSubmit: this._applyClicked,\n formConfig: [\n new ApDynformsConfigFieldset({\n key: 'SatelliteDetailsFieldSet',\n config: [\n new ApDynformsConfigNumerictextbox({\n key: 'EcValueToUpdate',\n label: 'ECStageShort',\n min: +this.agriportConstantsService.GetConstant('GS_GLOBAL_MIN'),\n max: +this.agriportConstantsService.GetConstant('GS_GLOBAL_MAX'),\n decimals: 0,\n format: 'n0',\n validators: [\n new ApDynformsValidator({validator: Validators.required, errorKey: ''})\n ]\n }),\n new ApDynformsConfigPlaceholder()\n ]\n })\n ]\n } as IDynGridWizardChoiceData\n ],\n apply: this._applyClicked,\n hasPermission: true\n }));\n }\n\n private _getNUptakeStatus(mainCrop: ICropTypes | undefined, fieldCrop: IFieldCrop | undefined,\n satelliteValues: SatelliteNValues | undefined): IGridStatus {\n const nUptakeFactor = this.ndiService.getNUptakeFactor(fieldCrop);\n if (!!mainCrop && !!fieldCrop?.EcValue && !!nUptakeFactor) {\n if (!!satelliteValues && Number.isFinite(satelliteValues.NUptakeAvg)) {\n return {\n state: ApColumnState.Green,\n class: 'ap-status-green',\n description: ''\n };\n }\n return {\n state: ApColumnState.Yellow,\n class: 'ap-status-yellow',\n description: ''\n };\n }\n return {\n state: ApColumnState.Grey,\n class: 'ap-status-grey',\n description: ''\n };\n }\n\n private _onApplyClicked(event: IGridPagerData): void {\n if (!event) {\n return;\n }\n if (event.object.id === SatelliteMassEditAction.Edit) {\n const selectedFieldCrops = (this.dynComponent.getSelectedItems() as INdiGridData[])\n .filter(x => x.FieldCrop)\n .map(x => x.FieldCrop);\n if (!selectedFieldCrops || selectedFieldCrops.length <= 0) {\n return;\n }\n const copiedFieldCrops = ObjectFactory.Copy(selectedFieldCrops);\n copiedFieldCrops.forEach(fieldCrop => {\n fieldCrop.EcValue = event.value ?? event.form['EcValueToUpdate'];\n });\n this.fieldStore.saveFieldCrops(copiedFieldCrops);\n }\n }\n\n private _invokeWhenFieldCropsUpdated(isUpdated: boolean | undefined): void {\n if (isUpdated === undefined) {\n return;\n }\n if (isUpdated) {\n this.notifyStore.showSaveSuccessMessage();\n } else {\n this.notifyStore.showSaveFailMessage();\n }\n MapFactoryStyler.Instance?.clearStyleCache();\n this.mapStore.Layers?.NUptakeLayer?.reload();\n }\n\n private _selectionChange(currentSelected: INdiGridData[]): void {\n this.fieldStore.changeSelectedField(currentSelected.Convert((gridRow: INdiGridData) => gridRow.Id.toString()));\n this._statisticUpdateRequested.emit();\n }\n\n /**\n * Generates the statistic diagrams for last sampling-dates and planned sampling dates\n * @private\n */\n private _generateStats(): void {\n if (this.mapViewStore.getMapViewCurrentMenu() !== MapViewCurrentMenu.STATS\n || this.mapViewStore.getMapViewMode() === MapViewMode.HIDE\n || !this.showDynComponent$.getValue()) {\n return;\n }\n let items = this.dynComponent.getSelectedItems() as INdiGridData[];\n if (!items || items?.length === 0) {\n items = this.dynComponent.items as INdiGridData[];\n }\n if (items?.length === 0) {\n this.statisticStore.setStatisticData([], ApStatsType.FieldsNdiStats, '', '');\n return;\n }\n // apply grid's current sort descriptor on our statistic items to have the same sort as user\n items = orderBy(items, this.dynComponent.dynGrid.gridPaging.getDescriptors().sort);\n const statisticData: IFieldsNdiStatsData[] = items.map(item => {\n return {\n FieldId: item.Id,\n FieldName: item.Name,\n AreaHa: item.Area,\n Cells: item.SatelliteNValues?.Cells,\n NIndexMin: item.SatelliteNValues?.NIndexMin,\n NIndexMax: item.SatelliteNValues?.NIndexMax,\n NIndexAvg: item.SatelliteNValues?.NIndexAvg,\n NIndexHistogram: item.SatelliteNValues?.NIndexHistogram,\n NUptakeMin: item.SatelliteNValues?.NUptakeMin,\n NUptakeMax: item.SatelliteNValues?.NUptakeMax,\n NUptakeAvg: item.SatelliteNValues?.NUptakeAvg,\n NUptakeHistogram: item.SatelliteNValues?.NUptakeHistogram,\n } as IFieldsNdiStatsData;\n });\n // generate each diagram/chart and add to statistics\n const title = this._getTitleForStatistic(items);\n this.statisticStore.setStatisticData(statisticData, ApStatsType.FieldsNdiStats, title, '');\n }\n\n private _getTitleForStatistic(selectedItems: INdiGridData[]): string {\n const totalItems = this.dynComponent.items as INdiGridData[];\n const dataForTitles = totalItems.map(x => ({\n AreaHa: x.Area,\n Selected: selectedItems.some(z => z.Id === x.Id)\n }));\n return this.statisticService.generateFieldsAreaTitle(dataForTitles);\n }\n\n /**\n * Updates layer visibility depending on current state of the component\n * @private\n */\n private updateLayerVisibility(): void {\n this.mapStore.Layers.NUptakeLayer.Visibility = (this._halfViewMode$.getValue() === NdiActiveView.NUptake);\n this.mapStore.Layers.NdiLayer.Visibility = (this._halfViewMode$.getValue() === NdiActiveView.NIndex);\n }\n}\n","import {AfterViewInit, Component} from '@angular/core';\nimport {MapViewStore} from '../../stores/layout/mapview.store';\n\n@Component({\n selector: 'ap-elevation',\n template: `\n \n \n \n
\n \n
\n `\n})\n\nexport class ApElevationComponent implements AfterViewInit {\n constructor(private mapViewStore: MapViewStore) {\n }\n\n ngAfterViewInit(): void {\n\n }\n}\n","import {AfterViewInit, Component} from '@angular/core';\nimport {MapViewStore} from '../../stores/layout/mapview.store';\n\n@Component({\n selector: 'ap-soil-scan',\n template: `\n \n \n \n
\n \n
\n `\n})\n\nexport class ApSoilScanComponent implements AfterViewInit {\n constructor(private mapViewStore: MapViewStore) {\n }\n\n ngAfterViewInit(): void {\n\n }\n}\n","import {Injectable} from '@angular/core';\nimport {\n ApDynGridStatusColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-status-column-config';\nimport {nameOf} from '../../../ap-core/utils/ap-name-of';\nimport {MonitoringChildGridItem, MonitoringGridItem} from '../../types/monitoring.types';\nimport {\n ApDynGridPropertyColumnConfig,\n FilterType,\n PropertyTemplate\n} from '../../../ap-dyngrids/config/ap-dyn-grid-property-column-config';\nimport {\n ApDynGridEditColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-edit-column-config';\nimport {GetRoundNumericPipe} from '../../../ap-utils';\nimport {\n DropDownButtonData\n} from '../../../ap-dyngrids/config/ap-dyn-grid-button-column-config';\nimport {\n ApDynGridColumnConfigBase,\n ApDynGridColumnHideConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApDynGridDetailsGridConfig\n} from '../../../ap-dyngrids/config/details/ap-dyn-grid-details-grid-config';\nimport {\n ApDynGridPagerConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {\n MonitoringFieldGridItem\n} from '../../../entry-components/ap-field-management-entry-components/ap-monitoring-field/monitoring-field-entry.types';\nimport {map} from 'rxjs/operators';\nimport {MapViewMode} from '../../../ap-interface';\nimport {MapViewStore} from '../../../stores/layout/mapview.store';\nimport {\n GetRoundNumericPipeConfig\n} from '../../../ap-utils/pipes/configs/get-round-numeric.pipe.config';\nimport ISettings = Data.BaseData.ISettings;\nimport ILanguage = Data.Language.ILanguage;\n\n@Injectable()\nexport class MonitoringConfig {\n constructor(private mapViewStore: MapViewStore,\n private roundNumericPipe: GetRoundNumericPipe) {\n }\n\n /**\n * Configures main grid columns with monitoring filed information and actions.\n * @param burgerMenuButtons Array of menu button configurations.\n * @param setting Application settings for decimals definition.\n * @param language Language for date format definition.\n * @returns Array of column configurations.\n */\n public getMainGridColumns(burgerMenuButtons: DropDownButtonData[], setting: ISettings, language: ILanguage): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridStatusColumnConfig({\n field: nameOf('Status'),\n class: nameOf('StatusClass'),\n description: nameOf('StatusDesc'),\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__NumberAbbr',\n field: nameOf('FieldNumber'),\n hide: true,\n width: 40,\n cssClass: 'right',\n filterable: true,\n filterType: FilterType.NUMBER,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldPartShort',\n field: nameOf('FieldSecondNumber'),\n hide: true,\n width: 40,\n cssClass: 'right',\n filterable: true,\n filterType: FilterType.NUMBER,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Number',\n field: nameOf('FieldCombinedNumber'),\n width: 70,\n hide: new ApDynGridColumnHideConfig({\n selfHide: this.mapViewStore.Listen(s => s.mode).pipe(\n map((mode) => mode === MapViewMode.HIDE)\n )\n }),\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldName',\n field: nameOf('FieldName'),\n cssClass: 'left',\n width: 120,\n sortIndex: 0,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Crop',\n field: nameOf('CropName'),\n width: 100,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'ECStageShort',\n field: nameOf('EcValue'),\n width: 40,\n cssClass: 'right',\n template: PropertyTemplate.NUMBER,\n filterable: true,\n filterType: FilterType.NUMBER,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Area',\n field: nameOf('Area'),\n width: 40,\n cssClass: 'right',\n hide: true,\n template: PropertyTemplate.NUMBER,\n tooltip: (dataItem: MonitoringGridItem) => dataItem?.Area?.toString(),\n filterable: true,\n filterType: FilterType.NUMBER,\n headerFilterable: true,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [setting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'LastMeasurementDate',\n field: nameOf('LatestMeasurementDate'),\n width: 80,\n hide: true,\n format: language.DateFormat,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'LastNApplicationDate',\n field: nameOf('LatestNApplicationDate'),\n width: 80,\n hide: true,\n format: language.DateFormat,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'LastPpApplicationDate',\n field: nameOf('LatestPpApplicationDate'),\n width: 80,\n hide: true,\n format: language.DateFormat,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridEditColumnConfig({\n data: burgerMenuButtons\n })\n ];\n }\n\n /**\n * Configures detail grid columns for monitoring details information.\n * @param burgerMenuButtons Array of menu button configurations.\n * @param setting Application settings for decimals definition.\n * @param language Language for date format definition.\n * @returns Detail grid configuration with columns.\n * @public\n */\n public getDetailsGridColumns(burgerMenuButtons: DropDownButtonData[], setting: ISettings, language: ILanguage): ApDynGridDetailsGridConfig {\n return new ApDynGridDetailsGridConfig({\n field: 'Details',\n checkboxDisabled: true,\n hide: (dataItem: MonitoringGridItem) => dataItem.Details.length <= 0,\n columns: [\n new ApDynGridStatusColumnConfig({\n field: nameOf('Status'),\n class: nameOf('StatusClass'),\n description: nameOf('StatusDesc'),\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Date',\n field: nameOf('Date'),\n width: 80,\n format: language.DateFormat,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global_Type',\n field: nameOf('TypeName'),\n width: 80,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'ECStageShort',\n field: nameOf('EcValue'),\n width: 40,\n cssClass: 'right',\n template: PropertyTemplate.NUMBER,\n filterable: true,\n filterType: FilterType.NUMBER,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'NMonitoring__MeasuredValue',\n field: nameOf('Value'),\n width: 60,\n cssClass: 'right',\n filterable: true,\n filterType: FilterType.DATE,\n headerFilterable: true,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [setting.DigitsAfterDecimalPoint, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients__Recommendation',\n field: nameOf('Recommendation'),\n width: 60,\n cssClass: 'right',\n format: language.DateFormat,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [setting.DigitsAfterDecimalPoint, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Note',\n field: nameOf('Notes'),\n width: 80,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'FilesCount',\n field: nameOf('FilesCount'),\n width: 40,\n filterable: true,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [0, GetRoundNumericPipeConfig.NullAndZeroToEmptyReplaceConfig]\n }]\n }),\n new ApDynGridEditColumnConfig({\n data: burgerMenuButtons\n })\n ]\n });\n }\n\n /**\n * Creates basic pager configuration.\n * @returns Default grid pager configuration\n * @public\n */\n public getPager(): any {\n return new ApDynGridPagerConfig();\n }\n}\n","import {Route, RouterModule} from '@angular/router';\nimport {PageMode} from '../ap-interface';\nimport {NgModule} from '@angular/core';\nimport {FieldOverviewComponent} from './components/field-overview.component';\nimport {ApPageNotFoundComponent} from '../layout/components/ap-page-not-found.component';\nimport {ApPermissionGuard} from '../guards/ap-permission-guard.service';\nimport {ApCropRotationComponent} from './components/ap-crop-rotation/ap-crop-rotation.component';\nimport {ApDeactivateGuard} from '../guards/ap-deactivate.guard';\nimport {ApSamplefieldsComponent} from './components/ap-samplefields/ap-samplefields.component';\nimport {NdiComponent} from './components/ndi/ndi.component';\nimport {ApElevationComponent} from './components/ap-elevation.component';\nimport {ApSoilScanComponent} from './components/ap-soil-scan.component';\nimport {MonitoringComponent} from './components/ap-monitoring/monitoring.component';\n\nconst routes: Route[] = [\n {\n path: 'overview',\n component: FieldOverviewComponent,\n canActivate: [ApPermissionGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n },\n },\n {\n path: 'crop-rotation',\n component: ApCropRotationComponent,\n canActivate: [ApPermissionGuard],\n canDeactivate: [ApDeactivateGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n },\n },\n {\n path: 'takeover-fields',\n component: ApPageNotFoundComponent,\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n }\n },\n {\n path: 'soil-sample-fields',\n component: ApSamplefieldsComponent,\n canActivate: [ApPermissionGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n }\n },\n {\n path: 'conversion',\n component: ApPageNotFoundComponent,\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n }\n },\n {\n path: 'satellite',\n component: NdiComponent,\n canActivate: [ApPermissionGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n },\n },\n {\n path: 'elevation',\n component: ApElevationComponent,\n canActivate: [ApPermissionGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n },\n },\n {\n path: 'soil-scanner',\n component: ApSoilScanComponent,\n canActivate: [ApPermissionGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n }\n },\n {\n path: 'monitoring',\n component: MonitoringComponent,\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n }\n }\n];\n\n@NgModule({\n imports: [\n RouterModule.forChild(routes)\n ],\n exports: [RouterModule]\n})\nexport class ApFieldmanagementRoutes {\n}\n","import {AfterViewInit, Component, EventEmitter, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {\n ApDynComponentComponent\n} from '../../../ap-dyncomponent/ap-dyncomponent.component';\nimport {BehaviorSubject, combineLatest, Observable, of, Subscription} from 'rxjs';\nimport {\n ApDynGridColumnConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApDynGridPagerConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {MonitoringChildGridItem, MonitoringGridItem, PlanBookApplicationDateObject} from '../../types/monitoring.types';\nimport {debounceTime, filter, map} from 'rxjs/operators';\nimport {\n MonitoringFieldStore\n} from '../../../stores/fields/monitoring-field.store';\nimport {\n MonitoringDetailStore\n} from '../../../stores/fields/monitoring-detail.store';\nimport {\n FieldStore\n} from '../../../stores/farm/field.store';\nimport {\n ApUtilService\n} from '../../../ap-utils/service/ap-util.service';\nimport {\n ApDynGridDetailsBaseConfig\n} from '../../../ap-dyngrids/config/details/ap-dyn-grid-details-base-config';\nimport {\n IGridStatus\n} from '../../../ap-interface/interfaces/ap-grid-status.interface';\nimport {\n SettingsStore\n} from '../../../stores/base-data/settings.store';\nimport {\n ApDateService,\n DateDiffType\n} from '../../../ap-core/services/ap-date-service';\nimport {\n ApColumnState\n} from '../../../ap-interface/enums/ap-column-state.enum';\nimport {\n ApGetCropService\n} from '../../../stores/services/ap-get-crop.service';\nimport {\n LoginStore\n} from '../../../stores/login/login.store';\nimport {\n FormStore\n} from '../../../stores/layout/form.store';\nimport {\n ApMonitoringFieldEntryComponent\n} from '../../../entry-components/ap-field-management-entry-components/ap-monitoring-field/ap-monitoring-field-entry.component';\nimport {\n CampaignYearStore\n} from '../../../stores/login/campaignyear.store';\nimport {\n MonitoringTypeStore\n} from '../../../stores/fields/monitoring-type.store';\nimport {\n ApMonitoringDetailEntryComponent\n} from '../../../entry-components/ap-field-management-entry-components/ap-monitoring-detail/ap-monitoring-detail-entry.component';\nimport {\n MonitoringDetailEntryComponentData\n} from '../../../entry-components/ap-field-management-entry-components/ap-monitoring-detail/monitoring-detail-entry.types';\nimport {\n ApStatsType,\n MapViewCurrentMenu,\n MapViewMode\n} from '../../../ap-interface';\nimport {\n MapViewStore\n} from '../../../stores/layout/mapview.store';\nimport {\n LanguageStore\n} from '../../../stores/translation/language.store';\nimport {\n DropDownButtonData\n} from '../../../ap-dyngrids/config/ap-dyn-grid-button-column-config';\nimport {MonitoringConfig} from './monitoring.config';\nimport {\n TranslationStore\n} from '../../../stores/translation/translation.store';\nimport {\n ModalDialogStore\n} from '../../../stores/dialog/modal.dialog.store';\nimport {\n ModalDialogButtonKeys,\n ModalDialogPresets\n} from '../../../stores/dialog/modal.dialog.presets';\nimport {\n PlantProtectionPlanBookStore\n} from '../../../stores/plant-protection/plant-protection-planbook.store';\nimport {\n NFertilizationStore\n} from '../../../stores/n-fertilization/n-fertilization.store';\nimport {\n NFertilizationService\n} from '../../../services/data/n-fertilization.service';\nimport {\n PlantProtectionService\n} from '../../../services/data/plant-protection.service';\nimport IGuid = System.IGuid;\nimport IMonitoringDetail = Data.Fields.IMonitoringDetail;\nimport IMonitoringType = Data.Fields.IMonitoringType;\nimport IField = Data.FieldManagement.IField;\nimport {StatisticStore} from '../../../stores/statistic/statistic.store';\nimport {ApTranslationService} from '../../../ap-utils/service/ap-translation.service';\nimport {StatisticService} from '../../../services/data/statistic.service';\nimport {CropGroupStore} from '../../../stores/base-data/crop.groups.store';\nimport {nameOf} from '../../../ap-core/utils/ap-name-of';\nimport {\n GenericChartConfig, GenericSeriesConfig, GenericSeriesData, GenericYAxisConfig\n} from '../../../statistics/components/charts/ap-generic-chart.types';\nimport {MapStore} from '../../../stores/map/map.store';\nimport {Point} from 'ts-tooling';\nimport Polygon from 'ol/geom/Polygon';\nimport {ApGuidUtil} from '../../../ap-utils';\nimport {IContentNRelatedPlanBook} from '../../../types/n-fertilization.types';\nimport {\n BasicFertilisationSummariesStore\n} from '../../../stores/taskmanagement/basic.fertilisation.summaries.store';\n\n@Component({\n selector: 'ap-monitoring',\n template: `\n \n \n `,\n styles: [],\n providers: [\n MonitoringConfig\n ]\n})\nexport class MonitoringComponent implements OnInit, AfterViewInit, OnDestroy {\n @ViewChild(ApDynComponentComponent, {static: false}) dynComponent: ApDynComponentComponent;\n public columns$: Observable = of([]);\n public detailsColumns$: Observable = of(undefined);\n public pager: ApDynGridPagerConfigBase = undefined;\n public loading$ = of(true);\n public items$ = new BehaviorSubject([]);\n\n private _statisticUpdateRequested = new EventEmitter();\n private _subscriptions: Subscription[] = [];\n\n constructor(public loginStore: LoginStore,\n private mapStore: MapStore,\n private formStore: FormStore,\n private fieldStore: FieldStore,\n private mapViewStore: MapViewStore,\n private settingsStore: SettingsStore,\n private languageStore: LanguageStore,\n private translationStore: TranslationStore,\n private modalDialogStore: ModalDialogStore,\n private campaignYearStore: CampaignYearStore,\n private nFertilizationStore: NFertilizationStore,\n private monitoringTypeStore: MonitoringTypeStore,\n private monitoringFieldStore: MonitoringFieldStore,\n private monitoringDetailStore: MonitoringDetailStore,\n private plantProtectionPlanBooksStore: PlantProtectionPlanBookStore,\n private dateService: ApDateService,\n private cropService: ApGetCropService,\n private nFertilizationService: NFertilizationService,\n private plantProtectionService: PlantProtectionService,\n private modalDialogPresets: ModalDialogPresets,\n private monitoringConfig: MonitoringConfig,\n private translationService: ApTranslationService,\n private statisticStore: StatisticStore,\n private cropGroupStore: CropGroupStore,\n private statisticService: StatisticService,\n private baseFertilizationSummaryStore: BasicFertilisationSummariesStore) {\n }\n\n public ngOnInit(): void {\n this._handleHalfMapAndGridView();\n this._setLoading();\n this._buildGrid();\n this._buildItems();\n }\n\n public ngAfterViewInit(): void {\n this._subscriptions.push(this.dynComponent.SelectedItems$.subscribe((items: MonitoringGridItem[]) => {\n this._handleSelectionChange(items);\n }));\n this._subscriptions.push(this.formStore.FormClose$.subscribe(() => {\n const selectedItems = this.dynComponent.getSelectedItems() as MonitoringGridItem[];\n setTimeout(() => this._handleSelectionChange(selectedItems), 1);\n }));\n this._subscriptions.push(this.campaignYearStore.SelectedCampaignYear$.subscribe(() => {\n setTimeout(() => {\n this.monitoringTypeStore.loadMonitoringTypes();\n this.monitoringFieldStore.loadMonitoringFields();\n this.monitoringDetailStore.loadMonitoringDetails();\n this.plantProtectionPlanBooksStore.loadPlanBooks();\n this.nFertilizationStore.LoadNFertilizationPlanningSummaries();\n this.nFertilizationStore.LoadLogfiles();\n }, 0);\n }));\n\n this._subscriptions.push(this._statisticUpdateRequested.pipe(\n debounceTime(100)).subscribe(_ => this._generateStats()));\n this._subscriptions.push(this.items$.subscribe(_ => this._statisticUpdateRequested.emit()));\n\n this._subscriptions.push(\n combineLatest([\n this.mapViewStore.Listen(s => s.mode),\n this.mapViewStore.Listen(s => s.currentMenu)\n ]).subscribe(([mapMode, mapMenu]) => {\n if (mapMode !== MapViewMode.HIDE && mapMenu === MapViewCurrentMenu.STATS) {\n this._statisticUpdateRequested.emit();\n }\n }\n ));\n }\n\n public ngOnDestroy(): void {\n this.statisticStore.removeStatisticData();\n this.fieldStore.changeSelectedField([]);\n this._subscriptions.forEach(x => x?.unsubscribe());\n }\n\n /**\n * Opens the monitoring field entry form for creating a new monitoring field.\n * Initializes form with null data to indicate new entry mode.\n * @public\n */\n public onCreate(): void {\n this.formStore.openForm({component: ApMonitoringFieldEntryComponent, data: null});\n }\n\n /**\n * Combines loading states from multiple stores.\n * @private\n */\n private _setLoading(): void {\n this.loading$ = combineLatest([\n this.fieldStore.Loading$,\n this.settingsStore.Loading$,\n this.languageStore.Loading$,\n this.campaignYearStore.Loading$,\n this.nFertilizationStore.Loading$,\n this.monitoringTypeStore.Loading$,\n this.monitoringFieldStore.Loading$,\n this.monitoringDetailStore.Loading$,\n this.plantProtectionPlanBooksStore.Loading$\n ]).pipe(\n map((loadings) => loadings.some(loaded => loaded))\n );\n }\n\n /**\n * Initializes grid components with columns and configuration.\n * Sets up two column sets:\n * - Main grid columns with create/delete actions;\n * - Details grid columns with edit/delete actions;\n * Sets up pager for grid.\n * Configures column settings based on language and application settings.\n * @private\n */\n private _buildGrid(): void {\n this.columns$ = combineLatest([\n this.settingsStore.FirstSetting$,\n this.languageStore.SelectedLanguage$\n ]).pipe(\n map(([setting, language]) => {\n const menuButtons: DropDownButtonData[] = [\n {\n text: 'NewMonitoringDetail',\n callback: ApUtilService.createEventEmitter(this._createMonitoringDetail.bind(this), this._subscriptions)\n },\n {\n text: 'Global__Delete',\n callback: ApUtilService.createEventEmitter(this._deleteMonitoringField.bind(this), this._subscriptions)\n }\n ];\n return this.monitoringConfig.getMainGridColumns(menuButtons, setting, language);\n })\n );\n this.detailsColumns$ = combineLatest([\n this.settingsStore.FirstSetting$,\n this.languageStore.SelectedLanguage$\n ]).pipe(\n map(([setting, language]) => {\n const burgerMenuButtons: DropDownButtonData[] = [\n {\n text: 'EditMonitoringDetail',\n callback: ApUtilService.createEventEmitter(this._editMonitoringDetail.bind(this), this._subscriptions)\n },\n {\n text: 'DeleteMonitoringDetail',\n callback: ApUtilService.createEventEmitter(this._deleteMonitoringDetail.bind(this), this._subscriptions)\n }\n ];\n return this.monitoringConfig.getDetailsGridColumns(burgerMenuButtons, setting, language);\n })\n );\n this.pager = this.monitoringConfig.getPager();\n }\n\n /**\n * Sets loading state for grid depending on loading state from stores.\n * Processes and combines monitoring data, plan books data with field to build grid items.\n * @private\n */\n private _buildItems(): void {\n this._subscriptions.push(\n combineLatest([\n this.fieldStore.Fields$,\n this.monitoringFieldStore.MonitoringFields$,\n this.monitoringDetailStore.MonitoringDetails$,\n this.monitoringTypeStore.MonitoringTypes$,\n this.nFertilizationStore.PlanBooks$,\n this.nFertilizationStore.Logfiles$,\n this.plantProtectionPlanBooksStore.PlanBooks$,\n this.monitoringDetailStore.Loading$,\n this.baseFertilizationSummaryStore.Summaries$\n ]).pipe(\n filter(([fields, monitoringFields, monitoringDetails, monitoringTypes, nPlanBooks, nLogFiles, ppPlanBooks, detailsLoading, baseFertSummaries]) => !!monitoringFields && !!monitoringDetails && !detailsLoading),\n map(([fields, monitoringFields, monitoringDetails, monitoringTypes, nPlanBooks, nLogFiles, ppPlanBooks, detailsLoading, baseFertSummaries]) => {\n return monitoringFields.map(monitoringField => {\n const field = fields.find(x => x.Id === monitoringField.FieldId);\n const fieldGeom = this.fieldStore.getCurrentFieldGeom(field);\n const mainCropDescription = this.cropService.parseMainCrop(field);\n const details = this._getDetailsForMonitoringField(monitoringField.Id, field, monitoringDetails, monitoringTypes);\n const latestDetailDate = this._getLatestDetail(details);\n const highestDetailEcValue = this._getHighestEcValueFromDetails(details);\n const gridStatus = this._getMonitoringFieldStatus(latestDetailDate);\n const baseFertPlanBooks = baseFertSummaries.map(x => x.BasicFertilisationPlanBooks).flat().filter(p => p.BookedAt);\n const nFertilizationApplications = this.nFertilizationService.getContentNRelatedPlanBooks(field, nPlanBooks, nLogFiles, baseFertPlanBooks);\n const planProtectionApplications = this.plantProtectionService.getPpApplications(field, ppPlanBooks);\n const latestNApplicationDate = this._getLatestApplicationDateForField(field, nFertilizationApplications);\n const latestPpApplicationDate = this._getLatestApplicationDateForField(field, planProtectionApplications);\n const item: MonitoringGridItem = {\n Id: monitoringField.Id,\n Status: gridStatus.state,\n StatusClass: gridStatus.class,\n StatusDesc: gridStatus.description,\n FieldId: field?.Id,\n FieldName: field?.FieldName,\n FieldNumber: field?.FieldNumber,\n FieldDefaultGeom: field?.DefaultGeom,\n FieldSecondNumber: field?.FieldSubnumber,\n FieldCombinedNumber: this.fieldStore.getFieldNumberAndSubNumber(field),\n CropName: mainCropDescription,\n EcValue: highestDetailEcValue,\n Area: fieldGeom?.AreaHa,\n LatestMeasurementDate: latestDetailDate,\n LatestNApplicationDate: latestNApplicationDate,\n LatestPpApplicationDate: latestPpApplicationDate,\n Details: details,\n ContentNRelatedPlanBooks: nFertilizationApplications\n };\n return item;\n });\n })\n ).subscribe(items => {\n this.items$.next(items);\n this.displayDetailsPositions();\n })\n );\n }\n\n public displayDetailsPositions(): void {\n this.mapStore.Layers.GeoPointsLayer.deleteAllPoints();\n this.mapStore.Layers.GeoPointsLayer.Visibility = true;\n this.items$.value.forEach(item => {\n item.Details?.forEach((detail) => {\n if (detail.Position) {\n this.mapStore.Layers.GeoPointsLayer.addPoint(detail.Id, (detail.Position as unknown as Point).coordinates);\n }\n });\n });\n }\n\n /**\n * Maps monitoring details to child grid items for a specific monitoring field.\n * @param monitoringFieldId ID of the monitoring field.\n * @param field the corresponding field\n * @param monitoringDetails Array of all monitoring details.\n * @param monitoringTypes Array of all monitoring types.\n * @returns Array of child grid items.\n * @private\n */\n private _getDetailsForMonitoringField(monitoringFieldId: IGuid,\n field: IField,\n monitoringDetails: IMonitoringDetail[],\n monitoringTypes: IMonitoringType[]): MonitoringChildGridItem[] {\n const fieldMonitoringDetails = monitoringDetails.filter(x => x.MonitoringFieldId === monitoringFieldId);\n return fieldMonitoringDetails.map(x => {\n const fieldName = this.fieldStore.getFieldNameById(field?.Id);\n const monitoringType = monitoringTypes.find(y => y.Id === x.TypeId);\n const detailItem: MonitoringChildGridItem = {\n Id: x.Id,\n MonitoringFieldId: monitoringFieldId,\n FieldName: fieldName,\n FieldId: field?.Id?.toString(),\n Status: ApColumnState.Green,\n StatusClass: 'ap-status-green',\n StatusDesc: '',\n TypeName: this.translationStore.FindTranslationForSelectedLanguage(monitoringType.TranslationKey),\n TypeId: monitoringType.Id,\n Type: monitoringType,\n Date: new Date(x.Date),\n Value: x?.Value,\n Recommendation: x?.Recommendation,\n EcValue: x.EcStage,\n Notes: x.Notes,\n Position: x.Position,\n FilesCount: x.Attachments?.length ?? 0\n };\n return detailItem;\n });\n }\n\n /**\n * Determines monitoring field status based on creation date.\n * Status colors:\n * - Green: ≤7 days old;\n * - Yellow: 8-14 days old;\n * - Red: >14 days old;\n * @param createdDate Date to evaluate.\n * @returns Grid status object with state and styling.\n * @private\n */\n private _getMonitoringFieldStatus(createdDate: Date | undefined): IGridStatus {\n const status: IGridStatus = {state: ApColumnState.Red, class: 'ap-status-red', description: ''};\n if (!createdDate) {\n return status;\n }\n const dateTimeUtc = this.dateService.getUtc();\n const dateDiffInDays = this.dateService.getDateDiff(createdDate, dateTimeUtc, DateDiffType.Days);\n if (dateDiffInDays >= -7) {\n status.state = ApColumnState.Green;\n status.class = 'ap-status-green';\n status.description = 'Monitoring__status_green';\n } else if (dateDiffInDays >= -14) {\n status.state = ApColumnState.Yellow;\n status.class = 'ap-status-yellow';\n status.description = 'Monitoring__status_yellow';\n } else if (dateDiffInDays < -14) {\n status.state = ApColumnState.Red;\n status.class = 'ap-status-red';\n status.description = 'Monitoring__status_red';\n }\n return status;\n }\n\n /**\n * Finds highest EC value among monitoring details.\n * @param details Array of monitoring detail items.\n * @returns Highest EC value or undefined if no details.\n * @private\n */\n private _getHighestEcValueFromDetails(details: MonitoringChildGridItem[]): number | undefined {\n if (details.length <= 0) {\n return undefined;\n }\n const highestEcValueObject = details.reduce((max, detail) => {\n return detail.EcValue > max.EcValue ? detail : max;\n });\n return highestEcValueObject.EcValue;\n }\n\n /**\n * Retrieves date of most recent monitoring detail.\n * @param details Array of monitoring detail items.\n * @returns Most recent date or undefined if no details.\n * @private\n */\n private _getLatestDetail(details: MonitoringChildGridItem[]): Date | undefined {\n const sortedDetailsByDate = details.sort((a, b) => b.Date.getTime() - a.Date.getTime());\n return sortedDetailsByDate[0]?.Date;\n }\n\n /**\n * Gets the latest application date for a specific field\n * @param field - Target field\n * @param planBooks - Array of plan book application dates\n * @returns Latest application date or undefined if no dates exist\n * @private\n */\n private _getLatestApplicationDateForField(field: IField | undefined,\n planBooks: PlanBookApplicationDateObject[]): Date | undefined {\n if (!field?.Id || !planBooks || planBooks.length === 0) {\n return undefined;\n }\n const planBooksForCurrentField = planBooks.filter(pb => pb.FieldId === field.Id && !!pb.ApplicationDate);\n return new Date(Math.max(...planBooksForCurrentField.map(planBook => new Date(planBook.ApplicationDate).getTime())));\n }\n\n /**\n * Manages the map and grid view state:\n * 1. Clears selected fields;\n * 2. Ensures proper map view mode;\n * 3. Adjusts zoom to show all farm fields;\n * @private\n */\n private _handleHalfMapAndGridView(): void {\n this.fieldStore.changeSelectedField([]);\n if (this.mapViewStore.getMapViewMode() !== MapViewMode.NORMAL) {\n this.mapViewStore.goIntoMapMenu();\n }\n if (this.mapViewStore.getMapViewCurrentMenu() !== MapViewCurrentMenu.MAP) {\n this.mapViewStore.goIntoMapMenu();\n }\n this.fieldStore.zoomFarmFields();\n }\n\n /**\n * Updates field selection based on grid item selection.\n * Zooms to farm fields if no items selected.\n * @param itemsToSelect Selected monitoring grid items\n * @private\n */\n private _handleSelectionChange(itemsToSelect: MonitoringGridItem[]): void {\n const selectedFieldIds = itemsToSelect.filter(x => !!x.FieldId).map(x => x.FieldId.toString());\n this.fieldStore.changeSelectedField(selectedFieldIds);\n if (selectedFieldIds.length <= 0) {\n this.fieldStore.zoomFarmFields();\n }\n this._statisticUpdateRequested.emit();\n }\n\n /**\n * Deletes a monitoring field with confirmation for existing details\n * @param dataItem - Grid item containing monitoring field data\n * Shows confirmation dialog if monitoring details exist\n * Directly deletes if no details are associated\n * @private\n */\n private _deleteMonitoringField(dataItem: MonitoringGridItem): void {\n if (!dataItem?.Id) {\n return;\n }\n const monitoringDetails = this.monitoringDetailStore.MonitoringDetails.filter(x => x.MonitoringFieldId === dataItem.Id);\n if (monitoringDetails.length > 0) {\n this.modalDialogStore.setModalDialogData(this.modalDialogPresets.DeleteDialog({\n message: 'DeleteMonitoringWithMonitoringDetails',\n resultDelegate: (dialogData, _) => {\n if (dialogData?.key === ModalDialogButtonKeys.Delete) {\n this.monitoringFieldStore.deleteMonitoringField(dataItem.Id);\n }\n }\n }));\n } else {\n this.monitoringFieldStore.deleteMonitoringField(dataItem.Id);\n }\n }\n\n /**\n * Opens form to create new monitoring detail.\n * @param dataItem Grid item for parent monitoring field\n * @private\n */\n private _createMonitoringDetail(dataItem: MonitoringGridItem): void {\n if (!dataItem?.Id) {\n return;\n }\n\n const fieldPolygon: Polygon = this.mapStore.Layers.FieldsLayer.layer.getSource().getFeatureById(dataItem.FieldDefaultGeom.Id.toString()).getGeometry() as Polygon;\n this.mapStore.Layers.GeoPointsLayer.addPoint('NEW', fieldPolygon.getCoordinates()[0][0], true, false);\n const data: MonitoringDetailEntryComponentData = {\n MonitoringDetailId: undefined,\n MonitoringFieldId: dataItem.Id\n };\n this.formStore.openForm({component: ApMonitoringDetailEntryComponent, data});\n }\n\n /**\n * Opens form to edit existing monitoring detail.\n * @param dataItem Child grid item containing detail to edit\n * @private\n */\n private _editMonitoringDetail(dataItem: MonitoringChildGridItem): void {\n if (!dataItem?.Id || !dataItem?.MonitoringFieldId) {\n return;\n }\n\n this.dynComponent.dynGrid.gridPaging.setSelectedKeys([dataItem.MonitoringFieldId]);\n\n this.mapStore.Layers.GeoPointsLayer.addPoint(dataItem.Id, (dataItem.Position as unknown as Point).coordinates, true);\n const data: MonitoringDetailEntryComponentData = {\n MonitoringDetailId: dataItem.Id,\n MonitoringFieldId: dataItem.MonitoringFieldId\n };\n this.formStore.openForm({component: ApMonitoringDetailEntryComponent, data});\n }\n\n /**\n * Deletes a monitoring detail with confirmation for last detail\n * @param dataItem - Child grid item containing detail data\n * Shows confirmation dialog if deleting last detail of monitoring field\n * Directly deletes if other details exist\n * @private\n */\n private _deleteMonitoringDetail(dataItem: MonitoringChildGridItem): void {\n if (!dataItem?.Id) {\n return;\n }\n const monitoringDetails = this.monitoringDetailStore.MonitoringDetails.filter(x => x.MonitoringFieldId === dataItem.MonitoringFieldId);\n if (monitoringDetails.length === 1) {\n this.modalDialogStore.setModalDialogData(this.modalDialogPresets.DeleteDialog({\n message: 'DeleteLastMonitoringDetailWithMonitoringField',\n resultDelegate: (dialogData, _) => {\n if (dialogData?.key === ModalDialogButtonKeys.Delete) {\n this.monitoringDetailStore.deleteMonitoringDetail(dataItem.Id);\n }\n }\n }));\n } else {\n this.monitoringDetailStore.deleteMonitoringDetail(dataItem.Id);\n }\n }\n\n /**\n * Generates the statistic charts for the selected monitorings.\n * There is one chart per monitoring type.\n * Each chart contains a data series (line, points or columns) for each monitoring field.\n * All charts have the same date range (same min/max date)\n * @private\n */\n private _generateStats(): void {\n if (this.mapViewStore.getMapViewCurrentMenu() !== MapViewCurrentMenu.STATS || this.mapViewStore.getMapViewMode() === MapViewMode.HIDE) {\n return;\n }\n const emptyTitle = `${this.translationService.translate('Nutrients__StatisticsTitle')}\\n${this.translationService.translate('Monitoring')}`;\n let items = this.dynComponent.getSelectedItems() as MonitoringGridItem[];\n if (!items || items?.length === 0) {\n items = this.dynComponent.items as MonitoringGridItem[];\n }\n if (!items || items?.length === 0) {\n this.statisticStore.setStatisticData(\n [], ApStatsType.GenericBars, emptyTitle, emptyTitle\n );\n return;\n }\n\n const chartConfigs: GenericChartConfig[] = [];\n // collect all monitoring details and group them and exclude details with not unit\n const monitoringDetails = items.map(item => item.Details).flat().FindAll(d => d.Type?.ValueUnit != null);\n const monitoringDates = monitoringDetails.map(d => d.Date.valueOf());\n let minDate = this.dateService.getDateMidnight(new Date(monitoringDates.Min()));\n let maxDate = this.dateService.getEndOfDayDate(new Date(monitoringDates.Max()));\n let statRelatedNApplications: IContentNRelatedPlanBook[] = [];\n // in case of any n_tester or nitrate check monitoring we want to load\n // booked n-applications as well and add them to the statistics.\n // in case we found n-applications the date-range might need to be extended as well\n if (monitoringDetails.Any(d => d.Type?.TranslationKey === 'N_TESTER' || d.Type?.TranslationKey === 'NITRATE_CHECK')) {\n statRelatedNApplications = this._findStatRelatedNApplications(items, minDate);\n if (statRelatedNApplications && statRelatedNApplications.length > 0) {\n const foundNApplicationDates = statRelatedNApplications.map(p => p.PlanBookApplicationDate.valueOf());\n const minDateApplications = this.dateService.getDateMidnight(new Date(foundNApplicationDates.Min()));\n const maxDateApplications = this.dateService.getEndOfDayDate(new Date(foundNApplicationDates.Max()));\n if (minDateApplications < minDate) {\n minDate = minDateApplications;\n }\n if (maxDateApplications > maxDate) {\n maxDate = maxDateApplications;\n }\n }\n }\n\n // let's group all monitoring details by monitoring type to assign those details to the same chart\n const monitoringDetailsByType = monitoringDetails.GroupBy(detail => detail.TypeId);\n for (const monitoringTypeId of Object.keys(monitoringDetailsByType)) {\n const monitoringType = this.monitoringTypeStore.MonitoringTypes.FirstOrDefault(m => m.Id?.toString() === monitoringTypeId);\n // skip monitoring types without units (e.g. diseases => makes no sense to have that in the statistic\n if (!monitoringType?.ValueUnit) {\n continue;\n }\n const details = monitoringDetailsByType[monitoringTypeId];\n const chartConfig = this._generateStatChartConfig(details, monitoringType, minDate, maxDate);\n chartConfig.noteField = nameOf('yValue');\n this._generateAppliedNSeries(monitoringType, details, statRelatedNApplications, chartConfig);\n chartConfigs.push(chartConfig);\n }\n this.statisticStore.setStatisticData(\n chartConfigs, ApStatsType.GenericChart, this._getTitleForStatistic(items), emptyTitle\n );\n }\n\n /**\n * Generates a chartConfig and series data for a monitoring type\n * @param monitoringDetailsByType the selected items\n * @param monitoringType the monitoring type of the chart to be generated\n * @param minDate the common (over all charts) minDate of category axis (x-axis)\n * @param maxDate the common (over all charts) maxDate of category axis (x-axis)\n * @private\n */\n private _generateStatChartConfig(monitoringDetailsByType: MonitoringChildGridItem[], monitoringType: IMonitoringType, minDate: Date, maxDate: Date): GenericChartConfig {\n // setup basic chart configuration and its axes\n const chartConfig = new GenericChartConfig();\n chartConfig.title = monitoringType?.TranslationKey;\n chartConfig.xAxisConfig.min = minDate?.valueOf();\n chartConfig.xAxisConfig.max = maxDate?.valueOf();\n chartConfig.xAxisConfig.labelDelegate = (xAxisValue: string, dataItem: GenericSeriesData, _: GenericChartConfig) => {\n return dataItem != null ? xAxisValue : '';\n };\n chartConfig.pannable = false;\n chartConfig.zoomable = false;\n chartConfig.xAxisConfig.type = 'date';\n chartConfig.xAxisConfig.baseUnit = 'days';\n chartConfig.axisCrossingValue = [Number.MIN_VALUE, Number.MAX_VALUE];\n // configuring yAxis (value axis). Here we have the chance to add multiple yAxis and assign the series data to\n // an individual axis by setting the 'axisId' property\n const yAxisConfig = new GenericYAxisConfig();\n yAxisConfig.title = this.translationService.translate(monitoringType?.ValueUnit?.Key);\n chartConfig.yAxisConfigs.push(yAxisConfig);\n\n // now let's iterate over our monitoring details (details of the given monitoring type).\n // building the series data per monitoring field\n const monitoringDetailsByField = monitoringDetailsByType.GroupBy(detail => detail.MonitoringFieldId);\n for (const monitoringFieldId of Object.keys(monitoringDetailsByField)) {\n const detailsByField = monitoringDetailsByField[monitoringFieldId];\n const fieldId = detailsByField.FirstOrDefault()?.FieldId;\n const seriesConfig = new GenericSeriesConfig();\n seriesConfig.id = fieldId?.toString();\n seriesConfig.type = monitoringType?.TranslationKey === 'PRECIPITATION' ? 'column' : 'line';\n seriesConfig.name = this.fieldStore.getFieldNameById(fieldId);\n seriesConfig.color = this._calculateSeriesColor(monitoringFieldId);\n for (const detail of detailsByField) {\n const seriesData = new GenericSeriesData();\n seriesData.xValue = detail.Date.valueOf();\n seriesData.yValue = detail.Value;\n seriesConfig.seriesData.push(seriesData);\n }\n chartConfig.seriesConfigs.push(seriesConfig);\n }\n return chartConfig;\n }\n\n /**\n * Generates column-statistics for the average applied N per field and per date.\n * This statistic is based on all booked N and base fertilizations (with n-content)\n * @param monitoringType he monitoring type of the chart to be generated\n * @param details the monitoring details for the currently processed chart/statistic (filtered by monitoring type)\n * @param statNApplications contentN related planBooks\n * @param chartConfig the current chart config\n * @private\n */\n private _generateAppliedNSeries(monitoringType: Data.Fields.IMonitoringType, details: MonitoringChildGridItem[], statNApplications: IContentNRelatedPlanBook[], chartConfig: GenericChartConfig): void {\n if (monitoringType?.TranslationKey !== 'N_TESTER' && monitoringType?.TranslationKey !== 'NITRATE_CHECK' || !statNApplications || statNApplications?.length === 0) {\n return;\n }\n // let's add applied n statistics only for fields which are part of the currently processed monitoring details\n const fieldIds = details.map(d => d.FieldId?.toString());\n const yAxisNApplicationConfig = new GenericYAxisConfig();\n yAxisNApplicationConfig.title = this.translationService.translate('N__ChartTitleY');\n yAxisNApplicationConfig.id = ApGuidUtil.generateNewGuid();\n yAxisNApplicationConfig.min = 0;\n const nApplicationsByField = statNApplications.GroupBy(p => p.FieldId);\n for (const fieldId of Object.keys(nApplicationsByField)) {\n if (!fieldIds.Any(id => id?.toString() === fieldId?.toString())) {\n continue;\n }\n // use color and name from the original monitoring series\n const relatedMonitoringSeries = chartConfig.seriesConfigs.FirstOrDefault(s => s.id === fieldId);\n const nApplicationsForField = nApplicationsByField[fieldId];\n const seriesConfigNApplication = new GenericSeriesConfig();\n seriesConfigNApplication.type = 'column';\n seriesConfigNApplication.axisId = yAxisNApplicationConfig.id;\n seriesConfigNApplication.name = relatedMonitoringSeries?.name;\n seriesConfigNApplication.color = relatedMonitoringSeries?.color;\n seriesConfigNApplication.hideLegend = true; // to avoid duplicate legend items (same legend item coming from monitoring statistics)\n\n // Group n applications by date (same like monitoring statistic)\n const nApplicationsByDate = nApplicationsForField.GroupBy(p => p.PlanBookApplicationDate.valueOf());\n for (const nApplicationDate of Object.keys(nApplicationsByDate)) {\n const nApplications = nApplicationsByDate[nApplicationDate];\n if (!nApplications || nApplications.length === 0) {\n continue;\n }\n const appliedN = nApplications.map(n => n.NFertilization?.Average);\n const avgAppliedN = appliedN.length > 0 ? appliedN.reduce((a, b) => a + b) : 0;\n const seriesData = new GenericSeriesData();\n seriesData.xValue = +nApplicationDate;\n seriesData.yValue = Math.round(avgAppliedN);\n seriesConfigNApplication.seriesData.push(seriesData);\n }\n chartConfig.seriesConfigs.push(seriesConfigNApplication);\n }\n chartConfig.yAxisConfigs.push(yAxisNApplicationConfig);\n }\n\n /**\n * Finds all booked content-n related planbooks (N and base fertilization)\n * for a specific period of time.\n * @param items the selected (or all) grid items\n * @param minDateMonitoring the oldest monitoring date within the user's selection\n * @private\n */\n private _findStatRelatedNApplications(items: MonitoringGridItem[], minDateMonitoring: Date): IContentNRelatedPlanBook[] {\n const fieldIdsRelevantForNApplications = items?.FindAll(i =>\n i.Details?.Any(d => d.Type?.TranslationKey === 'N_TESTER' || d.Type?.TranslationKey === 'NITRATE_CHECK')).map(i => i.FieldId);\n const campaignYearStart = new Date(this.campaignYearStore.SelectedCampaignYear.DefaultStart);\n const newYear = new Date(campaignYearStart.getFullYear(), 11, 31, 23, 59, 59);\n // let's find booked n plannings based on the date of the oldest monitoring\n // - if monitoring took place in the first half of the campaignYear => start searching from 01.08.\n // - otherwise start searching for planbooks from 01.01\n const minDatePlanBookFilter = (minDateMonitoring > campaignYearStart && minDateMonitoring < newYear) ? campaignYearStart : newYear;\n return items.map(item => item.ContentNRelatedPlanBooks).flat()\n .FindAll(p => p.BookedAt != null &&\n p.PlanBookApplicationDate > minDatePlanBookFilter &&\n fieldIdsRelevantForNApplications.Any(id => id?.toString() === p.FieldId?.toString()));\n }\n\n /**\n * Generates the statistics title\n * @param selectedItems selected grid items\n * @private\n */\n private _getTitleForStatistic(selectedItems: MonitoringGridItem[]): string {\n const totalItems = this.dynComponent.items as MonitoringGridItem[];\n const dataForTitles = totalItems.map(x => ({\n AreaHa: x.Area,\n Selected: selectedItems.some(z => z.Id === x.Id)\n }));\n return this.statisticService.generateFieldsAreaTitle(dataForTitles);\n }\n\n /**\n * Calculates the chart series color.\n * The idea is to have the same color in each chart for data series of the same field.\n * Here we are using the cropGroup colors as source colors and cycle through them\n * to assign them to those monitoring fields. If there are more monitoring fields\n * than available colors it is accepted behaviour to have duplicated colors in the charts.\n * @param monitoringFieldId\n * @private\n */\n private _calculateSeriesColor(monitoringFieldId: string): string {\n // as per definition we are using our cropGroup colors here\n // each monitoring field should have the same color in each chart\n const colors = this.cropGroupStore.getCropGroups().map(c => c.Colordefault);\n const monitoringFields = this.dynComponent.items as MonitoringGridItem[];\n const monitoringFieldIndex = monitoringFields.FindIndex(f => f.Id?.toString() === monitoringFieldId);\n // cycle through the colors. Yes, the color is reused if the amount of fields exceeds the available colors\n return colors[monitoringFieldIndex % colors.length];\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {keys} from 'lodash';\nimport * as moment from 'moment';\nimport IField = Data.FieldManagement.IField;\n\n@Pipe({\n name: 'apCampaignyearCropConverter'\n})\nexport class ApCampaignyearCropConverterPipe implements PipeTransform {\n\n transform(fields: IField[], args?: any): any {\n let counter = 1;\n const selectedValues = {};\n for (const field of fields) {\n for (const crop of field.FieldCrops) {\n const key = moment(crop.ValidTo).year() + '_' + crop.Cropkey;\n if (!selectedValues[key]) {\n selectedValues[key] = {\n Id: counter++,\n main_second_crop_type: crop.MainSecondCropType,\n avg: 0,\n sum: 0,\n count: 0,\n cropkey: crop.Cropkey,\n };\n }\n selectedValues[key].count++;\n selectedValues[key].sum = fields.length;\n }\n for (const k of keys(selectedValues)) {\n selectedValues[k].avg = selectedValues[k].sum * selectedValues[k].count / 100;\n }\n }\n return selectedValues;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ApCropRotationGridComponent} from './components/ap-crop-rotation-grid.component';\nimport {ApTranslationModule} from '../translation/ap-translation.module';\nimport {ApCoreModule} from '../ap-core/ap-core.module';\nimport {ListComponent} from './components/list/list.component';\nimport {ApCropRotationHeaderComponent} from './components/header/ap-crop-rotation-header.component';\nimport {ApResponsiveTextModule} from '../ap-responsive-text/ap-responsive-text.module';\nimport {FindSortPipe} from './pipes/find-sort.pipe';\nimport {FindSortIndexPipe} from './pipes/find-sort-index.pipe';\nimport {PopupModule} from '@progress/kendo-angular-popup';\nimport {ComboBoxModule, MultiSelectModule} from '@progress/kendo-angular-dropdowns';\nimport {FormsModule} from '@angular/forms';\nimport {ButtonModule, ButtonsModule} from '@progress/kendo-angular-buttons';\nimport {HasChildrenPipe} from './pipes/has-children.pipe';\nimport {IdCreatorPipe} from './pipes/id-creator.pipe';\nimport {GetMappedChildrenPipe} from './pipes/get-mapped-children.pipe';\nimport {GetSavingStatePipe} from './pipes/get-saving-state.pipe';\nimport {ToCellValuePipe} from './pipes/to-cell-value.pipe';\nimport {InputsModule, SliderModule, TextBoxModule} from '@progress/kendo-angular-inputs';\nimport {SortComponent} from './components/header/sort/sort.component';\nimport {ApCropRotationFilterComponent} from './components/header/filter/ap-crop-rotation-filter.component';\nimport {DetailHeaderComponent} from './components/header/detail-header/detail-header.component';\nimport {DetailComponent} from './components/list/detail/detail.component';\nimport {DetailFullCellComponent} from './components/list/detail/detail-full-cell/detail-full-cell.component';\nimport {DetailCellComponent} from './components/list/detail/detail-cell/detail-cell.component';\nimport {AllCropsPipe} from './pipes/all-crops.pipe';\nimport {ApUtilsModule} from '../ap-utils';\nimport {PagerComponent} from './components/pager.component';\nimport {CropShortnamePipe} from './pipes/crop-shortname.pipe';\nimport {DetailOffCellComponent} from './components/list/detail/detail-off-cell/detail-off-cell.component';\nimport {FieldIsActivePipe} from './pipes/field-is-active.pipe';\nimport {ApDynGridsModule} from '../ap-dyngrids/ap-dyngrids.module';\nimport {ApTooltipModule} from '../ap-tooltip/ap-tooltip.module';\n\n@NgModule({\n declarations: [\n // Components\n ApCropRotationGridComponent,\n ListComponent,\n ApCropRotationHeaderComponent,\n SortComponent,\n ApCropRotationFilterComponent,\n DetailHeaderComponent,\n DetailComponent,\n DetailFullCellComponent,\n DetailCellComponent,\n // Pipes\n FindSortPipe,\n FindSortIndexPipe,\n HasChildrenPipe,\n IdCreatorPipe,\n GetMappedChildrenPipe,\n GetSavingStatePipe,\n ToCellValuePipe,\n AllCropsPipe,\n PagerComponent,\n CropShortnamePipe,\n DetailOffCellComponent,\n FieldIsActivePipe,\n ],\n imports: [\n CommonModule,\n ApTranslationModule,\n ApCoreModule,\n ApResponsiveTextModule,\n PopupModule,\n MultiSelectModule,\n InputsModule,\n FormsModule,\n ButtonModule,\n ComboBoxModule,\n TextBoxModule,\n ApUtilsModule,\n SliderModule,\n ButtonsModule,\n ApDynGridsModule,\n ApTooltipModule,\n ],\n providers: [],\n exports: [\n ApCropRotationHeaderComponent,\n ApCropRotationGridComponent,\n ]\n})\nexport class ApCropRotationModule {\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport {FieldStore} from '../../stores/farm/field.store';\nimport {TranslationStore} from '../../stores/translation/translation.store';\n\n@Pipe({\n name: 'apGetFieldNamePipe',\n})\nexport class ApGetFieldNamePipe implements PipeTransform {\n\n constructor(private fieldStore: FieldStore,\n private translationStore: TranslationStore) {\n }\n\n transform(id: string): string {\n const result = this.fieldStore.getFieldName(this.fieldStore.getFieldById(id));\n if (result === '-') {\n return this.translationStore.FindTranslationForSelectedLanguage('Global__UnknownFieldName');\n }\n return result;\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {\n FieldOverviewComponent\n} from './components/field-overview.component';\nimport {\n BodyModule,\n GridModule,\n HeaderModule,\n PagerContextService,\n PagerModule,\n SharedModule\n} from '@progress/kendo-angular-grid';\nimport {CommonModule} from '@angular/common';\nimport {\n ApTranslationModule\n} from '../translation/ap-translation.module';\nimport {\n ApCoreModule\n} from '../ap-core/ap-core.module';\nimport {\n ApIconModule\n} from '../icons/ap-icon.module';\nimport {\n ButtonModule,\n SplitButtonModule\n} from '@progress/kendo-angular-buttons';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n LayoutModule\n} from '@progress/kendo-angular-layout';\nimport {\n InputsModule\n} from '@progress/kendo-angular-inputs';\nimport {\n ComboBoxModule,\n DropDownsModule\n} from '@progress/kendo-angular-dropdowns';\nimport {\n DateInputsModule\n} from '@progress/kendo-angular-dateinputs';\nimport {\n ApFieldmanagementRoutes\n} from './ap-fieldmanagement.routes';\nimport {\n ApLayoutModule\n} from '../layout/ap-layout.module';\nimport {\n ApCampaignyearCropConverterPipe\n} from './pipes/ap-campaignyear-crop-converter.pipe';\nimport {ApUtilsModule} from '../ap-utils';\nimport {\n ApDynComponentModule\n} from '../ap-dyncomponent/ap-dyncomponent.module';\nimport {\n ApCropRotationComponent\n} from './components/ap-crop-rotation/ap-crop-rotation.component';\nimport {\n ApStatisticsModule\n} from '../statistics/ap-statistics.module';\nimport {\n ApResponsiveTextModule\n} from '../ap-responsive-text/ap-responsive-text.module';\nimport {\n ApSectionHeaderModule\n} from '../ap-section-header/ap-section-header.module';\nimport {\n ApCropRotationModule\n} from '../ap-crop-rotation/ap-crop-rotation.module';\nimport {\n ApPermissionModule\n} from '../ap-permission/ap-permission.module';\nimport {\n ApGetFieldNamePipe\n} from './pipes/ap-get-field-name.pipe';\nimport {\n ApSamplefieldsComponent\n} from './components/ap-samplefields/ap-samplefields.component';\nimport {\n NdiComponent\n} from './components/ndi/ndi.component';\nimport {\n ApElevationComponent\n} from './components/ap-elevation.component';\nimport {\n ApSoilScanComponent\n} from './components/ap-soil-scan.component';\nimport {\n MonitoringComponent\n} from './components/ap-monitoring/monitoring.component';\nimport {\n ApReportsModule\n} from '../ap-reports/ap-reports.module';\n\n@NgModule({\n declarations: [\n FieldOverviewComponent,\n ApCampaignyearCropConverterPipe,\n ApCropRotationComponent,\n ApGetFieldNamePipe,\n ApSamplefieldsComponent,\n NdiComponent,\n ApElevationComponent,\n ApSoilScanComponent,\n MonitoringComponent\n ],\n exports: [\n FieldOverviewComponent,\n ApCampaignyearCropConverterPipe,\n ApGetFieldNamePipe,\n ApSamplefieldsComponent,\n ApElevationComponent,\n ApSoilScanComponent,\n MonitoringComponent\n ],\n imports: [\n ReactiveFormsModule,\n CommonModule,\n ApCoreModule,\n ApIconModule,\n LayoutModule,\n ApStatisticsModule,\n ButtonModule,\n ApLayoutModule,\n SplitButtonModule,\n InputsModule,\n ComboBoxModule,\n DateInputsModule,\n DropDownsModule,\n FormsModule,\n GridModule,\n ApTranslationModule,\n ApFieldmanagementRoutes,\n SharedModule,\n BodyModule,\n ApUtilsModule,\n PagerModule,\n HeaderModule,\n ApSectionHeaderModule,\n ApResponsiveTextModule,\n ApDynComponentModule,\n ApCropRotationModule,\n ApPermissionModule,\n ApReportsModule,\n ],\n providers: [\n ApCampaignyearCropConverterPipe,\n ApGetFieldNamePipe,\n PagerContextService\n ]\n})\nexport class ApFieldManagementModule {\n}\n","import {Injectable} from '@angular/core';\nimport {CampaignYearStore} from '../../stores/login/campaignyear.store';\nimport ISoilSampleField = Data.Nutrients.ISoilSampleField;\n\n@Injectable({providedIn: 'root'})\nexport class ApSoilSampleService {\n constructor(private campaignYearStore: CampaignYearStore) {\n }\n\n public getFieldNumberAndSubNumber(soilSampleField: ISoilSampleField): string {\n if (soilSampleField.FieldNumber !== null) {\n if (soilSampleField.FieldPart !== null) {\n return `${soilSampleField.FieldNumber} - ${soilSampleField.FieldPart}`;\n } else {\n return `${soilSampleField.FieldNumber}`;\n }\n } else {\n if (soilSampleField.FieldPart !== null) {\n return ` - ${soilSampleField.FieldPart}`;\n } else {\n return '';\n }\n }\n }\n\n public getStatus(sampleDate: Date | string): number {\n if (!sampleDate) {\n return -1;\n }\n if (typeof sampleDate === typeof '') {\n sampleDate = new Date(sampleDate as string);\n }\n const difference = this.campaignYearStore.getSelectedCampaignYear().Year - this.getCampaignYear(sampleDate as Date);\n if (difference > 5) {\n return -1;\n } else if (difference > 3) {\n return 0;\n }\n return 1;\n }\n\n public getCampaignYear(sampleDate: Date): number {\n if (!sampleDate) {\n return undefined;\n }\n if (sampleDate.getMonth() > 5) {\n return sampleDate.getFullYear() + 1;\n }\n return sampleDate.getFullYear();\n }\n}\n","import {Injectable} from '@angular/core';\nimport {ApStatsType, IBarLineAreaChartData, IBarLineAreaChartDataValue} from '../../ap-interface';\nimport {Create} from 'ts-tooling';\nimport {ChartSetValueType, IChartSet, StatisticStore} from '../../stores/statistic/statistic.store';\nimport {\n TranslationStore\n} from '../../stores/translation/translation.store';\nimport {SettingsStore} from '../../stores/base-data/settings.store';\nimport {ApDateService} from '../../ap-core/services/ap-date-service';\nimport {LandUseStore} from '../../stores/base-data/landuse.store';\nimport {\n FieldNutrientDistributionStore\n} from '../../stores/nutrients/field-nutrient-distributions.store';\nimport {\n SoilGroupFormatService\n} from '../../ap-utils/service/soil-group-format.service';\nimport {\n GetSoilSampleClassColorService\n} from '../../ap-utils/service/get-soil-sample-class-color.service';\nimport {GetSoilSampleClassNamePipe} from '../../ap-utils';\nimport IGuid = System.IGuid;\nimport IHistogram = Data.Nutrients.IHistogram;\n\nexport interface IFieldStatisticHistogramData {\n Status: number;\n FieldId: IGuid;\n FieldName: string;\n AreaHa: number;\n Histograms: IHistogram[];\n}\n\n@Injectable({providedIn: 'root'})\nexport class FieldStatisticHistogramService {\n constructor(private settings: SettingsStore,\n private landUseStore: LandUseStore,\n private statisticStore: StatisticStore,\n private translationStore: TranslationStore,\n private fieldNutrientDistributionStore: FieldNutrientDistributionStore,\n private dateService: ApDateService,\n private soilGroupFormatService: SoilGroupFormatService,\n private soilSampleClassColorService: GetSoilSampleClassColorService,\n private soilSampleClassNamePipe: GetSoilSampleClassNamePipe) {\n }\n\n public generateHistogramStatistic(title: string, items: IFieldStatisticHistogramData[]): void {\n if (!items || items.length <= 0) {\n this.statisticStore.setStatisticData([], ApStatsType.Nutrients, '', title);\n return;\n }\n\n this.statisticStore.setStatisticData(this.getHistogramStatistic(items), ApStatsType.Nutrients, title, 'Nutrient__Select_SoilSampleField');\n }\n\n public getHistogramStatistic(items: IFieldStatisticHistogramData[]): IChartSet[] {\n if (!items || items.length <= 0) {\n return [];\n }\n\n const areaSum = items.Reduce((target, e) => Create(e.AreaHa, 0) + target, 0);\n return [\n ...this._createStatistic('Nutrient__Band_ClassP', ChartSetValueType.CLASS, areaSum, items),\n ...this._createStatistic('Nutrient__Band_ClassK', ChartSetValueType.CLASS, areaSum, items),\n ...this._createStatistic('Nutrient__Band_ClassMg', ChartSetValueType.CLASS, areaSum, items),\n ...this._createStatistic('Nutrient__Band_ClassPh', ChartSetValueType.CLASS, areaSum, items),\n ...this._createStatistic('Nutrient__Band_SoilPlanningYear', ChartSetValueType.DATE, areaSum, items),\n ...this._createStatistic('Nutrient__Band_SoilGroup', ChartSetValueType.SOIL_GROUP, areaSum, items),\n ...this._createStatistic('Nutrient__Band_Region', ChartSetValueType.REGION, areaSum, items),\n ...this._createStatistic('Nutrient__Band_TypeOfUse', ChartSetValueType.LANDUSE, areaSum, items),\n ...this._createStatistic('Nutrient__Band_MethodP', ChartSetValueType.METHOD, areaSum, items),\n ...this._createStatistic('Nutrient__Band_MethodK', ChartSetValueType.METHOD, areaSum, items),\n ...this._createStatistic('Nutrient__Band_MethodMg', ChartSetValueType.METHOD, areaSum, items),\n ...this._createStatistic('Nutrient__Band_MethodPh', ChartSetValueType.METHOD, areaSum, items),\n ];\n }\n\n private _createStatistic(name: string, type: ChartSetValueType, areaSum: number, selected: IFieldStatisticHistogramData[]): IChartSet[] {\n if (!selected || !selected.Any()) {\n return [];\n }\n let soilPlanningYears: { date: number, category: number }[] = [];\n let fieldSoilPlanningYears: { fieldId: IGuid, dates: { date: string, percent: number }[] }[] = [];\n if (type === ChartSetValueType.DATE) {\n soilPlanningYears = selected.Reduce((target, e) => {\n const hist = e.Histograms.Find(el => el.Key === name);\n if (!hist) {\n return target;\n }\n for (const val of hist.Values) {\n if (target.Any(el => el.category === e.Status && el.date === val)) {\n continue;\n }\n target.Add({category: e.Status, date: val});\n }\n return target;\n }, [] as { date: number, category: number }[]);\n fieldSoilPlanningYears = selected.Reduce((target, e) => {\n const hist = e.Histograms.Find(el => el.Key === name);\n if (!hist) {\n return target;\n }\n for (const key in hist.Values) {\n if (!hist.Values.hasOwnProperty(key)) {\n continue;\n }\n const year = hist.Values[key];\n const cells = hist.Counters[key];\n const dateName = this._mapDate(year);\n const found = target.FindIndex(t => t.fieldId === e.FieldId);\n if (found < 0) {\n target.Add({\n fieldId: e.FieldId,\n dates: [\n {\n date: dateName,\n percent: cells,\n },\n ],\n });\n continue;\n }\n if (!target[found].dates.Any(d => d.date === dateName)) {\n target[found].dates.Add({\n date: dateName,\n percent: cells,\n });\n }\n }\n return target;\n }, [] as { fieldId: IGuid, dates: { date: string, percent: number }[] }[]);\n for (const item of fieldSoilPlanningYears) {\n const allCells = item.dates.map(el => el.percent).Sum();\n for (const date of item.dates) {\n date.percent = date.percent * 100 / allCells;\n }\n }\n }\n let max = 0;\n if (type === ChartSetValueType.CLASS) {\n max = selected.Reduce((target, e) => {\n const counters = e.Histograms.Find(el => el.Key === name).Counters;\n for (const key in counters) {\n if (!counters.hasOwnProperty(key)) {\n continue;\n }\n if (counters[key] > 0 && counters.Sum() > 0) {\n const tmp = counters[key] / counters.Sum();\n target[key] += tmp * e.AreaHa;\n }\n }\n return target;\n }, new Array(selected[0].Histograms.Find(el => el.Key === name).Counters.length).fill(0))\n .Max();\n max = max + (20 * max / 100);\n }\n const res: IChartSet[] = [];\n for (const dis of selected) {\n const hist = dis.Histograms.Find(e => e.Key === name);\n if (!hist) {\n continue;\n }\n res.Add({\n valueType: type,\n axes: this.soilSampleClassColorService.getStatisticAxesConfig(type, undefined, max),\n step: 1,\n data: {\n title: name,\n name,\n categories: hist.Values.Convert((e: any) => {\n switch (type) {\n case ChartSetValueType.CLASS:\n return this.soilSampleClassNamePipe.transform(e);\n case ChartSetValueType.REGION:\n return this._mapSampleRegion(e);\n case ChartSetValueType.METHOD:\n return this._mapSampleMethods(e);\n case ChartSetValueType.SOIL_GROUP:\n return this.soilGroupFormatService.mapSingle(e);\n case ChartSetValueType.LANDUSE:\n return this._mapLanduse(e);\n case ChartSetValueType.DATE:\n return dis.Status;\n default:\n return e.toString();\n }\n }),\n data: hist.Counters.Convert((e: any) => {\n switch (type) {\n case ChartSetValueType.CLASS:\n return {\n value: dis && e > 0 ?\n e / hist.Counters.Sum() * Create(dis.AreaHa, 0) :\n 0,\n } as IBarLineAreaChartDataValue;\n default:\n return {\n value: e,\n } as IBarLineAreaChartDataValue;\n }\n }),\n },\n decimalPlaces: this.settings.FirstSetting.DigitsAfterDecimalPoint,\n color: (p) => {\n switch (type) {\n case ChartSetValueType.CLASS:\n return this.soilSampleClassColorService.getColor(p.category);\n case ChartSetValueType.DATE:\n switch (p) {\n case -1:\n return '#980000';\n case 0:\n return '#fdce3e';\n case 1:\n return '#5ec232';\n default:\n return undefined;\n }\n case ChartSetValueType.SOIL_GROUP:\n return this.soilGroupFormatService.colorCode(p);\n default:\n return undefined;\n }\n },\n meta: {\n fieldId: dis.FieldId,\n years: soilPlanningYears.map(item => {\n return {category: item.category, date: this._mapDate(item.date)};\n }),\n // die fieldSoilPlanningYears werden nur 1x ausgelesen → nur 1x im Statistik objekt halten\n // Objekt kann sonst sehr groß werden\n fieldYears: res.length === 0 ? fieldSoilPlanningYears : undefined,\n areaSum,\n }\n });\n }\n return res;\n }\n\n private _mapSampleMethods(value: number): string {\n const method = this.fieldNutrientDistributionStore.SampleMethods.Find(e => e.Id === value);\n if (!method) {\n return value.toString();\n }\n return this.translationStore.FindTranslationForSelectedLanguage(method.Method);\n }\n\n private _mapSampleRegion(value: number): string {\n const region = this.fieldNutrientDistributionStore.SampleRegions.Find(e => e.Id === value);\n if (!region) {\n return value.toString();\n }\n return this.translationStore.FindTranslationForSelectedLanguage(region.Region);\n }\n\n private _mapLanduse(value: number): string {\n const landuse = this.landUseStore.LandUse.Find(e => e.Id === value);\n if (!landuse) {\n return value.toString();\n }\n return this.translationStore.FindTranslationForSelectedLanguage(landuse.Key);\n }\n\n private _mapDate(value: number): string {\n return this.dateService.toFarmDate(new Date(parseInt(value.toString() + '000', 10))).format('YYYY');\n }\n}\n"],"sourceRoot":"webpack:///","file":"244.7de034c56ab217c7.js"}