Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into optionsTranslation
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-webkul committed Dec 20, 2024
2 parents a9f8026 + e61ba94 commit a6a44d8
Show file tree
Hide file tree
Showing 33 changed files with 162 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## **v2.0.3 (6th of December 2024)** - *Release*
## **v2.0.4 (19th of December 2024)** - *Release*

Added support for Brazilian Portuguese (PT_BR) Language.

Expand Down
5 changes: 2 additions & 3 deletions packages/Webkul/Admin/src/DataGrids/Settings/UserDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ public function prepareColumns(): void
'index' => 'created_at',
'label' => trans('admin::app.settings.users.index.datagrid.created-at'),
'type' => 'date',
'searchable' => true,
'filterable' => true,
'sortable' => true,
'searchable' => true,
'filterable_type' => 'date_range',
'closure' => fn ($row) => core()->formatDate($row->created_at),
'filterable' => true,
]);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Helpers/Reporting/Lead.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function getTotalWonLeadValue($startDate, $endDate): ?float
->resetModel()
->whereIn('lead_pipeline_stage_id', $this->wonStageIds)
->whereBetween('created_at', [$startDate, $endDate])
->avg('lead_value');
->sum('lead_value');
}

/**
Expand Down Expand Up @@ -239,7 +239,7 @@ public function getTotalLostLeadValue($startDate, $endDate): ?float
->resetModel()
->whereIn('lead_pipeline_stage_id', $this->lostStageIds)
->whereBetween('created_at', [$startDate, $endDate])
->avg('lead_value');
->sum('lead_value');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function destroy(int $id): JsonResponse

$role = $this->roleRepository->findOrFail($id);

if ($role->admins && $role->admins->count() >= 1) {
if ($role->users && $role->users->count() >= 1) {
$response['message'] = trans('admin::app.settings.roles.index.being-used');

session()->flash('error', $response['message']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ public function store()
return redirect()->route('admin.session.create');
}

if (! bouncer()->hasPermission('dashboard')) {
$availableNextMenu = menu()->getItems('admin')?->first();

if (is_null($availableNextMenu)) {
session()->flash('error', trans('admin::app.users.not-permission'));

auth()->guard('user')->logout();

return redirect()->route('admin.session.create');
}

return redirect()->to($availableNextMenu->getUrl());
}

return redirect()->intended(route('admin.dashboard.index'));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/Webkul/Admin/src/Notifications/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function build()
$message = $this
->to($this->data['to'])
->subject($this->data['subject'])
->view('admin::emails.common', [
->view('admin::emails.common.index', [
'body' => $this->data['body'],
]);

Expand Down
1 change: 1 addition & 0 deletions packages/Webkul/Admin/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'users' => [
'activate-warning' => 'حسابك لم يتم تفعيله بعد. يرجى الاتصال بالمسؤول.',
'login-error' => 'بيانات الاعتماد لا تتطابق مع سجلاتنا.',
'not-permission' => 'ليس لديك إذن للوصول إلى لوحة الإدارة.',

'login' => [
'email' => 'عنوان البريد الإلكتروني',
Expand Down
5 changes: 5 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'users' => [
'activate-warning' => 'Your account is not activated yet. Please contact the administrator.',
'login-error' => 'The credentials do not match our records.',
'not-permission' => 'You do not have permission to access the admin panel.',

'login' => [
'email' => 'Email Address',
Expand Down Expand Up @@ -359,6 +360,10 @@
],

'layouts' => [
'powered-by' => [
'description' => 'Powered by :krayin, an open-source project by :webkul.',
],

'header' => [
'mega-search' => [
'title' => 'Search',
Expand Down
5 changes: 5 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'users' => [
'activate-warning' => 'Tu cuenta aún no está activada. Por favor, contacta al administrador.',
'login-error' => 'Las credenciales no coinciden con nuestros registros.',
'not-permission' => 'No tienes permiso para acceder al panel de administración.',

'login' => [
'email' => 'Dirección de correo electrónico',
Expand Down Expand Up @@ -359,6 +360,10 @@
],

'layouts' => [
'powered-by' => [
'description' => 'Desarrollado por :krayin, un proyecto de código abierto de :webkul.',
],

'header' => [
'mega-search' => [
'title' => 'Buscar',
Expand Down
5 changes: 5 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'users' => [
'activate-warning' => 'حساب شما هنوز فعال نشده است. لطفاً با مدیر سیستم تماس بگیرید.',
'login-error' => 'اطلاعات وارد شده با سوابق ما مطابقت ندارد.',
'not-permission' => 'شما اجازه دسترسی به پنل مدیریت را ندارید.',

'login' => [
'email' => 'آدرس ایمیل',
Expand Down Expand Up @@ -359,6 +360,10 @@
],

'layouts' => [
'powered-by' => [
'description' => 'توسعه یافته توسط :krayin، یک پروژه متن باز از :webkul.',
],

'header' => [
'mega-search' => [
'title' => 'جستجو',
Expand Down
4 changes: 4 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@
],

'layouts' => [
'powered-by' => [
'description' => 'Desenvolvido por :krayin, um projeto de código aberto da :webkul.',
],

'header' => [
'mega-search' => [
'title' => 'Pesquisar',
Expand Down
5 changes: 5 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/tr/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'users' => [
'activate-warning' => 'Hesabınız henüz etkinleştirilmedi. Lütfen yönetici ile iletişime geçin.',
'login-error' => 'Kimlik bilgileri kayıtlarımızla eşleşmiyor.',
'not-permission' => 'Yönetici paneline erişim izniniz yok.',

'login' => [
'email' => 'E-posta Adresi',
Expand Down Expand Up @@ -359,6 +360,10 @@
],

'layouts' => [
'powered-by' => [
'description' => ':webkul tarafından geliştirilen açık kaynaklı bir proje olan :krayin tarafından desteklenmektedir.',
],

'header' => [
'mega-search' => [
'title' => 'Arama',
Expand Down
5 changes: 5 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/vi/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'users' => [
'activate-warning' => 'Tài khoản của bạn chưa được kích hoạt. Vui lòng liên hệ quản trị viên.',
'login-error' => 'Thông tin đăng nhập không khớp với hồ sơ của chúng tôi.',
'not-permission' => 'Bạn không có quyền truy cập vào bảng quản trị.',

'login' => [
'email' => 'Địa chỉ Email',
Expand Down Expand Up @@ -359,6 +360,10 @@
],

'layouts' => [
'powered-by' => [
'description' => 'Được hỗ trợ bởi :krayin, một dự án mã nguồn mở được phát triển bởi :webkul.',
],

'header' => [
'mega-search' => [
'title' => 'Tìm kiếm',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ class="flex h-[34px] items-center rounded border border-transparent transition-a
v-model="inputValue"
/>
<span class="cursor-pointer truncate rounded">
@{{ valueLabel ? valueLabel : selectedValue?.name }}
</span>
<div
class="group relative h-[18px] !w-full pl-2.5"
:style="{ 'text-align': position }"
>
<span class="cursor-pointer truncate rounded">
@{{ valueLabel ? valueLabel : options[inputValue].name }}
</span>
</div>
<template v-if="allowEdit">
<i
@click="toggle"
class="icon-edit cursor-pointer rounded text-2xl opacity-0 hover:bg-gray-200 group-hover:opacity-100 dark:hover:bg-gray-950"
class="icon-edit cursor-pointer rounded p-0.5 text-2xl opacity-0 hover:bg-gray-200 group-hover:opacity-100 dark:hover:bg-gray-950 ltr:mr-1 rtl:ml-1"
></i>
</template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,21 @@ class="group/container sidebar-collapsed flex gap-4"
<!-- Page Sidebar Blade Component -->
<x-admin::layouts.sidebar />

<div class="max-w-full flex-1 bg-gray-100 px-4 pb-6 pt-3 transition-all duration-300 dark:bg-gray-950 max-lg:!px-4 ltr:pl-[85px] rtl:pr-[85px]">
<div class="max-w-full flex flex-col min-h-[calc(100vh-62px)] flex-1 bg-gray-100 pt-3 transition-all duration-300 dark:bg-gray-950 max-lg:!px-4">
<!-- Page Content Blade Component -->
{{ $slot }}
<div class="pb-6 px-4 ltr:pl-[85px] rtl:pr-[85px] ">
{{ $slot }}
</div>

<!-- Powered By -->
<div class="mt-auto pt-6">
<div class="border-t bg-white py-5 text-center text-sm font-normal dark:border-gray-800 dark:bg-gray-900 dark:text-white">
@lang('admin::app.components.layouts.powered-by.description', [
'krayin' => '<a class="text-brandColor hover:underline dark:text-brandColor" href="https://krayincrm.com/">Krayin</a>',
'webkul' => '<a class="text-brandColor hover:underline dark:text-brandColor" href="https://webkul.com/">Webkul</a>',
])
</div>
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@component('admin::emails.layout')
{!! $body !!}
@endcomponent
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
@lang('admin::app.emails.common.user.create-body')
</p>
</div>
@endcomponent
@endcomponent
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
@lang('admin::app.emails.common.user.forget-password.thanks')
</p>
</div>
@endcomponent
@endcomponent
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ class="relative flex h-7 min-w-24 cursor-pointer items-center justify-center rou
'!bg-green-500 text-white dark:text-gray-900 after:bg-green-500': ['won', 'lost'].includes(currentStage.code) && currentStage.code == 'won',
'!bg-red-500 text-white dark:text-gray-900 after:bg-red-500': ['won', 'lost'].includes(currentStage.code) && currentStage.code == 'lost',
}"
@click="stageToggler = ! stageToggler"
>
<span class="z-20 whitespace-nowrap text-sm font-medium dark:text-white">
{{ __('admin::app.leads.view.stages.won-lost') }}
</span>

<span class="icon-down-arrow text-2xl dark:text-gray-900"></span>
<span
class="text-2xl dark:text-gray-900"
:class="{'icon-up-arrow': stageToggler, 'icon-down-arrow': ! stageToggler}"
></span>
</div>

{!! view_render_event('admin.leads.view.stages.items.dropdown.toggle.after', ['lead' => $lead]) !!}
Expand Down Expand Up @@ -190,6 +194,8 @@ class="primary-button"
nextStage: null,
stages: @json($lead->pipeline->stages),
stageToggler: '',
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,32 @@
</h4>

{!! view_render_event('admin.products.view.attributes.view.before', ['product' => $product]) !!}

<!-- Attributes Listing -->
<div>
<!-- Default Attributes -->
<x-admin::attributes.view
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'products',
['code', 'IN', ['SKU', 'price', 'quantity', 'status']]
])->sortBy('sort_order')"
:entity="$product"
:url="route('admin.products.update', $product->id)"
:allow-edit="true"
/>

<x-admin::attributes.view
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'products',
['code', 'IN', ['SKU', 'price', 'quantity', 'status']]
])->sortBy('sort_order')"
:entity="$product"
:url="route('admin.products.update', $product->id)"
:allow-edit="true"
/>

<!-- Custom Attributes -->
<x-admin::attributes.view
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'products',
['code', 'NOTIN', ['SKU', 'price', 'quantity', 'status']]
])->sortBy('sort_order')"
:entity="$product"
:url="route('admin.products.update', $product->id)"
:allow-edit="true"
/>
</div>

{!! view_render_event('admin.products.view.attributes.view.after', ['product' => $product]) !!}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@lang('admin::app.users.forget-password.create.page-title')
</x-slot>

<div class="flex h-[100vh] items-center justify-center">
<div class="flex h-[100vh] flex-col items-center justify-center gap-10">
<div class="flex flex-col items-center gap-5">
<!-- Logo -->
@if ($logo = core()->getConfigData('general.design.admin_logo.logo_image'))
Expand Down Expand Up @@ -74,5 +74,13 @@ class="primary-button">
{!! view_render_event('admin.sessions.forgor_password.form_controls.after') !!}
</div>
</div>

<!-- Powered By -->
<div class="text-sm font-normal">
@lang('admin::app.components.layouts.powered-by.description', [
'krayin' => '<a class="text-brandColor hover:underline " href="https://krayincrm.com/">Krayin</a>',
'webkul' => '<a class="text-brandColor hover:underline " href="https://webkul.com/">Webkul</a>',
])
</div>
</div>
</x-admin::layouts.anonymous>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@lang('admin::app.users.login.title')
</x-slot>

<div class="flex h-[100vh] items-center justify-center">
<div class="flex h-[100vh] flex-col items-center justify-center gap-10">
<div class="flex flex-col items-center gap-5">
<!-- Logo -->
@if ($logo = core()->getConfigData('general.design.admin_logo.logo_image'))
Expand Down Expand Up @@ -101,6 +101,14 @@ class="primary-button"
{!! view_render_event('admin.sessions.login.form_controls.after') !!}
</div>
</div>

<!-- Powered By -->
<div class="text-sm font-normal">
@lang('admin::app.components.layouts.powered-by.description', [
'krayin' => '<a class="text-brandColor hover:underline " href="https://krayincrm.com/">Krayin</a>',
'webkul' => '<a class="text-brandColor hover:underline " href="https://webkul.com/">Webkul</a>',
])
</div>
</div>

@push('scripts')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@lang('admin::app.users.reset-password.title')
</x-slot>

<div class="flex h-[100vh] items-center justify-center">
<div class="flex h-[100vh] flex-col items-center justify-center gap-10">
<div class="flex flex-col items-center gap-5">
<!-- Logo -->
@if ($logo = core()->getConfigData('general.design.admin_logo.logo_image'))
Expand Down Expand Up @@ -119,5 +119,13 @@ class="primary-button">
{!! view_render_event('admin.sessions.reset-password.form_controls.after') !!}
</div>
</div>

<!-- Powered By -->
<div class="text-sm font-normal">
@lang('admin::app.components.layouts.powered-by.description', [
'krayin' => '<a class="text-brandColor hover:underline " href="https://krayincrm.com/">Krayin</a>',
'webkul' => '<a class="text-brandColor hover:underline " href="https://webkul.com/">Webkul</a>',
])
</div>
</div>
</x-admin::layouts.anonymous>
Loading

0 comments on commit a6a44d8

Please sign in to comment.