| @@ -103,7 +103,6 @@ export class AgGridComponent { | |||||
| /** | /** | ||||
| * On cell editing stopped | * On cell editing stopped | ||||
| * @param e | |||||
| */ | */ | ||||
| public onCellEditingStopped(e): void { | public onCellEditingStopped(e): void { | ||||
| if (null !== AgGridComponentConst.gridInputError) { | if (null !== AgGridComponentConst.gridInputError) { | ||||
| @@ -117,7 +116,6 @@ export class AgGridComponent { | |||||
| /** | /** | ||||
| * Sizes columns to fit | * Sizes columns to fit | ||||
| * @param params | |||||
| */ | */ | ||||
| public onFirstDataRendered(params: any): void { | public onFirstDataRendered(params: any): void { | ||||
| // Set for info components | // Set for info components | ||||
| @@ -15,10 +15,10 @@ import {IProduction} from '../model/entities/production'; | |||||
| import {IProductionContact} from '../model/entities/production-contact'; | import {IProductionContact} from '../model/entities/production-contact'; | ||||
| import {IProductionNote} from '../model/entities/production-note'; | import {IProductionNote} from '../model/entities/production-note'; | ||||
| import {IProductionMeeting} from '../model/entities/production-meeting'; | 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 { | export class Factory { | ||||
| static getEmptyUser(): IUser { | static getEmptyUser(): IUser { | ||||
| @@ -67,10 +67,10 @@ export class GridSelectRendererComponent extends GridRendererComponent { | |||||
| const itemValueKeys: string[] = params.colDef.cellEditorParams.itemValueKeys; | const itemValueKeys: string[] = params.colDef.cellEditorParams.itemValueKeys; | ||||
| // Get item range by related value | // 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() | // let value: string = GridFactory.getGridSelectItemValue() | ||||
| for (let i = 0; i < this.itemRange.length; i++) { | for (let i = 0; i < this.itemRange.length; i++) { | ||||
| if (this.itemRange[i][itemKey] === params.value) { | if (this.itemRange[i][itemKey] === params.value) { | ||||
| @@ -78,7 +78,7 @@ export class GridSelectRendererComponent extends GridRendererComponent { | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } else { | |||||
| } else { | |||||
| this.value = 'Bitte wählen'; | this.value = 'Bitte wählen'; | ||||
| } | } | ||||
| } | } | ||||
| @@ -18,10 +18,10 @@ export class GridTextRendererComponent extends GridRendererComponent { | |||||
| if (undefined !== this.cellParams) { | if (undefined !== this.cellParams) { | ||||
| // Replace "." with "," for display purpose | // Replace "." with "," for display purpose | ||||
| if (this.cellParams.type === AgGridComponentConst.CELL_VALUE_TYPE_FLOAT) { | 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) { | 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'); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,8 +1,8 @@ | |||||
| import {ICustomerMeeting} from '../entities/customer-meeting'; | import {ICustomerMeeting} from '../entities/customer-meeting'; | ||||
| import {IInternalMeeting} from '../entities/internal-meeting'; | import {IInternalMeeting} from '../entities/internal-meeting'; | ||||
| import {IOperatorMeeting} from '../entities/operator-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 { | export interface IMeetingData { | ||||
| customerMeetings: ICustomerMeeting[]; | customerMeetings: ICustomerMeeting[]; | ||||
| @@ -40,21 +40,21 @@ export class CustomerService { | |||||
| * @param {IAppServiceData} serviceData | * @param {IAppServiceData} serviceData | ||||
| */ | */ | ||||
| public handleServiceData(serviceData: IAppServiceData = null): void { | 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 | // Update service data | ||||
| updatedCustomers = ServiceHelper.updateServiceEntries(serviceData.customers, this.customers.getValue()) as ICustomer[]; | updatedCustomers = ServiceHelper.updateServiceEntries(serviceData.customers, this.customers.getValue()) as ICustomer[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (!null === serviceData.customerContacts)) { | |||||
| if (!null === serviceData.customerContacts) { } } {) { | |||||
| // Update service data | // Update service data | ||||
| updatedCustomerContacts = ServiceHelper.updateServiceEntries(serviceData.customerContacts, this.customerContacts.getValue()) as ICustomerContact[]; | updatedCustomerContacts = ServiceHelper.updateServiceEntries(serviceData.customerContacts, this.customerContacts.getValue()) as ICustomerContact[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (bSetNewData) { | |||||
| if (bSetNewData) { | |||||
| this.setCustomerServiceData(updatedCustomers, updatedCustomerContacts); | this.setCustomerServiceData(updatedCustomers, updatedCustomerContacts); | ||||
| } | } | ||||
| } | } | ||||
| @@ -65,7 +65,7 @@ export class CustomerService { | |||||
| * @param customers | * @param customers | ||||
| * @param customerContacts | * @param customerContacts | ||||
| */ | */ | ||||
| private setCustomerServiceData(customers: ICustomer[], customerContacts: ICustomerContact[]) { | |||||
| private setCustomerServiceData(customers: ICustomer[], customerContacts: ICustomerContact[]); { | |||||
| this.customers.next(customers); | this.customers.next(customers); | ||||
| this.customerContacts.next(customerContacts); | this.customerContacts.next(customerContacts); | ||||
| } | } | ||||
| @@ -73,7 +73,7 @@ export class CustomerService { | |||||
| /** | /** | ||||
| * Reset service data (on logout) | * Reset service data (on logout) | ||||
| */ | */ | ||||
| public resetCustomerServiceData() { | |||||
| public resetCustomerServiceData(); { | |||||
| this.customers.next(null); | this.customers.next(null); | ||||
| this.customerContacts.next(null); | this.customerContacts.next(null); | ||||
| } | } | ||||
| @@ -82,17 +82,17 @@ export class CustomerService { | |||||
| * Returns observable of customers | * Returns observable of customers | ||||
| * @returns {Observable<ICustomer[]>} | * @returns {Observable<ICustomer[]>} | ||||
| */ | */ | ||||
| public getCustomers$(): Observable<ICustomer[]> { | |||||
| public getCustomers$(); : Observable < ICustomer[] > { | |||||
| return this.dataCustomers$; | return this.dataCustomers$; | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Returns observable of customer contacts | * Returns observable of customer contacts | ||||
| * @returns {Observable<ICustomer[]>} | * @returns {Observable<ICustomer[]>} | ||||
| */ | */ | ||||
| public getCustomerContacts$(): Observable<ICustomerContact[]> { | |||||
| public getCustomerContacts$(); : Observable < ICustomerContact[] > { | |||||
| return this.dataCustomerContacts$; | return this.dataCustomerContacts$; | ||||
| } | |||||
| }; | |||||
| @@ -100,7 +100,7 @@ export class CustomerService { | |||||
| * Gets all customers | * Gets all customers | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiGetCustomerData(): void { | |||||
| public apiGetCustomerData(); : void { | |||||
| this.httpService.apiGet('get-customer-data').subscribe( | this.httpService.apiGet('get-customer-data').subscribe( | ||||
| data => { | data => { | ||||
| const res: ICustomerData = data.result_data as ICustomerData; | const res: ICustomerData = data.result_data as ICustomerData; | ||||
| @@ -108,114 +108,114 @@ export class CustomerService { | |||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Returns full customer | * Returns full customer | ||||
| * @param {number} customerId | * @param {number} customerId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiGetCustomerFull(customerId: number): Observable<IApiResponse> { | |||||
| public apiGetCustomerFull(customerId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerId', JSON.stringify(customerId)); | formData.append('customerId', JSON.stringify(customerId)); | ||||
| return this.httpService.apiPost('get-customer-full', formData); | return this.httpService.apiPost('get-customer-full', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create customer | * Create customer | ||||
| * @param {ICustomer} customer | * @param {ICustomer} customer | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiCreateCustomer(customer: ICustomer): Observable<IApiResponse> { | |||||
| public apiCreateCustomer(customer: ICustomer); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customer', JSON.stringify(customer)); | formData.append('customer', JSON.stringify(customer)); | ||||
| return this.httpService.apiPost('create-customer', formData); | return this.httpService.apiPost('create-customer', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer | * Edit customer | ||||
| * @param {ICustomer} customer | * @param {ICustomer} customer | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiEditCustomer(customer: ICustomer): Observable<IApiResponse> { | |||||
| public apiEditCustomer(customer: ICustomer); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customer', JSON.stringify(customer)); | formData.append('customer', JSON.stringify(customer)); | ||||
| return this.httpService.apiPost('edit-customer', formData); | return this.httpService.apiPost('edit-customer', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create customer contact | * Create customer contact | ||||
| * @param customerContact | * @param customerContact | ||||
| */ | */ | ||||
| public apiCreateCustomerContact(customerContact: ICustomerContact): Observable<IApiResponse> { | |||||
| public apiCreateCustomerContact(customerContact: ICustomerContact); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerContact', JSON.stringify(customerContact)); | formData.append('customerContact', JSON.stringify(customerContact)); | ||||
| return this.httpService.apiPost('create-customer-contact', formData); | return this.httpService.apiPost('create-customer-contact', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer contact | * Edit customer contact | ||||
| * @param {ICustomerContact} customerContact | * @param {ICustomerContact} customerContact | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiEditCustomerContact(customerContact: ICustomerContact): Observable<IApiResponse> { | |||||
| public apiEditCustomerContact(customerContact: ICustomerContact); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerContact', JSON.stringify(customerContact)); | formData.append('customerContact', JSON.stringify(customerContact)); | ||||
| return this.httpService.apiPost('edit-customer-contact', formData); | return this.httpService.apiPost('edit-customer-contact', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete customer contact | * Delete customer contact | ||||
| * @param {number} customerContactId | * @param {number} customerContactId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiDeleteCustomerContact(customerContactId: number): Observable<IApiResponse> { | |||||
| public apiDeleteCustomerContact(customerContactId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerContactId', JSON.stringify(customerContactId)); | formData.append('customerContactId', JSON.stringify(customerContactId)); | ||||
| return this.httpService.apiPost('delete-customer-contact', formData); | return this.httpService.apiPost('delete-customer-contact', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create customer note | * Create customer note | ||||
| * @param {ICustomerNote} customerNote | * @param {ICustomerNote} customerNote | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiCreateCustomerNote(customerNote: ICustomerNote): Observable<IApiResponse> { | |||||
| public apiCreateCustomerNote(customerNote: ICustomerNote); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerNote', JSON.stringify(customerNote)); | formData.append('customerNote', JSON.stringify(customerNote)); | ||||
| return this.httpService.apiPost('create-customer-note', formData); | return this.httpService.apiPost('create-customer-note', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer note | * Edit customer note | ||||
| * @param {ICustomerNote} customerNote | * @param {ICustomerNote} customerNote | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiEditCustomerNote(customerNote: ICustomerNote): Observable<IApiResponse> { | |||||
| public apiEditCustomerNote(customerNote: ICustomerNote); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerNote', JSON.stringify(customerNote)); | formData.append('customerNote', JSON.stringify(customerNote)); | ||||
| return this.httpService.apiPost('edit-customer-note', formData); | return this.httpService.apiPost('edit-customer-note', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete customer note | * Delete customer note | ||||
| * @param {number} customerNoteId | * @param {number} customerNoteId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiDeleteCustomerNote(customerNoteId: number): Observable<IApiResponse> { | |||||
| public apiDeleteCustomerNote(customerNoteId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerNoteId', JSON.stringify(customerNoteId)); | formData.append('customerNoteId', JSON.stringify(customerNoteId)); | ||||
| return this.httpService.apiPost('delete-customer-note', formData); | return this.httpService.apiPost('delete-customer-note', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer meeting report | * Edit customer meeting report | ||||
| * @param customerMeetingId | * @param customerMeetingId | ||||
| */ | */ | ||||
| public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string): Observable<IApiResponse> { | |||||
| public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | ||||
| formData.append('customerMeetingReport', JSON.stringify(customerMeetingReport)); | formData.append('customerMeetingReport', JSON.stringify(customerMeetingReport)); | ||||
| return this.httpService.apiPost('edit-customer-meeting-report', formData); | return this.httpService.apiPost('edit-customer-meeting-report', formData); | ||||
| } | |||||
| }; | |||||
| } | } | ||||
| @@ -61,39 +61,39 @@ export class MeetingService { | |||||
| * @param {IAppServiceData} serviceData | * @param {IAppServiceData} serviceData | ||||
| */ | */ | ||||
| public handleServiceData(serviceData: IAppServiceData = null): void { | 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 | // Update service data | ||||
| updatedCustomerMeetings = ServiceHelper.updateServiceEntries(serviceData.customerMeetings, this.customerMeetings.getValue()) as ICustomerMeeting[]; | updatedCustomerMeetings = ServiceHelper.updateServiceEntries(serviceData.customerMeetings, this.customerMeetings.getValue()) as ICustomerMeeting[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (!null === serviceData.internalMeetings)) { | |||||
| if (!null === serviceData.internalMeetings) { } } {) { | |||||
| // Update service data | // Update service data | ||||
| updatedInternalMeetings = ServiceHelper.updateServiceEntries(serviceData.internalMeetings, this.internalMeetings.getValue()) as IInternalMeeting[]; | updatedInternalMeetings = ServiceHelper.updateServiceEntries(serviceData.internalMeetings, this.internalMeetings.getValue()) as IInternalMeeting[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (!null === serviceData.operatorMeetings)) { | |||||
| if (!null === serviceData.operatorMeetings) { } } {) { | |||||
| // Update service data | // Update service data | ||||
| updatedOperatorMeetings = ServiceHelper.updateServiceEntries(serviceData.operatorMeetings, this.operatorMeetings.getValue()) as IOperatorMeeting[]; | updatedOperatorMeetings = ServiceHelper.updateServiceEntries(serviceData.operatorMeetings, this.operatorMeetings.getValue()) as IOperatorMeeting[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (!null === serviceData.productionMeetings)) { | |||||
| if (!null === serviceData.productionMeetings) { } } {) { | |||||
| // Update service data | // Update service data | ||||
| updatedProductionMeetings = ServiceHelper.updateServiceEntries(serviceData.productionMeetings, this.productionMeetings.getValue()) as IProductionMeeting[]; | updatedProductionMeetings = ServiceHelper.updateServiceEntries(serviceData.productionMeetings, this.productionMeetings.getValue()) as IProductionMeeting[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (!null === serviceData.operatorMeetings)) { | |||||
| if (!null === serviceData.operatorMeetings) { } } {) { | |||||
| // Update service data | // Update service data | ||||
| updatedServiceMeetings = ServiceHelper.updateServiceEntries(serviceData.serviceMeetings, this.serviceMeetings.getValue()) as IServiceMeeting[]; | updatedServiceMeetings = ServiceHelper.updateServiceEntries(serviceData.serviceMeetings, this.serviceMeetings.getValue()) as IServiceMeeting[]; | ||||
| bSetNewData = true; | bSetNewData = true; | ||||
| } | } | ||||
| if (bSetNewData) { | |||||
| if (bSetNewData) { | |||||
| const meetingData: {} = { | const meetingData: {} = { | ||||
| customerMeetings: updatedCustomerMeetings, | customerMeetings: updatedCustomerMeetings, | ||||
| internalMeetings: updatedInternalMeetings, | internalMeetings: updatedInternalMeetings, | ||||
| @@ -110,7 +110,7 @@ export class MeetingService { | |||||
| * Sets customer service and cache data | * Sets customer service and cache data | ||||
| * @param meetingData | * @param meetingData | ||||
| */ | */ | ||||
| private setMeetingServiceData(meetingData: IMeetingData) { | |||||
| private setMeetingServiceData(meetingData: IMeetingData); { | |||||
| this.meetingData.next(meetingData); | this.meetingData.next(meetingData); | ||||
| this.customerMeetings.next(meetingData.customerMeetings); | this.customerMeetings.next(meetingData.customerMeetings); | ||||
| this.internalMeetings.next(meetingData.internalMeetings); | this.internalMeetings.next(meetingData.internalMeetings); | ||||
| @@ -122,7 +122,7 @@ export class MeetingService { | |||||
| /** | /** | ||||
| * Reset service data (on logout) | * Reset service data (on logout) | ||||
| */ | */ | ||||
| public resetMeetingServiceData() { | |||||
| public resetMeetingServiceData(); { | |||||
| this.meetingData.next(null); | this.meetingData.next(null); | ||||
| this.customerMeetings.next(null); | this.customerMeetings.next(null); | ||||
| this.internalMeetings.next(null); | this.internalMeetings.next(null); | ||||
| @@ -131,35 +131,35 @@ export class MeetingService { | |||||
| this.serviceMeetings.next(null); | this.serviceMeetings.next(null); | ||||
| } | } | ||||
| public getMeetingsData$(): Observable<IMeetingData> { | |||||
| public getMeetingsData$(); : Observable < IMeetingData > { | |||||
| return this.meetingData$; | return this.meetingData$; | ||||
| } | |||||
| }; | |||||
| public getCustomerMeetings$(): Observable<ICustomerMeeting[]> { | |||||
| public getCustomerMeetings$(); : Observable < ICustomerMeeting[] > { | |||||
| return this.customerMeetings$; | return this.customerMeetings$; | ||||
| } | |||||
| }; | |||||
| public getInternalMeetings$(): Observable<IInternalMeeting[]> { | |||||
| public getInternalMeetings$(); : Observable < IInternalMeeting[] > { | |||||
| return this.internalMeetings$; | return this.internalMeetings$; | ||||
| } | |||||
| }; | |||||
| public getOperatorMeetings$(): Observable<IOperatorMeeting[]> { | |||||
| public getOperatorMeetings$(); : Observable < IOperatorMeeting[] > { | |||||
| return this.operatorMeetings$; | return this.operatorMeetings$; | ||||
| } | |||||
| }; | |||||
| public getProductionMeetings$(): Observable<IProductionMeeting[]> { | |||||
| public getProductionMeetings$(); : Observable < IProductionMeeting[] > { | |||||
| return this.productionMeetings$; | return this.productionMeetings$; | ||||
| } | |||||
| }; | |||||
| public getServiceMeetings$(): Observable<IServiceMeeting[]> { | |||||
| public getServiceMeetings$(); : Observable < IServiceMeeting[] > { | |||||
| return this.serviceMeetings$; | return this.serviceMeetings$; | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Gets all customers | * Gets all customers | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiGetMeetingData(): void { | |||||
| public apiGetMeetingData(); : void { | |||||
| this.httpService.apiGet('get-meeting-data').subscribe( | this.httpService.apiGet('get-meeting-data').subscribe( | ||||
| data => { | data => { | ||||
| const res: IMeetingData = data.result_data as IMeetingData; | const res: IMeetingData = data.result_data as IMeetingData; | ||||
| @@ -167,280 +167,280 @@ export class MeetingService { | |||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create customer meeting | * Create customer meeting | ||||
| * @param {ICustomerNote} customerMeeting | * @param {ICustomerNote} customerMeeting | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiCreateCustomerMeeting(customerMeeting: ICustomerMeeting): Observable<IApiResponse> { | |||||
| public apiCreateCustomerMeeting(customerMeeting: ICustomerMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerMeeting', JSON.stringify(customerMeeting)); | formData.append('customerMeeting', JSON.stringify(customerMeeting)); | ||||
| return this.httpService.apiPost('create-customer-meeting', formData); | return this.httpService.apiPost('create-customer-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer meeting | * Edit customer meeting | ||||
| * @param {ICustomerNote} customerMeeting | * @param {ICustomerNote} customerMeeting | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiEditCustomerMeeting(customerMeeting: ICustomerMeeting): Observable<IApiResponse> { | |||||
| public apiEditCustomerMeeting(customerMeeting: ICustomerMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerMeeting', JSON.stringify(customerMeeting)); | formData.append('customerMeeting', JSON.stringify(customerMeeting)); | ||||
| return this.httpService.apiPost('edit-customer-meeting', formData); | return this.httpService.apiPost('edit-customer-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete customer meeting | * Delete customer meeting | ||||
| * @param {number} customerMeetingId | * @param {number} customerMeetingId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiDeleteCustomerMeeting(customerMeetingId: number): Observable<IApiResponse> { | |||||
| public apiDeleteCustomerMeeting(customerMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | ||||
| return this.httpService.apiPost('delete-customer-meeting', formData); | return this.httpService.apiPost('delete-customer-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Checks customer meeting report | * Checks customer meeting report | ||||
| * @param customerMeetingId | * @param customerMeetingId | ||||
| */ | */ | ||||
| public apiCheckCustomerMeetingReport(customerMeetingId: number): Observable<IApiResponse> { | |||||
| public apiCheckCustomerMeetingReport(customerMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | ||||
| return this.httpService.apiPost('check-customer-meeting-report', formData, true); | return this.httpService.apiPost('check-customer-meeting-report', formData, true); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer meeting report | * Edit customer meeting report | ||||
| * @param customerMeetingId | * @param customerMeetingId | ||||
| * @param customerMeetingReport | * @param customerMeetingReport | ||||
| */ | */ | ||||
| public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string): Observable<IApiResponse> { | |||||
| public apiEditCustomerMeetingReport(customerMeetingId: number, customerMeetingReport: string); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | formData.append('customerMeetingId', JSON.stringify(customerMeetingId)); | ||||
| formData.append('customerMeetingReport', JSON.stringify(customerMeetingReport)); | formData.append('customerMeetingReport', JSON.stringify(customerMeetingReport)); | ||||
| return this.httpService.apiPost('edit-customer-meeting-report', formData); | return this.httpService.apiPost('edit-customer-meeting-report', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create internal meeting | * Create internal meeting | ||||
| * @param internalMeeting | * @param internalMeeting | ||||
| */ | */ | ||||
| public apiCreateInternalMeeting(internalMeeting: IInternalMeeting): Observable<IApiResponse> { | |||||
| public apiCreateInternalMeeting(internalMeeting: IInternalMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('internalMeeting', JSON.stringify(internalMeeting)); | formData.append('internalMeeting', JSON.stringify(internalMeeting)); | ||||
| return this.httpService.apiPost('create-internal-meeting', formData); | return this.httpService.apiPost('create-internal-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit internal meeting | * Edit internal meeting | ||||
| * @param internalMeeting | * @param internalMeeting | ||||
| */ | */ | ||||
| public apiEditInternalMeeting(internalMeeting: IInternalMeeting): Observable<IApiResponse> { | |||||
| public apiEditInternalMeeting(internalMeeting: IInternalMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('internalMeeting', JSON.stringify(internalMeeting)); | formData.append('internalMeeting', JSON.stringify(internalMeeting)); | ||||
| return this.httpService.apiPost('edit-internal-meeting', formData); | return this.httpService.apiPost('edit-internal-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete internal meeting | * Delete internal meeting | ||||
| * @param internalMeetingId | * @param internalMeetingId | ||||
| */ | */ | ||||
| public apiDeleteInternalMeeting(internalMeetingId: number): Observable<IApiResponse> { | |||||
| public apiDeleteInternalMeeting(internalMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); | formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); | ||||
| return this.httpService.apiPost('delete-internal-meeting', formData); | return this.httpService.apiPost('delete-internal-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Checks internal meeting report | * Checks internal meeting report | ||||
| * @param internalMeetingId | * @param internalMeetingId | ||||
| */ | */ | ||||
| public apiCheckInternalMeetingReport(internalMeetingId: number): Observable<IApiResponse> { | |||||
| public apiCheckInternalMeetingReport(internalMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); | formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); | ||||
| return this.httpService.apiPost('check-internal-meeting-report', formData, false); | return this.httpService.apiPost('check-internal-meeting-report', formData, false); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit internal meeting report | * Edit internal meeting report | ||||
| * @param internalMeetingId | * @param internalMeetingId | ||||
| * @param internalMeetingReport | * @param internalMeetingReport | ||||
| */ | */ | ||||
| public apiEditInternalMeetingReport(internalMeetingId: number, internalMeetingReport: string): Observable<IApiResponse> { | |||||
| public apiEditInternalMeetingReport(internalMeetingId: number, internalMeetingReport: string); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); | formData.append('internalMeetingId', JSON.stringify(internalMeetingId)); | ||||
| formData.append('internalMeetingReport', JSON.stringify(internalMeetingReport)); | formData.append('internalMeetingReport', JSON.stringify(internalMeetingReport)); | ||||
| return this.httpService.apiPost('edit-internal-meeting-report', formData); | return this.httpService.apiPost('edit-internal-meeting-report', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create operator meeting | * Create operator meeting | ||||
| * @param operatorMeeting | * @param operatorMeeting | ||||
| */ | */ | ||||
| public apiCreateOperatorMeeting(operatorMeeting: IOperatorMeeting): Observable<IApiResponse> { | |||||
| public apiCreateOperatorMeeting(operatorMeeting: IOperatorMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('operatorMeeting', JSON.stringify(operatorMeeting)); | formData.append('operatorMeeting', JSON.stringify(operatorMeeting)); | ||||
| return this.httpService.apiPost('create-operator-meeting', formData); | return this.httpService.apiPost('create-operator-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit operator meeting | * Edit operator meeting | ||||
| * @param operatorMeeting | * @param operatorMeeting | ||||
| */ | */ | ||||
| public apiEditOperatorMeeting(operatorMeeting: IOperatorMeeting): Observable<IApiResponse> { | |||||
| public apiEditOperatorMeeting(operatorMeeting: IOperatorMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('operatorMeeting', JSON.stringify(operatorMeeting)); | formData.append('operatorMeeting', JSON.stringify(operatorMeeting)); | ||||
| return this.httpService.apiPost('edit-operator-meeting', formData); | return this.httpService.apiPost('edit-operator-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete operator meeting | * Delete operator meeting | ||||
| * @param {number} operatorMeetingId | * @param {number} operatorMeetingId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiDeleteOperatorMeeting(operatorMeetingId: number): Observable<IApiResponse> { | |||||
| public apiDeleteOperatorMeeting(operatorMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); | formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); | ||||
| return this.httpService.apiPost('delete-operator-meeting', formData); | return this.httpService.apiPost('delete-operator-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Checks operator meeting report | * Checks operator meeting report | ||||
| * @param operatorMeetingId | * @param operatorMeetingId | ||||
| */ | */ | ||||
| public apiCheckOperatorMeetingReport(operatorMeetingId: number): Observable<IApiResponse> { | |||||
| public apiCheckOperatorMeetingReport(operatorMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); | formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); | ||||
| return this.httpService.apiPost('check-operator-meeting-report', formData, true); | return this.httpService.apiPost('check-operator-meeting-report', formData, true); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit operator meeting report | * Edit operator meeting report | ||||
| * @param operatorMeetingId | * @param operatorMeetingId | ||||
| * @param operatorMeetingReport | * @param operatorMeetingReport | ||||
| */ | */ | ||||
| public apiEditOperatorMeetingReport(operatorMeetingId: number, operatorMeetingReport: string): Observable<IApiResponse> { | |||||
| public apiEditOperatorMeetingReport(operatorMeetingId: number, operatorMeetingReport: string); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); | formData.append('operatorMeetingId', JSON.stringify(operatorMeetingId)); | ||||
| formData.append('operatorMeetingReport', JSON.stringify(operatorMeetingReport)); | formData.append('operatorMeetingReport', JSON.stringify(operatorMeetingReport)); | ||||
| return this.httpService.apiPost('edit-operator-meeting-report', formData); | return this.httpService.apiPost('edit-operator-meeting-report', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create production meeting | * Create production meeting | ||||
| * @param productionMeeting | * @param productionMeeting | ||||
| */ | */ | ||||
| public apiCreateProductionMeeting(productionMeeting: IProductionMeeting): Observable<IApiResponse> { | |||||
| public apiCreateProductionMeeting(productionMeeting: IProductionMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('productionMeeting', JSON.stringify(productionMeeting)); | formData.append('productionMeeting', JSON.stringify(productionMeeting)); | ||||
| return this.httpService.apiPost('create-production-meeting', formData); | return this.httpService.apiPost('create-production-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit production meeting | * Edit production meeting | ||||
| * @param productionMeeting | * @param productionMeeting | ||||
| */ | */ | ||||
| public apiEditProductionMeeting(productionMeeting: IProductionMeeting): Observable<IApiResponse> { | |||||
| public apiEditProductionMeeting(productionMeeting: IProductionMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('productionMeeting', JSON.stringify(productionMeeting)); | formData.append('productionMeeting', JSON.stringify(productionMeeting)); | ||||
| return this.httpService.apiPost('edit-production-meeting', formData); | return this.httpService.apiPost('edit-production-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete production meeting | * Delete production meeting | ||||
| * @param {number} productionMeetingId | * @param {number} productionMeetingId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiDeleteProductionMeeting(productionMeetingId: number): Observable<IApiResponse> { | |||||
| public apiDeleteProductionMeeting(productionMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); | formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); | ||||
| return this.httpService.apiPost('delete-production-meeting', formData); | return this.httpService.apiPost('delete-production-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Checks production meeting report | * Checks production meeting report | ||||
| * @param productionMeetingId | * @param productionMeetingId | ||||
| */ | */ | ||||
| public apiCheckProductionMeetingReport(productionMeetingId: number): Observable<IApiResponse> { | |||||
| public apiCheckProductionMeetingReport(productionMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); | formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); | ||||
| return this.httpService.apiPost('check-production-meeting-report', formData, true); | return this.httpService.apiPost('check-production-meeting-report', formData, true); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit production meeting report | * Edit production meeting report | ||||
| * @param productionMeetingId | * @param productionMeetingId | ||||
| * @param productionMeetingReport | * @param productionMeetingReport | ||||
| */ | */ | ||||
| public apiEditProductionMeetingReport(productionMeetingId: number, productionMeetingReport: string): Observable<IApiResponse> { | |||||
| public apiEditProductionMeetingReport(productionMeetingId: number, productionMeetingReport: string); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); | formData.append('productionMeetingId', JSON.stringify(productionMeetingId)); | ||||
| formData.append('productionMeetingReport', JSON.stringify(productionMeetingReport)); | formData.append('productionMeetingReport', JSON.stringify(productionMeetingReport)); | ||||
| return this.httpService.apiPost('edit-production-meeting-report', formData); | return this.httpService.apiPost('edit-production-meeting-report', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Create service meeting | * Create service meeting | ||||
| * @param serviceMeeting | * @param serviceMeeting | ||||
| */ | */ | ||||
| public apiCreateServiceMeeting(serviceMeeting: IServiceMeeting): Observable<IApiResponse> { | |||||
| public apiCreateServiceMeeting(serviceMeeting: IServiceMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('serviceMeeting', JSON.stringify(serviceMeeting)); | formData.append('serviceMeeting', JSON.stringify(serviceMeeting)); | ||||
| return this.httpService.apiPost('create-service-meeting', formData); | return this.httpService.apiPost('create-service-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit service meeting | * Edit service meeting | ||||
| * @param serviceMeeting | * @param serviceMeeting | ||||
| */ | */ | ||||
| public apiEditServiceMeeting(serviceMeeting: IServiceMeeting): Observable<IApiResponse> { | |||||
| public apiEditServiceMeeting(serviceMeeting: IServiceMeeting); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('serviceMeeting', JSON.stringify(serviceMeeting)); | formData.append('serviceMeeting', JSON.stringify(serviceMeeting)); | ||||
| return this.httpService.apiPost('edit-service-meeting', formData); | return this.httpService.apiPost('edit-service-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete service meeting | * Delete service meeting | ||||
| * @param {number} serviceMeetingId | * @param {number} serviceMeetingId | ||||
| * @returns {Observable<IApiResponse>} | * @returns {Observable<IApiResponse>} | ||||
| */ | */ | ||||
| public apiDeleteServiceMeeting(serviceMeetingId: number): Observable<IApiResponse> { | |||||
| public apiDeleteServiceMeeting(serviceMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); | formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); | ||||
| return this.httpService.apiPost('delete-service-meeting', formData); | return this.httpService.apiPost('delete-service-meeting', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Checks production meeting report | * Checks production meeting report | ||||
| * @param serviceMeetingId | * @param serviceMeetingId | ||||
| */ | */ | ||||
| public apiCheckServiceMeetingReport(serviceMeetingId: number): Observable<IApiResponse> { | |||||
| public apiCheckServiceMeetingReport(serviceMeetingId: number); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); | formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); | ||||
| return this.httpService.apiPost('check-service-meeting-report', formData, true); | return this.httpService.apiPost('check-service-meeting-report', formData, true); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit service meeting report | * Edit service meeting report | ||||
| * @param serviceMeetingId | * @param serviceMeetingId | ||||
| * @param serviceMeetingReport | * @param serviceMeetingReport | ||||
| */ | */ | ||||
| public apiEditServiceMeetingReport(serviceMeetingId: number, serviceMeetingReport: string): Observable<IApiResponse> { | |||||
| public apiEditServiceMeetingReport(serviceMeetingId: number, serviceMeetingReport: string); : Observable < IApiResponse > { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); | formData.append('serviceMeetingId', JSON.stringify(serviceMeetingId)); | ||||
| formData.append('serviceMeetingReport', JSON.stringify(serviceMeetingReport)); | formData.append('serviceMeetingReport', JSON.stringify(serviceMeetingReport)); | ||||
| return this.httpService.apiPost('edit-service-meeting-report', formData); | return this.httpService.apiPost('edit-service-meeting-report', formData); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Returns meeting list as excel | * Returns meeting list as excel | ||||
| * @param meetingList | * @param meetingList | ||||
| * @param fileName | * @param fileName | ||||
| */ | */ | ||||
| public apiExportMeetingList(meetingList: {}[], fileName: string): void { | |||||
| public apiExportMeetingList(meetingList: {}[], fileName: string); : void { | |||||
| const formData = new FormData(); | const formData = new FormData(); | ||||
| formData.append('meetingList', JSON.stringify(meetingList)); | formData.append('meetingList', JSON.stringify(meetingList)); | ||||
| this.httpService.apiFilePost('export-meeting-list', formData).subscribe( | this.httpService.apiFilePost('export-meeting-list', formData).subscribe( | ||||
| @@ -450,5 +450,5 @@ export class MeetingService { | |||||
| error => { | error => { | ||||
| } | } | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| } | } | ||||
| @@ -1,12 +1,8 @@ | |||||
| import {null === } from 'util'; | |||||
| export class Utils { | export class Utils { | ||||
| /** | /** | ||||
| * Sorts array of objects by given criteria | * Sorts array of objects by given criteria | ||||
| * @param {Array<jasmine.Any>} paramArray | |||||
| * @param {string} criteria | |||||
| * @returns {Array<jasmine.Any>} | |||||
| */ | */ | ||||
| static sortObjArrayByStringCriteria(paramArray: Array<any>, criteria: string): Array<any> { | static sortObjArrayByStringCriteria(paramArray: Array<any>, criteria: string): Array<any> { | ||||
| const sortedArray: Array<any> = paramArray.sort((obj1, obj2) => { | const sortedArray: Array<any> = paramArray.sort((obj1, obj2) => { | ||||
| @@ -23,20 +19,17 @@ export class Utils { | |||||
| /** | /** | ||||
| * Returns a sorted object by given array an criteria | * Returns a sorted object by given array an criteria | ||||
| * @param {Array<any>} paramArray | |||||
| * @param {string} criteria | |||||
| * @returns {{}} | |||||
| */ | */ | ||||
| static getSortedObjFromArray(paramArray: Array<any> = null, criteria: string = null) { | static getSortedObjFromArray(paramArray: Array<any> = null, criteria: string = null) { | ||||
| const res: {} = {}; | 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 | * Deep clones object | ||||
| * @param object | |||||
| * @returns {any} | |||||
| */ | */ | ||||
| static deepClone(object: any): any { | |||||
| static deepClone(object: any) { | |||||
| return JSON.parse(JSON.stringify(object)); | return JSON.parse(JSON.stringify(object)); | ||||
| } | } | ||||
| /** | /** | ||||
| * Checks if a file is an image file | * Checks if a file is an image file | ||||
| * @param {File} file | |||||
| * @returns {boolean} | |||||
| */ | */ | ||||
| static isImageFile(file: File): 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 | * Checks if a file is an Excel file | ||||
| * @param {File} file | |||||
| * @returns {boolean} | |||||
| */ | */ | ||||
| static isExcelFile(file: File): 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 | * Strips spaces from string and sets string to lowercase | ||||
| * @param s | |||||
| */ | */ | ||||
| static stripString(s: string): string { | static stripString(s: string): string { | ||||
| return s.replace(/[\s]/g, '').toLowerCase(); | return s.replace(/[\s]/g, '').toLowerCase(); | ||||
| @@ -83,8 +69,6 @@ export class Utils { | |||||
| /** | /** | ||||
| * Checks if a given value is an integer | * Checks if a given value is an integer | ||||
| * @param {any} value | |||||
| * @returns {boolean} | |||||
| */ | */ | ||||
| static isInteger(value: any): boolean { | static isInteger(value: any): boolean { | ||||
| return Number.isInteger(Number(value)); | return Number.isInteger(Number(value)); | ||||
| @@ -92,8 +76,6 @@ export class Utils { | |||||
| /** | /** | ||||
| * Checks if a given value is a decimal / float | * Checks if a given value is a decimal / float | ||||
| * @param {any} value | |||||
| * @returns {boolean} | |||||
| */ | */ | ||||
| static isFloat(value: any): boolean { | static isFloat(value: any): boolean { | ||||
| const val: any = value.replace(',', '.'); | const val: any = value.replace(',', '.'); | ||||
| @@ -102,8 +84,6 @@ export class Utils { | |||||
| /** | /** | ||||
| * Checks if a given value is a boolean | * Checks if a given value is a boolean | ||||
| * @param value | |||||
| * @returns {boolean} | |||||
| */ | */ | ||||
| static isBoolean(value: any): boolean { | static isBoolean(value: any): boolean { | ||||
| return typeof value === 'boolean'; | return typeof value === 'boolean'; | ||||
| @@ -116,7 +96,6 @@ export class Utils { | |||||
| /** | /** | ||||
| * Returns current date | * Returns current date | ||||
| * @param withTime | |||||
| */ | */ | ||||
| static getCurrentDate(withTime: boolean = false): string { | static getCurrentDate(withTime: boolean = false): string { | ||||
| let res: string; | let res: string; | ||||
| @@ -140,15 +119,15 @@ export class Utils { | |||||
| /** | /** | ||||
| * Returns date and time in german format | * 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 = ''; | 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 day: number = date.getDate(); | ||||
| const month: number = date.getMonth() + 1; | const month: number = date.getMonth() + 1; | ||||
| const year: number = date.getFullYear(); | const year: number = date.getFullYear(); | ||||
| @@ -186,10 +165,9 @@ export class Utils { | |||||
| /** | /** | ||||
| * Checks URL | * Checks URL | ||||
| * @param url | |||||
| */ | */ | ||||
| static checkUrl(url: string): string { | static checkUrl(url: string): string { | ||||
| if (!null === url)) { | |||||
| if (null !== url) { | |||||
| let newUrl = decodeURIComponent(url); | let newUrl = decodeURIComponent(url); | ||||
| newUrl = newUrl.trim().replace(/\s/g, ''); | newUrl = newUrl.trim().replace(/\s/g, ''); | ||||
| if (/^(:\/\/)/.test(newUrl)) { | if (/^(:\/\/)/.test(newUrl)) { | ||||
| @@ -199,7 +177,7 @@ export class Utils { | |||||
| return `http://${newUrl}`; | return `http://${newUrl}`; | ||||
| } | } | ||||
| return newUrl; | return newUrl; | ||||
| } else { | |||||
| } else { | |||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||
| @@ -79,7 +79,7 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI | |||||
| */ | */ | ||||
| public generateEntries(): void { | public generateEntries(): void { | ||||
| this.rowData = []; | this.rowData = []; | ||||
| if (null !== this.customerContacts)) { | |||||
| if (null !== this.customerContacts) { } } {) { | |||||
| for (let i = 0; i < this.customerContacts.length; i++) { | for (let i = 0; i < this.customerContacts.length; i++) { | ||||
| this.rowData.push({ | this.rowData.push({ | ||||
| id: this.customerContacts[i].id, | id: this.customerContacts[i].id, | ||||
| @@ -102,7 +102,7 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI | |||||
| * Row is clicked | * Row is clicked | ||||
| * @param e | * @param e | ||||
| */ | */ | ||||
| public rowClicked(e: any) { | |||||
| public rowClicked(e: any); { | |||||
| this.modalCustomerContactPersonDetailList.openModal(); | this.modalCustomerContactPersonDetailList.openModal(); | ||||
| this.customerContactPersonDetailList.setData(this.customersById[e.data.customer_id], Utils.deepClone(this.customerContactsById[e.data.id]) as ICustomerContact); | 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 | * Edit customer contact | ||||
| * @param customerContact | * @param customerContact | ||||
| */ | */ | ||||
| public editCustomerContactFunction(customerContact: ICustomerContact): void { | |||||
| public editCustomerContactFunction(customerContact: ICustomerContact); : void { | |||||
| this.customerService.apiEditCustomerContact(customerContact).subscribe( | this.customerService.apiEditCustomerContact(customerContact).subscribe( | ||||
| data => { | data => { | ||||
| this.customerContactPersonDetailList.updateData(data.result_data as ICustomer); | this.customerContactPersonDetailList.updateData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Delete customer contact | * Delete customer contact | ||||
| * @param contactId | * @param contactId | ||||
| */ | */ | ||||
| public deleteCustomerContactFunction(contactId: number): void { | |||||
| public deleteCustomerContactFunction(contactId: number); : void { | |||||
| this.customerService.apiDeleteCustomerContact(contactId).subscribe( | this.customerService.apiDeleteCustomerContact(contactId).subscribe( | ||||
| data => { | data => { | ||||
| this.modalCustomerContactPersonDetailList.closeModal(); | this.modalCustomerContactPersonDetailList.closeModal(); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Shortcut to customer detail | * Shortcut to customer detail | ||||
| * @param customer | * @param customer | ||||
| */ | */ | ||||
| public shortcutFunction(customer: ICustomer): void { | |||||
| public shortcutFunction(customer: ICustomer); : void { | |||||
| this.modalCustomerContactPersonDetailList.closeModal(); | this.modalCustomerContactPersonDetailList.closeModal(); | ||||
| this.shortcut.emit(customer); | this.shortcut.emit(customer); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Export customer contacts pdf | * Export customer contacts pdf | ||||
| */ | */ | ||||
| public exportCustomerContactsPdf(): void { | |||||
| public exportCustomerContactsPdf(); : void { | |||||
| this.commonService.apiExportContactsPdf('Kunden_Kontakte', 'customer'); | this.commonService.apiExportContactsPdf('Kunden_Kontakte', 'customer'); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Export customer xmas pdf | * Export customer xmas pdf | ||||
| */ | */ | ||||
| public exportXmasPdf(): void { | |||||
| public exportXmasPdf(); : void { | |||||
| this.commonService.apiExportXmasPdf('Kunden_Weihnachten', 'customer'); | this.commonService.apiExportXmasPdf('Kunden_Weihnachten', 'customer'); | ||||
| } | |||||
| }; | |||||
| } | } | ||||
| @@ -67,7 +67,7 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn | |||||
| * Set component data after all data has been received | * Set component data after all data has been received | ||||
| */ | */ | ||||
| private setComponentData() { | private setComponentData() { | ||||
| if (null !== this.customers && null !== this.customerContacts)) { | |||||
| if (null !== this.customers && null !== this.customerContacts) { } } {) { | |||||
| this.customerList.setData(this.customers); | this.customerList.setData(this.customers); | ||||
| this.customerContactList.setData(this.customers, this.customerContacts); | this.customerContactList.setData(this.customers, this.customerContacts); | ||||
| } | } | ||||
| @@ -77,7 +77,7 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn | |||||
| * Customer row is clicked | * Customer row is clicked | ||||
| * @param e | * @param e | ||||
| */ | */ | ||||
| public rowClickedCustomer(e: any) { | |||||
| public rowClickedCustomer(e: any); { | |||||
| this.customerService.apiGetCustomerFull(e.data.customer_id).subscribe( | this.customerService.apiGetCustomerFull(e.data.customer_id).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| @@ -90,159 +90,159 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn | |||||
| /** | /** | ||||
| * OnClick Create customer | * OnClick Create customer | ||||
| */ | */ | ||||
| public createCustomer(): void { | |||||
| public createCustomer(); : void { | |||||
| this.modalCustomerDataEdit.openModal(); | this.modalCustomerDataEdit.openModal(); | ||||
| this.customerDataEdit.setData(Factory.getEmptyCustomer()); | this.customerDataEdit.setData(Factory.getEmptyCustomer()); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Creates customer | * Creates customer | ||||
| * @param customer | * @param customer | ||||
| */ | */ | ||||
| public createCustomerFunction(customer: ICustomer): void { | |||||
| public createCustomerFunction(customer: ICustomer); : void { | |||||
| this.customerService.apiCreateCustomer(customer).subscribe( | this.customerService.apiCreateCustomer(customer).subscribe( | ||||
| data => { | data => { | ||||
| this.modalCustomerDataEdit.closeModal(); | this.modalCustomerDataEdit.closeModal(); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Saves customer | * Saves customer | ||||
| * @param customer | * @param customer | ||||
| */ | */ | ||||
| public editCustomerFunction(customer: ICustomer): void { | |||||
| public editCustomerFunction(customer: ICustomer); : void { | |||||
| this.customerService.apiEditCustomer(customer).subscribe( | this.customerService.apiEditCustomer(customer).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Creates customer contact | * Creates customer contact | ||||
| * @param customerContact | * @param customerContact | ||||
| */ | */ | ||||
| public createCustomerContactFunction(customerContact: ICustomerContact): void { | |||||
| public createCustomerContactFunction(customerContact: ICustomerContact); : void { | |||||
| this.customerService.apiCreateCustomerContact(customerContact).subscribe( | this.customerService.apiCreateCustomerContact(customerContact).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit customer contact | * Edit customer contact | ||||
| * @param customerContact | * @param customerContact | ||||
| */ | */ | ||||
| public editCustomerContactFunction(customerContact: ICustomerContact): void { | |||||
| public editCustomerContactFunction(customerContact: ICustomerContact); : void { | |||||
| this.customerService.apiEditCustomerContact(customerContact).subscribe( | this.customerService.apiEditCustomerContact(customerContact).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer, true); | this.customerView.setData(data.result_data as ICustomer, true); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Deletes customer contact | * Deletes customer contact | ||||
| * @param contactId | * @param contactId | ||||
| */ | */ | ||||
| public deleteCustomerContactFunction(contactId: number): void { | |||||
| public deleteCustomerContactFunction(contactId: number); : void { | |||||
| this.customerService.apiDeleteCustomerContact(contactId).subscribe( | this.customerService.apiDeleteCustomerContact(contactId).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Creates customer note entry | * Creates customer note entry | ||||
| * @param customerNote | * @param customerNote | ||||
| */ | */ | ||||
| public createCustomerNoteFunction(customerNote: ICustomerNote): void { | |||||
| public createCustomerNoteFunction(customerNote: ICustomerNote); : void { | |||||
| this.customerService.apiCreateCustomerNote(customerNote).subscribe( | this.customerService.apiCreateCustomerNote(customerNote).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edits customer note entry | * Edits customer note entry | ||||
| * @param customerNote | * @param customerNote | ||||
| */ | */ | ||||
| public editCustomerNoteFunction(customerNote: ICustomerNote): void { | |||||
| public editCustomerNoteFunction(customerNote: ICustomerNote); : void { | |||||
| this.customerService.apiEditCustomerNote(customerNote).subscribe( | this.customerService.apiEditCustomerNote(customerNote).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer, true); | this.customerView.setData(data.result_data as ICustomer, true); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Deletes customer note entry | * Deletes customer note entry | ||||
| * @param customerNoteId | * @param customerNoteId | ||||
| */ | */ | ||||
| public deleteCustomerNoteFunction(customerNoteId: number): void { | |||||
| public deleteCustomerNoteFunction(customerNoteId: number); : void { | |||||
| this.customerService.apiDeleteCustomerNote(customerNoteId).subscribe( | this.customerService.apiDeleteCustomerNote(customerNoteId).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Creates customer meeting entry | * Creates customer meeting entry | ||||
| * @param customerMeeting | * @param customerMeeting | ||||
| */ | */ | ||||
| public createCustomerMeetingFunction(customerMeeting: ICustomerMeeting): void { | |||||
| public createCustomerMeetingFunction(customerMeeting: ICustomerMeeting); : void { | |||||
| this.meetingService.apiCreateCustomerMeeting(customerMeeting).subscribe( | this.meetingService.apiCreateCustomerMeeting(customerMeeting).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edits customer meeting entry | * Edits customer meeting entry | ||||
| * @param customerMeeting | * @param customerMeeting | ||||
| */ | */ | ||||
| public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting): void { | |||||
| public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting); : void { | |||||
| this.meetingService.apiEditCustomerMeeting(customerMeeting).subscribe( | this.meetingService.apiEditCustomerMeeting(customerMeeting).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer, true); | this.customerView.setData(data.result_data as ICustomer, true); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Deletes customer meeting entry | * Deletes customer meeting entry | ||||
| * @param customerMeetingId | * @param customerMeetingId | ||||
| */ | */ | ||||
| public deleteCustomerMeetingFunction(customerMeetingId: number): void { | |||||
| public deleteCustomerMeetingFunction(customerMeetingId: number); : void { | |||||
| this.meetingService.apiDeleteCustomerMeeting(customerMeetingId).subscribe( | this.meetingService.apiDeleteCustomerMeeting(customerMeetingId).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edit report after meeting has started | * Edit report after meeting has started | ||||
| * @param reportValues | * @param reportValues | ||||
| */ | */ | ||||
| public editCustomerMeetingReportFunction(reportValues: any): void { | |||||
| public editCustomerMeetingReportFunction(reportValues: any); : void { | |||||
| const meetingId: number = reportValues.id; | const meetingId: number = reportValues.id; | ||||
| const report: string = reportValues.report; | const report: string = reportValues.report; | ||||
| this.meetingService.apiEditCustomerMeetingReport(meetingId, report).subscribe( | this.meetingService.apiEditCustomerMeetingReport(meetingId, report).subscribe( | ||||
| @@ -251,13 +251,13 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn | |||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Shortcut to customer detail | * Shortcut to customer detail | ||||
| * @param customer | * @param customer | ||||
| */ | */ | ||||
| public shortcutFunction(customer: ICustomer): void { | |||||
| public shortcutFunction(customer: ICustomer); : void { | |||||
| this.customerService.apiGetCustomerFull(customer.id).subscribe( | this.customerService.apiGetCustomerFull(customer.id).subscribe( | ||||
| data => { | data => { | ||||
| this.customerView.setData(data.result_data as ICustomer); | this.customerView.setData(data.result_data as ICustomer); | ||||
| @@ -265,13 +265,13 @@ export class CustomerManagementComponent extends AgGridComponent implements OnIn | |||||
| }, | }, | ||||
| error => {} | error => {} | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Destroy | * Destroy | ||||
| */ | */ | ||||
| ngOnDestroy(): void { | |||||
| if (this.customersSub !== null && this.customersSub !== undefined) { | |||||
| ngOnDestroy(); : void { | |||||
| if(this.customersSub !== null && this.customersSub !== undefined); { | |||||
| this.customersSub.unsubscribe(); | this.customersSub.unsubscribe(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -19,7 +19,7 @@ import {IConfig} from '../../../../model/virtual/config'; | |||||
| import {NgForm} from '@angular/forms'; | import {NgForm} from '@angular/forms'; | ||||
| import {ScrollToService} from '@nicky-lenaers/ngx-scroll-to'; | import {ScrollToService} from '@nicky-lenaers/ngx-scroll-to'; | ||||
| import {CustomerService} from '../../../../services/customer.service'; | import {CustomerService} from '../../../../services/customer.service'; | ||||
| import {null === } from 'util'; | |||||
| import {null === ; } from; 'util'; | |||||
| import {MeetingService} from '../../../../services/meeting.service'; | import {MeetingService} from '../../../../services/meeting.service'; | ||||
| import {FormComponent} from '../../../../components/form-component'; | import {FormComponent} from '../../../../components/form-component'; | ||||
| import {Const} from '../../../../utils/const'; | import {Const} from '../../../../utils/const'; | ||||
| @@ -101,7 +101,7 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI | |||||
| */ | */ | ||||
| public updateData(customer: ICustomer): void { | public updateData(customer: ICustomer): void { | ||||
| this.customer = customer; | 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++) { | for (let i = 0; i < this.customer.v_customer_meetings.length; i++) { | ||||
| if (this.customer.v_customer_meetings[i].id === this.customerMeeting.id) { | if (this.customer.v_customer_meetings[i].id === this.customerMeeting.id) { | ||||
| this.customerMeeting = this.customer.v_customer_meetings[i]; | this.customerMeeting = this.customer.v_customer_meetings[i]; | ||||
| @@ -114,7 +114,7 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI | |||||
| /** | /** | ||||
| * Sets variables for meeting | * Sets variables for meeting | ||||
| */ | */ | ||||
| public setMeetingData() { | |||||
| public setMeetingData(); { | |||||
| this.errorMsg = ''; | this.errorMsg = ''; | ||||
| this.reportFormVisible = false; | this.reportFormVisible = false; | ||||
| this.reportOld = this.customerMeeting.report; | this.reportOld = this.customerMeeting.report; | ||||
| @@ -137,25 +137,25 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI | |||||
| /** | /** | ||||
| * Edit meeting entry | * Edit meeting entry | ||||
| */ | */ | ||||
| public editEntry(): void { | |||||
| public editEntry(); : void { | |||||
| this.isEditMode = true; | this.isEditMode = true; | ||||
| this.customerMeetingDetailEdit.setData(this.customer, Utils.deepClone(this.customerMeeting) as ICustomerMeeting); | this.customerMeetingDetailEdit.setData(this.customer, Utils.deepClone(this.customerMeeting) as ICustomerMeeting); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Edits meeting entry | * Edits meeting entry | ||||
| * @param customerMeeting | * @param customerMeeting | ||||
| */ | */ | ||||
| public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting) { | |||||
| public editCustomerMeetingFunction(customerMeeting: ICustomerMeeting); { | |||||
| this.editMeeting.emit(customerMeeting); | this.editMeeting.emit(customerMeeting); | ||||
| } | } | ||||
| /** | /** | ||||
| * Delete meeting entry | * Delete meeting entry | ||||
| */ | */ | ||||
| public deleteEntry(): void { | |||||
| public deleteEntry(); : void { | |||||
| const confirmAction = confirm('Wollen Sie diesen Eintrag wirklich löschen?'); | const confirmAction = confirm('Wollen Sie diesen Eintrag wirklich löschen?'); | ||||
| if (confirmAction == true) { | |||||
| if(confirmAction == true; ) { | |||||
| this.deleteMeeting.emit(this.customerMeeting.id); | 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 | * Check if edit report after meeting has started | ||||
| */ | */ | ||||
| public editReport(): void { | |||||
| public editReport(); : void { | |||||
| this.meetingService.apiCheckCustomerMeetingReport(this.customerMeeting.id).subscribe( | this.meetingService.apiCheckCustomerMeetingReport(this.customerMeeting.id).subscribe( | ||||
| data => { | data => { | ||||
| this.reportFormVisible = data.result_data as boolean; | this.reportFormVisible = data.result_data as boolean; | ||||
| @@ -174,13 +174,13 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI | |||||
| error => { | error => { | ||||
| } | } | ||||
| ); | ); | ||||
| } | |||||
| }; | |||||
| /** | /** | ||||
| * Resets Form Validation | * Resets Form Validation | ||||
| */ | */ | ||||
| public resetFormValidation(): void { | |||||
| if (this.reportFormVisible) { | |||||
| public resetFormValidation(); : void { | |||||
| if(this.reportFormVisible); { | |||||
| this.customerMeetingReportForm.form.markAsUntouched(); | this.customerMeetingReportForm.form.markAsUntouched(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -190,9 +190,9 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI | |||||
| * @param value | * @param value | ||||
| * @param valid | * @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.'; | this.errorMsg = 'Bitte beheben Sie alle Fehler.'; | ||||
| if (valid) { | |||||
| if(valid) { | |||||
| this.editMeetingReport.emit({ | this.editMeetingReport.emit({ | ||||
| id: this.customerMeeting.id, | id: this.customerMeeting.id, | ||||
| report: this.customerMeeting.report | report: this.customerMeeting.report | ||||
| @@ -201,6 +201,6 @@ export class CustomerMeetingDetailComponent extends FormComponent implements OnI | |||||
| } else { | } else { | ||||
| this.scrollUp('customer-meeting-edit-report'); | this.scrollUp('customer-meeting-edit-report'); | ||||
| } | } | ||||
| } | |||||
| }; | |||||
| } | } | ||||
| @@ -139,7 +139,7 @@ export class CustomerMeetingViewComponent extends AgGridComponent implements OnI | |||||
| phone: value.phone_no, | phone: value.phone_no, | ||||
| mobile: value.mobile_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)); | |||||
| }); | }); | ||||
| } | } | ||||
| @@ -113,7 +113,7 @@ export class CustomerNoteViewComponent extends AgGridComponent implements OnInit | |||||
| creator: this.customerNote[i].creation_user_firstname + ' ' + this.customerNote[i].creation_user_lastname, | 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)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -10,10 +10,10 @@ import {IOperatorMeeting} from '../../../model/entities/operator-meeting'; | |||||
| import {IOperator} from '../../../model/entities/operator'; | import {IOperator} from '../../../model/entities/operator'; | ||||
| import {MeetingService} from '../../../services/meeting.service'; | import {MeetingService} from '../../../services/meeting.service'; | ||||
| import {Utils} from '../../../utils/utils'; | 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({ | @Component({ | ||||
| selector: 'app-meeting-list', | 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++) { | 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; | 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; | 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 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]; | 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, | 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: {}[] = []; | const exportData: {}[] = []; | ||||
| this.gridParamsApi.forEachNodeAfterFilter(function(rowNode, index) { | this.gridParamsApi.forEachNodeAfterFilter(function(rowNode, index) { | ||||
| const exportEntry: {} = rowNode.data; | const exportEntry: {} = rowNode.data; | ||||
| delete exportEntry['that']; | |||||
| delete exportEntry['participants']; | |||||
| delete exportEntry.that; | |||||
| delete exportEntry.participants; | |||||
| exportData.push(exportEntry); | exportData.push(exportEntry); | ||||
| }); | }); | ||||
| @@ -4,12 +4,12 @@ | |||||
| //////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////// | ||||
| // LOCAL 4 Spawntree ;) | // 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 = { | export const environment = { | ||||
| @@ -3,7 +3,7 @@ | |||||
| // `ng build --env=prod` then `environment.prod.ts` will be used instead. | // `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`. | // 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 = { | export const path = { | ||||
| path_assets: environment.apiAssetPath, | path_assets: environment.apiAssetPath, | ||||
| @@ -14,5 +14,8 @@ | |||||
| "exclude": [ | "exclude": [ | ||||
| "src/test.ts", | "src/test.ts", | ||||
| "src/**/*.spec.ts" | "src/**/*.spec.ts" | ||||
| ], | |||||
| "types": [ | |||||
| "node" | |||||
| ] | ] | ||||
| } | } | ||||