diff --git a/src/app/modules/shared/components/details-fields/details-fields.component.html b/src/app/modules/shared/components/details-fields/details-fields.component.html index 3ecc6f7e6..6954cc808 100644 --- a/src/app/modules/shared/components/details-fields/details-fields.component.html +++ b/src/app/modules/shared/components/details-fields/details-fields.component.html @@ -21,7 +21,7 @@ (search)="onClearedComponent($event)" (change)="onSelectedProject($event)" ngDefaultControl="project_name"> - +
diff --git a/src/app/modules/shared/components/details-fields/details-fields.component.ts b/src/app/modules/shared/components/details-fields/details-fields.component.ts index 32b8c408b..580f0794d 100644 --- a/src/app/modules/shared/components/details-fields/details-fields.component.ts +++ b/src/app/modules/shared/components/details-fields/details-fields.component.ts @@ -22,7 +22,7 @@ import { TechnologyState } from '../../store/technology.reducers'; import { EntryActionTypes } from './../../../time-clock/store/entry.actions'; import { SaveEntryEvent } from './save-entry-event'; import { ProjectSelectedEvent } from './project-selected-event'; -import { get } from 'lodash'; +import { get, isEmpty } from 'lodash'; import { DATE_FORMAT, DATE_FORMAT_YEAR } from 'src/environments/environment'; import { TechnologiesComponent } from '../technologies/technologies.component'; import { MatDatepicker } from '@angular/material/datepicker'; @@ -179,7 +179,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit { this.goingToWorkOnThis = this.entryToEdit?.running ? true : false; this.shouldRestartEntry = false; this.getRecentProjects(); - if (this.entryToEdit) { + if (this.entryToEdit && !isEmpty(this.entryToEdit)) { this.isTechnologiesDisabled = false; this.selectedTechnologies = this.entryToEdit.technologies; const projectFound = this.listProjects.find((project) => project.id === this.entryToEdit.project_id); diff --git a/src/app/modules/time-entries/pages/time-entries.component.ts b/src/app/modules/time-entries/pages/time-entries.component.ts index 6cdb0607c..1fbada9dd 100644 --- a/src/app/modules/time-entries/pages/time-entries.component.ts +++ b/src/app/modules/time-entries/pages/time-entries.component.ts @@ -113,7 +113,7 @@ export class TimeEntriesComponent implements OnInit, OnDestroy, AfterViewInit { editEntry(entryId: string) { this.entryId = entryId; this.store.pipe(select(getTimeEntriesDataSource)).subscribe(ds => { - this.entry = ds.data.find((entry) => entry.id === entryId); + this.entry = {... ds.data.find((entry) => entry.id === entryId)}; this.canMarkEntryAsWIP = this.isEntryRunningEqualsToEntryToEdit(this.getEntryRunning(ds.data), this.entry) || this.isTheEntryToEditTheLastOne(ds.data); });