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ardStates","constructor","dataProviders","dataItem","handleStateChange","onSelect","this","getFieldsetConfig","_","getGridColumnConfig","languageStore","Listen","s","selectedLanguage","pipe","map","l","columns","AddRange","getCommonBeginningGridColumnConfig","e","_a","Module","getBaseFertiGridColumnConfig","t","_b","getNFertiGridColumnConfig","getCommonEndingGridColumnConfig","getPagerConfig","breadCrumbsColumns","displayType","ApDynGridPagerWizardConfig","ApDynGridPagerWizardButton","value","TaskManagementWizardOpenConfigType","ApDynGridPagerWizardBreadcrumbsStepper","undefined","active","ApDynGridStatusColumnConfig","field","nameOf","class","description","ApDynGridPropertyColumnConfig","title","filterable","filterType","FilterType","cssClass","headerFilterable","width","sortIndex","sortDesc","tooltip","h","AreaOriginal","hide","ApDynGridColumnHideConfig","mapHide","pipes","roundNumericPipe","args","settingsStore","FirstSetting","DigitsAfterDecimalPoint","language","format","DateFormat","getPlanNumberTooltip","SourceItem","ApDynGridGroupColumnConfig","getProductGridHeader","groupColumns","ProductTooltip","ApplRate","planSummary","data","planBook","length","ApDynformsConfigFieldset","key","legend","config","ApDynformsConfigComboBox","label","options","getExportFormats","getPreselectedExportFormat","valueField","textField","valuePrimitive","translate","validators","ApDynformsValidator","validator","Validators","errorKey","getExportTargets","u","ExportFormat","value$","getSelectedExportTarget","ExportTarget","ApDynformsConfigDatepicker","r","ApplDate","_c","Date","ApDynformsConfigPlaceholder","o","_d","ExportDriver","drivers$","sort","d","_e","ExportMachine","machines$","c","_f","ExportInstrument","instruments$","of","allExportFormats","selectedExportFormat","find","Id","onExportNotRunning","_getCommonBeginningGridColumnConfig","_getBaseFertiGridColumnConfig","_getNFertiGridColumnConfig","_getCommonEndingGridColumnConfig","i0","ctx_r2","TaskManagementWizardComponent","fieldStore","formStore","mapStore","taskManagementStore","textProcessorService","fieldArchiveStore","changeDetection","BehaviorSubject","Map","ngOnInit","caption","Type","handleStateChangeAction","ApUtilService","_handleStateChange","bind","_subscriptions","saving$","combineLatest","saving","createPdfExport","isSaving","isGeneratingPdf","_stateModel","_initDetails","_initOverview","_initExport","_initSelection","initLeave","ngAfterContentInit","_uiConfigs","TaskManagementWizardSelectionConfig","PlanSummary","_onSelect","TaskManagementWizardDetailsConfig","TaskManagementWizardOverviewConfig","_onExportNotRunning","module","allItems$","PlanBooks","f","Fields","FieldId","getFieldArchiveById","Field","Status","getStatus","ModuleText","getModuleText","ApplicationModeText","getApplicationModeText","OperationModeText","getOperationModeText","ElementName","getElementName","ProductName","getProductName","ProductUnitPerHa","getProductUnit","getProductTooltip","CropName","getCropName","AreaHa","getAreaHaSum","getApplRate","ApplMin","getApplMin","ApplMax","getApplMax","ApplSum","getApplSum","getDate","ExportedAt","ExportTargetText","getExportTargetText","SelectedExportTargetObject","push","dynComponent","SelectedItems$","subscribe","_selectedRowsChanged","gridSubject","_setSelectedRows","FormValues$","v","filter","p","distinctUntilChanged","previous","current","S","M","Key","exportFail","exportSuccess","_activeWizardStep","next","exportedFile","_selectedItems","exportItem","filename","replaceSpecialChars","getExportBaseFilename","saveAs","Blob","Uint8Array","type","ngOnDestroy","forEach","unsubscribe","setTimeout","closeForm","selectedPlans","_isGridInitialized","Layers","TaskManagementLayer","replaceSource","ZoomIn","Array","row","Add","dataProvider","mapUrl","getMapFactoryUrl","currentUrl","TaskManagementNutrientLayer","source","getUrls","Legend","getMapLegend","update","selectLegendItem","clear","newStep","oldStep","dynForm","form","items$","_buildUi","fieldIdToSelect","RouterData","queryParams","fieldId","values","itemsToSelect","x","m","item","dynGrid","gridPaging","setSelectedKeys","onSelectAllChange","formValues","overviewItems","cloneDeep","getValue","plansForExport","_preparePlansForExport","export","get","fieldSets","columns$","pager","detectChanges","exportGridViewState","ObjectFactory","state","take","skip","exportGridView","process","items","Position","_g","IndexOf","CountryCode","_h","SelectedLanguage","_j","selectors","ApDynComponentComponent","ctx","TaskManagementEditComponent","cropRotationStore","modalDialogPresets","modalDialogStore","driverStore","machineStore","instrumentStore","_planSummary","_planBooks","loading$","historyLoading","loading","loadingItems","some","_getColumns","_getPager","setSelectedGridIdFromPreviousPage","_activateTaskManagementMapLayer","_closeForm","gridInitialized","ids","_selectionChange","changesSaveStatus","saved","_isDeleteAvailable","_itemsToDelete","z","_getItems","GetHistory$","_isBaseFertilisationPlanning","_getBaseFertiGridEditColumnConfig","listMassEditingSubject","listMassEditingObservable","asObservable","ApDynGridPagerConfig","lowerButtons","name","callback","listMassEditing","id","ApGridPagerType","onSubmit","_deleteManyPlanningBooks","planBooks","PlanBook","fieldPlanBook","getDriverById","getMachineById","getInstrumentById","selectedPlanBooks","selectedItems","sourceItemPlanBook","selectedPlanBook","changeSelectedField","toString","Legends","TaskMgmtLegend","refreshLegend","url","getComponentUrl","booking","Visibility","refreshActiveLayerGroups","then","_editPlanningBook","bookPlanningToEdit","_deletePlanningBook","bookPlanningToDelete","setModalDialogData","DeleteDialog","modalDialogSubscription","result","_deleteItems","bookPlanningsToDelete","bookPlanToDelete","deletePlannings","ApDynGridEditColumnConfig","text","disabled","routes","path","component","translationStore","dateService","campaignYearStore","routerStore","userContactsStore","legendScrollerService","terminalsStore","tooltipService","applicationModeService","P","b","FirstOrDefault","summary","k","E","ee","q","G","L","te","PpProductList","ProductListDetails","WorkType","WorkTypes","selectedYear","routerStoreData","_onRouterServiceOrSelectedYearChanged","FormClose$","_onFormClose","selectionChange","event","_onScrollerLegendServiceSelectionChange","loaded","taskManagement","campaignYear","fields","fieldArchiveLoaded","userApplRate","getSummaryStatus","Note","Remark","UserApplRate","UserApplSum","ProductUnit","FieldsTooltip","getFieldsCropsTooltip","getDateMidnight","AreaHaSum","ApplUnitPerHa","getApplUnit","AlreadyExported","getAlreadyExported","preselect","_getActions","iconButtons","icon","_onPdf","_onXlsPrint","settings","setting","multiline","FindTranslationForSelectedLanguage","headerStyle","GetRoundNumericPipeConfig","Number","isFinite","headerExtraLines","a","_exportDisabledSingleEdit","_bookDisabledSingleEdit","_onExportClicked","_exportDisabledMassEdit","_onShowClicked","_onBookClicked","_bookDisabledMassEdit","selectedSummaries","Tooltip","getMapLayerTooltip","zoomFarmFields","loadUserContacts","loadTerminals","startsWith","_crossComponentCallData","loadTaskManagementPlanSummaries","bookings","_wizardOpened","targetItem","Find","showOnly","show","componentToRedirect","dataObject","openForm","navigate","updatedComponent","updateComponent","PlanNumber","LEGEND_IDS","selectionKeys","toLowerCase","applicationModeText","GetApplicationModeStatus","ApplicationMode","wizardOpenConfig","TaskManagementWizardOpenConfig","_navigateToEditBookModule","TaskManagementAction","action","xlsExportFileName","_generatePrintFilename","exportAsXls","pdfExportFileName","exportAsPdf","toFarmDate","TaskManagementOverviewComponent","canActivate","ApPermissionGuard","login","layout","PageMode","TaskManagementRoutes","RouterModule","TaskManagementModule","imports","CommonModule","ApDynComponentModule","ApCoreModule","ApResponsiveTextModule","ButtonModule","ApReportsModule","ApMapModule"],"sources":["./src/app/ap-interface/enums/layout/icon.enum.ts","./src/app/task-management/components/wizard/wizard-ui-config/WizardStates.ts","./src/app/task-management/components/wizard/wizard-ui-config/task-management-wizard-selection.config.ts","./src/app/task-management/components/wizard/wizard-ui-config/task-management-wizard-details.config.ts","./src/app/task-management/components/wizard/wizard-ui-config/task-management-wizard-overview.config.ts","./src/app/task-management/components/wizard/task-management-wizard.component.ts","./src/app/task-management/components/editing/task-management-edit.component.ts","./src/app/task-management/task-management.routes.ts","./src/app/task-management/components/task-management-overview.component.ts","./src/app/task-management/task-management.module.ts"],"sourcesContent":["export enum Icon {\n Delete = 'delete',\n Edit = 'Edit',\n Print = 'print',\n Save = 'save',\n Source = 'source-code',\n XLS = 'file-xls',\n PDF = 'pdf',\n Shape = 'shape'\n}\n","import {Observable} 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 {\n ApDynformsConfigFieldset\n} from '../../../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {ITaskManagementPlanBookGridData, TaskManagementWizardOpenConfigType} from '../../../task-management.types';\n\nexport enum WizardStates {\n Leave = 'Leave_TaskMgmt', // user clicks 'cancel' button on Selection page\n Selection = 'Global__Selection', // first wizard page where user can select plannings\n Details = 'Global__Details', // second wizard page configuring the details\n Overview = 'Admin_Pages__Overview', // last wizard page showing summary\n Export = 'Export_Tasks' // user click 'export' button on Overview page\n}\n\nexport interface WizardUiState {\n getGridColumnConfig(): Observable;\n\n getPagerConfig(breadCrumbsColumns: WizardStates[], displayType: TaskManagementWizardOpenConfigType): ApDynGridPagerConfigBase;\n\n getFieldsetConfig(data: Array): ApDynformsConfigFieldset[];\n}\n","import {WizardStates, WizardUiState} from './WizardStates';\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {\n ApDynGridColumnConfigBase,\n ApDynGridColumnHideConfig\n} from '../../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApDynformsConfigFieldset\n} from '../../../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {\n ApDynGridPagerConfigBase\n} from '../../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {\n ApDynGridPagerWizardBreadcrumbsStepper,\n ApDynGridPagerWizardButton,\n ApDynGridPagerWizardConfig\n} from '../../../../ap-dyngrids/config/ap-dyn-grid-pager-wizard-config';\nimport {\n EventEmitter\n} from '@angular/core';\nimport {\n map\n} from 'rxjs/operators';\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 ApDynGridGroupColumnConfig\n} from '../../../../ap-dyngrids/config/ap-dyn-grid-group-column-config';\nimport {\n TaskManagementDataProviders\n} from '../../../task-management-data-providers/task-management-data-providers';\nimport {\n ITaskManagementPlanBookGridData,\n TaskManagementWizardOpenConfigType\n} from '../../../task-management.types';\nimport {\n nameOf\n} from '../../../../ap-core/utils/ap-name-of';\nimport {\n IGridStatus\n} from '../../../../ap-interface/interfaces/ap-grid-status.interface';\nimport ILanguage = Data.Language.ILanguage;\nimport ITaskManagementPlanSummary = Data.TaskManagement.ITaskManagementPlanSummary;\nimport TaskManagementModule = Data.TaskManagement.TaskManagementModule;\nimport IFieldBase = Data.FieldManagement.IFieldBase;\n\nexport class TaskManagementWizardSelectionConfig implements WizardUiState {\n\n constructor(private dataProviders: TaskManagementDataProviders,\n private dataItem: ITaskManagementPlanSummary,\n private handleStateChange: EventEmitter,\n private onSelect: BehaviorSubject) {\n }\n\n public getFieldsetConfig(_: Array): ApDynformsConfigFieldset[] {\n return [];\n }\n\n public getGridColumnConfig(): Observable {\n return this.dataProviders.languageStore.Listen(s => s.selectedLanguage).pipe(map((l) => {\n const columns = [];\n columns.AddRange(this.getCommonBeginningGridColumnConfig());\n if (this.dataItem?.Module === TaskManagementModule.GD_BasicFertilization) {\n columns.AddRange(this.getBaseFertiGridColumnConfig());\n } else if (this.dataItem?.Module === TaskManagementModule.N_NFertilization) {\n columns.AddRange(this.getNFertiGridColumnConfig());\n }\n columns.AddRange(this.getCommonEndingGridColumnConfig(l));\n return columns;\n }));\n }\n\n public getPagerConfig(breadCrumbsColumns: WizardStates[], displayType: TaskManagementWizardOpenConfigType): ApDynGridPagerConfigBase {\n return new ApDynGridPagerWizardConfig(\n new ApDynGridPagerWizardButton('Global__Cancel', this.handleStateChange, {value: WizardStates.Leave}),\n displayType === TaskManagementWizardOpenConfigType.Export ? new ApDynGridPagerWizardBreadcrumbsStepper(breadCrumbsColumns, 0) : undefined,\n displayType === TaskManagementWizardOpenConfigType.Export ? new ApDynGridPagerWizardButton('Global__Next', this.handleStateChange,\n {active: this.onSelect, value: WizardStates.Details}) : undefined);\n }\n\n /*\n * Columns which are same for all views at the beginning of the view\n */\n private getCommonBeginningGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridStatusColumnConfig({\n field: `${nameOf('Status')}.${nameOf('state')}`,\n class: `${nameOf('Status')}.${nameOf('class')}`,\n description: `${nameOf('Status')}.${nameOf('description')}`\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Number',\n field: `${nameOf('Field')}.${nameOf('FieldNumber')}`,\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 50\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini_Subnumber',\n field: `${nameOf('Field')}.${nameOf('FieldSubnumber')}`,\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 50\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldName',\n field: `${nameOf('Field')}.${nameOf('FieldName')}`,\n filterable: true,\n headerFilterable: true,\n sortIndex: 0,\n sortDesc: false,\n width: 160,\n cssClass: 'left',\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Area_Unit',\n field: nameOf('AreaHa'),\n cssClass: 'right',\n headerFilterable: true,\n filterable: true,\n width: 90,\n tooltip: (dataItem) => dataItem?.AreaOriginal,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n })\n ];\n }\n\n /*\n * Columns which are same for all views at the ending of the view\n */\n private getCommonEndingGridColumnConfig(language: ILanguage): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients__FertilizationDate',\n field: nameOf('ApplDate'),\n format: language.DateFormat,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 150,\n tooltip: (dataItem) => this.dataProviders[this.dataItem.Module].getPlanNumberTooltip(dataItem.SourceItem),\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Task_Mgmt_Exported',\n field: nameOf('ExportedAt'),\n format: language.DateFormat,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 150,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Task_Mgmt_Export_Target',\n field: nameOf('ExportTargetText'),\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 100,\n headerFilterable: true,\n filterable: true\n })\n ];\n }\n\n /*\n * Columns for : Grunddüngung (Base fertilization)\n */\n private getBaseFertiGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridGroupColumnConfig({\n title: this.dataProviders[this.dataItem.Module].getProductGridHeader(this.dataItem),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: nameOf('ProductName'),\n width: 120,\n headerFilterable: true,\n filterable: true,\n tooltip: (dataItem: any) => dataItem['ProductTooltip']\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Average_Amount',\n field: nameOf('ApplRate'),\n tooltip: (dataItem) => dataItem?.ApplRate,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: nameOf('ApplMin'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: nameOf('ApplMax'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n ]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients_Pages_Popups__Distribution',\n field: nameOf('ApplicationModeText'),\n width: 100,\n headerFilterable: true,\n filterable: true\n })\n ];\n }\n\n /*\n * Columns for : ND-N Düngung\n */\n private getNFertiGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: nameOf('ProductName'),\n width: 120,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridGroupColumnConfig({\n title: this.dataProviders[this.dataItem.Module].getProductGridHeader(this.dataItem),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'AgriConnect_View__Reference',\n field: nameOf('ApplRate'),\n tooltip: (dataItem) => dataItem?.ApplRate,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: nameOf('ApplMin'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: nameOf('ApplMax'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n ]\n })\n ];\n }\n}\n","import {WizardStates, WizardUiState} from './WizardStates';\nimport {ApDynformsConfigFieldset} from '../../../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {Observable, of} from 'rxjs';\nimport {ApDynGridColumnConfigBase} from '../../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {ApDynGridPagerConfigBase} from '../../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {ApDynformsConfigPlaceholder} from '../../../../ap-dynforms/config/ap-dynforms-config-placeholder';\nimport {ApDynformsConfigComboBox} from '../../../../ap-dynforms/config/ap-dynforms-config-combobox';\nimport {ApDynformsConfigDatepicker} from '../../../../ap-dynforms/config/ap-dynforms-config-datepicker';\nimport {ApDynformsValidator} from '../../../../ap-dynforms/ap-dynforms-validator';\nimport {Validators} from '@angular/forms';\nimport {TaskManagementDataProviders} from '../../../task-management-data-providers/task-management-data-providers';\nimport {ITaskManagementPlanBookGridData} from '../../../task-management.types';\nimport ITaskManagementPlanSummary = Data.TaskManagement.ITaskManagementPlanSummary;\nimport IExportFormat = Data.Common.IExportFormat;\nimport IExportTarget = Data.Common.IExportTarget;\n\nexport interface IExportFormatsComboData extends IExportFormat {\n Translation: string;\n}\n\nexport interface IExportTargetsComboData extends IExportTarget {\n Translation: string;\n}\n\nexport class TaskManagementWizardDetailsConfig implements WizardUiState {\n\n constructor(private dataProviders: TaskManagementDataProviders,\n private planSummary: ITaskManagementPlanSummary) {\n }\n\n getFieldsetConfig(data: Array): ApDynformsConfigFieldset[] {\n let planBook: ITaskManagementPlanBookGridData;\n if (data && data.length > 0) {\n planBook = data[0];\n }\n\n return [\n new ApDynformsConfigFieldset({\n key: 'Task_Mgmt_Processing',\n legend: 'Task_Mgmt_Processing',\n config: [\n new ApDynformsConfigComboBox({\n key: 'SourceItem.ExportFormat',\n label: 'Task_Mgmt_Export_Format',\n options: this.dataProviders[this.planSummary.Module].getExportFormats(this.planSummary),\n value: this.getPreselectedExportFormat(planBook),\n valueField: 'Id',\n textField: 'Translation',\n valuePrimitive: false,\n translate: false,\n validators: [\n new ApDynformsValidator({validator: Validators.required, errorKey: 'Settings__Msg_Vali_Value_Required'}),\n ]\n }),\n new ApDynformsConfigComboBox({\n key: 'SelectedExportTargetObject',\n label: 'Task_Mgmt_Export_Target',\n options: this.dataProviders[this.planSummary.Module].getExportTargets(planBook?.SourceItem?.ExportFormat),\n value$: this.dataProviders[this.planSummary.Module].getSelectedExportTarget(planBook?.SourceItem?.ExportTarget),\n valueField: 'Id',\n textField: 'Translation',\n valuePrimitive: false,\n translate: false,\n validators: [\n new ApDynformsValidator({validator: Validators.required, errorKey: 'Settings__Msg_Vali_Value_Required'}),\n ]\n }),\n new ApDynformsConfigDatepicker({\n key: 'ApplDate',\n label: 'Nutrients__FertilizationDate',\n value: planBook?.ApplDate ?? new Date(this.planSummary.ApplDate),\n validators: [\n new ApDynformsValidator({validator: Validators.required, errorKey: 'Settings__Msg_Vali_Value_Required'}),\n ]\n }),\n new ApDynformsConfigPlaceholder(),\n new ApDynformsConfigComboBox({\n key: 'SourceItem.ExportDriver',\n label: 'Docu_Ini__Motorist',\n value: planBook?.SourceItem?.ExportDriver,\n options: this.dataProviders.drivers$,\n valueField: 'Id',\n textField: 'ShortFullName',\n valuePrimitive: false,\n translate: false,\n sort: 1\n }),\n new ApDynformsConfigComboBox({\n key: 'SourceItem.ExportMachine',\n label: 'Base__Engine',\n value: planBook?.SourceItem?.ExportMachine,\n options: this.dataProviders.machines$,\n valueField: 'Id',\n textField: 'NameWithSign',\n valuePrimitive: false,\n translate: false,\n sort: 1\n }),\n new ApDynformsConfigComboBox({\n key: 'SourceItem.ExportInstrument',\n label: 'Docu_Ini__Tool',\n value: planBook?.SourceItem?.ExportInstrument,\n options: this.dataProviders.instruments$,\n valueField: 'Id',\n textField: 'Name',\n valuePrimitive: false,\n translate: false,\n sort: 1\n })\n ]\n }),\n ];\n }\n\n getGridColumnConfig(): Observable {\n return of([]);\n }\n\n getPagerConfig(_: WizardStates[]): ApDynGridPagerConfigBase {\n return undefined;\n }\n\n getPreselectedExportFormat(planBook: ITaskManagementPlanBookGridData): IExportTargetsComboData {\n const allExportFormats = this.dataProviders[this.planSummary.Module].getExportFormats(this.planSummary);\n const selectedExportFormat = allExportFormats.find(_ => _.Id === planBook?.SourceItem?.ExportFormat?.Id);\n return selectedExportFormat ?? allExportFormats[0];\n }\n}\n","import {WizardStates, WizardUiState} from './WizardStates';\nimport {\n ApDynformsConfigFieldset\n} from '../../../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {BehaviorSubject, Observable} 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 ApDynGridPagerWizardBreadcrumbsStepper,\n ApDynGridPagerWizardButton,\n ApDynGridPagerWizardConfig\n} from '../../../../ap-dyngrids/config/ap-dyn-grid-pager-wizard-config';\nimport {\n EventEmitter\n} from '@angular/core';\nimport {\n map\n} from 'rxjs/operators';\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 ApDynGridGroupColumnConfig\n} from '../../../../ap-dyngrids/config/ap-dyn-grid-group-column-config';\nimport {\n TaskManagementDataProviders\n} from '../../../task-management-data-providers/task-management-data-providers';\nimport {\n ITaskManagementPlanBookGridData,\n TaskManagementWizardOpenConfigType\n} from '../../../task-management.types';\nimport ILanguage = Data.Language.ILanguage;\nimport ITaskManagementPlanSummary = Data.TaskManagement.ITaskManagementPlanSummary;\nimport TaskManagementModule = Data.TaskManagement.TaskManagementModule;\n\nexport class TaskManagementWizardOverviewConfig implements WizardUiState {\n constructor(private dataProviders: TaskManagementDataProviders,\n private dataItem: ITaskManagementPlanSummary,\n private handleStateChange: EventEmitter,\n private onSelect: BehaviorSubject,\n private onExportNotRunning: BehaviorSubject) {\n }\n\n public getFieldsetConfig(_: Array): ApDynformsConfigFieldset[] {\n return [];\n }\n\n public getGridColumnConfig(): Observable {\n return this.dataProviders.languageStore.Listen(s => s.selectedLanguage).pipe(map((l) => {\n const columns = [];\n columns.AddRange(this._getCommonBeginningGridColumnConfig());\n if (this.dataItem.Module === TaskManagementModule.GD_BasicFertilization) {\n columns.AddRange(this._getBaseFertiGridColumnConfig(l));\n } else if (this.dataItem.Module === TaskManagementModule.N_NFertilization) {\n columns.AddRange(this._getNFertiGridColumnConfig(l));\n }\n columns.AddRange(this._getCommonEndingGridColumnConfig(l));\n return columns;\n }));\n }\n\n public getPagerConfig(breadCrumbsColumns: WizardStates[], _: TaskManagementWizardOpenConfigType): ApDynGridPagerConfigBase {\n return new ApDynGridPagerWizardConfig(\n new ApDynGridPagerWizardButton('Global_Back_With_Arrow', this.handleStateChange, {\n active: this.onExportNotRunning,\n value: WizardStates.Details\n }),\n new ApDynGridPagerWizardBreadcrumbsStepper(breadCrumbsColumns, 2),\n new ApDynGridPagerWizardButton('Task_Mgmt_Export', this.handleStateChange, {\n active: this.onSelect,\n value: WizardStates.Export\n })\n );\n }\n\n /*\n * Columns which are same for all views at the beginning of the view\n */\n private _getCommonBeginningGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridStatusColumnConfig({field: 'Status', class: 'StatusClass'}),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Number',\n field: 'Field.FieldNumber',\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 50\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini_Subnumber',\n field: 'Field.FieldSubnumber',\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 50\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldName',\n field: 'Field.FieldName',\n filterable: true,\n headerFilterable: true,\n sortIndex: 0,\n sortDesc: false,\n width: 160,\n cssClass: 'left',\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Area_Unit',\n field: 'AreaHa',\n cssClass: 'right',\n headerFilterable: true,\n filterable: true,\n width: 90,\n tooltip: (dataItem) => dataItem['AreaOriginal'],\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n })\n ];\n }\n\n /*\n * Columns which are same for all views at the ending of the view\n */\n private _getCommonEndingGridColumnConfig(language: ILanguage): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients__FertilizationDate',\n field: 'ApplDate',\n format: language.DateFormat,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 150,\n tooltip: (dataItem) => this.dataProviders[this.dataItem.Module].getPlanNumberTooltip(dataItem),\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Task_Mgmt_Export_Format',\n field: 'SourceItem.ExportFormat.Translation',\n width: 150,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Task_Mgmt_Export_Target',\n field: 'SelectedExportTargetObject.Translation',\n width: 100,\n filterable: true,\n headerFilterable: true\n })\n ];\n }\n\n /*\n * Columns for : Grunddüngung (Base fertilization)\n */\n private _getBaseFertiGridColumnConfig(_: ILanguage): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridGroupColumnConfig({\n title: this.dataProviders[this.dataItem.Module].getProductGridHeader(this.dataItem),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: 'ProductName',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 120,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Average_Amount',\n field: 'ApplRate',\n tooltip: (dataItem) => dataItem?.ApplRate,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n width: 90,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: 'ApplMin',\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: 'ApplMax',\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n ]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients_Pages_Popups__Distribution',\n field: 'ApplicationModeText',\n width: 100,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n filterable: true,\n headerFilterable: true\n })\n ];\n }\n\n /*\n * Columns for : ND-N Düngung\n */\n private _getNFertiGridColumnConfig(_: ILanguage): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: 'ProductName',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 120,\n filterable: true,\n headerFilterable: true\n }),\n new ApDynGridGroupColumnConfig({\n title: this.dataProviders[this.dataItem.Module].getProductGridHeader(this.dataItem),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'AgriConnect_View__Reference',\n field: 'ApplRate',\n tooltip: (dataItem) => dataItem?.ApplRate,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n width: 90,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: 'ApplMin',\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: 'ApplMax',\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n filterable: true,\n headerFilterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [0]\n }]\n }),\n ]\n })\n ];\n }\n}\n","import {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n OnDestroy,\n OnInit,\n ViewChild\n} from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable,\n of,\n Subscription\n} from 'rxjs';\nimport {\n ApDynGridPagerConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {\n ApDynformsConfigFieldset\n} from '../../../ap-dynforms/config/ap-dynforms-config-fieldset';\nimport {\n ApDynGridColumnConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApUtilService\n} from '../../../ap-utils/service/ap-util.service';\nimport {\n ApDynComponentComponent\n} from '../../../ap-dyncomponent/ap-dyncomponent.component';\nimport {\n distinctUntilChanged,\n filter,\n map\n} from 'rxjs/operators';\nimport {\n LanguageStore\n} from '../../../stores/translation/language.store';\nimport {\n FieldStore\n} from '../../../stores/farm/field.store';\nimport {\n SelectableSettings\n} from '@progress/kendo-angular-grid';\nimport {\n FormStore\n} from '../../../stores/layout/form.store';\nimport {\n WizardStates,\n WizardUiState\n} from './wizard-ui-config/WizardStates';\nimport {\n TaskManagementWizardSelectionConfig\n} from './wizard-ui-config/task-management-wizard-selection.config';\nimport {\n TaskManagementWizardDetailsConfig\n} from './wizard-ui-config/task-management-wizard-details.config';\nimport {\n TaskManagementWizardOverviewConfig\n} from './wizard-ui-config/task-management-wizard-overview.config';\nimport {\n MapStore\n} from '../../../stores/map/map.store';\nimport {\n TaskManagementDataProviders\n} from '../../task-management-data-providers/task-management-data-providers';\nimport {\n cloneDeep\n} from 'lodash';\nimport {\n TaskManagementStore\n} from '../../../stores/task-management/task-management.store';\nimport {\n saveAs\n} from '@progress/kendo-file-saver';\nimport {\n process\n} from '@progress/kendo-data-query';\nimport {\n ObjectFactory\n} from 'ts-tooling';\nimport {\n ITaskManagementPlanBookGridData,\n TaskManagementWizardOpenConfig,\n TaskManagementWizardOpenConfigType\n} from '../../task-management.types';\nimport {\n TextProcessorService\n} from '../../../services/common/text-processor.service';\nimport ITaskManagementPlanBook = Data.TaskManagement.ITaskManagementPlanBook;\nimport {\n FieldArchiveStore\n} from '../../../stores/farm/field-archive.store';\n\n@Component({\n selector: 'task-management-wizard',\n template: `\n \n \n
\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n \n `\n})\nexport class TaskManagementWizardComponent implements OnInit, AfterContentInit, OnDestroy {\n @ViewChild(ApDynComponentComponent, {static: true}) dynComponent: ApDynComponentComponent;\n public data: TaskManagementWizardOpenConfig;\n public columns$: Observable = of([]);\n public fieldSets: ApDynformsConfigFieldset[] = [];\n public items$: Observable = of([]);\n public allItems$: Observable = of([]);\n public saving$: Observable = of(false);\n public selectable: Observable;\n public pager: ApDynGridPagerConfigBase;\n public wizardSteps = WizardStates;\n public handleStateChangeAction: EventEmitter;\n public createPdfExport = new BehaviorSubject(false);\n public caption = '';\n public _selectedItems: Map> = new Map>([\n [WizardStates.Selection, null],\n [WizardStates.Details, null],\n [WizardStates.Overview, null]\n ]);\n public breadCrumbsColumns = [\n WizardStates.Selection,\n WizardStates.Details,\n WizardStates.Overview\n ];\n\n private _uiConfigs: Map;\n private _stateModel: { [oldState: string]: { [newState: string]: () => void } } = {};\n private _isGridInitialized: boolean;\n private _onExportNotRunning = new BehaviorSubject(true);\n private _onSelect = new BehaviorSubject(false);\n private _activeWizardStep: WizardStates = WizardStates.Selection;\n private _subscriptions: Subscription[] = [];\n\n constructor(private fieldStore: FieldStore,\n private languageStore: LanguageStore,\n private formStore: FormStore,\n private mapStore: MapStore,\n private dataProviders: TaskManagementDataProviders,\n private taskManagementStore: TaskManagementStore,\n private textProcessorService: TextProcessorService,\n private fieldArchiveStore: FieldArchiveStore,\n private changeDetection: ChangeDetectorRef) {\n }\n\n public ngOnInit(): void {\n this.caption = this.data?.Type === TaskManagementWizardOpenConfigType.Show ? 'Global__Show' : 'Task_Mgmt_Export';\n this.handleStateChangeAction = ApUtilService.createEventEmitter(this._handleStateChange.bind(this), this._subscriptions);\n this.saving$ = combineLatest([this.taskManagementStore.Listen(s => s.saving), this.createPdfExport]).pipe(\n map(([isSaving, isGeneratingPdf]) => isSaving || isGeneratingPdf)\n );\n this._stateModel[WizardStates.Leave] = {};\n this._stateModel[WizardStates.Selection] = {};\n this._stateModel[WizardStates.Details] = {};\n this._stateModel[WizardStates.Overview] = {};\n this._stateModel[WizardStates.Export] = {};\n // Definition of actions when state changes: [oldState][newState] => (action) executed\n this._stateModel[WizardStates.Selection][WizardStates.Details] = () => this._initDetails(); // user continues from selection to details\n this._stateModel[WizardStates.Details][WizardStates.Overview] = () => this._initOverview(); // user switches from details to overview-tab\n this._stateModel[WizardStates.Overview][WizardStates.Export] = () => this._initExport(); // user clicks export in overview\n this._stateModel[WizardStates.Overview][WizardStates.Details] = () => this._initDetails(); // user goes back to details from overview\n this._stateModel[WizardStates.Details][WizardStates.Selection] = () => this._initSelection(); // user navigates from details back to selection\n this._stateModel[WizardStates.Selection][WizardStates.Leave] = () => this.initLeave(); // leaving wizard\n this._stateModel[WizardStates.Export][WizardStates.Details] = () => this._initDetails(); // after failed export user goes back to details\n this._stateModel[WizardStates.Export][WizardStates.Export] = () => this._initExport(); // export retry by user\n }\n\n public ngAfterContentInit(): void {\n /*\n * UI Configuration setup:\n */\n this._uiConfigs = new Map(\n [\n [WizardStates.Selection,\n new TaskManagementWizardSelectionConfig(this.dataProviders, this.data.PlanSummary?.SourceItem, this.handleStateChangeAction, this._onSelect)],\n [WizardStates.Details,\n new TaskManagementWizardDetailsConfig(this.dataProviders, this.data.PlanSummary?.SourceItem)],\n [WizardStates.Overview,\n new TaskManagementWizardOverviewConfig(this.dataProviders, this.data.PlanSummary?.SourceItem, this.handleStateChangeAction, this._onSelect, this._onExportNotRunning)]\n ]);\n const planSummary = this.data.PlanSummary?.SourceItem;\n const module = planSummary?.Module;\n this.allItems$ = this.data?.PlanSummary ? of(planSummary?.PlanBooks?.map(planBook => {\n const field = this.fieldStore.Fields.find(f => f.Id === planBook.FieldId) ??\n this.fieldArchiveStore.getFieldArchiveById(planBook.FieldId);\n const result: ITaskManagementPlanBookGridData = {\n Id: planBook.Id,\n Field: field,\n Status: this.dataProviders[module].getStatus(planBook),\n ModuleText: this.dataProviders[planBook.Module].getModuleText(planBook),\n ApplicationModeText: this.dataProviders[module].getApplicationModeText(planBook),\n OperationModeText: this.dataProviders[module].getOperationModeText(planBook),\n ElementName: this.dataProviders[module].getElementName(planBook),\n ProductName: this.dataProviders[module].getProductName(planBook),\n ProductUnitPerHa: this.dataProviders[module].getProductUnit(planBook, true),\n ProductTooltip: this.dataProviders[module].getProductTooltip(planBook),\n CropName: this.dataProviders[module].getCropName(planBook),\n AreaHa: this.dataProviders[module].getAreaHaSum(planBook),\n ApplRate: this.dataProviders[module].getApplRate(planBook),\n ApplMin: this.dataProviders[module].getApplMin(planBook),\n ApplMax: this.dataProviders[module].getApplMax(planBook),\n ApplSum: this.dataProviders[module].getApplSum(planBook),\n ApplDate: this.dataProviders[module].getDate(planBook.ApplDate),\n ExportedAt: this.dataProviders[module].getDate(planBook.ExportedAt),\n ExportTargetText: this.dataProviders[module].getExportTargetText(planBook.ExportTarget),\n SelectedExportTargetObject: undefined,\n ExportDriver: planBook?.ExportDriver,\n ExportInstrument: planBook?.ExportInstrument,\n ExportMachine: planBook?.ExportMachine,\n SourceItem: planBook\n };\n return result;\n })) : of([]);\n this._subscriptions.push(this.dynComponent.SelectedItems$.subscribe(d => this._selectedRowsChanged(d)));\n this._subscriptions.push(this.dynComponent.gridSubject.subscribe(() => this._setSelectedRows()));\n this._subscriptions.push(this.dynComponent.FormValues$.pipe(\n map((v: ITaskManagementPlanBookGridData) => v),\n filter(p => !!p && !!p.SourceItem),\n distinctUntilChanged((previous, current) => previous.SourceItem.ExportFormat === current.SourceItem.ExportFormat),\n ).subscribe(_ => {\n // depending on export format a new list of export targets needs to be set\n this.dataProviders[module]?.getExportTargets(_.SourceItem.ExportFormat);\n this.dataProviders[module]?.getSelectedExportTarget(_.SelectedExportTargetObject?.Key);\n }));\n // Handle save states\n this._subscriptions.push(combineLatest([\n this.taskManagementStore.Listen(s => s.exportFail),\n this.taskManagementStore.Listen(s => s.exportSuccess)\n ]).subscribe(([exportFail, exportSuccess]) => {\n if (this._activeWizardStep !== WizardStates.Export) {\n return;\n }\n if (exportSuccess) {\n // after export was successful in backend => always generate pdf.\n // when pdf export finished the wizard closes due to 'exportdone' event of report-component.\n this.createPdfExport.next(true);\n } else if (exportFail) {\n this._activeWizardStep = WizardStates.Overview;\n this._onExportNotRunning.next(true);\n this._setSelectedRows();\n }\n }));\n this._initSelection();\n this._subscriptions.push(this.taskManagementStore.Listen(s => s.exportedFile).subscribe(data => {\n if (data && this._selectedItems[WizardStates.Overview]?.length > 0) {\n const exportItem = this._selectedItems[WizardStates.Overview][0] as ITaskManagementPlanBookGridData;\n const filename = this.textProcessorService.replaceSpecialChars(\n this.dataProviders[module]?.getExportBaseFilename(this.data.PlanSummary.SourceItem, exportItem.SourceItem)\n );\n saveAs(new Blob([new Uint8Array(data)], {type: 'application/zip'}), `${filename}.zip`);\n }\n }));\n }\n\n public ngOnDestroy(): void {\n this._subscriptions.forEach(s => s.unsubscribe());\n }\n\n /*\n * Function takes care of leaving the wizard\n */\n public initLeave(): void {\n setTimeout(() => this.formStore.closeForm(), 1);\n }\n\n private _selectedRowsChanged(selectedPlans: ITaskManagementPlanBookGridData[]): void {\n if (!this._isGridInitialized) {\n return;\n }\n if (!selectedPlans || selectedPlans.length === 0) {\n this._onSelect.next(false);\n this._selectedItems[this._activeWizardStep] = new Array();\n this.mapStore.Layers.TaskManagementLayer.clear();\n this.mapStore.Layers.TaskManagementNutrientLayer.clear();\n } else {\n this.mapStore.Layers.TaskManagementLayer.replaceSource(selectedPlans.map(p => p.SourceItem), this.fieldStore);\n this.mapStore.Layers.TaskManagementLayer.ZoomIn(500);\n this._onSelect.next(true);\n this._selectedItems[this._activeWizardStep] = new Array();\n selectedPlans.forEach(row => {\n this._selectedItems[this._activeWizardStep].Add(row);\n });\n const dataProvider = this.dataProviders[selectedPlans[0].SourceItem.Module];\n const mapUrl = dataProvider?.getMapFactoryUrl(selectedPlans.map(_ => _.SourceItem));\n if (mapUrl?.length > 0) {\n const currentUrl = this.mapStore.Layers.TaskManagementNutrientLayer.source.getUrls();\n // to avoid flickering: do not update map url if it is still same\n if (currentUrl == null || currentUrl.length < 1 || currentUrl[0] !== mapUrl) {\n this.mapStore.Layers.TaskManagementNutrientLayer.Legend = dataProvider?.getMapLegend(this.data.PlanSummary?.SourceItem);\n this.mapStore.Layers.TaskManagementNutrientLayer.update(mapUrl);\n setTimeout(() => dataProvider?.selectLegendItem(selectedPlans[0].SourceItem), 0);\n }\n } else {\n this.mapStore.Layers.TaskManagementNutrientLayer.clear();\n }\n }\n }\n\n private _handleStateChange(newStep: WizardStates): void {\n const oldStep = this._activeWizardStep;\n this._activeWizardStep = newStep;\n if (this._stateModel[oldStep][newStep]) {\n this._stateModel[oldStep][newStep]();\n }\n }\n\n /*\n * Function takes care of 1. wizard step 'selection'\n * initializes data and ui.\n */\n private _initSelection(): void {\n // in case user returned from details to selection we need to store current user input\n if (this.dynComponent && this.dynComponent.dynForm && this.dynComponent.dynForm.form) {\n this._selectedItems[WizardStates.Details] = [this.dynComponent.dynForm.form.value as ITaskManagementPlanBook];\n }\n this.items$ = this.allItems$;\n this._buildUi();\n // In case nothing is pre-selected => select all on startup\n if ((!this._selectedItems[WizardStates.Selection] || this._selectedItems[WizardStates.Selection].length === 0)) {\n const fieldIdToSelect = this.data?.RouterData?.queryParams['fieldId'];\n if (fieldIdToSelect) {\n this.items$.subscribe(values => {\n const itemsToSelect = values.filter(x => x?.Field?.Id === fieldIdToSelect)\n .map(item => item.Id);\n setTimeout(() => this.dynComponent.dynGrid.gridPaging.setSelectedKeys(itemsToSelect));\n }).unsubscribe();\n return;\n }\n if (this.data?.Type !== TaskManagementWizardOpenConfigType.Show) {\n this.dynComponent.dynGrid.gridPaging.onSelectAllChange('checked');\n }\n }\n }\n\n /*\n * Function takes care of 2. wizard step ('details') tab initialization\n */\n private _initDetails(): void {\n // Set values for details if not set already\n if (!this._selectedItems[WizardStates.Details] &&\n this._selectedItems[WizardStates.Selection] && this._selectedItems[WizardStates.Selection].length > 0) {\n this._selectedItems[WizardStates.Details] = [this._selectedItems[WizardStates.Selection][0]];\n }\n this._buildUi();\n }\n\n /*\n * Function takes care of last wizard step('overview') initialization\n */\n private _initOverview(): void {\n const formValues = this.dynComponent.dynForm.form.value as ITaskManagementPlanBookGridData;\n // save selection for further use by user.\n this._selectedItems[WizardStates.Details] = [formValues];\n const overviewItems = cloneDeep(this._selectedItems[WizardStates.Selection]);\n overviewItems.forEach((_: ITaskManagementPlanBookGridData) => {\n _.SourceItem.ExportFormat = formValues?.SourceItem?.ExportFormat;\n _.SourceItem.ExportTarget = formValues?.SelectedExportTargetObject?.Key;\n _.SelectedExportTargetObject = formValues?.SelectedExportTargetObject;\n _.SourceItem.ExportDriver = formValues?.SourceItem?.ExportDriver;\n _.SourceItem.ExportMachine = formValues?.SourceItem?.ExportMachine;\n _.SourceItem.ExportInstrument = formValues?.SourceItem?.ExportInstrument;\n _.SourceItem.ApplDate = formValues?.ApplDate;\n _.ApplDate = formValues?.ApplDate;\n });\n this.items$ = of(overviewItems);\n // preselect all rows for export\n this._selectedItems[WizardStates.Overview] = overviewItems;\n this._setSelectedRows();\n this._buildUi();\n }\n\n /*\n * Function takes care of 'Export' functionality\n */\n private _initExport(): void {\n // avoid double clicks\n if (!this._onExportNotRunning.getValue()) {\n return;\n }\n this._onExportNotRunning.next(false);\n this._onSelect.next(false);\n const plansForExport = this._selectedItems[WizardStates.Overview] as ITaskManagementPlanBookGridData[];\n this._preparePlansForExport(plansForExport);\n if (!plansForExport || plansForExport.length <= 0 || !plansForExport[0].SourceItem?.ExportFormat) {\n return;\n }\n this.taskManagementStore.export(plansForExport.map(_ => _.SourceItem));\n }\n\n private _setSelectedRows(): void {\n if (this._selectedItems[this._activeWizardStep] && this._selectedItems[this._activeWizardStep].length > 0 &&\n this.dynComponent.dynGrid && this.dynComponent.dynGrid.gridPaging) {\n this.dynComponent.dynGrid.gridPaging.setSelectedKeys(\n this._selectedItems[this._activeWizardStep].map((d: any) => d.Id)\n );\n }\n this._isGridInitialized = true;\n }\n\n /*\n * Generic function to generate/build UI depending on current wizard state.\n */\n private _buildUi(): void {\n if (!this._uiConfigs.get(this._activeWizardStep)) {\n return;\n }\n this._isGridInitialized = false;\n this._onSelect.next(this._selectedItems[this._activeWizardStep]?.length > 0);\n this.fieldSets = this._uiConfigs.get(this._activeWizardStep).getFieldsetConfig(this._selectedItems[WizardStates.Details]);\n this.columns$ = this._uiConfigs.get(this._activeWizardStep).getGridColumnConfig();\n this.pager = this._uiConfigs.get(this._activeWizardStep).getPagerConfig(this.breadCrumbsColumns, this.data?.Type);\n this.changeDetection.detectChanges();\n }\n\n private _preparePlansForExport(plansForExport: ITaskManagementPlanBookGridData[]): void {\n // disable paging when exporting data and getting the item's real position in grid.\n // actual real position depends on user's sorting and filtering.\n const exportGridViewState = ObjectFactory.Copy(this.dynComponent?.dynGrid?.gridPaging?.state);\n exportGridViewState.take = undefined;\n exportGridViewState.skip = undefined;\n const exportGridView = process(this.dynComponent?.dynGrid?.gridPaging?.items, exportGridViewState);\n\n // use gridview to get the current row positions => exported like sorted in grid\n for (const p of plansForExport) {\n p.SourceItem.ExportedAt = new Date();\n p.SourceItem.Position = exportGridView?.data?.IndexOf(p) + 1;\n p.SourceItem.CountryCode = this.languageStore?.SelectedLanguage?.Key;\n }\n }\n}\n","import {AfterContentInit, Component, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {BehaviorSubject, combineLatest, Observable, of, Subscription} from 'rxjs';\nimport {map, skip} from 'rxjs/operators';\nimport {\n ApDynGridColumnConfigBase,\n ApDynGridColumnHideConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n TaskManagementDataProviders\n} from '../../task-management-data-providers/task-management-data-providers';\nimport {FieldStore} from '../../../stores/farm/field.store';\nimport {\n ApUtilService\n} from '../../../ap-utils/service/ap-util.service';\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 ApDynGridGroupColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-group-column-config';\nimport {\n ApDynGridEditColumnConfig\n} from '../../../ap-dyngrids/config/ap-dyn-grid-edit-column-config';\nimport {\n ApDynGridPagerConfigBase\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {\n ApDynGridPagerConfig,\n IDynGridWizardChoiceData\n} from '../../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {ApGridPagerType} from '../../../ap-interface';\nimport {FormStore} from '../../../stores/layout/form.store';\nimport {\n ModalDialogPresets\n} from '../../../stores/dialog/modal.dialog.presets';\nimport {\n ModalDialogStore\n} from '../../../stores/dialog/modal.dialog.store';\nimport {IRouterStateUrl} from '../../../stores/router/router.store';\nimport {\n ApDynComponentComponent\n} from '../../../ap-dyncomponent/ap-dyncomponent.component';\nimport {MapStore} from '../../../stores/map/map.store';\nimport {\n LanguageStore\n} from '../../../stores/translation/language.store';\nimport {DriverStore} from '../../../stores/docu/driver.store';\nimport {MachineStore} from '../../../stores/docu/machine.store';\nimport {\n InstrumentStore\n} from '../../../stores/docu/instrument.store';\nimport {ITaskManagementPlanBookGridData, ITaskManagementPlanSummaryGridData} from '../../task-management.types';\nimport {\n CropRotationStore\n} from '../../../stores/farm/crop.rotation.store';\nimport {\n FieldArchiveStore\n} from '../../../stores/farm/field-archive.store';\nimport {nameOf} from '../../../ap-core/utils/ap-name-of';\nimport {\n IGridStatus\n} from '../../../ap-interface/interfaces/ap-grid-status.interface';\nimport ILanguage = Data.Language.ILanguage;\nimport TaskManagementModule = Data.TaskManagement.TaskManagementModule;\nimport ITaskManagementPlanBook = Data.TaskManagement.ITaskManagementPlanBook;\nimport ITaskManagementPlanSummary = Data.TaskManagement.ITaskManagementPlanSummary;\nimport IFieldBase = Data.FieldManagement.IFieldBase;\nimport IMachine = Data.DocuContext.Machine.IMachine;\nimport IInstrument = Data.DocuContext.Instrument.IInstrument;\nimport IDriver = Data.DocuContext.Driver.IDriver;\n\n@Component({\n selector: 'task-management-edit',\n template: `\n \n \n `\n})\nexport class TaskManagementEditComponent implements OnInit, AfterContentInit, OnDestroy {\n @ViewChild(ApDynComponentComponent, {static: true}) dynComponent: ApDynComponentComponent;\n public data: { PlanSummary: ITaskManagementPlanSummaryGridData, RouterData?: IRouterStateUrl };\n public loading$: Observable = of(true);\n public items$ = new BehaviorSubject([]);\n public columns$: Observable;\n public pager: ApDynGridPagerConfigBase;\n\n private _subscriptions: Subscription[] = [];\n private _planBooks: ITaskManagementPlanBook[];\n private _planSummary: ITaskManagementPlanSummary;\n private _itemsToDelete: ITaskManagementPlanBook[];\n private _isDeleteAvailable = true;\n\n constructor(private dataProviders: TaskManagementDataProviders,\n private fieldStore: FieldStore,\n private formStore: FormStore,\n private mapStore: MapStore,\n private cropRotationStore: CropRotationStore,\n private modalDialogPresets: ModalDialogPresets,\n private modalDialogStore: ModalDialogStore,\n private languageStore: LanguageStore,\n private driverStore: DriverStore,\n private machineStore: MachineStore,\n private fieldArchiveStore: FieldArchiveStore,\n private instrumentStore: InstrumentStore) {\n }\n\n public ngOnInit(): void {\n this._planSummary = this.data?.PlanSummary?.SourceItem;\n this._planBooks = this.data?.PlanSummary?.SourceItem.PlanBooks;\n if (!this._planBooks || this._planBooks?.length === 0) {\n this._closeForm();\n return;\n }\n this.loading$ = combineLatest([\n this.cropRotationStore.Listen(x => x.historyLoading),\n this.languageStore.Listen(x => x.loading)\n ]).pipe(\n map(loadingItems => loadingItems.some(x => x))\n );\n this.columns$ = this._getColumns();\n this.pager = this._getPager();\n this.dataProviders[this._planSummary.Module].setSelectedGridIdFromPreviousPage(this._planSummary.Id);\n this._activateTaskManagementMapLayer();\n }\n\n public ngAfterContentInit(): void {\n this._subscriptions.push(this.dynComponent.gridInitialized.subscribe(() => {\n this._subscriptions.push(this.items$.subscribe(items => {\n const ids = items.map(x => x.Id);\n setTimeout(() => this.dynComponent.dynGrid.gridPaging.setSelectedKeys(ids), 1);\n }));\n this._subscriptions.push(this.dynComponent.SelectedItems$.subscribe(_ => this._selectionChange()));\n }));\n this._subscriptions.push(this.dataProviders[this._planSummary.Module].changesSaveStatus().subscribe(saved => {\n this._isDeleteAvailable = true;\n if (!saved || !this._itemsToDelete || !this._planBooks) {\n return;\n }\n this._planBooks = this._planBooks.filter(planBook => !this._itemsToDelete.some(z => z.Id === planBook.Id));\n this._itemsToDelete = [];\n if (this._planBooks.length > 0) {\n this.items$.next(this._getItems(this._planBooks));\n } else {\n this._closeForm();\n }\n }));\n this._subscriptions.push(this.cropRotationStore.GetHistory$.subscribe(() => {\n this.items$.next(this._getItems(this._planBooks));\n }));\n }\n\n public ngOnDestroy(): void {\n this._subscriptions.forEach(s => s.unsubscribe());\n }\n\n private _getColumns(): Observable {\n return combineLatest([\n this.languageStore.Listen(x => x.selectedLanguage)\n ]).pipe(\n map(([selectedLanguage]) => {\n const columns: ApDynGridColumnConfigBase[] = [];\n if (this._planSummary.Module === TaskManagementModule.GD_BasicFertilization) {\n columns.AddRange(this._getCommonBeginningGridColumnConfig());\n columns.AddRange(this._getBaseFertiGridColumnConfig());\n columns.AddRange(this._getCommonEndingGridColumnConfig(selectedLanguage));\n if (this._isBaseFertilisationPlanning()) {\n columns.AddRange(this._getBaseFertiGridEditColumnConfig());\n }\n } else if (this._planSummary.Module === TaskManagementModule.N_NFertilization) {\n columns.AddRange(this._getCommonBeginningGridColumnConfig());\n columns.AddRange(this._getNFertiGridColumnConfig());\n columns.AddRange(this._getCommonEndingGridColumnConfig(selectedLanguage));\n } else {\n columns.AddRange(this._getCommonBeginningGridColumnConfig());\n columns.AddRange(this._getCommonEndingGridColumnConfig(selectedLanguage));\n }\n return columns;\n })\n );\n }\n\n private _getPager(): ApDynGridPagerConfig {\n const listMassEditingSubject: BehaviorSubject = new BehaviorSubject([]);\n const listMassEditingObservable: Observable = listMassEditingSubject.asObservable();\n const pager = new ApDynGridPagerConfig({\n lowerButtons: [\n {\n name: 'Global_Back_With_Arrow',\n callback: ApUtilService.createEventEmitter(this._closeForm.bind(this), this._subscriptions)\n }\n ],\n listMassEditing: listMassEditingObservable\n });\n if (this._isBaseFertilisationPlanning()) {\n listMassEditingSubject.next([\n {\n id: 0,\n name: 'Global__Delete',\n type: ApGridPagerType.None,\n onSubmit: ApUtilService.createEventEmitter(this._deleteManyPlanningBooks.bind(this), this._subscriptions)\n }\n ]);\n }\n return pager;\n }\n\n private _getItems(planBooks: ITaskManagementPlanBook[]): ITaskManagementPlanBookGridData[] {\n return planBooks.map(planBook => {\n const field = this.fieldStore.Fields.find(f => f.Id === planBook.FieldId) ??\n this.fieldArchiveStore.getFieldArchiveById(planBook.FieldId);\n return {PlanBook: planBook, Field: field};\n }).map(fieldPlanBook => {\n const planBook = fieldPlanBook.PlanBook;\n const field = fieldPlanBook.Field;\n return {\n Id: planBook.Id,\n Field: field,\n Status: this.dataProviders[this._planSummary.Module].getStatus(planBook),\n ModuleText: this.dataProviders[this._planSummary.Module].getModuleText(planBook),\n ApplicationModeText: this.dataProviders[this._planSummary.Module].getApplicationModeText(planBook),\n OperationModeText: this.dataProviders[this._planSummary.Module].getOperationModeText(planBook),\n ElementName: this.dataProviders[this._planSummary.Module].getElementName(planBook),\n ProductName: this.dataProviders[this._planSummary.Module].getProductName(planBook),\n ProductUnitPerHa: this.dataProviders[this._planSummary.Module].getProductUnit(planBook, true),\n CropName: this.dataProviders[this._planSummary.Module].getCropName(planBook),\n AreaHa: this.dataProviders[this._planSummary.Module].getAreaHaSum(planBook),\n ApplRate: this.dataProviders[this._planSummary.Module].getApplRate(planBook),\n ApplMin: this.dataProviders[this._planSummary.Module].getApplMin(planBook),\n ApplMax: this.dataProviders[this._planSummary.Module].getApplMax(planBook),\n ApplSum: this.dataProviders[this._planSummary.Module].getApplSum(planBook),\n ApplDate: this.dataProviders[this._planSummary.Module].getDate(planBook.ApplDate),\n ExportDriver: this.driverStore.getDriverById(fieldPlanBook?.PlanBook?.ExportDriver?.Id),\n ExportMachine: this.machineStore.getMachineById(fieldPlanBook?.PlanBook?.ExportMachine?.Id),\n ExportInstrument: this.instrumentStore.getInstrumentById(fieldPlanBook?.PlanBook?.ExportInstrument?.Id),\n SelectedExportTargetObject: undefined,\n SourceItem: planBook\n } as ITaskManagementPlanBookGridData;\n });\n }\n\n private _selectionChange(): void {\n if (!this.dynComponent?.dynGrid?.gridPaging) {\n return;\n }\n const selectedPlanBooks = this.dynComponent.dynGrid.gridPaging.selectedItems as ITaskManagementPlanBookGridData[];\n if (selectedPlanBooks && selectedPlanBooks.length > 0) {\n const selectedPlans = this._planBooks\n .filter(sourceItemPlanBook => selectedPlanBooks.some(selectedPlanBook => selectedPlanBook.Id === sourceItemPlanBook.Id));\n this.fieldStore.changeSelectedField(selectedPlans.map(p => p.FieldId?.toString()));\n this.mapStore.Layers.TaskManagementLayer.replaceSource(selectedPlans, this.fieldStore);\n this.mapStore.Layers.TaskManagementLayer.ZoomIn(500);\n const dataProvider = this.dataProviders[this._planSummary.Module];\n const mapUrl = dataProvider?.getMapFactoryUrl(selectedPlans);\n if (mapUrl?.length > 0) {\n const legend = dataProvider?.getMapLegend(this._planSummary)();\n this.mapStore.Legends.TaskMgmtLegend = legend;\n this.mapStore.Legends.refreshLegend(legend, true);\n this.mapStore.Layers.TaskManagementNutrientLayer.Legend = () => legend;\n this.mapStore.Layers.TaskManagementNutrientLayer.update(mapUrl);\n } else {\n this.mapStore.Layers.TaskManagementNutrientLayer.clear();\n }\n setTimeout(() => dataProvider?.selectLegendItem(this._planSummary), 0);\n } else {\n this.mapStore.Layers.TaskManagementLayer.clear();\n this.mapStore.Layers.TaskManagementNutrientLayer.clear();\n this.fieldStore.changeSelectedField([]);\n }\n }\n\n private _isBaseFertilisationPlanning(): boolean {\n return this.data?.RouterData?.queryParams['url'] === this.dataProviders[TaskManagementModule.GD_BasicFertilization].getComponentUrl()\n && this.data.RouterData.queryParams['booking'] === undefined;\n }\n\n private _activateTaskManagementMapLayer(): void {\n this.mapStore.Layers.TaskManagementLayer.Visibility = true;\n this.mapStore.Layers.refreshActiveLayerGroups(this.mapStore.Layers.TaskManagementLayer).then();\n this.mapStore.Legends.refreshLegend(this.mapStore.Legends.TaskMgmtLegend, true);\n }\n\n private _editPlanningBook(bookPlanningToEdit: any): void {\n if (!this._planSummary || !bookPlanningToEdit) {\n return;\n }\n }\n\n private _deletePlanningBook(bookPlanningToDelete: ITaskManagementPlanBookGridData): void {\n if (!this._isDeleteAvailable || !this._planSummary || !bookPlanningToDelete) {\n return;\n }\n this.modalDialogStore.setModalDialogData(this.modalDialogPresets.DeleteDialog());\n const modalDialogSubscription = this.modalDialogStore.Listen(s => s.result)\n .pipe(skip(1))\n .subscribe((result) => {\n modalDialogSubscription.unsubscribe();\n if (result.key === 'delete') {\n this._deleteItems([bookPlanningToDelete]);\n }\n });\n }\n\n private _deleteManyPlanningBooks(bookPlanningsToDelete: any): void {\n if (!this._isDeleteAvailable || !this._planSummary || !bookPlanningsToDelete?.items) {\n return;\n }\n this._deleteItems(bookPlanningsToDelete.items);\n }\n\n private _deleteItems(items: ITaskManagementPlanBookGridData[]): void {\n this._itemsToDelete = this._planBooks.filter(x => items.some(bookPlanToDelete => x.Id === bookPlanToDelete.Id));\n if (this._itemsToDelete) {\n this._isDeleteAvailable = false;\n this.dataProviders[this._planSummary.Module].deletePlannings(this._itemsToDelete);\n }\n }\n\n private _closeForm(): void {\n setTimeout(() => this.formStore.closeForm(), 1);\n }\n\n /*\n * Columns which are same for all views at the beginning of the view\n */\n private _getCommonBeginningGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridStatusColumnConfig({\n field: `${nameOf('Status')}.${nameOf('state')}`,\n class: `${nameOf('Status')}.${nameOf('class')}`,\n description: `${nameOf('Status')}.${nameOf('description')}`\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Number',\n field: `${nameOf('Field')}.${nameOf('FieldNumber')}`,\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 50\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini_Subnumber',\n field: `${nameOf('Field')}.${nameOf('FieldSubnumber')}`,\n filterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n headerFilterable: true,\n width: 50\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldName',\n field: `${nameOf('Field')}.${nameOf('FieldName')}`,\n filterable: true,\n headerFilterable: true,\n sortIndex: 0,\n sortDesc: false,\n width: 160,\n cssClass: 'left',\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Area_Unit',\n field: nameOf('AreaHa'),\n cssClass: 'right',\n headerFilterable: true,\n filterable: true,\n width: 60,\n tooltip: (dataItem) => dataItem['AreaOriginal'],\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Crop',\n field: nameOf('CropName'),\n width: 100,\n cssClass: 'left',\n filterable: true,\n headerFilterable: true\n })\n ];\n }\n\n /*\n * Columns which are same for all views at the ending of the view\n */\n private _getCommonEndingGridColumnConfig(language: ILanguage): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients__FertilizationDate',\n field: nameOf('ApplDate'),\n format: language.DateFormat,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 100,\n tooltip: (dataItem) => this.dataProviders[this._planSummary.Module].getPlanNumberTooltip(dataItem),\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridGroupColumnConfig({\n title: 'agrioptions_resources',\n hide: true,\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'Base__Engine',\n field: `${nameOf('ExportMachine')}.${nameOf('NameWithSign')}`,\n hide: true,\n width: 100\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'AgriConnect_Ini__Tool',\n field: `${nameOf('ExportInstrument')}.${nameOf('Name')}`,\n hide: true,\n width: 100\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Motorist',\n field: `${nameOf('ExportDriver')}.${nameOf('ShortFullName')}`,\n hide: true,\n width: 100\n })\n ]\n })\n ];\n }\n\n /*\n * Columns for : Grunddüngung (Base fertilization)\n */\n private _getBaseFertiGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridGroupColumnConfig({\n title: this.dataProviders[this._planSummary.Module].getProductGridHeader(this._planSummary),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: nameOf('ProductName'),\n width: 120,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Average_Amount',\n field: nameOf('ApplRate'),\n tooltip: (dataItem) => dataItem?.ApplRate,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n width: 60,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: nameOf('ApplMin'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 60,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: nameOf('ApplMax'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 60,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n })\n ]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients_Pages_Popups__Distribution',\n field: nameOf('ApplicationModeText'),\n width: 100,\n headerFilterable: true,\n filterable: true\n })\n ];\n }\n\n /*\n * Columns for burger : Grunddüngung (Base fertilization)\n */\n private _getBaseFertiGridEditColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridEditColumnConfig(\n {\n data: [\n {\n text: 'Global__Edit',\n callback: ApUtilService.createEventEmitter(this._editPlanningBook.bind(this), this._subscriptions),\n disabled: () => true\n },\n {\n text: 'Global__Delete',\n callback: ApUtilService.createEventEmitter(this._deletePlanningBook.bind(this), this._subscriptions)\n },\n ]\n }\n )\n ];\n }\n\n /*\n * Columns for : ND-N Düngung\n */\n private _getNFertiGridColumnConfig(): ApDynGridColumnConfigBase[] {\n return [\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: nameOf('ProductName'),\n width: 120,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridGroupColumnConfig({\n title: this.dataProviders[this._planSummary.Module].getProductGridHeader(this._planSummary),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n title: 'AgriConnect_View__Reference',\n field: nameOf('ApplRate'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Min',\n field: nameOf('ApplMin'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Max',\n field: nameOf('ApplMax'),\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 90,\n headerFilterable: true,\n filterable: true,\n pipes: [{\n pipe: this.dataProviders.roundNumericPipe,\n args: [this.dataProviders.settingsStore.FirstSetting.DigitsAfterDecimalPoint]\n }]\n })\n ]\n })\n ];\n }\n}\n","import {NgModule} from '@angular/core';\nimport {Route, RouterModule} from '@angular/router';\nimport {ApPermissionGuard} from '../guards/ap-permission-guard.service';\nimport {PageMode} from '../ap-interface';\nimport {TaskManagementOverviewComponent} from './components/task-management-overview.component';\n\nexport const routes: Route[] = [\n {\n path: 'overview',\n component: TaskManagementOverviewComponent,\n canActivate: [ApPermissionGuard],\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 TaskManagementRoutes {\n}\n","import {AfterContentInit, ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {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 LanguageStore\n} from '../../stores/translation/language.store';\nimport {filter, map} from 'rxjs/operators';\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 ApDynGridEditColumnConfig\n} from '../../ap-dyngrids/config/ap-dyn-grid-edit-column-config';\nimport {\n SettingsStore\n} from '../../stores/base-data/settings.store';\nimport {\n ApDynGridPagerConfig,\n IDynGridWizardChoiceData,\n IGridPagerSubmitData\n} from '../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {ApGridPagerType, IWizardProperties} from '../../ap-interface';\nimport {\n ApUtilService\n} from '../../ap-utils/service/ap-util.service';\nimport {\n Icon\n} from '../../ap-interface/enums/layout/icon.enum';\nimport {\n ApDynComponentComponent\n} from '../../ap-dyncomponent/ap-dyncomponent.component';\nimport {\n ApDateService\n} from '../../ap-core/services/ap-date-service';\nimport {\n TranslationStore\n} from '../../stores/translation/translation.store';\nimport {\n FormStore\n} from '../../stores/layout/form.store';\nimport {\n TaskManagementWizardComponent\n} from './wizard/task-management-wizard.component';\nimport {\n TaskManagementStore\n} from '../../stores/task-management/task-management.store';\nimport {\n TaskManagementDataProviders\n} from '../task-management-data-providers/task-management-data-providers';\nimport {MapStore} from '../../stores/map/map.store';\nimport {\n CampaignYearStore\n} from '../../stores/login/campaignyear.store';\nimport {\n FieldStore\n} from '../../stores/farm/field.store';\nimport {\n IRouterStateUrl,\n RouterStore\n} from '../../stores/router/router.store';\nimport {GetRoundNumericPipe} from '../../ap-utils';\nimport {\n UserContactsStore\n} from '../../stores/base-data/user.contacts.store';\nimport {\n TerminalsStore\n} from '../../stores/base-data/terminals.store';\nimport {\n ApDynGridGroupColumnConfig\n} from '../../ap-dyngrids/config/ap-dyn-grid-group-column-config';\nimport {\n ApLegendScrollerService\n} from '../../map/components/layer-controller/ap-legend-scroller.service';\nimport {\n ApTooltipContentService\n} from '../../ap-utils/service/ap-tooltip-content.service';\nimport {\n LEGEND_IDS\n} from '../../ap-interface/enums/ap-legend-ids.enum';\nimport {\n TaskManagementEditComponent\n} from './editing/task-management-edit.component';\nimport {\n GetApplicationModeService\n} from '../../ap-utils/service/ap-get-applicationmode.service';\nimport {\n ITaskManagementPlanSummaryGridData,\n TaskManagementAction,\n TaskManagementWizardOpenConfig,\n TaskManagementWizardOpenConfigType\n} from '../task-management.types';\nimport {\n ISelectionChangeEvent\n} from '../../map/components/layer-controller/ap-legend-scroller-item.component';\nimport {\n WorkTypes\n} from '../../stores/base-data/worrktypes.store';\nimport {\n FieldArchiveStore\n} from '../../stores/farm/field-archive.store';\nimport {\n GetRoundNumericPipeConfig\n} from '../../ap-utils/pipes/configs/get-round-numeric.pipe.config';\nimport {\n IGridStatus\n} from '../../ap-interface/interfaces/ap-grid-status.interface';\nimport {\n nameOf\n} from '../../ap-core/utils/ap-name-of';\nimport ITaskManagementPlanSummary = Data.TaskManagement.ITaskManagementPlanSummary;\nimport TaskManagementModule = Data.TaskManagement.TaskManagementModule;\n\n@Component({\n selector: 'task-management-overview',\n template: `\n \n \n `\n})\nexport class TaskManagementOverviewComponent implements OnInit, AfterContentInit, OnDestroy {\n @ViewChild(ApDynComponentComponent, {static: true}) dynComponent: ApDynComponentComponent;\n public columns$: Observable = of([]);\n public items$: Observable;\n public loading$: Observable;\n public pager: ApDynGridPagerConfigBase;\n\n private _crossComponentCallData: IRouterStateUrl = undefined;\n private _wizardOpened = false;\n private _subscriptions: Subscription[] = [];\n\n constructor(private taskManagementStore: TaskManagementStore,\n private languageStore: LanguageStore,\n private fieldStore: FieldStore,\n private translationStore: TranslationStore,\n private settingsStore: SettingsStore,\n private dateService: ApDateService,\n private formStore: FormStore,\n private mapStore: MapStore,\n private roundNumericPipe: GetRoundNumericPipe,\n private campaignYearStore: CampaignYearStore,\n private dataProviders: TaskManagementDataProviders,\n private changeDetection: ChangeDetectorRef,\n private routerStore: RouterStore,\n private userContactsStore: UserContactsStore,\n private legendScrollerService: ApLegendScrollerService,\n private terminalsStore: TerminalsStore,\n private tooltipService: ApTooltipContentService,\n private fieldArchiveStore: FieldArchiveStore,\n private applicationModeService: GetApplicationModeService) {\n }\n\n public ngOnInit(): void {\n this.loading$ = combineLatest([\n this.taskManagementStore.Listen(s => s.loading),\n this.campaignYearStore.Listen(c => c.loading),\n this.userContactsStore.Listen(c => c.loading),\n this.terminalsStore.Listen(c => c.loading),\n this.fieldStore.Listen(f => f.loading)]\n ).pipe(\n map(items => items.some(x => x))\n );\n this.pager = this._getPager();\n this.columns$ = this._getColumns();\n this.items$ = this._getItems();\n }\n\n public ngAfterContentInit(): void {\n this._subscriptions.push(combineLatest([\n this.routerStore.Listen(s => s),\n this.campaignYearStore.Listen(s => s.selectedYear)\n ]).subscribe(([routerStoreData, _]) => {\n this._onRouterServiceOrSelectedYearChanged(routerStoreData);\n }));\n this._subscriptions.push(this.formStore.FormClose$.subscribe(() => {\n // force detect changes in case wizard closes - ignore all kind of other forms.\n // do not reload if it was a navigation from another component\n this._onFormClose();\n }));\n this._subscriptions.push(this.legendScrollerService.selectionChange.subscribe((event: ISelectionChangeEvent): void => {\n this._onScrollerLegendServiceSelectionChange(event);\n }));\n this._subscriptions.push(this.dynComponent.SelectedItems$.subscribe(_ => this._selectionChange()));\n }\n\n public ngOnDestroy(): void {\n this._subscriptions.forEach(s => s.unsubscribe());\n }\n\n private _getItems(): Observable {\n return combineLatest([\n this.taskManagementStore.Listen(d => d.data),\n this.campaignYearStore.Listen(s => s.selectedYear),\n this.fieldStore.Listen(f => f.data),\n this.fieldArchiveStore.Listen(s => s.loaded)\n ]).pipe(\n filter(([taskManagement, campaignYear, fields, fieldArchiveLoaded]) =>\n taskManagement && campaignYear && fields && fields?.length > 0 && fieldArchiveLoaded),\n map(([taskManagement]) => taskManagement.map(planSummary => {\n const userApplRate = this.dataProviders[planSummary.Module].getApplRate(planSummary);\n const result: ITaskManagementPlanSummaryGridData = {\n Id: planSummary.Id,\n SourceItem: planSummary,\n Status: this.getSummaryStatus(planSummary),\n Module: planSummary.Module,\n Note: planSummary.Remark,\n UserApplRate: userApplRate,\n ProductUnitPerHa: !!userApplRate ? this.dataProviders[planSummary.Module].getProductUnit(planSummary, true) : '',\n UserApplSum: this.dataProviders[planSummary.Module].getApplSum(planSummary),\n ProductUnit: this.dataProviders[planSummary.Module].getProductUnit(planSummary, false),\n FieldsTooltip: this.tooltipService.getFieldsCropsTooltip(planSummary.PlanBooks),\n ApplDate: this.dateService.getDateMidnight(this.dataProviders[planSummary.Module].getDate(planSummary.ApplDate)),\n ApplicationModeText: this.dataProviders[planSummary.Module].getApplicationModeText(planSummary),\n ModuleText: this.dataProviders[planSummary.Module].getModuleText(planSummary),\n OperationModeText: this.dataProviders[planSummary.Module].getOperationModeText(planSummary),\n ElementName: this.dataProviders[planSummary.Module].getElementName(planSummary),\n ProductName: this.dataProviders[planSummary.Module].getProductName(planSummary),\n AreaHaSum: this.dataProviders[planSummary.Module].getAreaHaSum(planSummary),\n ApplUnitPerHa: this.dataProviders[planSummary.Module].getApplUnit(planSummary, true),\n AlreadyExported: this.dataProviders[planSummary.Module].getAlreadyExported(planSummary)\n };\n return result;\n }))\n );\n }\n\n private _getPager(): ApDynGridPagerConfigBase {\n return new ApDynGridPagerConfig({\n preselect: false,\n listMassEditing: this._getActions(),\n iconButtons: [\n {\n icon: Icon.PDF,\n callback: ApUtilService.createEventEmitter(this._onPdf.bind(this), this._subscriptions),\n tooltip: 'Global__Save_PDF'\n },\n {\n icon: Icon.XLS,\n callback: ApUtilService.createEventEmitter(this._onXlsPrint.bind(this), this._subscriptions),\n tooltip: 'Global__Save_EXCEL'\n }\n ]\n });\n }\n\n private _getColumns(): Observable {\n return combineLatest([\n this.languageStore.Listen(s => s.selectedLanguage),\n this.settingsStore.Listen(s => s.data)\n ]).pipe(\n filter(([language, settings]) => !!language && settings.length !== 0),\n map(([language, settings]) => ({language, setting: settings[0]})),\n map((p) => {\n return [\n new ApDynGridStatusColumnConfig({\n field: `${nameOf('Status')}.${nameOf('state')}`,\n class: `${nameOf('Status')}.${nameOf('class')}`,\n description: `${nameOf('Status')}.${nameOf('description')}`,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Nutrients__FertilizationDate',\n field: nameOf('ApplDate'),\n headerFilterable: true,\n format: p.language.DateFormat,\n tooltip: (dataItem) => this.dataProviders[dataItem?.Module].getPlanNumberTooltip(dataItem),\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 160,\n sortIndex: 1,\n sortDesc: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Module',\n field: nameOf('ModuleText'),\n headerFilterable: true,\n width: 80,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__OperationMode',\n field: nameOf('OperationModeText'),\n headerFilterable: true,\n width: 130,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'AgriConnect__Nutrient',\n field: nameOf('ElementName'),\n headerFilterable: true,\n width: 120,\n filterable: true,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n })\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Product',\n field: nameOf('ProductName'),\n headerFilterable: true,\n width: 180,\n multiline: true,\n filterable: true,\n tooltip: (dataItem: any) => dataItem['ProductTooltip']\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global_ha_Unit',\n field: nameOf('AreaHaSum'),\n tooltip: (dataItem) => dataItem?.AreaHaSum,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 70,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [p.setting.DigitsAfterDecimalPoint]\n }],\n filterable: true\n }),\n new ApDynGridGroupColumnConfig({\n title: `${this.translationStore.FindTranslationForSelectedLanguage('Nutrients__Average_Amount_Goods')} / ` +\n `${this.translationStore.FindTranslationForSelectedLanguage('Global__Remaining_Need_Two_Short')}`,\n headerStyle: {'text-align': 'center'},\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n field: nameOf('UserApplRate'),\n width: 80,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n tooltip: (dataItem) => dataItem?.UserApplRate,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [0, GetRoundNumericPipeConfig.NullAndZeroToEmptyReplaceConfig]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: nameOf('ProductUnitPerHa'),\n width: 60\n })\n ]\n }),\n new ApDynGridGroupColumnConfig({\n title: `${this.translationStore.FindTranslationForSelectedLanguage('Global__Sum')} ` +\n `${this.translationStore.FindTranslationForSelectedLanguage('Product')}`,\n headerStyle: {'text-align': 'center'},\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n groupColumns: [\n new ApDynGridPropertyColumnConfig({\n field: nameOf('UserApplSum'),\n tooltip: (dataItem) => Number.isFinite(dataItem?.UserApplSum) ? `${dataItem?.UserApplSum} ${dataItem?.ProductUnit}` : undefined,\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 80,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [p.setting.DigitsAfterDecimalPoint, GetRoundNumericPipeConfig.NullToEmptyReplaceConfig]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: nameOf('ProductUnit'),\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n width: 60,\n filterable: true\n })\n ]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Base__Fields',\n field: nameOf('AlreadyExported'),\n hide: new ApDynGridColumnHideConfig({\n mapHide: true\n }),\n headerExtraLines: ['Task_Mgmt_Already_Exported'],\n tooltip: (dataItem: ITaskManagementPlanSummaryGridData) => dataItem?.FieldsTooltip,\n width: 120,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Note',\n field: nameOf('Note'),\n width: 120,\n filterable: true,\n headerFilterable: true,\n }),\n new ApDynGridEditColumnConfig({\n data: this._getActions().map(a => ({\n text: a.name,\n callback: a.onSubmit,\n disabled: a.id === 0 ? this._exportDisabledSingleEdit : a.id === 2 ? this._bookDisabledSingleEdit : undefined\n })),\n disabled: false\n })\n ];\n })\n );\n }\n\n private _getActions(): IDynGridWizardChoiceData[] {\n return [\n {\n id: 0,\n name: 'Task_Mgmt_Export',\n type: ApGridPagerType.None,\n values: [],\n onSubmit: ApUtilService.createEventEmitter(this._onExportClicked.bind(this), this._subscriptions),\n disabled: this._exportDisabledMassEdit\n },\n {\n id: 1,\n name: 'Global__Show',\n type: ApGridPagerType.None,\n values: [],\n onSubmit: ApUtilService.createEventEmitter(this._onShowClicked.bind(this), this._subscriptions)\n },\n {\n id: 2,\n name: 'Admin_Pages_Popups__Book',\n type: ApGridPagerType.None,\n values: [],\n onSubmit: ApUtilService.createEventEmitter(this._onBookClicked.bind(this), this._subscriptions),\n disabled: this._bookDisabledMassEdit\n }\n ];\n }\n\n private _selectionChange(): void {\n if (!this.dynComponent || !this.dynComponent.dynGrid || !this.dynComponent.dynGrid.gridPaging) {\n return;\n }\n const selectedSummaries = this.dynComponent.dynGrid.gridPaging.selectedItems as ITaskManagementPlanSummaryGridData[];\n if (selectedSummaries && selectedSummaries.length > 0 && selectedSummaries[0].SourceItem?.PlanBooks != null) {\n const selectedPlans = selectedSummaries[0].SourceItem.PlanBooks;\n this.mapStore.Layers.TaskManagementLayer.replaceSource(selectedPlans, this.fieldStore);\n this.mapStore.Layers.TaskManagementLayer.ZoomIn(500);\n const dataProvider = this.dataProviders[selectedSummaries[0].SourceItem.Module];\n const mapUrl = dataProvider?.getMapFactoryUrl(selectedPlans);\n if (mapUrl?.length > 0) {\n const legend = dataProvider?.getMapLegend(selectedSummaries[0].SourceItem)();\n this.mapStore.Legends.TaskMgmtLegend = legend;\n this.mapStore.Legends.refreshLegend(legend, true);\n this.mapStore.Layers.TaskManagementNutrientLayer.Legend = () => legend;\n this.mapStore.Layers.TaskManagementNutrientLayer.Tooltip = dataProvider?.getMapLayerTooltip();\n this.mapStore.Layers.TaskManagementNutrientLayer.update(mapUrl);\n } else {\n this.mapStore.Layers.TaskManagementNutrientLayer.clear();\n }\n setTimeout(() => dataProvider?.selectLegendItem(selectedSummaries[0].SourceItem), 0);\n } else {\n this.mapStore.Layers.TaskManagementLayer.clear();\n this.mapStore.Layers.TaskManagementNutrientLayer.clear();\n this.fieldStore.zoomFarmFields();\n }\n }\n\n private _onRouterServiceOrSelectedYearChanged(routerStoreData: IRouterStateUrl): void {\n this.userContactsStore.loadUserContacts();\n this.terminalsStore.loadTerminals();\n // load only id which was passed:\n if (!routerStoreData.url?.startsWith('/task-management/overview')) {\n return;\n }\n if (routerStoreData.queryParams['id'] !== undefined && !this._crossComponentCallData) {\n this._crossComponentCallData = routerStoreData;\n const showBookings = routerStoreData.queryParams['bookings'] !== undefined;\n this.taskManagementStore.loadTaskManagementPlanSummaries(routerStoreData.queryParams['id'], showBookings);\n this._subscriptions.push(this.items$.subscribe(items => {\n // Whenever items are done with loading we might do some magic in case it was cross component call\n if (!this._crossComponentCallData || this._wizardOpened) {\n return;\n }\n const targetItem = items?.Find(d => d.Id === this._crossComponentCallData.queryParams['id']);\n if (!targetItem) {\n return;\n }\n this._wizardOpened = true;\n const showOnly = this._crossComponentCallData.queryParams['show'] !== undefined;\n setTimeout(() => {\n const componentToRedirect = showOnly ? TaskManagementEditComponent : TaskManagementWizardComponent;\n const dataObject = {PlanSummary: targetItem, RouterData: this._crossComponentCallData};\n if (!showOnly) {\n dataObject['Type'] = TaskManagementWizardOpenConfigType.Export;\n }\n this.formStore.openForm({\n component: componentToRedirect,\n data: dataObject\n });\n if (this._crossComponentCallData.queryParams['url']) {\n this._subscriptions.push(this.formStore.FormClose$.subscribe(() => {\n this.routerStore.navigate([this._crossComponentCallData.queryParams['url']]).then();\n }));\n }\n }, 0);\n }));\n } else {\n this.taskManagementStore.loadTaskManagementPlanSummaries();\n }\n }\n\n private _onFormClose(): void {\n const updatedComponent = this.formStore.Listen(s => s.updateComponent).getValue();\n if (!this._crossComponentCallData && updatedComponent && updatedComponent.data &&\n (updatedComponent.data?.PlanSummary?.SourceItem as ITaskManagementPlanSummary)?.PlanNumber && this._wizardOpened) {\n this._wizardOpened = false;\n this.changeDetection.detectChanges();\n this.taskManagementStore.loadTaskManagementPlanSummaries();\n }\n }\n\n private _onScrollerLegendServiceSelectionChange(event: ISelectionChangeEvent): void {\n if (event.legend?.id !== LEGEND_IDS.TASK_MANAGEMENT || !event.selectionKeys || event.selectionKeys.length < 1) {\n return;\n }\n const selectedSummaries = this.dynComponent?.dynGrid?.gridPaging?.selectedItems as ITaskManagementPlanSummaryGridData[];\n if (!selectedSummaries || selectedSummaries?.length < 1) {\n return;\n }\n const selectedPlans = selectedSummaries[0].SourceItem.PlanBooks;\n if (!selectedPlans || selectedPlans?.length < 1) {\n return;\n }\n const dataProvider = this.dataProviders[selectedSummaries[0].SourceItem.Module];\n const mapUrl = dataProvider?.getMapFactoryUrl(selectedPlans, event.selectionKeys[0].toLowerCase());\n this.mapStore.Layers.TaskManagementNutrientLayer.update(mapUrl);\n }\n\n private getSummaryStatus(summary: ITaskManagementPlanSummary): IGridStatus {\n const applicationModeText = this.dataProviders[summary.Module].getApplicationModeText(summary);\n return {\n state: this.applicationModeService.GetApplicationModeStatus(summary?.ApplicationMode)?.state,\n class: this.applicationModeService.GetApplicationModeStatus(summary?.ApplicationMode)?.class,\n description: applicationModeText\n };\n }\n\n private _onExportClicked(item: any | IGridPagerSubmitData): void {\n const pagerItems = item as IGridPagerSubmitData;\n if (pagerItems && pagerItems.items) {\n item = pagerItems.items[0];\n }\n if (!item) {\n return;\n }\n const wizardOpenConfig = new TaskManagementWizardOpenConfig();\n wizardOpenConfig.PlanSummary = item;\n wizardOpenConfig.Type = TaskManagementWizardOpenConfigType.Export;\n\n // The user might not have selected the row, but using the button to export\n // Without selecting the row we will get an 'ExpressionHasBeenChangedAfter...' exception\n this.dynComponent.dynGrid.gridPaging.setSelectedKeys([item.Id]);\n this._wizardOpened = true;\n this.formStore.openForm({component: TaskManagementWizardComponent, data: wizardOpenConfig});\n }\n\n private _onShowClicked(item: any | IGridPagerSubmitData): void {\n const pagerItems = item as IGridPagerSubmitData;\n if (pagerItems && pagerItems.items) {\n item = pagerItems.items[0];\n }\n if (!item) {\n return;\n }\n\n // The user might not have selected the row, but using the button to export\n // Without selecting the row we will get an 'ExpressionHasBeenChangedAfter...' exception\n this.dynComponent.dynGrid.gridPaging.setSelectedKeys([item.Id]);\n this._wizardOpened = true;\n this.formStore.openForm({\n component: TaskManagementEditComponent,\n data: {PlanSummary: item, RouterData: this._crossComponentCallData}\n });\n }\n\n private _onBookClicked(item: any | IGridPagerSubmitData): void {\n this._navigateToEditBookModule(item, TaskManagementAction.Booking);\n }\n\n private _navigateToEditBookModule(item: any | IGridPagerSubmitData, action: TaskManagementAction): void {\n const pagerItems = item as IGridPagerSubmitData;\n if (pagerItems && pagerItems.items) {\n item = pagerItems.items[0];\n }\n if (!item) {\n return;\n }\n this.routerStore.navigate([this.dataProviders[item?.SourceItem.Module].getComponentUrl()], {\n id: item.Id,\n action,\n url: 'task-management/overview'\n }).then();\n }\n\n private _exportDisabledMassEdit = (item: IWizardProperties) => {\n const module = item?.selectedItems?.FirstOrDefault()?.Module;\n if (module !== TaskManagementModule.PS_Fertilization) {\n return false;\n }\n const summary = item?.selectedItems?.FirstOrDefault()?.SourceItem;\n return summary?.PlanBooks?.FirstOrDefault()?.PpProductList?.FirstOrDefault()?.ProductListDetails?.WorkType !== WorkTypes.Spraying;\n }\n\n private _exportDisabledSingleEdit = (item: ITaskManagementPlanSummaryGridData) => {\n const module = item?.Module;\n if (module !== TaskManagementModule.PS_Fertilization) {\n return false;\n }\n const summary = item?.SourceItem;\n return summary?.PlanBooks?.FirstOrDefault()?.PpProductList?.FirstOrDefault()?.ProductListDetails?.WorkType !== WorkTypes.Spraying;\n }\n\n private _bookDisabledMassEdit = (item: IWizardProperties) => {\n const module = item?.selectedItems?.FirstOrDefault()?.Module;\n return module === TaskManagementModule.N_NFertilization || module === TaskManagementModule.PS_Fertilization;\n }\n\n private _bookDisabledSingleEdit = (item: ITaskManagementPlanSummaryGridData) => {\n const module = item?.Module;\n return module === TaskManagementModule.N_NFertilization || module === TaskManagementModule.PS_Fertilization;\n }\n\n private _onXlsPrint(): void {\n this.dynComponent.dynGrid.xlsExportFileName = this._generatePrintFilename();\n this.dynComponent.dynGrid.exportAsXls();\n }\n\n private _onPdf(): void {\n this.dynComponent.dynGrid.pdfExportFileName = this._generatePrintFilename();\n this.dynComponent.dynGrid.exportAsPdf();\n }\n\n private _generatePrintFilename(): string {\n return this.dateService.toFarmDate(new Date()).format('YYMMDD') + '_' +\n this.translationStore.FindTranslationForSelectedLanguage('AgriConnect__Taskmanagement');\n }\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ApDynComponentModule} from '../ap-dyncomponent/ap-dyncomponent.module';\nimport {TaskManagementRoutes} from './task-management.routes';\nimport {ApCoreModule} from '../ap-core/ap-core.module';\nimport {ApResponsiveTextModule} from '../ap-responsive-text/ap-responsive-text.module';\nimport {ButtonModule} from '@progress/kendo-angular-buttons';\nimport {TaskManagementOverviewComponent} from './components/task-management-overview.component';\nimport {TaskManagementWizardComponent} from './components/wizard/task-management-wizard.component';\nimport {ApReportsModule} from '../ap-reports/ap-reports.module';\nimport {ApMapModule} from '../map/ap-map.module';\nimport {TaskManagementEditComponent} from './components/editing/task-management-edit.component';\n\n@NgModule({\n declarations: [\n TaskManagementOverviewComponent,\n TaskManagementWizardComponent,\n TaskManagementEditComponent\n ],\n exports: [\n TaskManagementOverviewComponent,\n TaskManagementWizardComponent\n ],\n imports: [\n CommonModule,\n ApDynComponentModule,\n TaskManagementRoutes,\n ApCoreModule,\n ApResponsiveTextModule,\n ButtonModule,\n ApReportsModule,\n ApMapModule\n ],\n providers: []\n})\nexport class TaskManagementModule {\n}\n"],"sourceRoot":"webpack:///","file":"90.bc881b6c8f00c9b5.js"}