Skip to content

Commit

Permalink
Merge pull request #124 from avored/developed
Browse files Browse the repository at this point in the history
3.1.0
  • Loading branch information
indpurvesh authored Aug 14, 2020
2 parents 31af659 + 74c9f37 commit e52ceef
Show file tree
Hide file tree
Showing 26 changed files with 448 additions and 458 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --https --key ~/.config/valet/Certificates/laravel-ecommerce.test.key --cert ~/.config/valet/Certificates/laravel-ecommerce.test.crt --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"avored-components": "^0.1.1",
"avored-components": "^0.1.5",
"axios": "^0.19.2",
"cross-env": "^7.0.2",
"laravel-mix": "^5.0.4",
Expand Down
2 changes: 1 addition & 1 deletion resources/components/catalog/category/Test.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>Hello Test</div>
<div>Hello Test Update</div>
</template>

<script>
Expand Down
209 changes: 109 additions & 100 deletions resources/components/order/order/OrderTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,103 +9,112 @@
:next_page_url="initOrders.next_page_url"
:items="initOrders.data"
>
<template slot="orderUser" slot-scope="{item}">{{ item.user.name }}</template>
<template slot="orderCustomer" slot-scope="{item}">{{ item.customer.first_name }} {{ item.customer.last_name }}</template>

<template slot="action" slot-scope="{item}">
<div class="flex items-center">
<a-dropdown>
<a class="ant-dropdown-link flex" href="#">
<span>Actions</span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-5 text-gray-500"><path class="heroicon-ui" d="M15.3 9.3a1 1 0 011.4 1.4l-4 4a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4l3.3 3.29 3.3-3.3z"/></svg>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a :href="orderShowAction(item)">Show</a>
</a-menu-item>
<avored-dropdown>
<a class="ant-dropdown-link flex" href="#">
<span>Actions</span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-5 text-gray-500"><path class="heroicon-ui" d="M15.3 9.3a1 1 0 011.4 1.4l-4 4a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4l3.3 3.29 3.3-3.3z"/></svg>
</a>

<a-menu-item>
<a @click.prevent="changeStatusMenuClick(item, $event)">Change Status</a>
</a-menu-item>
<a-menu-item>
<a @click.prevent="addTrackingCodeMenuClick(item, $event)">Add Tracking</a>
</a-menu-item>
<a-menu-item>
<a :href="downloadOrderAction(item)">Download Invoice</a>
</a-menu-item>
<a-menu-item>
<a :href="emailInvoiceOrderAction(item)">Email Invoice</a>
</a-menu-item>
<a-menu-item>
<a :href="shippingLabelOrderAction(item)">Shipping Label</a>
</a-menu-item>
</a-menu>
</a-dropdown>
<template slot="dropdown-content">
<div class="relative z-10 mt-2 py-3 w-32 bg-white border border-gray-200">

<a class="w-full px-3 mb-2 block" :href="orderShowAction(item)">Show</a>
<a href="#" class="w-full px-3 mb-2 block"
@click.prevent="changeStatusMenuClick(item, $event)">
Change Status
</a>
<a href="#" class="w-full px-3 mb-2 block"
@click.prevent="addTrackingCodeMenuClick(item, $event)">
Add Tracking
</a>

<a class="w-full px-3 mb-2 block"
:href="downloadOrderAction(item)">
Download Invoice
</a>

<a class="w-full px-3 mb-2 block" :href="emailInvoiceOrderAction(item)">
Email Invoice
</a>

<a class="w-full px-3 mb-2 block" :href="shippingLabelOrderAction(item)">
Shipping Label
</a>
</div>
</template>

</avored-dropdown>

</div>
</template>
</avored-table>

<avored-modal modal-title="Change Track Code" @close="track_code_modal_visibility=false" :is-visible="track_code_modal_visibility">
<div class="block">
<avored-input
label-text="Tracking Code"
field-name="track_code"
:init-value="track_code"
v-model="track_code"
>
</avored-input>
<div class="mt-3 py-3">
<button type="button" @click="handleTrackCodeOk"
class="px-3 py-2 text-white hover:text-white bg-red-600 rounded hover:bg-red-700"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-flex w-4" fill="currentColor" viewBox="0 0 20 20">
<path d="M0 2C0 .9.9 0 2 0h14l4 4v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5 0v6h10V2H5zm6 1h3v4h-3V3z"/>
</svg>
<span class="ml-3">Save</span>
</button>
<avored-modal modal-title="Change Track Code" @close="track_code_modal_visibility=false" :is-visible="track_code_modal_visibility">
<div class="block">
<avored-input
label-text="Tracking Code"
field-name="track_code"
:init-value="track_code"
v-model="track_code"
>
</avored-input>
<div class="mt-3 py-3">
<button type="button" @click="handleTrackCodeOk"
class="px-3 py-2 text-white hover:text-white bg-red-600 rounded hover:bg-red-700"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-flex w-4" fill="currentColor" viewBox="0 0 20 20">
<path d="M0 2C0 .9.9 0 2 0h14l4 4v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5 0v6h10V2H5zm6 1h3v4h-3V3z"/>
</svg>
<span class="ml-3">Save</span>
</button>


<button type="button" @click="handleTrackCodeCancel"
class="px-3 py-2 font-xs text-white hover:text-white bg-gray-500 hover:bg-gray-600 rounded"
>
<span class="">Cancel</span>
</button>

</div>

<button type="button" @click="handleTrackCodeCancel"
class="px-3 py-2 font-xs text-white hover:text-white bg-gray-500 hover:bg-gray-600 rounded"
>
<span class="">Cancel</span>
</button>

</div>
</avored-modal>

</div>
</avored-modal>

<avored-modal modal-title="Change Order Status" @close="change_status_modal_visibility=false" :is-visible="change_status_modal_visibility">
<div class="block">
<avored-select
label-text="Order Status"
field-name="order_status_id"
:init-value="currentRecord.order_status_id"
:options="orderStatuses"
v-model="changeStatusId"
>
</avored-select>
<div class="mt-3 py-3">
<button type="button" @click="handleChangeStatusOk"
class="px-3 py-2 text-white hover:text-white bg-red-600 rounded hover:bg-red-700"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-flex w-4" fill="currentColor" viewBox="0 0 20 20">
<path d="M0 2C0 .9.9 0 2 0h14l4 4v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5 0v6h10V2H5zm6 1h3v4h-3V3z"/>
</svg>
<span class="ml-3">Save</span>
</button>

<avored-modal modal-title="Change Order Status"
@close="change_status_modal_visibility=false"
:is-visible="change_status_modal_visibility">
<div class="w-full">
<avored-select
label-text="Order Status"
field-name="order_status_id"
:init-value="currentRecord.order_status_id"
:options="orderStatuses"
v-model="changeStatusId"
>
</avored-select>
<div class="mt-3 py-3">
<button type="button" @click="handleChangeStatusOk"
class="px-3 py-2 text-white hover:text-white bg-red-600 rounded hover:bg-red-700"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-flex w-4" fill="currentColor" viewBox="0 0 20 20">
<path d="M0 2C0 .9.9 0 2 0h14l4 4v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5 0v6h10V2H5zm6 1h3v4h-3V3z"/>
</svg>
<span class="ml-3">Save</span>
</button>


<button type="button" @click="handleChangeStatusCancel"
class="px-3 py-2 font-xs text-white hover:text-white bg-gray-500 hover:bg-gray-600 rounded"
>
<span class="">Cancel</span>
</button>

</div>

<button type="button" @click="handleChangeStatusCancel"
class="px-3 py-2 font-xs text-white hover:text-white bg-gray-500 hover:bg-gray-600 rounded"
>
<span class="">Cancel</span>
</button>
</div>
</avored-modal>
</div>
</avored-modal>

</div>
</template>
Expand All @@ -125,8 +134,8 @@ const columns = [
fieldKey: "payment_option"
},
{
label: "User",
slotName: "orderUser"
label: "Customer",
slotName: "orderCustomer"
},
{
label: "Actions",
Expand Down Expand Up @@ -176,31 +185,31 @@ export default {
});
},
changeStatusMenuClick(record, e) {
e.preventDefault();
this.currentRecord = record;
this.change_status = record.order_Status_id;
this.change_status_modal_visibility = true;
e.preventDefault();
this.currentRecord = record;
this.change_status = record.order_Status_id;
this.change_status_modal_visibility = true;
},
addTrackingCodeMenuClick(record, e) {
e.preventDefault();
this.currentRecord = record;
this.track_code = record.track_code;
this.track_code_modal_visibility = true;
e.preventDefault();
this.currentRecord = record;
this.track_code = record.track_code;
this.track_code_modal_visibility = true;
},
handleTrackCodeCancel() {
this.track_code_modal_visibility = false;
this.track_code_modal_visibility = false;
},
handleChangeStatusCancel() {
this.change_status_modal_visibility = false;
this.change_status_modal_visibility = false;
},
getShowUrl(record) {
return this.baseUrl + "/order/" + record.id;
return this.baseUrl + "/order/" + record.id;
},
changeStatusDropdown(val) {
this.changeStatusId = val;
this.changeStatusId = val;
},
downloadOrderAction(record) {
return this.baseUrl + "/order-download-invoice/" + record.id;
return this.baseUrl + "/order-download-invoice/" + record.id;
},
getOrderStatus(statusId) {
var index;
Expand All @@ -220,7 +229,7 @@ export default {
return this.baseUrl + "/order-shipping-label/" + record.id;
},
handleChangeStatusOk() {
let data = { order_status_id: this.changeStatusId };
let data = { order_status_id: this.changeStatusId[0] };
let url = this.baseUrl + "/order-change-status/" + this.currentRecord.id;
var app = this;
Expand Down
4 changes: 3 additions & 1 deletion resources/js/services/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
AvoRedTab,
AvoRedModal,
AvoRedAlert,
AvoRedConfirm
AvoRedConfirm,
AvoRedDropdown
} from 'avored-components'

Vue.component('avored-table', AvoRedTable)
Expand All @@ -21,6 +22,7 @@ Vue.component('avored-toggle', AvoRedToggle)
Vue.component('avored-tabs', AvoRedTabs)
Vue.component('avored-tab', AvoRedTab)
Vue.component('avored-modal', AvoRedModal)
Vue.component('avored-dropdown', AvoRedDropdown)

Vue.component('avored-menu', require('@/modules/system/components/layout/Menu').default)

Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@yield('page_title')
</h1>
<div class="rounded p-5 mx-3 my-3 bg-white">
{{-- <router-view></router-view> --}}
<router-view></router-view>
@yield('content')
</div>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/order/order/invoice.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<td style="padding: 5px;text-align:right">
{{ $order->billingAddress->company_name }}<br>
{{ $order->billingAddress->first_name }} {{ $order->billingAddress->last_name }}<br>
{{ $order->user->email }}
{{ $order->customer->email }}
</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/order/order/shipping-label.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<td style="padding: 5px;text-align:right">
{{ $order->billingAddress->company_name }}<br>
{{ $order->billingAddress->first_name }} {{ $order->billingAddress->last_name }}<br>
{{ $order->user->email }}
{{ $order->customer->email }}
</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/promotion/promotion-code/_fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
label-text="{{ __('avored::promotion.promotion-code.active_from') }}"
field-name="active_from"
input-type="date"
init-value="{{ $promotionCode->active_from->format('Y-m-d') ?? '' }}"
init-value="{{ (isset($promotionCode)) ? $promotionCode->active_from->format('Y-m-d') : '' }}"
error-text="{{ $errors->first('active_from') }}"
>
</avored-input>
Expand All @@ -78,7 +78,7 @@
label-text="{{ __('avored::promotion.promotion-code.active_till') }}"
field-name="active_till"
input-type="date"
init-value="{{ $promotionCode->active_till->format('Y-m-d') ?? '' }}"
init-value="{{ (isset($promotionCode)) ? $promotionCode->active_till->format('Y-m-d') : '' }}"
error-text="{{ $errors->first('active_till') }}"
>
</avored-input>
Expand Down
17 changes: 17 additions & 0 deletions resources/views/spa/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@extends('avored::layouts.app')

@section('meta_title')
AvoRed E commerce Admin Dashboard
@endsection

@section('page_title')
<div class="text-gray-800 flex items-center">
<div class="text-xl text-red-700 font-semibold">
{{ __('avored::system.terms.dashboard') }}
</div>
</div>
@endsection

@section('content')

@endsection
2 changes: 1 addition & 1 deletion resources/views/user/auth/reset.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</p>
</div>

@if (true || session('status'))
@if (session('status'))
<div class="rounded-l-lg bg-green-100 border-l-4 border-green-500 text-green-700 p-4">
<p class="text-sm font-semibold">{{ session('status') }}</p>
</div>
Expand Down
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
Route::resource('admin-user', User\Controllers\AdminUserController::class);
Route::resource('attribute', Catalog\Controllers\AttributeController::class);
Route::resource('category', Catalog\Controllers\CategoryController::class);
Route::get('category-test', [\AvoRed\Framework\System\Controllers\SpaController::class, 'index']);
Route::resource('currency', System\Controllers\CurrencyController::class);
Route::resource('language', System\Controllers\LanguageController::class);
Route::resource('order', Order\Controllers\OrderController::class)->only(['index']);
Expand Down
Loading

0 comments on commit e52ceef

Please sign in to comment.