Skip to content

Commit

Permalink
Merge pull request #114 from avored/dev
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
indpurvesh authored Jun 10, 2020
2 parents 370337b + 77a5d20 commit 3a911b8
Show file tree
Hide file tree
Showing 164 changed files with 3,365 additions and 3,697 deletions.
19 changes: 0 additions & 19 deletions .circleci/config.yml

This file was deleted.

54 changes: 36 additions & 18 deletions .github/workflows/avored-test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
name: AvoRed
name: "Run Tests"

on: [push]
on: [push, pull_request]

jobs:
avored-tests:
test:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
# php: ['7.2', '7.3', '7.4']
php: ['7.2']
laravel: ['5.8.*']
include:
- laravel: '5.8.*'
testbench: '3.8.*'

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist

- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
31 changes: 0 additions & 31 deletions .github/workflows/avored.yml

This file was deleted.

13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@
"require" : {
"php" : ">=7.2",
"symfony/yaml": "^4.2",
"laravel/passport": "^7.4",
"laravel/passport": "^7.4|^8.0|^9.0",
"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",
"rebing/graphql-laravel": "^2.0"
"laravel/framework" : "^5.8.15|^6.0|^7.0",
"rebing/graphql-laravel": "^5.1"
},
"require-dev" : {
"phpunit/phpunit": "^7.5",
"orchestra/testbench" : "~3.7",
"mockery/mockery" : "1.2.*"
"phpunit/phpunit": "^8.0|^9.0",
"orchestra/testbench": "^3.8|^4.0|^5.0",
"phpstan/phpstan": "^0.12.27"
},
"autoload" : {
"classmap": [
Expand Down
31 changes: 31 additions & 0 deletions database/factories/ProductFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Support\Str;
use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Product;

$factory->define(Product::class, function (Faker $faker) {
$name = $faker->sentence;

return [
'name' => $name,
'slug' => Str::slug($name),
'type' => 'BASIC',
'sku' => Str::slug($name),
'barcode' => $faker->randomNumber(4),
'description' => $faker->sentence(3000),
'status' => 1,
'in_stock' => 1,
'track_stock' => 1,
'qty' => rand(100, 300),
'is_taxable' => 1,
'price' => $faker->randomNumber(2),
'cost_price' => $faker->randomNumber(2),
'weight' => $faker->randomNumber(2),
'height' => $faker->randomNumber(2),
'width' => $faker->randomNumber(2),
'length' => $faker->randomNumber(2),
'meta_title' => $faker->sentence,
'meta_description' => $faker->sentence,
];
});
44 changes: 8 additions & 36 deletions database/migrations/2017_03_29_000000_avored_framework_schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use AvoRed\Framework\Database\Models\Country;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Arr;

class AvoredFrameworkSchema extends Migration
{
Expand Down Expand Up @@ -62,19 +63,6 @@ public function up()
$table->timestamps();
});

Schema::create('category_translations', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('category_id')->nullable()->default(null);
$table->unsignedBigInteger('language_id')->nullable()->default(null);
$table->string('name')->nullable()->default(null);
$table->string('slug')->nullable()->default(null);
$table->string('meta_title')->nullable()->default(null);
$table->string('meta_description')->nullable()->default(null);
$table->timestamps();
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('language_id')->references('id')->on('languages')->onDelete('cascade');
});

Schema::create('permissions', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->unique();
Expand All @@ -101,21 +89,6 @@ public function up()
$table->timestamps();
});

Schema::create('page_translations', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('page_id')->nullable()->default(null);
$table->unsignedBigInteger('language_id')->nullable()->default(null);
$table->string('name')->nullable()->default(null);
$table->string('slug')->nullable()->default(null);
$table->text('content')->nullable()->default(null);
$table->string('meta_title')->nullable()->default(null);
$table->string('meta_description')->nullable()->default(null);
$table->timestamps();

$table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade');
$table->foreign('language_id')->references('id')->on('languages')->onDelete('cascade');
});

Schema::create('configurations', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('code')->nullable()->default(null);
Expand Down Expand Up @@ -436,7 +409,7 @@ public function up()
$table->unsignedBigInteger('filter_id');
$table->enum('type', ['ATTRIBUTE', 'PROPERTY']);

$table->foreign('category_id')->references('id')->on('categories');
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->timestamps();
});

Expand Down Expand Up @@ -481,12 +454,12 @@ public function up()
$json = json_decode(file_get_contents($path), true);
foreach ($json as $country) {
Country::create([
'code' => strtolower(array_get($country, 'alpha2Code')),
'name' => array_get($country, 'name'),
'phone_code' => array_get($country, 'callingCodes.0'),
'currency_code' => array_get($country, 'currencies.0.code'),
'currency_symbol' => array_get($country, 'currencies.0.symbol'),
'lang_code' => array_get($country, 'languages.0.name'),
'code' => strtolower(Arr::get($country, 'alpha2Code')),
'name' => Arr::get($country, 'name'),
'phone_code' => Arr::get($country, 'callingCodes.0'),
'currency_code' => Arr::get($country, 'currencies.0.code'),
'currency_symbol' => Arr::get($country, 'currencies.0.symbol'),
'lang_code' => Arr::get($country, 'languages.0.name'),
]);
}
}
Expand Down Expand Up @@ -537,7 +510,6 @@ public function down()
Schema::dropIfExists('permission_role');
Schema::dropIfExists('permissions');

Schema::dropIfExists('category_translations');
Schema::dropIfExists('categories');

Schema::dropIfExists('admin_users');
Expand Down
6 changes: 5 additions & 1 deletion resources/components/catalog/attribute/AttributeSave.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import isNil from 'lodash/isNil';
import isNil from 'lodash/isNil'
import get from 'lodash/get'
let id = 0;
export default {
Expand Down Expand Up @@ -37,6 +38,9 @@ export default {
})
return value;
},
getInitDropdownValue(index) {
return get(this.attribute, `dropdown_options.[${index}]['display_text']`, '')
},
handleUploadImageChange(info, record){
if (info.file.status == "done") {
var object = {};
Expand Down
Loading

0 comments on commit 3a911b8

Please sign in to comment.