Skip to content

Rendybp/bugfix/list vehicle action button#10

Merged
fdhliakbar merged 8 commits intodevfrom
rendybp/bugfix/list-vehicle-action-button
Mar 25, 2026
Merged

Rendybp/bugfix/list vehicle action button#10
fdhliakbar merged 8 commits intodevfrom
rendybp/bugfix/list-vehicle-action-button

Conversation

@rendybp
Copy link
Copy Markdown
Collaborator

@rendybp rendybp commented Mar 16, 2026

UI Fix & Feature :

  • Action button jika diklik pada 2 item terbawah / terakhir maka pop up akan muncul di atas item teresbut, bukan dibawahnya, sehingga tidak terpotong / overflowing.
  • Add feature handle click outside, sehingga saat mau menutup pop up action button tidak perlu mengklik simbol Ellipsis (...) lagi, cukup klik di luar pop up

Logic FIx :
A. Fitur Tambah Kendaraan

  1. Penyebab error saat menambahkan data kendaraan dengan beberapa data kosong (description & image) adalah di image.
    1.1. Apabila frontend tidak mengirim data image ke backend maka akan langsung gagal (so harus cek backend), sementara untuk frontend saya tambahkan logic supaya wajib memasukkan data image, biar tidak error dulu, later bisa dihapus jika backend sudah fix.
    1.2. Sedangkan untuk deskripsi, jika tidak diisi maka tidak terjadi error, so its nullable. Tetapi di kode sebelumnya, payload deskripsi sama sekali tidak ada, yang sebenarnya menyebabkan data deskripsi sama sekali tidak dikirim (tetapi sekarang sudah saya fix)

  2. Muncul error lagi padahal sudah menambahkan semua data & status toast sukses.
    Penyebab error ini terjadi karena terdapat fungsi handleAddVehicle di list-kendaraan.tsx yang mengirim payload ke API yang salah, padahal di dialog-kendaraan-tambah.tsx sudah terdapat fungsi tambah yang memanggil API juga (API yang benar), sehingga walaupun di dialog-kendaraan-tambah.tsx sukses, tetapi di list kendaraan akan error.

Disini saya sudah menghapus fungsi di file list-kendaraan.tsx tersebut, dan fungsi tambah kendaraan yang benar ada di dialog-kendaraan-tambah.tsx

B. Fitur Edit Kendaraan
Saya merefactor fungsi edit kendaraan dengan memindahkan fungsi edit dari list-kendaraan.tsx ke dialog-kendaraan-edit.tsx, sehingga kode lebih konsisten seperti halnya pada fungsi dialog tambah dan tidak perlu bolak balik parsing data antar file yang terkadang membingungkan.

Harapannya di kemudian hari tidak bingung saat debugging, karena tidak perlu berpindah pindah file, dan membuat kode di list-kendaraan.tsx menjadi lebih efektif.

fdhliakbar and others added 7 commits February 9, 2026 12:42
* feat: fetch superadmin & crete table vehicle with model

* Rendi/company management logic (#3)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* Fadhli/create vehicle for integration mx (#4)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

---------

Co-authored-by: Rendy Buana Perdana <52504900+rendybp@users.noreply.github.com>
Co-authored-by: rendybp <rendibuanap@gmail.com>
* feat: fetch superadmin & crete table vehicle with model

* Rendi/company management logic (#3)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* Fadhli/create vehicle for integration mx (#4)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

* Fadhli/create vehicle for integration mx (#7)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

* fix:  login and private route validation for super_admin role

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

---------

Co-authored-by: Rendy Buana Perdana <52504900+rendybp@users.noreply.github.com>
Co-authored-by: rendybp <rendibuanap@gmail.com>
Fixed the pop-up location of the menu button on the vehicle list page that overflowed when clicking the last item in the table.
…icle.

This feature allows users to click outside the pop-up action menu to close it.
Adding a description to the add vehicle payload. Previously, this payload had not been added at all, so it was not sent.
In the list-kendaraan.tsx file, there is a handleAddVehicle function that sends data to the wrong API, causing the second error (sending data twice). I deleted this function and focused on the add vehicle function in the dialog-kendaran-tambah.tsx.
Refactoring the vehicle edit function by moving the edit function to dialog-kendaraan-edit.tsx, just like the add vehicle function. Hopefully, this will make the code cleaner, less confusing, and easier to maintain.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tracker-fe-superadmin Ready Ready Preview, Comment Mar 16, 2026 6:47am

@rendybp rendybp closed this Mar 16, 2026
@rendybp rendybp reopened this Mar 16, 2026
@rendybp rendybp marked this pull request as ready for review March 16, 2026 06:08
Copy link
Copy Markdown
Collaborator

@fdhliakbar fdhliakbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oke, untuk handling erronya udah sesuai👍

@fdhliakbar fdhliakbar merged commit 15ba154 into dev Mar 25, 2026
2 checks passed
fdhliakbar added a commit that referenced this pull request Apr 9, 2026
* feat: fetch superadmin & crete table vehicle with model

* Rendi/company management logic (#3)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* Fadhli/create vehicle for integration mx (#4)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

* Fadhli/create vehicle for integration mx (#7)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

* fix:  login and private route validation for super_admin role

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

* Rendybp/bugfix/list vehicle action button (#10)

* Dev (#6)

* feat: fetch superadmin & crete table vehicle with model

* Rendi/company management logic (#3)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* Fadhli/create vehicle for integration mx (#4)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

---------

Co-authored-by: Rendy Buana Perdana <52504900+rendybp@users.noreply.github.com>
Co-authored-by: rendybp <rendibuanap@gmail.com>

* Dev (#9)

* feat: fetch superadmin & crete table vehicle with model

* Rendi/company management logic (#3)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* Fadhli/create vehicle for integration mx (#4)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

* Fadhli/create vehicle for integration mx (#7)

* feat: handle edit vehicle function

* fix: axios error when editing vehicle

Things that I changed :
- change all year data types into number, cuz in the backend, it required as number, not a string.
- Change the selected value text in the edit form exactly like vehicleType. Because if the text is not the same, then the item cannot be selected.

* feat: add handle delete vehicle function

* feat: implement vehicle management features including model retrieval and vehicle addition

* fix: tsconfig.app.json

* fix:  login and private route validation for super_admin role

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

---------

Co-authored-by: Rendy Buana Perdana <52504900+rendybp@users.noreply.github.com>
Co-authored-by: rendybp <rendibuanap@gmail.com>

* fix: pop up location of the menu button on the vehicle list page

Fixed the pop-up location of the menu button on the vehicle list page that overflowed when clicking the last item in the table.

* feat: add handle click outside for action button menu in the list vehicle.

This feature allows users to click outside the pop-up action menu to close it.

* fix: missing description payload in the add vehicle.

Adding a description to the add vehicle payload. Previously, this payload had not been added at all, so it was not sent.

* fix: double handle add vehicle function that cause error

In the list-kendaraan.tsx file, there is a handleAddVehicle function that sends data to the wrong API, causing the second error (sending data twice). I deleted this function and focused on the add vehicle function in the dialog-kendaran-tambah.tsx.

* refactor: handle edit vehicle

Refactoring the vehicle edit function by moving the edit function to dialog-kendaraan-edit.tsx, just like the add vehicle function. Hopefully, this will make the code cleaner, less confusing, and easier to maintain.

---------

Co-authored-by: Fadhliakbar <104522615+fdhliakbar@users.noreply.github.com>

* feat: implement device management API and UI components (#12)

- Added API functions for device management including CRUD operations.
- Created a DataTable component for displaying devices with pagination.
- Introduced pagination controls for navigating through device lists.
- Developed a dialog for adding new devices with form validation.
- Enhanced the device model and vehicle interfaces in types.
- Updated the Fuel Calibration and User Management pages with placeholders.
- Refactored the Manajemen Device page to include search functionality and error handling.

* Fadhli/device management UI (#13)

* feat: implement device management API and UI components

- Added API functions for device management including CRUD operations.
- Created a DataTable component for displaying devices with pagination.
- Introduced pagination controls for navigating through device lists.
- Developed a dialog for adding new devices with form validation.
- Enhanced the device model and vehicle interfaces in types.
- Updated the Fuel Calibration and User Management pages with placeholders.
- Refactored the Manajemen Device page to include search functionality and error handling.

* fix: unclickable vehicle search input in add device modal

Refactored the vehicle dropdown from `<Select>` to a Combobox (`<Popover>` + `<Command>`). This resolves the unclickable search input issue caused by the strict focus trap in Radix UI's Select component, allowing users to properly type and search license plates.

* fix: vehicle data not showing in dropdown

Refactored the vehicle fetching logic to resolve missing data. Replaced the `getLicensePlate` API (which requires a `companyId`) with the `getAllVehicle` API to directly fetch all vehicle data.

* feat: add edit and delete dialogs for device management

---------

Co-authored-by: rendybp <rendibuanap@gmail.com>

* feat: add vercel.yml to auto deploy in github actions

* feat: update vercel-deploy.yml

---------

Co-authored-by: Rendy Buana Perdana <52504900+rendybp@users.noreply.github.com>
Co-authored-by: rendybp <rendibuanap@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants