Skip to content

Commit

Permalink
Merge pull request bagisto#8047 from amit-webkul/datagrid
Browse files Browse the repository at this point in the history
🔒 Refactor Customer view page and fixed edit address state issue
  • Loading branch information
jitendra-webkul authored Aug 28, 2023
2 parents e1e4af9 + bea915e commit fe03699
Show file tree
Hide file tree
Showing 7 changed files with 623 additions and 665 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
{{-- Customer Address Modal --}}
@pushOnce('scripts')
<!-- Customer Address Form -->
<script type="text/x-template" id="v-create-customer-address-template">
<script
type="text/x-template"
id="v-create-customer-address-template"
>
<!-- Address Create Button -->
@if (bouncer()->hasPermission('customers.addresses.create'))
<div
Expand All @@ -29,7 +32,6 @@ class="inline-flex gap-x-[8px] items-center justify-between w-full max-w-max px-
<form @submit="handleSubmit($event, create)">
<!-- Address Create Modal -->
<x-admin::modal ref="CustomerAddress">

<x-slot:header>
<!-- Modal Header -->
<p class="text-[18px] text-gray-800 font-bold">
Expand Down

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
@lang('admin::app.customers.edit.title')
</p>
</x-slot:header>

<x-slot:content>
<!-- Modal Content -->
{!! view_render_event('bagisto.admin.customers.edit.before') !!}
Expand All @@ -39,7 +39,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
<x-admin::form.control-group.label class="required">
@lang('admin::app.customers.edit.first-name')
</x-admin::form.control-group.label>

<x-admin::form.control-group.control
type="text"
name="first_name"
Expand All @@ -50,19 +50,19 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
:placeholder="trans('admin::app.customers.edit.first-name')"
>
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="first_name"
>
</x-admin::form.control-group.error>
</x-admin::form.control-group>

<!--Last Name -->
<!--Last Name -->
<x-admin::form.control-group class="w-full mb-[10px]">
<x-admin::form.control-group.label class="required">
@lang('admin::app.customers.edit.last-name')
</x-admin::form.control-group.label>

<x-admin::form.control-group.control
type="text"
name="last_name"
Expand All @@ -73,7 +73,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
:placeholder="trans('admin::app.customers.edit.last-name')"
>
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="last_name"
>
Expand All @@ -86,7 +86,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
<x-admin::form.control-group.label class="required">
@lang('admin::app.customers.edit.email')
</x-admin::form.control-group.label>

<x-admin::form.control-group.control
type="email"
name="email"
Expand All @@ -97,7 +97,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
placeholder="[email protected]"
>
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="email"
>
Expand All @@ -110,7 +110,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
<x-admin::form.control-group.label class="required">
@lang('admin::app.customers.edit.contact-number')
</x-admin::form.control-group.label>

<x-admin::form.control-group.control
type="text"
name="phone"
Expand All @@ -121,19 +121,19 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
:placeholder="trans('admin::app.customers.edit.contact-number')"
>
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="phone"
>
</x-admin::form.control-group.error>
</x-admin::form.control-group>

<!-- Date -->
<x-admin::form.control-group class="w-full mb-[10px]">
<x-admin::form.control-group.label>
@lang('admin::app.customers.edit.date-of-birth')
</x-admin::form.control-group.label>

<x-admin::form.control-group.control
type="date"
name="date_of_birth"
Expand All @@ -143,21 +143,21 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
:placeholder="trans('admin::app.customers.edit.date-of-birth')"
>
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="date_of_birth"
>
</x-admin::form.control-group.error>
</x-admin::form.control-group>
</div>

<div class="flex gap-[16px] max-sm:flex-wrap">
<!-- Gender -->
<x-admin::form.control-group class="w-full">
<x-admin::form.control-group.label class="required">
@lang('admin::app.customers.edit.gender')
</x-admin::form.control-group.label>

<x-admin::form.control-group.control
type="select"
name="gender"
Expand All @@ -169,7 +169,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
<option value="Male">
@lang('admin::app.customers.edit.male')
</option>

<option value="Female">
@lang('admin::app.customers.edit.female')
</option>
Expand All @@ -178,19 +178,19 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
@lang('admin::app.customers.edit.other')
</option>
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="gender"
>
</x-admin::form.control-group.error>
</x-admin::form.control-group>

<!-- Customer Group -->
<x-admin::form.control-group class="w-full">
<x-admin::form.control-group.label>
@lang('admin::app.customers.edit.customer-group')
</x-admin::form.control-group.label>

@php
$selectedCustomerOption = !is_null($customer->customer_group_id) ? $customer->group->id : '';
@endphp
Expand All @@ -208,7 +208,7 @@ class="flex gap-[6px] items-center justify-between px-[10px] text-blue-600 curso
</option>
@endforeach
</x-admin::form.control-group.control>

<x-admin::form.control-group.error
control-name="customer_group_id"
>
Expand Down Expand Up @@ -272,7 +272,7 @@ class="text-gray-600 font-semibold cursor-pointer"

</div>
</x-slot:content>

<x-slot:footer>
<!-- Modal Submission -->
<div class="flex gap-x-[10px] items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ class="text-[16px] text-gray-800 font-semibold"
<p class="text-gray-600">
@{{ "@lang('admin::app.customers.index.datagrid.order')".replace(':order', record.order_count) }}
</p>

<p class="text-gray-600">
@{{ "@lang('admin::app.customers.index.datagrid.address')".replace(':address', record.address_count) }}
</p>
Expand Down
Loading

0 comments on commit fe03699

Please sign in to comment.