Skip to content

Commit

Permalink
Merge pull request bagisto#7965 from amit-webkul/account
Browse files Browse the repository at this point in the history
Refactor customer view page
  • Loading branch information
devansh-webkul authored Aug 16, 2023
2 parents 6e0172d + 1110be6 commit 0bbfd2e
Show file tree
Hide file tree
Showing 6 changed files with 785 additions and 790 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function makeDefault($id)
if ($default = $this->customerAddressRepository->findOneWhere(['customer_id' => $id, 'default_address' => 1])) {
$default->update(['default_address' => 0]);
}

$address = $this->customerAddressRepository->findOneWhere([
'id' => request('set_as_default'),
'customer_id' => $id
Expand All @@ -181,10 +181,10 @@ public function makeDefault($id)
$address->update(['default_address' => 1]);

session()->flash('success', trans('admin::app.customers.view.set-default-success'));
}
}

return redirect()->back();
}
}

/**
* Remove the specified resource from storage.
Expand Down
117 changes: 58 additions & 59 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
],

'sales'=> [
'sales' => [
'orders' => [
'index' => [
'title' => 'Orders',
Expand Down Expand Up @@ -178,7 +178,7 @@
'product-image' => 'Product Image',
'sku' => 'SKU',
'qty' => 'Quantity',
'amount-per-unit' =>':amount Per Unit x :qty Quantity',
'amount-per-unit' => ':amount Per Unit x :qty Quantity',
'price' => 'Price',
'tax' => 'Tax Amount',
'discount' => 'Discount Amount',
Expand All @@ -199,91 +199,92 @@

'customers' => [
'index' => [
'title' => 'Customers',
'login-message' => 'you logged in as :customer_name',
'title' => 'Customers',

'create' => [
'title' => 'Create New Customer',
'create-btn' => 'Create Customer',
'save-btn' => 'Save customer',
'first-name' => 'First Name',
'last-name' => 'Last Name',
'email' => 'Email',
'contact-number' => 'Contact Number',
'customer-group' => 'Customer Group',
'create-success' => 'Customer created successfully',
'date-of-birth' => 'Date of Birth',
'email' => 'Email',
'female' => 'female',
'first-name' => 'First Name',
'gender' => 'Gender',
'select-gender' => 'Select Gender',
'other' => 'Other',
'last-name' => 'Last Name',
'male' => 'male',
'female' => 'female',
'date-of-birth' => 'Date of Birth',
'customer-group' => 'Customer Group',
'other' => 'Other',
'save-btn' => 'Save customer',
'select-gender' => 'Select Gender',
'select-customer-group' => 'Select Customer Group',
'create-success' => 'Customer created successfully',
'title' => 'Create New Customer',
],
],

'edit' => [
'title' => 'Edit Customer',
'contact-number' => 'Contact Number',
'customer-group' => 'Customer Group',
'date-of-birth' => 'Date of Birth',
'email' => 'Email',
'edit-btn' => 'Edit',
'save-btn' => 'Save customer',
'female' => 'female',
'first-name' => 'First Name',
'last-name' => 'Last Name',
'email' => 'Email',
'contact-number' => 'Contact Number',
'gender' => 'Gender',
'select-gender' => 'Select Gender',
'other' => 'Other',
'last-name' => 'Last Name',
'male' => 'male',
'female' => 'female',
'date-of-birth' => 'Date of Birth',
'customer-group' => 'Customer Group',
'other' => 'Other',
'select-customer-group' => 'Select Customer Group',
'select-gender' => 'Select Gender',
'status' => 'Status',
'save-btn' => 'Save customer',
'suspended' => 'Suspended',
'title' => 'Edit Customer',

],

'view' => [
'title' => 'Customer View',
'customer' => 'Customer',
'active' => 'Active',
'inactive' => 'Inactive',
'suspended' => 'Suspended',
'orders' => 'Orders',
'total-revenue' => 'Total Revenue',
'pay-by' => 'Pay By',
'reviews' => 'Reviews',
'id' => 'ID',

'view' => [
'address' => 'Address',
'add-note' => 'Add Note',
'notify-customer' => 'Notify Customer',
'submit-btn-title' => 'Submit Note',
'active' => 'Active',
'address-delete-success' => 'Address Deleted Successfully',
'customer' => 'Customer',
'customer-notified' => 'Customer Notified',
'customer-not-notified' => 'Customer Not Notified',
'delete-account' => 'Delete Account',
'delete' => 'Delete',
'date-of-birth' => 'DOB',
'default-address' => 'Default Address',
'empty-description' => 'Create New Addresses for Customer',
'empty-title' => 'Add Customer Address',
'empty-order' => 'No Orders Available',
'empty-invoice' => 'No Invoices Available',
'empty-review' => 'No Reviews Available',
'edit' => 'Edit',
'email' => 'Email',
'phone' => 'Phone',
'gender' => 'Gender',
'date-of-birth' => 'DOB',
'group' => 'Group',
'default-address' => 'Default Address',
'mobile' => 'Mobile',
'delete' => 'Delete',
'set-as-default' => 'Set as Default',
'address' => 'Address',
'inactive' => 'Inactive',
'id' => 'ID',
'invoice-id' => 'Invoice ID',
'invoice-date' => 'Invoice Date',
'invoice-amount' => 'Invoice Amount',
'order-id' => 'Order ID',
'empty-title' => 'Add Customer Address',
'empty-description' => 'Create New Addresses for Customer',
'invoice' => 'Invoices',
'mobile' => 'Mobile',
'notify-customer' => 'Notify Customer',
'note' => 'Note',
'empty-order' => 'No Orders Available',
'empty-invoice' => 'No Invoices Available',
'empty-review' => 'No Reviews Available',
'set-default-success' => 'Default Address Updated Successfully',
'address-delete-success' => 'Address Deleted Successfully',
'note-created-success' => 'Note Created Successfully',
'orders' => 'Orders',
'order-id' => 'Order ID',
'phone' => 'Phone',
'pay-by' => 'Pay By',
'reviews' => 'Reviews',
'suspended' => 'Suspended',
'set-default-success' => 'Default Address Updated Successfully',
'submit-btn-title' => 'Submit Note',
'set-as-default' => 'Set as Default',
'total-revenue' => 'Total Revenue',
'title' => 'Customer View',
],

'groups' => [
Expand Down Expand Up @@ -316,9 +317,7 @@
'title' => 'Reviews',
],

'edit' => [

],
'edit' => [],
],

'addresses' => [
Expand All @@ -339,7 +338,7 @@
'phone' => 'Phone',
'street-address' => 'Street Address',
'post-code' => 'Post Code',
'default-address' => 'Default Address',
'default-address' => 'Default Address',
'save-btn-title' => 'Save Address',
],

Expand All @@ -359,7 +358,7 @@
'phone' => 'Phone',
'street-address' => 'Street Address',
'post-code' => 'Post Code',
'default-address' => 'Default Address',
'default-address' => 'Default Address',
'save-btn-title' => 'Save Address',
],
],
Expand Down Expand Up @@ -2009,7 +2008,7 @@
'update-success' => 'Selected :resource were successfully updated',
'no-resource' => 'The resource provided for insufficient for the action',
],

'admin-name' => 'Name',
'attribute-family' => 'Attribute Family',
'base-total' => 'Base Total',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class="block w-full px-[8px] py-[6px] rounded-[6px] border border-gray-300 bg-wh
/>
</div>

<div class="flex gap-2 mb-2">
<div class="flex gap-2">
<p
class="flex px-[8px] py-[3px] items-center rounded-[3px] bg-gray-600 font-semibold text-white"
v-for="appliedColumnValue in getAppliedColumnValues(column.index)"
Expand All @@ -224,8 +224,6 @@ class="icon-cross ml-[5px] cursor-pointer text-[18px] text-white"
</span>
</p>
</div>

<hr class="mb-2">
</div>
</div>
</x-slot:content>
Expand Down
Loading

0 comments on commit 0bbfd2e

Please sign in to comment.