From 89b19fb7748cac7733a51ea8a990d8aacdcb065f Mon Sep 17 00:00:00 2001 From: "prabhatkumar.oc082" Date: Thu, 2 May 2024 15:33:31 +0530 Subject: [PATCH 1/3] added tabs on lead view --- .../src/Database/Seeders/LeadSourceSeeder.php | 5 +++ .../Activity/ActivityController.php | 8 ++-- .../Admin/src/Resources/assets/js/app.js | 5 ++- .../Admin/src/Resources/assets/sass/app.scss | 7 ++++ .../Admin/src/Resources/lang/en/app.php | 4 ++ .../leads/view/activity-action.blade.php | 41 +++++++++++++++++++ .../views/leads/view/activity-list.blade.php | 19 +++++++-- 7 files changed, 79 insertions(+), 10 deletions(-) diff --git a/packages/Webkul/Admin/src/Database/Seeders/LeadSourceSeeder.php b/packages/Webkul/Admin/src/Database/Seeders/LeadSourceSeeder.php index 7bf1bb2b4..522f8abab 100644 --- a/packages/Webkul/Admin/src/Database/Seeders/LeadSourceSeeder.php +++ b/packages/Webkul/Admin/src/Database/Seeders/LeadSourceSeeder.php @@ -41,6 +41,11 @@ public function run() 'name' => 'Direct', 'created_at' => $now, 'updated_at' => $now, + ], [ + 'id' => 6, + 'name' => 'WhatsApp', + 'created_at' => $now, + 'updated_at' => $now, ] ]); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Activity/ActivityController.php b/packages/Webkul/Admin/src/Http/Controllers/Activity/ActivityController.php index f68d5e8b3..95e5dd216 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Activity/ActivityController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Activity/ActivityController.php @@ -142,15 +142,15 @@ public function store() { $this->validate(request(), [ 'type' => 'required', - 'comment' => 'required_if:type,note', - 'schedule_from' => 'required_unless:type,note', - 'schedule_to' => 'required_unless:type,note', + 'comment' => 'required_if:type,note,whatsapp', + 'schedule_from' => 'required_unless:type,note,whatsapp', + 'schedule_to' => 'required_unless:type,note,whatsapp', ]); Event::dispatch('activity.create.before'); $activity = $this->activityRepository->create(array_merge(request()->all(), [ - 'is_done' => request('type') == 'note' ? 1 : 0, + 'is_done' => request('type') == 'note' || request('type') == 'whatsapp' ? 1 : 0, 'user_id' => auth()->guard('user')->user()->id, ])); diff --git a/packages/Webkul/Admin/src/Resources/assets/js/app.js b/packages/Webkul/Admin/src/Resources/assets/js/app.js index b7ac78fa3..a98a7b625 100644 --- a/packages/Webkul/Admin/src/Resources/assets/js/app.js +++ b/packages/Webkul/Admin/src/Resources/assets/js/app.js @@ -22,8 +22,9 @@ import './bootstrap'; import hi_IN from 'vee-validate/dist/locale/hi'; import zh_CN from 'vee-validate/dist/locale/zh_CN'; - import 'vue-cal/dist/i18n/ar.js'; - import 'vue-cal/dist/i18n/tr.js'; + import 'vue-cal/dist/i18n/en.es.js'; + import 'vue-cal/dist/i18n/ar.es.js'; + import 'vue-cal/dist/i18n/tr.es.js'; window.moment = require('moment'); diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss index c7b7320b7..f3c995ee5 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss @@ -1290,6 +1290,13 @@ body { top: 8px; } + &.whatsapp { + background-image: url("../images/note-icon.svg"); + width: 16px; + height: 20px; + top: 8px; + } + &.call { background-image: url("../images/call-icon.svg"); top: 9px; diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 1920a4a4f..16f5a192a 100644 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -170,6 +170,8 @@ 'lunch' => 'Lunch', 'file' => 'File', 'quote' => 'Quote', + 'whatsapp' => 'WhatsApp', + 'whatsapp-comment' => 'Message', 'create-quote' => 'Create Quote', 'type' => 'Type', 'description' => 'Description', @@ -221,6 +223,7 @@ 'meeting-scheduled' => 'Meeting scheduled at :from - :to', 'lunch-scheduled' => 'Lunch scheduled at :from - :to', 'file-added' => 'File added', + 'whatsapp-added' => 'WhasApp message added', 'quote-destroy-success' => 'Quote removed successfully.', 'tag-create-success' => 'Tag added successfully.', 'tag-destroy-success' => 'Tag removed successfully.', @@ -337,6 +340,7 @@ 'back' => 'Back', 'type' => 'Type', 'note' => 'Note', + 'whatsapp' => 'Whatsapp message', 'call' => 'Call', 'meeting' => 'Meeting', 'lunch' => 'Lunch', diff --git a/packages/Webkul/Admin/src/Resources/views/leads/view/activity-action.blade.php b/packages/Webkul/Admin/src/Resources/views/leads/view/activity-action.blade.php index 9728f9592..0129ef833 100644 --- a/packages/Webkul/Admin/src/Resources/views/leads/view/activity-action.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/leads/view/activity-action.blade.php @@ -408,6 +408,47 @@ class="control" @endif {!! view_render_event('admin.leads.view.informations.activity_actions.quote.after', ['lead' => $lead]) !!} + + {!! view_render_event('admin.leads.view.informations.activity_actions.whatsapp.before', ['lead' => $lead]) !!} + + +
+ + + + + + @csrf() + +
+ + + + + + @{{ errors.first('whatsapp-form.comment') }} + +
+ + + +
+
+ + {!! view_render_event('admin.leads.view.informations.activity_actions.whatsapp.after', ['lead' => $lead]) !!} diff --git a/packages/Webkul/Admin/src/Resources/views/leads/view/activity-list.blade.php b/packages/Webkul/Admin/src/Resources/views/leads/view/activity-list.blade.php index c00412094..890017975 100644 --- a/packages/Webkul/Admin/src/Resources/views/leads/view/activity-list.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/leads/view/activity-list.blade.php @@ -16,7 +16,7 @@
-
+