removed module category from json
This commit is contained in:
parent
1cd85d446c
commit
d934bc419e
@ -56,7 +56,6 @@ abstract class Module extends Command
|
|||||||
ModelHistory::create([
|
ModelHistory::create([
|
||||||
'company_id' => $this->company_id,
|
'company_id' => $this->company_id,
|
||||||
'module_id' => $this->model->id,
|
'module_id' => $this->model->id,
|
||||||
'category' => $this->module->get('category'),
|
|
||||||
'version' => $this->module->get('version'),
|
'version' => $this->module->get('version'),
|
||||||
'description' => trans('modules.' . $action, ['module' => $this->alias]),
|
'description' => trans('modules.' . $action, ['module' => $this->alias]),
|
||||||
]);
|
]);
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"alias": "$ALIAS$",
|
"alias": "$ALIAS$",
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"category": "accounting",
|
|
||||||
"active": 1,
|
"active": 1,
|
||||||
"providers": [
|
"providers": [
|
||||||
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\Event",
|
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Providers\\Event",
|
||||||
|
@ -39,7 +39,6 @@ class Updates extends Controller
|
|||||||
$m = new \stdClass();
|
$m = new \stdClass();
|
||||||
$m->name = $row->getName();
|
$m->name = $row->getName();
|
||||||
$m->alias = $row->get('alias');
|
$m->alias = $row->get('alias');
|
||||||
$m->category = $row->get('category');
|
|
||||||
$m->installed = $row->get('version');
|
$m->installed = $row->get('version');
|
||||||
$m->latest = $updates[$alias];
|
$m->latest = $updates[$alias];
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ namespace App\Http\Controllers\Modules;
|
|||||||
|
|
||||||
use App\Abstracts\Http\Controller;
|
use App\Abstracts\Http\Controller;
|
||||||
use App\Models\Module\Module;
|
use App\Models\Module\Module;
|
||||||
use App\Models\Module\ModuleHistory;
|
|
||||||
use App\Traits\Modules;
|
use App\Traits\Modules;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ class CreateModuleUpdatedHistory
|
|||||||
ModuleHistory::create([
|
ModuleHistory::create([
|
||||||
'company_id' => $model->company_id,
|
'company_id' => $model->company_id,
|
||||||
'module_id' => $model->id,
|
'module_id' => $model->id,
|
||||||
'category' => $module->get('category', 'payment-method'),
|
|
||||||
'version' => $event->new,
|
'version' => $event->new,
|
||||||
'description' => trans('modules.history.updated', ['module' => $module->getAlias()]),
|
'description' => trans('modules.history.updated', ['module' => $module->getAlias()]),
|
||||||
]);
|
]);
|
||||||
|
29
app/Listeners/Update/V20/Version2017.php
Normal file
29
app/Listeners/Update/V20/Version2017.php
Normal 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]);
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,6 @@ use App\Abstracts\Model;
|
|||||||
|
|
||||||
class ModuleHistory extends Model
|
class ModuleHistory extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $table = 'module_histories';
|
protected $table = 'module_histories';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,5 +13,5 @@ class ModuleHistory extends Model
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['company_id', 'module_id', 'category', 'version', 'description'];
|
protected $fillable = ['company_id', 'module_id', 'version', 'description'];
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ class Event extends Provider
|
|||||||
'App\Listeners\Update\V20\Version208',
|
'App\Listeners\Update\V20\Version208',
|
||||||
'App\Listeners\Update\V20\Version209',
|
'App\Listeners\Update\V20\Version209',
|
||||||
'App\Listeners\Update\V20\Version2014',
|
'App\Listeners\Update\V20\Version2014',
|
||||||
|
'App\Listeners\Update\V20\Version2017',
|
||||||
],
|
],
|
||||||
'Illuminate\Auth\Events\Login' => [
|
'Illuminate\Auth\Events\Login' => [
|
||||||
'App\Listeners\Auth\Login',
|
'App\Listeners\Auth\Login',
|
||||||
|
@ -460,7 +460,6 @@ trait Modules
|
|||||||
{
|
{
|
||||||
$module = module($alias);
|
$module = module($alias);
|
||||||
$name = $module->getName();
|
$name = $module->getName();
|
||||||
$category = $module->get('category');
|
|
||||||
$version = $module->get('version');
|
$version = $module->get('version');
|
||||||
|
|
||||||
$company_id = session('company_id');
|
$company_id = session('company_id');
|
||||||
@ -483,7 +482,6 @@ trait Modules
|
|||||||
'message' => null,
|
'message' => null,
|
||||||
'data' => [
|
'data' => [
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'category' => $category,
|
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@ -513,7 +511,6 @@ trait Modules
|
|||||||
'message' => null,
|
'message' => null,
|
||||||
'data' => [
|
'data' => [
|
||||||
'name' => $module->getName(),
|
'name' => $module->getName(),
|
||||||
'category' => $module->get('category'),
|
|
||||||
'version' => $module->get('version'),
|
'version' => $module->get('version'),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@ -543,7 +540,6 @@ trait Modules
|
|||||||
'message' => null,
|
'message' => null,
|
||||||
'data' => [
|
'data' => [
|
||||||
'name' => $module->getName(),
|
'name' => $module->getName(),
|
||||||
'category' => $module->get('category'),
|
|
||||||
'version' => $module->get('version'),
|
'version' => $module->get('version'),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
30
database/migrations/2020_07_20_000000_core_v2017.php
Normal file
30
database/migrations/2020_07_20_000000_core_v2017.php
Normal 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()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
@ -46,9 +46,8 @@
|
|||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr class="row table-head-line">
|
<tr class="row table-head-line">
|
||||||
<th class="col-xs-4 col-sm-4 col-md-4">{{ trans('general.name') }}</th>
|
<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-3 d-none d-sm-block">{{ trans('updates.installed_version') }}</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-3">{{ trans('updates.latest_version') }}</th>
|
||||||
<th class="col-xs-4 col-sm-3 col-md-2">{{ trans('updates.latest_version') }}</th>
|
|
||||||
<th class="col-xs-4 col-sm-2 col-md-2 text-center">{{ trans('general.actions') }}</th>
|
<th class="col-xs-4 col-sm-2 col-md-2 text-center">{{ trans('general.actions') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -57,9 +56,8 @@
|
|||||||
@foreach($modules as $module)
|
@foreach($modules as $module)
|
||||||
<tr class="row align-items-center border-top-1">
|
<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-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-3 d-none d-sm-block">{{ $module->installed }}</td>
|
||||||
<td class="col-sm-3 col-md-2 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-md-2 col-sm-3">{{ $module->latest }}</td>
|
|
||||||
<td class="col-xs-4 col-sm-2 col-md-2 text-center">
|
<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">
|
<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) }}
|
<i class="fa fa-refresh" aria-hidden="true"></i> {{ trans_choice('general.updates', 1) }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user