{ "version": 3, "sources": ["client/app/modules/shared/service-add/service-add.component.ts", "client/app/modules/shared/service-add/service-add.component.html"], "sourcesContent": ["import { Component, Inject, OnInit } from \"@angular/core\";\nimport {\n MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA,\n MatLegacyDialogRef as MatDialogRef,\n} from \"@angular/material/legacy-dialog\";\nimport { TranslateService } from \"@ngx-translate/core\";\nimport { GridDataSource } from \"../data-grid/data-grid.datasource\";\nimport { DataGridComponent } from \"../data-grid/data-grid.interface\";\nimport { DataGridService } from \"../data-grid/data-grid.service.interface\";\nimport { ServiceSummaryDTO } from \"../dto-models/serviceSummaryDTO.model\";\nimport { DataGridColumn } from \"../models/dataGridColumn.model\";\n\n@Component({\n selector: \"bs-service-add\",\n templateUrl: \"./service-add.component.html\",\n styleUrls: [\"./service-add.component.scss\"],\n})\nexport class ServiceAddComponent\n implements DataGridComponent, OnInit\n{\n dataSource: GridDataSource;\n dataGridService: DataGridService;\n existingServices: ServiceSummaryDTO[];\n existingServiceIds: number[];\n\n columns: DataGridColumn[] = [];\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: any,\n public translate: TranslateService,\n private dialogRef: MatDialogRef,\n ) {\n this.dataGridService = data.gridService;\n this.existingServices = data.existingServices;\n this.existingServiceIds = this.existingServices.map(service => service.id);\n\n this.columns = [\n {\n property: \"checkbox\",\n visible: true,\n sticky: true,\n },\n {\n name: this.translate.instant(\"SERVICE.COLUMNS.SERVICENAME\"),\n property: \"serviceName\",\n visible: true,\n isModelProperty: true,\n sortable: true,\n flexGrow: \"0.4\",\n },\n {\n name: this.translate.instant(\"SERVICE.COLUMNS.PARENTSERVICE\"),\n property: \"parentService\",\n visible: true,\n isModelProperty: true,\n sortable: true,\n flexGrow: \"0.4\",\n },\n {\n name: this.translate.instant(\"SERVICE.COLUMNS.CATEGORYNAME\"),\n property: \"categoryName\",\n visible: true,\n isModelProperty: true,\n sortable: true,\n flexGrow: \"0.4\",\n },\n ] as DataGridColumn[];\n }\n\n ngOnInit(): void {\n this.dataSource = new GridDataSource(\n this.dataGridService,\n );\n\n this.setDataSource();\n }\n\n saveAndClose(): void {\n const checkedServices = this.dataSource?.selectedRowIds?.map(Number);\n var selectedServices = this.existingServices.filter(\n (service) => checkedServices.includes(service.id),\n );\n selectedServices = selectedServices.concat(this.dataSource.selectedDataSourceRows);\n this.dialogRef.close(selectedServices);\n }\n\n close(): void {\n this.dialogRef.close(undefined);\n }\n\n setDataSource(): void {\n const filter: DataGridColumn[] = [\n {\n property: \"status\",\n filterValue: 3,\n },\n ];\n\n if (this.data.locationTypeId) {\n filter.push({\n property: \"locationTypeId\",\n filterValue: this.data.locationTypeId,\n });\n }\n\n if (this.data.locationId) {\n filter.push({\n property: \"locationId\",\n filterValue: this.data.locationId,\n });\n }\n\n if (this.data.buildingId) {\n filter.push({\n property: \"buildingId\",\n filterValue: this.data.buildingId,\n });\n }\n\n if (this.data.serviceId) {\n filter.push({\n property: \"thisServiceId\",\n filterValue: this.data.serviceId,\n });\n }\n\n this.dataSource.filter = filter;\n }\n}\n", "
\n
\n
\n

{{ \"LOCATION.FORM.TABS.SERVICES\" | translate }}

\n \n \n {{ \"ACTIONS.SAVE_CLOSE\" | translate }}\n \n \n {{ \"ACTIONS.CLOSE\" | translate }}\n \n\n \n \n filter_list\n \n
\n
\n \n \n
\n\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAiBa;AAjBb;;AACA;AAKA;;;;;;;;;AAWM,IAAO,sBAAP,MAAO,qBAAmB;MAWI;MACzB;MACC;MAVV;MACA;MACA;MACA;MAEA,UAA4B,CAAA;MAE5B,YACkC,MACzB,WACC,WAA4C;AAFpB,aAAA,OAAA;AACzB,aAAA,YAAA;AACC,aAAA,YAAA;AAER,aAAK,kBAAkB,KAAK;AAC5B,aAAK,mBAAmB,KAAK;AAC7B,aAAK,qBAAqB,KAAK,iBAAiB,IAAI,aAAW,QAAQ,EAA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