| @@ -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 | |||
| @@ -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 { | |||
| @@ -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'; | |||
| } | |||
| } | |||
| @@ -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'); | |||
| } | |||
| } | |||
| } | |||
| @@ -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[]; | |||
| @@ -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<ICustomer[]>} | |||
| */ | |||
| public getCustomers$(): Observable<ICustomer[]> { | |||
| public getCustomers$(); : Observable < ICustomer[] > { | |||
| return this.dataCustomers$; | |||
| } | |||
| }; | |||
| /** | |||
| * Returns observable of customer contacts | |||
| * @returns {Observable<ICustomer[]>} | |||
| */ | |||
| public getCustomerContacts$(): Observable<ICustomerContact[]> { | |||
| public getCustomerContacts$(); : Observable < ICustomerContact[] > { | |||
| return this.dataCustomerContacts$; | |||
| } | |||
| }; | |||
| @@ -100,7 +100,7 @@ export class CustomerService { | |||
| * Gets all customers | |||
| * @returns {Observable<IApiResponse>} | |||
| */ | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiGetCustomerFull(customerId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiCreateCustomer(customer: ICustomer): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiEditCustomer(customer: ICustomer): Observable<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiEditCustomerContact(customerContact: ICustomerContact): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiDeleteCustomerContact(customerContactId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiCreateCustomerNote(customerNote: ICustomerNote): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiEditCustomerNote(customerNote: ICustomerNote): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiDeleteCustomerNote(customerNoteId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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); | |||
| } | |||
| }; | |||
| } | |||
| @@ -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<IMeetingData> { | |||
| public getMeetingsData$(); : Observable < IMeetingData > { | |||
| return this.meetingData$; | |||
| } | |||
| }; | |||
| public getCustomerMeetings$(): Observable<ICustomerMeeting[]> { | |||
| public getCustomerMeetings$(); : Observable < ICustomerMeeting[] > { | |||
| return this.customerMeetings$; | |||
| } | |||
| }; | |||
| public getInternalMeetings$(): Observable<IInternalMeeting[]> { | |||
| public getInternalMeetings$(); : Observable < IInternalMeeting[] > { | |||
| return this.internalMeetings$; | |||
| } | |||
| }; | |||
| public getOperatorMeetings$(): Observable<IOperatorMeeting[]> { | |||
| public getOperatorMeetings$(); : Observable < IOperatorMeeting[] > { | |||
| return this.operatorMeetings$; | |||
| } | |||
| }; | |||
| public getProductionMeetings$(): Observable<IProductionMeeting[]> { | |||
| public getProductionMeetings$(); : Observable < IProductionMeeting[] > { | |||
| return this.productionMeetings$; | |||
| } | |||
| }; | |||
| public getServiceMeetings$(): Observable<IServiceMeeting[]> { | |||
| public getServiceMeetings$(); : Observable < IServiceMeeting[] > { | |||
| return this.serviceMeetings$; | |||
| } | |||
| }; | |||
| /** | |||
| * Gets all customers | |||
| * @returns {Observable<IApiResponse>} | |||
| */ | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiCreateCustomerMeeting(customerMeeting: ICustomerMeeting): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiEditCustomerMeeting(customerMeeting: ICustomerMeeting): Observable<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiDeleteCustomerMeeting(customerMeetingId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiDeleteOperatorMeeting(operatorMeetingId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiDeleteProductionMeeting(productionMeetingId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse>} | |||
| */ | |||
| public apiDeleteServiceMeeting(serviceMeetingId: number): Observable<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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<IApiResponse> { | |||
| 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 => { | |||
| } | |||
| ); | |||
| } | |||
| }; | |||
| } | |||
| @@ -1,12 +1,8 @@ | |||
| import {null === } from 'util'; | |||
| export class Utils { | |||
| /** | |||
| * 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> { | |||
| const sortedArray: Array<any> = paramArray.sort((obj1, obj2) => { | |||
| @@ -23,20 +19,17 @@ export class Utils { | |||
| /** | |||
| * 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) { | |||
| 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; | |||
| } | |||
| } | |||
| @@ -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'); | |||
| } | |||
| }; | |||
| } | |||
| @@ -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(); | |||
| } | |||
| } | |||
| @@ -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'); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| @@ -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)); | |||
| }); | |||
| } | |||
| @@ -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)); | |||
| } | |||
| /** | |||
| @@ -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); | |||
| }); | |||
| @@ -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 = { | |||
| @@ -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, | |||
| @@ -14,5 +14,8 @@ | |||
| "exclude": [ | |||
| "src/test.ts", | |||
| "src/**/*.spec.ts" | |||
| ], | |||
| "types": [ | |||
| "node" | |||
| ] | |||
| } | |||