@@ -39,7 +39,7 @@ class="primary-button"
39
39
>
40
40
@lang (' admin::app.activities.edit.save-btn' )
41
41
</button >
42
-
42
+
43
43
{!! view_render_event (' admin.activities.edit.save_button.after' ) ! !}
44
44
</div >
45
45
</div >
@@ -54,7 +54,7 @@ class="primary-button"
54
54
55
55
<!-- Schedule Date -->
56
56
<x-admin::form .control-group >
57
- <div class =" flex gap-2" >
57
+ <div class =" flex gap-2" >
58
58
<div class =" w-full" >
59
59
<x-admin::form .control-group.label class =" required" >
60
60
@lang (' admin::app.activities.edit.schedule_from' )
@@ -101,7 +101,7 @@ class="flex w-full rounded-md border px-3 py-2 text-sm text-gray-600 transition-
101
101
:label =" trans('admin::app.activities.edit.comment')"
102
102
:placeholder =" trans('admin::app.activities.edit.comment')"
103
103
/>
104
-
104
+
105
105
<x-admin::form .control-group.error control-name =" comment" />
106
106
</x-admin::form .control-group >
107
107
@@ -113,8 +113,8 @@ class="flex w-full rounded-md border px-3 py-2 text-sm text-gray-600 transition-
113
113
114
114
<!-- Participants Multi lookup Vue Component -->
115
115
<v-multi-lookup-component >
116
- <div
117
- class =" relative rounded border border-gray-200 px-2 py-1 hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:hover:border-gray-400 dark:focus:border-gray-400"
116
+ <div
117
+ class =" relative rounded border border-gray-200 px-2 py-1 hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:hover:border-gray-400 dark:focus:border-gray-400"
118
118
role =" button"
119
119
>
120
120
<ul class =" flex flex-wrap items-center gap-1" >
@@ -176,7 +176,7 @@ class="w-full px-1 py-1 dark:bg-gray-900 dark:text-gray-300"
176
176
<x-admin::form .control-group.label class =" required" >
177
177
@lang (' admin::app.activities.edit.title' )
178
178
</x-admin::form .control-group.label >
179
-
179
+
180
180
<x-admin::form .control-group.control
181
181
type =" text"
182
182
name =" title"
@@ -189,13 +189,13 @@ class="w-full px-1 py-1 dark:bg-gray-900 dark:text-gray-300"
189
189
190
190
<x-admin::form .control-group.error control-name =" title" />
191
191
</x-admin::form .control-group >
192
-
192
+
193
193
<!-- Edit Type -->
194
194
<x-admin::form .control-group >
195
195
<x-admin::form .control-group.label class =" required" >
196
196
@lang (' admin::app.activities.edit.type' )
197
197
</x-admin::form .control-group.label >
198
-
198
+
199
199
<x-admin::form .control-group.control
200
200
type =" select"
201
201
name =" type"
@@ -208,16 +208,16 @@ class="w-full px-1 py-1 dark:bg-gray-900 dark:text-gray-300"
208
208
<option value =" call" >
209
209
@lang (' admin::app.activities.edit.call' )
210
210
</option >
211
-
211
+
212
212
<option value =" meeting" >
213
213
@lang (' admin::app.activities.edit.meeting' )
214
214
</option >
215
-
215
+
216
216
<option value =" lunch" >
217
217
@lang (' admin::app.activities.edit.lunch' )
218
218
</option >
219
219
</x-admin::form .control-group.control >
220
-
220
+
221
221
<x-admin::form .control-group.error control-name =" type" />
222
222
</x-admin::form .control-group >
223
223
@@ -250,7 +250,7 @@ class="w-full px-1 py-1 dark:bg-gray-900 dark:text-gray-300"
250
250
{!! view_render_event (' admin.activities.edit.form.after' ) ! !}
251
251
252
252
@pushOnce (' scripts' )
253
- <script
253
+ <script
254
254
type =" text/x-template"
255
255
id =" v-multi-lookup-component-template"
256
256
>
@@ -260,6 +260,14 @@ class="w-full px-1 py-1 dark:bg-gray-900 dark:text-gray-300"
260
260
< ul class = " flex flex-wrap items-center gap-1" >
261
261
<!-- Added Participants -->
262
262
< template v- for = " userType in ['users', 'persons']" >
263
+ < template v- if = " ! addedParticipants[userType].length" >
264
+ < input
265
+ type= " hidden"
266
+ : name= " `participants[${userType}][]`"
267
+ value= " "
268
+ / >
269
+ < / template>
270
+
263
271
< li
264
272
class = " flex items-center gap-1 rounded-md bg-slate-100 pl-2 dark:bg-slate-950 dark:text-gray-300"
265
273
v- for = " (user, index) in addedParticipants[userType]"
@@ -360,27 +368,27 @@ class="cursor-pointer rounded-sm px-3 py-2 text-sm text-gray-800 hover:bg-gray-1
360
368
return {
361
369
isSearching: {
362
370
users: false ,
363
-
371
+
364
372
persons: false ,
365
373
},
366
374
367
375
searchTerm: ' ' ,
368
376
369
377
addedParticipants: {
370
378
users: [],
371
-
379
+
372
380
persons: [],
373
381
},
374
382
375
383
searchedParticipants: {
376
384
users: [],
377
-
385
+
378
386
persons: [],
379
387
},
380
388
381
389
searchEnpoints: {
382
390
users: " {{ route (' admin.settings.users.search' ) } }" ,
383
-
391
+
384
392
persons: " {{ route (' admin.contacts.persons.search' ) } }" ,
385
393
},
386
394
};
@@ -389,7 +397,7 @@ class="cursor-pointer rounded-sm px-3 py-2 text-sm text-gray-800 hover:bg-gray-1
389
397
watch: {
390
398
searchTerm (newVal , oldVal ) {
391
399
this .search (' users' );
392
-
400
+
393
401
this .search (' persons' );
394
402
},
395
403
},
@@ -423,7 +431,7 @@ class="cursor-pointer rounded-sm px-3 py-2 text-sm text-gray-800 hover:bg-gray-1
423
431
}
424
432
})
425
433
.then ((response ) => {
426
- this .addedParticipants [userType].forEach (addedParticipant =>
434
+ this .addedParticipants [userType].forEach (addedParticipant =>
427
435
response .data .data = response .data .data .filter (participant => participant .id !== addedParticipant .id )
428
436
);
429
437
@@ -443,13 +451,13 @@ class="cursor-pointer rounded-sm px-3 py-2 text-sm text-gray-800 hover:bg-gray-1
443
451
444
452
this .searchedParticipants = {
445
453
users: [],
446
-
454
+
447
455
persons: [],
448
456
};
449
457
},
450
458
451
459
remove (userType , participant ) {
452
- this .addedParticipants [userType] = this .addedParticipants [userType].filter (addedParticipant =>
460
+ this .addedParticipants [userType] = this .addedParticipants [userType].filter (addedParticipant =>
453
461
addedParticipant .id !== participant .id
454
462
);
455
463
},
0 commit comments