5 Commits

Author SHA1 Message Date
sas.fajri
6d40e1c7bf C1J0ET - add icd10 stemcell validation 2026-06-25 11:17:32 +07:00
sas.fajri
46525e5622 FHM24062601CPONE - update footer branch info 2026-06-24 16:30:11 +07:00
sas.fajri
2716f15cbe FHM24062601CPONE - add branch name at footer 2026-06-24 16:28:56 +07:00
sas.fajri
8caa27b436 3Z4LPN - add git workflow guide 2026-06-24 16:28:56 +07:00
sas.fajri
9d1c478831 3Z4LPN - enable staging sync to devcpone 2026-06-24 16:28:56 +07:00
10 changed files with 213 additions and 31 deletions

View File

@@ -28,6 +28,6 @@
## Auto Sync ke Devcpone
- Repo ini punya **post-commit hook** di `.githooks/post-commit` yang otomatis menjalankan `scripts/devcpone_sync.sh`.
- Setiap `git commit` di branch `master` akan langsung rsync file yang berubah ke `devcpone.aplikasi.web.id:/home/one/project/one/one-ui/`.
- Setiap `git commit` di branch `master` atau `staging` akan langsung rsync file yang berubah ke `devcpone.aplikasi.web.id:/home/one/project/one/one-ui/`.
- Hook sudah aktif (`core.hooksPath = .githooks`), tidak perlu jalankan script deploy manual.
- Jangan bilang tidak ada hook/sync sebelum mengecek `.githooks/` dan `scripts/` terlebih dahulu.

View File

@@ -10,6 +10,6 @@
# Auto Sync ke Devcpone
- Repo ini punya **post-commit hook** di `.githooks/post-commit` yang otomatis menjalankan `scripts/devcpone_sync.sh`.
- Setiap `git commit` di branch `master` akan langsung rsync file yang berubah ke `devcpone.aplikasi.web.id:/home/one/project/one/one-ui/`.
- Setiap `git commit` di branch `master` atau `staging` akan langsung rsync file yang berubah ke `devcpone.aplikasi.web.id:/home/one/project/one/one-ui/`.
- Hook sudah aktif (`core.hooksPath = .githooks`), tidak perlu jalankan script deploy manual.
- Jangan bilang tidak ada hook/sync sebelum mengecek `.githooks/` dan `scripts/` terlebih dahulu.

163
GIT_WORKFLOW.md Normal file
View File

@@ -0,0 +1,163 @@
# Git Workflow FE_CPONE
Dokumen ini jadi patokan kerja git di repo `FE_CPONE` supaya alur branch, PR, dan upload ke `devcpone` konsisten.
## Branch Utama
- `master`
Branch final. Perubahan ke branch ini masuk lewat PR.
- `staging`
Branch testing dan integrasi sebelum masuk `master`.
- `feature/*` atau branch task
Branch kerja untuk perubahan per task, misalnya `ais_registration_sc`.
## Alur Utama
1. Buat branch kerja dari base yang benar.
2. Kerjakan perubahan di branch kerja.
3. Commit dengan format `TASKCODE - deskripsi singkat`.
4. Push branch kerja ke remote.
5. Buat PR dari branch kerja ke `staging`.
6. Setelah lolos testing, buat PR dari `staging` ke `master`.
7. Setelah merge ke `master`, sinkronkan branch lokal.
## Cara Menentukan Base Branch
- Ambil dari `master` kalau perubahan baru berdiri sendiri dan tidak butuh context terbaru di `staging`.
- Ambil dari `staging` kalau perubahan baru bergantung pada hasil kerja yang sudah masuk `staging` tetapi belum masuk `master`.
## Diagram Alur
```mermaid
flowchart LR
A[master] --> B[branch kerja / feature]
C[staging] --> D[branch kerja lanjutan]
B --> E[PR ke staging]
D --> E
E --> C
C --> F[PR ke master]
F --> A
```
## Diagram Singkat
```text
master
|
+-- branch kerja A --------------> PR ke staging
| |
| v
| staging
| |
+-- branch kerja B dari staging ----> PR ke staging
|
v
PR ke master
|
v
master
```
## Aturan Praktis
- Sebelum push atau menyiapkan merge, jalankan `git fetch origin`.
- Rebase ke base remote yang benar supaya conflict muncul lebih awal.
- Kalau target merge adalah `staging`, sync branch kerja ke `origin/staging`, bukan ke `origin/master`.
- Kalau target merge adalah `master`, sync branch kerja ke `origin/master`.
- Jangan direct push ke protected branch.
- `master` dan `staging` dipakai sebagai branch tujuan PR.
- Untuk repo ini, upload ke `devcpone` dilakukan dari commit di `master` atau `staging`.
## Patokan Sebelum Merge
- Target akhir `staging`
Branch kerja harus update dulu dari `staging`.
- Target akhir `master`
Branch kerja harus update dulu dari `master`.
Kalau `staging` dipakai paralel oleh beberapa fitur, jangan patokan ke `master` saat mau merge ke `staging`, karena bisa ada fitur lain yang sudah lebih dulu masuk `staging` tetapi belum masuk `master`.
## Contoh Skenario 1
Kasus:
- A membuat `A1`
- B membuat `B1`
- `A1` sudah merge ke `staging`
- `B1` belum butuh hasil `A1`
Patokan:
- A atau B yang kerja baru dan tidak butuh hasil `staging` terbaru bisa ambil base dari `master`.
## Contoh Skenario 2
Kasus:
- `A1` sudah merge ke `staging`
- C mau bikin `C1`
- `C1` butuh flow, API, atau komponen yang berasal dari `A1`
Patokan:
- C buat branch baru dari `staging`, bukan dari `master`.
## Contoh Alur Kerja Nyata
### 1. Kerja task baru dari `master`
```bash
git fetch origin
git checkout master
git pull --ff-only origin master
git checkout -b feature_x
```
### 2. Update branch kerja sebelum push
```bash
git fetch origin
git rebase origin/master
```
Kalau branch kerja memang berbasis `staging`, ganti target rebase ke `origin/staging`.
Kalau target merge akhirnya `staging`, contoh yang benar:
```bash
git fetch origin
git rebase origin/staging
```
Kalau target merge akhirnya `master`, contoh yang benar:
```bash
git fetch origin
git rebase origin/master
```
### 3. Commit dan push
```bash
git add <file-yang-perlu>
git commit -m "3Z4LPN - contoh perubahan"
git push -u origin feature_x
```
### 4. Merge ke `staging`
- Buat PR `feature_x` -> `staging`
- Testing di `staging`
### 5. Merge ke `master`
- Buat PR `staging` -> `master`
- Setelah merge, sync branch lokal lagi
## Sync ke Devcpone
- Hook `post-commit` menjalankan `scripts/devcpone_sync.sh`
- Commit di branch `master` atau `staging` akan upload file yang berubah di commit terakhir ke:
```text
one@devcpone.aplikasi.web.id:/home/one/project/one/one-ui/
```
- Delete file tidak ikut dihapus di remote
- Upload mengikuti file yang berubah pada commit terakhir

View File

@@ -14,7 +14,7 @@ Setelah itu:
- `core.hooksPath` akan diarahkan ke `.githooks`
- hook `post-commit` akan aktif
- commit di branch `master` akan otomatis sync ke:
- commit di branch `master` atau `staging` akan otomatis sync ke:
```text
one@devcpone.aplikasi.web.id:/home/one/project/one/one-ui/

View File

@@ -1,10 +1,10 @@
<template>
<div class="tanggal">
{{f_tanggal}}
<span class="hidden-sm-and-down" style="color:brown; margin-left:20px;font-weight:bold;font-size:16px;">
<span class="hidden-sm-and-down" style="color:#fff59d; margin-left:20px;font-weight:bold;font-size:16px;">
{{branch_name}}
</span>
<div class="visible-sm-and-down hidden-md-and-up" style="color:brown; font-weight:bold;font-size:10px;">
<div class="visible-sm-and-down hidden-md-and-up" style="color:#fff59d; font-weight:bold;font-size:10px;">
Devone <!-- {{branch_name}} -->
</div>
</div>
@@ -32,9 +32,15 @@ module.exports = {
}
,computed: {
branch_name() {
let branch = this.$store.state.system.branch
if (branch.M_BranchName == undefined) return ''
return branch.M_BranchName
try {
let retrievedObject = localStorage.getItem("user")
if (!retrievedObject) return ''
let dtuser = JSON.parse(retrievedObject)
if (dtuser.M_BranchName == undefined) return ''
return dtuser.M_BranchName
} catch(e) {
return ''
}
},
f_tanggal() {
try {

View File

@@ -5,7 +5,7 @@ repo_root=$(git rev-parse --show-toplevel)
cd "$repo_root"
branch=$(git symbolic-ref --quiet --short HEAD 2>/dev/null || true)
if [ "$branch" != "master" ]; then
if [ "$branch" != "master" ] && [ "$branch" != "staging" ]; then
exit 0
fi

View File

@@ -243,12 +243,12 @@ export async function edit(datas, id) {
}
}
export async function search_icd10(prm) {
try {
var resp = await axios.post(URL + 'patient/search_icd10', prm);
if (resp.status != 200) {
return {
status: "ERR",
export async function search_icd10(prm) {
try {
var resp = await axios.post(URL + 'order/search_icd10', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}

View File

@@ -248,24 +248,24 @@
></v-textarea>
</v-flex>
<!----<v-flex xs12 pa-1>
<v-autocomplete
label="ICD-10"
v-model="selected_icd10"
:items="icd10"
<v-flex xs12 pa-1>
<v-autocomplete
label="ICD-10"
v-model="selected_icd10"
:items="icd10"
:search-input.sync="search_icd10"
class="pb-2"
no-filter
:item-text="item => item.code + ' - ' + item.display"
item-value="code"
return-object
:loading="loading_icd10"
no-data-text="Ketikkan pencarian ICD-10"
clearable
>
</v-autocomplete>
</v-flex>-->
:loading="loading_icd10"
no-data-text="Ketikkan pencarian ICD-10"
clearable
>
</v-autocomplete>
</v-flex>
</v-flex>
</v-layout>
@@ -425,4 +425,4 @@
}
}
</script>

View File

@@ -175,6 +175,18 @@ export default {
},
actions: {
async save(context) {
let diagnosa = context.state.diagnosa ? context.state.diagnosa.trim() : ''
let selectedIcd10 = context.rootState.patient.selected_icd10 || {}
let icd10Code = selectedIcd10.code ? selectedIcd10.code.toString().trim() : ''
if (!diagnosa && !icd10Code) {
context.commit('update_in_saving', false)
context.commit('update_loading_process', false)
context.commit('update_dialog_loading', false, { root: true })
context.commit('update_message_error', 'Diagnosa atau ICD-10 wajib diisi salah satu')
context.commit('update_dialog_pop_up_error', true)
return
}
var req = [];
var detail = [];
@@ -224,9 +236,9 @@ export default {
prm.selected_patient = context.rootState.patient.selected_patient
prm.patient_age = context.rootState.patient.selected_patient.patient_age
prm.patient_note = context.state.patient_note
prm.diagnosa = context.state.diagnosa
prm.diagnosa = diagnosa
prm.catatan_fo = context.state.catatan_fo
prm.selected_icd10 = context.rootState.patient.selected_icd10
prm.selected_icd10 = selectedIcd10
prm.selected_doctor = context.rootState.doctor.selected_doctor
prm.selected_language = context.rootState.language.selected_language ? context.rootState.language.selected_language.id : 1
prm.selected_language_2 = context.rootState.language.selected_language_2 ? context.rootState.language.selected_language_2.id : 0

View File

@@ -472,9 +472,10 @@ export default {
context.commit("update_loading_icd10",false)
context.commit("update_search_error_message",resp.message)
} else {
let records = Array.isArray(resp.data) ? resp.data : (resp.data && resp.data.records ? resp.data.records : [])
context.commit("update_loading_icd10",false)
context.commit("update_search_error_message","")
context.commit("update_icd10", resp.data.records)
context.commit("update_icd10", records)
}
} catch(e) {
context.commit("update_loading_icd10",false)