Skip to content

Commit

Permalink
MPM-7 update menu items & mpm plugins (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
InensusDev authored Feb 8, 2024
1 parent e0330fb commit 2fff160
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('micro_power_manager')->table('mpm_plugins', function (Blueprint $table) {
$table->enum('usage_type', [
'mini-grid',
'shs',
'e-bike',
'general',
])->default('general')->after('id');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('micro_power_manager')->table('mpm_plugins', function (Blueprint $table) {
//
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('shard')->table('menu_items', function (Blueprint $table) {
$table->string('usage_type')->default('general')->after('id');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('shard')->table('menu_items', function (Blueprint $table) {
$table->dropColumn('usage_type');
});
}
};
17 changes: 15 additions & 2 deletions Website/htdocs/mpmanager/database/seeders/MenuItemsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,88 +17,101 @@ public function run()
DB::connection('shard')->table('menu_items')->insert(array(
[
'name' => 'Dashboard',
'url_slug' => '',
'url_slug' => '/',
'md_icon' => 'home',
'menu_order' => '1',

'usage_type' => 'general',
],
[
'name' => 'Customers',
'url_slug' => '/people/page/1',
'md_icon' => 'supervisor_account',
'menu_order' => '2',
'usage_type' => 'general',
],
[
'name' => 'Agents',
'url_slug' => '',
'md_icon' => 'support_agent',
'menu_order' => '3',
'usage_type' => 'general',
],
[
'name' => 'Meters',
'url_slug' => '',
'md_icon' => 'bolt',
'menu_order' => '4',
'usage_type' => 'mini-grid',
],
[
'name' => 'Transactions',
'url_slug' => '/transactions/page/1',
'md_icon' => 'account_balance',
'menu_order' => '5',
'usage_type' => 'general',
],
[
'name' => 'Tickets',
'url_slug' => '',
'md_icon' => 'confirmation_number',
'menu_order' => '6',
'usage_type' => 'general',
],
[
'name' => 'Tariffs',
'url_slug' => '/tariffs',
'md_icon' => 'widgets',
'menu_order' => '7',
'usage_type' => 'mini-grid',
],
[
'name' => 'Targets',
'url_slug' => '/targets',
'md_icon' => 'gps_fixed',
'menu_order' => '8',
'usage_type' => 'mini-grid',
],
[
'name' => 'Reports',
'url_slug' => '/reports',
'md_icon' => 'text_snippet',
'menu_order' => '9',
'usage_type' => 'general',
],
[
'name' => 'Messages',
'url_slug' => '',
'md_icon' => 'sms',
'menu_order' => '10',
'usage_type' => 'general',
],
[
'name' => 'Appliances',
'url_slug' => '/assets/page/1',
'md_icon' => 'devices_other',
'menu_order' => '11',
'usage_type' => 'general',
],
[
'name' => 'Maintenance',
'url_slug' => '/maintenance',
'md_icon' => 'home_repair_service',
'menu_order' => '12',
'usage_type' => 'mini-grid',
],
[
'name' => 'Solar Home Systems',
'url_slug' => '/solar-home-systems/page/1',
'md_icon' => 'solar_power',
'menu_order' => '13',
'usage_type' => 'shs',
],
[
'name' => 'E-Bikes',
'url_slug' => '/e-bikes/page/1',
'md_icon' => 'electric_bike',
'menu_order' => '14',
'usage_type' => 'e-bike',
]
)
);
Expand Down
10 changes: 0 additions & 10 deletions Website/htdocs/mpmanager/database/seeders/SubMenuItemsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ class SubMenuItemsSeeder extends Seeder
public function run(): void
{
DB::connection('shard')->table('sub_menu_items')->insert(array(
[
'name' => 'Clusters',
'url_slug' => '/',
'parent_id' => '1',
],
[
'name' => 'Mini-Grid',
'url_slug' => '/dashboards/mini-grid',
'parent_id' => '1',
],
[
'name' => 'List',
'url_slug' => '/agents/page/1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Angaza SHS',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'shs',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' =>'Bulk Registration',
'url_slug' =>'/bulk-registration/bulk-registration',
'md_icon' =>'upload_file'
'md_icon' =>'upload_file',
'usage_type' =>'general',
];
return ['menuItem'=>$menuItem,'subMenuItems'=>[]];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public function createMenuItems()
$menuItem = [
'name' =>'Calin Meter',
'url_slug' =>'',
'md_icon' =>'bolt'
'md_icon' =>'bolt',
'usage_type' =>'mini-grid',
];
$subMenuItems= array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'CalinSmart Meter',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'mini-grid',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Daly Bms',
'url_slug' => '',
'md_icon' => 'charging_station'
'md_icon' => 'charging_station',
'usage_type' => 'e-bike',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'GomeLong Meter',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'mini-grid',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Kelin Meter',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'mini-grid',
];
$subMenuItems= array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' =>'MicroStar Meter',
'url_slug' =>'',
'md_icon' =>'bolt'
'md_icon' =>'bolt',
'usage_type' =>'mini-grid',
];
$subMenuItems= array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Spark Meter',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'mini-grid',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Steamaco Meter',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'mini-grid',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Stron Meter',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'mini-grid',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'SunKing SHS',
'url_slug' => '',
'md_icon' => 'bolt'
'md_icon' => 'bolt',
'usage_type' => 'shs',
];
$subMenuItems = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Swifta',
'url_slug' => '',
'md_icon' => 'money'
'md_icon' => 'money',
'usage_type' => 'general',
];
$subMenuItems= array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'Viber Messaging',
'url_slug' => '',
'md_icon' => 'message'
'md_icon' => 'message',
'usage_type' => 'general',
];
$subMenuItems= array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function createMenuItems()
$menuItem = [
'name' => 'WaveMoney',
'url_slug' => '',
'md_icon' => 'money'
'md_icon' => 'money',
'usage_type' => 'general',
];
$subMenuItems= array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public function createMenuItems()
$menuItem = [
'name' =>'Wavecom Payment Provider',
'url_slug' =>'/wavecom/transactions',
'md_icon' =>'upload_file'
'md_icon' =>'upload_file',
'usage_type' =>'general',
];
return ['menuItem'=>$menuItem,'subMenuItems'=>[]];
}
Expand Down

0 comments on commit 2fff160

Please sign in to comment.