resolve conflicts
This commit is contained in:
commit
13ebcdd649
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/admin.js": "/js/admin.js?id=94da304c8b02ad3ba649",
|
||||
"/css/admin.css": "/css/admin.css?id=ba5c24da94551b1d8c1d"
|
||||
"/css/admin.css": "/css/admin.css?id=2f20fcdbc6633b4218d7"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -820,7 +820,6 @@ body {
|
|||
}
|
||||
|
||||
.content-container {
|
||||
padding-left: 0px;
|
||||
position: absolute;
|
||||
margin-top: 60px;
|
||||
top: 0px;
|
||||
|
|
|
|||
|
|
@ -11,25 +11,28 @@ $toggleColor: #3c41ff;
|
|||
max-height: $toggleSize + $toggleMargin;
|
||||
overflow: visible;
|
||||
outline: none;
|
||||
|
||||
|
||||
&.is-active {
|
||||
.nav-toggle {
|
||||
&:before, &:after {
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-items,.nav-top {
|
||||
|
||||
.nav-items,
|
||||
.nav-top {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
|
||||
.overlay{
|
||||
.overlay {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.overlay{
|
||||
background-color: rgba(0,0,0,0.8);
|
||||
.overlay {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
|
@ -38,9 +41,9 @@ $toggleColor: #3c41ff;
|
|||
display: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
|
||||
.nav-toggle {
|
||||
background-image: url(./../images/hamburger.svg);
|
||||
background-image: url(./../images/hamburger.svg);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
position: relative;
|
||||
|
|
@ -49,7 +52,7 @@ $toggleColor: #3c41ff;
|
|||
height: $toggleSize;
|
||||
margin: $toggleMargin;
|
||||
z-index: 1;
|
||||
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
@ -86,7 +89,7 @@ $toggleColor: #3c41ff;
|
|||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.nav-top {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
|
@ -103,41 +106,41 @@ $toggleColor: #3c41ff;
|
|||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
align-content: start;
|
||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
.pro-info{
|
||||
.pro-info {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
position: absolute;
|
||||
|
||||
.profile-info-icon{
|
||||
position:absolute;
|
||||
display:inline-block;
|
||||
.profile-info-icon {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
background: #3c41ff;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
|
||||
> span{
|
||||
display:block;
|
||||
margin:6px;
|
||||
>span {
|
||||
display: block;
|
||||
margin: 6px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-info-desc{
|
||||
display:inline-block;
|
||||
.profile-info-desc {
|
||||
display: inline-block;
|
||||
margin-left: 40px;
|
||||
|
||||
.name{
|
||||
.name {
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.role{
|
||||
.role {
|
||||
font-size: 10px;
|
||||
color: #000;
|
||||
}
|
||||
|
|
@ -145,8 +148,8 @@ $toggleColor: #3c41ff;
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.nav-items{
|
||||
|
||||
.nav-items {
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
left: 0;
|
||||
|
|
@ -163,7 +166,7 @@ $toggleColor: #3c41ff;
|
|||
grid-template-columns: 1fr;
|
||||
align-content: start;
|
||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
||||
overflow-y: scroll ;
|
||||
overflow-y: scroll;
|
||||
text-decoration: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
|
|
@ -175,130 +178,142 @@ $toggleColor: #3c41ff;
|
|||
font-size: 16px;
|
||||
text-transform: capitalize;
|
||||
text-decoration: none;
|
||||
|
||||
a{
|
||||
color:#000;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
|
||||
.arrow-icon{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
a {
|
||||
color: #000;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
|
||||
.arrow-icon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
ul{
|
||||
display: none;
|
||||
|
||||
.navbar-child{
|
||||
text-transform: capitalize;
|
||||
padding: 15px;
|
||||
&.active,&:hover {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
}
|
||||
}
|
||||
ul {
|
||||
display: none;
|
||||
|
||||
.display-block{
|
||||
display: block !important;
|
||||
}
|
||||
.navbar-child {
|
||||
text-transform: capitalize;
|
||||
padding: 15px;
|
||||
|
||||
&.active {
|
||||
background-color: #e6e6e6;
|
||||
> a{
|
||||
background-color: #ddd;
|
||||
&.active,
|
||||
&:hover {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> a{
|
||||
background-color: #ddd;
|
||||
}
|
||||
}
|
||||
.display-block {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #e6e6e6;
|
||||
|
||||
>a {
|
||||
background-color: #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
>a {
|
||||
background-color: #ddd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rtl{
|
||||
.nav-container{
|
||||
.rtl {
|
||||
.nav-container {
|
||||
|
||||
.close{
|
||||
left:13px;
|
||||
.close {
|
||||
left: 13px;
|
||||
right: auto !important;
|
||||
}
|
||||
|
||||
|
||||
&.is-active {
|
||||
.nav-toggle {
|
||||
&:before, &:after {
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-items,.nav-top {
|
||||
|
||||
.nav-items,
|
||||
.nav-top {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
|
||||
.overlay{
|
||||
|
||||
.overlay {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-top{
|
||||
.nav-top {
|
||||
right: 0;
|
||||
left: 100%;
|
||||
transform: translate(calc(100% + 50px), 0);
|
||||
|
||||
.pro-info{
|
||||
.profile-info-desc{
|
||||
.pro-info {
|
||||
.profile-info-desc {
|
||||
margin-left: 0px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.nav-items{
|
||||
|
||||
.nav-items {
|
||||
right: 0;
|
||||
left: 100%;
|
||||
transform: translate(calc(100% + 50px), 0);
|
||||
|
||||
a{
|
||||
.arrow-icon{
|
||||
position: absolute;
|
||||
right: auto;
|
||||
left: 20px;
|
||||
}
|
||||
a {
|
||||
.arrow-icon {
|
||||
position: absolute;
|
||||
right: auto;
|
||||
left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px){
|
||||
.nav-container {
|
||||
display: inline-block;
|
||||
}
|
||||
@media only screen and (max-width: 768px) {
|
||||
.nav-container {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.destop-logo {
|
||||
display: none;
|
||||
}
|
||||
.destop-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-container{
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
.content-container {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-left: 0 !important;
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-expand {
|
||||
padding-left: 0 !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.rtl {
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
.content-container {
|
||||
padding-left: 0px !important;
|
||||
padding-right: 0px !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
.padding-container-navbar-not-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.padding-container-navbar-expand {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
.content-container {
|
||||
padding-left: 0px;
|
||||
padding-right: 56px;
|
||||
|
||||
.content .page-header {
|
||||
.page-title {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.customers.addresses.title', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = '{{ route('admin.customer.edit', ['id' => $customer->id]) }}'"></i>
|
||||
|
||||
{{ __('admin::app.customers.addresses.title', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.customer.addresses.create', ['id' => $customer->id]) }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.customers.addresses.create-btn-title') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.addresses.list.before') !!}
|
||||
|
||||
<div class="page-content">
|
||||
<datagrid-plus src="{{ route('admin.customer.addresses.index', $customer->id) }}"></datagrid-plus>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.addresses.list.after') !!}
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
{!! view_render_event('bagisto.admin.layout.nav-left.after') !!}
|
||||
|
||||
<div :class="isMenuOpen ? 'content-container padding-container-navbar-expand' : 'content-container padding-container-navbar-not-expand'">
|
||||
<div class="content-container" :class="isMenuOpen ? 'padding-container-navbar-expand' : 'padding-container-navbar-not-expand'">
|
||||
|
||||
{!! view_render_event('bagisto.admin.layout.content.before') !!}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Actions;
|
||||
|
||||
trait CleanAction
|
||||
{
|
||||
/**
|
||||
* Clean all fields.
|
||||
*
|
||||
* @param array $fields
|
||||
* @return array
|
||||
*/
|
||||
public function cleanAllFields(array $fields)
|
||||
{
|
||||
return collect($fields)->map(function ($field, $key) {
|
||||
return $this->cleanField($field);
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean field.
|
||||
*
|
||||
* @param string $field
|
||||
* @return string
|
||||
*/
|
||||
public function cleanField($field)
|
||||
{
|
||||
return preg_replace('/[^A-Za-z0-9 ]/', '', $field);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Actions\CartAction;
|
||||
use Actions\CleanAction;
|
||||
use Actions\ProductAction;
|
||||
use Actions\ProductActionContract;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
|
@ -24,7 +25,7 @@ use Webkul\Customer\Models\Customer;
|
|||
*/
|
||||
class ApiTester extends \Codeception\Actor implements ProductActionContract
|
||||
{
|
||||
use _generated\ApiTesterActions, CartAction, ProductAction;
|
||||
use _generated\ApiTesterActions, CartAction, CleanAction, ProductAction;
|
||||
|
||||
/**
|
||||
* Sanctum authenticated customer.
|
||||
|
|
@ -115,28 +116,4 @@ class ApiTester extends \Codeception\Actor implements ProductActionContract
|
|||
|
||||
return $idAndToken[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean all fields.
|
||||
*
|
||||
* @param array $fields
|
||||
* @return array
|
||||
*/
|
||||
public function cleanAllFields(array $fields)
|
||||
{
|
||||
return collect($fields)->map(function ($field, $key) {
|
||||
return $this->cleanField($field);
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean field.
|
||||
*
|
||||
* @param string $field
|
||||
* @return string
|
||||
*/
|
||||
public function cleanField($field)
|
||||
{
|
||||
return preg_replace('/[^A-Za-z0-9 ]/', '', $field);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Actions\CleanAction;
|
||||
use Codeception\Actor;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
|
@ -25,7 +26,7 @@ use Webkul\User\Models\Admin;
|
|||
*/
|
||||
class FunctionalTester extends Actor
|
||||
{
|
||||
use _generated\FunctionalTesterActions;
|
||||
use _generated\FunctionalTesterActions, CleanAction;
|
||||
|
||||
/**
|
||||
* Set the logged in user to the admin identity.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Functional\Admin\Customer;
|
||||
|
||||
use FunctionalTester;
|
||||
use Webkul\Customer\Models\Customer;
|
||||
|
||||
class AddressCest
|
||||
{
|
||||
/**
|
||||
* Test address index page.
|
||||
*
|
||||
* @param FunctionalTester $I
|
||||
* @return void
|
||||
*/
|
||||
public function testIndex(FunctionalTester $I): void
|
||||
{
|
||||
$customer = $I->have(Customer::class);
|
||||
|
||||
$I->loginAsAdmin();
|
||||
|
||||
$I->amOnAdminRoute('admin.customer.edit', [$customer->id]);
|
||||
$I->seeCurrentRouteIs('admin.customer.edit');
|
||||
|
||||
$I->sendAjaxGetRequest(route('admin.customer.addresses.index', $customer->id));
|
||||
$I->seeResponseCodeIsSuccessful();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create address page.
|
||||
*
|
||||
* @param FunctionalTester $I
|
||||
* @return void
|
||||
*/
|
||||
public function testCreate(FunctionalTester $I): void
|
||||
{
|
||||
$customer = $I->have(Customer::class);
|
||||
|
||||
$I->loginAsAdmin();
|
||||
|
||||
$I->amOnAdminRoute('admin.customer.edit', [$customer->id]);
|
||||
|
||||
$I->click(__('admin::app.customers.addresses.create-btn-title'), '//*[contains(@class, "page-content")]');
|
||||
$I->seeCurrentRouteIs('admin.customer.addresses.create');
|
||||
|
||||
$I->click(__('admin::app.customers.addresses.save-btn-title'), '//*[contains(@class, "page-action")]');
|
||||
$I->seeFormHasErrors();
|
||||
|
||||
// To Do (@devansh-webkul): Simulate this...
|
||||
// $addressData = $this->generateAddressData($I);
|
||||
// $this->fillForm($I, $addressData);
|
||||
|
||||
// $I->click(__('admin::app.customers.addresses.save-btn-title'), '//*[contains(@class, "page-action")]');
|
||||
// $I->dontSeeFormErrors();
|
||||
|
||||
// $I->seeCurrentRouteIs('admin.customer.addresses.index');
|
||||
// $I->seeRecord(Customer::class, $addressData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate address data.
|
||||
*
|
||||
* @param FunctionalTester $I
|
||||
* @return void
|
||||
*/
|
||||
private function generateAddressData(FunctionalTester $I)
|
||||
{
|
||||
return $I->cleanAllFields([
|
||||
'first_name' => $I->fake()->firstName,
|
||||
'last_name' => $I->fake()->lastName,
|
||||
'address1' => $I->fake()->streetAddress,
|
||||
'country' => $I->fake()->countryCode,
|
||||
'state' => $I->fake()->word,
|
||||
'city' => $I->fake()->city,
|
||||
'postcode' => $I->fake()->postcode,
|
||||
'phone' => $I->fake()->phoneNumber,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill form data.
|
||||
*
|
||||
* @param FunctionalTester $I
|
||||
* @param array $addressData
|
||||
* @return void
|
||||
*/
|
||||
private function fillForm(FunctionalTester $I, array $addressData)
|
||||
{
|
||||
$I->fillField('first_name', $addressData['first_name']);
|
||||
|
||||
$I->fillField('last_name', $addressData['last_name']);
|
||||
|
||||
$I->fillField('address1[]', $addressData['address1']);
|
||||
|
||||
$I->fillField('city', $addressData['city']);
|
||||
|
||||
$I->selectOption('country', $addressData['country']);
|
||||
|
||||
$I->selectOption('state', $addressData['state']);
|
||||
|
||||
$I->fillField('postcode', $addressData['postcode']);
|
||||
|
||||
$I->fillField('phone', $addressData['phone']);
|
||||
}
|
||||
}
|
||||
|
|
@ -56,8 +56,8 @@ class CustomerCest
|
|||
public function updateCustomerProfile(FunctionalTester $I): void
|
||||
{
|
||||
$customer = $I->loginAsCustomer();
|
||||
$customer->first_name = $this->cleanField($customer->first_name);
|
||||
$customer->last_name = $this->cleanField($customer->last_name);
|
||||
$customer->first_name = $I->cleanField($customer->first_name);
|
||||
$customer->last_name = $I->cleanField($customer->last_name);
|
||||
$customer->save();
|
||||
|
||||
$I->amOnPage('/');
|
||||
|
|
@ -92,7 +92,7 @@ class CustomerCest
|
|||
$I->click('Address');
|
||||
$I->click('Add Address');
|
||||
|
||||
$this->setFields();
|
||||
$this->setFields($I);
|
||||
|
||||
foreach ($this->fields as $key => $value) {
|
||||
/**
|
||||
|
|
@ -131,7 +131,7 @@ class CustomerCest
|
|||
$I->click('Edit');
|
||||
|
||||
$oldcompany = $this->fields['company_name'];
|
||||
$this->fields['company_name'] = $this->cleanField($this->faker->company);
|
||||
$this->fields['company_name'] = $I->cleanField($this->faker->company);
|
||||
|
||||
$I->submitForm($formCssSelector, $this->fields);
|
||||
|
||||
|
|
@ -169,11 +169,12 @@ class CustomerCest
|
|||
/**
|
||||
* Set fields.
|
||||
*
|
||||
* @param FunctionalTester $I
|
||||
* @return void
|
||||
*/
|
||||
private function setFields()
|
||||
private function setFields(FunctionalTester $I)
|
||||
{
|
||||
$this->fields = $this->cleanAllFields([
|
||||
$this->fields = $I->cleanAllFields([
|
||||
'company_name' => $this->faker->company,
|
||||
'first_name' => $this->faker->firstName,
|
||||
'last_name' => $this->faker->lastName,
|
||||
|
|
@ -186,28 +187,4 @@ class CustomerCest
|
|||
'phone' => $this->faker->phoneNumber,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean all fields.
|
||||
*
|
||||
* @param array $fields
|
||||
* @return array
|
||||
*/
|
||||
private function cleanAllFields(array $fields)
|
||||
{
|
||||
return collect($fields)->map(function ($field, $key) {
|
||||
return $this->cleanField($field);
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean fields.
|
||||
*
|
||||
* @param string $field
|
||||
* @return string
|
||||
*/
|
||||
private function cleanField($field)
|
||||
{
|
||||
return preg_replace('/[^A-Za-z0-9 ]/', '', $field);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue