Skip to content

Commit 31df7a1

Browse files
Merge remote-tracking branch 'origin/2.x' into config-files
2 parents fb060b1 + 7fc913b commit 31df7a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+471
-853
lines changed

packages/Webkul/Admin/src/Http/Controllers/Lead/LeadController.php

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Webkul\Admin\Http\Resources\StageResource;
1919
use Webkul\Lead\Repositories\LeadRepository;
2020
use Webkul\Lead\Repositories\PipelineRepository;
21+
use Webkul\Lead\Repositories\ProductRepository;
2122
use Webkul\Lead\Repositories\SourceRepository;
2223
use Webkul\Lead\Repositories\StageRepository;
2324
use Webkul\Lead\Repositories\TypeRepository;
@@ -34,9 +35,10 @@ public function __construct(
3435
protected UserRepository $userRepository,
3536
protected SourceRepository $sourceRepository,
3637
protected TypeRepository $typeRepository,
37-
protected LeadRepository $leadRepository,
3838
protected PipelineRepository $pipelineRepository,
39-
protected StageRepository $stageRepository
39+
protected StageRepository $stageRepository,
40+
protected LeadRepository $leadRepository,
41+
protected ProductRepository $productRepository,
4042
) {
4143
request()->request->add(['entity_type' => 'leads']);
4244
}
@@ -424,4 +426,54 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest): JsonRespons
424426
]);
425427
}
426428
}
429+
430+
/**
431+
* Attach product to lead.
432+
*/
433+
public function addProduct(int $leadId): JsonResponse
434+
{
435+
$product = $this->productRepository->updateOrCreate(
436+
[
437+
'lead_id' => $leadId,
438+
'product_id' => request()->input('product_id'),
439+
],
440+
array_merge(
441+
request()->all(),
442+
[
443+
'lead_id' => $leadId,
444+
'amount' => request()->input('price') * request()->input('quantity'),
445+
],
446+
)
447+
);
448+
449+
return response()->json([
450+
'data' => $product,
451+
'message' => trans('admin::app.leads.update-success'),
452+
]);
453+
}
454+
455+
/**
456+
* Remove product attached to lead.
457+
*/
458+
public function removeProduct(int $id): JsonResponse
459+
{
460+
try {
461+
Event::dispatch('lead.product.delete.before', $id);
462+
463+
$this->productRepository->deleteWhere([
464+
'lead_id' => $id,
465+
'product_id' => request()->input('product_id'),
466+
]);
467+
468+
Event::dispatch('lead.product.delete.after', $id);
469+
470+
return response()->json([
471+
'message' => trans('admin::app.leads.destroy-success'),
472+
]);
473+
} catch (\Exception $exception) {
474+
return response()->json([
475+
'message' => trans('admin::app.leads.destroy-failed'),
476+
]);
477+
}
478+
}
427479
}

packages/Webkul/Admin/src/Resources/lang/en/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@
14651465
'outbox' => 'Outbox',
14661466
'sent' => 'Sent',
14671467
'trash' => 'Trash',
1468-
'composer-mail-btn' => 'Composer Mail',
1468+
'compose-mail-btn' => 'Compose Mail',
14691469
'btn' => 'Mail',
14701470
'mail' => [
14711471
'title' => 'Compose Mail',

packages/Webkul/Admin/src/Resources/views/activities/edit.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class="flex w-full rounded-md border px-3 py-2 text-sm text-gray-600 transition-
108108

109109
<!-- Participants Multilookup Vue Component -->
110110
<v-multi-lookup-component>
111-
<div class="relative rounded border border-gray-200 px-2 py-1 hover:border-gray-400 focus:border-gray-400" role="button">
111+
<div 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" role="button">
112112
<ul class="flex flex-wrap items-center gap-1">
113113
<li>
114114
<input
@@ -245,12 +245,12 @@ class="w-full px-1 py-1"
245245
>
246246
<!-- Search Button -->
247247
<div class="relative">
248-
<div class="relative rounded border border-gray-200 px-2 py-1 hover:border-gray-400 focus:border-gray-400" role="button">
248+
<div class="relative rounded border border-gray-200 px-2 py-1 hover:border-gray-400 focus:border-gray-400 dark:border-gray-800" role="button">
249249
<ul class="flex flex-wrap items-center gap-1">
250250
<!-- Added Participants -->
251251
<template v-for="userType in ['users', 'persons']">
252252
<li
253-
class="flex items-center gap-1 rounded-md bg-slate-100 pl-2"
253+
class="flex items-center gap-1 rounded-md bg-slate-100 pl-2 dark:bg-slate-950"
254254
v-for="(user, index) in addedParticipants[userType]"
255255
>
256256
<!-- Person and User Hidden Input Field -->

packages/Webkul/Admin/src/Resources/views/activities/index.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<x-admin::breadcrumbs name="activities" />
1212
</div>
1313

14-
<div class="text-xl font-bold dark:text-gray-300">
14+
<div class="text-xl font-bold dark:text-white">
1515
@lang('admin::app.activities.index.title')
1616
</div>
1717
</div>
@@ -40,7 +40,7 @@
4040
<x-admin::breadcrumbs name="activities" />
4141
</div>
4242
43-
<div class="text-xl font-bold dark:text-gray-300">
43+
<div class="text-xl font-bold dark:text-white">
4444
@lang('admin::app.activities.index.title')
4545
</div>
4646
</div>
@@ -50,13 +50,13 @@
5050
<div class="flex gap-2">
5151
<i
5252
class="icon-kanban cursor-pointer rounded p-1 text-2xl"
53-
:class="{'bg-gray-200 text-gray-800': viewType == 'table'}"
53+
:class="{'bg-gray-200 dark:bg-gray-800 text-gray-800 dark:text-white': viewType == 'table'}"
5454
@click="toggleView('table')"
5555
></i>
5656
5757
<i
5858
class="icon-calender cursor-pointer rounded p-1 text-2xl"
59-
:class="{'bg-gray-200 text-gray-800': viewType == 'calendor'}"
59+
:class="{'bg-gray-200 dark:bg-gray-800 text-gray-800 dark:text-white': viewType == 'calendor'}"
6060
@click="toggleView('calendor')"
6161
></i>
6262
</div>

packages/Webkul/Admin/src/Resources/views/components/activities/actions/activity/participants.blade.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
<script type="text/x-template" id="v-activity-participants-template">
66
<!-- Search Button -->
77
<div class="relative">
8-
<div class="relative rounded border border-gray-200 px-2 py-1 hover:border-gray-400 focus:border-gray-400" role="button">
8+
<div
9+
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"
10+
role="button"
11+
>
912
<ul class="flex flex-wrap items-center gap-1">
1013
<template v-for="userType in ['users', 'persons']">
1114
<li
12-
class="flex items-center gap-1 rounded-md bg-slate-100 pl-2"
15+
class="flex items-center gap-1 rounded-md bg-slate-100 pl-2 dark:bg-gray-950"
1316
v-for="(user, index) in addedParticipants[userType]"
1417
>
1518
<!-- User Id -->
@@ -64,7 +67,7 @@ class="absolute z-10 w-full rounded bg-white shadow-[0px_10px_20px_0px_#0000001F
6467
class="flex flex-col gap-2"
6568
v-for="userType in ['users', 'persons']"
6669
>
67-
<h3 class="text-sm font-bold text-gray-600 dark:text-gray-400">
70+
<h3 class="text-sm font-bold text-gray-600 dark:text-gray-300">
6871
<template v-if="userType === 'users'">
6972
@lang('admin::app.components.activities.actions.activity.participants.users')
7073
</template>
@@ -76,7 +79,7 @@ class="flex flex-col gap-2"
7679

7780
<ul>
7881
<li
79-
class="rounded-sm px-5 py-2 text-sm text-gray-800 dark:text-gray-300"
82+
class="rounded-sm px-5 py-2 text-sm text-gray-800 dark:text-white"
8083
v-if="! searchedParticipants[userType].length && ! isSearching[userType]"
8184
>
8285
<p class="text-sm text-gray-500 dark:text-gray-400">
@@ -85,7 +88,7 @@ class="rounded-sm px-5 py-2 text-sm text-gray-800 dark:text-gray-300"
8588
</li>
8689

8790
<li
88-
class="cursor-pointer rounded-sm px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-950"
91+
class="cursor-pointer rounded-sm px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-950"
8992
v-for="user in searchedParticipants[userType]"
9093
@click="add(userType, user)"
9194
>

packages/Webkul/Admin/src/Resources/views/components/activities/actions/note.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class="flex h-[74px] w-[84px] flex-col items-center justify-center gap-1 rounded
3232
<form @submit="handleSubmit($event, save)">
3333
<x-admin::modal ref="noteActivityModal" position="bottom-right">
3434
<x-slot:header>
35-
<h3 class="text-base font-semibold">
35+
<h3 class="text-base font-semibold dark:text-white">
3636
@lang('admin::app.components.activities.actions.note.title')
3737
</h3>
3838
</x-slot>

packages/Webkul/Admin/src/Resources/views/components/activities/index.blade.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
</template>
3131

3232
<template v-else>
33-
<div class="w-full bg-white">
34-
<div class="flex gap-4 border-b border-gray-200">
33+
<div class="w-full bg-white dark:bg-gray-900">
34+
<div class="flex gap-4 border-b border-gray-200 dark:border-gray-800">
3535
<div
3636
v-for="type in types"
37-
class="cursor-pointer px-3 py-2.5 text-sm font-medium"
37+
class="cursor-pointer px-3 py-2.5 text-sm font-medium dark:text-white"
3838
:class="{'border-brandColor border-b-2 !text-brandColor transition': selectedType == type.name }"
3939
@click="selectedType = type.name"
4040
>
@@ -62,12 +62,12 @@ class="mt-2 flex h-9 min-h-9 w-9 min-w-9 items-center justify-center rounded-ful
6262
<!-- Activity Details -->
6363
<div
6464
class="flex w-full justify-between gap-4 rounded-md p-4"
65-
:class="{'bg-gray-100': index % 2 != 0 }"
65+
:class="{'bg-gray-100 dark:bg-gray-950': index % 2 != 0 }"
6666
>
6767
<div class="flex flex-col gap-2">
6868
<!-- Activity Title -->
6969
<div class="flex flex-col gap-1">
70-
<p class="font-medium">
70+
<p class="font-medium dark:text-white">
7171
@{{ activity.title }}
7272
</p>
7373

@@ -124,7 +124,9 @@ class="flex w-full justify-between gap-4 rounded-md p-4"
124124
</div>
125125

126126
<!-- Activity Description -->
127-
<p v-if="activity.comment"
127+
<p
128+
class="dark:text-white"
129+
v-if="activity.comment"
128130
>
129131
@{{ activity.comment }}
130132
</p>
@@ -149,7 +151,7 @@ class="flex cursor-pointer items-center gap-1 rounded-md p-1.5"
149151
</div>
150152

151153
<!-- Activity Time and User -->
152-
<div class="text-gray-500">
154+
<div class="text-gray-500 dark:text-gray-300">
153155
@{{ $admin.formatDate(activity.created_at, 'd MMM yyyy, h:mm A') }},
154156

155157
@{{ "@lang('admin::app.components.activities.index.by-user', ['user' => 'replace'])".replace('replace', activity.user.name) }}
@@ -161,7 +163,7 @@ class="flex cursor-pointer items-center gap-1 rounded-md p-1.5"
161163
<x-slot:toggle>
162164
<template v-if="! isUpdating[activity.id]">
163165
<button
164-
class="icon-more flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-2xl transition-all hover:bg-gray-200"
166+
class="icon-more flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-2xl transition-all hover:bg-gray-200 dark:hover:bg-gray-800"
165167
></button>
166168
</template>
167169

@@ -244,11 +246,11 @@ class="grid justify-center justify-items-center gap-3.5 py-12"
244246
<img :src="typeIllustrations[selectedType]?.image ?? typeIllustrations['all'].image">
245247

246248
<div class="flex flex-col items-center gap-2">
247-
<p class="text-xl font-semibold">
249+
<p class="text-xl font-semibold dark:text-white">
248250
@{{ typeIllustrations[selectedType]?.title ?? typeIllustrations['all'].title }}
249251
</p>
250252

251-
<p class="text-gray-400">
253+
<p class="text-gray-400 dark:text-gray-400">
252254
@{{ typeIllustrations[selectedType]?.description ?? typeIllustrations['all'].description }}
253255
</p>
254256
</div>

packages/Webkul/Admin/src/Resources/views/components/attachments/index.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class="flex flex-wrap gap-2"
6565
</script>
6666

6767
<script type="text/x-template" id="v-attachment-item-template">
68-
<div class="flex items-center gap-2 rounded-md bg-gray-100 px-2.5 py-1">
69-
<span class="max-w-xs truncate">
68+
<div class="flex items-center gap-2 rounded-md bg-gray-100 px-2.5 py-1 dark:bg-gray-950">
69+
<span class="max-w-xs truncate dark:text-white">
7070
@{{ attachment.name }}
7171
</span>
7272

@@ -78,7 +78,7 @@ class="hidden"
7878
/>
7979

8080
<i
81-
class="icon-cross-large cursor-pointer rounded-md p-0.5 text-xl hover:bg-gray-200"
81+
class="icon-cross-large cursor-pointer rounded-md p-0.5 text-xl hover:bg-gray-200 dark:hover:bg-gray-800"
8282
@click="remove"
8383
></i>
8484
</div>

packages/Webkul/Admin/src/Resources/views/components/attributes/view.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
@foreach ($customAttributes as $attribute)
1010
@if (view()->exists($typeView = 'admin::components.attributes.view.' . $attribute->type))
1111
<div class="grid grid-cols-[1fr_2fr] items-center gap-1">
12-
<div class="label">{{ $attribute->name }}</div>
12+
<div class="label dark:text-white">{{ $attribute->name }}</div>
1313

14-
<div class="font-medium">
14+
<div class="font-medium dark:text-white">
1515
@include ($typeView, [
1616
'attribute' => $attribute,
1717
'value' => isset($entity) ? $entity[$attribute->code] : null,

packages/Webkul/Admin/src/Resources/views/components/form/control-group/controls/inline/address.blade.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:value='@json($attributes->get('value'))'
44
>
55
<div class="group w-full max-w-full hover:rounded-sm">
6-
<div class="flex items-center rounded-xs text-left pl-2.5 h-[34px] space-x-2">
6+
<div class="rounded-xs flex h-[34px] items-center space-x-2 pl-2.5 text-left">
77
<div class="shimmer h-5 w-48 rounded border border-transparent"></div>
88
</div>
99
</div>
@@ -17,28 +17,28 @@
1717
<div class="group w-full max-w-full hover:rounded-sm">
1818
<!-- Non-editing view -->
1919
<div
20-
class="flex items-center rounded-xs h-[34px] space-x-2"
21-
:class="allowEdit ? 'cursor-pointer hover:bg-gray-50' : ''"
20+
class="rounded-xs flex h-[34px] items-center space-x-2"
21+
:class="allowEdit ? 'cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800' : ''"
2222
:style="textPositionStyle"
2323
>
24-
<div class="relative flex flex-col items-center group !w-full">
25-
<span class="pl-[2px] rounded border border-transparent truncate w-40">@{{ inputValue?.address }} @{{ `${inputValue?.postcode} ${inputValue?.city}` }}</span>
24+
<div class="group relative flex !w-full flex-col items-center">
25+
<span class="w-40 truncate rounded border border-transparent pl-[2px]">@{{ inputValue?.address }} @{{ `${inputValue?.postcode} ${inputValue?.city}` }}</span>
2626
27-
<div class="absolute bottom-0 flex-col items-center hidden mb-5 group-hover:flex">
28-
<span class="relative rounded-md z-10 p-4 text-xs leading-none whitespace-no-wrap text-white bg-black shadow-lg">
27+
<div class="absolute bottom-0 mb-5 hidden flex-col items-center group-hover:flex">
28+
<span class="whitespace-no-wrap relative z-10 rounded-md bg-black p-4 text-xs leading-none text-white shadow-lg dark:text-gray-900">
2929
@{{ inputValue?.address }}<br>
3030
@{{ `${inputValue?.postcode} ${inputValue?.city}` }}<br>
3131
@{{ `${inputValue?.state}, ${inputValue?.country}` }}<br>
3232
</span>
3333
34-
<div class="w-3 h-3 -mt-2 rotate-45 bg-black"></div>
34+
<div class="-mt-2 h-3 w-3 rotate-45 bg-black"></div>
3535
</div>
3636
</div>
3737
3838
<template v-if="allowEdit">
3939
<i
4040
@click="toggle"
41-
class="icon-edit hidden text-xl pr-2 group-hover:block"
41+
class="icon-edit hidden pr-2 text-xl group-hover:block"
4242
></i>
4343
</template>
4444
</div>

0 commit comments

Comments
 (0)