From 14d4db611352bc59c0a1ae5b6cbb1ac1bb4832df Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 11 May 2023 15:17:12 +0200 Subject: [PATCH] wip refactoring 2 --- .../src/app/components/ag-grid-component.ts | 2 - .../plp-angular/src/app/factory/factory.ts | 8 +- .../grid-select-renderer.component.ts | 8 +- .../grid-text-renderer.component.ts | 4 +- .../src/app/model/virtual/meeting-data.ts | 4 +- .../src/app/services/customer.service.ts | 70 ++++---- .../src/app/services/meeting.service.ts | 162 +++++++++--------- httpdocs/plp-angular/src/app/utils/utils.ts | 66 +++---- .../customer-contact-list.component.ts | 24 +-- .../customer-management.component.ts | 64 +++---- .../customer-meeting-detail.component.ts | 30 ++-- .../customer-meeting-view.component.ts | 2 +- .../customer-note-view.component.ts | 2 +- .../meeting-list/meeting-list.component.ts | 18 +- .../src/environments/environment.ts | 10 +- httpdocs/plp-angular/src/environments/path.ts | 2 +- httpdocs/plp-angular/tsconfig.app.json | 3 + 17 files changed, 229 insertions(+), 250 deletions(-) diff --git a/httpdocs/plp-angular/src/app/components/ag-grid-component.ts b/httpdocs/plp-angular/src/app/components/ag-grid-component.ts index 4539be6..d26fe62 100644 --- a/httpdocs/plp-angular/src/app/components/ag-grid-component.ts +++ b/httpdocs/plp-angular/src/app/components/ag-grid-component.ts @@ -103,7 +103,6 @@ export class AgGridComponent { /** * On cell editing stopped - * @param e */ public onCellEditingStopped(e): void { if (null !== AgGridComponentConst.gridInputError) { @@ -117,7 +116,6 @@ export class AgGridComponent { /** * Sizes columns to fit - * @param params */ public onFirstDataRendered(params: any): void { // Set for info components diff --git a/httpdocs/plp-angular/src/app/factory/factory.ts b/httpdocs/plp-angular/src/app/factory/factory.ts index b16dab3..e642d2a 100644 --- a/httpdocs/plp-angular/src/app/factory/factory.ts +++ b/httpdocs/plp-angular/src/app/factory/factory.ts @@ -15,10 +15,10 @@ import {IProduction} from '../model/entities/production'; import {IProductionContact} from '../model/entities/production-contact'; import {IProductionNote} from '../model/entities/production-note'; import {IProductionMeeting} from '../model/entities/production-meeting'; -import {IService} from "../model/entities/service"; -import {IServiceContact} from "../model/entities/service-contact"; -import {IServiceNote} from "../model/entities/service-note"; -import {IServiceMeeting} from "../model/entities/service-meeting"; +import {IService} from '../model/entities/service'; +import {IServiceContact} from '../model/entities/service-contact'; +import {IServiceNote} from '../model/entities/service-note'; +import {IServiceMeeting} from '../model/entities/service-meeting'; export class Factory { static getEmptyUser(): IUser { diff --git a/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-select/grid-select-renderer/grid-select-renderer.component.ts b/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-select/grid-select-renderer/grid-select-renderer.component.ts index 4500238..06b91d0 100644 --- a/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-select/grid-select-renderer/grid-select-renderer.component.ts +++ b/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-select/grid-select-renderer/grid-select-renderer.component.ts @@ -67,10 +67,10 @@ export class GridSelectRendererComponent extends GridRendererComponent { const itemValueKeys: string[] = params.colDef.cellEditorParams.itemValueKeys; // Get item range by related value - this.itemRange = params.data.hasOwnProperty(relatedValue) && null !== params.data[relatedValue]) ? - params.colDef.cellEditorParams.values[params.data[relatedValue]] : null; + this.itemRange = params.data.hasOwnProperty(relatedValue) && null !== params.data[relatedValue]; ) ? + params.colDef.cellEditorParams.values[params.data[relatedValue]]; : null; - if (null !== params.value && null !== this.itemRange)) { + if (null !== params.value && null !== this.itemRange) { } } {) { // let value: string = GridFactory.getGridSelectItemValue() for (let i = 0; i < this.itemRange.length; i++) { if (this.itemRange[i][itemKey] === params.value) { @@ -78,7 +78,7 @@ export class GridSelectRendererComponent extends GridRendererComponent { break; } } - } else { + } else { this.value = 'Bitte wählen'; } } diff --git a/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-text/grid-text-renderer/grid-text-renderer.component.ts b/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-text/grid-text-renderer/grid-text-renderer.component.ts index f2b331e..1a8fffc 100644 --- a/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-text/grid-text-renderer/grid-text-renderer.component.ts +++ b/httpdocs/plp-angular/src/app/grid-cellrenderer/grid-text/grid-text-renderer/grid-text-renderer.component.ts @@ -18,10 +18,10 @@ export class GridTextRendererComponent extends GridRendererComponent { if (undefined !== this.cellParams) { // Replace "." with "," for display purpose if (this.cellParams.type === AgGridComponentConst.CELL_VALUE_TYPE_FLOAT) { - this.value = isNaN(this.value) || null === this.value) ? '' : this.value = parseFloat(parseFloat(this.value).toFixed(2)).toLocaleString('de-DE'); + this.value = isNaN(this.value) || null === this.value; ) ? ''; : this.value = parseFloat(parseFloat(this.value).toFixed(2)).toLocaleString('de-DE'); } if (this.cellParams.type == AgGridComponentConst.CELL_VALUE_TYPE_INT) { - this.value = isNaN(this.value) || null === this.value) ? '' : this.value = parseInt(parseInt(this.value).toFixed(2)).toLocaleString('de-DE'); + this.value = isNaN(this.value) || null === this.value; ) ? ''; : this.value = parseInt(parseInt(this.value).toFixed(2)).toLocaleString('de-DE'); } } } diff --git a/httpdocs/plp-angular/src/app/model/virtual/meeting-data.ts b/httpdocs/plp-angular/src/app/model/virtual/meeting-data.ts index 452c503..3c9f121 100644 --- a/httpdocs/plp-angular/src/app/model/virtual/meeting-data.ts +++ b/httpdocs/plp-angular/src/app/model/virtual/meeting-data.ts @@ -1,8 +1,8 @@ import {ICustomerMeeting} from '../entities/customer-meeting'; import {IInternalMeeting} from '../entities/internal-meeting'; import {IOperatorMeeting} from '../entities/operator-meeting'; -import {IProductionMeeting} from "../entities/production-meeting"; -import {IServiceMeeting} from "../entities/service-meeting"; +import {IProductionMeeting} from '../entities/production-meeting'; +import {IServiceMeeting} from '../entities/service-meeting'; export interface IMeetingData { customerMeetings: ICustomerMeeting[]; diff --git a/httpdocs/plp-angular/src/app/services/customer.service.ts b/httpdocs/plp-angular/src/app/services/customer.service.ts index 62e7b00..16f0b3a 100644 --- a/httpdocs/plp-angular/src/app/services/customer.service.ts +++ b/httpdocs/plp-angular/src/app/services/customer.service.ts @@ -40,21 +40,21 @@ export class CustomerService { * @param {IAppServiceData} serviceData */ public handleServiceData(serviceData: IAppServiceData = null): void { - if (!null === serviceData)) { - let bSetNewData = false; - let updatedCustomers: ICustomer[] = this.customers.getValue(); - let updatedCustomerContacts: ICustomerContact[] = this.customerContacts.getValue(); - if (!null === serviceData.customers)) { + if (!null === serviceData) { } } {) { + const bSetNewData = false; + const updatedCustomers: ICustomer[] = this.customers.getValue(); + const updatedCustomerContacts: ICustomerContact[] = this.customerContacts.getValue(); + if (!null === serviceData.customers) { } } {) { // Update service data updatedCustomers = ServiceHelper.updateServiceEntries(serviceData.customers, this.customers.getValue()) as ICustomer[]; bSetNewData = true; } - if (!null === serviceData.customerContacts)) { + if (!null === serviceData.customerContacts) { } } {) { // Update service data updatedCustomerContacts = ServiceHelper.updateServiceEntries(serviceData.customerContacts, this.customerContacts.getValue()) as ICustomerContact[]; bSetNewData = true; } - if (bSetNewData) { + if (bSetNewData) { this.setCustomerServiceData(updatedCustomers, updatedCustomerContacts); } } @@ -65,7 +65,7 @@ export class CustomerService { * @param customers * @param customerContacts */ - private setCustomerServiceData(customers: ICustomer[], customerContacts: ICustomerContact[]) { + private setCustomerServiceData(customers: ICustomer[], customerContacts: ICustomerContact[]); { this.customers.next(customers); this.customerContacts.next(customerContacts); } @@ -73,7 +73,7 @@ export class CustomerService { /** * Reset service data (on logout) */ - public resetCustomerServiceData() { + public resetCustomerServiceData(); { this.customers.next(null); this.customerContacts.next(null); } @@ -82,17 +82,17 @@ export class CustomerService { * Returns observable of customers * @returns {Observable} */ - public getCustomers$(): Observable { + public getCustomers$(); : Observable < ICustomer[] > { return this.dataCustomers$; - } + }; /** * Returns observable of customer contacts * @returns {Observable} */ - public getCustomerContacts$(): Observable { + public getCustomerContacts$(); : Observable < ICustomerContact[] > { return this.dataCustomerContacts$; - } + }; @@ -100,7 +100,7 @@ export class CustomerService { * Gets all customers * @returns {Observable} */ - public apiGetCustomerData(): void { + public apiGetCustomerData(); : void { this.httpService.apiGet('get-customer-data').subscribe( data => { const res: ICustomerData = data.result_data as ICustomerData; @@ -108,114 +108,114 @@ export class CustomerService { }, error => {} ); - } + }; /** * Returns full customer * @param {number} customerId * @returns {Observable} */ - public apiGetCustomerFull(customerId: number): Observable { + public apiGetCustomerFull(customerId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerId', JSON.stringify(customerId)); return this.httpService.apiPost('get-customer-full', formData); - } + }; /** * Create customer * @param {ICustomer} customer * @returns {Observable} */ - public apiCreateCustomer(customer: ICustomer): Observable { + public apiCreateCustomer(customer: ICustomer); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customer', JSON.stringify(customer)); return this.httpService.apiPost('create-customer', formData); - } + }; /** * Edit customer * @param {ICustomer} customer * @returns {Observable} */ - public apiEditCustomer(customer: ICustomer): Observable { + public apiEditCustomer(customer: ICustomer); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customer', JSON.stringify(customer)); return this.httpService.apiPost('edit-customer', formData); - } + }; /** * Create customer contact * @param customerContact */ - public apiCreateCustomerContact(customerContact: ICustomerContact): Observable { + public apiCreateCustomerContact(customerContact: ICustomerContact); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerContact', JSON.stringify(customerContact)); return this.httpService.apiPost('create-customer-contact', formData); - } + }; /** * Edit customer contact * @param {ICustomerContact} customerContact * @returns {Observable} */ - public apiEditCustomerContact(customerContact: ICustomerContact): Observable { + public apiEditCustomerContact(customerContact: ICustomerContact); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerContact', JSON.stringify(customerContact)); return this.httpService.apiPost('edit-customer-contact', formData); - } + }; /** * Delete customer contact * @param {number} customerContactId * @returns {Observable} */ - public apiDeleteCustomerContact(customerContactId: number): Observable { + public apiDeleteCustomerContact(customerContactId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerContactId', JSON.stringify(customerContactId)); return this.httpService.apiPost('delete-customer-contact', formData); - } + }; /** * Create customer note * @param {ICustomerNote} customerNote * @returns {Observable} */ - public apiCreateCustomerNote(customerNote: ICustomerNote): Observable { + public apiCreateCustomerNote(customerNote: ICustomerNote); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerNote', JSON.stringify(customerNote)); return this.httpService.apiPost('create-customer-note', formData); - } + }; /** * Edit customer note * @param {ICustomerNote} customerNote * @returns {Observable} */ - public apiEditCustomerNote(customerNote: ICustomerNote): Observable { + public apiEditCustomerNote(customerNote: ICustomerNote); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerNote', JSON.stringify(customerNote)); return this.httpService.apiPost('edit-customer-note', formData); - } + }; /** * Delete customer note * @param {number} customerNoteId * @returns {Observable} */ - public apiDeleteCustomerNote(customerNoteId: number): Observable { + public apiDeleteCustomerNote(customerNoteId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerNoteId', JSON.stringify(customerNoteId)); return this.httpService.apiPost('delete-customer-note', formData); - } + }; /** * Edit customer meeting report * @param customerMeetingId */ - public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string): Observable { + public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); formData.append('customerMeetingReport', JSON.stringify(customerMeetingReport)); return this.httpService.apiPost('edit-customer-meeting-report', formData); - } + }; } diff --git a/httpdocs/plp-angular/src/app/services/meeting.service.ts b/httpdocs/plp-angular/src/app/services/meeting.service.ts index e071378..773253f 100644 --- a/httpdocs/plp-angular/src/app/services/meeting.service.ts +++ b/httpdocs/plp-angular/src/app/services/meeting.service.ts @@ -61,39 +61,39 @@ export class MeetingService { * @param {IAppServiceData} serviceData */ public handleServiceData(serviceData: IAppServiceData = null): void { - if (!null === serviceData)) { - let bSetNewData = false; - let updatedCustomerMeetings: ICustomerMeeting[] = this.customerMeetings.getValue(); - let updatedInternalMeetings: IInternalMeeting[] = this.internalMeetings.getValue(); - let updatedOperatorMeetings: IOperatorMeeting[] = this.operatorMeetings.getValue(); - let updatedProductionMeetings: IProductionMeeting[] = this.productionMeetings.getValue(); - let updatedServiceMeetings: IServiceMeeting[] = this.serviceMeetings.getValue(); - if (!null === serviceData.customerMeetings)) { + if (!null === serviceData) { } } {) { + const bSetNewData = false; + const updatedCustomerMeetings: ICustomerMeeting[] = this.customerMeetings.getValue(); + const updatedInternalMeetings: IInternalMeeting[] = this.internalMeetings.getValue(); + const updatedOperatorMeetings: IOperatorMeeting[] = this.operatorMeetings.getValue(); + const updatedProductionMeetings: IProductionMeeting[] = this.productionMeetings.getValue(); + const updatedServiceMeetings: IServiceMeeting[] = this.serviceMeetings.getValue(); + if (!null === serviceData.customerMeetings) { } } {) { // Update service data updatedCustomerMeetings = ServiceHelper.updateServiceEntries(serviceData.customerMeetings, this.customerMeetings.getValue()) as ICustomerMeeting[]; bSetNewData = true; } - if (!null === serviceData.internalMeetings)) { + if (!null === serviceData.internalMeetings) { } } {) { // Update service data updatedInternalMeetings = ServiceHelper.updateServiceEntries(serviceData.internalMeetings, this.internalMeetings.getValue()) as IInternalMeeting[]; bSetNewData = true; } - if (!null === serviceData.operatorMeetings)) { + if (!null === serviceData.operatorMeetings) { } } {) { // Update service data updatedOperatorMeetings = ServiceHelper.updateServiceEntries(serviceData.operatorMeetings, this.operatorMeetings.getValue()) as IOperatorMeeting[]; bSetNewData = true; } - if (!null === serviceData.productionMeetings)) { + if (!null === serviceData.productionMeetings) { } } {) { // Update service data updatedProductionMeetings = ServiceHelper.updateServiceEntries(serviceData.productionMeetings, this.productionMeetings.getValue()) as IProductionMeeting[]; bSetNewData = true; } - if (!null === serviceData.operatorMeetings)) { + if (!null === serviceData.operatorMeetings) { } } {) { // Update service data updatedServiceMeetings = ServiceHelper.updateServiceEntries(serviceData.serviceMeetings, this.serviceMeetings.getValue()) as IServiceMeeting[]; bSetNewData = true; } - if (bSetNewData) { + if (bSetNewData) { const meetingData: {} = { customerMeetings: updatedCustomerMeetings, internalMeetings: updatedInternalMeetings, @@ -110,7 +110,7 @@ export class MeetingService { * Sets customer service and cache data * @param meetingData */ - private setMeetingServiceData(meetingData: IMeetingData) { + private setMeetingServiceData(meetingData: IMeetingData); { this.meetingData.next(meetingData); this.customerMeetings.next(meetingData.customerMeetings); this.internalMeetings.next(meetingData.internalMeetings); @@ -122,7 +122,7 @@ export class MeetingService { /** * Reset service data (on logout) */ - public resetMeetingServiceData() { + public resetMeetingServiceData(); { this.meetingData.next(null); this.customerMeetings.next(null); this.internalMeetings.next(null); @@ -131,35 +131,35 @@ export class MeetingService { this.serviceMeetings.next(null); } - public getMeetingsData$(): Observable { + public getMeetingsData$(); : Observable < IMeetingData > { return this.meetingData$; - } + }; - public getCustomerMeetings$(): Observable { + public getCustomerMeetings$(); : Observable < ICustomerMeeting[] > { return this.customerMeetings$; - } + }; - public getInternalMeetings$(): Observable { + public getInternalMeetings$(); : Observable < IInternalMeeting[] > { return this.internalMeetings$; - } + }; - public getOperatorMeetings$(): Observable { + public getOperatorMeetings$(); : Observable < IOperatorMeeting[] > { return this.operatorMeetings$; - } + }; - public getProductionMeetings$(): Observable { + public getProductionMeetings$(); : Observable < IProductionMeeting[] > { return this.productionMeetings$; - } + }; - public getServiceMeetings$(): Observable { + public getServiceMeetings$(); : Observable < IServiceMeeting[] > { return this.serviceMeetings$; - } + }; /** * Gets all customers * @returns {Observable} */ - public apiGetMeetingData(): void { + public apiGetMeetingData(); : void { this.httpService.apiGet('get-meeting-data').subscribe( data => { const res: IMeetingData = data.result_data as IMeetingData; @@ -167,280 +167,280 @@ export class MeetingService { }, error => {} ); - } + }; /** * Create customer meeting * @param {ICustomerNote} customerMeeting * @returns {Observable} */ - public apiCreateCustomerMeeting(customerMeeting: ICustomerMeeting): Observable { + public apiCreateCustomerMeeting(customerMeeting: ICustomerMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerMeeting', JSON.stringify(customerMeeting)); return this.httpService.apiPost('create-customer-meeting', formData); - } + }; /** * Edit customer meeting * @param {ICustomerNote} customerMeeting * @returns {Observable} */ - public apiEditCustomerMeeting(customerMeeting: ICustomerMeeting): Observable { + public apiEditCustomerMeeting(customerMeeting: ICustomerMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerMeeting', JSON.stringify(customerMeeting)); return this.httpService.apiPost('edit-customer-meeting', formData); - } + }; /** * Delete customer meeting * @param {number} customerMeetingId * @returns {Observable} */ - public apiDeleteCustomerMeeting(customerMeetingId: number): Observable { + public apiDeleteCustomerMeeting(customerMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); return this.httpService.apiPost('delete-customer-meeting', formData); - } + }; /** * Checks customer meeting report * @param customerMeetingId */ - public apiCheckCustomerMeetingReport(customerMeetingId: number): Observable { + public apiCheckCustomerMeetingReport(customerMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); return this.httpService.apiPost('check-customer-meeting-report', formData, true); - } + }; /** * Edit customer meeting report * @param customerMeetingId * @param customerMeetingReport */ - public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string): Observable { + public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string); : Observable < IApiResponse > { const formData = new FormData(); formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); formData.append('customerMeetingReport', JSON.stringify(customerMeetingReport)); return this.httpService.apiPost('edit-customer-meeting-report', formData); - } + }; /** * Create internal meeting * @param internalMeeting */ - public apiCreateInternalMeeting(internalMeeting: IInternalMeeting): Observable { + public apiCreateInternalMeeting(internalMeeting: IInternalMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('internalMeeting', JSON.stringify(internalMeeting)); return this.httpService.apiPost('create-internal-meeting', formData); - } + }; /** * Edit internal meeting * @param internalMeeting */ - public apiEditInternalMeeting(internalMeeting: IInternalMeeting): Observable { + public apiEditInternalMeeting(internalMeeting: IInternalMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('internalMeeting', JSON.stringify(internalMeeting)); return this.httpService.apiPost('edit-internal-meeting', formData); - } + }; /** * Delete internal meeting * @param internalMeetingId */ - public apiDeleteInternalMeeting(internalMeetingId: number): Observable { + public apiDeleteInternalMeeting(internalMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); return this.httpService.apiPost('delete-internal-meeting', formData); - } + }; /** * Checks internal meeting report * @param internalMeetingId */ - public apiCheckInternalMeetingReport(internalMeetingId: number): Observable { + public apiCheckInternalMeetingReport(internalMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); return this.httpService.apiPost('check-internal-meeting-report', formData, false); - } + }; /** * Edit internal meeting report * @param internalMeetingId * @param internalMeetingReport */ - public apiEditInternalMeetingReport(internalMeetingId: number, internalMeetingReport: string): Observable { + public apiEditInternalMeetingReport(internalMeetingId: number, internalMeetingReport: string); : Observable < IApiResponse > { const formData = new FormData(); formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); formData.append('internalMeetingReport', JSON.stringify(internalMeetingReport)); return this.httpService.apiPost('edit-internal-meeting-report', formData); - } + }; /** * Create operator meeting * @param operatorMeeting */ - public apiCreateOperatorMeeting(operatorMeeting: IOperatorMeeting): Observable { + public apiCreateOperatorMeeting(operatorMeeting: IOperatorMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('operatorMeeting', JSON.stringify(operatorMeeting)); return this.httpService.apiPost('create-operator-meeting', formData); - } + }; /** * Edit operator meeting * @param operatorMeeting */ - public apiEditOperatorMeeting(operatorMeeting: IOperatorMeeting): Observable { + public apiEditOperatorMeeting(operatorMeeting: IOperatorMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('operatorMeeting', JSON.stringify(operatorMeeting)); return this.httpService.apiPost('edit-operator-meeting', formData); - } + }; /** * Delete operator meeting * @param {number} operatorMeetingId * @returns {Observable} */ - public apiDeleteOperatorMeeting(operatorMeetingId: number): Observable { + public apiDeleteOperatorMeeting(operatorMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); return this.httpService.apiPost('delete-operator-meeting', formData); - } + }; /** * Checks operator meeting report * @param operatorMeetingId */ - public apiCheckOperatorMeetingReport(operatorMeetingId: number): Observable { + public apiCheckOperatorMeetingReport(operatorMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); return this.httpService.apiPost('check-operator-meeting-report', formData, true); - } + }; /** * Edit operator meeting report * @param operatorMeetingId * @param operatorMeetingReport */ - public apiEditOperatorMeetingReport(operatorMeetingId: number, operatorMeetingReport: string): Observable { + public apiEditOperatorMeetingReport(operatorMeetingId: number, operatorMeetingReport: string); : Observable < IApiResponse > { const formData = new FormData(); formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); formData.append('operatorMeetingReport', JSON.stringify(operatorMeetingReport)); return this.httpService.apiPost('edit-operator-meeting-report', formData); - } + }; /** * Create production meeting * @param productionMeeting */ - public apiCreateProductionMeeting(productionMeeting: IProductionMeeting): Observable { + public apiCreateProductionMeeting(productionMeeting: IProductionMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('productionMeeting', JSON.stringify(productionMeeting)); return this.httpService.apiPost('create-production-meeting', formData); - } + }; /** * Edit production meeting * @param productionMeeting */ - public apiEditProductionMeeting(productionMeeting: IProductionMeeting): Observable { + public apiEditProductionMeeting(productionMeeting: IProductionMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('productionMeeting', JSON.stringify(productionMeeting)); return this.httpService.apiPost('edit-production-meeting', formData); - } + }; /** * Delete production meeting * @param {number} productionMeetingId * @returns {Observable} */ - public apiDeleteProductionMeeting(productionMeetingId: number): Observable { + public apiDeleteProductionMeeting(productionMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); return this.httpService.apiPost('delete-production-meeting', formData); - } + }; /** * Checks production meeting report * @param productionMeetingId */ - public apiCheckProductionMeetingReport(productionMeetingId: number): Observable { + public apiCheckProductionMeetingReport(productionMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); return this.httpService.apiPost('check-production-meeting-report', formData, true); - } + }; /** * Edit production meeting report * @param productionMeetingId * @param productionMeetingReport */ - public apiEditProductionMeetingReport(productionMeetingId: number, productionMeetingReport: string): Observable { + public apiEditProductionMeetingReport(productionMeetingId: number, productionMeetingReport: string); : Observable < IApiResponse > { const formData = new FormData(); formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); formData.append('productionMeetingReport', JSON.stringify(productionMeetingReport)); return this.httpService.apiPost('edit-production-meeting-report', formData); - } + }; /** * Create service meeting * @param serviceMeeting */ - public apiCreateServiceMeeting(serviceMeeting: IServiceMeeting): Observable { + public apiCreateServiceMeeting(serviceMeeting: IServiceMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('serviceMeeting', JSON.stringify(serviceMeeting)); return this.httpService.apiPost('create-service-meeting', formData); - } + }; /** * Edit service meeting * @param serviceMeeting */ - public apiEditServiceMeeting(serviceMeeting: IServiceMeeting): Observable { + public apiEditServiceMeeting(serviceMeeting: IServiceMeeting); : Observable < IApiResponse > { const formData = new FormData(); formData.append('serviceMeeting', JSON.stringify(serviceMeeting)); return this.httpService.apiPost('edit-service-meeting', formData); - } + }; /** * Delete service meeting * @param {number} serviceMeetingId * @returns {Observable} */ - public apiDeleteServiceMeeting(serviceMeetingId: number): Observable { + public apiDeleteServiceMeeting(serviceMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); return this.httpService.apiPost('delete-service-meeting', formData); - } + }; /** * Checks production meeting report * @param serviceMeetingId */ - public apiCheckServiceMeetingReport(serviceMeetingId: number): Observable { + public apiCheckServiceMeetingReport(serviceMeetingId: number); : Observable < IApiResponse > { const formData = new FormData(); formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); return this.httpService.apiPost('check-service-meeting-report', formData, true); - } + }; /** * Edit service meeting report * @param serviceMeetingId * @param serviceMeetingReport */ - public apiEditServiceMeetingReport(serviceMeetingId: number, serviceMeetingReport: string): Observable { + public apiEditServiceMeetingReport(serviceMeetingId: number, serviceMeetingReport: string); : Observable < IApiResponse > { const formData = new FormData(); formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); formData.append('serviceMeetingReport', JSON.stringify(serviceMeetingReport)); return this.httpService.apiPost('edit-service-meeting-report', formData); - } + }; /** * Returns meeting list as excel * @param meetingList * @param fileName */ - public apiExportMeetingList(meetingList: {}[], fileName: string): void { + public apiExportMeetingList(meetingList: {}[], fileName: string); : void { const formData = new FormData(); formData.append('meetingList', JSON.stringify(meetingList)); this.httpService.apiFilePost('export-meeting-list', formData).subscribe( @@ -450,5 +450,5 @@ export class MeetingService { error => { } ); - } + }; } diff --git a/httpdocs/plp-angular/src/app/utils/utils.ts b/httpdocs/plp-angular/src/app/utils/utils.ts index 0a34ff7..3d9d35c 100644 --- a/httpdocs/plp-angular/src/app/utils/utils.ts +++ b/httpdocs/plp-angular/src/app/utils/utils.ts @@ -1,12 +1,8 @@ -import {null === } from 'util'; export class Utils { /** * Sorts array of objects by given criteria - * @param {Array} paramArray - * @param {string} criteria - * @returns {Array} */ static sortObjArrayByStringCriteria(paramArray: Array, criteria: string): Array { const sortedArray: Array = paramArray.sort((obj1, obj2) => { @@ -23,20 +19,17 @@ export class Utils { /** * Returns a sorted object by given array an criteria - * @param {Array} paramArray - * @param {string} criteria - * @returns {{}} */ static getSortedObjFromArray(paramArray: Array = null, criteria: string = null) { const res: {} = {}; - if (!null === paramArray)) { - if (!null === criteria)) { - for (let i = 0; i < paramArray.length; i++) { - res[paramArray[i][criteria]] = paramArray[i]; + if (null !== paramArray ) { + if (null !== criteria) { + for (const item of paramArray) { + res[item[criteria]] = item; } - } else { - for (let i = 0; i < paramArray.length; i++) { - res[paramArray[i]] = paramArray[i]; + } else { + for (const item of paramArray) { + res[item] = item; } } } @@ -45,37 +38,30 @@ export class Utils { /** * Deep clones object - * @param object - * @returns {any} */ - static deepClone(object: any): any { + static deepClone(object: any) { return JSON.parse(JSON.stringify(object)); } /** * Checks if a file is an image file - * @param {File} file - * @returns {boolean} */ static isImageFile(file: File): boolean { - return file.type.toString() == 'image/gif' || - file.type.toString() == 'image/png' || - file.type.toString() == 'image/jpeg'; + return file.type.toString() === 'image/gif' || + file.type.toString() === 'image/png' || + file.type.toString() === 'image/jpeg'; } /** * Checks if a file is an Excel file - * @param {File} file - * @returns {boolean} */ static isExcelFile(file: File): boolean { - return file.type.toString() == 'application/vnd.ms-excel' || - file.type.toString() == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; + return file.type.toString() === 'application/vnd.ms-excel' || + file.type.toString() === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; } /** * Strips spaces from string and sets string to lowercase - * @param s */ static stripString(s: string): string { return s.replace(/[\s]/g, '').toLowerCase(); @@ -83,8 +69,6 @@ export class Utils { /** * Checks if a given value is an integer - * @param {any} value - * @returns {boolean} */ static isInteger(value: any): boolean { return Number.isInteger(Number(value)); @@ -92,8 +76,6 @@ export class Utils { /** * Checks if a given value is a decimal / float - * @param {any} value - * @returns {boolean} */ static isFloat(value: any): boolean { const val: any = value.replace(',', '.'); @@ -102,8 +84,6 @@ export class Utils { /** * Checks if a given value is a boolean - * @param value - * @returns {boolean} */ static isBoolean(value: any): boolean { return typeof value === 'boolean'; @@ -116,7 +96,6 @@ export class Utils { /** * Returns current date - * @param withTime */ static getCurrentDate(withTime: boolean = false): string { let res: string; @@ -140,15 +119,15 @@ export class Utils { /** * Returns date and time in german format - * @param dateString - * @param withDate - * @param withTime - * @param withSeconds - * @param forDatePicker */ - static getDateTimeToDisplay(dateString: string = null, withDate: boolean = true, withTime: boolean = false, withSeconds: boolean = false, forDatePicker: boolean = false): string { + static getDateTimeToDisplay( + dateString: string = null, + withDate: boolean = true, + withTime: boolean = false, + withSeconds: boolean = false, + forDatePicker: boolean = false): string { let res = ''; - const date: Date = null === dateString) ? new Date() : new Date(dateString.replace(/\s/, 'T')); + const date: Date = null === dateString ? new Date() : new Date(dateString.replace(/\s/, 'T')); const day: number = date.getDate(); const month: number = date.getMonth() + 1; const year: number = date.getFullYear(); @@ -186,10 +165,9 @@ export class Utils { /** * Checks URL - * @param url */ static checkUrl(url: string): string { - if (!null === url)) { + if (null !== url) { let newUrl = decodeURIComponent(url); newUrl = newUrl.trim().replace(/\s/g, ''); if (/^(:\/\/)/.test(newUrl)) { @@ -199,7 +177,7 @@ export class Utils { return `http://${newUrl}`; } return newUrl; - } else { + } else { return null; } } diff --git a/httpdocs/plp-angular/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.ts b/httpdocs/plp-angular/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.ts index 1bec85e..2f54abd 100644 --- a/httpdocs/plp-angular/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.ts +++ b/httpdocs/plp-angular/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.ts @@ -79,7 +79,7 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI */ public generateEntries(): void { this.rowData = []; - if (null !== this.customerContacts)) { + if (null !== this.customerContacts) { } } {) { for (let i = 0; i < this.customerContacts.length; i++) { this.rowData.push({ id: this.customerContacts[i].id, @@ -102,7 +102,7 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI * Row is clicked * @param e */ - public rowClicked(e: any) { + public rowClicked(e: any); { this.modalCustomerContactPersonDetailList.openModal(); this.customerContactPersonDetailList.setData(this.customersById[e.data.customer_id], Utils.deepClone(this.customerContactsById[e.data.id]) as ICustomerContact); } @@ -111,48 +111,48 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI * Edit customer contact * @param customerContact */ - public editCustomerContactFunction(customerContact: ICustomerContact): void { + public editCustomerContactFunction(customerContact: ICustomerContact); : void { this.customerService.apiEditCustomerContact(customerContact).subscribe( data => { this.customerContactPersonDetailList.updateData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Delete customer contact * @param contactId */ - public deleteCustomerContactFunction(contactId: number): void { + public deleteCustomerContactFunction(contactId: number); : void { this.customerService.apiDeleteCustomerContact(contactId).subscribe( data => { this.modalCustomerContactPersonDetailList.closeModal(); }, error => {} ); - } + }; /** * Shortcut to customer detail * @param customer */ - public shortcutFunction(customer: ICustomer): void { + public shortcutFunction(customer: ICustomer); : void { this.modalCustomerContactPersonDetailList.closeModal(); this.shortcut.emit(customer); - } + }; /** * Export customer contacts pdf */ - public exportCustomerContactsPdf(): void { + public exportCustomerContactsPdf(); : void { this.commonService.apiExportContactsPdf('Kunden_Kontakte', 'customer'); - } + }; /** * Export customer xmas pdf */ - public exportXmasPdf(): void { + public exportXmasPdf(); : void { this.commonService.apiExportXmasPdf('Kunden_Weihnachten', 'customer'); - } + }; } diff --git a/httpdocs/plp-angular/src/app/views/customer-management/customer-management.component.ts b/httpdocs/plp-angular/src/app/views/customer-management/customer-management.component.ts index 815bb91..6567e8f 100644 --- a/httpdocs/plp-angular/src/app/views/customer-management/customer-management.component.ts +++ b/httpdocs/plp-angular/src/app/views/customer-management/customer-management.component.ts @@ -67,7 +67,7 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn * Set component data after all data has been received */ private setComponentData() { - if (null !== this.customers && null !== this.customerContacts)) { + if (null !== this.customers && null !== this.customerContacts) { } } {) { this.customerList.setData(this.customers); this.customerContactList.setData(this.customers, this.customerContacts); } @@ -77,7 +77,7 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn * Customer row is clicked * @param e */ - public rowClickedCustomer(e: any) { + public rowClickedCustomer(e: any); { this.customerService.apiGetCustomerFull(e.data.customer_id).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); @@ -90,159 +90,159 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn /** * OnClick Create customer */ - public createCustomer(): void { + public createCustomer(); : void { this.modalCustomerDataEdit.openModal(); this.customerDataEdit.setData(Factory.getEmptyCustomer()); - } + }; /** * Creates customer * @param customer */ - public createCustomerFunction(customer: ICustomer): void { + public createCustomerFunction(customer: ICustomer); : void { this.customerService.apiCreateCustomer(customer).subscribe( data => { this.modalCustomerDataEdit.closeModal(); }, error => {} ); - } + }; /** * Saves customer * @param customer */ - public editCustomerFunction(customer: ICustomer): void { + public editCustomerFunction(customer: ICustomer); : void { this.customerService.apiEditCustomer(customer).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Creates customer contact * @param customerContact */ - public createCustomerContactFunction(customerContact: ICustomerContact): void { + public createCustomerContactFunction(customerContact: ICustomerContact); : void { this.customerService.apiCreateCustomerContact(customerContact).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Edit customer contact * @param customerContact */ - public editCustomerContactFunction(customerContact: ICustomerContact): void { + public editCustomerContactFunction(customerContact: ICustomerContact); : void { this.customerService.apiEditCustomerContact(customerContact).subscribe( data => { this.customerView.setData(data.result_data as ICustomer, true); }, error => {} ); - } + }; /** * Deletes customer contact * @param contactId */ - public deleteCustomerContactFunction(contactId: number): void { + public deleteCustomerContactFunction(contactId: number); : void { this.customerService.apiDeleteCustomerContact(contactId).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Creates customer note entry * @param customerNote */ - public createCustomerNoteFunction(customerNote: ICustomerNote): void { + public createCustomerNoteFunction(customerNote: ICustomerNote); : void { this.customerService.apiCreateCustomerNote(customerNote).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Edits customer note entry * @param customerNote */ - public editCustomerNoteFunction(customerNote: ICustomerNote): void { + public editCustomerNoteFunction(customerNote: ICustomerNote); : void { this.customerService.apiEditCustomerNote(customerNote).subscribe( data => { this.customerView.setData(data.result_data as ICustomer, true); }, error => {} ); - } + }; /** * Deletes customer note entry * @param customerNoteId */ - public deleteCustomerNoteFunction(customerNoteId: number): void { + public deleteCustomerNoteFunction(customerNoteId: number); : void { this.customerService.apiDeleteCustomerNote(customerNoteId).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Creates customer meeting entry * @param customerMeeting */ - public createCustomerMeetingFunction(customerMeeting: ICustomerMeeting): void { + public createCustomerMeetingFunction(customerMeeting: ICustomerMeeting); : void { this.meetingService.apiCreateCustomerMeeting(customerMeeting).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Edits customer meeting entry * @param customerMeeting */ - public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting): void { + public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting); : void { this.meetingService.apiEditCustomerMeeting(customerMeeting).subscribe( data => { this.customerView.setData(data.result_data as ICustomer, true); }, error => {} ); - } + }; /** * Deletes customer meeting entry * @param customerMeetingId */ - public deleteCustomerMeetingFunction(customerMeetingId: number): void { + public deleteCustomerMeetingFunction(customerMeetingId: number); : void { this.meetingService.apiDeleteCustomerMeeting(customerMeetingId).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); }, error => {} ); - } + }; /** * Edit report after meeting has started * @param reportValues */ - public editCustomerMeetingReportFunction(reportValues: any): void { + public editCustomerMeetingReportFunction(reportValues: any); : void { const meetingId: number = reportValues.id; const report: string = reportValues.report; this.meetingService.apiEditCustomerMeetingReport(meetingId, report).subscribe( @@ -251,13 +251,13 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn }, error => {} ); - } + }; /** * Shortcut to customer detail * @param customer */ - public shortcutFunction(customer: ICustomer): void { + public shortcutFunction(customer: ICustomer); : void { this.customerService.apiGetCustomerFull(customer.id).subscribe( data => { this.customerView.setData(data.result_data as ICustomer); @@ -265,13 +265,13 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn }, error => {} ); - } + }; /** * Destroy */ - ngOnDestroy(): void { - if (this.customersSub !== null && this.customersSub !== undefined) { +ngOnDestroy(); : void { + if(this.customersSub !== null && this.customersSub !== undefined); { this.customersSub.unsubscribe(); } } diff --git a/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-detail/customer-meeting-detail.component.ts b/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-detail/customer-meeting-detail.component.ts index 3ae4028..856eeca 100644 --- a/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-detail/customer-meeting-detail.component.ts +++ b/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-detail/customer-meeting-detail.component.ts @@ -19,7 +19,7 @@ import {IConfig} from '../../../../model/virtual/config'; import {NgForm} from '@angular/forms'; import {ScrollToService} from '@nicky-lenaers/ngx-scroll-to'; import {CustomerService} from '../../../../services/customer.service'; -import {null === } from 'util'; +import {null === ; } from; 'util'; import {MeetingService} from '../../../../services/meeting.service'; import {FormComponent} from '../../../../components/form-component'; import {Const} from '../../../../utils/const'; @@ -101,7 +101,7 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI */ public updateData(customer: ICustomer): void { this.customer = customer; - if (!null === this.customerMeeting.id)) { + if (!null === this.customerMeeting.id) { } } {) { for (let i = 0; i < this.customer.v_customer_meetings.length; i++) { if (this.customer.v_customer_meetings[i].id === this.customerMeeting.id) { this.customerMeeting = this.customer.v_customer_meetings[i]; @@ -114,7 +114,7 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI /** * Sets variables for meeting */ - public setMeetingData() { + public setMeetingData(); { this.errorMsg = ''; this.reportFormVisible = false; this.reportOld = this.customerMeeting.report; @@ -137,25 +137,25 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI /** * Edit meeting entry */ - public editEntry(): void { + public editEntry(); : void { this.isEditMode = true; this.customerMeetingDetailEdit.setData(this.customer, Utils.deepClone(this.customerMeeting) as ICustomerMeeting); - } + }; /** * Edits meeting entry * @param customerMeeting */ - public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting) { + public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting); { this.editMeeting.emit(customerMeeting); } /** * Delete meeting entry */ - public deleteEntry(): void { + public deleteEntry(); : void { const confirmAction = confirm('Wollen Sie diesen Eintrag wirklich löschen?'); - if (confirmAction == true) { + if(confirmAction == true; ) { this.deleteMeeting.emit(this.customerMeeting.id); } } @@ -163,7 +163,7 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI /** * Check if edit report after meeting has started */ - public editReport(): void { + public editReport(); : void { this.meetingService.apiCheckCustomerMeetingReport(this.customerMeeting.id).subscribe( data => { this.reportFormVisible = data.result_data as boolean; @@ -174,13 +174,13 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI error => { } ); - } + }; /** * Resets Form Validation */ - public resetFormValidation(): void { - if (this.reportFormVisible) { + public resetFormValidation(); : void { + if(this.reportFormVisible); { this.customerMeetingReportForm.form.markAsUntouched(); } } @@ -190,9 +190,9 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI * @param value * @param valid */ - public onFormSubmit({value, valid}: { value: any, valid: boolean }): void { + public onFormSubmit({value, valid}: { value: any, valid: boolean }); : void { this.errorMsg = 'Bitte beheben Sie alle Fehler.'; - if (valid) { + if(valid) { this.editMeetingReport.emit({ id: this.customerMeeting.id, report: this.customerMeeting.report @@ -201,6 +201,6 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI } else { this.scrollUp('customer-meeting-edit-report'); } - } + }; } diff --git a/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.ts b/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.ts index ad9a066..fea3652 100644 --- a/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.ts +++ b/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.ts @@ -139,7 +139,7 @@ export class CustomerMeetingViewComponent extends AgGridComponent implements OnI phone: value.phone_no, mobile: value.mobile_no, }); - this.rowData = items.sort((a: {} , b: {}) => this.dateComparator(a['date'], b['date'], false)); + this.rowData = items.sort((a: {} , b: {}) => this.dateComparator(a.date, b.date, false)); }); } diff --git a/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.ts b/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.ts index 252241e..8ecc34e 100644 --- a/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.ts +++ b/httpdocs/plp-angular/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.ts @@ -113,7 +113,7 @@ export class CustomerNoteViewComponent extends AgGridComponent implements OnInit creator: this.customerNote[i].creation_user_firstname + ' ' + this.customerNote[i].creation_user_lastname, }); } - this.rowData = items.sort((a: {} , b: {}) => this.dateComparator(a['date'], b['date'], false)); + this.rowData = items.sort((a: {} , b: {}) => this.dateComparator(a.date, b.date, false)); } /** diff --git a/httpdocs/plp-angular/src/app/views/start/meeting-list/meeting-list.component.ts b/httpdocs/plp-angular/src/app/views/start/meeting-list/meeting-list.component.ts index 51ab91f..be3d412 100644 --- a/httpdocs/plp-angular/src/app/views/start/meeting-list/meeting-list.component.ts +++ b/httpdocs/plp-angular/src/app/views/start/meeting-list/meeting-list.component.ts @@ -10,10 +10,10 @@ import {IOperatorMeeting} from '../../../model/entities/operator-meeting'; import {IOperator} from '../../../model/entities/operator'; import {MeetingService} from '../../../services/meeting.service'; import {Utils} from '../../../utils/utils'; -import {IProductionMeeting} from "../../../model/entities/production-meeting"; -import {IServiceMeeting} from "../../../model/entities/service-meeting"; -import {IProduction} from "../../../model/entities/production"; -import {IService} from "../../../model/entities/service"; +import {IProductionMeeting} from '../../../model/entities/production-meeting'; +import {IServiceMeeting} from '../../../model/entities/service-meeting'; +import {IProduction} from '../../../model/entities/production'; +import {IService} from '../../../model/entities/service'; @Component({ selector: 'app-meeting-list', @@ -123,8 +123,8 @@ export class MeetingListComponent extends AgGridComponent implements OnInit, OnD for (let c = 0; c < this.customerMeetings.length; c++) { owner = this.appService.getConfig().vc_user_by_id[this.customerMeetings[c].owner_user_id] as IUser; meetingType = this.appService.getConfig().vc_meeting_types_by_id[this.customerMeetings[c].meeting_type_id] as IMeetingType; - let customerContactName: string = null !== this.customerMeetings[c].firstname) ? this.customerMeetings[c].firstname + ' ' : ''; - customerContactName += null !== this.customerMeetings[c].lastname) ? this.customerMeetings[c].lastname : ''; + let customerContactName: string = null !== this.customerMeetings[c].firstname) ?; this.customerMeetings[c].firstname + ' '; : ''; + customerContactName += null !== this.customerMeetings[c].lastname; ) ? this.customerMeetings[c].lastname; : ''; const customer: ICustomer = this.customersById[this.customerMeetings[c].customer_id]; const creator: IUser = this.appService.getConfig().vc_user_by_id[this.customerMeetings[c].creation_user_id]; @@ -294,7 +294,7 @@ export class MeetingListComponent extends AgGridComponent implements OnInit, OnD mobile: this.serviceMeetings[s].mobile_no, }); } - this.rowData = items.sort((a: {} , b: {}) => this.dateComparator(a['dateStart'], b['dateStart'], false)); + this.rowData = items.sort((a: {} , b: {}) => this.dateComparator(a.dateStart, b.dateStart, false)); } /** @@ -326,8 +326,8 @@ export class MeetingListComponent extends AgGridComponent implements OnInit, OnD const exportData: {}[] = []; this.gridParamsApi.forEachNodeAfterFilter(function(rowNode, index) { const exportEntry: {} = rowNode.data; - delete exportEntry['that']; - delete exportEntry['participants']; + delete exportEntry.that; + delete exportEntry.participants; exportData.push(exportEntry); }); diff --git a/httpdocs/plp-angular/src/environments/environment.ts b/httpdocs/plp-angular/src/environments/environment.ts index 3a2fc8b..f721fae 100644 --- a/httpdocs/plp-angular/src/environments/environment.ts +++ b/httpdocs/plp-angular/src/environments/environment.ts @@ -4,12 +4,12 @@ //////////////////////////////////////////////////////////////////// // LOCAL 4 Spawntree ;) -//php bin/console server:status -//php bin/console server:start *:8001 -//php bin/console server:stop *:8001 -//https://symfony.com/doc/current/setup/built_in_web_server.html +// php bin/console server:status +// php bin/console server:start *:8001 +// php bin/console server:stop *:8001 +// https://symfony.com/doc/current/setup/built_in_web_server.html // -//ng serve --port 4300 +// ng serve --port 4300 //////////////////////////////////////////////////////////////////// export const environment = { diff --git a/httpdocs/plp-angular/src/environments/path.ts b/httpdocs/plp-angular/src/environments/path.ts index 8241dc5..99d6323 100644 --- a/httpdocs/plp-angular/src/environments/path.ts +++ b/httpdocs/plp-angular/src/environments/path.ts @@ -3,7 +3,7 @@ // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. -import {environment} from "./environment"; +import {environment} from './environment'; export const path = { path_assets: environment.apiAssetPath, diff --git a/httpdocs/plp-angular/tsconfig.app.json b/httpdocs/plp-angular/tsconfig.app.json index 565a11a..54ccc58 100644 --- a/httpdocs/plp-angular/tsconfig.app.json +++ b/httpdocs/plp-angular/tsconfig.app.json @@ -14,5 +14,8 @@ "exclude": [ "src/test.ts", "src/**/*.spec.ts" + ], + "types": [ + "node" ] }