Skip to content

Commit

Permalink
Merge pull request #117 from avored/tailwind-migration
Browse files Browse the repository at this point in the history
3.0.15
  • Loading branch information
indpurvesh authored Aug 6, 2020
2 parents dd8b2ab + 61cf389 commit 1b2174d
Show file tree
Hide file tree
Showing 166 changed files with 11,766 additions and 4,208 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/avored-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ jobs:
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit

- name: Send Slack notification
uses: 8398a7/action-slack@v2
if: failure()
with:
status: ${{ job.status }}
author_name: ${{ github.actor }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/vendor
composer.lock
.phpunit.result.cache
/node_modules
.env
.DS_Store
12 changes: 11 additions & 1 deletion config/avored.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
| AvoRed Cart Products Session Identifier
|--------------------------------------------------------------------------
*/


return [
'admin_url' => 'admin',
'symlink_storage_folder' => 'storage',
'cart' => ['session_key' => 'cart_products', 'promotion_key' => 'cart_discount'],
'model' => [
'user' => App\User::class,
'user' => \AvoRed\Framework\Database\Models\Customer::class,
],

'graphql' => [
Expand Down Expand Up @@ -86,6 +88,10 @@
'driver' => 'session',
'provider' => 'admin-users',
],
'customer' => [
'driver' => 'session',
'provider' => 'customers',
],
'admin_api' => [
'driver' => 'passport',
'provider' => 'admin-users',
Expand All @@ -98,6 +104,10 @@
'driver' => 'eloquent',
'model' => AvoRed\Framework\Database\Models\AdminUser::class,
],
'customers' => [
'driver' => 'eloquent',
'model' => AvoRed\Framework\Database\Models\Customer::class,
],
],

'passwords' => [
Expand Down
19 changes: 16 additions & 3 deletions database/migrations/2017_03_29_000000_avored_framework_schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ public function up()
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
});

Schema::create('customers', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('email')->unique();
$table->string('password');
$table->string('image_path')->nullable()->default(null);
$table->rememberToken();
$table->timestamp('email_verified_at')->nullable();
$table->timestamps();
});

Schema::create('categories', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->nullable()->default(null);
Expand Down Expand Up @@ -344,7 +356,7 @@ public function up()

Schema::create('addresses', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('customer_id');
$table->enum('type', ['SHIPPING', 'BILLING']);
$table->string('first_name')->nullable()->default(null);
$table->string('last_name')->nullable()->default(null);
Expand All @@ -357,7 +369,7 @@ public function up()
$table->unsignedBigInteger('country_id')->nullable()->default(null);
$table->string('phone')->nullable()->default(null);
$table->timestamps();
//$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
});

Expand All @@ -367,7 +379,7 @@ public function up()
$table->string('payment_option');
$table->unsignedBigInteger('order_status_id');
$table->unsignedBigInteger('currency_id')->nullable()->default(null);
$table->unsignedBigInteger('user_id')->nullable();
$table->unsignedBigInteger('customer_id')->nullable();
$table->unsignedBigInteger('shipping_address_id')->nullable();
$table->unsignedBigInteger('billing_address_id')->nullable();
$table->string('track_code')->nullable()->default(null);
Expand All @@ -377,6 +389,7 @@ public function up()
$table->foreign('shipping_address_id')->references('id')->on('addresses');
$table->foreign('billing_address_id')->references('id')->on('addresses');
$table->foreign('order_status_id')->references('id')->on('order_statuses');
$table->foreign('customer_id')->references('id')->on('customers');
});

Schema::create('order_products', function (Blueprint $table) {
Expand Down
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@avored/framework",
"version": "1.0.0",
"repository": "https://www.github.com/avored/framework",
"author": "Purvesh <purvesh.patel@digistorm.com>",
"license": "MIT",
"private": false,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"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.0",
"axios": "^0.19.2",
"cross-env": "^7.0.2",
"laravel-mix": "^5.0.4",
"laravel-mix-alias": "^1.0.2",
"less": "^3.11.3",
"less-loader": "^6.2.0",
"lodash": "^4.17.19",
"tailwindcss": "^1.4.6",
"vddl": "^0.7.1",
"vue": "^2.5",
"vue-i18n": "^8.18.2",
"vue-router": "^3.3.4",
"vue-simplemde": "^1.1.2",
"vue-zondicons": "^0.1.10",
"vuex": "^3.5.1"
}
}
15 changes: 6 additions & 9 deletions resources/components/catalog/attribute/AttributeSave.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ export default {
}
});
},
imagePathName(path) {
var name = "dropdown_option[";
Object.keys(path).forEach(key => {
name += key
})
name += "][path]";
return name;
},
imagePathValue(path) {
var value = ""
Object.keys(path).forEach(key => {
Expand All @@ -40,6 +33,9 @@ export default {
},
getInitDropdownValue(index) {
return get(this.attribute, `dropdown_options.[${index}]['display_text']`, '')
},
getInitDropdownPathValue(index) {
return get(this.attribute, `dropdown_options.[${index}]['path']`, '')
},
handleUploadImageChange(info, record){
if (info.file.status == "done") {
Expand Down Expand Up @@ -72,7 +68,7 @@ export default {
},
getDefaultFile(record) {
if (isNil(this.attribute)) {
if (true ||isNil(this.attribute)) {
return []
}
var dropdownOption = this.attribute.dropdown_options[record];
Expand Down Expand Up @@ -107,6 +103,7 @@ export default {
this.attributeForm.getFieldDecorator('dropdown_options['+ element.id +']', { initialValue: element.display_text, preserve: true });
});
}
this.dropdownOptions.push(this.randomString());
} else {
this.dropdownOptions.push(this.randomString());
}
Expand Down
44 changes: 16 additions & 28 deletions resources/components/catalog/attribute/AttributeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,39 +61,27 @@ export default {
},
methods: {
getEditUrl(record) {
return this.baseUrl + '/attirbute/' + record.id + '/edit';
return this.baseUrl + '/attribute/' + record.id + '/edit';
},
getDeleteUrl(record) {
return this.baseUrl + '/attirbute/' + record.id;
return this.baseUrl + '/attribute/' + record.id;
},
deleteOnClick(record) {
var url = this.baseUrl + '/attirbute/' + record.id;
var url = this.baseUrl + '/attribute/' + record.id;
var app = this;
this.$confirm({
title: 'Do you Want to delete ' + record.name + ' attirbute?',
okType: 'danger',
onOk() {
axios.delete(url)
.then(response => {
if (response.data.success === true) {
app.$notification.error({
key: 'attirbute.delete.success',
message: response.data.message,
});
}
window.location.reload();
})
.catch(errors => {
app.$notification.error({
key: 'attirbute.delete.error',
message: errors.message
});
});
},
onCancel() {
// Do nothing
},
});
this.$confirm({message: `Do you Want to delete ${record.name} attribute?`, callback: () => {
axios.delete(url)
.then(response => {
if (response.data.success === true) {
app.$alert(response.data.message)
}
window.location.reload();
})
.catch(errors => {
app.$alert(errors.message)
});
}})
},
}
};
Expand Down
82 changes: 32 additions & 50 deletions resources/components/catalog/category/CategoryTable.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<template>
<div>
<div class="flex justify-end mt-3">
<avored-button
button-text="Create"
html-type="link"
type="primary"
icon-type="edit-pencil"
:link-url="createUrl">
</avored-button>
</div>
<div class="mt-3">
<avored-table
:columns="columns"
Expand All @@ -19,22 +10,22 @@
:next_page_url="initCategories.next_page_url"
:items="initCategories.data"
>
>
<template slot="action" slot-scope="{item}">
<div class="flex items-center">
<avored-button
icon-type="edit-pencil"
button-class="px-0"
html-type="link"
:link-url="getEditUrl(item)">
</avored-button>

<a :href="getEditUrl(item)">
<svg class="h-6 w-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path
class="heroicon-ui"
d="M6.3 12.3l10-10a1 1 0 011.4 0l4 4a1 1 0 010 1.4l-10 10a1 1 0 01-.7.3H7a1 1 0 01-1-1v-4a1 1 0 01.3-.7zM8 16h2.59l9-9L17 4.41l-9 9V16zm10-2a1 1 0 012 0v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6c0-1.1.9-2 2-2h6a1 1 0 010 2H4v14h14v-6z"
/>
</svg>
</a>

<avored-button
icon-type="trash"
@click.prevent="deleteOnClick(item)">
</avored-button>

<button type="button" @click.prevent="deleteOnClick(item)">
<svg class="h-6 w-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path class="heroicon-ui" d="M8 6V4c0-1.1.9-2 2-2h4a2 2 0 012 2v2h5a1 1 0 010 2h-1v12a2 2 0 01-2 2H6a2 2 0 01-2-2V8H3a1 1 0 110-2h5zM6 8v12h12V8H6zm8-2V4h-4v2h4zm-4 4a1 1 0 011 1v6a1 1 0 01-2 0v-6a1 1 0 011-1zm4 0a1 1 0 011 1v6a1 1 0 01-2 0v-6a1 1 0 011-1z"/>
</svg>
</button>
</div>
</template>
</avored-table>
Expand All @@ -44,7 +35,7 @@

<script>
import AvoRedButton from '../../system/forms/AvoRedButtton'
// import AvoRedButton from '../../system/forms/AvoRedButtton'
const columns = [
{
Expand All @@ -66,14 +57,17 @@ const columns = [
];
export default {
props: ['baseUrl', 'initCategories', 'createUrl'],
props: ['baseUrl', 'initCategories'],
components: {
'avored-button': AvoRedButton
},
data () {
return {
columns,
};
},
mounted() {
},
methods: {
getEditUrl(record) {
Expand All @@ -85,31 +79,19 @@ export default {
deleteOnClick(record) {
var url = this.baseUrl + '/category/' + record.id;
var app = this;
this.$confirm({
title: 'Do you Want to delete ' + record.name + ' category?',
okType: 'danger',
onOk() {
axios.delete(url)
.then(response => {
if (response.data.success === true) {
app.$notification.error({
key: 'category.delete.success',
message: response.data.message,
});
}
window.location.reload();
})
.catch(errors => {
app.$notification.error({
key: 'category.delete.error',
message: errors.message
});
});
},
onCancel() {
// Do nothing
},
});
this.$confirm({message: `Do you Want to delete ${record.name} category?`, callback: () => {
axios.delete(url)
.then(response => {
if (response.data.success === true) {
app.$alert(response.data.message)
}
window.location.reload();
})
.catch(errors => {
app.$alert(errors.message)
});
}})
},
}
};
Expand Down
9 changes: 9 additions & 0 deletions resources/components/catalog/category/Test.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<div>Hello Test</div>
</template>

<script>
export default {
name: 'category-test'
}
</script>
Loading

0 comments on commit 1b2174d

Please sign in to comment.