@@ -23,6 +23,7 @@ import { Permission } from '@/constants/permissions'
23
23
import { FormSchema } from '@/modules/emergencyEvacuationApplications/constants/formSchema'
24
24
import { EmergencyEvacuationApplication } from '@/modules/emergencyEvacuationApplications/constants/types'
25
25
import { getEmergencyEvacuationApplication } from '@/modules/emergencyEvacuationApplications/service'
26
+ import { Checkbox } from '@/components/ui/checkbox'
26
27
27
28
const Page = ( { params } : { params : { slug : string ; id : string } } ) => {
28
29
const { t } = useTranslation ( )
@@ -118,10 +119,14 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
118
119
{ ...field }
119
120
disabled
120
121
defaultValue = {
121
- emergencyEvacuationApplicationDetails . firstName ??
122
- '' +
123
- emergencyEvacuationApplicationDetails . lastName ??
124
- ''
122
+ ( emergencyEvacuationApplicationDetails . firstName ??
123
+ '' ) +
124
+ ( emergencyEvacuationApplicationDetails . firstName &&
125
+ emergencyEvacuationApplicationDetails . lastName
126
+ ? ' '
127
+ : '' ) +
128
+ ( emergencyEvacuationApplicationDetails . lastName ??
129
+ '' )
125
130
}
126
131
/>
127
132
</ FormControl >
@@ -154,48 +159,106 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
154
159
) }
155
160
/>
156
161
{ emergencyEvacuationApplicationDetails . isInPerson ? null : (
157
- < FormField
158
- control = { control }
159
- name = "applicantNameSurname"
160
- render = { ( { field } ) => (
161
- < FormItem className = "sm:col-span-1" >
162
- < FormLabel >
163
- { t ( 'emergencyEvacuationApplications.applicantNameSurname' ) }
164
- </ FormLabel >
165
- < FormControl >
162
+ < >
163
+ < FormField
164
+ control = { control }
165
+ name = "applicantNameSurname"
166
+ render = { ( { field } ) => (
167
+ < FormItem className = "sm:col-span-1" >
168
+ < FormLabel >
169
+ { t (
170
+ 'emergencyEvacuationApplications.applicantNameSurname' ,
171
+ ) }
172
+ </ FormLabel >
173
+ < FormControl >
174
+ < Input
175
+ { ...field }
176
+ disabled
177
+ defaultValue = {
178
+ emergencyEvacuationApplicationDetails . applicantFirstName ??
179
+ '' +
180
+ emergencyEvacuationApplicationDetails . applicantLastName ??
181
+ ''
182
+ }
183
+ />
184
+ </ FormControl >
185
+ </ FormItem >
186
+ ) }
187
+ />
188
+ < FormField
189
+ control = { control }
190
+ name = "applicantPhoneNumber"
191
+ render = { ( { field } ) => (
192
+ < FormItem className = "sm:col-span-1" >
193
+ < FormLabel >
194
+ { t (
195
+ 'emergencyEvacuationApplications.applicantPhoneNumber' ,
196
+ ) }
197
+ </ FormLabel >
198
+ < FormControl >
199
+ < Input
200
+ { ...field }
201
+ disabled
202
+ defaultValue = {
203
+ emergencyEvacuationApplicationDetails
204
+ ?. applicantPhoneNumber ?. countryCode &&
205
+ emergencyEvacuationApplicationDetails
206
+ ?. applicantPhoneNumber ?. lineNumber
207
+ ? formatPhoneNumber (
208
+ emergencyEvacuationApplicationDetails . applicantPhoneNumber ,
209
+ )
210
+ : ''
211
+ }
212
+ />
213
+ </ FormControl >
214
+ </ FormItem >
215
+ ) }
216
+ />
217
+ </ >
218
+ ) }
219
+ < FormField
220
+ control = { control }
221
+ name = "sourcecityAndDistrict"
222
+ render = { ( { field } ) => (
223
+ < FormItem className = "sm:col-span-1" >
224
+ < FormLabel >
225
+ { t (
226
+ 'emergencyEvacuationApplications.sourceCityAndDistrict' ,
227
+ ) }
228
+ </ FormLabel >
229
+ < FormControl >
166
230
< Input
167
231
{ ...field }
168
232
disabled
169
233
defaultValue = {
170
- emergencyEvacuationApplicationDetails . applicantFirstName ??
171
- '' +
172
- emergencyEvacuationApplicationDetails . applicantLastName ??
173
- ''
234
+ ( emergencyEvacuationApplicationDetails . sourceCity ??
235
+ '' ) +
236
+ ( emergencyEvacuationApplicationDetails . sourceCity &&
237
+ emergencyEvacuationApplicationDetails . sourceDistrict
238
+ ? ' / '
239
+ : '' ) +
240
+ ( emergencyEvacuationApplicationDetails . sourceDistrict ??
241
+ '' )
174
242
}
175
243
/>
176
- </ FormControl >
177
- </ FormItem >
178
- ) }
179
- />
180
- ) }
181
-
182
-
183
- { /* GO ON FROM HERE */ }
184
-
185
-
186
-
244
+ </ FormControl >
245
+ </ FormItem >
246
+ ) }
247
+ />
187
248
< FormField
188
249
control = { control }
189
- name = "createdUser "
250
+ name = "address "
190
251
render = { ( { field } ) => (
191
252
< FormItem className = "sm:col-span-1" >
192
- < FormLabel > { t ( 'applicationCreatedUser' ) } </ FormLabel >
253
+ < FormLabel >
254
+ { t ( 'emergencyEvacuationApplications.address' ) }
255
+ </ FormLabel >
193
256
< FormControl >
194
257
< Input
195
258
{ ...field }
196
259
disabled
197
260
defaultValue = {
198
- emergencyEvacuationApplicationDetails . createdUser ??
261
+ emergencyEvacuationApplicationDetails . address ??
199
262
''
200
263
}
201
264
/>
@@ -205,20 +268,27 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
205
268
/>
206
269
< FormField
207
270
control = { control }
208
- name = "createDate "
271
+ name = "targetCityAndDistrict "
209
272
render = { ( { field } ) => (
210
273
< FormItem className = "sm:col-span-1" >
211
- < FormLabel > { t ( 'createDate' ) } </ FormLabel >
274
+ < FormLabel >
275
+ { t (
276
+ 'emergencyEvacuationApplications.targetCityAndDistrict' ,
277
+ ) }
278
+ </ FormLabel >
212
279
< FormControl >
213
280
< Input
214
281
{ ...field }
215
282
disabled
216
283
defaultValue = {
217
- emergencyEvacuationApplicationDetails . createdAt
218
- ? formatDateTime (
219
- emergencyEvacuationApplicationDetails . createdAt ,
220
- )
221
- : ''
284
+ ( emergencyEvacuationApplicationDetails . targetCity ??
285
+ '' ) +
286
+ ( emergencyEvacuationApplicationDetails . targetCity &&
287
+ emergencyEvacuationApplicationDetails . targetDistrict
288
+ ? ' / '
289
+ : '' ) +
290
+ ( emergencyEvacuationApplicationDetails . targetDistrict ??
291
+ '' )
222
292
}
223
293
/>
224
294
</ FormControl >
@@ -227,16 +297,16 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
227
297
/>
228
298
< FormField
229
299
control = { control }
230
- name = "updatedUser "
300
+ name = "seatCount "
231
301
render = { ( { field } ) => (
232
302
< FormItem className = "sm:col-span-1" >
233
- < FormLabel > { t ( 'updatedUser ' ) } </ FormLabel >
303
+ < FormLabel > { t ( 'seatingCount ' ) } </ FormLabel >
234
304
< FormControl >
235
305
< Input
236
306
{ ...field }
237
307
disabled
238
308
defaultValue = {
239
- emergencyEvacuationApplicationDetails . updatedUser ??
309
+ emergencyEvacuationApplicationDetails . seatingCount ??
240
310
''
241
311
}
242
312
/>
@@ -246,18 +316,64 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
246
316
/>
247
317
< FormField
248
318
control = { control }
249
- name = "updateDate "
319
+ name = "isInPerson "
250
320
render = { ( { field } ) => (
251
321
< FormItem className = "sm:col-span-1" >
252
- < FormLabel > { t ( 'updateDate' ) } </ FormLabel >
322
+ < div className = "flex items-center" >
323
+ < FormLabel className = "mr-2" >
324
+ { t ( 'emergencyEvacuationApplications.isInPerson' ) }
325
+ </ FormLabel >
326
+ < FormControl >
327
+ < Checkbox
328
+ { ...field }
329
+ disabled
330
+ checked = {
331
+ emergencyEvacuationApplicationDetails . isInPerson
332
+ }
333
+ />
334
+ </ FormControl >
335
+ </ div >
336
+ </ FormItem >
337
+ ) }
338
+ />
339
+ < FormField
340
+ control = { control }
341
+ name = "status"
342
+ render = { ( { field } ) => (
343
+ < FormItem className = "sm:col-span-1" >
344
+ < FormLabel >
345
+ { t ( 'emergencyEvacuationApplications.status' ) }
346
+ </ FormLabel >
347
+ < FormControl >
348
+ < Input
349
+ { ...field }
350
+ disabled
351
+ value = {
352
+ t (
353
+ emergencyEvacuationApplicationDetails . status . toLowerCase ( ) ,
354
+ ) ?? ''
355
+ }
356
+ />
357
+ </ FormControl >
358
+ </ FormItem >
359
+ ) }
360
+ />
361
+ < FormField
362
+ control = { control }
363
+ name = "createdAt"
364
+ render = { ( { field } ) => (
365
+ < FormItem className = "sm:col-span-1" >
366
+ < FormLabel >
367
+ { t ( 'emergencyEvacuationApplications.createdAt' ) }
368
+ </ FormLabel >
253
369
< FormControl >
254
370
< Input
255
371
{ ...field }
256
372
disabled
257
373
defaultValue = {
258
- emergencyEvacuationApplicationDetails . updatedAt
374
+ emergencyEvacuationApplicationDetails . createdAt
259
375
? formatDateTime (
260
- emergencyEvacuationApplicationDetails . updatedAt ,
376
+ emergencyEvacuationApplicationDetails . createdAt ,
261
377
)
262
378
: ''
263
379
}
@@ -266,29 +382,45 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
266
382
</ FormItem >
267
383
) }
268
384
/>
269
- </ div >
270
- </ CardContent >
271
- </ Card >
272
-
273
- < Card >
274
- < CardHeader >
275
- < CardTitle > { t ( 'userInformation' ) } </ CardTitle >
276
- </ CardHeader >
277
- < CardContent >
278
- < div className = "grid grid-cols-1 gap-y-6 sm:grid-cols-3 sm:gap-x-6 mb-6" >
279
385
< FormField
280
386
control = { control }
281
- name = "firstName "
387
+ name = "anyHandicap "
282
388
render = { ( { field } ) => (
283
- < FormItem >
284
- < FormLabel > { t ( 'firstName' ) } </ FormLabel >
389
+ < FormItem className = "sm:col-span-1" >
390
+ < div className = "flex items-center" >
391
+ < FormLabel className = "mr-2" >
392
+ { t ( 'emergencyEvacuationApplications.anyHandicap' ) }
393
+ </ FormLabel >
394
+ < FormControl >
395
+ < Checkbox
396
+ { ...field }
397
+ disabled
398
+ checked = {
399
+ emergencyEvacuationApplicationDetails . hasObstaclePersonExist
400
+ }
401
+ />
402
+ </ FormControl >
403
+ </ div >
404
+ </ FormItem >
405
+ ) }
406
+ />
407
+ < FormField
408
+ control = { control }
409
+ name = "confirmedSeatCount"
410
+ render = { ( { field } ) => (
411
+ < FormItem className = "sm:col-span-1" >
412
+ < FormLabel >
413
+ { t (
414
+ 'emergencyEvacuationApplications.confirmedSeatCount' ,
415
+ ) }
416
+ </ FormLabel >
285
417
< FormControl >
286
418
< Input
287
419
{ ...field }
288
420
disabled
289
421
defaultValue = {
290
- emergencyEvacuationApplicationDetails
291
- ?. firstName ?? ''
422
+ // emergencyEvacuationApplicationDetails.confirmedSeatCount ??
423
+ ''
292
424
}
293
425
/>
294
426
</ FormControl >
@@ -297,26 +429,26 @@ const Page = ({ params }: { params: { slug: string; id: string } }) => {
297
429
/>
298
430
< FormField
299
431
control = { control }
300
- name = "lastName "
432
+ name = "operatorNotes "
301
433
render = { ( { field } ) => (
302
- < FormItem >
303
- < FormLabel > { t ( 'lastName' ) } </ FormLabel >
434
+ < FormItem className = "sm:col-span-1" >
435
+ < FormLabel >
436
+ { t ( 'emergencyEvacuationApplications.notes' ) }
437
+ </ FormLabel >
304
438
< FormControl >
305
439
< Input
306
440
{ ...field }
307
441
disabled
308
442
defaultValue = {
309
- emergencyEvacuationApplicationDetails
310
- ?. lastName ?? ''
443
+ emergencyEvacuationApplicationDetails . notes ??
444
+ ''
311
445
}
312
446
/>
313
447
</ FormControl >
314
448
</ FormItem >
315
449
) }
316
450
/>
317
451
</ div >
318
- < div className = "grid grid-cols-1 gap-y-6 sm:grid-cols-2 sm:gap-x-6" >
319
- </ div >
320
452
</ CardContent >
321
453
</ Card >
322
454
</ form >
0 commit comments