Skip to content

Commit

Permalink
Merge branch 'master' into product-custom-options
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-webkul committed Jan 16, 2025
2 parents 961ff54 + 0cde6d1 commit 06d9648
Show file tree
Hide file tree
Showing 30 changed files with 88 additions and 92 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/linting_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Linting Tests

on: [push, pull_request]

permissions:
contents: read

jobs:
linting_tests:
runs-on: ${{ matrix.operating-systems }}
Expand All @@ -17,19 +14,9 @@ jobs:
name: PHP ${{ matrix.php-versions }} test on ${{ matrix.operating-systems }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: curl, fileinfo, gd, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer, zip
ini-values: error_reporting=E_ALL
tools: composer:v2

- name: Running Composer Install
run: composer install

- name: Running Pint Test
run: vendor/bin/pint --test -v
- uses: actions/checkout@v1
- name: Running Pint Test
uses: aglipanci/[email protected]
with:
testMode: true
verboseMode: true
2 changes: 1 addition & 1 deletion packages/Webkul/Admin/src/Config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@
'name' => 'order_number_length',
'title' => 'admin::app.configuration.index.sales.order-settings.order-number.length',
'type' => 'text',
'validation' => 'numeric',
'validation' => 'between:1,10|integer',
'channel_based' => true,
], [
'name' => 'order_number_suffix',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,27 @@ public function update(): JsonResponse
public function destroy(int $id): JsonResponse
{
try {
Event::dispatch('tax.category.delete.before', $id);
$taxCategory = $this->taxCategoryRepository->findOrFail($id);

$this->taxCategoryRepository->delete($id);
if (! $taxCategory->tax_rates()->count()) {
Event::dispatch('tax.category.delete.before', $id);

Event::dispatch('tax.category.delete.after', $id);
$taxCategory->delete();

Event::dispatch('tax.category.delete.after', $id);

return new JsonResponse([
'message' => trans('admin::app.settings.taxes.categories.index.delete-success'),
]);
}

return new JsonResponse([
'message' => trans('admin::app.settings.taxes.categories.index.delete-success'),
]);
'message' => trans('admin::app.settings.taxes.categories.index.can-not-delete'),
], 400);
} catch (\Exception $e) {
return new JsonResponse([
'message' => trans('admin::app.settings.taxes.categories.index.delete-failed'),
], 500);
}

return new JsonResponse([
'message' => trans('admin::app.settings.taxes.categories.index.delete-failed'),
], 500);
}
}
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Http/Requests/ConfigurationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public function rules()
$data = json_decode($item, true);

return collect($data['fields'])->mapWithKeys(function ($field) use ($data) {
$key = $data['key'].'.'.$field['name'];
$key = "{$data['key']}.{$field['name']}";

// Check delete key exist in the request
if (! $this->has($key.'.delete')) {
if (! $this->has("{$key}.delete")) {
$validation = isset($field['validation']) && $field['validation'] ? $field['validation'] : 'nullable';

return [$key => $validation];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ public function toArray($request)
'payment_title' => $this->payment_title,
'amount' => core()->formatPrice($this->amount),
'invoice_id' => $this->invoice_id,
'status' => $this->status,
'status' => match ($this->status) {
'paid' => '<span class="label-active">'.ucfirst($this->status).'</span>',
'pending' => '<span class="label-pending">'.ucfirst($this->status).'</span>',
'completed' => '<span class="label-completed">'.ucfirst($this->status).'</span>',
},
'created_at' => $this->created_at->format('d M Y'),
];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'طريقة الدفع',
'status' => 'الحالة',
'title' => 'تفاصيل العملية',
'transaction-data' => 'بيانات العملية',
'transaction-id' => 'رقم العملية',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'تعديل فئات الضرائب',
],

'can-not-delete' => 'لا يمكن حذف فئات الضرائب المعينة.',
'create-success' => 'تم إنشاء فئة ضريبية جديدة',
'delete-failed' => 'فشل حذف فئة الضريبة',
'delete-success' => 'تم حذف فئة الضريبة بنجاح',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'تعيين مفتاح الموقع والمفتاح السري والحالة.',
'title' => 'التحقق من الصحة',
'title' => 'Google التحقق من الصحة',

'credentials' => [
'secret-key' => 'المفتاح السري',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/bn/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'পেমেন্ট মেথড',
'status' => 'অবস্থা',
'title' => 'লেনদেনের বিস্তারিত',
'transaction-data' => 'লেনদেনের তথ্য',
'transaction-id' => 'লেনদেন আইডি',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'কর শ্রেণী সম্পাদনা করুন',
],

'can-not-delete' => 'কর হার নির্ধারিত বিভাগগুলি মুছে ফেলা যাবে না।',
'create-success' => 'নতুন কর শ্রেণী তৈরি হয়েছে',
'delete-failed' => 'কর শ্রেণী মুছে ফেলা ব্যর্থ হয়েছে',
'delete-success' => 'কর শ্রেণী সফলভাবে মুছে ফেলা হয়েছে',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'সাইট কী, সিক্রেট কী এবং স্থিতি সেট করুন।',
'title' => 'ক্যাপচা',
'title' => 'Google ক্যাপচা',

'credentials' => [
'secret-key' => 'সিক্রেট কী',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/de/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'Zahlungsmethode',
'status' => 'Status',
'title' => 'Transaktionsdetails',
'transaction-data' => 'Transaktionsdaten',
'transaction-id' => 'Transaktions-ID',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'Steuerkategorien bearbeiten',
],

'can-not-delete' => 'Steuersätze zugewiesene Kategorien können nicht gelöscht werden.',
'create-success' => 'Neue Steuerkategorie erstellt',
'delete-failed' => 'Steuerkategorie löschen fehlgeschlagen',
'delete-success' => 'Steuerkategorie erfolgreich gelöscht',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'Site-Schlüssel, geheimer Schlüssel und Status festlegen.',
'title' => 'Captcha',
'title' => 'Google Captcha',

'credentials' => [
'secret-key' => 'Geheimer Schlüssel',
Expand Down
10 changes: 5 additions & 5 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'Payment Method',
'status' => 'Status',
'title' => 'Transaction Details',
'transaction-data' => 'Transaction Data',
'transaction-id' => 'Transaction ID ',
],
],
Expand Down Expand Up @@ -2904,10 +2903,11 @@
'title' => 'Edit Tax Categories',
],

'create-success' => 'New Tax Category Created',
'can-not-delete' => 'Tax Rates Assigned Categories cannot be deleted.',
'create-success' => 'New Tax Category Created.',
'delete-failed' => 'Tax Category Deleted Failed',
'delete-success' => 'Tax Category Deleted Successfully',
'update-success' => 'Tax Category Successfully Updated',
'delete-success' => 'Tax Category Deleted Successfully.',
'update-success' => 'Tax Category Successfully Updated.',
],
],

Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'Set site key, secret key and status.',
'title' => 'Captcha',
'title' => 'Google Captcha',

'credentials' => [
'secret-key' => 'Secret Key',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'Método de Pago',
'status' => 'Estado',
'title' => 'Detalles de la Transacción',
'transaction-data' => 'Datos de la Transacción',
'transaction-id' => 'ID de Transacción',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'Editar Categorías de Impuestos',
],

'can-not-delete' => 'No se pueden eliminar las categorías asignadas a las tasas de impuestos.',
'create-success' => 'Nueva Categoría de Impuestos Creada',
'delete-failed' => 'Error al Eliminar Categoría de Impuestos',
'delete-success' => 'Categoría de Impuestos Eliminada Exitosamente',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'Establecer clave del sitio, clave secreta y estado.',
'title' => 'Captcha',
'title' => 'Google Captcha',

'credentials' => [
'secret-key' => 'Clave Secreta',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'روش پرداخت',
'status' => 'وضعیت',
'title' => 'جزئیات تراکنش',
'transaction-data' => 'اطلاعات تراکنش',
'transaction-id' => 'شناسه تراکنش',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'ویرایش دسته‌بندی مالیاتی',
],

'can-not-delete' => 'نرخ‌های مالیاتی اختصاص داده شده به دسته‌بندی‌ها قابل حذف نیستند.',
'create-success' => 'دسته‌بندی مالیاتی جدید ایجاد شد.',
'delete-failed' => 'حذف دسته‌بندی مالیاتی با شکست مواجه شد.',
'delete-success' => 'دسته‌بندی مالیاتی با موفقیت حذف شد.',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'تنظیم کلید سایت، کلید مخفی و وضعیت.',
'title' => 'کپچا',
'title' => 'Google کپچا',

'credentials' => [
'secret-key' => 'کلید مخفی',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/fr/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'Méthode de Paiement',
'status' => 'Statut',
'title' => 'Détails de la Transaction',
'transaction-data' => 'Données de la Transaction',
'transaction-id' => 'Identifiant de la Transaction',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'Modifier les catégories de taxe',
],

'can-not-delete' => 'Les catégories assignées aux taux de taxe ne peuvent pas être supprimées.',
'create-success' => 'Nouvelle catégorie de taxe créée',
'delete-failed' => 'Échec de la suppression de la catégorie de taxe',
'delete-success' => 'Catégorie de taxe supprimée avec succès',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'Définir la clé du site, la clé secrète et le statut.',
'title' => 'Captcha',
'title' => 'Google Captcha',

'credentials' => [
'secret-key' => 'Clé secrète',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/he/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'אמצעי תשלום',
'status' => 'סטטוס',
'title' => 'פרטי התשלום',
'transaction-data' => 'נתוני התשלום',
'transaction-id' => 'מזהה עסקה',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'ערוך קטגוריות מס',
],

'can-not-delete' => 'לא ניתן למחוק קטגוריות שהוקצו לשערי מס.',
'create-success' => 'קטגוריית מס חדשה נוצרה בהצלחה',
'delete-failed' => 'מחיקת קטגוריית מס נכשלה',
'delete-success' => 'קטגוריית מס נמחקה בהצלחה',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'הגדרת מפתח אתר, מפתח סודי ומצב.',
'title' => 'קפצ',
'title' => 'Google קפצ',

'credentials' => [
'secret-key' => 'מפתח סודי',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/hi_IN/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'भुगतान का तरीका',
'status' => 'स्थिति',
'title' => 'लेन-देन का विवरण',
'transaction-data' => 'लेन-देन डेटा',
'transaction-id' => 'लेन-देन आईडी',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'कर श्रेणियाँ संपादित करें',
],

'can-not-delete' => 'कर दर असाइन की गई श्रेणियाँ हटाई नहीं जा सकतीं।',
'create-success' => 'नई कर श्रेणी बनाई गई',
'delete-failed' => 'कर श्रेणी हटाने में विफल हुआ',
'delete-success' => 'कर श्रेणी सफलतापूर्वक हटाई गई',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'साइट कुंजी, गुप्त कुंजी और स्थिति सेट करें।',
'title' => 'कैप्चा',
'title' => 'Google कैप्चा',

'credentials' => [
'secret-key' => 'गुप्त कुंजी',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/it/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => 'Metodo di Pagamento',
'status' => 'Stato',
'title' => 'Dettagli Transazione',
'transaction-data' => 'Dati Transazione',
'transaction-id' => 'ID Transazione ',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => 'Modifica Categorie Fiscali',
],

'can-not-delete' => 'Le categorie assegnate alle aliquote fiscali non possono essere eliminate.',
'create-success' => 'Nuova Categoria Fiscale Creata',
'delete-failed' => 'Eliminazione Categoria Fiscale Fallita',
'delete-success' => 'Categoria Fiscale Eliminata con Successo',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'Imposta chiave del sito, chiave segreta e stato.',
'title' => 'Captcha',
'title' => 'Google Captcha',

'credentials' => [
'secret-key' => 'Chiave segreta',
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/ja/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@
'payment-method' => '支払い方法',
'status' => 'ステータス',
'title' => '取引の詳細',
'transaction-data' => '取引データ',
'transaction-id' => '取引ID',
],
],
Expand Down Expand Up @@ -2904,6 +2903,7 @@
'title' => '税カテゴリーを編集',
],

'can-not-delete' => '税率が割り当てられているカテゴリは削除できません。',
'create-success' => '新しい税カテゴリーが作成されました',
'delete-failed' => '税カテゴリーの削除に失敗しました',
'delete-success' => '税カテゴリーが正常に削除されました',
Expand Down Expand Up @@ -3864,7 +3864,7 @@

'captcha' => [
'info' => 'サイトキー、シークレットキー、ステータスを設定します。',
'title' => 'キャプチャ',
'title' => 'Google キャプチャ',

'credentials' => [
'secret-key' => 'シークレットキー',
Expand Down
Loading

0 comments on commit 06d9648

Please sign in to comment.