removed module category from json

This commit is contained in:
Denis Duliçi 2020-07-21 00:01:26 +03:00
parent 1cd85d446c
commit d934bc419e
11 changed files with 65 additions and 17 deletions

View File

@ -56,7 +56,6 @@ abstract class Module extends Command
ModelHistory::create([
'company_id' => $this->company_id,
'module_id' => $this->model->id,
'category' => $this->module->get('category'),
'version' => $this->module->get('version'),
'description' => trans('modules.' . $action, ['module' => $this->alias]),
]);

View File

@ -2,7 +2,6 @@
"alias": "$ALIAS$",
"icon": "fa fa-cog",
"version": "1.0.0",
"category": "accounting",
"active": 1,
"providers": [
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\Event",

View File

@ -39,7 +39,6 @@ class Updates extends Controller
$m = new \stdClass();
$m->name = $row->getName();
$m->alias = $row->get('alias');
$m->category = $row->get('category');
$m->installed = $row->get('version');
$m->latest = $updates[$alias];

View File

@ -4,7 +4,6 @@ namespace App\Http\Controllers\Modules;
use App\Abstracts\Http\Controller;
use App\Models\Module\Module;
use App\Models\Module\ModuleHistory;
use App\Traits\Modules;
use Illuminate\Http\Request;

View File

@ -33,7 +33,6 @@ class CreateModuleUpdatedHistory
ModuleHistory::create([
'company_id' => $model->company_id,
'module_id' => $model->id,
'category' => $module->get('category', 'payment-method'),
'version' => $event->new,
'description' => trans('modules.history.updated', ['module' => $module->getAlias()]),
]);

View File

@ -0,0 +1,29 @@
<?php
namespace App\Listeners\Update\V20;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use Illuminate\Support\Facades\Artisan;
class Version2017 extends Listener
{
const ALIAS = 'core';
const VERSION = '2.0.17';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Artisan::call('migrate', ['--force' => true]);
}
}

View File

@ -6,7 +6,6 @@ use App\Abstracts\Model;
class ModuleHistory extends Model
{
protected $table = 'module_histories';
/**
@ -14,5 +13,5 @@ class ModuleHistory extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'module_id', 'category', 'version', 'description'];
protected $fillable = ['company_id', 'module_id', 'version', 'description'];
}

View File

@ -21,6 +21,7 @@ class Event extends Provider
'App\Listeners\Update\V20\Version208',
'App\Listeners\Update\V20\Version209',
'App\Listeners\Update\V20\Version2014',
'App\Listeners\Update\V20\Version2017',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',

View File

@ -460,7 +460,6 @@ trait Modules
{
$module = module($alias);
$name = $module->getName();
$category = $module->get('category');
$version = $module->get('version');
$company_id = session('company_id');
@ -483,7 +482,6 @@ trait Modules
'message' => null,
'data' => [
'name' => $name,
'category' => $category,
'version' => $version,
],
];
@ -513,7 +511,6 @@ trait Modules
'message' => null,
'data' => [
'name' => $module->getName(),
'category' => $module->get('category'),
'version' => $module->get('version'),
],
];
@ -543,7 +540,6 @@ trait Modules
'message' => null,
'data' => [
'name' => $module->getName(),
'category' => $module->get('category'),
'version' => $module->get('version'),
],
];

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CoreV2017 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('module_histories', function (Blueprint $table) {
$table->dropColumn('category');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -46,9 +46,8 @@
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-4 col-md-4">{{ trans('general.name') }}</th>
<th class="col-md-2 d-none d-md-block">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-sm-3 col-md-2 d-none d-sm-block">{{ trans('updates.installed_version') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2">{{ trans('updates.latest_version') }}</th>
<th class="col-sm-3 col-md-3 d-none d-sm-block">{{ trans('updates.installed_version') }}</th>
<th class="col-xs-4 col-sm-3 col-md-3">{{ trans('updates.latest_version') }}</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
@ -57,9 +56,8 @@
@foreach($modules as $module)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-4 col-md-4">{{ $module->name }}</td>
<td class="col-md-2 d-none d-md-block">{{ $module->category }}</td>
<td class="col-sm-3 col-md-2 d-none d-sm-block">{{ $module->installed }}</td>
<td class="col-xs-4 col-md-2 col-sm-3">{{ $module->latest }}</td>
<td class="col-sm-3 col-md-3 d-none d-sm-block">{{ $module->installed }}</td>
<td class="col-xs-4 col-sm-3 col-md-3">{{ $module->latest }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-center">
<a href="{{ route('updates.run', ['alias' => $module->alias, 'version' => $module->latest]) }}" class="btn btn-warning btn-sm">
<i class="fa fa-refresh" aria-hidden="true"></i> {{ trans_choice('general.updates', 1) }}