@@ -88,10 +88,17 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
88
88
ngOnChanges ( ) : void {
89
89
if ( this . entryToEdit ) {
90
90
this . selectedTechnology = this . entryToEdit . technologies ;
91
+ < < < << << HEAD
91
92
this . project = this. listProjects . find ( ( p ) => p . id === this . entryToEdit . project_id ) ;
92
93
const activity = this . activities . find ( ( a ) => a . id === this . entryToEdit . activity_id ) ;
93
94
this . projectName = this . project . name ;
94
95
this . entryForm . setValue ( {
96
+ = === ===
97
+ const project = this . listProjects . find ( ( p ) => p . id === this . entryToEdit . project_id ) ;
98
+ const activity = this . activities . find ( ( a ) => a . id === this . entryToEdit . activity_id ) ;
99
+ this . entryForm . setValue ( {
100
+ project : project ? project . name : '' ,
101
+ > >>> >>> fix : #172 Create - time - entries - manually
95
102
activity : activity ? activity . name : '' ,
96
103
description : this . entryToEdit . description ,
97
104
start_date : this . entryToEdit . start_date ? formatDate ( this . entryToEdit . start_date , 'yyyy-MM-dd' , 'en' ) : '' ,
@@ -102,9 +109,14 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
102
109
} ) ;
103
110
} else {
104
111
this . selectedTechnology = [ ] ;
112
+ << < < < << HEAD
105
113
this . project = '' ;
106
114
this . projectName = '' ;
107
115
this . entryForm . setValue ( {
116
+ = === ===
117
+ this . entryForm . setValue ( {
118
+ project : '' ,
119
+ > >>> >>> fix : #172 Create - time - entries - manually
108
120
activity : '' ,
109
121
description : '' ,
110
122
start_date : formatDate ( new Date ( ) , 'yyyy-MM-dd' , 'en' ) ,
@@ -138,9 +150,14 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
138
150
139
151
onSubmit ( ) {
140
152
const activity = this . activities . find ( ( a ) => a . name === this . entryForm . value . activity ) ;
153
+ << < < < << HEAD
141
154
this . project = this . projectName . id ? this . projectName : this . project ;
142
155
const entry = {
143
156
project_id : this . project . id ,
157
+ = === ===
158
+ const entry = {
159
+ project_id : this . entryForm . value . project . id ,
160
+ > >>> >>> fix : #172 Create - time - entries - manually
144
161
activity_id : activity ? activity . id : null ,
145
162
technologies : this . selectedTechnology ,
146
163
description : this . entryForm . value . description ,
0 commit comments