diff --git a/packages/ui-core/shared/src/lib/table-components/editors/job-search-availability-editor.component.ts b/packages/ui-core/shared/src/lib/table-components/editors/job-search-availability-editor.component.ts index a30586a629..7e6bb91749 100644 --- a/packages/ui-core/shared/src/lib/table-components/editors/job-search-availability-editor.component.ts +++ b/packages/ui-core/shared/src/lib/table-components/editors/job-search-availability-editor.component.ts @@ -63,7 +63,8 @@ export class JobSearchAvailabilityEditorComponent extends DefaultEditor implemen this._toastrService.success(toastrMessageKey, { name: employee.fullName }); } catch (error) { - this._toastrService.danger(error); + const errorMessage = error?.message || 'An error occurred while updating the job search availability.'; + this._toastrService.danger(errorMessage); } } } diff --git a/packages/ui-core/shared/src/lib/table-components/editors/non-editable-number-editor.component.ts b/packages/ui-core/shared/src/lib/table-components/editors/non-editable-number-editor.component.ts index c3dde52b6e..c8b85b5951 100644 --- a/packages/ui-core/shared/src/lib/table-components/editors/non-editable-number-editor.component.ts +++ b/packages/ui-core/shared/src/lib/table-components/editors/non-editable-number-editor.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { Cell, DefaultEditor } from 'angular2-smart-table'; @Component({ @@ -9,11 +9,20 @@ import { Cell, DefaultEditor } from 'angular2-smart-table'; ` }) export class NonEditableNumberEditorComponent extends DefaultEditor implements OnInit { - cellValue!: string; + cellValue!: string | number; @Input() cell!: Cell; ngOnInit() { - this.cellValue = this.cell.getValue(); + const value = this.cell.getValue(); + if (value === null || value === undefined) { + console.warn('Cell value is null or undefined'); + this.cellValue = ''; + } else if (typeof value === 'number' || typeof value === 'string') { + this.cellValue = value; + } else { + console.error('Unexpected cell value type:', typeof value); + this.cellValue = ''; + } } } diff --git a/packages/ui-core/shared/src/lib/table-components/table-components.module.ts b/packages/ui-core/shared/src/lib/table-components/table-components.module.ts index 5a78413778..aaeee1761b 100644 --- a/packages/ui-core/shared/src/lib/table-components/table-components.module.ts +++ b/packages/ui-core/shared/src/lib/table-components/table-components.module.ts @@ -136,6 +136,8 @@ import { TaskBadgeViewComponentModule } from '../tasks/task-badge-view/task-badg InvoiceTotalValueComponent, NotesWithTagsComponent, NumberEditorComponent, + JobSearchAvailabilityEditorComponent, + NonEditableNumberEditorComponent, OrganizationWithTagsComponent, PhoneUrlComponent, PictureNameTagsComponent,