Skip to content

Commit

Permalink
Merge branch '2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-webkul committed Nov 12, 2024
2 parents 891b8a4 + 0fa0576 commit eae02b0
Show file tree
Hide file tree
Showing 141 changed files with 1,183 additions and 719 deletions.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
"Tests\\": "tests/"
}
},
"repositories": [{
"type": "path",
"url": "packages/*/*",
"options": {
"symlink": true
}
}],
"minimum-stability": "stable",
"prefer-stable": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function prepareQueryBuilder(): Builder
$query->whereIn('activities.user_id', $userIds)
->orWhereIn('activity_participants.user_id', $userIds);
}
});
})->groupBy('activities.id', 'leads.id', 'users.id');

$this->addFilter('id', 'activities.id');
$this->addFilter('title', 'activities.title');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,9 @@ public function massUpdate(MassUpdateRequest $massUpdateRequest): JsonResponse
foreach ($leads as $lead) {
Event::dispatch('lead.update.before', $lead->id);

$this->leadRepository->update(
['lead_pipeline_stage_id' => $massUpdateRequest->input('value')],
$lead->id,
['lead_pipeline_stage_id']
);
$lead = $this->leadRepository->find($lead->id);

$lead?->update(['lead_pipeline_stage_id' => $massUpdateRequest->input('value')]);

Event::dispatch('lead.update.before', $lead->id);
}
Expand All @@ -376,7 +374,7 @@ public function massUpdate(MassUpdateRequest $massUpdateRequest): JsonResponse
]);
} catch (\Exception $th) {
return response()->json([
'message' => trans('admin::app.leads.destroy-failed'),
'message' => trans('admin::app.leads.update-failed'),
], 400);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,17 @@ public function download($id)
*/
public function massUpdate(MassUpdateRequest $massUpdateRequest): JsonResponse
{
$leads = $this->leadRepository->findWhereIn('id', $massUpdateRequest->input('indices'));
$emails = $this->emailRepository->findWhereIn('id', $massUpdateRequest->input('indices'));

try {
foreach ($leads as $lead) {
Event::dispatch('email.update.before', $lead->id);
foreach ($emails as $email) {
Event::dispatch('email.update.before', $email->id);

$this->emailRepository->update([
'folders' => request('folders'),
], $lead->id);
], $email->id);

Event::dispatch('email.update.after', $lead->id);
Event::dispatch('email.update.after', $email->id);
}

return response()->json([
Expand Down
8 changes: 8 additions & 0 deletions packages/Webkul/Admin/src/Resources/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -622,3 +622,11 @@
.tox .tox-toolbar__group:last-child button[aria-disabled="true"] {
@apply cursor-not-allowed opacity-50;
}

.tox .tox-toolbar__group:last-child button {
@apply !bg-transparent;
}

.tox .tox-toolbar__group:last-child button:hover {
@apply border-0 !bg-[#3389ec] text-white shadow-none;
}
133 changes: 15 additions & 118 deletions packages/Webkul/Admin/src/Resources/assets/js/plugins/vee-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,20 @@ export default {

defineRule("", () => true);

// @TODO handle this
// @suraj-webkul
defineRule("date_format", (value) => {
return true;
const regex = /^\d{4}-\d{2}-\d{2}$/;

return regex.test(value);
});

// @TODO handle this
// @suraj-webkul
defineRule("after", (value) => {
return true;
const today = new Date();
const inputDate = new Date(value);

today.setHours(0, 0, 0, 0);
inputDate.setHours(0, 0, 0, 0);

return inputDate >= today;
});

configure({
Expand All @@ -129,30 +133,16 @@ export default {
messages: {
...ar.messages,
phone: "يجب أن يكون هذا {field} رقم هاتف صالحًا",
after: "يجب أن يكون {field} تاريخًا في المستقبل أو اليوم.",
},
},

bn: {
...bn,
messages: {
...bn.messages,
phone: "এই {field} একটি বৈধ ফোন নম্বর হতে হবে",
},
},

de: {
...de,
messages: {
...de.messages,
phone: "Dieses {field} muss eine gültige Telefonnummer sein.",
},
},

en: {
...en,
messages: {
...en.messages,
phone: "This {field} must be a valid phone number",
after: "The {field} must be a date in the future or today.",
},
},

Expand All @@ -161,6 +151,7 @@ export default {
messages: {
...es.messages,
phone: "Este {field} debe ser un número de teléfono válido.",
after: "El {field} debe ser una fecha en el futuro o hoy.",
},
},

Expand All @@ -169,86 +160,7 @@ export default {
messages: {
...fa.messages,
phone: "این {field} باید یک شماره تلفن معتبر باشد.",
},
},

fr: {
...fr,
messages: {
...fr.messages,
phone: "Ce {field} doit être un numéro de téléphone valide.",
},
},

he: {
...he,
messages: {
...he.messages,
phone: "זה {field} חייב להיות מספר טלפון תקין.",
},
},

hi_IN: {
...hi_IN,
messages: {
...hi_IN.messages,
phone: "यह {field} कोई मान्य फ़ोन नंबर होना चाहिए।",
},
},

it: {
...it,
messages: {
...it.messages,
phone: "Questo {field} deve essere un numero di telefono valido.",
},
},

ja: {
...ja,
messages: {
...ja.messages,
phone: "この{field}は有効な電話番号である必要があります。",
},
},

nl: {
...nl,
messages: {
...nl.messages,
phone: "Dit {field} moet een geldig telefoonnummer zijn.",
},
},

pl: {
...pl,
messages: {
...pl.messages,
phone: "To {field} musi być prawidłowy numer telefonu.",
},
},

pt_BR: {
...pt_BR,
messages: {
...pt_BR.messages,
phone: "Este {field} deve ser um número de telefone válido.",
},
},

ru: {
...ru,
messages: {
...ru.messages,
phone: "Это {field} должно быть действительным номером телефона.",
},
},

sin: {
...sin,
messages: {
...sin.messages,
phone: "මෙම {field} වටේ වලංගු දුරකතන අංකය විය යුතුයි.",
after: "{field} باید یک تاریخ در آینده یا امروز باشد.",
},
},

Expand All @@ -257,22 +169,7 @@ export default {
messages: {
...tr.messages,
phone: "Bu {field} geçerli bir telefon numarası olmalıdır.",
},
},

uk: {
...uk,
messages: {
...uk.messages,
phone: "Це {field} повинно бути дійсним номером телефону.",
},
},

zh_CN: {
...zh_CN,
messages: {
...zh_CN.messages,
phone: "这个 {field} 必须是一个有效的电话号码。",
after: "{field} gelecekte veya bugün olmalıdır.",
},
},
}),
Expand Down
18 changes: 10 additions & 8 deletions packages/Webkul/Admin/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,13 +849,13 @@
],

'create' => [
'name' => 'الاسم',
'save-btn' => 'حفظ النوع',
'title' => 'إنشاء نوع',
'name' => 'اسم',
'save-btn' => 'حفظ المصدر',
'title' => 'إنشاء مصدر',
],

'edit' => [
'title' => 'تعديل النوع',
'title' => 'تعديل المصدر',
],
],
],
Expand Down Expand Up @@ -887,6 +887,7 @@
'send-email-to-person' => 'إرسال بريد إلكتروني إلى الشخص',
'add-tag' => 'إضافة علامة',
'add-note-as-activity' => 'إضافة ملاحظة كنشاط',
'update-quote' => 'تحديث العرض',
],

'create' => [
Expand Down Expand Up @@ -1034,10 +1035,10 @@
'save-btn' => 'حفظ نموذج الويب',
'submit-button-label' => 'تسمية زر الإرسال',
'submit-success-action' => 'إجراء نجاح الإرسال',
'choose-value' => 'Choose Value',
'select-file' => 'Select File',
'select-image' => 'Select Image',
'enter-value' => 'Enter Value',
'choose-value' => 'اختر القيمة',
'select-file' => 'اختر ملف',
'select-image' => 'اختر صورة',
'enter-value' => 'أدخل القيمة',
],
],

Expand Down Expand Up @@ -1654,6 +1655,7 @@
'leads' => [
'create-success' => 'تم إنشاء العميل المحتمل بنجاح.',
'update-success' => 'تم تحديث العميل المحتمل بنجاح.',
'update-failed' => 'Leads can not be deleted.',
'destroy-success' => 'تم حذف العميل المحتمل بنجاح.',
'destroy-failed' => 'لا يمكن حذف العميل المحتمل.',

Expand Down
10 changes: 6 additions & 4 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,12 +850,12 @@

'create' => [
'name' => 'Name',
'save-btn' => 'Save Type',
'title' => 'Create Type',
'save-btn' => 'Save Source',
'title' => 'Create Source',
],

'edit' => [
'title' => 'Edit Type',
'title' => 'Edit Source',
],
],
],
Expand Down Expand Up @@ -887,6 +887,7 @@
'send-email-to-person' => 'Send email to person',
'add-tag' => 'Add Tag',
'add-note-as-activity' => 'Add Note as Activity',
'update-quote' => 'Update Quote',
],

'create' => [
Expand Down Expand Up @@ -1653,7 +1654,8 @@

'leads' => [
'create-success' => 'Lead created successfully.',
'update-success' => 'Lead updated successfully.',
'update-success' => 'Leads updated successfully.',
'update-failed' => 'Leads can not be deleted.',
'destroy-success' => 'Lead deleted successfully.',
'destroy-failed' => 'Lead can not be deleted.',

Expand Down
8 changes: 5 additions & 3 deletions packages/Webkul/Admin/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,12 +850,12 @@

'create' => [
'name' => 'Nombre',
'save-btn' => 'Guardar Fuente',
'title' => 'Crear Fuente',
'save-btn' => 'Guardar fuente',
'title' => 'Crear fuente',
],

'edit' => [
'title' => 'Editar Fuente',
'title' => 'Editar fuente',
],
],
],
Expand Down Expand Up @@ -887,6 +887,7 @@
'send-email-to-person' => 'Enviar correo a la persona',
'add-tag' => 'Agregar Etiqueta',
'add-note-as-activity' => 'Agregar Nota como Actividad',
'update-quote' => 'Actualizar cotización',
],

'create' => [
Expand Down Expand Up @@ -1654,6 +1655,7 @@
'leads' => [
'create-success' => 'Lead creado exitosamente.',
'update-success' => 'Lead actualizado exitosamente.',
'update-failed' => 'No se pueden eliminar los clientes potenciales.',
'destroy-success' => 'Lead eliminado exitosamente.',
'destroy-failed' => 'No se puede eliminar el lead.',

Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@
'send-email-to-person' => 'ارسال ایمیل به شخص',
'add-tag' => 'افزودن برچسب',
'add-note-as-activity' => 'افزودن یادداشت به‌عنوان فعالیت',
'update-quote' => 'به‌روزرسانی نقل‌قول',
],

'create' => [
Expand Down Expand Up @@ -1654,6 +1655,7 @@
'leads' => [
'create-success' => 'سرنخ با موفقیت ایجاد شد.',
'update-success' => 'سرنخ با موفقیت به‌روزرسانی شد.',
'update-failed' => 'سرنخ‌ها قابل حذف نیستند.',
'destroy-success' => 'سرنخ با موفقیت حذف شد.',
'destroy-failed' => 'سرنخ قابل حذف نیست.',

Expand Down
Loading

0 comments on commit eae02b0

Please sign in to comment.