From dfce2a4f16c1e150ce9086807efbb5a993a02aa6 Mon Sep 17 00:00:00 2001 From: my4fdal Date: Thu, 8 Jul 2021 09:38:52 +0700 Subject: [PATCH 1/3] update name seeder --- CONTRIBUTING.md | 19 ++++++++++--------- ...p => BadasoContentFixedMenuItemSeeder.php} | 5 ++--- ...eeder.php => BadasoContentMenusSeeder.php} | 5 ++--- src/Seeder/BadasoContentModuleSeeder.php | 17 +++++++++++++++++ ...php => BadasoContentPermissionsSeeder.php} | 3 +-- ...=> BadasoContentRolePermissionsSeeder.php} | 5 ++--- src/Seeder/ContentModuleSeeder.php | 19 ------------------- .../js/api/modules/badaso-content.js | 4 ++-- src/resources/js/pages/content/add.vue | 4 ++-- 9 files changed, 38 insertions(+), 43 deletions(-) rename src/Seeder/{ContentFixedMenuItemSeeder.php => BadasoContentFixedMenuItemSeeder.php} (84%) rename src/Seeder/{ContentMenusSeeder.php => BadasoContentMenusSeeder.php} (82%) create mode 100644 src/Seeder/BadasoContentModuleSeeder.php rename src/Seeder/{ContentPermissionsSeeder.php => BadasoContentPermissionsSeeder.php} (85%) rename src/Seeder/{ContentRolePermissionsSeeder.php => BadasoContentRolePermissionsSeeder.php} (90%) delete mode 100644 src/Seeder/ContentModuleSeeder.php diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c7289e..bb37a88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,15 +48,16 @@ After getting the license, you can proceed to Badaso installation. - Root Laravel Project - /packages (Folder Packages) - /uasoft-indonesia (Folder Uasoft Indonesia) - - badaso (Badaso Library) - - badaso-content-module (Cloud Badaso Content Manager) + - core (Badaso Core Library) + - content-module (Cloud Badaso Content Manager) - ... - ... - ... cd into uasoft-indonesia directory, then run ``` -git clone https://github.com/uasoft-indonesia/badaso-content-module.git +git clone https://github.com/uasoft-indonesia/badaso-content-module.git content-module + ``` 2. Add the following Badaso provider to ```/config/app.php```. @@ -74,14 +75,14 @@ git clone https://github.com/uasoft-indonesia/badaso-content-module.git "autoload": { "psr-4": { "App\\": "app/", - "Uasoft\\Badaso\\": "packages/uasoft-indonesia/badaso/src/", - "Uasoft\\Badaso\\Module\\Content\\": "packages/uasoft-indonesia/badaso-content-module/src/", + "Uasoft\\Badaso\\": "packages/badaso/badaso/src/", + "Uasoft\\Badaso\\Module\\Content\\": "packages/badaso/content-module/src/", }, ... } ``` -5. Copy required library from ```packages/uasoft-indonesia/badaso-content-module/composer.json``` to ```/composer.json``` then ```composer install``` +5. Copy required library from ```packages/badaso/content-module/composer.json``` to ```/composer.json``` then ```composer install``` 6. Run the following commands in sequence. ``` @@ -103,13 +104,13 @@ composer dump-autoload ``` 9. Run command ``` -php artisan db:seed --class=ContentModuleSeeder +php artisan db:seed --class=BadasoContentModuleSeeder ``` 11. Open the ```env``` file then add the following lines. ``` MIX_DEFAULT_MENU=admin -MIX_BADASO_MENU=${MIX_DEFAULT_MENU},badaso-content-module -MIX_BADASO_MODULES=badaso-content-module +MIX_BADASO_MENU=${MIX_DEFAULT_MENU},content-module +MIX_BADASO_MODULES=content-module ``` 9. In menu item "Role Management" from badaso admin panel, add permission user to fill content diff --git a/src/Seeder/ContentFixedMenuItemSeeder.php b/src/Seeder/BadasoContentFixedMenuItemSeeder.php similarity index 84% rename from src/Seeder/ContentFixedMenuItemSeeder.php rename to src/Seeder/BadasoContentFixedMenuItemSeeder.php index ef7f208..78548a7 100644 --- a/src/Seeder/ContentFixedMenuItemSeeder.php +++ b/src/Seeder/BadasoContentFixedMenuItemSeeder.php @@ -1,9 +1,8 @@ where('key', 'badaso-content-module')->first(); + $menus = \DB::table('menus')->where('key', 'content-module')->first(); $menu_id = $menus->id; $add_menus_item = [ diff --git a/src/Seeder/ContentMenusSeeder.php b/src/Seeder/BadasoContentMenusSeeder.php similarity index 82% rename from src/Seeder/ContentMenusSeeder.php rename to src/Seeder/BadasoContentMenusSeeder.php index 936d230..c4ab132 100644 --- a/src/Seeder/ContentMenusSeeder.php +++ b/src/Seeder/BadasoContentMenusSeeder.php @@ -1,9 +1,8 @@ 'badaso-content-module', + 'key' => 'content-module', 'display_name' => 'Content Manager', 'created_at' => '2021-01-01 15:26:06', 'updated_at' => '2021-01-01 15:26:06', diff --git a/src/Seeder/BadasoContentModuleSeeder.php b/src/Seeder/BadasoContentModuleSeeder.php new file mode 100644 index 0000000..cebc725 --- /dev/null +++ b/src/Seeder/BadasoContentModuleSeeder.php @@ -0,0 +1,17 @@ +call(BadasoContentPermissionsSeeder::class); + $this->call(BadasoContentRolePermissionsSeeder::class); + $this->call(BadasoContentMenusSeeder::class); + $this->call(BadasoContentFixedMenuItemSeeder::class); + } +} diff --git a/src/Seeder/ContentPermissionsSeeder.php b/src/Seeder/BadasoContentPermissionsSeeder.php similarity index 85% rename from src/Seeder/ContentPermissionsSeeder.php rename to src/Seeder/BadasoContentPermissionsSeeder.php index cdb5d3e..182e1c5 100644 --- a/src/Seeder/ContentPermissionsSeeder.php +++ b/src/Seeder/BadasoContentPermissionsSeeder.php @@ -1,9 +1,8 @@ id) ->where('permission_id', $row->id) diff --git a/src/Seeder/ContentModuleSeeder.php b/src/Seeder/ContentModuleSeeder.php deleted file mode 100644 index 3d81573..0000000 --- a/src/Seeder/ContentModuleSeeder.php +++ /dev/null @@ -1,19 +0,0 @@ -call(ContentPermissionsSeeder::class); - $this->call(ContentRolePermissionsSeeder::class); - $this->call(ContentMenusSeeder::class); - $this->call(ContentFixedMenuItemSeeder::class); - } -} diff --git a/src/resources/js/api/modules/badaso-content.js b/src/resources/js/api/modules/badaso-content.js index 661f287..066f81a 100644 --- a/src/resources/js/api/modules/badaso-content.js +++ b/src/resources/js/api/modules/badaso-content.js @@ -1,5 +1,5 @@ -import resource from "../../../../../../badaso/src/resources/js/api/resource"; -import QueryString from "../../../../../../badaso/src/resources/js/api/query-string"; +import resource from "../../../../../../core/src/resources/js/api/resource"; +import QueryString from "../../../../../../core/src/resources/js/api/query-string"; let apiPrefix = process.env.MIX_API_ROUTE_PREFIX ? "/" + process.env.MIX_API_ROUTE_PREFIX diff --git a/src/resources/js/pages/content/add.vue b/src/resources/js/pages/content/add.vue index 42d9428..13caa5c 100644 --- a/src/resources/js/pages/content/add.vue +++ b/src/resources/js/pages/content/add.vue @@ -311,7 +311,7 @@ export default { } } [temp[index], temp[index + 1]] = [temp[index + 1], temp[index]] - + tempObject = this.convertArrayToObject(temp, 'name') this.items = tempObject }, @@ -325,7 +325,7 @@ export default { } } [temp[index], temp[index - 1]] = [temp[index - 1], temp[index]] - + tempObject = this.convertArrayToObject(temp, 'name') this.items = tempObject }, From 2381d95f7f2ca54d70d05de1402ab2b9de8ef48b Mon Sep 17 00:00:00 2001 From: my4fdal Date: Thu, 8 Jul 2021 12:08:44 +0700 Subject: [PATCH 2/3] update class table html --- src/Seeder/BadasoContentFixedMenuItemSeeder.php | 1 + src/Seeder/BadasoContentMenusSeeder.php | 1 + src/Seeder/BadasoContentModuleSeeder.php | 2 ++ src/Seeder/BadasoContentPermissionsSeeder.php | 1 + src/Seeder/BadasoContentRolePermissionsSeeder.php | 1 + src/resources/js/pages/content/add.vue | 2 +- 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Seeder/BadasoContentFixedMenuItemSeeder.php b/src/Seeder/BadasoContentFixedMenuItemSeeder.php index 78548a7..e03f455 100644 --- a/src/Seeder/BadasoContentFixedMenuItemSeeder.php +++ b/src/Seeder/BadasoContentFixedMenuItemSeeder.php @@ -1,5 +1,6 @@

{{ $t("content.add.secondTitle") }}

- +
From 3955d198d91a15771112bf0b42047a32d20f3def Mon Sep 17 00:00:00 2001 From: Afdal Date: Thu, 8 Jul 2021 05:14:58 +0000 Subject: [PATCH 3/3] Apply fixes from StyleCI --- src/Seeder/BadasoContentRolePermissionsSeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Seeder/BadasoContentRolePermissionsSeeder.php b/src/Seeder/BadasoContentRolePermissionsSeeder.php index 2499793..c518c2b 100644 --- a/src/Seeder/BadasoContentRolePermissionsSeeder.php +++ b/src/Seeder/BadasoContentRolePermissionsSeeder.php @@ -23,7 +23,7 @@ public function run() $permissions = Permission::all(); - if (!is_null($administrator)) { + if (! is_null($administrator)) { foreach ($permissions as $row) { $role_permission = RolePermission::where('role_id', $administrator->id) ->where('permission_id', $row->id)
{{ $t("content.add.field.content.label.title") }}