This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from uasoft-indonesia/develop
Merge develop to master
- Loading branch information
Showing
23 changed files
with
831 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
open_collective: badaso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
frontend: ["*.js", "*.css", "*.html", "*.vue"] | ||
backend: ["/app", "*.php"] | ||
legal: ["LICENSE*", "NOTICES*"] | ||
config: .github | ||
dependencies: ["composer.json"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
feature: feature/* | ||
enhancement: enhancement/* | ||
bugfix: bugfix/* | ||
hotfix: hotfix/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: 'Features' | ||
label: 'feature' | ||
- title: 'Enhancement' | ||
label: 'engancement' | ||
- title: 'Bug Fixes' | ||
labels: | ||
- 'bugfix' | ||
- 'hotfix' | ||
- title: 'Frontend' | ||
label: 'frontend' | ||
- title: 'Backend' | ||
label: 'backend' | ||
- title: 'Dependency Updates' | ||
label: 'dependencies' | ||
- title: 'Configs' | ||
label: 'config' | ||
- title: 'Legals' | ||
label: 'legal' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## Changes | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: PR Labeler | ||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
pr-labeler: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: TimonVS/pr-labeler-action@v3 | ||
with: | ||
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
id: analytics | ||
title: Analytics | ||
sidebar_label: Analytics | ||
--- | ||
|
||
Analytics is useful for getting site visitor information such as the number of visitors to a page, the average length of time visitors have accessed the site, etc. To use analytics on badaso, you must create [Google Analytics](https://analytics.google.com/analytics/web) account first. After that, get the View ID and Tracking ID from your analytics. | ||
|
||
Insert the View ID and Tracking ID from your analytics to .env variable `ANALYTICS_VIEW_ID` and `MIX_ANALYTICS_TRACKING_ID`. | ||
|
||
To retrieve the site visitor information, you must create a service account for your analytics and download the service-account.json file. After that, you can store it in storage directory like below. | ||
|
||
``` | ||
📦 Your Project | ||
┣ 📂 storage | ||
┃ ┣ 📂 app | ||
┃ ┃ ┣ 📂 analytics | ||
┃ ┃ ┃ ┗ 📜 service-account-crendetial.js /** Store the .json file here. **/ | ||
``` | ||
|
||
:::important | ||
You can adjust the service account credential store directory in `analytics.php` config file. | ||
::: | ||
|
||
:::important | ||
Analytics will only detect visitor from accessing generated CRUD only. | ||
::: | ||
|
||
After that you can perform queries using classes provided by spatie/laravel-analytics. If you want to know more about the queries, visit [spatie/laravel-analytics](https://github.com/spatie/laravel-analytics). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
id: plugins | ||
title: Plugins | ||
sidebar_label: Plugins | ||
--- | ||
|
||
To create a badaso plugin, you must understand how to create a laravel packages first. You can learn about it [here](https://laravelpackage.com/). | ||
|
||
## Naming | ||
|
||
Badaso plugin uses slug for naming, for example: **badaso-blog-module**. The plugin itself must be in-line with badaso core directory in order detect the plugin by badaso core, for example: | ||
|
||
``` | ||
📦 uasoft-indonesia | ||
┣ 📂 badaso | ||
┣ 📂 badaso-example-plugin /** Your plugins here **/ | ||
``` | ||
|
||
## Registering the Plugin | ||
|
||
To detect the plugin, you must include it in .env file on **MIX_BADASO_PLUGINS** variable with delimiter of comma (,) without whitespace. For example: | ||
|
||
``` | ||
MIX_BADASO_PLUGINS=badaso-blog-module,badaso-content-module | ||
``` | ||
|
||
:::important | ||
If the plugin using the menu in sidebar, you must include it in **MIX_BADASO_MENU** in order to display it with delimiter of comma (,) without whitespace. For example: | ||
|
||
``` | ||
MIX_BADASO_MENU=badaso-blog-module,badaso-content-module | ||
``` | ||
::: | ||
|
||
## Resources Directory Structure | ||
|
||
Below is the resources directory structure for plugins from badaso. | ||
|
||
``` | ||
📦 uasoft-indonesia | ||
┣ 📂 badaso | ||
┣ 📂 badaso-example-plugin | ||
┃ ┣ 📂 src | ||
┃ ┃ ┣ 📂 resources | ||
┃ ┃ ┃ ┣ 📂 js | ||
┃ ┃ ┃ ┃ ┣ 📂 api | ||
┃ ┃ ┃ ┃ ┃ ┣ 📂 modules /** Register your api helper here. **/ | ||
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📜 badaso-example.js /** Example of api helper. **/ | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js * /** This file is required. **/ | ||
┃ ┃ ┃ ┃ ┣ 📂 components | ||
┃ ┃ ┃ ┃ ┃ ┣ 📜 example-component.vue /** Example of components. **/ | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js * /** Export the components here. This file is required. **/ | ||
┃ ┃ ┃ ┃ ┣ 📂 lang | ||
┃ ┃ ┃ ┃ ┃ ┣ 📂 modules | ||
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📜 en.js /** Example of internationalization **/ | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js * /** Export the language here. This file is required. **/ | ||
┃ ┃ ┃ ┃ ┣ 📂 pages | ||
┃ ┃ ┃ ┃ ┃ ┣ 📂 example | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js /** Export the pages here. This file is required. **/ | ||
┃ ┃ ┃ ┃ ┣ 📂 router | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 routes.js * /** Export the router here. This file is required. **/ | ||
┃ ┃ ┃ ┃ ┣ 📂 store | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 badaso.js * /** Export the store here. This file is required. **/ | ||
┃ ┃ ┃ ┃ ┣ 📂 utils | ||
┃ ┃ ┃ ┃ ┃ ┗ 📜 example.js * /** Export the utils here. **/ | ||
``` | ||
|
||
:::warning | ||
Router file naming must use routes.js and file store must use badaso.js. | ||
::: | ||
|
||
:::important | ||
`*` is auto-detect by badaso core. | ||
|
||
If you want to use assets and utils, you can create assets and utils folder, but the folder only affect in your plugin scope, not badaso core scope. | ||
::: | ||
|
||
### `src\resources\js\pages\index.vue` | ||
|
||
Here is the content of index.vue in pages directory. | ||
|
||
<!--DOCUSAURUS_CODE_TABS--> | ||
<!--Vue--> | ||
```vue | ||
<template> | ||
<component | ||
v-if="globalComponentList[defaultComponent]" | ||
v-bind:is="globalComponentList[defaultComponent]" | ||
></component> | ||
<component v-else v-bind:is="defaultComponent"></component> | ||
</template> | ||
<script> | ||
import Example from "./example/index.vue"; | ||
export default { | ||
components: { | ||
// Register the pages here | ||
Example | ||
}, | ||
name: "ExamplePlugin", | ||
data: () => ({ | ||
globalComponentList: {}, | ||
defaultComponent: null, | ||
}), | ||
mounted() { | ||
const routeName = this.$route.name; | ||
const componentName = this.$caseConvert.kebab(routeName); | ||
const slug = this.$route.params ? this.$route.params.slug : ""; | ||
this.globalComponentList = this.constructor.superOptions.components; | ||
this.defaultComponent = componentName; | ||
}, | ||
methods: {}, | ||
}; | ||
</script> | ||
``` | ||
<!--END_DOCUSAURUS_CODE_TABS--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
id: version-1.0.0-analytics | ||
title: Analytics | ||
sidebar_label: Analytics | ||
original_id: analytics | ||
--- | ||
|
||
Analytics berguna untuk mendapatkan informasi pengunjung seperti jumlah pengunjung di suatu halaman, rata-rata lama pengunjung mengakses situs, dll. Untuk menggunakan analytics di badaso, Anda harus membuat akun [Google Analytics](https://analytics.google.com/analytics/web) terlebih dahulu. Setelah itu, dapatkan View ID dan Tracking ID dari analytics Anda. | ||
|
||
Masukkan View ID dan Tracking ID dari analytics Anda ke variabel .env `ANALYTICS_VIEW_ID` dan` MIX_ANALYTICS_TRACKING_ID`. | ||
|
||
Untuk mengambil informasi pengunjung situs, Anda harus membuat akun layanan untuk analytics Anda dan mengunduh file service-account.json. Setelah itu, Anda dapat menyimpannya di direktori penyimpanan seperti di bawah ini. | ||
|
||
``` | ||
📦 Your Project | ||
┣ 📂 storage | ||
┃ ┣ 📂 app | ||
┃ ┃ ┣ 📂 analytics | ||
┃ ┃ ┃ ┗ 📜 service-account-crendetial.js /** Simpan file .json disini. **/ | ||
``` | ||
|
||
:::important | ||
Anda dapat menyesuaikan direktori penyimpanan kredensial akun layanan di file konfigurasi `analytics.php`. | ||
::: | ||
|
||
:::important | ||
Analytics hanya akan mendeteksi pengunjung dari mengakses generated CRUD saja. | ||
::: | ||
|
||
Setelah itu Anda dapat melakukan query menggunakan class yang disediakan oleh spatie/laravel-analytics. Jika Anda ingin tahu lebih banyak tentang query tersebut, kunjungi [spatie/laravel-analytics](https://github.com/spatie/laravel-analytics). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.