Skip to content

Commit

Permalink
Merge pull request #69 from uasoft-indonesia/develop
Browse files Browse the repository at this point in the history
Prepare for release 2.0.0-rc.3
  • Loading branch information
rizkiheryandi authored Jul 8, 2021
2 parents 76187aa + f029cf9 commit 6d59b55
Show file tree
Hide file tree
Showing 17 changed files with 108 additions and 63 deletions.
19 changes: 10 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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```.
Expand All @@ -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.
```
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2.0.0-rc.2",
"name": "badaso/content-module",
"description": "Zero development for web page content system on badaso",
"version": "2.0.0-rc.3",
"description": "Manage website content content through badaso",
"keywords": [
"laravel",
"admin",
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions src/Commands/BadasoContentSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Uasoft\Badaso\Module\Content\Commands;

use Illuminate\Console\Command;
use Symfony\Component\VarExporter\VarExporter;

class BadasoContentSetup extends Command
{
Expand Down Expand Up @@ -44,6 +45,7 @@ public function handle()
$this->force = true;
}
$this->generateSeeder();
$this->hiddenTableHandle();
} catch (\Exception $e) {
$this->error($e->getMessage());
}
Expand All @@ -58,4 +60,22 @@ private function generateSeeder()

$this->call('l5-swagger:generate');
}

private function hiddenTableHandle()
{
$table_name = 'content';
$config_name_file = 'badaso-hidden-tables';
$hidden_table = config($config_name_file);
if (! in_array($table_name, $hidden_table)) {
$hidden_table[] = $table_name;
$content_config = VarExporter::export($hidden_table);
$content_config = <<<PHP
<?php
return {$content_config} ;
PHP;

file_put_contents(config_path("{$config_name_file}.php"), $content_config);
}
}
}
6 changes: 3 additions & 3 deletions src/Routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

Route::group(
[
'prefix' => $api_route_prefix,
'namespace' => 'Uasoft\Badaso\Module\Content\Controllers',
'as' => 'badaso.',
'prefix' => $api_route_prefix,
'namespace' => 'Uasoft\Badaso\Module\Content\Controllers',
'as' => 'badaso.',
'middleware' => [ApiRequest::class],
],
function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Database\Seeder;
use Uasoft\Badaso\Models\MenuItem;

class ContentFixedMenuItemSeeder extends Seeder
class BadasoContentFixedMenuItemSeeder extends Seeder
{
/**
* Auto generated seed file.
Expand All @@ -19,7 +19,7 @@ public function run()
\DB::beginTransaction();

try {
$menus = \DB::table('menus')->where('key', 'badaso-content-module')->first();
$menus = \DB::table('menus')->where('key', 'content-module')->first();
$menu_id = $menus->id;

$add_menus_item = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Database\Seeder;
use Uasoft\Badaso\Models\Menu;

class ContentMenusSeeder extends Seeder
class BadasoContentMenusSeeder extends Seeder
{
/**
* Auto generated seed file.
Expand All @@ -20,7 +20,7 @@ public function run()

try {
$new_menus = [
'key' => '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',
Expand Down
21 changes: 21 additions & 0 deletions src/Seeder/BadasoContentModuleSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Database\Seeders\Badaso\Content;

use Illuminate\Database\Seeder;

class BadasoContentModuleSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->call(BadasoContentPermissionsSeeder::class);
$this->call(BadasoContentRolePermissionsSeeder::class);
$this->call(BadasoContentMenusSeeder::class);
$this->call(BadasoContentFixedMenuItemSeeder::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Database\Seeder;
use Uasoft\Badaso\Models\Permission;

class ContentPermissionsSeeder extends Seeder
class BadasoContentPermissionsSeeder extends Seeder
{
/**
* Auto generated seed file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Uasoft\Badaso\Models\Role;
use Uasoft\Badaso\Models\RolePermission;

class ContentRolePermissionsSeeder extends Seeder
class BadasoContentRolePermissionsSeeder extends Seeder
{
/**
* Auto generated seed file.
Expand Down
4 changes: 2 additions & 2 deletions src/resources/js/api/modules/badaso-content.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/resources/js/components/BadasoContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default {
}
}
[temp[index], temp[index + 1]] = [temp[index + 1], temp[index]]
tempObject = this.convertArrayToObject(temp, 'name')
this.items.data = tempObject
},
Expand All @@ -223,7 +223,7 @@ export default {
}
}
[temp[index], temp[index - 1]] = [temp[index - 1], temp[index]]
tempObject = this.convertArrayToObject(temp, 'name')
this.items.data = tempObject
},
Expand Down Expand Up @@ -257,4 +257,4 @@ export default {
padding: 0 !important;
border-top: none !important;
}
</style>
</style>
30 changes: 16 additions & 14 deletions src/resources/js/components/BadasoContentAddField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,22 @@ export default {
},
},
},
validations: {
field: {
type: {
required,
},
label: {
required,
},
name: {
required,
alphaNum,
nonNumericOnFirstChar: nonNumericOnFirstChar(this.name)
validations() {
return {
field: {
type: {
required,
},
label: {
required,
},
name: {
required,
alphaNum,
nonNumericOnFirstChar: nonNumericOnFirstChar(this.field.name)
},
},
},
}
},
watch: {
show(val) {
Expand Down Expand Up @@ -128,4 +130,4 @@ export default {
},
},
};
</script>
</script>
11 changes: 6 additions & 5 deletions src/resources/js/components/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import BadasoContent from "./BadasoContent.vue";
import BadasoContentAddField from "./BadasoContentAddField.vue";
import BadasoContentFill from "./BadasoContentFill.vue";
import BadasoContentRead from "./BadasoContentRead.vue";
import BadasoContent from "./BadasoContent";
import BadasoContentAddField from "./BadasoContentAddField";
import BadasoContentFill from "./BadasoContentFill";
import BadasoContentRead from "./BadasoContentRead";

export default {

export default {
BadasoContent,
BadasoContentAddField,
BadasoContentFill,
Expand Down
4 changes: 2 additions & 2 deletions src/resources/js/pages/content/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export default {
}
}
[temp[index], temp[index + 1]] = [temp[index + 1], temp[index]]
tempObject = this.convertArrayToObject(temp, 'name')
this.items = tempObject
},
Expand All @@ -323,7 +323,7 @@ export default {
}
}
[temp[index], temp[index - 1]] = [temp[index - 1], temp[index]]
tempObject = this.convertArrayToObject(temp, 'name')
this.items = tempObject
},
Expand Down
32 changes: 16 additions & 16 deletions src/resources/js/pages/content/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default {
item.data = {};
}
if (event === 'text' || event === 'image') {
if (event === "text" || event === "image") {
item.data = "";
}
Expand All @@ -348,30 +348,30 @@ export default {
}
},
moveDown(index) {
const temp = []
var tempObject = {}
const temp = [];
var tempObject = {};
for (const item in this.items) {
if (Object.hasOwnProperty.call(this.items, item)) {
temp.push(this.items[item])
temp.push(this.items[item]);
}
}
[temp[index], temp[index + 1]] = [temp[index + 1], temp[index]]
tempObject = this.convertArrayToObject(temp, 'name')
this.items = tempObject
[temp[index], temp[index + 1]] = [temp[index + 1], temp[index]];
tempObject = this.convertArrayToObject(temp, "name");
this.items = tempObject;
},
moveUp(index) {
const temp = []
var tempObject = {}
const temp = [];
var tempObject = {};
for (const item in this.items) {
if (Object.hasOwnProperty.call(this.items, item)) {
temp.push(this.items[item])
temp.push(this.items[item]);
}
}
[temp[index], temp[index - 1]] = [temp[index - 1], temp[index]]
tempObject = this.convertArrayToObject(temp, 'name')
this.items = tempObject
[temp[index], temp[index - 1]] = [temp[index - 1], temp[index]];
tempObject = this.convertArrayToObject(temp, "name");
this.items = tempObject;
},
convertArrayToObject(array, key) {
const initialValue = {};
Expand All @@ -381,7 +381,7 @@ export default {
[item[key]]: item,
};
}, initialValue);
}
},
},
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/js/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
ContentManagementFill,
ContentManagementRead,
},
name: "BlogEntryIndex",
name: "ContentEntryIndex",
data: () => ({
globalComponentList: {},
defaultComponent: null,
Expand Down

0 comments on commit 6d59b55

Please sign in to comment.