Skip to content

Commit

Permalink
Merge pull request #108 from avored/dev
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
indpurvesh authored Mar 15, 2020
2 parents ab151e4 + 4375e73 commit 8e6f7af
Show file tree
Hide file tree
Showing 45 changed files with 2,080 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
- dev
- master
docker:
- image: circleci/php:7-fpm-browsers-legacy
- image: circleci/php:7.3.9-fpm
steps:
- checkout
- run:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"barryvdh/laravel-dompdf": "^0.8.4",
"laravel/helpers": "^1.1",
"spatie/laravel-view-models": "^1.2",
"laravel/framework" : "^5.8|^6.0|^6.1|^6.2"
"laravel/framework" : "^5.8|^6.0|^6.1|^6.2",
"rebing/graphql-laravel": "^2.0"
},
"require-dev" : {
"phpunit/phpunit": "^7.5",
Expand Down
57 changes: 57 additions & 0 deletions config/avored.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,58 @@
'user' => App\User::class,
],

'graphql' => [
'default_schema' => 'default',
'schemas' => [
'default' => [
'query' => [
'menu' => \AvoRed\Framework\Graphql\Queries\MenuQuery::class,
'allCategory' => \AvoRed\Framework\Graphql\Queries\AllCategoryQuery::class,
'category' => \AvoRed\Framework\Graphql\Queries\CategoryQuery::class,
'product' => \AvoRed\Framework\Graphql\Queries\ProductQuery::class,
'barcodeProduct' => \AvoRed\Framework\Graphql\Queries\BarcodeProductQuery::class,


'adminCategoryTable' => \AvoRed\Framework\Graphql\Queries\Admin\Catalog\Category\CategoryTableQuery::class,
],
'mutation' => [
'login' => \AvoRed\Framework\Graphql\Mutations\Auth\LoginMutation::class,
'addToCart' => \AvoRed\Framework\Graphql\Mutations\Cart\AddToCartMutation::class,


'adminLogin' => \AvoRed\Framework\Graphql\Mutations\Admin\User\LoginMutation::class,
'adminCategoryCreate' => \AvoRed\Framework\Graphql\Mutations\Admin\Catalog\Category\CategoryCreateMutation::class,
'adminCategoryUpdate' => \AvoRed\Framework\Graphql\Mutations\Admin\Catalog\Category\CategoryUpdateMutation::class,
'adminCategoryDelete' => \AvoRed\Framework\Graphql\Mutations\Admin\Catalog\Category\CategoryDeleteMutation::class,
],
'middleware' => [],
'method' => ['get', 'post'],
],
'secret' => [
'query' => [
'order' => \AvoRed\Framework\Graphql\Queries\OrderQuery::class,
],
'mutation' => [
// 'example_mutation' => ExampleMutation::class,
],
'middleware' => ['auth:api'],
'method' => ['get', 'post'],
],
],

'types' => [
'menu' => AvoRed\Framework\Graphql\Types\MenuType::class,
'category' => AvoRed\Framework\Graphql\Types\CategoryType::class,
'filter' => AvoRed\Framework\Graphql\Types\FilterType::class,
'product' => AvoRed\Framework\Graphql\Types\ProductType::class,
'token' => AvoRed\Framework\Graphql\Types\TokenType::class,
'cartProduct' => AvoRed\Framework\Graphql\Types\CartProductType::class,
'order' => AvoRed\Framework\Graphql\Types\OrderType::class,
'address' => AvoRed\Framework\Graphql\Types\AddressType::class,
'delete' => AvoRed\Framework\Graphql\Types\DeleteType::class,
],
],

'filesystems' => [
'disks' => [
'avored' => [
Expand All @@ -34,6 +86,11 @@
'driver' => 'session',
'provider' => 'admin-users',
],
'admin_api' => [
'driver' => 'passport',
'provider' => 'admin-users',
'hash' => false,
],
],

'providers' => [
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<file>routes/web.php</file>
</exclude>
</whitelist>
</filter>

Expand Down
18 changes: 18 additions & 0 deletions resources/components/system/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@

<script>
import gql from 'graphql-tag'
export default {
data() {
return {
collapsed: false,
}
},
mounted() {
// let data = this.$apollo.query({
// query: gql `query AllCategories {
// allCategory {
// id
// name
// slug
// meta_title
// meta_description
// }
// }`
// }).then(res => {
// console.log(res.data.allCategory);
// });
}
}
</script>
6 changes: 5 additions & 1 deletion resources/components/system/LoginFields.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>

</template>

<script>
export default {
props: { name:'loginpost', type: String },
props: [],
data () {
return {
loginForm: this.$form.createForm(this),
Expand Down
19 changes: 12 additions & 7 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ if (token) {
}

import AvoRed from './avored'
//import router from './router'
//import apolloProvider from './vue-apollo'

window.Vue = require('vue')
window.AvoRed = AvoRed

//import i18n from 'vue-i18n'


import Layout from 'ant-design-vue/lib/layout'
import Menu from 'ant-design-vue/lib/menu'
import Form from 'ant-design-vue/lib/form'
Expand Down Expand Up @@ -117,18 +122,18 @@ Vue.component('promotion-code-edit', () => import('../components/promotion/promo

Vue.component('avored-layout', () => import('../components/system/Layout.vue'))
Vue.component('avored-flash', () => import('../components/system/Flash.vue'))
Vue.component('login-fields', () => import('../components/system/LoginFields.vue'))
Vue.component('login-fields', require('../components/system/LoginFields.vue').default)
Vue.component('password-reset-page', () => import('../components/system/PasswordResetPage.vue'))
Vue.component('password-new-page', () => import('../components/system/PasswordNewPage.vue'))

/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/



const app = new Vue({
el: '#app'
el: '#app',
//router,
//i18n,
//apolloProvider
});

export const EventBus = new Vue();
9 changes: 9 additions & 0 deletions resources/js/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Vue from 'vue'
import Vuei18n from 'vue-i18n'
Vue.use(Vuei18n)

export const i18n = new Vuei18n({
locale: 'en',
fallbackLocale: 'en',
messages: {}
})
15 changes: 15 additions & 0 deletions resources/js/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

]

const router = new VueRouter({
routes
})


export default router;
31 changes: 31 additions & 0 deletions resources/js/vue-apollo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

import Vue from 'vue'
import VueApollo from 'vue-apollo'

import { ApolloClient } from 'apollo-client'
import { createHttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'

Vue.use(VueApollo)


// HTTP connection to the API
const httpLink = createHttpLink({
// You should use an absolute URL here
uri: 'https://ecommerce.test/graphql',
})

// Cache implementation
const cache = new InMemoryCache()

// Create the apollo client
const apolloClient = new ApolloClient({
link: httpLink,
cache,
})

const apolloProvider = new VueApollo({
defaultClient: apolloClient,
})

export default apolloProvider
3 changes: 3 additions & 0 deletions resources/views/catalog/attribute/_fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
name="name"
v-decorator="[
'name',
{'initialValue': '{{ $attribute->name ?? '' }}'},
{rules:
[
{ required: true,
Expand All @@ -32,6 +33,7 @@
name="slug"
v-decorator="[
'slug',
{'initialValue': '{{ $attribute->slug ?? '' }}'},
{rules:
[
{ required: true,
Expand All @@ -54,6 +56,7 @@
@change="displayAsChange"
v-decorator="[
'display_as',
{'initialValue': '{{ $attribute->display_as ?? '' }}'},
{rules:
[
{ required: true,
Expand Down
2 changes: 1 addition & 1 deletion resources/views/catalog/attribute/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
>
@csrf
@method('put')
@<a-tabs tabbar-gutter="15" tab-position="left" default-active-key="catalog.attribute.info">
<a-tabs tabbar-gutter="15" tab-position="left" default-active-key="catalog.attribute.info">
@foreach ($tabs as $tab)
<a-tab-pane :force-render="true" tab="{{ $tab->label() }}" key="{{ $tab->key() }}">
@php
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 @@ -14,7 +14,7 @@
</head>
<body>
<div id="app">
<avored-layout inline-template >
<avored-layout inline-template>
<a-layout id="avored-admin-layout" style="min-height: 100vh">
@include('avored::partials.sidebar')
<a-layout>
Expand Down
10 changes: 2 additions & 8 deletions resources/views/partials/sidebar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
</a>
<a-menu
theme="light"
:default-selected-keys="[]"
:default-open-keys="[]"
:default-selected-keys="['{{ $currentMenuItemKey }}']"
:default-open-keys="['{{ $currentOpenKey }}']"
mode="inline">
@foreach ($adminMenus as $key => $adminMenu)
@if ($adminMenu->hasSubmenu())
Expand All @@ -23,13 +23,7 @@
</a>
</a-menu-item>
@endforeach

</a-sub-menu>
@else
<a-menu-item key="1">
<a-icon type="user"></a-icon>
<span>Test</span>
</a-menu-item>
@endif
@endforeach
</a-menu>
Expand Down
Loading

0 comments on commit 8e6f7af

Please sign in to comment.