From 8ae9a070c79fd180c64eba5204ad1c06ab30a5f7 Mon Sep 17 00:00:00 2001 From: Danny Atthaya Date: Tue, 29 Jun 2021 15:44:53 +0700 Subject: [PATCH 1/4] #208 Fixing license issue --- src/Config/badaso.php | 1 + src/Controllers/BadasoDashboardController.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Config/badaso.php b/src/Config/badaso.php index ae796e59e..779df4656 100644 --- a/src/Config/badaso.php +++ b/src/Config/badaso.php @@ -5,6 +5,7 @@ 'admin_panel_route_prefix' => env('MIX_ADMIN_PANEL_ROUTE_PREFIX', 'badaso-dashboard'), 'default_menu' => env('MIX_DEFAULT_MENU', 'admin'), 'api_route_prefix' => env('MIX_API_ROUTE_PREFIX', 'badaso-api'), + 'license_key' => env('BADASO_LICENSE_KEY'), 'storage' => [ 'disk' => env('FILESYSTEM_DRIVER', 'public'), ], diff --git a/src/Controllers/BadasoDashboardController.php b/src/Controllers/BadasoDashboardController.php index c8111354b..cdd8699fd 100644 --- a/src/Controllers/BadasoDashboardController.php +++ b/src/Controllers/BadasoDashboardController.php @@ -14,9 +14,9 @@ class BadasoDashboardController extends Controller { public function verifyLicense() { - $license = env('BADASO_LICENSE_KEY'); + $license = config('badaso.license_key'); if (is_null($license)) { - return ApiResponse::paymentRequired('BADASO_LICENSE_KEY not found'); + return ApiResponse::paymentRequired('BADASO_LICENSE_KEY not found on .env'); } elseif ($license == '') { return ApiResponse::paymentRequired('BADASO_LICENSE_KEY License Empty'); } else { From a482fd6df1f6d0f64804b8e3cef311b5ce3f9c3c Mon Sep 17 00:00:00 2001 From: Danny Atthaya Date: Tue, 29 Jun 2021 16:28:17 +0700 Subject: [PATCH 2/4] Squash migrations --- .../2020_11_13_064800_create_data_type.php | 2 + ...020_11_18_014827_create_configurations.php | 1 + .../2020_11_18_014950_create_permissions.php | 1 + .../2020_11_18_015020_create_menus.php | 1 + ...020_11_18_015341_add_badaso_user_field.php | 2 +- .../2021_02_19_033756_add_icon_to_menus.php | 36 ---------------- ...03_02_022959_add_column_to_permissions.php | 36 ---------------- ...64043_add_can_delete_to_configurations.php | 36 ---------------- ...ification_on_event_in_data_types_table.php | 36 ---------------- ...add_is_maintenance_to_data_types_table.php | 36 ---------------- ...91143_alter_avatar_field_on_user_table.php | 42 ------------------- ...alter_avatar_field_on_user_table_again.php | 42 ------------------- 12 files changed, 6 insertions(+), 265 deletions(-) delete mode 100644 src/Migrations/2021_02_19_033756_add_icon_to_menus.php delete mode 100644 src/Migrations/2021_03_02_022959_add_column_to_permissions.php delete mode 100644 src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php delete mode 100644 src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php delete mode 100644 src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php delete mode 100644 src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php delete mode 100644 src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php diff --git a/src/Migrations/2020_11_13_064800_create_data_type.php b/src/Migrations/2020_11_13_064800_create_data_type.php index 8b669aa2c..172183d6c 100644 --- a/src/Migrations/2020_11_13_064800_create_data_type.php +++ b/src/Migrations/2020_11_13_064800_create_data_type.php @@ -29,8 +29,10 @@ public function up() $table->enum('order_direction', ['ASC', 'DESC'])->nullable(); $table->boolean('generate_permissions')->default(false); $table->tinyInteger('server_side')->default(0); + $table->boolean('is_maintenance')->default(false); $table->text('description')->nullable(); $table->text('details')->nullable(); + $table->text('notification')->nullable(); $table->timestamps(); }); diff --git a/src/Migrations/2020_11_18_014827_create_configurations.php b/src/Migrations/2020_11_18_014827_create_configurations.php index 0b1635cee..51b690da1 100644 --- a/src/Migrations/2020_11_18_014827_create_configurations.php +++ b/src/Migrations/2020_11_18_014827_create_configurations.php @@ -23,6 +23,7 @@ public function up() $table->string('type'); $table->integer('order')->default('1'); $table->string('group')->nullable(); + $table->boolean('can_delete')->default(false); $table->timestamps(); }); } catch (PDOException $ex) { diff --git a/src/Migrations/2020_11_18_014950_create_permissions.php b/src/Migrations/2020_11_18_014950_create_permissions.php index 7a421f5cf..098264556 100644 --- a/src/Migrations/2020_11_18_014950_create_permissions.php +++ b/src/Migrations/2020_11_18_014950_create_permissions.php @@ -20,6 +20,7 @@ public function up() $table->string('description')->nullable(); $table->string('table_name')->nullable(); $table->boolean('always_allow')->default(false); + $table->boolean('is_public')->default(false); $table->timestamps(); }); } catch (PDOException $ex) { diff --git a/src/Migrations/2020_11_18_015020_create_menus.php b/src/Migrations/2020_11_18_015020_create_menus.php index a943768f8..a59c527d2 100644 --- a/src/Migrations/2020_11_18_015020_create_menus.php +++ b/src/Migrations/2020_11_18_015020_create_menus.php @@ -18,6 +18,7 @@ public function up() $table->increments('id'); $table->string('key')->unique(); $table->string('display_name'); + $table->string('icon')->nullable(); $table->timestamps(); }); } catch (PDOException $ex) { diff --git a/src/Migrations/2020_11_18_015341_add_badaso_user_field.php b/src/Migrations/2020_11_18_015341_add_badaso_user_field.php index 83b4fa386..d9bcc6cb0 100644 --- a/src/Migrations/2020_11_18_015341_add_badaso_user_field.php +++ b/src/Migrations/2020_11_18_015341_add_badaso_user_field.php @@ -16,7 +16,7 @@ public function up() try { Schema::table('users', function (Blueprint $table) { if (! Schema::hasColumn('users', 'avatar')) { - $table->string('avatar')->nullable()->after('email')->default('users/default.png'); + $table->string('avatar')->nullable()->after('email')->default('files/shares/default-user.png'); } if (! Schema::hasColumn('users', 'additional_info')) { $table->text('additional_info')->nullable()->after('email'); diff --git a/src/Migrations/2021_02_19_033756_add_icon_to_menus.php b/src/Migrations/2021_02_19_033756_add_icon_to_menus.php deleted file mode 100644 index 174ca4f86..000000000 --- a/src/Migrations/2021_02_19_033756_add_icon_to_menus.php +++ /dev/null @@ -1,36 +0,0 @@ -string('icon')->nullable()->after('display_name'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('menus', function (Blueprint $table) { - if (Schema::hasColumn('menus', 'icon')) { - $table->dropColumn('icon'); - } - }); - } -} diff --git a/src/Migrations/2021_03_02_022959_add_column_to_permissions.php b/src/Migrations/2021_03_02_022959_add_column_to_permissions.php deleted file mode 100644 index 82af9f416..000000000 --- a/src/Migrations/2021_03_02_022959_add_column_to_permissions.php +++ /dev/null @@ -1,36 +0,0 @@ -boolean('is_public')->default(false)->after('always_allow'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('permissions', function (Blueprint $table) { - if (Schema::hasColumn('permissions', 'is_public')) { - $table->dropColumn('is_public'); - } - }); - } -} diff --git a/src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php b/src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php deleted file mode 100644 index 24b11b803..000000000 --- a/src/Migrations/2021_03_16_064043_add_can_delete_to_configurations.php +++ /dev/null @@ -1,36 +0,0 @@ -boolean('can_delete')->default(false)->after('group'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('configurations', function (Blueprint $table) { - if (Schema::hasColumn('configurations', 'can_delete')) { - $table->dropColumn('can_delete'); - } - }); - } -} diff --git a/src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php b/src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php deleted file mode 100644 index d5f63e9b7..000000000 --- a/src/Migrations/2021_04_23_024729_add_notification_on_event_in_data_types_table.php +++ /dev/null @@ -1,36 +0,0 @@ -text('notification')->nullable()->after('details'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('data_types', function (Blueprint $table) { - if (Schema::hasColumn('data_types', 'notification')) { - $table->dropColumn('notification'); - } - }); - } -} diff --git a/src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php b/src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php deleted file mode 100644 index 3fb578cf0..000000000 --- a/src/Migrations/2021_05_07_024347_add_is_maintenance_to_data_types_table.php +++ /dev/null @@ -1,36 +0,0 @@ -boolean('is_maintenance')->default(false)->after('server_side'); - } - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('data_types', function (Blueprint $table) { - if (Schema::hasColumn('data_types', 'is_maintenance')) { - $table->dropColumn('is_maintenance'); - } - }); - } -} diff --git a/src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php b/src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php deleted file mode 100644 index 82230f156..000000000 --- a/src/Migrations/2021_06_14_091143_alter_avatar_field_on_user_table.php +++ /dev/null @@ -1,42 +0,0 @@ -string('avatar')->nullable()->after('additional_info')->default('/files/shares/default-user.png')->change(); - } - }); - } catch (PDOException $ex) { - $this->down(); - - throw $ex; - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - if (Schema::hasColumn('users', 'avatar')) { - $table->string('avatar')->nullable()->after('additional_info')->default('users/default.png')->change(); - } - }); - } -} diff --git a/src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php b/src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php deleted file mode 100644 index 057b79cda..000000000 --- a/src/Migrations/2021_06_22_091143_alter_avatar_field_on_user_table_again.php +++ /dev/null @@ -1,42 +0,0 @@ -string('avatar')->nullable()->after('additional_info')->default('files/shares/default-user.png')->change(); - } - }); - } catch (PDOException $ex) { - $this->down(); - - throw $ex; - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - if (Schema::hasColumn('users', 'avatar')) { - $table->string('avatar')->nullable()->after('additional_info')->default('/files/shares/default-user.png')->change(); - } - }); - } -} From c04a70f6c04bc1f73d598454bf1afdfd6ea135a7 Mon Sep 17 00:00:00 2001 From: Danny Atthaya Date: Tue, 29 Jun 2021 17:08:12 +0700 Subject: [PATCH 3/4] #210 change seeder replace concept to delete --- src/Seeder/Configurations/SiteManagementSeeder.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Seeder/Configurations/SiteManagementSeeder.php b/src/Seeder/Configurations/SiteManagementSeeder.php index 9a8ed211d..cdb2edfe3 100644 --- a/src/Seeder/Configurations/SiteManagementSeeder.php +++ b/src/Seeder/Configurations/SiteManagementSeeder.php @@ -153,16 +153,11 @@ public function run() ], ]; - $new_settings = []; foreach ($settings as $key => $value) { - $setting = \DB::table('configurations')->where('key', $value['key'])->first(); - if (isset($setting)) { - continue; - } - $new_settings[] = $value; + \DB::table('configurations')->where('key', $value['key'])->delete(); } - \DB::table('configurations')->insert($new_settings); + \DB::table('configurations')->insert($settings); \DB::commit(); } catch (Exception $e) { From 046ec3da07d94e1e0a02a9735052ac52b0a727f1 Mon Sep 17 00:00:00 2001 From: Rizki Heryandi Date: Sun, 4 Jul 2021 23:42:11 +0700 Subject: [PATCH 4/4] Bump version to 2.0.0-rc.7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c303802a8..3b1398d36 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "version": "2.0.0-rc.6", + "version": "2.0.0-rc.7", "name": "uasoft-indonesia/badaso", "description": "The First Open-Source Laravel Vue headless CMS (PWA dashboard + CRUD + API generator & more) for more productivity !", "keywords": [