Compare commits

..

1143 Commits

Author SHA1 Message Date
rstubryan fe5a14a764 refactor(FE): Disable invoice download feature 2026-02-04 15:06:44 +07:00
rstubryan 25a89b8987 refactor(FE): Update purchase search input UI 2026-02-04 14:16:53 +07:00
rstubryan 760e9ccd89 refactor(FE): Add invoice download and PO table columns 2026-02-04 14:13:59 +07:00
Rivaldi A N S 428d9f33d9 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!307
2026-02-04 03:35:57 +00:00
ValdiANS c3f4c9b1ec chore: remove keepPreviousData in useSWR config when fetching sapronak 2026-02-04 10:15:35 +07:00
ValdiANS 2918500585 chore: add is_approved query param when fetching project flock 2026-02-04 10:05:03 +07:00
Rivaldi A N S b48bf06f7d Merge branch 'fix/production-result-report' into 'development'
[FIX/FE] Production Result Report

See merge request mbugroup/lti-web-client!306
2026-02-03 09:50:18 +00:00
ValdiANS 2b343b893e chore: remove unncessary data and fix pagination for single selected project flock kandang 2026-02-03 16:45:49 +07:00
Rivaldi A N S 0c25751401 Merge branch 'fix/master-data-production-standard' into 'development'
[FIX/FE] Adding FCR Master Data Production Standard Growing

See merge request mbugroup/lti-web-client!305
2026-02-03 09:32:21 +00:00
randy-ar 9be5bb35c4 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/master-data-production-standard 2026-02-03 14:40:12 +07:00
randy-ar c24cf7ed1a fix(FE): adding standard fcr to growing production standard 2026-02-03 14:39:34 +07:00
Rivaldi A N S 7b398bc2ee Merge branch 'fix/adjustment-uniformity-ui' into 'development'
[FIX/FE] Adjustment Uniformity, Expense, Purchase, and Recording Page UI

See merge request mbugroup/lti-web-client!304
2026-02-03 07:35:29 +00:00
rstubryan d9ee2bc7be Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-02-03 14:22:23 +07:00
rstubryan f31eb8db59 refactor(FE): Show pending stock usage and depletions in detail 2026-02-03 14:20:32 +07:00
randy-ar 40411b0417 fix(FE): fixing total text color debt supplier 2026-02-03 14:12:08 +07:00
Rivaldi A N S fbbe5532a0 Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Fixing Line Chart in Dashboard Page

See merge request mbugroup/lti-web-client!302
2026-02-03 07:00:11 +00:00
randy-ar c102a4043c fix(FE): fixing status badge color 2026-02-03 13:40:46 +07:00
randy-ar ab694270c4 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/dashboard 2026-02-03 12:41:51 +07:00
randy-ar 0febc9d8f3 fix(FE): fixing line chart dashboard comparison 2026-02-03 12:41:22 +07:00
Rivaldi A N S 15e53d2c2d Merge branch 'fix/not-found-page-permission' into 'development'
[FIX/FE] Not Found Page

See merge request mbugroup/lti-web-client!301
2026-02-03 05:06:11 +00:00
Rivaldi A N S 0093410d5b Merge branch 'fix/closing-overhead' into 'development'
[FIX/FE] Fixing Closing Overhead Per Kandang

See merge request mbugroup/lti-web-client!300
2026-02-03 05:04:43 +00:00
ValdiANS 7f4eb2ad35 chore: remove unnecessary code 2026-02-03 12:04:28 +07:00
ValdiANS f9e00a3f4f feat: create NotFoundPage component 2026-02-03 12:03:47 +07:00
ValdiANS 2d13564538 chore: bypass 404 page 2026-02-03 12:03:24 +07:00
ValdiANS 4fef966428 chore: remove unnecessary code 2026-02-03 12:02:43 +07:00
Rivaldi A N S e29097499a Merge branch 'fix/marketing' into 'development'
[FIX/FE] Refactor UI Sales Order & Delivery Order

See merge request mbugroup/lti-web-client!299
2026-02-03 05:02:22 +00:00
ValdiANS d4c8f9bbbc feat: create not-found page in app 2026-02-03 12:00:46 +07:00
rstubryan 43afd35e54 refactor(FE): Update add buttons styling and labels 2026-02-03 11:56:25 +07:00
rstubryan 489e8a31f3 refactor(FE): Make ConfirmationModal body scrollable and sticky 2026-02-03 11:46:45 +07:00
randy-ar 12c7e56604 fix(FE): fixing line chart dashboard 2026-02-03 11:45:33 +07:00
randy-ar eb6071aaf8 fix(FE): fixing closing overhead 2026-02-03 11:37:28 +07:00
randy-ar f01765d2f8 fix(FE): fixing closing overhead per kandang 2026-02-03 11:33:58 +07:00
rstubryan e5d6be446a refactor(FE): Enable closing modals on backdrop click 2026-02-03 11:23:07 +07:00
rstubryan bb83acbe81 refactor(FE): Render previews for multiple uniformities 2026-02-03 11:11:28 +07:00
rstubryan 758a0cd9a7 refactor(FE): Update Add button styles and labels 2026-02-03 10:46:58 +07:00
rstubryan 1a938b4218 refactor(FE): Use StatusBadge instead of PillBadge 2026-02-03 10:31:16 +07:00
randy-ar e123ca9b13 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/marketing 2026-02-02 22:01:37 +07:00
randy-ar 17589cb2b4 refactor(FE): refactor UI Sales Order and Delivery Order 2026-02-02 22:00:42 +07:00
Rivaldi A N S 0c0ad04c20 Merge branch 'fix/adjustment-confirmation-modal-and-recording-form' into 'development'
[HOTFIX/FE] Adjustment Confirmation Modal with Notes Usage and Recording Form

See merge request mbugroup/lti-web-client!298
2026-02-02 08:54:41 +00:00
rstubryan d327af814f refactor(FE): Handle missing selectedRecordDate and next-day data 2026-02-02 15:13:59 +07:00
rstubryan 8637d1c2c2 refactor(FE): Handle next-day error toast visibility 2026-02-02 15:05:47 +07:00
rstubryan 68feef77fc refactpr(FE): Extract approval and rejection handlers 2026-02-02 14:43:18 +07:00
rstubryan 4dec97b57c refactor(FE): Reset approval notes when opening/closing modals 2026-02-02 14:33:48 +07:00
rstubryan d776c73a03 refactor(FE): Add onClose handler and improve button behavior 2026-02-02 14:32:40 +07:00
rstubryan dc26da7404 refactor(FE): Remove next-day duplicate recording check 2026-02-02 12:11:24 +07:00
rstubryan 2425316fea refactor(FE): Exclude already selected products from options 2026-02-02 11:54:19 +07:00
Rivaldi A N S ff2e0ed114 Merge branch 'fix/adjustment-status-badge' into 'development'
[FIX/FE] Adjustment Usage of Status Badge (Recording, Purchase)

See merge request mbugroup/lti-web-client!297
2026-02-02 04:37:37 +00:00
kris 0efae3089d Update .gitlab-ci.yml file 2026-02-02 04:35:36 +00:00
rstubryan 1a9f5424a5 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-02-02 11:18:52 +07:00
Rivaldi A N S e169068e1c Merge branch 'fix/daily-checklist-permission' into 'development'
[FIX/FE] Daily Checklist Permission

See merge request mbugroup/lti-web-client!296
2026-02-02 04:14:06 +00:00
rstubryan 85556c0db0 refactor(FE): Use Color type for badge color typings 2026-02-02 11:10:58 +07:00
ValdiANS 7ac92ff451 chore: implement permission guard for approve/reject button 2026-02-02 10:59:44 +07:00
kris 448cf5ceae Update .gitlab-ci.yml file 2026-02-02 03:57:20 +00:00
ValdiANS 995d20bdf3 chore: implement permission guard for edit, approve/reject, and delete button 2026-02-02 10:54:34 +07:00
rstubryan 3ca4b324d3 refactor(FE): Unify status badge logic and use StatusBadge 2026-02-02 10:46:20 +07:00
kris 8fa2a444f0 Update .gitlab-ci.yml file 2026-02-02 03:42:31 +00:00
rstubryan 4a1464185b refactor(FE): Replace approval history modal with status badge 2026-02-02 10:30:34 +07:00
randy-ar a57f65a420 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/marketing 2026-01-31 13:16:37 +07:00
randy-ar 70bb40d4f2 fix(FE): refactor sales order form create 2026-01-31 13:15:47 +07:00
Rivaldi A N S 66c8f67245 Merge branch 'hotfix/permission-guard' into 'development'
[HOTFIX/FE] Permission Guard

See merge request mbugroup/lti-web-client!293
2026-01-30 09:57:50 +00:00
ValdiANS 5b167db6c3 chore: add permission for transfer to laying 2026-01-30 16:55:32 +07:00
ValdiANS c6b9ed4f12 hotfix: add permission guard in transfer to laying page 2026-01-30 16:54:19 +07:00
Rivaldi A N S 9928997dd8 Merge branch 'fix/adjustment-uniformity-ui' into 'development'
[FIX/FE] Adjusment Pixel Perfect Uniformity UI

See merge request mbugroup/lti-web-client!289
2026-01-30 09:21:31 +00:00
randy-ar d92a63db41 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/marketing 2026-01-30 15:54:25 +07:00
randy-ar 73319bbdfa fix(FE): fixing pixel perfect marketing table 2026-01-30 15:53:51 +07:00
rstubryan d12374e5d9 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 15:43:29 +07:00
Rivaldi A N S 507cf710e1 Merge branch 'hotfix/permission-guard' into 'development'
[HOTFIX/FE] Permission Guard

See merge request mbugroup/lti-web-client!290
2026-01-30 08:43:00 +00:00
ValdiANS 8ce72b21e1 chore: update permissions for /report/marketing 2026-01-30 15:39:16 +07:00
ValdiANS 92cc082c54 chore: use localized language 2026-01-30 15:39:04 +07:00
ValdiANS 24f2b94bb8 feat: update menu permissions 2026-01-30 15:38:12 +07:00
rstubryan 67cf459216 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 15:04:24 +07:00
rstubryan e3a2b41342 refactor(FE): Replace Badge with StatusBadge and cleanup utils 2026-01-30 14:55:11 +07:00
Rivaldi A N S fcea485286 Merge branch 'fix/transfer-context' into 'development'
[FIX/FE] Transfer Context

See merge request mbugroup/lti-web-client!288
2026-01-30 07:48:53 +00:00
rstubryan 0b7ff6f3f1 refactor(FE): Use accessorKey/styled headers and remove dead code 2026-01-30 14:44:29 +07:00
ValdiANS 190792affe chore: format license plate number 2026-01-30 14:44:26 +07:00
rstubryan 0a81790049 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 14:37:05 +07:00
rstubryan b9b02f285f refactor(FE): Refine Uniformity table headers and layout 2026-01-30 14:36:36 +07:00
ValdiANS d3be683b69 chore: add transfer_context query when fetching source project flock 2026-01-30 14:35:21 +07:00
ValdiANS 2c27b2e41d chore: add transfer_context query when fetching source warehouse 2026-01-30 14:34:48 +07:00
rstubryan 8b0dd6deea refactor(FE): Set xl min height to 72 for Uniformity chart 2026-01-30 14:16:22 +07:00
rstubryan a5613980c0 refactor(FE): Update UniformityGaugeChart styles 2026-01-30 14:13:38 +07:00
Rivaldi A N S 12a02cd15d Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!287
2026-01-30 07:00:12 +00:00
ValdiANS aecf470173 chore: add max size and bottom label for file input in daily checklist form 2026-01-30 13:57:17 +07:00
rstubryan 64bd57cad4 refactor(FE): Reduce info icon size to 15 2026-01-30 13:50:21 +07:00
rstubryan ae0d03ddc0 refactor(FE): Reduce info icon size to 15 2026-01-30 13:49:47 +07:00
rstubryan 2a12bc4ba4 refactor(FE): Tweak spacing and icon size in uniformity form 2026-01-30 13:48:04 +07:00
rstubryan ace3018539 refactor(FE): Add bottom margin to Informasi Umum heading 2026-01-30 13:40:19 +07:00
rstubryan fbf7cb2d21 refactor(FE): Wrap table headers in styled span 2026-01-30 13:37:13 +07:00
rstubryan c0b1da89f1 refactor(FE): Standardize button styles in uniformity forms 2026-01-30 13:32:07 +07:00
rstubryan 4b0397903d refactor(FE): Adjust file upload label styling 2026-01-30 13:27:11 +07:00
Rivaldi A N S 48a7cd168a Merge branch 'hotfix/permission-guard' into 'development'
[HOTFIX/FE] Permission Guard

See merge request mbugroup/lti-web-client!285
2026-01-30 06:26:19 +00:00
rstubryan 93b2496f55 refactor(FE): Adjust spacing in UniformityForm 2026-01-30 13:25:08 +07:00
ValdiANS 15c167d24d fix: add permission for Penjualan and Keuangan menu 2026-01-30 13:24:08 +07:00
rstubryan 8947d48a43 refactor(FE): Adjust spacing and border in UniformityForm 2026-01-30 13:20:04 +07:00
rstubryan 3de19d495e Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 13:19:06 +07:00
Rivaldi A N S 8bf0f067bb Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist Enhancement

See merge request mbugroup/lti-web-client!284
2026-01-30 04:49:13 +00:00
ValdiANS 970278f684 chore: sort activity and employee name 2026-01-30 11:46:29 +07:00
ValdiANS 99f8e5dcf3 chore: add validation in phase selection and sort activity and employee name 2026-01-30 11:45:50 +07:00
Adnan Zahir d40d352418 Merge branch 'fix/debt-supplier' into 'development'
[FIX/FE] Pixel Perfect Report Finance Debt Supplier & Customer Supplier

See merge request mbugroup/lti-web-client!282
2026-01-30 11:26:51 +07:00
randy-ar 359cdb2534 fix(FE): adding margin on data state skeleton 2026-01-30 11:24:42 +07:00
randy-ar 8a64780135 fix(FE): adding margin on data state skeleton 2026-01-30 11:20:47 +07:00
ValdiANS 7956ce5b6f fix: issue when selecting all phase and employee 2026-01-30 11:18:39 +07:00
rstubryan 8babb4e3d7 refactor(FE): Use className props for drawer widths 2026-01-30 11:05:38 +07:00
ValdiANS de8fda9360 fix: reset input error when dialog is closed 2026-01-30 11:03:17 +07:00
randy-ar 3b7836c8ba Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/debt-supplier 2026-01-30 11:03:04 +07:00
randy-ar ba1d462a0a fix(FE): adding skeleton state data on null or unfiltered 2026-01-30 11:02:18 +07:00
rstubryan b2670f76bf Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 10:52:54 +07:00
rstubryan 89f711241d refactor(FE): Remove left chart margin and lower min-height 2026-01-30 10:49:17 +07:00
Adnan Zahir 352688054e Merge branch 'fix/adjustment-uniformity-ui' into 'development'
[FIX/FE] Pixel Perfect Uniformity UI

See merge request mbugroup/lti-web-client!279
2026-01-30 10:44:22 +07:00
rstubryan 06c4631ca5 refactor(FE): Refactor filter modal into form and adjust UI 2026-01-30 10:37:11 +07:00
rstubryan 2b6676b4eb Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 10:17:13 +07:00
rstubryan 14c208f494 refactor(FE): Add border class to UniformityChart cards 2026-01-30 10:15:07 +07:00
rstubryan 27ab373ebb refactor(FE): Add subtle border to UniformityChart cards 2026-01-30 10:14:13 +07:00
Rivaldi A N S ab4e9fbd39 Merge branch 'fix/refresh-session-issue' into 'development'
[FIX/FE] Refresh Session Issue

See merge request mbugroup/lti-web-client!281
2026-01-30 03:08:55 +00:00
ValdiANS dd586f07d2 fix: only refresh session when user data is available 2026-01-30 10:03:03 +07:00
rstubryan 9d70f94b33 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-30 09:58:34 +07:00
rstubryan 5ebeeeedb3 refactor(FE): Make UniformityBarChartSkeleton more responsive 2026-01-30 09:56:30 +07:00
rstubryan a9ff4579b0 refactor(FE): Adjust 2xl grid layout in UniformityChart 2026-01-30 09:46:10 +07:00
rstubryan a1fe08fdeb refactor(FE): Use text-base for UniformityChart headings 2026-01-30 09:38:38 +07:00
rstubryan fc81fa9ad3 refactor(FE): Fix bg class syntax in uniformity skeletons 2026-01-30 09:22:52 +07:00
randy-ar e980320d00 fix(FE): fixing report finance filter ui 2026-01-29 20:59:16 +07:00
randy-ar 5509f52464 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/debt-supplier 2026-01-29 20:19:25 +07:00
randy-ar 0ed6c246b1 fix(FE): fix badge and table pdf 2026-01-29 20:18:42 +07:00
randy-ar c7818cefbb fix(FE): adjust ui debt supplier pixel perfect figma 2026-01-29 18:24:43 +07:00
Rivaldi A N S b004877584 Merge branch 'fix/adjustment-transfer-stock-form' into 'development'
[HOTFIX/FE] Require Delivery Fields if Supplier Chosen

See merge request mbugroup/lti-web-client!280
2026-01-29 10:30:29 +00:00
rstubryan a51a020dfa refactor(FE): Replace Button with static icon tiles in skeletons 2026-01-29 17:07:56 +07:00
rstubryan a3670271de Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-29 16:54:09 +07:00
rstubryan adaac46236 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-transfer-stock-form 2026-01-29 16:53:47 +07:00
Rivaldi A N S 49e843f3b2 Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Fixing UI Dashboard

See merge request mbugroup/lti-web-client!277
2026-01-29 09:38:30 +00:00
randy-ar b9ed7df063 fix(FE): fixing rounded value 2026-01-29 16:33:02 +07:00
rstubryan 60d5551dff fix(FE): Require delivery fields if supplier chosen 2026-01-29 16:17:57 +07:00
rstubryan db33247d6c refactor(FE): Use English copy for bulk reject modal 2026-01-29 15:41:05 +07:00
rstubryan aab8e0c5ce refactor(FE): Remove unused imports and accessorKey props 2026-01-29 15:37:53 +07:00
rstubryan 6c6634fa1d refactor(FE): Rename column header 'No' to 'Number' 2026-01-29 15:35:32 +07:00
rstubryan e93a9c8011 refactor(FE): Add divider above Next button in UniformityForm 2026-01-29 15:33:00 +07:00
rstubryan b8031448ff refactor(FE): Adjust checkbox alignment and column padding 2026-01-29 15:24:30 +07:00
randy-ar c63df91e08 fix(FE): fixing rounded value 2026-01-29 15:10:18 +07:00
rstubryan 0e43957e6e refactor(FE): Replace Badge with StatusBadge in uniformity views 2026-01-29 14:58:09 +07:00
rstubryan dada6a542f refactor(FE): Add badge color helpers for status and weight 2026-01-29 14:57:25 +07:00
randy-ar b305d43ce6 fix(FE): fixing classname using dynamic value 2026-01-29 14:56:52 +07:00
randy-ar 8d5b195691 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/dashboard 2026-01-29 14:51:40 +07:00
randy-ar 6c2baca807 fix(FE): fixing classname using dynamic value 2026-01-29 14:50:16 +07:00
rstubryan d9a1d340bb refactor(FE): Reduce vertical spacing in Uniformity components 2026-01-29 14:32:52 +07:00
rstubryan 8511a75842 refactor(FE): Refactor uniformity drawer styles and layout 2026-01-29 14:24:58 +07:00
rstubryan 4452b6fd03 refactor(FE): Add spacing to UniformityTableSkeleton 2026-01-29 14:10:36 +07:00
rstubryan 1ed83351e0 refacto(FE): Refine UniformityTableSkeleton styles and icon 2026-01-29 14:09:38 +07:00
rstubryan 9817864c3d refactor(FE): Reduce UniformityBarChartSkeleton min height 2026-01-29 14:04:35 +07:00
rstubryan 564d6d0da1 refactor(FE): Add wrapperContent and refactor uniformity charts 2026-01-29 13:58:42 +07:00
rstubryan 2c8160f816 refactor(FE): Add padding to UniformityChart card bodies 2026-01-29 12:00:10 +07:00
rstubryan 23402370b8 refactor(FE): Add rounded corners to uniformity components 2026-01-29 11:57:44 +07:00
rstubryan e3d929435a refactor(FE): Refine empty-state styling in uniformity skeletons 2026-01-29 11:53:06 +07:00
rstubryan ef3797e724 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-uniformity-ui 2026-01-29 11:31:33 +07:00
Rivaldi A N S cddb1422f6 Merge branch 'fix/adjustment-transfer-stock-form' into 'development'
[FIX/FE] Adjustment Transfer Stock Form and Adjustment Select Option

See merge request mbugroup/lti-web-client!278
2026-01-29 04:30:47 +00:00
rstubryan f28aeda74c refactor(FE): Move Error List Alert below form fields 2026-01-29 11:29:19 +07:00
rstubryan 75dfd96934 refactor(FE): Replace Badge with simple span and rename adornment prop 2026-01-29 11:09:30 +07:00
rstubryan 079d69dffb refactor(FE): Simplify SelectInput control styling 2026-01-29 11:05:06 +07:00
rstubryan 711536975c refactor(FE): Apply innerProps and className to CustomControl 2026-01-29 10:58:49 +07:00
rstubryan 97bf785fe9 refactor(FE): Support inputPrefix/inputSuffix on SelectInput 2026-01-29 10:27:47 +07:00
ValdiANS dce913815e chore: adjust styling in Dashboard related components 2026-01-29 10:23:58 +07:00
rstubryan 737d8e943c refactor(FE): Make delivery fields nullable and optional 2026-01-29 09:48:43 +07:00
rstubryan 0bdf27de2c refactor(FE): Make delivery fields optional in movement types 2026-01-29 09:47:30 +07:00
randy-ar 9cff99cba9 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/dashboard 2026-01-28 17:56:35 +07:00
randy-ar 46cfc2539e fix(FE): remove unused import 2026-01-28 17:55:57 +07:00
randy-ar 34f93f8dcc fix(FE): refactor UI Dashboard pixel perfect figma 2026-01-28 17:54:55 +07:00
rstubryan 1a800a1157 refactor(FE): Refine drawer header and uniformity form styles 2026-01-28 16:14:26 +07:00
rstubryan 3c96855b86 refactor(FE): Replace Card with section in UniformityTable 2026-01-28 15:59:18 +07:00
rstubryan 607bf28121 refactor(FE): Refactor Uniformity header and add filter badge 2026-01-28 15:10:36 +07:00
rstubryan d8361be28f refactor(FE): Replace UniformityTable with Uniformity page 2026-01-28 14:45:48 +07:00
Rivaldi A N S 031d51947a Merge branch 'fix/error-list-position' into 'development'
[FIX/FE] Adjust Error List Position to Bottom

See merge request mbugroup/lti-web-client!276
2026-01-28 07:27:41 +00:00
rstubryan 554037bfe5 refactor(FE): Move expense form error alerts below fields 2026-01-28 14:20:41 +07:00
rstubryan 9f93200bd5 refactor(FE): Move form error alerts to bottom of forms 2026-01-28 14:14:44 +07:00
Rivaldi A N S 70fcbf795b Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Refactor Prefix and Suffix Size Based on Latest Field Input

See merge request mbugroup/lti-web-client!275
2026-01-28 06:59:03 +00:00
rstubryan 406befc21b refactor(FE): Refine input component styles and error UI 2026-01-28 13:43:46 +07:00
Rivaldi A N S 558f219e8b Merge branch 'dev/hotfix/restu' into 'development'
[HOTFIX/FE] Fix Edit Realization Restriction Issue Based on Approval Line

See merge request mbugroup/lti-web-client!273
2026-01-28 06:07:37 +00:00
rstubryan 8671f37ada refactor(FE): Treat kandang_id as optional and use expense id 2026-01-28 12:19:36 +07:00
rstubryan 15dc04bb95 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-28 11:58:13 +07:00
Rivaldi A N S f801378ad2 Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!272
2026-01-28 04:52:44 +00:00
rstubryan 73e8697097 refactor(FE): Allow editing at approval steps 5 and 6 2026-01-28 11:51:07 +07:00
ValdiANS b3f6f36c00 fix: reset employee when changing phase 2026-01-28 11:50:55 +07:00
Rivaldi A N S b9c4f44e3f Merge branch 'feat/create-pdf-component' into 'development'
[FEAT/FE] Create PDF Table Component

See merge request mbugroup/lti-web-client!270
2026-01-28 04:39:33 +00:00
rstubryan 5a7b750203 chore(FE): Remove PdfContainer component 2026-01-28 11:24:22 +07:00
rstubryan bb30b6cb21 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/create-pdf-component 2026-01-28 11:22:59 +07:00
rstubryan 0cc857378f refactor(FE): Add icons to PurchasesPerSupplierTab controls 2026-01-28 11:18:51 +07:00
rstubryan e68e5a6d51 refactor(FE): Refine Purchases per Supplier styles and page size 2026-01-28 11:10:37 +07:00
rstubryan c20b1c5942 refactor(FE): Refactor PDF exports to use PdfTable 2026-01-28 11:04:06 +07:00
rstubryan 0a5efbe383 refactor(FE): Omit right border for last PDF table column 2026-01-28 11:03:17 +07:00
Rivaldi A N S 2e769b234d Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!269
2026-01-28 03:30:50 +00:00
ValdiANS f87736154a fix: only fetch initial value if the modal action is action for form 2026-01-28 10:29:15 +07:00
rstubryan ca0d379c2c refactor(FE): Rename initialBalanceRow to firstRow 2026-01-28 10:00:01 +07:00
Rivaldi A N S 87492876e5 Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!267
2026-01-28 02:56:58 +00:00
rstubryan 3d8d0d9e4d feat(FE): Add PDF table index exports 2026-01-28 09:50:13 +07:00
rstubryan 956f1ce500 refactor(FE): Refactor PdfTable to use PdfThead/PdfTbody/PdfTfoot 2026-01-28 09:49:26 +07:00
ValdiANS a11b648bf9 Merge branch 'development' into fix/daily-checklist 2026-01-28 09:42:16 +07:00
ValdiANS 31581e963f fix: set empty daily checklist phase if phase is not selected 2026-01-28 09:39:32 +07:00
rstubryan c63882fbd7 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/create-pdf-component 2026-01-28 09:14:49 +07:00
Rivaldi A N S ab84f59929 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!266
2026-01-27 12:00:09 +00:00
ValdiANS 5fe0236686 feat: implement export to excel 2026-01-27 18:58:47 +07:00
ValdiANS 8f6597e7df feat: add exportToExcel method 2026-01-27 18:58:03 +07:00
Rivaldi A N S c4f4775a48 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!265
2026-01-27 11:21:43 +00:00
ValdiANS 81e5a180ba feat: create ProjectFlockMaxQuantity type 2026-01-27 18:18:15 +07:00
ValdiANS 1d65cf0d08 feat: create getMaxTargetQty and getMappedFlockKandangsMaxTargetQty method 2026-01-27 18:18:06 +07:00
ValdiANS 4ef5ee7142 fix: get real max quantity in target project flock kandang 2026-01-27 18:17:50 +07:00
ValdiANS 19a90c9045 feat: add search input 2026-01-27 18:17:34 +07:00
ValdiANS fcbb34624d fix: get real max quantity in target project flock kandang 2026-01-27 18:17:13 +07:00
ValdiANS 68ccb66e5c chore: update TextInput styling 2026-01-27 18:16:41 +07:00
ValdiANS a094eb94a5 chore: render see more button conditionally 2026-01-27 18:16:34 +07:00
rstubryan 4db2bc187a Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/create-pdf-component 2026-01-27 18:15:31 +07:00
Rivaldi A N S e8ff69b43f Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!264
2026-01-27 10:06:20 +00:00
ValdiANS b03a47ddc6 refactor: delete unnecessary page and component 2026-01-27 17:03:06 +07:00
Rivaldi A N S 62a78b8619 Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Change Required Field to Optional on Delivery Supplier Field (Transfer Stock)

See merge request mbugroup/lti-web-client!263
2026-01-27 10:02:42 +00:00
ValdiANS 7f43ef6c56 chore: adjust Approvals type 2026-01-27 16:59:32 +07:00
ValdiANS 51ad37cc48 feat: add getApprovalLineHistory method 2026-01-27 16:59:19 +07:00
ValdiANS 9a00d4b98e refactor: adjust APPROVAL_WORKFLOWS structure 2026-01-27 16:59:10 +07:00
ValdiANS 6528899aaf chore: adjust maxTotalQuantity error message 2026-01-27 16:58:48 +07:00
ValdiANS f94c8ba799 chore: adjust detail link and add transfer_number column 2026-01-27 16:58:37 +07:00
ValdiANS df4b513739 chore: add required mark 2026-01-27 16:58:15 +07:00
ValdiANS 50477d0850 feat: create TransferToLayingDetailModal component 2026-01-27 16:57:46 +07:00
ValdiANS 79f0e2b7b7 chore: add loading state for table 2026-01-27 16:57:35 +07:00
ValdiANS 63c3818766 chore: update TextInput styling 2026-01-27 16:57:18 +07:00
ValdiANS f6a360ee2b chore: update TextArea styling 2026-01-27 16:57:05 +07:00
ValdiANS aa39478318 feat: create ApprovalStepsV2 component 2026-01-27 16:56:57 +07:00
ValdiANS 02fbd677fc chore: add readOnly prop and adjust SelectInput styling 2026-01-27 16:54:44 +07:00
ValdiANS 98608576b9 chore: adjust DateInput styling 2026-01-27 16:53:17 +07:00
ValdiANS 80d9dd689a feat: add TransferToLayingDetailModal component in Transfer to Laying page 2026-01-27 16:53:04 +07:00
ValdiANS 0d1907f729 chore: update base content and warning color 2026-01-27 16:52:46 +07:00
rstubryan 3aab90d3d6 refactor(FE): Remove min validation on supplier_id 2026-01-27 16:27:09 +07:00
rstubryan 6f96f20b49 refactor(FE): Format PdfTfoot props and inline Text 2026-01-27 16:24:43 +07:00
rstubryan 142ce7fe3a feat(FE): Add PDF table components for report export 2026-01-27 16:23:29 +07:00
Rivaldi A N S b7085f5d2a Merge branch 'fix/adjustment-transfer-stock' into 'development'
[FIX/FE] Adjustment Transfer Stock's Issues and Purchase Table

See merge request mbugroup/lti-web-client!262
2026-01-27 06:44:36 +00:00
rstubryan 628facb23d Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-27 13:23:51 +07:00
rstubryan 27c112e479 refactor(FE): Use index-only keys for product/delivery rows 2026-01-27 12:01:53 +07:00
Rivaldi A N S b19340536a Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!260
2026-01-26 15:30:22 +00:00
ValdiANS 163d225dba fix: set limit to 100 when fetching phase activities 2026-01-26 22:28:49 +07:00
Rivaldi A N S f07db1be7a Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!259
2026-01-26 15:23:25 +00:00
ValdiANS 4323040bd3 feat: use TransferToLayingConfirmationModal and remove unnecessary code 2026-01-26 22:21:11 +07:00
ValdiANS 97a753133e chore: adjust secondayButton onClick 2026-01-26 22:20:19 +07:00
ValdiANS 273810804d chore: adjust secondayButton onClick 2026-01-26 22:20:03 +07:00
ValdiANS 2be417ac0a chore: set error in input and use TransferToLayingConfirmationModal component 2026-01-26 21:23:55 +07:00
ValdiANS f98e9d6930 feat: create TransferToLayingConfirmationModal component 2026-01-26 21:22:57 +07:00
rstubryan 4c336f81c7 refactor(FE): Allow supplier to be optional in movement form 2026-01-26 21:21:40 +07:00
ValdiANS 1389cb7ed6 chore: render button only if primary or secondary button is used 2026-01-26 20:57:50 +07:00
ValdiANS a7958166bf chore: change circle success color 2026-01-26 20:57:27 +07:00
ValdiANS 34f01abb32 chore: add new props (withPagination, getRowCanExpand, renderSubComponent, expanded, and getSubRows) 2026-01-26 20:57:05 +07:00
ValdiANS 66c537ec10 chore: change loading text to loading spinner 2026-01-26 20:56:12 +07:00
rstubryan 2847f50bf7 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-26 17:32:49 +07:00
rstubryan 7b4d69b0b0 refactor(FE): Clarify duplicate recording error message 2026-01-26 16:48:16 +07:00
Rivaldi A N S 37ab614a97 Merge branch 'fix/finance' into 'development'
[FIX/FE] Adding Select Input Injection Type for Negative or Positive Value

See merge request mbugroup/lti-web-client!257
2026-01-26 09:16:38 +00:00
randy-ar 7c73e8e5c6 fix(FE): fixing negative value in index table 2026-01-26 16:13:43 +07:00
randy-ar 85f4a5deaa fix(FE): adding select injection type for positive and negative value 2026-01-26 16:08:23 +07:00
rstubryan 4011d26193 refactor(FE): Make approval and action buttons responsive 2026-01-26 13:45:32 +07:00
rstubryan afb0c40fd2 refactor(FE): Add Status Approval column to PurchaseTable 2026-01-26 13:37:06 +07:00
rstubryan 2a03eae8a2 refactor(FE): Remove section padding on small+ screens 2026-01-26 13:35:45 +07:00
rstubryan e9238e2bb5 feat(FE): Persist search in UI store and reset on exit 2026-01-26 11:45:57 +07:00
Rivaldi A N S 40eaa729ef Merge branch 'fix/adjustment-recording-and-uniformity' into 'development'
[FIX/FE] Adjustment Recording, Uniformity and Transfer Stock

See merge request mbugroup/lti-web-client!256
2026-01-26 04:09:42 +00:00
rstubryan 47e51e0105 refactor(FE): Remove redundant input bg class from TextInputs 2026-01-26 09:51:37 +07:00
rstubryan 56326cc8d2 refactor(FE): Disable product select until kandang chosen 2026-01-26 09:41:50 +07:00
rstubryan 860a2d988e Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-26 09:26:34 +07:00
Rivaldi A N S 79701fbcfe Merge branch 'hotfix/finance' into 'development'
[HOTFIX/FE] Fixing Injection Balance Negative value

See merge request mbugroup/lti-web-client!255
2026-01-26 01:44:07 +00:00
rstubryan 8b1e43cdb9 refactor(FE): Set week using chick_in_date and earliest record 2026-01-25 18:00:53 +07:00
rstubryan 4768a7d6fd Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-25 17:46:05 +07:00
randy-ar caba77d871 fix(FE): fixing bank undefined in detail page 2026-01-25 14:11:47 +07:00
randy-ar 37c0c1cf42 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into hotfix/finance 2026-01-24 14:53:57 +07:00
randy-ar 1d06c6f02a fix(FE): fixing injection payload negative not send properly 2026-01-24 14:52:54 +07:00
Rivaldi A N S ae206b9426 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!252
2026-01-24 07:03:07 +00:00
ValdiANS d3d3859021 fix: set different key in useSWR for getting flockSourceKandangsAvailability 2026-01-24 14:01:39 +07:00
Rivaldi A N S 447ef81871 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!251
2026-01-24 06:35:57 +00:00
ValdiANS 2507f733fb chore: fetch flock source kandang available qty in TransferToLayingFormModal 2026-01-24 13:35:09 +07:00
rstubryan 2d6e8480f5 refactor(FE): Show detailed stock usage and remove limit check 2026-01-24 13:27:17 +07:00
Rivaldi A N S 9d0fdb346d Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!250
2026-01-24 06:11:43 +00:00
ValdiANS 08f3372b46 chore: access available_qty optionally 2026-01-24 13:10:51 +07:00
rstubryan 6307cdc0dc refactor(FE): Send selected record date to next-day API 2026-01-24 12:53:54 +07:00
rstubryan 52213fc8c4 refactor(FE): Add optional location and flock ids 2026-01-24 12:51:01 +07:00
Rivaldi A N S 826e83b025 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!247
2026-01-24 05:50:00 +00:00
ValdiANS c300bdcb0f fix: adjust wording 2026-01-24 12:49:16 +07:00
Rivaldi A N S 84a7b0e50f Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!246
2026-01-24 05:47:12 +00:00
ValdiANS 839bf4daac fix: get flock source data if ID exist in query 2026-01-24 12:45:38 +07:00
ValdiANS 38955b96de chore: show Bank name conditionally 2026-01-24 12:29:23 +07:00
Rivaldi A N S 542992eaab Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer To Laying

See merge request mbugroup/lti-web-client!245
2026-01-24 04:24:04 +00:00
ValdiANS 982d0294b6 Merge branch 'development' into fix/transfer-to-laying 2026-01-24 11:22:48 +07:00
ValdiANS 42ebf1015f chore: adjust getFilledTransferToLayingFormInitialValues function to set max quantity for flock destination kandang 2026-01-24 11:21:31 +07:00
ValdiANS 4991b1160f chore: remove unnecessary code and adjust edit link 2026-01-24 11:21:02 +07:00
ValdiANS 71a430c99c feat: create TransferToLayingFormModal component 2026-01-24 11:20:24 +07:00
ValdiANS db1e224c3b chore: adjust TextInput styling 2026-01-24 11:20:11 +07:00
ValdiANS bb74b90790 chore: adjust TextArea styling 2026-01-24 11:19:58 +07:00
ValdiANS a890ed571b chore: adjust SelectInputRadio styling 2026-01-24 11:19:50 +07:00
ValdiANS 2d81b0dfba chore: adjust DateInput styling 2026-01-24 11:19:41 +07:00
ValdiANS ab390ab461 feat: add className prop 2026-01-24 11:19:33 +07:00
ValdiANS 335b254a60 feat: add onBackdropClick and position prop 2026-01-24 11:19:24 +07:00
ValdiANS 5e53f8764e chore: update href type 2026-01-24 11:19:04 +07:00
ValdiANS f0051b58bb feat: add TransferToLayingFormModal in Transfer To Laying page 2026-01-24 11:18:52 +07:00
rstubryan 8c73a8f61a refactor(FE): Include selected record date in next-day API 2026-01-24 11:17:13 +07:00
Rivaldi A N S 6636648813 Merge branch 'fix/purchase-limitation' into 'development'
[FIX/FE] Fix Limitation on useSelect (Purchase Request)

See merge request mbugroup/lti-web-client!242
2026-01-24 02:13:07 +00:00
rstubryan 151af5707d refactor(FE): Enable supplier select infinite loading 2026-01-24 09:10:40 +07:00
rstubryan 716f064858 refactor(FE): Limit supplier useSelect results to 100 2026-01-24 09:03:19 +07:00
Rivaldi A N S be87bc7c1d Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Hotfix Issues on Transfer Stock, Customer Control Payment and Uniformity

See merge request mbugroup/lti-web-client!241
2026-01-24 01:26:39 +00:00
ValdiANS 111531b803 Merge branch 'development' into fix/transfer-to-laying 2026-01-23 23:07:51 +07:00
ValdiANS d59cf359ee chore: adjust TransferToLayingsTable component styling 2026-01-23 23:05:09 +07:00
ValdiANS 2f7ae0ae66 feat: create TransferToLayingFilter type 2026-01-23 23:04:18 +07:00
ValdiANS 8cc7f2f526 feat: add findMenuPath helper function 2026-01-23 23:04:04 +07:00
ValdiANS 25074edaa1 feat: create tailwind.css file 2026-01-23 23:03:46 +07:00
ValdiANS 0b1349ca8d feat: create TransferToLayingFilterModal component 2026-01-23 23:03:34 +07:00
ValdiANS 6c70dc93ce chore: pass the rest of the props to ConfirmationModal 2026-01-23 23:03:13 +07:00
ValdiANS ed3d525c06 chore: adjust ConfirmationModal component styling 2026-01-23 23:02:49 +07:00
ValdiANS af9c4bbdb9 chore: adjust SelectInputCheckbox styling 2026-01-23 23:02:25 +07:00
ValdiANS 5a88718454 chore: adjust SelectInput styling 2026-01-23 23:02:12 +07:00
ValdiANS d1a0cdc1b9 chore: adjust DateInput styling 2026-01-23 23:01:59 +07:00
ValdiANS 196db657e8 feat: create StatusBadge component 2026-01-23 23:01:43 +07:00
ValdiANS 51c3277b6c feat: add selectedBodyRowClassName class name 2026-01-23 23:01:33 +07:00
ValdiANS abc35314a0 chore: adjust Navbar styling and add breadcrumb to navbar 2026-01-23 23:01:07 +07:00
ValdiANS 146a63fc70 chore: remove unnecessary code and remove title from Navbar prop 2026-01-23 23:00:44 +07:00
ValdiANS d46652cb68 feat: add Breadcrumb component 2026-01-23 23:00:15 +07:00
ValdiANS b46f06a739 chore: remove padding 2026-01-23 22:59:54 +07:00
ValdiANS 6cc5e5e931 chore: adjust color variable and add shadow-button-soft custom shadow 2026-01-23 22:59:44 +07:00
rstubryan 7b82888aa6 refactor(FE): Update styling and imports in CustomerPaymentTab 2026-01-23 21:53:59 +07:00
rstubryan 762fb08568 refactor(FE): Replace hardcoded blue with bg-primary 2026-01-23 21:48:57 +07:00
rstubryan b7c0a80a04 refactor(FE): Validate end_date is not before start_date 2026-01-23 21:45:09 +07:00
rstubryan 143674533a refactor(FE): Remove redundant ID fields and require filters and update
date labels to 'Tanggal mulai' and 'Tanggal akhir
2026-01-23 21:40:54 +07:00
rstubryan b046b64ed2 refactor(FE): Add Formik-based filter with validation 2026-01-23 21:32:10 +07:00
rstubryan 9f6fec5a3c refactor(FE): Set uniformity week from recording data 2026-01-23 20:55:48 +07:00
rstubryan e386d2a389 chore(FE-Cleanup): Clean up unused code and add memoization 2026-01-23 18:12:44 +07:00
rstubryan cdef3e797e Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-23 17:34:10 +07:00
rstubryan 6af2609f44 refactor(FE): Use useSelect to fetch product warehouses 2026-01-23 16:38:34 +07:00
rstubryan 6f5540eb91 refactor(FE): Reset deliveries when products change 2026-01-23 16:26:25 +07:00
rstubryan 5c286128e4 refactor(FE): Exclude falsy product_id in product filter 2026-01-23 16:13:36 +07:00
rstubryan df875eda1d refactor(FE): Exclude selected products from product options 2026-01-23 16:05:59 +07:00
Rivaldi A N S ae2b27521e Merge branch 'fix/production-result' into 'development'
[FIX/FE] Production Result

See merge request mbugroup/lti-web-client!240
2026-01-23 09:01:27 +00:00
ValdiANS d026a3b5ae chore: round export number to excel 2026-01-23 15:59:46 +07:00
ValdiANS ed9a8021c1 feat: add safeRound helper function 2026-01-23 15:59:31 +07:00
rstubryan 31d9c5e38d Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-23 15:37:32 +07:00
Rivaldi A N S e749faedca Merge branch 'fix/production-result' into 'development'
[FIX/FE] Production Result

See merge request mbugroup/lti-web-client!239
2026-01-23 08:37:32 +00:00
rstubryan 27c696c797 refactor(FE): Use filter to remove products and deliveries 2026-01-23 15:37:06 +07:00
ValdiANS 28b58d9cac fix: fix exportProductionResultToExcel method 2026-01-23 15:36:16 +07:00
rstubryan 1d0d42dc16 refactor(FE): Include products in MovementForm effect deps 2026-01-23 13:45:55 +07:00
rstubryan 1b3dd34add refactor(FE): Filter products by available stock and format qty 2026-01-23 13:21:12 +07:00
rstubryan 1d29f62bf2 refactor(FE): Fix delivery dependency tracking and init 2026-01-23 13:10:54 +07:00
rstubryan e35f857057 fix(FE): Include deliveries in deps for cost handlers 2026-01-23 12:58:33 +07:00
rstubryan bcc2f71623 refactor(FE): Manage product and delivery quantity error toasts 2026-01-23 12:52:54 +07:00
rstubryan 359f0f7b01 refactor(FE): Move EKSPEDISI flag to supplier select 2026-01-23 11:10:08 +07:00
rstubryan 6a9f672d27 refactor(FE): Reduce font weight and size for payment badge 2026-01-23 11:05:42 +07:00
rstubryan 8c976b6d0b refactor(FE): Center PDF status and refine payment badge styling 2026-01-23 10:54:15 +07:00
Rivaldi A N S e00a81cebb Merge branch 'hotfix/finance' into 'development'
[HOTFIX/FE] Fixing Form Component State

See merge request mbugroup/lti-web-client!238
2026-01-23 03:36:49 +00:00
rstubryan a82860cb68 refactor(FE): Add initial balance row and normalize empty values 2026-01-23 10:34:53 +07:00
randy-ar 52a18dac24 fix(FE): fixing submit button disable and implement store search filter 2026-01-23 10:30:50 +07:00
randy-ar c2272ee5e0 hotfix(FE): fixing select input edit supplier in edit transaction 2026-01-22 16:20:40 +07:00
Rivaldi A N S c012f39a38 Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Fixing Store State Filter Dashboard

See merge request mbugroup/lti-web-client!235
2026-01-22 09:06:26 +00:00
Rivaldi A N S 0f72a14fde Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Add Tooltip, Support Comma on Recording Egg Values (Total Berat) and Add Global State Search for Table

See merge request mbugroup/lti-web-client!234
2026-01-22 09:05:40 +00:00
randy-ar 1c35c7db32 fix(FE): fixing filter store state on reset 2026-01-22 16:01:39 +07:00
rstubryan 1f6ce36976 refactor(FE): Move table slice into UI store and persist search 2026-01-22 15:58:56 +07:00
rstubryan 756701722a feat(FE): Persist Recording search across navigation 2026-01-22 15:24:04 +07:00
rstubryan 8e48c4d7cf Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-22 14:48:38 +07:00
Rivaldi A N S 282f651d96 Merge branch 'hotfix/marketing' into 'development'
[HOTFIX/FE] Sales Product Calculation

See merge request mbugroup/lti-web-client!233
2026-01-22 07:48:32 +00:00
rstubryan 49abb129e3 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-22 14:48:13 +07:00
rstubryan 9d6148e877 refactor(FE): Add tooltip and allow 3-decimal weight input 2026-01-22 14:46:38 +07:00
randy-ar d914eb86f2 hotfix: fix sales calculation 2026-01-22 14:43:07 +07:00
randy-ar e8a6bf05c3 hotfix: fix sales calculation 2026-01-22 14:38:34 +07:00
randy-ar ffa0b23b82 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into hotfix/marketing 2026-01-22 14:20:42 +07:00
rstubryan 49e9e958fa refactor(FE): Use local state for record date and disable
reinitialization
2026-01-22 14:20:16 +07:00
randy-ar b17ccd502e hotfix: fix sales calculation 2026-01-22 14:19:48 +07:00
Rivaldi A N S 1a7b969c3f Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Fix Aging/Umur on Closing Detail (Penjualan's Tab)

See merge request mbugroup/lti-web-client!232
2026-01-22 06:13:38 +00:00
rstubryan eca8bd7026 refactor(FE): Display raw age instead of using formatNumber 2026-01-22 11:36:02 +07:00
rstubryan 1e421e4230 refactor(FE): Show age as days and weeks in table 2026-01-22 11:34:29 +07:00
rstubryan 9cffa53122 feat(FE): Show age with week in sales report table 2026-01-22 11:26:47 +07:00
Rivaldi A N S 2ff217efcb Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Fixing Select Input Component UI

See merge request mbugroup/lti-web-client!231
2026-01-21 09:21:28 +00:00
Rivaldi A N S 475467cca6 Merge branch 'fix/debt-supplier' into 'development'
[FIX/FE] Fixing Debt Supplier Export Excel and Select Input

See merge request mbugroup/lti-web-client!230
2026-01-21 09:19:54 +00:00
randy-ar d0f6e965f0 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/dashboard 2026-01-21 15:19:27 +07:00
randy-ar 9a1be88bce fix(FE): fixing dashboard select input UI component 2026-01-21 15:18:37 +07:00
Rivaldi A N S 76fb5a2625 Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!227
2026-01-21 07:44:46 +00:00
Rivaldi A N S b75ed86949 Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Adjustment Recording Logic

See merge request mbugroup/lti-web-client!226
2026-01-21 07:42:39 +00:00
ValdiANS 426b6bfc85 chore: update chart and chart text color 2026-01-21 14:38:21 +07:00
randy-ar c7ffae68d8 fix(FE): adding color to negative value excel and change select UI 2026-01-21 14:27:59 +07:00
ValdiANS 362ae16c7d chore: set empty string for phase_id filter if ALL phase is selected 2026-01-21 14:19:58 +07:00
ValdiANS 149b14e0f8 fix: add form validation for configuration form 2026-01-21 14:18:14 +07:00
rstubryan 4d7bbaf771 feat(FE): Show product UOM suffix in recording form 2026-01-21 14:15:09 +07:00
rstubryan 99fc3f8cae refactor(FE): Standardize unit labels and number formatting 2026-01-21 13:45:12 +07:00
rstubryan 507f53ace8 refactor(FE): Use projectFlockKandangId for next-day recording 2026-01-21 13:29:35 +07:00
rstubryan fd4b584ccd refactor(FE): Use kilograms for egg weight fields 2026-01-21 13:23:31 +07:00
Rivaldi A N S f73672f65c Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!225
2026-01-21 06:13:23 +00:00
ValdiANS b62424af18 chore: rename updated_at column title to 'Diperbarui' 2026-01-21 13:08:05 +07:00
Rivaldi A N S 951d2bca0a Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!224
2026-01-21 05:40:07 +00:00
ValdiANS 4081a326e3 feat: add edit button 2026-01-21 12:38:30 +07:00
ValdiANS 0dbcb83c54 feat: set default value for date, kandang ID, and category from url query 2026-01-21 12:37:53 +07:00
ValdiANS 248d4f75d8 chore: rename daily checklist submenu to 'Formulir' 2026-01-21 12:36:40 +07:00
ValdiANS 4b2e00d91a chore: reorder activities in the correct order 2026-01-21 11:16:50 +07:00
ValdiANS d679b5b54e fix: show 'Umum' activity and fix select all phase bug 2026-01-21 11:15:57 +07:00
Rivaldi A N S b2fa4786b2 Merge branch 'dev/hotfix/restu' into 'development'
[FEAT/FE] Install ExcelJS and Refactor XLSX Export (Negative Color)

See merge request mbugroup/lti-web-client!223
2026-01-21 04:05:33 +00:00
rstubryan aaca46356a Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-21 10:55:00 +07:00
rstubryan 1f03222e42 feat(FE): Color negative accounts receivable red in XLSX export 2026-01-21 10:54:41 +07:00
rstubryan c472375f38 feat(FE): Use ExcelJS for customer payment export 2026-01-21 10:52:58 +07:00
Rivaldi A N S 469542bd2e Merge branch 'fix/daily-checklist' into 'development'
[FIX/FE] Daily Checklist

See merge request mbugroup/lti-web-client!222
2026-01-21 03:45:17 +00:00
ValdiANS 98e1623c19 Merge branch 'development' into fix/daily-checklist 2026-01-21 10:43:08 +07:00
ValdiANS 480e8a3226 Merge branch 'development' into fix/daily-checklist 2026-01-21 10:42:37 +07:00
ValdiANS 7317eb7129 chore: remove time_type default value and check activity form time type validity 2026-01-21 10:41:27 +07:00
ValdiANS c4f8051fba chore: set selected phase to null if category change 2026-01-21 10:19:46 +07:00
Rivaldi A N S 7be811f2b1 Merge branch 'dev/hotfix/restu' into 'development'
[FE/FIX] Adjustment Detail Closing (Tab Penjualan) Flock and Kandang

See merge request mbugroup/lti-web-client!221
2026-01-21 03:07:55 +00:00
rstubryan 5053ce35df refactor(FE): Add sales/actual price fields and summary 2026-01-21 10:01:08 +07:00
Rivaldi A N S 9bd4df3f4c Merge branch 'fix/daily-marketing-report' into 'development'
[FIX/FE] Daily Marketing Report

See merge request mbugroup/lti-web-client!220
2026-01-21 02:45:11 +00:00
ValdiANS 6c4672e38e chore: add flock name to ClosingsTable 2026-01-21 09:43:13 +07:00
ValdiANS c695afa1e7 chore: rename total_sales_price to average_sales_price in SalesSummary 2026-01-21 09:40:22 +07:00
ValdiANS 93513c4a3a chore: add flock name in ClosingsTable 2026-01-21 09:36:36 +07:00
ValdiANS ead338fa0f chore: rename total_average_weight to average_weight_kg in SalesSummary 2026-01-21 09:31:21 +07:00
Rivaldi A N S afbb007309 Merge branch 'fix/transfer-to-laying' into 'development'
[FIX/FE] Transfer to Laying

See merge request mbugroup/lti-web-client!219
2026-01-20 11:03:38 +00:00
ValdiANS 732fe85cde Merge branch 'development' into fix/transfer-to-laying 2026-01-20 17:37:06 +07:00
ValdiANS 43fe8ad1b3 feat: create PopoverContent component 2026-01-20 17:33:38 +07:00
ValdiANS d53afb6b74 feat: create PopoverButton component 2026-01-20 17:11:18 +07:00
ValdiANS e13f3358f4 chore: set maxQuantity min to 0 2026-01-20 17:09:57 +07:00
ValdiANS 26d89c35a5 chore: adjust TransferToLayingsTable styling 2026-01-20 17:07:24 +07:00
ValdiANS 7a45926c49 feat: adjust SalesSummary type 2026-01-20 17:04:41 +07:00
ValdiANS 0439c21ec6 chore: change button variant 2026-01-20 16:44:42 +07:00
ValdiANS 696ec3a69c feat: add total average weight and total sales price in table footer 2026-01-20 16:35:12 +07:00
ValdiANS 6b2f95b9a3 chore: adjust SidebarMenu styling 2026-01-20 16:33:35 +07:00
ValdiANS 324b6b69e2 chore: use TABLE_DEFAULT_STYLING for default styling 2026-01-20 16:31:05 +07:00
ValdiANS 876217d1af chore: adjust MainDrawer styling 2026-01-20 16:30:04 +07:00
ValdiANS 7a2bdb25e4 chore: change className.drawerContent to className.drawerSidebarContent 2026-01-20 16:29:03 +07:00
ValdiANS 1a3ea5be8c chore: add roboto font 2026-01-20 16:15:38 +07:00
ValdiANS 572e5233b4 chore: add roboto font 2026-01-20 16:13:29 +07:00
ValdiANS 6ece591d2b chore: update daisyUI version 2026-01-20 16:11:45 +07:00
Rivaldi A N S 122bdbbf54 Merge branch 'fix/finance' into 'development'
[FIX/FE] Fixing Form State in Module Finance

See merge request mbugroup/lti-web-client!218
2026-01-20 08:52:47 +00:00
Rivaldi A N S 5eb1296391 Merge branch 'fix/marketing' into 'development'
[FIX/FE] Fixing Edit Product Sales Order per Row

See merge request mbugroup/lti-web-client!217
2026-01-20 08:51:42 +00:00
Rivaldi A N S 3cc85a894f Merge branch 'fix/master-data' into 'development'
[FIX/FE] Fixing Unit in Production Standard

See merge request mbugroup/lti-web-client!216
2026-01-20 08:50:16 +00:00
randy-ar 71e6ac9c63 fix(FE): fixing url encode for filters 2026-01-20 15:34:33 +07:00
randy-ar 596e2d0095 fix(FE): change nominal to absolute value, change form state initial balance, and changes filter options 2026-01-20 15:22:35 +07:00
randy-ar 4cb8343f74 fix(FE): fixing edit product SO per row 2026-01-20 15:00:50 +07:00
randy-ar fc785bc63c fix(FE): fixing unit production standard 2026-01-20 14:39:44 +07:00
Rivaldi A N S defbcd9867 Merge branch 'fix/marketing' into 'development'
[FIX/FE] Adding Button Edit and Delete per Product on Marketing Form

See merge request mbugroup/lti-web-client!213
2026-01-20 04:36:51 +00:00
randy-ar f69fc08ef8 feat(FE): adding delete per product row delivery order 2026-01-20 11:06:53 +07:00
randy-ar 41bf12846d Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/marketing 2026-01-20 10:44:22 +07:00
randy-ar bbb9c5f190 feat(FE): adding edit and delete per product row sales order 2026-01-20 10:43:13 +07:00
Rivaldi A N S de11534e20 Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Adjustment Recording and Purchase Order

See merge request mbugroup/lti-web-client!212
2026-01-20 03:35:40 +00:00
rstubryan 8b0a6f054b refactor(FE): Format zero transport per item as currency 2026-01-20 10:31:32 +07:00
rstubryan 46b819c200 refactor(FE): Use approval step_name or action for status 2026-01-20 10:27:16 +07:00
rstubryan 72356917ff refactor(FE): Show dash for missing transport per item 2026-01-20 10:23:40 +07:00
rstubryan 28a32cb6c4 refactor(FE): Move travel document button into receipt section 2026-01-20 10:21:22 +07:00
rstubryan 0e179f1643 refactor(FE): Use location type guard for warehouse access 2026-01-20 10:08:37 +07:00
rstubryan 6319b6d5fe refactor(FE): Guard warehouse before accessing location 2026-01-20 10:07:39 +07:00
Rivaldi A N S a538c3ea90 Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Adjustment Recording, Biaya and HPP Harian Kandang (Report)

See merge request mbugroup/lti-web-client!211
2026-01-20 02:09:43 +00:00
rstubryan cbc54eb501 refactor(FE): Use name_with_periode in HppPerKandang cell 2026-01-19 20:57:16 +07:00
rstubryan 67f7a68f1b refactor(FE): Use ProjectFlockKandangApi for kandang select 2026-01-19 20:52:37 +07:00
rstubryan b1981867ff refactor(FE): Make depletion and egg fields optional 2026-01-19 17:52:19 +07:00
rstubryan 8a84542c60 refactor(FE): Rename expense item note to notes 2026-01-19 17:27:49 +07:00
rstubryan f091b4be43 refactor(FE): Show kandangs table for add-request and selection 2026-01-19 17:26:41 +07:00
rstubryan 6e4c214821 refactor(FE): Remove Warehouse column from RecordingTable 2026-01-19 17:21:48 +07:00
Rivaldi A N S aa6d205491 Merge branch 'dev/hotfix/restu' into 'development'
[FIX/FE] Data Refactor and UI Adjustment (Closing (Penjualan), Transfer Stock, Laporan (Kontrol Pembayaran Customer dan HPP Harian Kandang), Biaya, Recording)

See merge request mbugroup/lti-web-client!210
2026-01-19 09:15:25 +00:00
rstubryan 2e6e11984e Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-19 16:04:40 +07:00
Rivaldi A N S 0824225080 Merge branch 'fix/dateinput' into 'development'
[FIX/FE] Fixing Dateinput Component

See merge request mbugroup/lti-web-client!209
2026-01-19 09:04:19 +00:00
rstubryan e4ae1566f1 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-19 16:00:39 +07:00
rstubryan 0f21731008 feat(FE): Add Lokasi and Kandang columns in RecordingTable 2026-01-19 16:00:27 +07:00
randy-ar 9b2b5d8307 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/dateinput 2026-01-19 15:50:06 +07:00
randy-ar ff6f6136cc fix(FE): fixing component date input, remove alert native function & remove console.error 2026-01-19 15:49:31 +07:00
Rivaldi A N S 4ad2b54128 Merge branch 'fix/recording' into 'development'
[FIX/FE] Fixing Recording Form

See merge request mbugroup/lti-web-client!208
2026-01-19 08:38:25 +00:00
randy-ar 7b939f57af Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/recording 2026-01-19 15:28:48 +07:00
randy-ar 18f3295562 fix(FE): fixing initial state in form recording & refactor formik message errors list 2026-01-19 15:28:16 +07:00
rstubryan 9c540e7cd8 refactor(FE): Add guards for latest_approval and move search 2026-01-19 15:27:49 +07:00
rstubryan eefec93811 refactor(FE): Add Kandang and Location to Recording type 2026-01-19 14:59:26 +07:00
Rivaldi A N S 04e54044e9 Merge branch 'fix/sapronak-closing-report' into 'development'
[FIX/FE] Sapronak Closing Report

See merge request mbugroup/lti-web-client!207
2026-01-19 07:49:05 +00:00
ValdiANS e143668f82 feat: create getAllIncomingSapronakSummaryFetcher and getAllOutgoingSapronakSummaryFetcher method 2026-01-19 14:46:29 +07:00
ValdiANS 949b5cbc12 feat: create Closing Sapronak Summary type 2026-01-19 14:44:35 +07:00
ValdiANS 0f64baca23 feat: show Closing Sapronak Summary table 2026-01-19 14:42:04 +07:00
ValdiANS d9c154997d feat: create Closing Sapronak Summary component 2026-01-19 14:41:20 +07:00
rstubryan b3f8fc451d feat(FE): Add Rekapitulasi sheet to Excel export 2026-01-19 14:37:23 +07:00
rstubryan da040a4f7e refactor(FE): Format style objects in HppPerkandangExport 2026-01-19 14:36:21 +07:00
rstubryan 200290a0b3 refactor(FE): Remove header cell bottom and right borders in PDF export 2026-01-19 14:27:27 +07:00
rstubryan 366864582f feat(FE): Add TOTAL row to HppPerkandang PDF export 2026-01-19 14:14:04 +07:00
ValdiANS 876d564f26 fix: refactor confirmationModalDeleteClickHandler function 2026-01-19 14:06:04 +07:00
ValdiANS 979f803d75 chore: rename title 2026-01-19 14:05:08 +07:00
rstubryan f4166f4dbd refactor(FE): Keep select menus open and show selected options 2026-01-19 13:41:15 +07:00
rstubryan 56d4eca034 refactor(FE): Validate weight max is not less than min 2026-01-19 13:13:23 +07:00
rstubryan 24ff7a080f refactor(FE): Reset products when source warehouse changes 2026-01-19 13:03:07 +07:00
rstubryan ee1f759a37 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-19 10:54:46 +07:00
rstubryan 23c758b0cf refactor(FE): Prevent selecting same source and destination 2026-01-19 10:47:12 +07:00
rstubryan 1c002a1b95 refactor(FE): Stop resetting deliveries on product change 2026-01-19 10:44:18 +07:00
rstubryan fb980c38c9 refactor(FE): Toast warehouse duplicate error on validation 2026-01-19 10:42:20 +07:00
rstubryan dc2c2228a8 refactor(FE): Extract and memoize form event handlers 2026-01-19 10:28:08 +07:00
rstubryan 6def4e0fcd refactor(FE): Extract DeliveryDocumentSchema for reuse 2026-01-19 10:16:46 +07:00
rstubryan aaaa126c42 refactor(FE): Display zero and negative aging days 2026-01-19 09:32:59 +07:00
rstubryan 70a15d3044 refactor(FE): Rename customer_id to customer_ids in API and UI 2026-01-19 09:19:47 +07:00
Rivaldi A N S 5c8e97ebf9 Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Fixing Export PDF, Data Types and Filter State

See merge request mbugroup/lti-web-client!206
2026-01-19 02:12:21 +00:00
rstubryan f8ae023c45 refactor(FE): Only render kandang table when selected 2026-01-19 00:17:11 +07:00
rstubryan d03414f7ab refactor(FE): Refactor expense form handlers and schema 2026-01-19 00:07:00 +07:00
rstubryan 3cda11c66e refactor(FE): Filter warehouse options by EKSPEDISI flag 2026-01-18 23:43:31 +07:00
randy-ar 55b50d4184 feat(FE): add state filter dashboard with store 2026-01-18 19:30:54 +07:00
randy-ar a9c22d778b refactor(FE): export charts with hidden html renderer and adding package html-to-image 2026-01-18 18:57:10 +07:00
randy-ar c576933ba2 fix(FE): update dashboard line chart and types 2026-01-18 16:15:18 +07:00
rstubryan b66054c9a2 refactor(FE): Use nonstock_id and make select clearable 2026-01-17 21:43:49 +07:00
rstubryan ccf535cbd9 refactor(FE): Improve expense form validation messages 2026-01-17 21:30:03 +07:00
rstubryan df550abc46 refactor(FE): Simplify recording approval line steps 2026-01-17 21:04:29 +07:00
rstubryan 0aa96b9c46 refactor(FE): Remove max-width constraints, use two-column grid 2026-01-17 20:53:39 +07:00
rstubryan 4391fe1de7 refactor(FE): Capitalize payment status text 2026-01-17 20:37:43 +07:00
rstubryan 6377557ef0 refactor(FE): Reset products and deliveries on warehouse change 2026-01-17 20:33:13 +07:00
rstubryan 4d319ca9c8 refactor(FE): Comment out age column in SalesReportTable 2026-01-17 20:25:23 +07:00
rstubryan 93c886551d Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2026-01-17 20:19:51 +07:00
Rivaldi A N S d31c1deaa2 Merge branch 'hotfix/finance' into 'development'
[HOTFIX/FE] FIxing Test Scenario in Finance Module

See merge request mbugroup/lti-web-client!205
2026-01-17 09:55:02 +00:00
Rivaldi A N S aad08593c7 Merge branch 'hot-fix/marketing-disabled-edit-customer' into 'development'
[HOTFIX/FE] Disabled Select input customer

See merge request mbugroup/lti-web-client!204
2026-01-17 09:54:41 +00:00
randy-ar 36da05890a hotfix(FE): fixing failed test scenario in module finance 2026-01-17 16:45:56 +07:00
rstubryan a82c5e5593 refactor(FE): Rename price to unit_price in customer payments 2026-01-17 16:16:34 +07:00
randy-ar 08715e39c2 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into hot-fix/marketing-disabled-edit-customer 2026-01-17 15:59:49 +07:00
randy-ar 138ad6a7c9 hotfix(FE): change select input component to disabled 2026-01-17 15:59:08 +07:00
Rivaldi A N S 9ae5bdd969 Merge branch 'dev/hotfix/restu' into 'development'
[HOTFIX/FE] Fix Recording Record Date and Purchase Order Staff Edit Mode

See merge request mbugroup/lti-web-client!202
2026-01-17 06:12:01 +00:00
rstubryan d19b1e885e refactor(FE): Compute item total on qty change and limit reset 2026-01-17 12:59:41 +07:00
rstubryan f4abfd4279 refactor(FE): Dismiss toast notifications on unmount 2026-01-17 12:54:16 +07:00
rstubryan 1152b6d2c3 refactor(FE): Disable Submit button when duplicate error shown 2026-01-17 12:45:11 +07:00
rstubryan 0cdbff6954 refactor(FE): Validate recording date and handle null location 2026-01-17 12:32:55 +07:00
rstubryan f32b77c552 refactor(FE): Add location, project_flock and kandang fields 2026-01-17 12:24:32 +07:00
rstubryan cd9fa31ad7 refactor(FE): Disable form fields in edit mode 2026-01-17 12:11:30 +07:00
rstubryan 4c4c70e10f refactor(FE): Validate duplicates by selected record date 2026-01-17 12:03:32 +07:00
Rivaldi A N S 67d695303e Merge branch 'hot-fix/project-flock-status' into 'development'
[FIX/FE] Fix Approval Status Badge

See merge request mbugroup/lti-web-client!200
2026-01-17 04:15:40 +00:00
Rivaldi A N S b85bace073 Merge branch 'hot-fix/master-data-flock' into 'development'
[FIX/FE] Show server error message

See merge request mbugroup/lti-web-client!199
2026-01-17 04:15:14 +00:00
randy-ar 835ba077d8 fix(FE): change status badge kandang aktif 2026-01-17 11:08:25 +07:00
randy-ar 13abc6d7ce fix(FE): change status badge 2026-01-17 11:02:22 +07:00
randy-ar a26919f037 fix(FE): show server error 2026-01-17 10:49:41 +07:00
Rivaldi A N S e6cbb3013d Merge branch 'hot-fix/project-flock-kandang-options' into 'development'
[FIX/FE] Fix Limit Data Kandang in Project Form

See merge request mbugroup/lti-web-client!197
2026-01-17 02:53:03 +00:00
randy-ar c55081f358 fix(FE): fix limit fetch data kandang 2026-01-17 09:48:37 +07:00
Rivaldi A N S ff9ad8237c Merge branch 'hot-fix/closing-finance-kandang' into 'development'
[FIX/FE] Hotfix Closing Finance Kandang

See merge request mbugroup/lti-web-client!195
2026-01-16 15:02:10 +00:00
randy-ar f371d06386 fix(FE): add depedency to useMemo rows data 2026-01-16 21:55:39 +07:00
randy-ar 79cb89b9a0 fix(FE): delete console log debug 2026-01-16 21:11:46 +07:00
randy-ar 9a3617edf1 fix(FE): hot fix closing finance per kandang 2026-01-16 21:04:23 +07:00
Rivaldi A N S 80dfbcb858 Merge branch 'feat/closing-overhead-kandang' into 'development'
[FIX/FE] Fixing Slicing UI Closing Overhead Kandang

See merge request mbugroup/lti-web-client!194
2026-01-16 12:01:48 +00:00
Rivaldi A N S db51619fbe Merge branch 'feat/closing-finance-kandang' into 'development'
[FEAT/FE] Refactor Response Data Closing Finance

See merge request mbugroup/lti-web-client!193
2026-01-16 12:01:29 +00:00
Rivaldi A N S 6395a32f43 Merge branch 'fix/data-refactor-and-ui-adjustment' into 'development'
[FIX/FE] Data Refactor and UI Adjustment (Recording, Purchase, Finance, Marketing & Sales Report)

See merge request mbugroup/lti-web-client!192
2026-01-16 12:00:37 +00:00
Rivaldi A N S 3c6f7ce0d3 Merge branch 'fix/finance-select-input' into 'development'
[FIX/FE] Implement Lazy Loading Select Input

See merge request mbugroup/lti-web-client!191
2026-01-16 12:00:09 +00:00
randy-ar 01b8841e3c fix(FE): adjust ui closing overhead kandang 2026-01-15 21:14:55 +07:00
randy-ar 40e8f52fe4 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into feat/closing-overhead-kandang 2026-01-15 20:16:11 +07:00
randy-ar 8c6a87c011 feat(FE): adding closing finance per kandang 2026-01-15 20:08:21 +07:00
rstubryan a17089f4bb refactor(FE): Relax expedition vendor validation 2026-01-15 19:37:55 +07:00
rstubryan 45700be730 refactor(FE): Improve vehicle number validation message and set
expedition flag on supplier
2026-01-15 19:32:09 +07:00
rstubryan 228e79bb31 refactor(FE): Make vehicle/expedition/transport fields optional 2026-01-15 19:29:03 +07:00
rstubryan 87bf474cf6 refactor(FE): Add customer address as card subtitle 2026-01-15 18:01:15 +07:00
rstubryan b25418b51e Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-15 17:54:56 +07:00
rstubryan 0a24c4541f refactor(FE): Make feed and doc supplier arrays nullable 2026-01-15 17:53:18 +07:00
rstubryan 7d3a4c1ecc refactor(FE): Use memoized IDs and badges for standards 2026-01-15 17:47:03 +07:00
rstubryan 8fe51c976b refactor(FE): Show additional flock info in recording form 2026-01-15 17:29:09 +07:00
randy-ar 5a4e3ab5ab Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into feat/closing-finance-kandang 2026-01-15 17:23:57 +07:00
randy-ar a1bbe4e2d7 fix(FE): implement lazy loading select button on marketing index 2026-01-15 17:03:25 +07:00
Rivaldi A N S 6c8e901a99 Merge branch 'fix/master-data-delete-error-message' into 'development'
[FIX/FE] Master Data Delete Error Message

See merge request mbugroup/lti-web-client!190
2026-01-15 09:57:28 +00:00
ValdiANS a2e04dad9f chore: implement delete error message toast 2026-01-15 16:55:16 +07:00
randy-ar 73100aa1ce fix(FE): implement lazy loading select button on project flock index 2026-01-15 16:53:39 +07:00
randy-ar e349b9dfa4 fix(FE): implement lazy loading select button on finance module 2026-01-15 16:48:11 +07:00
rstubryan 4a9cbdc219 refactor(FE): Use initialValues total_chick_qty for edit/detail 2026-01-15 16:41:24 +07:00
rstubryan 76c1b2f628 refactor(FE): Derive current total chick qty from flock data 2026-01-15 16:35:32 +07:00
rstubryan 0a5414a3ac refactor(FE): Add bottom margin to production standards text 2026-01-15 16:28:32 +07:00
rstubryan c7b4361cb6 feat(FE): Add Production Standard modal and table 2026-01-15 16:24:45 +07:00
rstubryan 00e0bc387b Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-15 16:17:22 +07:00
rstubryan 4285e2e269 refactor(FE): Enable backdrop close and set FCR table pageSize 2026-01-15 16:16:32 +07:00
Rivaldi A N S 9df64eeafa Merge branch 'fix/master-data-nonstock' into 'development'
[FIX/FE] Master Data Nonstock

See merge request mbugroup/lti-web-client!188
2026-01-15 09:15:10 +00:00
Rivaldi A N S 34901aa11c Merge branch 'fix/master-data-production-standard' into 'development'
[FIX/FE] Fixing Error Message and Fixing UI

See merge request mbugroup/lti-web-client!186
2026-01-15 09:14:26 +00:00
ValdiANS b2ce9c93b7 chore: remove unnecessary data 2026-01-15 16:13:54 +07:00
Rivaldi A N S 0c4448f396 Merge branch 'fix/master-data-nonstock' into 'development'
[FIX/FE] Master Data Nonstock

See merge request mbugroup/lti-web-client!187
2026-01-15 09:12:26 +00:00
ValdiANS 7114470c13 chore: access correct UOM id 2026-01-15 16:11:12 +07:00
rstubryan 0de4f9d745 feat(FE): Display FCR standards table in RecordingForm 2026-01-15 16:07:17 +07:00
randy-ar a6fe07de07 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/master-data-production-standard 2026-01-15 16:06:13 +07:00
randy-ar 438082c94c fix(FE): fixing error message on submit and fixing ui 2026-01-15 16:05:05 +07:00
Rivaldi A N S 081048f0c5 Merge branch 'fix/closing-report-per-kandang' into 'development'
[FIX/FE] Closing Report Per Kandang

See merge request mbugroup/lti-web-client!185
2026-01-15 09:02:18 +00:00
ValdiANS fce2cfee73 feat: implement closing production data per kandang 2026-01-15 15:56:47 +07:00
ValdiANS bd64694c73 feat: implement closing sapronak per kandang 2026-01-15 15:56:30 +07:00
rstubryan 105d23e4f7 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-15 15:50:28 +07:00
rstubryan 68f9e27b5f refactor(FE): Reorder fields in RecordingForm 2026-01-15 15:48:18 +07:00
rstubryan d786b7b5ba feat(FE): Add warehouse display and standard detail modals 2026-01-15 15:41:11 +07:00
rstubryan 23e8487a97 refactor(FE): Show zero values in RecordingForm 2026-01-15 15:21:16 +07:00
Rivaldi A N S 02b97117eb Merge branch 'feat/FE/US-81/production-result-report' into 'development'
[FEAT/FE][US#81] Production Result Report PDF

See merge request mbugroup/lti-web-client!184
2026-01-15 08:15:49 +00:00
Rivaldi A N S 0f6e224870 Merge branch 'fix/project-flock-select-options' into 'development'
[FIX/FE] Implementasi Select Lazy Loading Form Project Flock

See merge request mbugroup/lti-web-client!183
2026-01-15 08:14:58 +00:00
ValdiANS e15b7e11d3 feat: create ProductionResultReportPDF component 2026-01-15 15:14:33 +07:00
ValdiANS 8f55ced55a feat: add export to pdf functionality 2026-01-15 15:14:17 +07:00
ValdiANS 781a5ca0d9 chore: use real permission for daily checklist menu 2026-01-15 15:14:04 +07:00
rstubryan ac84841b05 feat(FE): Add production metric columns and table styling 2026-01-15 15:06:41 +07:00
rstubryan a08ab7abaf feat(FE): Add Periode and Gudang columns and show week 2026-01-15 14:47:49 +07:00
randy-ar 1d689da546 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/project-flock-select-options 2026-01-15 14:45:40 +07:00
Rivaldi A N S 96f96f6c5a Merge branch 'fix/marketing' into 'development'
[FIX/FE] Fixing Module Marketing Change UI Layout

See merge request mbugroup/lti-web-client!178
2026-01-15 07:43:31 +00:00
Rivaldi A N S a403800fb0 Merge branch 'fix/debt-supplier' into 'development'
[FIX/FE] Adjust UI Debt Supplier

See merge request mbugroup/lti-web-client!177
2026-01-15 07:43:03 +00:00
randy-ar 49b7ca4be5 fix(FE): resolve conflict 2026-01-15 14:39:06 +07:00
rstubryan dd080b1d19 refactor(FE): Add record_date and DateInput to recording form 2026-01-15 14:08:09 +07:00
rstubryan 63461173e5 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-15 13:52:45 +07:00
rstubryan 9d7140beb6 refactor(FE): Use egg production as remaining columns 2026-01-15 13:52:21 +07:00
rstubryan 817420ee62 refactor(FE): Rename Ayam labels to Telur in HPP reports 2026-01-15 13:35:00 +07:00
rstubryan f3b1091890 refactor(FE): Add infinite scroll to flock selects 2026-01-15 12:12:03 +07:00
rstubryan c9bace04ec refactor(FE): Use absolute import for Badge 2026-01-15 12:07:55 +07:00
rstubryan dc3b4f1850 refactor(FE): Use useSelect for ProjectFlock with pagination 2026-01-15 12:05:34 +07:00
Rivaldi A N S 27a398a1c8 Merge branch 'fix/master-data-product' into 'development'
[FIX/FE] Master Data Product

See merge request mbugroup/lti-web-client!181
2026-01-15 05:03:53 +00:00
Rivaldi A N S 9a87f1c404 Merge branch 'feat/closing-finance-kandang' into 'development'
[FEAT/FE] Closing Finance Kandang

See merge request mbugroup/lti-web-client!176
2026-01-15 05:00:43 +00:00
Rivaldi A N S fc1a0d6a3f Merge branch 'fix/dashboard' into 'development'
[FIX/FE] Adding Export Button and Fixing Filter

See merge request mbugroup/lti-web-client!175
2026-01-15 05:00:07 +00:00
ValdiANS 6a7990e722 fix: make suppliers optional 2026-01-15 11:59:25 +07:00
rstubryan 294c843bd4 refactor(FE): Use useSelect for project flock filter 2026-01-15 11:58:38 +07:00
rstubryan 12f22833c9 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-15 11:48:17 +07:00
Rivaldi A N S d46355f7f0 Merge branch 'fix/master-data-product' into 'development'
[FIX/FE] Master Data Product

See merge request mbugroup/lti-web-client!180
2026-01-15 04:47:21 +00:00
ValdiANS bf38178969 chore: update product type 2026-01-15 11:46:19 +07:00
ValdiANS 790b590668 feat: use real permission for daily checklist 2026-01-15 11:46:10 +07:00
ValdiANS 3952704643 chore: fix typo in placeholder 2026-01-15 11:45:51 +07:00
ValdiANS 57a148b6cf feat: add price per supplier input in product form 2026-01-15 11:45:31 +07:00
randy-ar 8a7245f5dd Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into feat/closing-finance-kandang 2026-01-15 11:14:09 +07:00
rstubryan b02a3c5eee refactor(FE): Add onMenuScrollToBottom to product selects 2026-01-15 10:51:33 +07:00
rstubryan a1301121ac refactor(FE): Refactor selects to use useSelect hook 2026-01-15 10:44:27 +07:00
rstubryan 3bc5030a3d refactor(FE): Use useSelect for warehouse options 2026-01-15 10:17:08 +07:00
rstubryan 4b88b684af refactor(FE): Load locations by area and disable location select 2026-01-15 10:12:52 +07:00
rstubryan cf332b5346 refactor(FE): Add load-on-scroll for expedition vendor select 2026-01-15 10:00:56 +07:00
Rivaldi A N S 94c6d82967 Merge branch 'feat/select-input-lazy-loading' into 'development'
[FEAT/FE] SelectInput Lazy Loading Implementation

See merge request mbugroup/lti-web-client!179
2026-01-15 02:56:09 +00:00
ValdiANS c75563491f feat: implement lazy loading in SelectInput 2026-01-15 09:48:02 +07:00
ValdiANS 3827204f13 chore: make basePath nullable 2026-01-15 09:47:11 +07:00
randy-ar 76e15d13ad fix(FE): adding filter information and supplier category on export pdf 2026-01-15 00:52:29 +07:00
randy-ar 5e7f55000a fix(FE): add sales person, refactor calculate total weight and price, add uom information and implement lazy load select 2026-01-15 00:32:55 +07:00
rstubryan 427c8aec34 feat(FE): Join array fields into comma-separated strings 2026-01-14 22:28:45 +07:00
rstubryan f1dba4012a refactor(FE): Update customer payment types and exports 2026-01-14 22:17:24 +07:00
rstubryan a72fbec5ce refactor(FE): Remove CN and PPN columns and bold receivables 2026-01-14 22:02:48 +07:00
rstubryan d8e134d404 feat(FE): Add customer payment permission to finance route 2026-01-14 21:59:03 +07:00
rstubryan 359326e575 refactor(FE): Rename 'Populasi Awal' column to 'Populasi Ayam' 2026-01-14 21:45:52 +07:00
rstubryan dbe9b26818 feat(FE): Adjust recording form grid and add chick count 2026-01-14 21:42:36 +07:00
rstubryan b290f7692a refactor(FE): Show current chick total in recording form 2026-01-14 21:39:38 +07:00
randy-ar 7a6bee57c2 fix(FE): fix report excel debt supplier change debt_price to balance 2026-01-14 19:20:16 +07:00
randy-ar b52a414eb0 fix(FE): adjust slicing ui debt supplier 2026-01-14 19:11:38 +07:00
rstubryan 4137683d05 refactor(FE): Hide 'hari' for zero or negative aging days 2026-01-14 17:55:38 +07:00
randy-ar 9237d4e731 fix(FE): implement lazy load select project flock 2026-01-14 17:10:42 +07:00
rstubryan efde742518 refactor(FE): Highlight negative accounts receivable values 2026-01-14 17:03:40 +07:00
rstubryan 916de1432b refactor(FE): Adjust column span in CustomerPaymentTab 2026-01-14 16:59:45 +07:00
rstubryan e134f0994b refactor(FE): Remove credit_note and ppn fields 2026-01-14 16:57:52 +07:00
randy-ar f22ba83dd0 feat(FE): hit api to endpoint closing finance kandang 2026-01-14 16:44:50 +07:00
randy-ar 3cb11f6158 fix(FE): add empty state overlay on chart null value 2026-01-14 16:27:13 +07:00
rstubryan c5baff6f33 refactor(FE): Update column headers in CustomerPaymentTab 2026-01-14 15:55:20 +07:00
rstubryan ab2175d903 refactor(FE): Simplify table cells and render initial balance row 2026-01-14 15:46:03 +07:00
randy-ar 524036a6bf fix(FE): implement lazy load options select 2026-01-14 15:43:53 +07:00
randy-ar 6c320ce59a Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/dashboard 2026-01-14 15:37:44 +07:00
randy-ar cb8a1a17ac feat(FE): adding export feature on dashboard 2026-01-14 15:36:21 +07:00
rstubryan 08c28f4077 refactor(FE): Rename payment fields and add initial balance row 2026-01-14 15:14:33 +07:00
rstubryan 66fa65e4bb refactor(FE): Disable sales and filter_by until backend ready 2026-01-14 14:29:40 +07:00
rstubryan 01e94b57c1 refactor(FE): Disable row selection for approved recordings 2026-01-14 14:14:48 +07:00
rstubryan 8d586e7cb4 refactor(FE): Switch FinanceApi to production and remove import 2026-01-14 13:53:45 +07:00
Rivaldi A N S 447a953ed3 Merge branch 'feat/customer-control-ui-adjustment' into 'development'
[FEAT/FE] Customer Control UI Adjustment (Kontrol Pembayaran Customer)

See merge request mbugroup/lti-web-client!174
2026-01-14 06:36:33 +00:00
rstubryan 141d695a7d feat(FE): Load more select options on scroll 2026-01-14 13:10:51 +07:00
rstubryan ae35d42484 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-14 12:00:50 +07:00
rstubryan 3f285a74bc refactor(FE): Append title classes to Card and style customer card 2026-01-14 11:56:09 +07:00
Rivaldi A N S c81f7faf93 Merge branch 'feat/select-input-lazy-loading' into 'development'
[FEAT/FE] Implement SelectInput lazy loading

See merge request mbugroup/lti-web-client!173
2026-01-14 04:53:27 +00:00
Rivaldi A N S c81b250cbb Merge branch 'fix/debt-supplier' into 'development'
[FIX/FE] Fixing Debt Supplier Report Ledger

See merge request mbugroup/lti-web-client!172
2026-01-14 04:51:20 +00:00
randy-ar fc71defa08 feat(FE): adding button filter component 2026-01-14 11:43:10 +07:00
ValdiANS 54e05b7150 feat: implement lazy loading in SelectInput component in master data form 2026-01-14 11:36:57 +07:00
rstubryan d28fa77405 feat(FE): Fetch sales from UserApi and use sales_id param 2026-01-14 11:35:10 +07:00
rstubryan 53277b5893 refactor(FE): Use customerOptions type for filterCustomer state 2026-01-14 11:16:33 +07:00
rstubryan 97d131be12 refactor(FE): Cleanup types and remove pagination 2026-01-14 11:06:29 +07:00
rstubryan 3937c27c77 feat(FE): Show active filter count on Filter button 2026-01-14 10:49:21 +07:00
randy-ar bdf84c3802 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into fix/debt-supplier 2026-01-14 10:41:24 +07:00
randy-ar ba679865c4 fix(FE): fixing laporan ledger debt supplier 2026-01-14 10:40:54 +07:00
ValdiANS 8d7adbbd27 feat: implement lazy loading in SelectInput 2026-01-14 10:35:51 +07:00
rstubryan adb8d0f69e feat(FE): Add checkbox multi-select and components prop 2026-01-14 10:04:51 +07:00
Rivaldi A N S e6eac6b62d Merge branch 'fix/marketing-report' into 'development'
[FIX/FE] Daily Marketing Report

See merge request mbugroup/lti-web-client!171
2026-01-14 02:32:18 +00:00
Rivaldi A N S e87f9087e1 Merge branch 'fix/data-refactor-and-ui-adjustment' into 'development'
[FIX/FE] Data Refactor and UI Adjustment (Closing, Biaya, Finance Report, Sales Report, Recording)

See merge request mbugroup/lti-web-client!170
2026-01-14 02:30:03 +00:00
ValdiANS c4b505047c chore: add MARKETING_DATE_FILTER_TYPE_OPTIONS constant 2026-01-14 09:29:27 +07:00
ValdiANS fee9328699 chore: adjust table columns accessorKey for filter 2026-01-14 09:29:15 +07:00
ValdiANS b90fdabc4b feat: date filter type 2026-01-14 09:28:47 +07:00
ValdiANS a5d2d85572 chore: hide AWG std and AWG act 2026-01-14 09:28:16 +07:00
rstubryan 4560073f6a refactor(FE): Add record_date to recording payloads 2026-01-14 00:02:44 +07:00
rstubryan a205e57d39 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-13 16:49:12 +07:00
rstubryan 582b971c09 refactor(FE): Change endpoint path to reports 2026-01-13 16:47:58 +07:00
Rivaldi A N S 54ce9e5458 Merge branch 'feat/closing-overhead-kandang' into 'development'
[FEAT/FE] Closing Overhead Kandang

See merge request mbugroup/lti-web-client!169
2026-01-13 09:47:01 +00:00
rstubryan 8481b77c90 refactor(FE): Adjust cumulative depletion table layout 2026-01-13 16:21:41 +07:00
rstubryan e77a43300a refactor(FE): Nest project_flock in Recording and update UI 2026-01-13 16:01:30 +07:00
rstubryan 34d7310cc9 refactor(FE): Style accounts receivable in red and adjust badge 2026-01-13 15:32:39 +07:00
randy-ar 8998d815a5 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into feat/closing-overhead-kandang 2026-01-13 15:23:27 +07:00
randy-ar e5ec0f8deb feat(FE): closing report overhead per kandang 2026-01-13 15:20:36 +07:00
rstubryan 60eaec261d refactor(FE): Render payment notes as Badge and highlight balance 2026-01-13 15:20:27 +07:00
rstubryan 92bfef850a refactor(FE): Enhance customer payment PDF export and filters 2026-01-13 14:31:30 +07:00
rstubryan 502564da0a refactor(FE): Exclude step 6 and include step 4 in edit check 2026-01-13 13:43:34 +07:00
rstubryan 8b99be34ae Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-13 13:36:13 +07:00
rstubryan a781431683 refactor(FE): Rename Type column header to Jenis 2026-01-13 13:35:56 +07:00
Rivaldi A N S d34413fa3a Merge branch 'fix/debt-supplier' into 'development'
[FIX/FE] Delete Dummy Data and Separate Service API File

See merge request mbugroup/lti-web-client!168
2026-01-13 06:29:00 +00:00
randy-ar b9212d1241 fix(FE): delete dummy data and separate service api file 2026-01-13 12:03:45 +07:00
Rivaldi A N S 6a58be8c67 Merge branch 'fix/form-error-message' into 'development'
[FIX/FE] Form Error Message

See merge request mbugroup/lti-web-client!167
2026-01-13 04:35:43 +00:00
Rivaldi A N S d4b8d25bd5 Merge branch 'fix/debt-supplier-and-project-flock' into 'development'
[FIX/FE] Refactor data response debt supplier and fix Floating Action Button Project Flock

See merge request mbugroup/lti-web-client!166
2026-01-13 04:33:15 +00:00
Rivaldi A N S 19c4e0fd4b Merge branch 'dev/randy' into 'fix/debt-supplier-and-project-flock'
[FIX/FE] Refactor data response debt supplier and fix Floating Action Button Project Flock

See merge request mbugroup/lti-web-client!165
2026-01-13 04:29:21 +00:00
ValdiANS 9ffa60b935 fix: use AlertErrorList for showing error message list 2026-01-13 11:25:10 +07:00
randy-ar 77a7b6ccf8 fix(FE): change options value debt supplier 2026-01-13 11:23:17 +07:00
Rivaldi A N S 55376e9631 Merge branch 'feat/closing-kandang-hpp-ekspedisi-dan-penjualan' into 'development'
[FEAT/FE] Add Closing (Kandang) HPP Expedition (Ekspedisi) dan Sales (Penjualan)

See merge request mbugroup/lti-web-client!164
2026-01-13 04:15:46 +00:00
randy-ar 0ac14fe342 fix(FE): fixing floating action button project flock and change page size 2026-01-13 11:11:10 +07:00
rstubryan 06accca19e feat(FE): Support per-kandang sales fetching 2026-01-13 11:00:36 +07:00
rstubryan 0f5ac917d2 feat(FE): Support fetching HPP ekspedisi by kandang 2026-01-13 10:57:40 +07:00
randy-ar 00eed01cea Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-13 10:47:32 +07:00
randy-ar 6702dd7dc6 fix(FE): fixing response data debt supplier 2026-01-13 10:46:52 +07:00
Rivaldi A N S a526772e02 Merge branch 'fix/marketing-report' into 'development'
[FIX/FE] Daily Marketing Report

See merge request mbugroup/lti-web-client!163
2026-01-13 03:38:56 +00:00
ValdiANS b486d25a8b chore: access sales.name 2026-01-13 10:34:54 +07:00
Rivaldi A N S b73b452621 Merge branch 'fix/marketing-report' into 'development'
[FIX/FE] Daily Marketing Report

See merge request mbugroup/lti-web-client!162
2026-01-13 03:27:14 +00:00
ValdiANS 4f4787e088 chore: create DailyMarketingReportResponse 2026-01-13 10:22:19 +07:00
ValdiANS f32024d19a chore: use DailyMarketingReportResponse 2026-01-13 10:21:31 +07:00
ValdiANS 3b666a924f chore: add total hpp price per kg footer 2026-01-13 10:21:22 +07:00
ValdiANS 021df11600 chore: add total props in DailyMarketingReportPDFProps and adjust data type 2026-01-13 10:20:23 +07:00
ValdiANS d306fad40c chore: use DailyMarketingReportResponse type 2026-01-13 10:19:22 +07:00
Rivaldi A N S ebc12638ff Merge branch 'fix/adjustment-closing-tab-and-finance-report' into 'development'
[FIX/FE] Adjustment Finance Report (Kontrol Pembayaran Customer)

See merge request mbugroup/lti-web-client!161
2026-01-13 02:30:22 +00:00
rstubryan 437dd75934 feat(FE): Add 5MB file size validation for document uploads 2026-01-13 08:42:07 +07:00
rstubryan e1c0701629 refactor(FE): Adapt customer payment report types and exports 2026-01-12 21:39:22 +07:00
rstubryan 96a5eb1be5 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-12 17:45:30 +07:00
rstubryan 7add41ea5a refactor(FE): Map approval 6 to green and export FinanceApi 2026-01-12 17:45:15 +07:00
Rivaldi A N S 548dfd19e5 Merge branch 'feat/FE/daily-checklist' into 'development'
[FEAT/FE] Daily Checklist

See merge request mbugroup/lti-web-client!160
2026-01-12 10:42:20 +00:00
ValdiANS f0a6dd4a5a Merge branch 'development' into feat/FE/daily-checklist 2026-01-12 17:37:20 +07:00
Rivaldi A N S 7159114733 Merge branch 'fix/submit-form' into 'development'
[FIX/FE] Create Custom Hooks for Formik Error List

See merge request mbugroup/lti-web-client!159
2026-01-12 10:35:24 +00:00
Rivaldi A N S e300a60b5a Merge branch 'dev/randy' into 'fix/submit-form'
[FIX/FE] Create Custom Hooks for Formik Error List

See merge request mbugroup/lti-web-client!158
2026-01-12 10:34:36 +00:00
ValdiANS 4cbd83a6fa feat: add document_urls property in DetailDailyChecklist type 2026-01-12 17:32:34 +07:00
ValdiANS b39202111e feat: create Document type 2026-01-12 17:32:07 +07:00
ValdiANS a891608d13 feat: add uploadImage and exportDailyChecklistReportToExcel method 2026-01-12 17:31:55 +07:00
ValdiANS aff05c6b1a feat: add export to excel 2026-01-12 17:31:35 +07:00
ValdiANS 70eac011f3 chore: remove export button 2026-01-12 17:31:07 +07:00
ValdiANS 10e843aebf chore: refresh phase after modifying activity 2026-01-12 17:31:00 +07:00
ValdiANS a24f51dad3 feat: show existing document 2026-01-12 17:30:44 +07:00
ValdiANS 9245285fe2 feat: add upload document in daily checklist 2026-01-12 17:30:30 +07:00
randy-ar eb1337292b Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-12 17:19:53 +07:00
randy-ar aa114c164b fix(FE): create hooks for formik error list and integrate alert error list for finance and master data modules 2026-01-12 17:19:16 +07:00
randy-ar 0f9849c0ac fix(FE): fixing sapronak calculation get kandangId state 2026-01-12 15:38:07 +07:00
randy-ar 36b167dafb fix(FE): add production standard in detail project flock 2026-01-12 15:13:02 +07:00
ValdiANS 1002c6c437 feat: create Daily Checklist Configuration type 2026-01-12 14:42:41 +07:00
ValdiANS 25352659f3 feat: create Daily Checklist Configuration Api Service 2026-01-12 14:42:33 +07:00
ValdiANS dfac7f84ff feat: create MasterConfigurationContent component 2026-01-12 14:42:14 +07:00
ValdiANS c099314bdb feat: add route permission for daily checklist master configuration 2026-01-12 14:42:02 +07:00
ValdiANS 404019f181 feat: add Konfigurasi menu 2026-01-12 14:41:46 +07:00
ValdiANS 8afd8c6382 feat: create master daily checklist configuration page 2026-01-12 14:41:34 +07:00
Rivaldi A N S ef4ad07547 Merge branch 'fix/adjustment-submission-form-biaya' into 'development'
[FIX/FE] Submission Form Biaya Handling

See merge request mbugroup/lti-web-client!157
2026-01-12 07:41:15 +00:00
rstubryan 31aa8e7652 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-submission-form-biaya 2026-01-12 14:33:42 +07:00
Rivaldi A N S 994967e940 Merge branch 'dev/randy' into 'development'
[FEAT/FE] Report Sapronak Calculation per Kandang

See merge request mbugroup/lti-web-client!156
2026-01-12 07:30:47 +00:00
rstubryan 90eef08f9b refactor(FE): Enable sales tab and fetch sales data 2026-01-12 14:30:34 +07:00
rstubryan def2167803 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into fix/adjustment-submission-form-biaya 2026-01-12 14:13:09 +07:00
rstubryan bf834cf79b refactor(FE): Allow null for select fields and track id fields 2026-01-12 14:12:12 +07:00
randy-ar 470add1563 fix(FE): fix report debt supplier filters date type 2026-01-12 14:11:45 +07:00
randy-ar 114658f198 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-12 14:01:35 +07:00
randy-ar d01bfe33a8 fix(FE): fix pagination report debt supplier 2026-01-12 14:01:03 +07:00
Rivaldi A N S 47ba16b20a Merge branch 'fix/finance-and-recording-adjustment' into 'development'
[FIX/FE] Adjust Biaya and Recording

See merge request mbugroup/lti-web-client!155
2026-01-12 06:46:30 +00:00
randy-ar d6c6211937 feat(FE): report sapronak calculation per kandang 2026-01-12 13:44:03 +07:00
ValdiANS 536b1c5b01 chore: uninstall supabase 2026-01-12 13:05:16 +07:00
ValdiANS f84fcb78b8 chore: delete supabase related code 2026-01-12 13:04:46 +07:00
ValdiANS aec5c89979 feat: create Daily Checklist Report type 2026-01-12 12:56:42 +07:00
ValdiANS f46a0610f5 feat: integrate Daily Checklist Report to API 2026-01-12 12:55:31 +07:00
randy-ar d879acc001 feat(FE): workaround general information closing kandang 2026-01-12 12:44:28 +07:00
rstubryan 8516929056 refactor(FE): Rename hand_* to hen_* and egg_mesh to egg_mass 2026-01-12 11:56:52 +07:00
rstubryan 595f2b5e9b refactor(FE): Require approval step 5 for realization 2026-01-12 11:32:17 +07:00
rstubryan 6a4e8776bd refactor(FE): Update approval steps and PDF nominal logic 2026-01-12 11:19:01 +07:00
rstubryan ec16c6c47e refactor(FE): Add Unit VP approval and rename Manager 2026-01-12 11:11:11 +07:00
rstubryan 2b2dd0a026 feat(FE): Add 5MB file size check and show form errors 2026-01-12 10:56:02 +07:00
ValdiANS a8c12d0c92 feat(FE): create type for daily checklist dashboard 2026-01-12 10:47:00 +07:00
ValdiANS 334bd08e60 feat: integrate Daily Checklist Dashboard to API integration 2026-01-12 10:46:19 +07:00
Rivaldi A N S ddd9a3d2da Merge branch 'feat/finance-debt-supplier-report' into 'development'
[FEAT/FE] Debt Supplier Report

See merge request mbugroup/lti-web-client!154
2026-01-12 02:55:53 +00:00
Rivaldi A N S 2b1d5290f3 Merge branch 'dev/randy' into 'feat/finance-debt-supplier-report'
[FEAT/FE] Debt Supplier Report

See merge request mbugroup/lti-web-client!153
2026-01-12 02:55:10 +00:00
randy-ar 935588b30e feat(FE): API integration debt supplier report 2026-01-11 21:07:01 +07:00
randy-ar 677025b4a2 feat(FE): API integration debt supplier report 2026-01-11 21:02:58 +07:00
randy-ar 0da9f9d651 feat(FE): API integration dashboard 2026-01-11 19:15:22 +07:00
randy-ar c752cad057 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-11 00:16:49 +07:00
randy-ar cdfb59a70b feat(FE): adding report debt supplier report with temporary data types and dummy data 2026-01-11 00:16:12 +07:00
Rivaldi A N S 91fcbffab6 Merge branch 'feat/dashboard' into 'development'
[FEAT/FE] Slicing UI Dashboard and Integrate With Dummy Data

See merge request mbugroup/lti-web-client!152
2026-01-10 07:34:57 +00:00
Rivaldi A N S 33e3b86b82 Merge branch 'dev/randy' into 'feat/dashboard'
[FEAT/FE] Slicing UI Dashboard and Integrate With Dummy Data

See merge request mbugroup/lti-web-client!151
2026-01-10 07:33:05 +00:00
randy-ar a012707bae chore(FE): pull development 2026-01-10 08:11:45 +07:00
randy-ar 00bc644ea9 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-10 08:10:18 +07:00
randy-ar 126346dc52 feat(FE): slicing ui dashboard, API integration with dummy data and form validation 2026-01-10 08:09:29 +07:00
randy-ar 777b06c690 feat(FE): slicing UI dashboard and define data types 2026-01-09 16:48:38 +07:00
Rivaldi A N S 1f96100390 Merge branch 'dev/restu' into 'development'
[FEAT/FE] Add Customer Payment Control Report Page

See merge request mbugroup/lti-web-client!150
2026-01-09 09:30:35 +00:00
rstubryan 7e5898a253 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-09 15:37:49 +07:00
Rivaldi A N S 86651d3f3f Merge branch 'feat/FE/daily-checklist' into 'development'
[FEAT/FE] Daily Checklist

See merge request mbugroup/lti-web-client!149
2026-01-09 08:35:03 +00:00
ValdiANS ebd3e14f0e Merge branch 'development' into feat/FE/daily-checklist 2026-01-09 15:32:27 +07:00
ValdiANS e9a1f4298f chore: add activity_count 2026-01-09 15:30:58 +07:00
ValdiANS cc8f258c41 feat: create Daily Checklist type 2026-01-09 15:30:45 +07:00
ValdiANS f60a07bc5b feat: create Daily Checklist API Service 2026-01-09 15:30:37 +07:00
ValdiANS 6dc93b1065 chore: add activity_count 2026-01-09 15:28:29 +07:00
ValdiANS 76c68d0d79 chore: make select scrollable 2026-01-09 15:23:56 +07:00
rstubryan f1ed22ff22 refactor(FE): Format numbers and currencies in payment XLSX 2026-01-09 15:16:54 +07:00
rstubryan d478ef5e22 refactor(FE): Remove date_type filter and hardcode filter_by 2026-01-09 15:08:21 +07:00
rstubryan 6643fe5a60 refactor(FE): Move filters into modal and refactor filter state 2026-01-09 14:58:41 +07:00
rstubryan 7a6b003cb9 feat(FE): Add Customer Payment report with export features 2026-01-09 14:42:23 +07:00
rstubryan e6cee4a93a feat(FE): Add finance report API and customer payment types 2026-01-09 14:41:21 +07:00
rstubryan c61ef5471b feat(FE): Add finance report route and menu link 2026-01-09 14:40:27 +07:00
ValdiANS c9c618e3f8 feat: integrate DetailDailyChecklistContent component to API 2026-01-09 14:13:14 +07:00
ValdiANS ceb7cb6b2d feat: integrate ListDailyChecklistContent component to API 2026-01-09 14:12:36 +07:00
ValdiANS f765895988 feat: integrate DailyChecklistContent component to API 2026-01-09 14:12:12 +07:00
ValdiANS b1715172db chore: update react and react-dom to safe version 2026-01-09 14:10:31 +07:00
Rivaldi A N S d84b2583d8 Merge branch 'dev/restu' into 'development'
[FEAT/FE] Refactor Closing (Keuangan) & Takeout Closing (Penjualan)

See merge request mbugroup/lti-web-client!148
2026-01-09 06:24:06 +00:00
rstubryan f38cebc0d9 refactor(FE): Limit Location select options to 100 2026-01-09 13:02:20 +07:00
rstubryan 7951754722 refactor(FE): Generate HPP table from static rows with defaults 2026-01-09 12:46:19 +07:00
rstubryan 4fc689898f refactor(FE): Use optional chaining for summary_hpp fields 2026-01-09 12:33:21 +07:00
rstubryan 69d7f65b76 refactor(FE): Disable sales tab and related data fetching 2026-01-09 12:31:53 +07:00
Rivaldi A N S b626c2805f Merge branch 'dev/restu' into 'development'
[FEAT/FE] Add Uniformity Chart Data (Ideal and Outside Range)

See merge request mbugroup/lti-web-client!147
2026-01-09 03:51:22 +00:00
rstubryan 97c16ce596 refactor(FE): Initialize and use current gauge week index 2026-01-09 10:46:05 +07:00
rstubryan 88e3ec7bbc refactor(FE): Reduce default query limit to 100 2026-01-09 09:48:54 +07:00
rstubryan 3ce30115f8 refactor(FE): Add validation and error messages to filter modal 2026-01-09 09:30:51 +07:00
rstubryan 4fdfe63dc9 refactor(FE): Remove document_path from movement payload 2026-01-09 09:24:46 +07:00
rstubryan badb1e141a refactor(FE): Deduplicate delivery documents by filename 2026-01-09 08:29:21 +07:00
rstubryan c894f26d18 refactor(FE): Handle ideal/outside ranges in uniformity tooltip 2026-01-08 13:52:23 +07:00
rstubryan 3b9599d169 refactor(FE): Set peer flag in package-lock.json 2026-01-08 13:51:28 +07:00
rstubryan 9a9a9c0cb5 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-08 13:18:22 +07:00
Rivaldi A N S b69126ed84 Merge branch 'feat/FE/daily-checklist' into 'development'
[FEAT/FE] Daily Checklist

See merge request mbugroup/lti-web-client!146
2026-01-08 06:18:03 +00:00
rstubryan 91b0bf7c27 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-08 13:15:31 +07:00
Rivaldi A N S 1b2a45f9ac Merge branch 'feat/FE/refactor-submission-form' into 'development'
[FEAT/FE] Refactor Submission Form (Alert Error and Submit Button) & Adjust Uniformity Page

See merge request mbugroup/lti-web-client!145
2026-01-08 06:13:10 +00:00
rstubryan cb62416552 refactor(FE): Increase file upload limit to 5 MB 2026-01-08 12:40:35 +07:00
rstubryan d2781b0a89 refactor(FE): Validate Uniformity form and show error list 2026-01-08 12:38:07 +07:00
rstubryan 325f3f1bd8 refactor(FE): Display form error list in purchase forms 2026-01-08 12:35:16 +07:00
rstubryan 346c731c42 refactor(FE): Display Formik validation errors in alert list 2026-01-08 12:31:25 +07:00
rstubryan 61766d3255 refactor(FE): Show validation error list before submit 2026-01-08 12:27:26 +07:00
rstubryan 0898892f15 feat(FE): Show unique form errors and improve product form 2026-01-08 11:11:58 +07:00
rstubryan 3dd4a9cebc refactor(FE): Reset submission flag when clearing uniformity filters 2026-01-08 10:51:47 +07:00
rstubryan 549e15499c feat(FE): Add CV field and section bottom margin 2026-01-08 10:42:07 +07:00
rstubryan a4a07f2ce9 refactor(FE): Remove on-demand weight fetch and show empty state 2026-01-08 10:39:21 +07:00
rstubryan 6930696692 refactor(FE): Lazy-load uniformity details and show spinner 2026-01-08 10:37:17 +07:00
rstubryan 7df9559f35 refactor(FE): Move sampling and result tables to UniformityDetail 2026-01-08 10:29:08 +07:00
rstubryan eeeb0a404c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/refactor-submission-form 2026-01-08 10:23:50 +07:00
rstubryan b3c4a438ad refactor(FE): Use chart_data for Uniformity and add week nav 2026-01-08 10:17:31 +07:00
ValdiANS a9e6f7155e Merge branch 'development' into feat/FE/daily-checklist 2026-01-08 10:04:32 +07:00
ValdiANS 3d94474d7c chore: add supabase client 2026-01-08 09:56:29 +07:00
ValdiANS 4872a53a25 chore: adjust styling for search input 2026-01-08 09:56:05 +07:00
rstubryan 662dec38bc refactor(FE): Add with_chart param to date filter 2026-01-08 09:51:10 +07:00
Rivaldi A N S 9f0cefe91c Merge branch 'dev/randy' into 'development'
[FEAT/FE] Adding helper function for alert list error formik

See merge request mbugroup/lti-web-client!144
2026-01-08 02:50:32 +00:00
rstubryan 3cb6bfcf52 feat(FE): Add chart data types to Uniformity API types 2026-01-08 09:47:33 +07:00
ValdiANS 7d4869fbdc feat: create type for Phase 2026-01-08 09:41:50 +07:00
ValdiANS 4ae36ee3f0 feat: create type for Phase Activity 2026-01-08 09:41:44 +07:00
ValdiANS 21acb09f0c feat: create type for Master Employee 2026-01-08 09:41:24 +07:00
ValdiANS f17bc1493b feat: create Phase API Service 2026-01-08 09:41:01 +07:00
ValdiANS 6943cd3903 feat: create Phase Activity API Service 2026-01-08 09:40:53 +07:00
ValdiANS 14b63dd0f1 feat: create Employee API Service 2026-01-08 09:40:40 +07:00
ValdiANS db4d9ad38c feat: integrate MasterEmployeeContent component to API 2026-01-08 09:40:02 +07:00
ValdiANS 06dd9a3609 feat: integrate MasterAktivitasContent component to API 2026-01-08 09:39:50 +07:00
ValdiANS 5ba58c92d4 feat: add daily checklist route permissions 2026-01-08 09:39:21 +07:00
ValdiANS d44de5a363 feat: add daily checklist menu 2026-01-08 09:39:02 +07:00
ValdiANS b70ae164e1 feat: format pathname 2026-01-08 09:38:42 +07:00
ValdiANS f89236bb5e feat: create Daily Checklist Report page 2026-01-08 09:38:32 +07:00
ValdiANS 4759a82034 feat: create Master Data Employee page 2026-01-08 09:38:22 +07:00
ValdiANS 866bd90b3d feat: create Master Activity page 2026-01-08 09:38:09 +07:00
ValdiANS b0dfc7f31c feat: create Detail Daily Checklist page 2026-01-08 09:37:57 +07:00
ValdiANS 561a9fe186 feat: add layout file for detail of daily checklist list page 2026-01-08 09:37:35 +07:00
rstubryan dbdfd2c50b refactor(FE): Remove location, project_flock and kandang fields 2026-01-08 09:37:05 +07:00
ValdiANS afc102e618 feat: create Daily Checklist List page 2026-01-08 09:36:54 +07:00
ValdiANS 7736fce5bb feat: create Daily Checklist Dashboard page 2026-01-08 09:36:43 +07:00
ValdiANS 04dcf110a3 feat: create Daily Checklist page 2026-01-08 09:35:58 +07:00
ValdiANS 53bca6170f feat: add SonnerToaster 2026-01-08 09:35:46 +07:00
ValdiANS 20e27dccc1 chore: import figma-make theme styling 2026-01-08 09:34:52 +07:00
rstubryan 965dc01e86 feat(FE): Add location, project flock, and kandang fields 2026-01-08 09:27:51 +07:00
randy-ar 64a0a9c8a8 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-08 09:25:20 +07:00
randy-ar 0ed30e184b feat(FE): implement alert error list in marketing module 2026-01-08 09:19:55 +07:00
randy-ar 13205ca80a feat(FE): adding alert errors message for project flock and fixing bug approval status in chickin 2026-01-08 08:59:27 +07:00
rstubryan 0d6e229ee5 refactor(FE): Allow null for document_path in schema 2026-01-07 18:11:12 +07:00
rstubryan 319afa3faf refactor(FE): Require positive IDs in movement form schema 2026-01-07 18:01:26 +07:00
rstubryan 6da6cf699f refactor(FE): Require warehouse IDs to be at least 1 2026-01-07 17:50:44 +07:00
rstubryan ca830f8e3d Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/refactor-submission-form 2026-01-07 17:42:35 +07:00
rstubryan 22be41058f refactor(FE): Normalize Tailwind classnames in MovementForm 2026-01-07 17:35:55 +07:00
rstubryan c4debcecce refactor(FE): Add default empty product and delivery rows 2026-01-07 16:18:02 +07:00
rstubryan 6fdff6706d refactor(FE): Clear file input on form reset 2026-01-07 15:54:16 +07:00
rstubryan d5b4111ae4 refactor(FE): Remove travel_document_path field and handling 2026-01-07 15:46:58 +07:00
Rivaldi A N S 2df86e7be8 Merge branch 'fix/chickins-approval' into 'development'
[FIX/FE] Fix chickins approval

See merge request mbugroup/lti-web-client!143
2026-01-07 08:27:40 +00:00
Rivaldi A N S 6efe44ba55 Merge branch 'dev/randy' into 'fix/chickins-approval'
[FIX/FE] Fix chickins approval

See merge request mbugroup/lti-web-client!142
2026-01-07 08:24:59 +00:00
randy-ar c766f53753 fix(FE): fix chickins approvals status 2026-01-07 15:16:40 +07:00
rstubryan 38dfeec892 refactor(FE): Move movement error to top and remove isValid check 2026-01-07 15:11:36 +07:00
rstubryan cf8ed9ccad refactor(FE): Use expedition vendor id fallback in mapping 2026-01-07 15:06:43 +07:00
rstubryan 90c61cbdf6 refactor(FE): Only disable submit button during submission 2026-01-07 15:01:57 +07:00
rstubryan bfcdb9883d refactor(FE): Move purchase order error alert below heading 2026-01-07 14:53:24 +07:00
rstubryan b0a1b837d0 refactor(FE): Move error alert to top of purchase forms 2026-01-07 14:45:38 +07:00
rstubryan 09ae619829 refactor(FE): Stop blocking Submit on form validity 2026-01-07 14:41:54 +07:00
rstubryan 59f4528841 refactor(FE): Stop disabling Submit when form is invalid 2026-01-07 14:39:43 +07:00
rstubryan d049f6c34f refactor(FE): Tighten product form validation and layout 2026-01-07 14:21:37 +07:00
rstubryan 8b7ed9e46b refactor(FE): Move error alert above form 2026-01-07 14:09:47 +07:00
rstubryan e6172be81e refactor(FE): Allow submit when invalid and move error alert 2026-01-07 14:08:04 +07:00
rstubryan 324b9b14ef refactor(FE): Move form error above fields 2026-01-07 14:07:02 +07:00
rstubryan a10c20394d Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/refactor-submission-form 2026-01-07 14:01:45 +07:00
rstubryan ff2d53a0b7 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-07 14:01:30 +07:00
Rivaldi A N S 42d8896ab7 Merge branch 'fix/FE/route-permission' into 'development'
[FIX/FE] Format pathname for route permission

See merge request mbugroup/lti-web-client!141
2026-01-07 06:57:59 +00:00
ValdiANS 50d499005d fix: format pathname 2026-01-07 13:57:00 +07:00
Rivaldi A N S b421bc48d0 Merge branch 'fix/FE/US-340/marketing-report' into 'development'
[FIX/FE] Adjust marketing report endpoint

See merge request mbugroup/lti-web-client!140
2026-01-07 06:03:34 +00:00
ValdiANS f7986149e8 fix: adjust marketing report endpoint 2026-01-07 13:01:32 +07:00
rstubryan 309a9ecc86 refactor(FE): Increase upload file size limit to 5 MB 2026-01-07 11:38:28 +07:00
ValdiANS d30979f5cd feat: add figma-make style 2026-01-07 11:21:28 +07:00
Rivaldi A N S 43cd3abe02 Merge branch 'dev/randy' into 'development'
[FIX/FE] Adding current stock information in SO and DO marketing

See merge request mbugroup/lti-web-client!139
2026-01-07 04:19:55 +00:00
ValdiANS 770f363c60 feat: add figma make components 2026-01-07 10:59:12 +07:00
ValdiANS 88c6c863e7 feat: install dependencies for components from figma make 2026-01-07 10:58:09 +07:00
randy-ar ba84e718cb Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-07 10:52:12 +07:00
Rivaldi A N S fed2bf7878 Merge branch 'dev/restu' into 'development'
[HOTFIX/FE][US#281-391] Adjustment Uniformity, Purchase and Expense

See merge request mbugroup/lti-web-client!138
2026-01-07 02:15:53 +00:00
rstubryan 6f90bd604a feat(FE): Enforce 2MB file limit and improve FileInput 2026-01-06 20:38:51 +07:00
rstubryan fa199e4879 refactor(FE): Support add/edit type and use ProductPrice for add 2026-01-06 20:25:09 +07:00
rstubryan 46c06ea548 refactor(FE): Support add/edit type and use ProductPrice for add 2026-01-06 20:24:29 +07:00
rstubryan fd868eaa0c refactor(FE): Add ProductPrice and SellingPrice fields to types 2026-01-06 20:12:47 +07:00
rstubryan 8dfccf25d8 refactor(FE): Truncate delivery document name in MovementForm 2026-01-06 19:32:13 +07:00
randy-ar 5d8dfca3b5 fix(FE): shows delivery number when status marketing is delivery in marketing detail page 2026-01-06 16:06:26 +07:00
randy-ar aee0ad8a20 feat(FE): adding stok information in form repeater SO and DO 2026-01-06 14:42:52 +07:00
rstubryan 2fa086bb32 refactor(FE): Prefer latest_approval action and add file_name 2026-01-06 14:01:01 +07:00
randy-ar 0af612703a fix(FE): remove pullet table, change doc table to conditional data base on project flock category 2026-01-06 13:46:18 +07:00
rstubryan f22c4e4798 refactor(FE): Adjust expense status badge colors 2026-01-06 13:32:59 +07:00
randy-ar 841aadc107 fix(FE): fixing issue reject modal show up when creating project flock 2026-01-06 13:29:05 +07:00
rstubryan f31a80340b refactor(FE): Check delete API response before showing toast 2026-01-06 11:04:54 +07:00
rstubryan 727fd2ad43 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-06 10:46:24 +07:00
rstubryan a4275f4b66 refactor(FE): Support UniformityDetail in confirmation preview 2026-01-06 10:46:05 +07:00
Rivaldi A N S 9ac5e0ee76 Merge branch 'dev/restu' into 'development'
[HOTFIX/FE][US#439-281-352-391] Fix Issue Based on UAT Revision and Taiga

See merge request mbugroup/lti-web-client!137
2026-01-06 03:30:14 +00:00
rstubryan 24499d110a refactor(FE): Refactor Uniformity charts to use API data 2026-01-06 08:36:23 +07:00
rstubryan c24aebe02d refactor(FE): Highlight ideal ranges in Uniformity charts 2026-01-05 15:29:52 +07:00
rstubryan fd32b55ad9 refactor(FE): Provide defaults for missing info_umum fields 2026-01-05 15:13:00 +07:00
rstubryan d2b19cbd7b refactor(FE): Force form remount on initialValues change 2026-01-05 15:07:09 +07:00
rstubryan 2c29cffa45 refactor(FE): Remove overflow-visible class from table wrapper 2026-01-05 14:50:10 +07:00
rstubryan 476cf2fa29 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-05 13:47:41 +07:00
Rivaldi A N S 1797498df2 Merge branch 'dev/randy' into 'development'
[FIX/FE][US#304] Adjust Permission for Finance and Marketing

See merge request mbugroup/lti-web-client!135
2026-01-05 06:47:30 +00:00
randy-ar f7d1beffcf Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2026-01-05 13:46:45 +07:00
rstubryan ac6e7c6d36 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-05 13:46:33 +07:00
rstubryan d7ef86e24b refactor(FE): Add default page/limit to location and flock queries 2026-01-05 13:46:21 +07:00
Rivaldi A N S 3dff72b0f0 Merge branch 'feat/FE/US-335/production-data-report' into 'development'
[FEAT/FE][US#335] Production Data Report

See merge request mbugroup/lti-web-client!136
2026-01-05 06:46:17 +00:00
ValdiANS eea76e77a8 chore: update displayed data 2026-01-05 13:42:20 +07:00
randy-ar 11f9a685a8 fix(FE): permission for balance injection in finance detail page 2026-01-05 13:42:01 +07:00
ValdiANS c863ebc2af chore: update ClosingProductionData type 2026-01-05 13:41:16 +07:00
randy-ar e8aea0a27e fix(FE): resolve merge conflict 2026-01-05 13:13:37 +07:00
randy-ar 79cf777b11 fix(FE): merge with branch development 2026-01-05 13:11:03 +07:00
randy-ar 203782c258 fix(FE): adjust permission finance 2026-01-05 13:05:10 +07:00
Rivaldi A N S 0a0a1a23f9 Merge branch 'feat/FE/US-81/production-result-report' into 'development'
[FEAT/FE][US#81] Production Result Report

See merge request mbugroup/lti-web-client!134
2026-01-05 04:34:21 +00:00
ValdiANS f9f4c5b67c Merge branch 'development' into feat/FE/US-81/production-result-report 2026-01-05 11:30:28 +07:00
ValdiANS 98107373e8 Merge branch 'development' into feat/FE/US-81/production-result-report 2026-01-05 11:30:04 +07:00
ValdiANS 9838cf347b feat(FE-443,444): create exportProductionResultToExcel method 2026-01-05 11:27:38 +07:00
ValdiANS f183ee5c7a chore: update permission name 2026-01-05 11:23:47 +07:00
ValdiANS 2ab2cd6d99 chore: adjust header column styling 2026-01-05 11:19:59 +07:00
ValdiANS 1571d79685 chore: disabled export button if filter is not selected yet 2026-01-05 11:18:19 +07:00
ValdiANS 5e3648b385 chore: update permission name from lti.finance.transaction to lti.finance.transactions 2026-01-05 11:11:34 +07:00
rstubryan 62b05bf9c0 refactor(FE): Add week navigation to UniformityGaugeChart 2026-01-05 09:11:54 +07:00
rstubryan 7579cd5533 refactor(FE): Remove Kandang prop and center Uniformity gauge 2026-01-05 08:56:09 +07:00
rstubryan 174e5ed1a3 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2026-01-05 08:36:15 +07:00
kris c6e9e98ce1 Update .gitlab-ci.yml file 2026-01-03 12:42:09 +00:00
randy-ar 9562ce7b40 fix(FE): remove bypass permission in marketing detail and form page 2026-01-02 15:11:06 +07:00
rstubryan 57fa67c05a refactor(FE): Support MovementDocument in movement form 2026-01-02 14:22:57 +07:00
Rivaldi A N S eadb08879d Merge branch 'fix/FE/redirect-to-sso' into 'development'
[FIX/FE] Redirect to SSO

See merge request mbugroup/lti-web-client!133
2026-01-02 07:10:30 +00:00
Rivaldi A N S 50b8b77f22 Merge branch 'dev/randy' into 'development'
[FIX/FE][US#284] Fix sapronak calculation data types

See merge request mbugroup/lti-web-client!132
2026-01-02 06:55:56 +00:00
ValdiANS 045913d05f chore: lint 2026-01-02 13:28:46 +07:00
ValdiANS b53c8b99a0 chore: refresh user session when user first enter the web 2026-01-02 12:40:07 +07:00
randy-ar f23d369e02 fix(FE): integrate search filter marketing 2026-01-02 10:15:50 +07:00
randy-ar d6b8b10183 fix(FE): remove bypass permission and integrate table filter 2026-01-02 10:04:56 +07:00
rstubryan 1c77deeee7 refactor(FE): Move Movement FormData into API service 2026-01-02 10:00:14 +07:00
rstubryan 6a3d2c0dcd refactor(FE): Drop refresh prop and simplify UniformityTable 2026-01-02 09:07:30 +07:00
rstubryan b1f4b4dc4b refactor(FE): Refresh uniformities on successful mutation 2026-01-02 09:03:42 +07:00
rstubryan a518895096 refactor(FE): Conditionally render sampling and result sections 2026-01-02 08:47:08 +07:00
randy-ar 046fb74cab fix(FE-284): adjust data types for sapronak calculation 2025-12-31 15:18:17 +07:00
kris 00f09364b1 Update .gitlab-ci.yml file 2025-12-31 07:44:43 +00:00
kris 02c5cddc94 Update .gitlab-ci.yml file 2025-12-31 07:32:33 +00:00
kris 9f079c1e52 Update .gitlab-ci.yml file 2025-12-31 07:26:27 +00:00
rstubryan c32074d72c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-31 14:12:56 +07:00
kris 7d46e3dc2e Update .gitlab-ci.yml file 2025-12-31 06:57:40 +00:00
rstubryan e7b53efa4b Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-31 13:57:28 +07:00
Rivaldi A N S aebb9a0b28 Merge branch 'hotfix-finance-and-production' into 'development'
[HOTFIX/FE][US][TASK] Hotfix bypass permission di marketing

See merge request mbugroup/lti-web-client!131
2025-12-31 06:42:53 +00:00
randy-ar 4ec62c936e hotfix(FE): bypass permission marketing 2025-12-31 13:32:11 +07:00
randy-ar f7ae1f835f Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into hotfix-finance-and-production 2025-12-31 13:29:09 +07:00
randy-ar 3769309ce3 hotfix(FE): bypass permission marketinh 2025-12-31 13:28:27 +07:00
randy-ar 15b3151c5f fix(FE): fix perhitungan sapronak 2025-12-31 13:18:22 +07:00
Rivaldi A N S b0707db551 Merge branch 'hotfix/master-data' into 'development'
[HOTFIX/FE] Master Data Warehouse

See merge request mbugroup/lti-web-client!130
2025-12-31 06:12:22 +00:00
randy-ar 1a8d794a66 fix(FE): fix finance party select 2025-12-31 13:10:58 +07:00
ValdiANS 1b7e8a342f fix: fix onInputChange of kandang select input 2025-12-31 13:10:58 +07:00
rstubryan f08fae4f77 refactor(FE): Enable reinitialize and map expedition vendor 2025-12-31 13:00:48 +07:00
randy-ar 6cd09a413d fix(FE): fix delete reseponse project flock 2025-12-31 12:25:08 +07:00
Rivaldi A N S 84eb34a9dd Merge branch 'dev/restu' into 'development'
[HOTFIX/FE] Fix Issue Purchase Expedition Vendor Name

See merge request mbugroup/lti-web-client!129
2025-12-31 05:16:54 +00:00
rstubryan 37317ed95c fix(FE): Make expedition_vendor optional and nullable 2025-12-31 11:58:45 +07:00
rstubryan 201c9249cc fix(FE): Make expedition_vendor optional and nullable 2025-12-31 11:58:14 +07:00
rstubryan 46dfacae23 refactor(FE-Fix): Use optional chaining for expedition vendor name 2025-12-31 11:53:40 +07:00
Rivaldi A N S d856b35e24 Merge branch 'feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page' into 'development'
[FEAT/FE][US#281/TASK-316-317] Uniformity Page and Adjustment Purchase Accept Issue

See merge request mbugroup/lti-web-client!128
2025-12-31 04:29:45 +00:00
rstubryan 28c94e3e1d refactor(FE): Show expedition vendor name in order detail 2025-12-31 11:21:35 +07:00
rstubryan a1e8f582ba refactor(FE-316,317,438): Move Uniformity feature under production
namespace
2025-12-31 11:17:26 +07:00
rstubryan f3f552bd16 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page 2025-12-31 11:02:37 +07:00
rstubryan 5af00faa32 feat(FE): Add travel document upload to purchase form 2025-12-31 11:02:06 +07:00
Rivaldi A N S f0dcb6b8ca Merge branch 'feat/FE/refresh-user-session' into 'development'
[FEAT/FE] Refresh user session

See merge request mbugroup/lti-web-client!127
2025-12-31 03:47:29 +00:00
rstubryan e32b9ddcb2 feat(FE-316): Display created uniformity in confirmation preview 2025-12-31 10:37:21 +07:00
ValdiANS 57ef4109f7 feat: refresh user session 2025-12-31 10:34:07 +07:00
rstubryan ef3611e7fc refactor(FE-316): Rename document_name to file_name and add standard 2025-12-31 10:20:59 +07:00
rstubryan 0090961ec0 refactor(FE-316): Support localized uniformity statuses and fields 2025-12-31 10:17:39 +07:00
rstubryan 640cf26970 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page 2025-12-31 10:03:37 +07:00
Rivaldi A N S d1d0692e2e Merge branch 'feat/FE/US-281-439/TASK-440-441-recording-page-and-form-adjustment' into 'development'
[FEAT/FE][US#281-439/TASK-440-441] Recording Page and Form Adjustment

See merge request mbugroup/lti-web-client!125
2025-12-31 03:01:09 +00:00
rstubryan 6b13794ee5 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281-439/TASK-440-441-recording-page-and-form-adjustment 2025-12-31 09:44:10 +07:00
rstubryan 8e88355894 refactor(FE-441): Refactor RecordingForm layout and labels 2025-12-31 09:43:05 +07:00
Rivaldi A N S 1b98e5d4d8 Merge branch 'feat/FE/US-81/production-result-report' into 'development'
[FEAT/FE][US#81] Production Result Report

See merge request mbugroup/lti-web-client!126
2025-12-31 02:42:23 +00:00
rstubryan d8daf09844 refactorF(FE-441): Display formatted fcr_std in RecordingForm 2025-12-31 09:20:49 +07:00
ValdiANS 0bb9aee139 chore: set dummy permission 2025-12-31 09:09:55 +07:00
Rivaldi A N S 306b8d3bf3 Merge branch 'hotfix/dashboard-permission' into 'development'
[HOTFIX/FE][US#390] Hotfix temporary permission for dashboard and finance

See merge request mbugroup/lti-web-client!124
2025-12-31 02:06:42 +00:00
rstubryan 2bf764a05c refactor(FE-441): Display '-' for empty/zero numeric fields 2025-12-31 09:02:15 +07:00
rstubryan 6c3285f624 refactor(FE-441): Make recording metrics grid responsive 2025-12-31 08:54:15 +07:00
rstubryan afb79b0589 feat(FE-441): Format and display intake, hand house, and totals 2025-12-31 08:50:51 +07:00
rstubryan 4f571f1c16 feat(FE-441): Show laying metrics and extend ProductionMetrics 2025-12-31 08:40:56 +07:00
rstubryan 81ca60a09b Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281-439/TASK-440-441-recording-page-and-form-adjustment 2025-12-31 08:22:40 +07:00
randy-ar 23453eb8f5 hotfix(FE): change temporary permission for dashboard, finance and master data standard 2025-12-30 23:52:13 +07:00
Rivaldi A N S 3dc32da834 Merge branch 'feat/FE/US-81/production-result-report' into 'development'
[FEAT/FE][US#81/TASK-442] Production Result Report

See merge request mbugroup/lti-web-client!123
2025-12-30 16:02:58 +00:00
ValdiANS f089492830 chore: adjust closing data type 2025-12-30 22:49:39 +07:00
rstubryan 3412994d15 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page 2025-12-30 22:43:23 +07:00
ValdiANS 6eaa92dfd4 Merge branch 'development' into feat/FE/US-81/production-result-report 2025-12-30 22:30:56 +07:00
rstubryan 8d668429e1 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281-439/TASK-440-441-recording-page-and-form-adjustment 2025-12-30 22:29:28 +07:00
rstubryan 8d1a3b665e refactor(FE-440): Use styled HTML tables for FCR and mortality 2025-12-30 22:29:15 +07:00
ValdiANS 7b99bae197 feat(FE-443): create ProductionResult type 2025-12-30 22:27:59 +07:00
ValdiANS dad169d854 feat(FE-443): create ProductionResultReportApiService 2025-12-30 22:27:33 +07:00
ValdiANS f985c041e4 chore: create getAll method in BaseApiService 2025-12-30 22:26:43 +07:00
ValdiANS 5326eff293 feat(FE-442): add laporan hasil produksi route permission 2025-12-30 22:26:29 +07:00
ValdiANS d66bd8c606 feat(FE-442): add Laporan Hasil Produksi menu 2025-12-30 22:25:53 +07:00
ValdiANS ea5ad20684 feat(FE-442): create ProductionResultProjectFlockKandangTable component 2025-12-30 22:25:27 +07:00
ValdiANS 23ee8828f0 feat(FE-442): create ProductionResultContent component 2025-12-30 22:24:22 +07:00
ValdiANS 0dd2edfe01 feat(FE-442): create Production Result Report page 2025-12-30 22:22:23 +07:00
Rivaldi A N S 6edc278bdf Merge branch 'feat/FE/US-391/TASK-435-436-expense-adjustment' into 'development'
[FEAT/FE][US#391/TASK-435-436] Expense Adjustment

See merge request mbugroup/lti-web-client!122
2025-12-30 15:21:09 +00:00
Rivaldi A N S f81c49becb Merge branch 'dev/randy' into 'development'
[FIX/FE][US#337-390] Fix issue in finance and adding dummy dashboard

See merge request mbugroup/lti-web-client!121
2025-12-30 15:20:45 +00:00
rstubryan 03a9451fc8 feat(FE-441): Add FCR and mortality tables to detail view 2025-12-30 22:18:51 +07:00
rstubryan cc0b051a0a refactor(FE-440): Remove body_weights handling from recording forms 2025-12-30 21:55:37 +07:00
rstubryan 865438e3fb refactor(FE-436): Check kandang_id before showing kandang name 2025-12-30 21:26:40 +07:00
rstubryan d39b71e759 refactor(FE-436): Use fallback when kandang name missing 2025-12-30 21:21:35 +07:00
rstubryan 5e6b03ef08 refactor(FE-435,436): Use location name as fallback for expense titles 2025-12-30 21:17:37 +07:00
rstubryan c291ba3246 refactor(FE-435,436): Use S3 public base URL for document links 2025-12-30 20:52:12 +07:00
randy-ar ab2e7db9d0 fix(FE): error null in marketing 2025-12-30 20:32:23 +07:00
rstubryan 13c1a82142 refactor(FE-435,436): Select Nominal Biaya by approval step 2025-12-30 20:19:05 +07:00
rstubryan 6185fafb57 refactor(FE-435): Multiply qty by price when summing expenses 2025-12-30 19:56:31 +07:00
randy-ar 2ab7c10d5d feat(FE): adding column standard fcr in master data standar production 2025-12-30 19:53:50 +07:00
randy-ar bc6ebcfeda fix(FE): add optional chaining for sapronak calculation in closing odule 2025-12-30 19:34:32 +07:00
randy-ar 10fb9fc990 feat(FE-390): slicing UI and API integration for production dashboard 2025-12-30 19:30:52 +07:00
randy-ar 28639516d5 feat(FE-390): slicing UI and API integration for production dashboard 2025-12-30 19:29:42 +07:00
rstubryan 2bf0f2874e refactor(FE-435): Allow realizations without kandang 2025-12-30 19:28:38 +07:00
rstubryan a81a61135f refactor(FE-435,436): Exclude null kandang_id from expense payload 2025-12-30 19:03:26 +07:00
rstubryan d2e88c2061 refactor(FE-435,436): Allow optional kandang and location expenses 2025-12-30 18:53:46 +07:00
rstubryan 8f4f3d93b8 refactor(FE-435,436): Add location_id to expense form and payload 2025-12-30 18:38:59 +07:00
rstubryan 7daca04cc1 refactor(FE-435): Add required asterisks to table headers 2025-12-30 17:54:03 +07:00
rstubryan 2c5168badf Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-30 17:31:28 +07:00
rstubryan 73f4b486c0 refactor(FE-438): Increase vertical margin in table skeleton 2025-12-30 16:46:43 +07:00
rstubryan ed7ee1a268 refactor(FE-316): Refine Filter Modal layout and styles 2025-12-30 16:42:19 +07:00
rstubryan 4e7b91a7b4 refactor(FE-316): Add commented local API URL to UniformityApi 2025-12-30 16:07:35 +07:00
rstubryan 7c0581728e feat(FE-316): Use population instead of available_quantity 2025-12-30 14:41:06 +07:00
rstubryan 52cb440cb3 refactor(FE-316): Rename documents to document in uniformity 2025-12-30 13:35:24 +07:00
rstubryan 7c64870fed refactor(FE-316): Add submission state to apply filters 2025-12-30 11:46:43 +07:00
rstubryan 7290f242f4 feat(FE-438): Add Excel and PDF export for Uniformity table 2025-12-30 11:37:08 +07:00
rstubryan 9be09ae281 refactor(FE-438): Make filter modal and controls responsive 2025-12-30 10:55:43 +07:00
rstubryan 32088b916f refactor(FE-438): Refine Filter modal UI and controls 2025-12-30 10:39:37 +07:00
rstubryan f51236fcfc refactor(FE-316): Use single-select filters, add PF-Kandang lookup 2025-12-30 10:23:01 +07:00
rstubryan c385c42c8f feat(FE-316): Support multi-select filters in UniformityTable 2025-12-30 10:17:46 +07:00
rstubryan 02dc624036 feat(FE-316): Add filter modal and query params for Uniformity 2025-12-30 10:11:51 +07:00
rstubryan 4e5f9c710c refactor(FE-316): Replace bulk delete with single-item delete 2025-12-30 09:50:09 +07:00
randy-ar 2712821f4e fix(FE-337): fix finance input and transaction type 2025-12-30 09:25:54 +07:00
rstubryan d6849a48d2 refactor(FE-316): Rename file to documents in uniformity feature 2025-12-30 09:21:38 +07:00
rstubryan 2e44371c6c feat(FE-316): Add withpopulation query param to kandang lookup 2025-12-30 09:05:50 +07:00
rstubryan 98ae56a1aa feat(FE-438): Load uniformity details on demand 2025-12-29 22:22:09 +07:00
rstubryan 7fcab4d295 feat(FE-316): Add tooltip and remove control to file upload 2025-12-29 21:24:13 +07:00
rstubryan 550bcc426b refactor(FE-316): Rename fileName to file_name in uniformity forms 2025-12-29 21:04:25 +07:00
rstubryan 844ac01b70 refactor(FE-316): Clamp subtitle text and update export filename 2025-12-29 20:58:12 +07:00
rstubryan 9ef232bac5 refactor(FE-316): Polish Uniformity template and upload UI 2025-12-29 20:50:53 +07:00
rstubryan 34ec650a01 refactor(FE-316): Clarify instructions in uniformity template 2025-12-29 20:42:38 +07:00
rstubryan 1d27781c02 feat(FE-316): Add instruction sheet and format data sheet 2025-12-29 19:43:32 +07:00
rstubryan e81c0a3baf feat(FE-316): Add uniformity Excel template generator 2025-12-29 19:34:17 +07:00
rstubryan be0bdcd299 feat(FE-316): Show required data count in upload area 2025-12-29 17:52:26 +07:00
randy-ar 7e73c99074 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2025-12-29 16:35:11 +07:00
randy-ar 0f86ba0f2d fix(FE): adjust options in master data product 2025-12-29 15:52:43 +07:00
randy-ar 10a37fde75 fix(FE): fix delete and update button row in master data production standards 2025-12-29 15:01:42 +07:00
rstubryan 6ad1a3349b refactor(FE-316): Extract Uniformity confirmation preview component 2025-12-29 14:53:29 +07:00
rstubryan 3bb5d5e5a5 refactor(FE-316): Change upload file hint to .xlsx 2025-12-29 14:44:38 +07:00
rstubryan 3279fb30ce refactor(FE-316): Update template label to XLSX 2025-12-29 14:43:54 +07:00
rstubryan 34eae71b44 refactor(FE-316): Guard unsubscribe call with optional chaining 2025-12-29 14:43:11 +07:00
rstubryan 4f168b51c7 refactor(FE-316): Centralize uniformity types and add typings 2025-12-29 14:32:17 +07:00
rstubryan ded1cc1f62 refactor(FE-316): Extract uniformity slice and add types 2025-12-29 14:24:23 +07:00
rstubryan 39f2fc48a8 refactor(FE): Remove unnecessary comments in useEffect 2025-12-29 14:16:28 +07:00
rstubryan a72b22da6e Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page 2025-12-29 14:15:29 +07:00
rstubryan dc4e569453 refactor(FE-438): Remove unused view handler and simplify catch 2025-12-29 14:03:14 +07:00
rstubryan 17a6cee1e3 refactor(FE-438): Fix Uniformity component sample data and imports 2025-12-29 14:01:37 +07:00
rstubryan 5e32724d40 refactor(FE-438): Show approve/reject only when step is CREATED 2025-12-29 13:51:32 +07:00
randy-ar cd3a5ad441 feat(FE): adding production standard select options for project flock 2025-12-29 13:50:23 +07:00
rstubryan 11bd8b27b5 refactor(FE-438): Remove CV field from Uniformity preview 2025-12-29 13:46:27 +07:00
rstubryan 9a1a6a7e41 refactor(FE-316): Add cursor to buttons and enlarge close icon 2025-12-29 13:43:28 +07:00
rstubryan d02f919b76 refactor(FE-438): Rename uniformityDetails prop to uniformity_details 2025-12-29 13:37:18 +07:00
rstubryan 4529ee50e3 refactor(FE-316, 438): Move uniformity types into shared types file 2025-12-29 13:30:16 +07:00
randy-ar cd42bd6bc0 fix(FE): change hatchery to optional in master data supplier 2025-12-29 13:26:39 +07:00
rstubryan 4ed1e4f8b5 refactor(FE-438): Fix Uniformity gauge skeleton sizing 2025-12-29 13:22:18 +07:00
randy-ar ea7f8a68f4 fix(FE): change select option warehouse marketing to correct data warehouses 2025-12-29 13:19:16 +07:00
rstubryan 11a63f76b7 refactor(FE-438): Use shared DetailOptionType for result tables 2025-12-29 13:18:44 +07:00
rstubryan cd41d5daab refactor(FE-438): Extract uniformity status and weight helpers 2025-12-29 13:16:39 +07:00
rstubryan 9f2fcbf154 refactor(FE-438): Add uniformity details preview drawer 2025-12-29 12:08:30 +07:00
rstubryan 70d9b4d8ed feat(FE-438): Add approval badge to uniformity detail 2025-12-29 09:23:25 +07:00
rstubryan 39f70bd71b refactor(FE-438): Remove unused code from UniformityDetail 2025-12-28 21:25:45 +07:00
rstubryan 817f8a7010 refactor(FE-438): Update UniformityDetail header 2025-12-28 21:22:11 +07:00
rstubryan 2276df2790 feat(FE-438): Handle approve/reject via URL and add buttons 2025-12-28 21:19:38 +07:00
rstubryan 8ec76af012 feat(FE-438): Add Uniformity detail view and navigation 2025-12-28 20:58:59 +07:00
rstubryan 9f0dc8c644 refactor(FE-438): Localize modal buttons and stub uniformity details 2025-12-28 18:48:00 +07:00
rstubryan 2d0c8dbd3f refactor(FE-438): Refactor ConfirmationModal icon and update usages 2025-12-28 17:46:27 +07:00
rstubryan 8224dbf8ec refactor(FE-438): Rework confirmation modals and add bulk approve 2025-12-28 17:08:47 +07:00
rstubryan 6e4462e217 feat(FE-438): Add approve/reject flows to UniformityTable 2025-12-28 16:58:29 +07:00
rstubryan b1ccad081d refactor(FE-438): Add icon position/size and subtitle to modal 2025-12-28 16:44:01 +07:00
rstubryan c0a818af7e feat(FE-438): Add bulk approve/reject/delete and FAB 2025-12-28 14:32:14 +07:00
Rivaldi A N S e0371b0884 Merge branch 'feat/FE/US-388/master-data-uniformity-standard' into 'development'
[FEAT/FE][US#388] Master Data Standar Produksi

See merge request mbugroup/lti-web-client!118
2025-12-28 07:15:27 +00:00
rstubryan 8a6f78ef84 feat(FE-316): Show details table in success confirmation modal 2025-12-28 14:06:30 +07:00
rstubryan b2c09bb7c7 refactor(FE-316): Reset uniformity state on drawer close 2025-12-28 13:56:32 +07:00
rstubryan c550922974 refactor(FE-316): Use real data and formatting in uniformity results 2025-12-28 13:52:59 +07:00
Rivaldi A N S 432d837aaf Merge branch 'dev/randy' into 'feat/FE/US-388/master-data-uniformity-standard'
[FEAT/FE][US#388] Master Data Standar Produksi

See merge request mbugroup/lti-web-client!116
2025-12-28 05:23:38 +00:00
rstubryan b24fb54856 refactor(FE-316): Update uniformity payload/fields and file handling 2025-12-28 11:50:14 +07:00
rstubryan f37eea687a feat(FE-316): Show success modal after creating uniformity 2025-12-28 10:17:29 +07:00
randy-ar 77b05c6440 chore(FE): delete dummy data 2025-12-28 04:39:40 +07:00
randy-ar 731bec5a94 feat(FE-337): slicing ui form finance and API integration 2025-12-28 04:28:02 +07:00
randy-ar 6ea25aa3b1 feat(FE-331): implement permission guard in project flock, chickin and closing kandang 2025-12-28 01:00:20 +07:00
randy-ar d4f4505405 feat(FE-331): implement permission guard in project flock, chickin and closing kandang 2025-12-28 00:56:39 +07:00
randy-ar bd653851e2 feat(FE-331): implement permission guard in master data productions standards 2025-12-28 00:23:50 +07:00
rstubryan c8f47c741a feat(FE-316): Add status badges and result summary tables 2025-12-27 23:15:19 +07:00
rstubryan 78486be3ea refactor(FE-316): Remove RequirePermission and update header buttons 2025-12-27 22:45:44 +07:00
rstubryan fe04bf5692 refactor(FE-316): Hide back icon and divider in uniformity forms 2025-12-27 22:39:03 +07:00
rstubryan 3c29b8bc77 refactor(FE-316): Show selected file name in preview subtitle 2025-12-27 22:32:12 +07:00
rstubryan 45d65024db refactor(FE-316): Extract uniformity state into separate store 2025-12-27 21:51:13 +07:00
rstubryan fd2077c68b refactor(FE-316): Add fileName to Uniformity form data 2025-12-27 21:36:34 +07:00
rstubryan 819b709f7e feat(FE-316): Add Uniformity result drawer and flow 2025-12-27 21:25:06 +07:00
rstubryan 549a710a8d feat(FE-316): Save and preview uniformity verification 2025-12-27 21:00:07 +07:00
rstubryan ec8ae7561d feat(FE-316): Add verifyUniformity and split payload types 2025-12-27 19:09:03 +07:00
rstubryan 5f68c05acc refactor(FE-316,438): Wrap Uniformity actions with permission checks 2025-12-27 18:05:25 +07:00
randy-ar b9b349aa7a fix(FE): resolve git pull merge development 2025-12-27 16:49:16 +07:00
rstubryan 0a447f93c1 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page 2025-12-27 16:48:00 +07:00
Rivaldi A N S 6ec6323bbc Merge branch 'feat/FE/US-304/permission-guard' into 'development'
[FEAT/FE][US#304] Permission Guard

See merge request mbugroup/lti-web-client!115
2025-12-27 09:41:13 +00:00
randy-ar c44e63bd2b fix(FE): fix page responsive in project flock dan marketing modules 2025-12-27 16:36:07 +07:00
randy-ar d49bca1d40 feat(FE): api integration production standards 2025-12-27 13:46:19 +07:00
rstubryan e4d75dad68 refactor(FE-316): Rename CreateUniformityPayload to
VerifyUniformityPayload
2025-12-27 09:17:09 +07:00
rstubryan 4f22024c82 refactor(FE-316): Rename ExpandedDrawerForm to UniformityPreviewForm 2025-12-27 09:12:31 +07:00
rstubryan 751c27b73e feat(FE-316): Add delete button to ExpandedDrawerForm header 2025-12-27 09:05:12 +07:00
rstubryan 0d77aa4a5f feat(FE-438): Display date and week in Uniformity table 2025-12-27 08:57:01 +07:00
rstubryan 6fde6b180a feat(FE-316): Add isNextStep flag for expanded drawer flow 2025-12-27 08:37:05 +07:00
randy-ar 663c1dea14 feat(FE): add master data production standard, slicing form and index table 2025-12-27 03:23:03 +07:00
rstubryan 4aab54981e refactor(FE-316): Use single file field and remove unused IDs 2025-12-26 23:05:25 +07:00
rstubryan 04c987b86b refactor(FE-316): Remove toggleExpandedDrawer from drawer slice 2025-12-26 22:57:28 +07:00
rstubryan 800739bd4f refactor(FE-316): Add expanded drawer content and dynamic width 2025-12-26 22:50:41 +07:00
rstubryan e0ee846106 refactor(FE-438): Center text in UniformityForm placeholder 2025-12-26 22:39:36 +07:00
rstubryan 84b49d2ac6 refactor(FE-438): Normalize ID handling and simplify callbacks 2025-12-26 22:35:42 +07:00
rstubryan ec95ddbddd refactor(FE-438): Add min validators and file error handling 2025-12-26 22:05:36 +07:00
rstubryan 6d2057842d refactor(FE-438): Remove sm: prefix from drawer-end class 2025-12-26 21:52:10 +07:00
rstubryan 1843a47d59 refactor(FE-438): Replace FileInput with custom file upload UI 2025-12-26 21:50:59 +07:00
rstubryan e6a38c3f65 refactor(FE-438): Scope Drawer classes to sm breakpoint 2025-12-26 20:29:18 +07:00
rstubryan f58cb43801 refacotr(FE-438): Unsubscribe validate subscription and close drawer 2025-12-26 19:17:12 +07:00
rstubryan 517e8c758c refactor(FE-438): Add Project Flock selection and lookup 2025-12-26 17:12:40 +07:00
rstubryan 97c5917401 refactor(FE-438): Unsubscribe immediately after validation 2025-12-26 16:21:42 +07:00
rstubryan 31a9828661 refactor(FE-316): Use useSelect for location options 2025-12-26 16:15:33 +07:00
rstubryan 580c357667 feat(FE-316): Add Uniformity form with validation and upload 2025-12-26 16:08:04 +07:00
rstubryan f1227c9dcb feat(FE-438): Add UniformityTable skeleton for empty state 2025-12-26 10:58:27 +07:00
rstubryan 5f3c3be1f3 refactor(FE-438): Use skeleton class in UniformityBarChartSkeleton 2025-12-26 10:55:24 +07:00
rstubryan ae00f49e64 feat(FE-438): Add gauge skeleton and use in UniformityChart 2025-12-26 10:36:29 +07:00
rstubryan d9322cc17d refactor(FE-438): Make left legend skeleton DRY and widen gaps 2025-12-26 10:13:17 +07:00
rstubryan f5f154883b feat(FE-438): Add UniformityBarChartSkeleton and use it 2025-12-26 09:49:18 +07:00
rstubryan 8c21883aa9 refactor(FE-316): Move UniformityStat to chart folder 2025-12-26 08:38:54 +07:00
randy-ar 4ddd1dc8e3 feat(FE-337): slicing ui form add finance 2025-12-24 18:45:33 +07:00
rstubryan 879702d31d refactor(FE-316): Add expandable secondary drawer panel 2025-12-24 17:53:14 +07:00
randy-ar 8c95dc8327 feat(FE-350): add filtering table 2025-12-24 16:44:53 +07:00
rstubryan f0eb3fcf52 refactor(FE-316): Remove overflow-visible class from table wrapper 2025-12-24 16:38:50 +07:00
rstubryan 871f0403ad feat(FE-316): Disable tooltip cursor in uniformity bar chart 2025-12-24 11:46:13 +07:00
rstubryan b57a0fcc90 feat(FE-316): Add gradient fill and refine bar chart axes 2025-12-24 11:44:29 +07:00
rstubryan 6ef9c1338f Merge branch 'feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-281/TASK-316-317-slicing-ui-and-integrate-api-daily-recording-growing-uniformity-page 2025-12-24 11:24:24 +07:00
rstubryan ea4dd29bbf feat(FE-316): Add axis labels and responsive sizing to bar chart 2025-12-24 11:23:37 +07:00
rstubryan d591c89cac feat(FE-316): Add axis labels and responsive sizing to bar chart 2025-12-24 11:22:47 +07:00
rstubryan 22d24af41c feat(FE-316): Add info icon to Card titles 2025-12-24 11:11:35 +07:00
rstubryan 20d124504b refactor(FE-316): Use CSS background classes for status badges 2025-12-24 10:57:02 +07:00
rstubryan b9c1989cae refactor(FE-316): Refactor Uniformity table and status helpers 2025-12-24 10:51:12 +07:00
rstubryan 5fae7752f2 feat(FE): Add status indicator to Badge and use theme types 2025-12-24 10:32:39 +07:00
rstubryan 9e5d878e82 feat(FE-316,317): Add accessorKey and id for UniformityTable columns 2025-12-23 22:15:33 +07:00
rstubryan 035f187bac refactor(FE-316,317): Extract Uniformity table columns to constant 2025-12-23 22:12:24 +07:00
rstubryan cb78ec4990 feat(FE-316,317): Enhance UniformityTable with selection and actions 2025-12-23 21:58:28 +07:00
rstubryan 3a2fac013e feat(FE-317): Add uniformity field to Uniformity type 2025-12-23 21:57:44 +07:00
rstubryan 3b2e11fd41 feat(FE-317): Add Uniformity API service and types 2025-12-23 21:21:25 +07:00
rstubryan 414d617341 refactor(FE-316): Adjust UniformityChart responsive grid 2025-12-23 20:10:28 +07:00
rstubryan 0774200aa5 refactor(FE-316): Extract Uniformity charts into components 2025-12-23 18:52:05 +07:00
rstubryan 5dd64b9907 feat(FE-316): Add Gauge and Detail Card to Uniformity Chart 2025-12-23 18:33:47 +07:00
rstubryan 8fc5d42bb8 refactor(FE-316): Fix header markup and comment out UniformityStat 2025-12-23 17:52:29 +07:00
randy-ar 36ff6d04ee feat(FE-337): init slicing UI and define data types 2025-12-23 17:38:16 +07:00
rstubryan f23a0144b0 refactor(FE-316): Replace tooltip with custom uniformity design 2025-12-23 16:40:37 +07:00
rstubryan 09dd907f88 feat(FE-316): Add Uniformity page and form component 2025-12-23 16:11:02 +07:00
rstubryan 33b8d0a8b0 feat(FE-316): Add Uniformity page and layout components 2025-12-23 16:10:12 +07:00
rstubryan 398282b3bf feat(FE-316): Add Uniformity page components 2025-12-23 16:09:29 +07:00
rstubryan 035482accc feat(FE-317): Add Uniformity menu item to main drawer 2025-12-23 16:03:36 +07:00
rstubryan 907afbb062 chore(FE): Add Recharts deps and run tsc in pre-commit 2025-12-23 15:51:26 +07:00
rstubryan b9dad3094c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-23 11:08:36 +07:00
rstubryan ff427d13cc Merge branch 'feat/FE/US-334/expedition-hpp-report' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-23 10:55:03 +07:00
rstubryan 8295943b82 Merge branch 'feat/FE/US-339/purchase-report' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-23 10:53:44 +07:00
rstubryan a3169d582d Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-23 10:52:24 +07:00
rstubryan dd6c6263e7 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-23 09:32:08 +07:00
rstubryan 5d03b68576 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-22 15:48:43 +07:00
398 changed files with 54137 additions and 11368 deletions
+21 -25
View File
@@ -2,6 +2,17 @@ stages:
- build - build
- deploy - deploy
# ==========================================================
# ✅ Global defaults
# ==========================================================
default:
tags:
- server-development-biznet
interruptible: true
# ==========================================================
# 🏗️ Build Template
# ==========================================================
.build_template: &build_template .build_template: &build_template
stage: build stage: build
image: node:20-alpine image: node:20-alpine
@@ -39,6 +50,9 @@ stages:
- out/ - out/
expire_in: 1 week expire_in: 1 week
# ==========================================================
# 🚀 Deploy Template
# ==========================================================
.deploy_template: &deploy_template .deploy_template: &deploy_template
stage: deploy stage: deploy
image: image:
@@ -82,11 +96,11 @@ stages:
if [ "$STATUS" = "success" ]; then if [ "$STATUS" = "success" ]; then
COLOR=3066993 COLOR=3066993
TITLE="✅ Deployment ${ENVIRONMENT_NAME} Succeeded" TITLE="✅ Deployment ${ENVIRONMENT_NAME} Succeeded"
DESC="Deployment job on branch \`${CI_COMMIT_REF_NAME}\` completed successfully." DESC="Deployment job on branch \${CI_COMMIT_REF_NAME}\ completed successfully."
else else
COLOR=15158332 COLOR=15158332
TITLE="❌ Deployment ${ENVIRONMENT_NAME} Failed" TITLE="❌ Deployment ${ENVIRONMENT_NAME} Failed"
DESC="Deployment job on branch \`${CI_COMMIT_REF_NAME}\` encountered issues." DESC="Deployment job on branch \${CI_COMMIT_REF_NAME}\ encountered issues."
fi fi
jq -n \ jq -n \
@@ -114,7 +128,9 @@ stages:
curl -sS -H "Content-Type: application/json" -d @payload.json "$DISCORD_WEBHOOK_URL" curl -sS -H "Content-Type: application/json" -d @payload.json "$DISCORD_WEBHOOK_URL"
# ====== DEVELOPMENT (Branch development) ====== # ==========================================================
# ==== DEVELOPMENT (Branch development) ======
# ==========================================================
build:dev: build:dev:
<<: *build_template <<: *build_template
rules: rules:
@@ -140,7 +156,9 @@ deploy:dev:
name: development name: development
url: https://dev-lti-erp.mbugroup.id url: https://dev-lti-erp.mbugroup.id
# ==========================================================
# ====== STAGING (Branch staging) ====== # ====== STAGING (Branch staging) ======
# ==========================================================
build:staging: build:staging:
<<: *build_template <<: *build_template
rules: rules:
@@ -165,25 +183,3 @@ deploy:staging:
environment: environment:
name: staging name: staging
url: https://stg-lti-erp.mbugroup.id url: https://stg-lti-erp.mbugroup.id
# ====== PRODUCTION ======
# build:production:
# <<: *build_template
# rules:
# # pilih salah satu: pakai branch master ATAU pakai tags rilis
# - if: '$CI_COMMIT_BRANCH == "master"'
# # - if: '$CI_COMMIT_TAG' # kalau mau rilis via tag, uncomment ini dan hapus baris di atas
# environment:
# name: production
# deploy:production:
# <<: *deploy_template
# needs: ["build:production"]
# rules:
# - if: '$CI_COMMIT_BRANCH == "master"'
# # - if: '$CI_COMMIT_TAG' # selaras dengan rule di build:production
# variables:
# S3_BUCKET: "lti-erp.mbugroup.id"
# CLOUDFRONT_DISTRIBUTION_ID: "ddfd"
# environment:
# name: production
+1 -1
View File
@@ -1,3 +1,3 @@
npm run format npm run format
npm run lint npm run lint
npm run build npx tsc --noEmit
+4125 -40
View File
File diff suppressed because it is too large Load Diff
+17 -3
View File
@@ -15,22 +15,36 @@
"@tanstack/match-sorter-utils": "^8.19.4", "@tanstack/match-sorter-utils": "^8.19.4",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"axios": "^1.12.2", "axios": "^1.12.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cmdk": "^1.1.1",
"embla-carousel-react": "^8.6.0",
"exceljs": "^4.4.0",
"formik": "^2.4.6", "formik": "^2.4.6",
"html-to-image": "^1.11.13",
"input-otp": "^1.4.2",
"jspdf": "^3.0.4", "jspdf": "^3.0.4",
"jspdf-autotable": "^5.0.2", "jspdf-autotable": "^5.0.2",
"lucide-react": "^0.562.0",
"moment": "^2.30.1", "moment": "^2.30.1",
"next": "15.5.9", "next": "15.5.9",
"react": "19.1.0", "next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.1.2",
"react-day-picker": "^9.11.1", "react-day-picker": "^9.11.1",
"react-dom": "19.1.0", "react-dom": "^19.1.2",
"react-dropzone": "^14.3.8", "react-dropzone": "^14.3.8",
"react-hook-form": "^7.70.0",
"react-hot-toast": "^2.6.0", "react-hot-toast": "^2.6.0",
"react-number-format": "^5.4.4", "react-number-format": "^5.4.4",
"react-resizable-panels": "2.1.7",
"react-select": "^5.10.2", "react-select": "^5.10.2",
"recharts": "^3.6.0",
"sonner": "^2.0.7",
"swr": "^2.3.6", "swr": "^2.3.6",
"tailwind-merge": "^3.3.1", "tailwind-merge": "^3.3.1",
"use-debounce": "^10.0.6", "use-debounce": "^10.0.6",
"vaul": "^1.1.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
"yup": "^1.7.0", "yup": "^1.7.0",
"zustand": "^5.0.8" "zustand": "^5.0.8"
@@ -42,7 +56,7 @@
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^19", "@types/react": "^19",
"@types/react-dom": "^19", "@types/react-dom": "^19",
"daisyui": "^5.5.8", "daisyui": "^5.5.14",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "^15.5.7", "eslint-config-next": "^15.5.7",
"husky": "^9.1.7", "husky": "^9.1.7",
+48 -5
View File
@@ -7,26 +7,58 @@ import ClosingDetail from '@/components/pages/closing/ClosingDetail';
import { ClosingApi } from '@/services/api/closing'; import { ClosingApi } from '@/services/api/closing';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper'; import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { FlockApi } from '@/services/api/master-data';
import { ProjectFlockApi } from '@/services/api/production/project-flock';
import { ProjectFlockKandangApi } from '@/services/api/production';
const ClosingDetailPage = () => { const ClosingDetailPage = () => {
const router = useRouter(); const router = useRouter();
const searchParams = useSearchParams(); const searchParams = useSearchParams();
const closingId = searchParams.get('closingId'); const closingId = searchParams.get('closingId');
const kandangId = searchParams.get('kandangId'); // project flock kandang ID
const { data: closing, isLoading: isLoadingClosing } = useSWR( const { data: closing, isLoading: isLoadingClosing } = useSWR(
closingId, closingId,
(id: number) => ClosingApi.getGeneralInfo(id) (id: number) => ClosingApi.getGeneralInfo(id)
); );
// WORKAROUND - get flock data from closing ID
const { data: projectData, isLoading: isLoadingProject } = useSWR(
`flock-${closingId}`,
() => ProjectFlockApi.getSingle(Number(closingId))
);
// WORKAROUND - get kandang data from closing ID
const { data: kandangData, isLoading: isLoadingKandang } = useSWR(
kandangId ? `kandang-${closingId}-${kandangId}` : null,
() => ProjectFlockKandangApi.getSingle(Number(kandangId))
);
const { data: salesData, isLoading: isLoadingSales } = useSWR( const { data: salesData, isLoading: isLoadingSales } = useSWR(
closingId ? `sales-${closingId}` : null, kandangId
() => ClosingApi.getPenjualan(Number(closingId)) ? `sales-${closingId}-${kandangId}`
: closingId
? `sales-${closingId}`
: null,
() =>
kandangId
? ClosingApi.getPenjualanByKandang(Number(closingId), Number(kandangId))
: ClosingApi.getPenjualan(Number(closingId))
); );
const { data: hppEkspedisiData, isLoading: isLoadingHppEkspedisi } = useSWR( const { data: hppEkspedisiData, isLoading: isLoadingHppEkspedisi } = useSWR(
closingId ? `hpp-ekspedisi-${closingId}` : null, kandangId
() => ClosingApi.getHppEkspedisi(Number(closingId)) ? `hpp-ekspedisi-${closingId}-${kandangId}`
: closingId
? `hpp-ekspedisi-${closingId}`
: null,
() =>
kandangId
? ClosingApi.getHppEkspedisiByKandang(
Number(closingId),
Number(kandangId)
)
: ClosingApi.getHppEkspedisi(Number(closingId))
); );
if (!closingId) { if (!closingId) {
@@ -44,7 +76,12 @@ const ClosingDetailPage = () => {
return; return;
} }
const isLoading = isLoadingClosing || isLoadingSales || isLoadingHppEkspedisi; const isLoading =
isLoadingClosing ||
isLoadingSales ||
isLoadingHppEkspedisi ||
isLoadingProject ||
isLoadingKandang;
return ( return (
<div className='w-full p-4 flex flex-row justify-center'> <div className='w-full p-4 flex flex-row justify-center'>
@@ -60,6 +97,12 @@ const ClosingDetailPage = () => {
? hppEkspedisiData.data ? hppEkspedisiData.data
: undefined : undefined
} }
projectData={
isResponseSuccess(projectData) ? projectData.data : undefined
}
kandangData={
isResponseSuccess(kandangData) ? kandangData.data : undefined
}
/> />
)} )}
</div> </div>
@@ -0,0 +1,11 @@
import { DailyChecklistContent } from '@/figma-make/components/pages/daily-checklist/DailyChecklistContent';
const DailyChecklistPage = () => {
return (
<section className='w-full'>
<DailyChecklistContent />
</section>
);
};
export default DailyChecklistPage;
@@ -0,0 +1,11 @@
import { Dashboard as DashboardDailyChecklist } from '@/figma-make/components/pages/dashboard/Dashboard';
const DailyChecklistDashboardPage = () => {
return (
<section className='w-full'>
<DashboardDailyChecklist />
</section>
);
};
export default DailyChecklistDashboardPage;
@@ -0,0 +1,11 @@
import { DetailDailyChecklistContent } from '@/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent';
const ListDailyChecklistDetailPage = () => {
return (
<section className='w-full'>
<DetailDailyChecklistContent />
</section>
);
};
export default ListDailyChecklistDetailPage;
@@ -0,0 +1,11 @@
import { ListDailyChecklistContent } from '@/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent';
const ListDailyChecklistPage = () => {
return (
<section className='w-full'>
<ListDailyChecklistContent />
</section>
);
};
export default ListDailyChecklistPage;
@@ -0,0 +1,11 @@
import { MasterAktivitasContent } from '@/figma-make/components/pages/master-data/activity/MasterAktivitasContent';
const MasterAktivitasPage = () => {
return (
<section className='w-full'>
<MasterAktivitasContent />
</section>
);
};
export default MasterAktivitasPage;
@@ -0,0 +1,11 @@
import { MasterConfigurationContent } from '@/figma-make/components/pages/master-data/configuration/MasterConfigurationContent';
const MasterConfigurationPage = () => {
return (
<section className='w-full'>
<MasterConfigurationContent />
</section>
);
};
export default MasterConfigurationPage;
@@ -0,0 +1,11 @@
import { MasterEmployeeContent } from '@/figma-make/components/pages/master-data/employee/MasterEmployeeContent';
const MasterEmployeePage = () => {
return (
<section className='w-full'>
<MasterEmployeeContent />
</section>
);
};
export default MasterEmployeePage;
+11
View File
@@ -0,0 +1,11 @@
import { DailyChecklistReportsContent } from '@/figma-make/components/pages/reports/DailyChecklistReportsContent';
const DailyChecklistReportsPage = () => {
return (
<section className='w-full'>
<DailyChecklistReportsContent />
</section>
);
};
export default DailyChecklistReportsPage;
+3 -5
View File
@@ -1,9 +1,7 @@
import DashboardProduction from '@/components/pages/dashboard/DashboardProduction';
const Dashboard = () => { const Dashboard = () => {
return ( return <DashboardProduction />;
<section className='w-full p-4'>
<h1 className='text-3xl font-bold text-primary'>Dashboard</h1>
</section>
);
}; };
export default Dashboard; export default Dashboard;
+3 -1
View File
@@ -38,9 +38,11 @@ const ExpenseEditPage = () => {
!isLoadingExpense && !isLoadingExpense &&
isResponseSuccess(expense) && isResponseSuccess(expense) &&
expense.data.latest_approval.step_number !== 5 && expense.data.latest_approval.step_number !== 5 &&
expense.data.latest_approval.step_number !== 6 &&
(expense.data.latest_approval.step_number === 1 || (expense.data.latest_approval.step_number === 1 ||
expense.data.latest_approval.step_number === 2 || expense.data.latest_approval.step_number === 2 ||
expense.data.latest_approval.step_number === 3); expense.data.latest_approval.step_number === 3 ||
expense.data.latest_approval.step_number === 4);
if (!isLoadingExpense && !isExpenseCanBeEdited) { if (!isLoadingExpense && !isExpenseCanBeEdited) {
router.back(); router.back();
+1 -1
View File
@@ -2,7 +2,7 @@ import ExpensesTable from '@/components/pages/expense/ExpensesTable';
const Expense = () => { const Expense = () => {
return ( return (
<section className='w-full p-4'> <section className='w-full p-4 sm:p-0'>
<ExpensesTable /> <ExpensesTable />
</section> </section>
); );
+2 -2
View File
@@ -38,8 +38,8 @@ const ExpenseRealizationEditPage = () => {
!isLoadingExpense && !isLoadingExpense &&
isResponseSuccess(expense) && isResponseSuccess(expense) &&
expense.data.latest_approval.action !== 'REJECTED' && expense.data.latest_approval.action !== 'REJECTED' &&
(expense.data.latest_approval.step_number === 4 || (expense.data.latest_approval.step_number === 5 ||
expense.data.latest_approval.step_number === 5); expense.data.latest_approval.step_number === 6);
if (!isLoadingExpense && !isExpenseRealizationCanBeEdited) { if (!isLoadingExpense && !isExpenseRealizationCanBeEdited) {
router.back(); router.back();
+1 -1
View File
@@ -37,7 +37,7 @@ const ExpenseRealization = () => {
const isExpenseCanBeRealized = const isExpenseCanBeRealized =
isResponseSuccess(expense) && isResponseSuccess(expense) &&
expense.data.latest_approval.action !== 'REJECTED' && expense.data.latest_approval.action !== 'REJECTED' &&
expense.data.latest_approval.step_number === 3; expense.data.latest_approval.step_number === 4;
if (isResponseSuccess(expense) && !isExpenseCanBeRealized) { if (isResponseSuccess(expense) && !isExpenseCanBeRealized) {
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
+5
View File
@@ -0,0 +1,5 @@
const FinanceAdjust = () => {
return <div>Finance Adjust</div>;
};
export default FinanceAdjust;
@@ -0,0 +1,7 @@
import FormFinanceAddInitialBalance from '@/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance';
const FinanceAddInitialBalancePage = () => {
return <FormFinanceAddInitialBalance type='add' />;
};
export default FinanceAddInitialBalancePage;
+7
View File
@@ -0,0 +1,7 @@
import FormFinanceInjection from '@/components/pages/finance/add/injection/FormFinanceInjection';
const FinanceAddInjectionPage = () => {
return <FormFinanceInjection type='add' />;
};
export default FinanceAddInjectionPage;
+7
View File
@@ -0,0 +1,7 @@
import FormFinanceAdd from '@/components/pages/finance/add/FormFinanceAdd';
const FinanceAddPage = () => {
return <FormFinanceAdd />;
};
export default FinanceAddPage;
@@ -0,0 +1,51 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import { FinanceApi } from '@/services/api/finance';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import FormFinanceAddInitialBalance from '@/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance';
const EditFinanceInitialBalancePage = () => {
const router = useRouter();
const searchParams = useSearchParams();
const financeId = searchParams.get('financeId');
const { data: finance, isLoading: isLoadingFinance } = useSWR(
financeId,
(id: number) => FinanceApi.getSingle(id)
);
if (!financeId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (!isLoadingFinance && (!finance || isResponseError(finance))) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingFinance && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingFinance && (
<FormFinanceAddInitialBalance
type='edit'
initialValues={isResponseSuccess(finance) ? finance.data : undefined}
/>
)}
</div>
);
};
export default EditFinanceInitialBalancePage;
@@ -0,0 +1,51 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import { FinanceApi } from '@/services/api/finance';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import FormFinanceInjection from '@/components/pages/finance/add/injection/FormFinanceInjection';
const EditFinanceInjectionPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
const financeId = searchParams.get('financeId');
const { data: finance, isLoading: isLoadingFinance } = useSWR(
financeId,
(id: number) => FinanceApi.getSingle(id)
);
if (!financeId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (!isLoadingFinance && (!finance || isResponseError(finance))) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingFinance && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingFinance && (
<FormFinanceInjection
type='edit'
initialValues={isResponseSuccess(finance) ? finance.data : undefined}
/>
)}
</div>
);
};
export default EditFinanceInjectionPage;
+52
View File
@@ -0,0 +1,52 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import { FinanceApi } from '@/services/api/finance';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import FormFinanceAdd from '@/components/pages/finance/add/FormFinanceAdd';
import FormFinanceAddInitialBalance from '@/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance';
const EditFinanceTransactionPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
const financeId = searchParams.get('financeId');
const { data: finance, isLoading: isLoadingFinance } = useSWR(
financeId,
(id: number) => FinanceApi.getSingle(id)
);
if (!financeId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (!isLoadingFinance && (!finance || isResponseError(finance))) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingFinance && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingFinance && (
<FormFinanceAdd
type='edit'
initialValues={isResponseSuccess(finance) ? finance.data : undefined}
/>
)}
</div>
);
};
export default EditFinanceTransactionPage;
+39
View File
@@ -0,0 +1,39 @@
'use client';
import FinanceDetail from '@/components/pages/finance/FinanceDetail';
import useSWR from 'swr';
import { useRouter, useSearchParams } from 'next/navigation';
import { FinanceApi } from '@/services/api/finance';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
const FinanceDetailPage = () => {
const router = useRouter();
const financeId = useSearchParams().get('financeId');
const { data: finance } = useSWR(financeId, () =>
FinanceApi.getSingle(Number(financeId))
);
if (!financeId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
// if (!finance || isResponseError(finance)) {
// router.replace('/404');
// return;
// }
return (
<>
{isResponseSuccess(finance) && <FinanceDetail finance={finance.data} />}
</>
);
};
export default FinanceDetailPage;
+14
View File
@@ -0,0 +1,14 @@
'use client';
import FinanceTable from '@/components/pages/finance/FinanceTable';
const Finance = () => {
return (
<section className='size-full p-6'>
<div className='flex flex-row gap-4'></div>
<FinanceTable />
</section>
);
};
export default Finance;
+11 -5
View File
@@ -1,6 +1,8 @@
@import 'tailwindcss'; @import 'tailwindcss';
@plugin "daisyui"; @plugin "daisyui";
@import '../styles/tailwind.css';
@import '../styles/daisyui.css'; @import '../styles/daisyui.css';
@import '../figma-make/styles/theme.css';
@plugin "daisyui/theme" { @plugin "daisyui/theme" {
name: 'lti'; name: 'lti';
@@ -28,16 +30,16 @@
--color-base-100: oklch(100% 0 0); /* #ffffff */ --color-base-100: oklch(100% 0 0); /* #ffffff */
--color-base-200: oklch(97.2% 0 0); /* #f2f2f2 */ --color-base-200: oklch(97.2% 0 0); /* #f2f2f2 */
--color-base-300: oklch(93.1% 0.002 249.7); /* #e5e6e6 */ --color-base-300: oklch(93.1% 0.002 249.7); /* #e5e6e6 */
--color-base-content: oklch(18.6% 0.024 257.7); /* #1f2937 */ --color-base-content: #18181b;
/* Status/Utility Colors */ /* Status/Utility Colors */
--color-info: oklch(67.4% 0.176 238.9); --color-info: oklch(67.4% 0.176 238.9);
--color-info-content: oklch(0% 0 0); /* #000000 */ --color-info-content: oklch(0% 0 0); /* #000000 */
--color-success: oklch(62.3% 0.147 149); --color-success: #00d390;
--color-success-content: oklch(100% 0 0); /* #ffffff */ --color-success-content: oklch(100% 0 0); /* #ffffff */
--color-warning: oklch(82.2% 0.165 91.9); --color-warning: #fcb700;
--color-warning-content: oklch(0% 0 0); /* #000000 */ --color-warning-content: oklch(0% 0 0); /* #000000 */
--color-error: oklch(61.8% 0.203 27.8); --color-error: #ff3a3a;
--color-error-content: oklch(100% 0 0); /* #fffffff */ --color-error-content: oklch(100% 0 0); /* #fffffff */
--radius-selector: 0rem; --radius-selector: 0rem;
@@ -51,17 +53,21 @@
} }
:root { :root {
--color-primary: #1f74bf; --color-primary: #0069e0;
} }
@theme { @theme {
--font-inter: var(--font-inter); --font-inter: var(--font-inter);
--font-roboto: var(--font-roboto);
--container-sm: 40rem; --container-sm: 40rem;
--container-md: 48rem; --container-md: 48rem;
--container-lg: 64rem; --container-lg: 64rem;
--container-xl: 80rem; --container-xl: 80rem;
--container-2xl: 96rem; --container-2xl: 96rem;
--shadow-button-soft:
0 3px 2px -2px var(--color-base-200), 0 4px 3px -2px var(--color-base-200);
} }
html { html {
+1 -1
View File
@@ -2,7 +2,7 @@ import MovementTable from '@/components/pages/inventory/movement/MovementTable';
const Movement = () => { const Movement = () => {
return ( return (
<section className='w-full p-4'> <section className='w-full p-4 sm:p-0'>
<MovementTable /> <MovementTable />
</section> </section>
); );
+12 -2
View File
@@ -1,8 +1,9 @@
import type { Metadata, Viewport } from 'next'; import type { Metadata, Viewport } from 'next';
import { Inter } from 'next/font/google'; import { Inter, Roboto } from 'next/font/google';
import '@/app/globals.css'; import '@/app/globals.css';
import { Toaster } from 'react-hot-toast'; import { Toaster } from 'react-hot-toast';
import { Toaster as SonnerToaster } from '@/figma-make/components/base/sonner';
import MainDrawer from '@/components/MainDrawer'; import MainDrawer from '@/components/MainDrawer';
import RequireAuth from '@/components/helper/RequireAuth'; import RequireAuth from '@/components/helper/RequireAuth';
@@ -11,6 +12,12 @@ const inter = Inter({
subsets: ['latin'], subsets: ['latin'],
}); });
const roboto = Roboto({
variable: '--font-roboto',
subsets: ['latin'],
weight: ['200', '300', '400', '500', '600', '700', '900'],
});
export const viewport: Viewport = { export const viewport: Viewport = {
themeColor: '#1f74bf', themeColor: '#1f74bf',
colorScheme: 'light', colorScheme: 'light',
@@ -29,12 +36,15 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang='en' data-theme='lti'> <html lang='en' data-theme='lti'>
<body className={`${inter.variable} antialiased font-inter`}> <body
className={`${inter.variable} ${roboto.variable} antialiased font-inter`}
>
<RequireAuth> <RequireAuth>
<MainDrawer>{children}</MainDrawer> <MainDrawer>{children}</MainDrawer>
</RequireAuth> </RequireAuth>
<Toaster /> <Toaster />
<SonnerToaster position='top-right' />
</body> </body>
</html> </html>
); );
+6 -1
View File
@@ -1,9 +1,14 @@
import DeliveryOrderFormModal from '@/components/pages/marketing/DeliveryOrderFormModal';
import MarketingTable from '@/components/pages/marketing/MarketingTable'; import MarketingTable from '@/components/pages/marketing/MarketingTable';
import SalesOrderFormModal from '@/components/pages/marketing/SalesOrderFormModal';
const Marketing = () => { const Marketing = () => {
return ( return (
<div className='w-full p-4'> <div className='w-full'>
<MarketingTable /> <MarketingTable />
<SalesOrderFormModal />
<DeliveryOrderFormModal />
</div> </div>
); );
}; };
@@ -0,0 +1,13 @@
'use client';
import ProductionStandardForm from '@/components/pages/master-data/production-standard/form/ProductionStandardForm';
const AddProductionStandardPage = () => {
return (
<>
<ProductionStandardForm formType='add' />
</>
);
};
export default AddProductionStandardPage;
@@ -0,0 +1,56 @@
'use client';
import ProductionStandardForm from '@/components/pages/master-data/production-standard/form/ProductionStandardForm';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { ProductionStandardApi } from '@/services/api/master-data';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
const EditProductionStandardPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
// Get Query Params
const productionStandardId = searchParams.get('productionStandardId');
// Fetch Data
const { data: productionStandard, isLoading: isLoadingProductionStandard } =
useSWR(productionStandardId, (id: number) =>
ProductionStandardApi.getSingle(id)
);
if (!productionStandardId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (
!isLoadingProductionStandard &&
(!productionStandard || isResponseError(productionStandard))
) {
router.replace('/404');
return;
}
return (
<>
{isLoadingProductionStandard && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingProductionStandard &&
isResponseSuccess(productionStandard) && (
<ProductionStandardForm
formType='edit'
initialValue={productionStandard.data}
/>
)}
</>
);
};
export default EditProductionStandardPage;
@@ -0,0 +1,11 @@
import SuspenseHelper from '@/components/helper/SuspenseHelper';
const Layout = ({
children,
}: Readonly<{
children: React.ReactNode;
}>) => {
return <SuspenseHelper>{children}</SuspenseHelper>;
};
export default Layout;
@@ -0,0 +1,56 @@
'use client';
import ProductionStandardForm from '@/components/pages/master-data/production-standard/form/ProductionStandardForm';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { ProductionStandardApi } from '@/services/api/master-data';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
const DetailProductionStandardPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
// Get Query Params
const productionStandardId = searchParams.get('productionStandardId');
// Fetch Data
const { data: productionStandard, isLoading: isLoadingProductionStandard } =
useSWR(productionStandardId, (id: number) =>
ProductionStandardApi.getSingle(id)
);
if (!productionStandardId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (
!isLoadingProductionStandard &&
(!productionStandard || isResponseError(productionStandard))
) {
router.replace('/404');
return;
}
return (
<>
{isLoadingProductionStandard && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingProductionStandard &&
isResponseSuccess(productionStandard) && (
<ProductionStandardForm
formType='detail'
initialValue={productionStandard.data}
/>
)}
</>
);
};
export default DetailProductionStandardPage;
@@ -0,0 +1,11 @@
import ProductionStandardTable from '@/components/pages/master-data/production-standard/ProductionStandardTable';
const ProductionStandardPage = () => {
return (
<div className='w-full'>
<ProductionStandardTable />
</div>
);
};
export default ProductionStandardPage;
+5
View File
@@ -0,0 +1,5 @@
import PageNotFound from '@/components/helper/NotFoundPage';
export default function NotFound() {
return <PageNotFound />;
}
+5 -1
View File
@@ -25,5 +25,9 @@ export default function Home() {
); );
} }
return <>Loading...</>; return (
<main className='w-full h-full min-h-screen flex flex-row justify-center items-center'>
<span className='loading loading-spinner loading-lg'></span>
</main>
);
} }
@@ -1,20 +0,0 @@
'use client';
import { FormHeader } from '@/components/helper/form/FormHeader';
import ProjectFlockChickinDetail from '@/components/pages/production/project-flock/chickin/ProjectFlockChickinDetail';
import { useSearchParams } from 'next/navigation';
const AddChickin = () => {
const searchParams = useSearchParams();
const projectFlockId = searchParams.get('projectFlockId');
return (
<>
<section className='w-full'>
<ProjectFlockChickinDetail projectFlockId={Number(projectFlockId)} />
</section>
</>
);
};
export default AddChickin;
@@ -1,10 +0,0 @@
import ChickinTable from '@/components/pages/production/chickin/ChickinTable';
const Chickin = () => {
return (
<section className='w-full'>
<ChickinTable />
</section>
);
};
export default Chickin;
@@ -50,5 +50,3 @@ const ProjectFlockDetailPage = () => {
}; };
export default ProjectFlockDetailPage; export default ProjectFlockDetailPage;
ProjectFlockDetail;
ProjectFlockDetail;
+1 -1
View File
@@ -2,7 +2,7 @@ import RecordingTable from '@/components/pages/production/recording/RecordingTab
const Recording = () => { const Recording = () => {
return ( return (
<section className='w-full p-4'> <section className='w-full p-4 sm:p-0'>
<RecordingTable /> <RecordingTable />
</section> </section>
); );
@@ -1,11 +0,0 @@
import TransferToLayingForm from '@/components/pages/production/transfer-to-laying/form/TransferToLayingForm';
const AddTransferToLaying = () => {
return (
<div className='w-full p-4 flex flex-row justify-center'>
<TransferToLayingForm />
</div>
);
};
export default AddTransferToLaying;
@@ -1,63 +0,0 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import TransferToLayingForm from '@/components/pages/production/transfer-to-laying/form/TransferToLayingForm';
import { TransferToLayingApi } from '@/services/api/production/transfer-to-laying';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
const TransferToLayingEdit = () => {
const router = useRouter();
const searchParams = useSearchParams();
const transferToLayingId = searchParams.get('transferToLayingId');
const { data: transferToLaying, isLoading: isLoadingTransferToLaying } =
useSWR(transferToLayingId, (id: number) =>
TransferToLayingApi.getSingle(id)
);
if (!transferToLayingId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (
!isLoadingTransferToLaying &&
(!transferToLaying || isResponseError(transferToLaying))
) {
router.replace('/404');
return;
}
if (
isResponseSuccess(transferToLaying) &&
transferToLaying.data.approval.step_number === 2
) {
router.replace('/production/transfer-to-laying');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingTransferToLaying && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingTransferToLaying && isResponseSuccess(transferToLaying) && (
<TransferToLayingForm
type='edit'
initialValues={transferToLaying.data}
/>
)}
</div>
);
};
export default TransferToLayingEdit;
@@ -1,56 +0,0 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import TransferToLayingForm from '@/components/pages/production/transfer-to-laying/form/TransferToLayingForm';
import { TransferToLayingApi } from '@/services/api/production/transfer-to-laying';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
const TransferToLayingDetail = () => {
const router = useRouter();
const searchParams = useSearchParams();
const transferToLayingId = searchParams.get('transferToLayingId');
const { data: transferToLaying, isLoading: isLoadingTransferToLaying } =
useSWR(transferToLayingId, (id: number) =>
TransferToLayingApi.getSingle(id)
);
if (!transferToLayingId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (
!isLoadingTransferToLaying &&
(!transferToLaying || isResponseError(transferToLaying))
) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingTransferToLaying && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingTransferToLaying && isResponseSuccess(transferToLaying) && (
<TransferToLayingForm
type='detail'
initialValues={transferToLaying.data}
/>
)}
</div>
);
};
export default TransferToLayingDetail;
+17 -1
View File
@@ -1,9 +1,25 @@
import TransferToLayingsTable from '@/components/pages/production/transfer-to-laying/TransferToLayingsTable'; import TransferToLayingsTable from '@/components/pages/production/transfer-to-laying/TransferToLayingsTable';
import TransferToLayingFormModal from '@/components/pages/production/transfer-to-laying/TransferToLayingFormModal';
import TransferToLayingDetailModal from '@/components/pages/production/transfer-to-laying/TransferToLayingDetailModal';
import RequirePermission from '@/components/helper/RequirePermission';
const TransferToLaying = () => { const TransferToLaying = () => {
return ( return (
<section className='w-full p-4'> <section className='w-full'>
<TransferToLayingsTable /> <TransferToLayingsTable />
<RequirePermission
permissions={[
'lti.production.transfer_to_laying.create',
'lti.production.transfer_to_laying.update',
]}
>
<TransferToLayingFormModal />
</RequirePermission>
<RequirePermission permissions='lti.production.transfer_to_laying.detail'>
<TransferToLayingDetailModal />
</RequirePermission>
</section> </section>
); );
}; };
@@ -0,0 +1,7 @@
import UniformityForm from '@/components/pages/production/uniformity/form/UniformityForm';
const AddUniformity = () => {
return <UniformityForm formType='add' />;
};
export default AddUniformity;
@@ -0,0 +1,49 @@
'use client';
import UniformityDetail from '@/components/pages/production/uniformity/detail/UniformityDetail';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { UniformityApi } from '@/services/api/uniformity';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
const UniformityDetailPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
const uniformityId = searchParams.get('uniformityId');
const { data: uniformity, isLoading: isLoadingUniformity } = useSWR(
uniformityId,
(id: string) => UniformityApi.getUniformityDetail(parseInt(id))
);
if (!uniformityId) {
router.back();
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
</div>
);
}
if (!isLoadingUniformity && (!uniformity || isResponseError(uniformity))) {
router.replace('/404');
return;
}
return (
<div className='w-full h-full flex flex-col justify-center'>
{isLoadingUniformity && (
<div className='w-full flex flex-row justify-center items-center p-4 min-h-screen'>
<span className='loading loading-spinner loading-xl' />
</div>
)}
{isResponseSuccess(uniformity) && (
<UniformityDetail initialValues={uniformity.data} />
)}
</div>
);
};
export default UniformityDetailPage;
+10
View File
@@ -0,0 +1,10 @@
import { ReactNode } from 'react';
import UniformityPageWrapper from '@/components/pages/production/uniformity/UniformityPageWrapper';
export default function UniformityLayout({
children,
}: {
children: ReactNode;
}) {
return <UniformityPageWrapper>{children}</UniformityPageWrapper>;
}
+7
View File
@@ -0,0 +1,7 @@
import UniformityTable from '@/components/pages/production/uniformity/UniformityTable';
const Uniformity = () => {
return <UniformityTable />;
};
export default Uniformity;
+1 -1
View File
@@ -2,7 +2,7 @@ import PurchaseTable from '@/components/pages/purchase/PurchaseTable';
const Purchase = () => { const Purchase = () => {
return ( return (
<section className='w-full p-4'> <section className='w-full p-4 sm:p-0'>
<PurchaseTable /> <PurchaseTable />
</section> </section>
); );
+7
View File
@@ -0,0 +1,7 @@
import FinanceTabs from '@/components/pages/report/finance/FinanceTabs';
const Finance = () => {
return <FinanceTabs />;
};
export default Finance;
+11
View File
@@ -0,0 +1,11 @@
import ProductionResultContent from '@/components/pages/report/production-result/ProductionResultContent';
const ProductionResultReportPage = () => {
return (
<section className='w-full max-w-7xl pb-16'>
<ProductionResultContent />
</section>
);
};
export default ProductionResultReportPage;
+34 -14
View File
@@ -3,29 +3,25 @@
import { HTMLAttributes, ReactNode } from 'react'; import { HTMLAttributes, ReactNode } from 'react';
import { cn } from '@/lib/helper'; import { cn } from '@/lib/helper';
import type { Color, Variant, Size } from '@/types/theme';
export interface BadgeProps export interface BadgeProps
extends Omit<HTMLAttributes<HTMLSpanElement>, 'className'> { extends Omit<HTMLAttributes<HTMLSpanElement>, 'className'> {
children?: ReactNode; children?: ReactNode;
className?: { className?: {
badge?: string; badge?: string;
status?: string;
}; };
variant?: 'default' | 'outline' | 'ghost' | 'soft' | 'dash'; statusIndicator?: boolean;
color?: variant?: Variant;
| 'neutral' color?: Color;
| 'primary' size?: Size;
| 'secondary'
| 'accent'
| 'info'
| 'success'
| 'warning'
| 'error';
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
} }
const Badge = ({ const Badge = ({
children, children,
className, className,
statusIndicator = false,
variant = 'default', variant = 'default',
color, color,
size = 'md', size = 'md',
@@ -34,7 +30,7 @@ const Badge = ({
const getBadgeClasses = () => { const getBadgeClasses = () => {
const baseClasses = 'badge'; const baseClasses = 'badge';
const variantClasses = { const variantClasses: Record<Variant, string> = {
default: '', default: '',
outline: 'badge-outline', outline: 'badge-outline',
ghost: 'badge-ghost', ghost: 'badge-ghost',
@@ -42,7 +38,7 @@ const Badge = ({
dash: 'badge-dash', dash: 'badge-dash',
}; };
const colorClasses = { const colorClasses: Record<Color, string> = {
neutral: 'badge-neutral', neutral: 'badge-neutral',
primary: 'badge-primary', primary: 'badge-primary',
secondary: 'badge-secondary', secondary: 'badge-secondary',
@@ -51,9 +47,10 @@ const Badge = ({
success: 'badge-success', success: 'badge-success',
warning: 'badge-warning', warning: 'badge-warning',
error: 'badge-error', error: 'badge-error',
none: '',
}; };
const sizeClasses = { const sizeClasses: Record<Size, string> = {
xs: 'badge-xs', xs: 'badge-xs',
sm: 'badge-sm', sm: 'badge-sm',
md: 'badge-md', md: 'badge-md',
@@ -70,8 +67,31 @@ const Badge = ({
); );
}; };
const getStatusClasses = () => {
if (!statusIndicator) return '';
const statusIndicatorClasses: Record<Color, string> = {
neutral: 'bg-neutral',
primary: 'bg-primary',
secondary: 'bg-secondary',
accent: 'bg-accent',
info: 'bg-info',
success: 'bg-success',
warning: 'bg-warning',
error: 'bg-error',
none: '',
};
return cn(
'w-2.5 h-2.5 rounded-full',
color && statusIndicatorClasses[color],
className?.status
);
};
return ( return (
<span className={getBadgeClasses()} {...props}> <span className={getBadgeClasses()} {...props}>
{statusIndicator && <span className={getStatusClasses()} />}
{children} {children}
</span> </span>
); );
+263
View File
@@ -0,0 +1,263 @@
import React, { useId } from 'react';
import Link from 'next/link';
import { Icon } from '@iconify/react';
import { cn, findMenuPath } from '@/lib/helper';
import { Size } from '@/types/theme';
import Button from '@/components/Button';
import { MAIN_DRAWER_LINKS } from '@/config/constant';
interface BreadcrumbItem {
label: string;
href?: string;
icon?: React.ReactNode;
isActive?: boolean;
isDisabled?: boolean;
}
interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {
items: BreadcrumbItem[];
size?: Size;
maxVisibleItems?: number;
showEllipsisDropdown?: boolean;
}
export function buildBreadcrumbs(pathname: string): BreadcrumbItem[] {
const menuPath = findMenuPath(MAIN_DRAWER_LINKS, pathname);
if (!menuPath) return [];
return menuPath.map((menu, index) => {
const isLast = index === menuPath.length - 1;
return {
label: menu.text,
href: isLast ? menu.link : undefined,
isActive: isLast,
icon: menu.icon ? (
<Icon icon={menu.icon} width={16} height={16} />
) : undefined,
};
});
}
const EllipsisDropdown = ({
hiddenItems,
}: {
hiddenItems: BreadcrumbItem[];
}) => {
const dropdownId = useId();
const anchorId = useId();
return (
<li>
{/* Ellipsis Button */}
<Button
popoverTarget={dropdownId}
variant='ghost'
color='none'
style={
{
anchorName: `--breadcrumb-ellipsis-anchor-${anchorId}`,
} as React.CSSProperties
}
>
<Icon icon='material-symbols:more-horiz' width={16} height={16} />
</Button>
{/* Dropdown Menu using popover API */}
<ul
className='dropdown menu rounded-box bg-base-100 border border-base-300 shadow-lg z-[9999] [&_a:hover]:no-underline [&_a:focus]:no-underline [&&]:no-underline [&&_a]:no-underline [&&]:hover:no-underline [&&]:flex [&&]:items-start [&&]:justify-start w-max'
popover='auto'
id={dropdownId}
style={
{
positionAnchor: `--breadcrumb-ellipsis-anchor-${anchorId}`,
} as React.CSSProperties
}
>
{hiddenItems.map((item, index) => {
const itemStyles = cn(
'[&]:flex [&]:items-center [&]:justify-start py-1 text-sm',
// Disabled state
item.isDisabled && 'text-base-content/40 opacity-50',
// Active/Last state
(item.isActive || item.isDisabled) && 'text-primary',
// Regular clickable state
!item.isDisabled && 'text-base-content/50'
);
const itemContent = (
<div className={itemStyles}>
{item.icon && (
<span className='inline-flex mr-2'>{item.icon}</span>
)}
{item.label}
</div>
);
return (
<li
key={`ellipsis-${index}`}
className='[&&]:text-left [&&]:block w-full'
>
{item.href && !item.isDisabled ? (
<Link
href={item.href}
className='block !no-underline [&&]:text-left w-full'
onClick={(e) => e.stopPropagation()}
>
{itemContent}
</Link>
) : (
<div className='block !no-underline [&&]:cursor-default [&&]:hover:cursor-default [&&]:hover:bg-base-100 [&&]:text-left'>
{itemContent}
</div>
)}
</li>
);
})}
</ul>
</li>
);
};
const Breadcrumb = ({
items,
size = 'md',
maxVisibleItems = 3,
showEllipsisDropdown = true,
className,
...props
}: BreadcrumbsProps) => {
const sizeClasses = {
xs: 'text-xs',
sm: 'text-sm',
md: 'text-base',
lg: 'text-lg',
xl: 'text-xl',
};
const getItemStyles = (
item: BreadcrumbItem,
position: 'first' | 'middle' | 'last' = 'middle'
) => {
const baseClasses = 'inline-flex items-center gap-2';
// Disabled state
if (item.isDisabled) {
return `${baseClasses} text-base-content/40 !cursor-default opacity-50 hover:!no-underline`;
}
// Active/Last state (no underline)
if (item.isActive || position === 'last') {
return `${baseClasses} text-primary !cursor-pointer hover:!no-underline`;
}
// Regular clickable state
return `${baseClasses} text-base-content/60`;
};
const renderItem = (
item: BreadcrumbItem,
position: 'first' | 'middle' | 'last' = 'middle'
) => {
const styles = getItemStyles(item, position);
// Disabled items
if (item.isDisabled) {
return (
<span className={styles}>
{item.icon && item.icon}
{item.label}
</span>
);
}
// Active/Last items
if (item.isActive || position === 'last') {
if (item.href) {
return (
<Link href={item.href} className={styles}>
{item.icon && (
<span className='inline-flex gap-2'>{item.icon}</span>
)}
{item.label}
</Link>
);
}
return (
<span className={styles}>
{item.icon && item.icon}
{item.label}
</span>
);
}
// Regular items
if (item.href) {
return (
<Link href={item.href} className={styles}>
{item.icon && <span className='inline-flex gap-2'>{item.icon}</span>}
{item.label}
</Link>
);
}
return (
<span className={styles}>
{item.icon && item.icon}
{item.label}
</span>
);
};
const renderBreadcrumbList = () => {
// Show all items if within limit
if (items.length <= maxVisibleItems) {
return items.map((item, index) => {
const position =
index === 0
? 'first'
: index === items.length - 1
? 'last'
: 'middle';
return <li key={index}>{renderItem(item, position)}</li>;
});
}
// Collapsed items indexing when exceeding limit
const firstItem = items[0];
const lastItem = items[items.length - 1];
const visibleMiddleItems = items.slice(1, -1).slice(-(maxVisibleItems - 2));
const hiddenItems = items.slice(1, -1).slice(0, -(maxVisibleItems - 2));
const showEllipsis = showEllipsisDropdown && hiddenItems.length > 0;
return (
<>
<li>{renderItem(firstItem, 'first')}</li>
{/* Ellipsis for hidden items with dropdown */}
{showEllipsis && <EllipsisDropdown hiddenItems={hiddenItems} />}
{/* Middle items */}
{visibleMiddleItems.map((item, index) => (
<li key={`middle-${index}`}>{renderItem(item, 'middle')}</li>
))}
<li>{renderItem(lastItem, 'last')}</li>
</>
);
};
return (
<nav
aria-label='Breadcrumb'
className={cn('breadcrumbs', sizeClasses[size], className)}
{...props}
>
<ul className='text-sm'>{renderBreadcrumbList()}</ul>
</nav>
);
};
export default Breadcrumb;
+2 -1
View File
@@ -2,11 +2,12 @@ import react from 'react';
import Link from 'next/link'; import Link from 'next/link';
import { cn } from '@/lib/helper'; import { cn } from '@/lib/helper';
import { Color } from '@/types/theme'; import { Color } from '@/types/theme';
import { UrlObject } from 'url';
export interface ButtonProps extends react.ComponentProps<'button'> { export interface ButtonProps extends react.ComponentProps<'button'> {
variant?: 'soft' | 'outline' | 'dash' | 'ghost' | 'link' | 'active'; variant?: 'soft' | 'outline' | 'dash' | 'ghost' | 'link' | 'active';
color?: Color; color?: Color;
href?: string; href?: string | UrlObject;
isLoading?: boolean; isLoading?: boolean;
target?: string; target?: string;
rel?: string; rel?: string;
+17 -3
View File
@@ -22,6 +22,7 @@ export interface CardProps
onCollapsedChange?: (collapsed: boolean) => void; onCollapsedChange?: (collapsed: boolean) => void;
className?: { className?: {
wrapper?: string; wrapper?: string;
wrapperContent?: string;
image?: string; image?: string;
body?: string; body?: string;
title?: string; title?: string;
@@ -122,6 +123,10 @@ const Card = ({
return cn(baseClasses, 'p-6', className?.body); return cn(baseClasses, 'p-6', className?.body);
}; };
const getCollapsibleClasses = () => {
return cn('', className?.collapsible);
};
const getTitleClasses = () => { const getTitleClasses = () => {
const sizeClasses = { const sizeClasses = {
sm: 'text-lg', sm: 'text-lg',
@@ -144,11 +149,19 @@ const Card = ({
return cn('border-t border-base-300 mt-4 pt-4', className?.footer); return cn('border-t border-base-300 mt-4 pt-4', className?.footer);
}; };
const getWrapperContentClasses = () => {
return cn('space-y-4', className?.wrapperContent);
};
const renderCardContent = () => { const renderCardContent = () => {
const hasContent = children || actions || footer; const hasContent = children || actions || footer;
const titleContent = ( const titleContent = (
<div className='group flex items-center !justify-between w-full'> <div
className={
`group flex items-center justify-between! w-full` + getTitleClasses()
}
>
<div className='flex-1'> <div className='flex-1'>
{title && <h2 className={getTitleClasses()}>{title}</h2>} {title && <h2 className={getTitleClasses()}>{title}</h2>}
{subtitle && <p className={getSubtitleClasses()}>{subtitle}</p>} {subtitle && <p className={getSubtitleClasses()}>{subtitle}</p>}
@@ -156,7 +169,7 @@ const Card = ({
{collapsible && ( {collapsible && (
<button <button
onClick={() => handleCollapsedChange(!isCollapsed)} onClick={() => handleCollapsedChange(!isCollapsed)}
className='btn btn-ghost btn-sm btn-circle' className={`btn btn-ghost btn-sm btn-circle` + getTitleClasses()}
aria-label={isCollapsed ? 'Expand content' : 'Collapse content'} aria-label={isCollapsed ? 'Expand content' : 'Collapse content'}
> >
<Icon <Icon
@@ -173,7 +186,7 @@ const Card = ({
); );
const cardContent = ( const cardContent = (
<div className='space-y-4'> <div className={getWrapperContentClasses()}>
{children} {children}
{actions && <div className={getActionsClasses()}>{actions}</div>} {actions && <div className={getActionsClasses()}>{actions}</div>}
{footer && <div className={getFooterClasses()}>{footer}</div>} {footer && <div className={getFooterClasses()}>{footer}</div>}
@@ -204,6 +217,7 @@ const Card = ({
titleClassName='w-full cursor-pointer' titleClassName='w-full cursor-pointer'
contentClassName='p-0' contentClassName='p-0'
fullWidth={true} fullWidth={true}
className={getCollapsibleClasses()}
> >
{cardContent} {cardContent}
</Collapse> </Collapse>
+46 -8
View File
@@ -15,6 +15,7 @@ interface DrawerProps {
className?: DrawerClassName; className?: DrawerClassName;
onBackdropClick?: () => void; onBackdropClick?: () => void;
closeOnBackdropClick?: boolean; closeOnBackdropClick?: boolean;
expandedContent?: ReactNode;
} }
type DrawerClassName = { type DrawerClassName = {
@@ -23,6 +24,7 @@ type DrawerClassName = {
drawerSide?: string; drawerSide?: string;
drawerOverlay?: string; drawerOverlay?: string;
drawerSidebarContent?: string; drawerSidebarContent?: string;
drawerExpandedContent?: string;
}; };
const Drawer = ({ const Drawer = ({
@@ -36,6 +38,7 @@ const Drawer = ({
className, className,
onBackdropClick, onBackdropClick,
closeOnBackdropClick = true, closeOnBackdropClick = true,
expandedContent,
}: DrawerProps) => { }: DrawerProps) => {
const getDrawerClassNames = (): DrawerClassName => { const getDrawerClassNames = (): DrawerClassName => {
const baseClassNames = { const baseClassNames = {
@@ -46,12 +49,24 @@ const Drawer = ({
drawerSidebarContent: 'min-h-full bg-base-100', drawerSidebarContent: 'min-h-full bg-base-100',
}; };
const getSidebarWidth = () => {
if (variant === 'sidebar') {
return expandedContent
? 'w-full lg:min-w-[600px] lg:max-w-[600px]'
: 'w-full max-w-[300px] lg:w-[300px]';
}
if (className?.drawerSidebarContent) {
return '';
}
return 'w-full sm:min-w-120 sm:w-fit';
};
if (variant === 'sidebar') { if (variant === 'sidebar') {
return { return {
...baseClassNames, ...baseClassNames,
drawerSidebarContent: cn( drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent, baseClassNames.drawerSidebarContent,
'w-full max-w-[300px] lg:w-[300px]' getSidebarWidth()
), ),
}; };
} else if (variant === 'right') { } else if (variant === 'right') {
@@ -60,11 +75,11 @@ const Drawer = ({
drawer: cn(baseClassNames.drawer, 'drawer-end'), drawer: cn(baseClassNames.drawer, 'drawer-end'),
drawerSide: cn( drawerSide: cn(
baseClassNames.drawerSide, baseClassNames.drawerSide,
'border-l border-solid border-gray-200 drawer-side w-screen top-0 right-0 fixed z-21' 'border-l border-solid border-gray-200 sm:drawer-side w-screen top-0 right-0 fixed z-21'
), ),
drawerSidebarContent: cn( drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent, baseClassNames.drawerSidebarContent,
'w-full min-w-120 sm:w-fit' getSidebarWidth()
), ),
}; };
} else if (variant === 'left') { } else if (variant === 'left') {
@@ -76,7 +91,7 @@ const Drawer = ({
), ),
drawerSidebarContent: cn( drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent, baseClassNames.drawerSidebarContent,
'w-full min-w-120 sm:w-fit' getSidebarWidth()
), ),
}; };
} }
@@ -138,14 +153,37 @@ const Drawer = ({
onClick={closeDrawer} onClick={closeDrawer}
/> />
{/* Sidebar Content */} {/* Sidebar Content - Full height container */}
<div <div
className={cn( className={cn(
varianClassName?.drawerSidebarContent, 'flex h-screen bg-base-100 overflow-hidden',
className?.drawerContent variant === 'right' && 'flex-row'
)} )}
> >
{sidebarContent} {/* Primary Sidebar Content */}
<div
className={cn(
varianClassName?.drawerSidebarContent,
className?.drawerSidebarContent,
'overflow-y-auto'
)}
>
{sidebarContent}
</div>
{/* Expanded Drawer (Right side, side-by-side) */}
{expandedContent && (
<div
className={cn(
'border-l border-gray-200 bg-white flex flex-col h-full',
className?.drawerExpandedContent
)}
>
<div className='overflow-y-auto flex-1 h-full'>
{expandedContent}
</div>
</div>
)}
</div> </div>
</div> </div>
</div> </div>
+3 -3
View File
@@ -39,8 +39,8 @@ const FloatingActionsButton = ({
// Jika tidak ada baris yang dipilih, jangan tampilkan FAB // Jika tidak ada baris yang dipilih, jangan tampilkan FAB
const positionStyles = const positionStyles =
selectedRowIds.length > 0 selectedRowIds.length > 0
? 'bottom-[10%] opacity-100' ? 'bottom-[5%] opacity-100'
: 'bottom-[-10%] opacity-0'; : 'bottom-[-5%] opacity-0';
// Helper untuk menentukan gaya warna tombol approval // Helper untuk menentukan gaya warna tombol approval
const getApprovalColor = (action: 'APPROVED' | 'REJECTED') => { const getApprovalColor = (action: 'APPROVED' | 'REJECTED') => {
@@ -60,7 +60,7 @@ const FloatingActionsButton = ({
// Container utama FAB // Container utama FAB
<div <div
className={cn( className={cn(
`absolute ${positionStyles} inset-x-1/2 -translate-x-1/2 z-50`, `fixed ${positionStyles} inset-x-1/2 -translate-x-1/2 z-50`,
'mx-auto w-full max-w-sm sm:mx-0 bg-base-300 p-4 rounded-xl shadow-md transition-all duration-300 transform', 'mx-auto w-full max-w-sm sm:mx-0 bg-base-300 p-4 rounded-xl shadow-md transition-all duration-300 transform',
'bg-slate-950 backdrop-blur-md' 'bg-slate-950 backdrop-blur-md'
)} )}
+33 -50
View File
@@ -26,29 +26,34 @@ const MainDrawerContent = () => {
}; };
return ( return (
<div className='w-full p-4 flex flex-col gap-4'> <div className='w-full flex flex-col'>
<div className='flex flex-row items-center gap-4'> <div className='p-3 flex flex-row items-center gap-4 border-b border-base-content/10'>
<Image <div className='flex flex-row items-center gap-2'>
src='/assets/img/lti-logo.png' <Image
alt='MBU Logo' src='/assets/img/lti-logo.png'
width={256} alt='LTI Logo'
height={256} width={40}
className='w-full max-w-16 h-auto' height={40}
/> className='w-full max-w-10 h-auto'
/>
<h1 className='text-xl font-bold'>LTI ERP</h1> <div className='font-roboto'>
<h1 className='text-sm font-semibold'>LTI ERP</h1>
<p className='text-sm text-black/50'>Lumbung Telur Indonesia</p>
</div>
</div>
<div className='grow flex flex-row justify-end sm:hidden'> <div className='grow flex flex-row justify-end sm:hidden'>
<Button <Button
variant='soft' variant='soft'
color='error' color='error'
onClick={closeMainDrawerHandler} onClick={closeMainDrawerHandler}
className='rounded-full' className='p-1 rounded-full'
> >
<Icon <Icon
icon='material-symbols:close-rounded' icon='material-symbols:close-rounded'
width={24} width={16}
height={24} height={16}
/> />
</Button> </Button>
</div> </div>
@@ -67,61 +72,39 @@ const MainDrawer = ({
const pathname = usePathname(); const pathname = usePathname();
const { permissionCheck } = useAuth(); const { permissionCheck } = useAuth();
const isPermitted = ROUTE_PERMISSIONS[pathname]?.some((permission) => const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`;
const isPathnameNotFoundPage = formattedPathname === '/404/';
const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) =>
permissionCheck(permission) permissionCheck(permission)
); );
const getPageTitle = useCallback(() => {
let title = '';
const activeMenu = MAIN_DRAWER_LINKS.find((item) =>
isPathActive(pathname, item.link)
);
const traverseMenuTitle = (menu: typeof activeMenu) => {
if (!menu) return;
const hasSubmenu = menu?.submenu && menu?.submenu.length > 0;
if (!title) {
title += menu?.text;
} else {
title += ' - ' + menu?.text;
}
if (!hasSubmenu || !menu.submenu) return;
const activeSubmenu = menu.submenu?.find((item) =>
isPathActive(pathname, item.link)
);
traverseMenuTitle(activeSubmenu);
};
traverseMenuTitle(activeMenu);
return title;
}, [pathname]);
const pageTitle = getPageTitle();
const toggleSidebar = () => { const toggleSidebar = () => {
setMainDrawerOpen(!mainDrawerOpen); setMainDrawerOpen(!mainDrawerOpen);
}; };
if (!isPermitted) { if (!isPermitted && !isPathnameNotFoundPage) {
return <PermissionNotFound />; return <PermissionNotFound />;
} }
if (isPathnameNotFoundPage) {
return children;
}
return ( return (
<Drawer <Drawer
open={mainDrawerOpen} open={mainDrawerOpen}
setOpen={setMainDrawerOpen} setOpen={setMainDrawerOpen}
openOnLarge openOnLarge
sidebarContent={<MainDrawerContent />} sidebarContent={<MainDrawerContent />}
className={{
drawerSide: 'border-r border-base-content/10',
drawerSidebarContent: 'min-w-[244px] lg:w-[244px]',
}}
> >
<main className='w-full h-full flex flex-col'> <main className='w-full h-full flex flex-col'>
<Navbar title={pageTitle as string} toggleSidebar={toggleSidebar} /> <Navbar toggleSidebar={toggleSidebar} />
{children} {children}
</main> </main>
+22 -2
View File
@@ -53,15 +53,25 @@ interface ModalProps {
ref: RefObject<HTMLDialogElement | null>; ref: RefObject<HTMLDialogElement | null>;
children?: ReactNode; children?: ReactNode;
closeOnBackdrop?: boolean; closeOnBackdrop?: boolean;
onBackdropClick?: () => void;
position?: 'top' | 'middle' | 'bottom' | 'start' | 'end';
className?: { className?: {
modal?: string; modal?: string;
modalBox?: string; modalBox?: string;
}; };
} }
const Modal = ({ ref, children, closeOnBackdrop, className }: ModalProps) => { const Modal = ({
ref,
children,
closeOnBackdrop,
onBackdropClick,
position = 'middle',
className,
}: ModalProps) => {
const handleBackdropClick = (e: React.MouseEvent<HTMLDialogElement>) => { const handleBackdropClick = (e: React.MouseEvent<HTMLDialogElement>) => {
if (closeOnBackdrop && e.target === ref.current) { if (closeOnBackdrop && e.target === ref.current) {
onBackdropClick?.();
ref.current?.close(); ref.current?.close();
} }
}; };
@@ -69,7 +79,17 @@ const Modal = ({ ref, children, closeOnBackdrop, className }: ModalProps) => {
return ( return (
<dialog <dialog
ref={ref} ref={ref}
className={cn('modal', className?.modal)} className={cn(
'modal',
{
'modal-top': position === 'top',
'modal-middle': position === 'middle',
'modal-bottom': position === 'bottom',
'modal-start': position === 'start',
'modal-end': position === 'end',
},
className?.modal
)}
onClick={handleBackdropClick} onClick={handleBackdropClick}
> >
<div className={cn('modal-box', className?.modalBox)}>{children}</div> <div className={cn('modal-box', className?.modalBox)}>{children}</div>
+46 -32
View File
@@ -1,26 +1,28 @@
'use client'; 'use client';
import toast from 'react-hot-toast'; import toast from 'react-hot-toast';
import { useRouter } from 'next/navigation'; import { usePathname, useRouter } from 'next/navigation';
import { Icon } from '@iconify/react'; import { Icon } from '@iconify/react';
import Menu from '@/components/menu/Menu';
import MenuItem from '@/components/menu/MenuItem';
import Button from '@/components/Button'; import Button from '@/components/Button';
import Dropdown from '@/components/Dropdown'; import Breadcrumb, { buildBreadcrumbs } from '@/components/Breadcrumb';
import PopoverButton from '@/components/popover/PopoverButton';
import PopoverContent from '@/components/popover/PopoverContent';
import { useAuth } from '@/services/hooks/useAuth'; import { useAuth } from '@/services/hooks/useAuth';
import { AuthApi } from '@/services/api/auth'; import { AuthApi } from '@/services/api/auth';
import { isResponseError } from '@/lib/api-helper'; import { isResponseError } from '@/lib/api-helper';
import { useUiStore } from '@/stores/ui/ui.store';
interface NavbarProps { interface NavbarProps {
title: string;
toggleSidebar?: () => void; toggleSidebar?: () => void;
} }
const Navbar = ({ title, toggleSidebar }: NavbarProps) => { const Navbar = ({ toggleSidebar }: NavbarProps) => {
const { setUser } = useAuth(); const { setUser } = useAuth();
const router = useRouter(); const router = useRouter();
const pathname = usePathname();
const navbarActions = useUiStore((state) => state.navbarActions);
const logoutClickHandler = async () => { const logoutClickHandler = async () => {
const logoutRes = await AuthApi.logout(); const logoutRes = await AuthApi.logout();
@@ -35,42 +37,54 @@ const Navbar = ({ title, toggleSidebar }: NavbarProps) => {
}; };
return ( return (
<div className='navbar px-4 bg-base-100 shadow-sm'> <div className='navbar p-3 bg-base-100 border-b border-base-content/10'>
<div className='flex-1'> <div className='flex-1'>
<div className='flex flex-row items-center gap-4'> <div className='flex flex-row items-center gap-4'>
{toggleSidebar && ( {toggleSidebar && (
<Button onClick={toggleSidebar} className='block lg:hidden'> <Button
<Icon variant='ghost'
icon='material-symbols:menu-rounded' color='none'
width={24} onClick={toggleSidebar}
height={24} className='block lg:hidden p-[9px] text-base-content/50 border border-base-content/10 rounded-xl shadow-button-soft'
/> >
<Icon icon='heroicons:bars-3' width={20} height={20} />
</Button> </Button>
)} )}
<span className='font-bold text-xl text-primary'>{title}</span> <Breadcrumb items={buildBreadcrumbs(pathname)} />
</div> </div>
</div> </div>
<div className='flex gap-2'> <div className='flex gap-2 items-center'>
<Dropdown {/* Page-specific actions */}
align='end' {navbarActions && <div className='mr-2'>{navbarActions}</div>}
direction='bottom' <PopoverButton
trigger={ tabIndex={0}
<div className='btn btn-ghost btn-circle avatar'> variant='ghost'
<div className='w-10 rounded-full border flex justify-center items-center'> color='none'
<Icon icon='uil:user' width={40} height={40} /> popoverTarget='accountNavbar'
</div> anchorName='--account-navbar'
</div> className='p-[9px] text-base-content/50 border border-base-content/10 rounded-xl shadow-button-soft'
}
className={{
content: 'w-52 mt-3',
}}
> >
<Menu> <Icon icon='heroicons:user' width={20} height={20} />
<MenuItem title='Logout' onClick={logoutClickHandler} /> </PopoverButton>
</Menu>
</Dropdown> <PopoverContent
id='accountNavbar'
anchorName='--account-navbar'
position='bottom-start'
className='rounded-xl border border-base-content/5 shadow-sm'
>
<Button
onClick={logoutClickHandler}
variant='ghost'
color='error'
className='p-3 justify-start text-sm font-semibold w-full'
>
<Icon icon='heroicons-outline:logout' width={20} height={20} />
Logout
</Button>
</PopoverContent>
</div> </div>
</div> </div>
); );
+180 -49
View File
@@ -1,11 +1,12 @@
'use client'; 'use client';
import { ReactNode, useCallback, useEffect, useState } from 'react'; import { Fragment, ReactNode, useCallback, useEffect, useState } from 'react';
import { import {
flexRender, flexRender,
getCoreRowModel, getCoreRowModel,
getFilteredRowModel, getFilteredRowModel,
getPaginationRowModel, getPaginationRowModel,
getExpandedRowModel,
getSortedRowModel, getSortedRowModel,
TableOptions, TableOptions,
useReactTable, useReactTable,
@@ -15,6 +16,7 @@ import {
OnChangeFn, OnChangeFn,
Row, Row,
HeaderContext, HeaderContext,
ExpandedState,
} from '@tanstack/react-table'; } from '@tanstack/react-table';
import { rankItem } from '@tanstack/match-sorter-utils'; import { rankItem } from '@tanstack/match-sorter-utils';
import { Icon } from '@iconify/react'; import { Icon } from '@iconify/react';
@@ -31,11 +33,16 @@ interface TableClassNames {
headerColumnClassName?: string; headerColumnClassName?: string;
tableBodyClassName?: string; tableBodyClassName?: string;
bodyRowClassName?: string; bodyRowClassName?: string;
selectedBodyRowClassName?: string;
bodyColumnClassName?: string; bodyColumnClassName?: string;
bodySubRowClassName?: (depth: number) => string;
selectedBodySubRowClassName?: (depth: number) => string;
bodySubRowColumnClassName?: (depth: number) => string;
tableFooterClassName?: string; tableFooterClassName?: string;
footerRowClassName?: string; footerRowClassName?: string;
footerColumnClassName?: string; footerColumnClassName?: string;
paginationClassName?: string; paginationClassName?: string;
skeletonCellClassName?: string;
} }
export interface TableProps<TData extends object> { export interface TableProps<TData extends object> {
@@ -59,6 +66,7 @@ export interface TableProps<TData extends object> {
enableRowSelection?: boolean | ((row: Row<TData>) => boolean); enableRowSelection?: boolean | ((row: Row<TData>) => boolean);
renderFooter?: boolean; renderFooter?: boolean;
withCheckbox?: boolean; withCheckbox?: boolean;
withPagination?: boolean;
rowOptions?: number[]; rowOptions?: number[];
/** /**
* Custom row renderer. Should return a complete <tr> element or null. * Custom row renderer. Should return a complete <tr> element or null.
@@ -66,9 +74,15 @@ export interface TableProps<TData extends object> {
* Return null to render the default row. * Return null to render the default row.
*/ */
renderCustomRow?: (row: Row<TData>) => ReactNode | null; renderCustomRow?: (row: Row<TData>) => ReactNode | null;
getRowCanExpand?: (row: Row<TData>) => boolean;
renderSubComponent?: (props: { row: Row<TData> }) => React.ReactElement;
expanded?: ExpandedState;
getSubRows?: (originalRow: TData, index: number) => TData[] | undefined;
} }
const DUMMY_SKELETON_DATA = [{}, {}, {}, {}, {}]; const DUMMY_SKELETON_DATA = Array.from({ length: 10 }, (_, index) => ({
id: index,
}));
const emptyContentDefaultValue = ( const emptyContentDefaultValue = (
<div className='w-full p-5 text-center'> <div className='w-full p-5 text-center'>
@@ -86,11 +100,18 @@ export const TABLE_DEFAULT_STYLING = {
tableHeaderClassName: '', tableHeaderClassName: '',
headerRowClassName: '', headerRowClassName: '',
headerColumnClassName: headerColumnClassName:
'px-4 py-3 border-base-content/10 text-base-content/50', 'px-4 py-3 border-base-content/10 text-base-content/50 text-sm font-medium',
tableBodyClassName: '', tableBodyClassName: '',
bodyRowClassName: 'border-t border-base-content/10', bodyRowClassName:
bodyColumnClassName: 'px-4 py-3 text-base-content', 'transition-all duration-200 border-t border-base-content/10 bg-transparent',
paginationClassName: '', selectedBodyRowClassName: 'bg-primary/5',
bodyColumnClassName: 'px-4 py-3 text-base-content font-medium',
bodySubRowClassName: (depth: number) =>
'transition-all duration-200 border-t border-base-content/10 bg-transparent',
selectedBodySubRowClassName: (depth: number) => 'bg-primary/5',
bodySubRowColumnClassName: (depth: number) =>
'px-4 py-3 text-base-content font-medium',
paginationClassName: 'px-3',
tableFooterClassName: 'font-semibold border-base-content/10', tableFooterClassName: 'font-semibold border-base-content/10',
footerRowClassName: 'bg-base-200 border-t-2 border-base-content/10', footerRowClassName: 'bg-base-200 border-t-2 border-base-content/10',
footerColumnClassName: 'p-4 text-base-content whitespace-nowrap', footerColumnClassName: 'p-4 text-base-content whitespace-nowrap',
@@ -117,8 +138,13 @@ const Table = <TData extends object>({
enableRowSelection, enableRowSelection,
renderFooter = false, renderFooter = false,
withCheckbox = false, withCheckbox = false,
withPagination = true,
rowOptions = [10, 20, 50, 100], rowOptions = [10, 20, 50, 100],
renderCustomRow, renderCustomRow,
getRowCanExpand,
renderSubComponent,
expanded = {},
getSubRows,
}: TableProps<TData>) => { }: TableProps<TData>) => {
const isServerSideTable = const isServerSideTable =
totalItems !== undefined && totalItems !== undefined &&
@@ -151,10 +177,14 @@ const Table = <TData extends object>({
getSortedRowModel: getSortedRowModel(), getSortedRowModel: getSortedRowModel(),
getPaginationRowModel: getPaginationRowModel(), getPaginationRowModel: getPaginationRowModel(),
onPaginationChange: setPagination, onPaginationChange: setPagination,
getExpandedRowModel: getExpandedRowModel(),
getRowCanExpand: getRowCanExpand ?? (getSubRows ? undefined : () => false),
getSubRows,
manualSorting, manualSorting,
state: { state: {
pagination, pagination,
globalFilter: fuzzySearchValue, globalFilter: fuzzySearchValue,
expanded,
}, },
filterFns: { filterFns: {
fuzzy: fuzzyFilter, fuzzy: fuzzyFilter,
@@ -222,14 +252,40 @@ const Table = <TData extends object>({
}, [pageSize, setPageSize]); }, [pageSize, setPageSize]);
return ( return (
<div className={tableClassNames.containerClassName}> <div
<div className={tableClassNames.tableWrapperClassName}> className={cn(
<table className={tableClassNames.tableClassName}> TABLE_DEFAULT_STYLING.containerClassName,
<thead className={tableClassNames.tableHeaderClassName}> tableClassNames.containerClassName,
{
'mb-0': !withPagination,
}
)}
>
<div
className={cn(
TABLE_DEFAULT_STYLING.tableWrapperClassName,
tableClassNames.tableWrapperClassName
)}
>
<table
className={cn(
TABLE_DEFAULT_STYLING.tableClassName,
tableClassNames.tableClassName
)}
>
<thead
className={cn(
TABLE_DEFAULT_STYLING.tableHeaderClassName,
tableClassNames.tableHeaderClassName
)}
>
{table.getHeaderGroups().map((headerGroup) => ( {table.getHeaderGroups().map((headerGroup) => (
<tr <tr
key={headerGroup.id} key={headerGroup.id}
className={tableClassNames.headerRowClassName} className={cn(
TABLE_DEFAULT_STYLING.headerRowClassName,
tableClassNames.headerRowClassName
)}
> >
{headerGroup.headers.map((header) => { {headerGroup.headers.map((header) => {
const columnRelativeDepth = const columnRelativeDepth =
@@ -262,6 +318,7 @@ const Table = <TData extends object>({
{ {
'border-b': header.colSpan > 1, 'border-b': header.colSpan > 1,
}, },
TABLE_DEFAULT_STYLING.headerColumnClassName,
tableClassNames.headerColumnClassName tableClassNames.headerColumnClassName
)} )}
> >
@@ -311,7 +368,12 @@ const Table = <TData extends object>({
))} ))}
</thead> </thead>
<tbody className={tableClassNames.tableBodyClassName}> <tbody
className={cn(
TABLE_DEFAULT_STYLING.tableBodyClassName,
tableClassNames.tableBodyClassName
)}
>
{table.getRowModel().rows.map((row) => { {table.getRowModel().rows.map((row) => {
const customRowContent = renderCustomRow?.(row); const customRowContent = renderCustomRow?.(row);
@@ -320,36 +382,96 @@ const Table = <TData extends object>({
} }
return ( return (
<tr key={row.id} className={tableClassNames.bodyRowClassName}> <Fragment key={row.id}>
{row.getVisibleCells().map((cell) => ( <tr
<td data-depth={row.depth}
key={cell.id} className={cn(
className={cn( row.depth > 0
{ 'first:w-9 first:pr-0': withCheckbox }, ? tableClassNames.bodySubRowClassName(row.depth)
tableClassNames.bodyColumnClassName : tableClassNames.bodyRowClassName,
)} {
> [tableClassNames.selectedBodyRowClassName!]:
{!isLoading && row.getIsSelected() && row.depth === 0,
flexRender( [tableClassNames.selectedBodySubRowClassName(
cell.column.columnDef.cell, row.depth
cell.getContext() )!]: row.getIsSelected() && row.depth > 0,
}
)}
>
{row.getVisibleCells().map((cell) => (
<td
key={cell.id}
className={cn(
{ 'first:w-9 first:pr-0': withCheckbox },
TABLE_DEFAULT_STYLING.bodyColumnClassName,
row.depth > 0
? tableClassNames.bodySubRowColumnClassName(
row.depth
)
: tableClassNames.bodyColumnClassName
)} )}
>
{!isLoading &&
flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
{isLoading && <div className='skeleton w-full h-4' />} {isLoading && (
</td> <div
))} className={cn(
</tr> 'skeleton w-full h-4',
tableClassNames.skeletonCellClassName
)}
/>
)}
</td>
))}
</tr>
{row.getIsExpanded() && (
<>
{renderSubComponent && (
<tr
className={cn(
TABLE_DEFAULT_STYLING.bodySubRowClassName(1),
tableClassNames.bodySubRowClassName(1),
{
[tableClassNames.selectedBodySubRowClassName(1)]:
row.getIsSelected(),
}
)}
>
<td colSpan={row.getVisibleCells().length}>
{renderSubComponent({ row })}
</td>
</tr>
)}
</>
)}
</Fragment>
); );
})} })}
</tbody> </tbody>
<tfoot className={cn(tableClassNames.tableFooterClassName)}> <tfoot
className={cn(
TABLE_DEFAULT_STYLING.tableFooterClassName,
tableClassNames.tableFooterClassName
)}
>
{renderFooter && ( {renderFooter && (
<tr className={cn(tableClassNames.footerRowClassName)}> <tr
className={cn(
TABLE_DEFAULT_STYLING.footerRowClassName,
tableClassNames.footerRowClassName
)}
>
{table.getAllLeafColumns().map((column) => ( {table.getAllLeafColumns().map((column) => (
<td <td
key={column.id} key={column.id}
className={cn( className={cn(
{ 'first:w-9 first:pr-0': withCheckbox }, { 'first:w-9 first:pr-0': withCheckbox },
TABLE_DEFAULT_STYLING.footerColumnClassName,
tableClassNames.footerColumnClassName tableClassNames.footerColumnClassName
)} )}
> >
@@ -371,24 +493,33 @@ const Table = <TData extends object>({
!isLoading && !isLoading &&
emptyContent} emptyContent}
{data.length > 0 && table.getRowModel().rows.length > 0 && !isLoading && ( {data.length > 0 &&
<div className={cn('mt-5', tableClassNames.paginationClassName)}> table.getRowModel().rows.length > 0 &&
<Pagination !isLoading &&
totalItems={isServerSideTable ? totalItems : table.getRowCount()} withPagination && (
itemsPerPage={table.getState().pagination.pageSize} <div
currentPage={ className={cn(
isServerSideTable 'mt-5',
? page TABLE_DEFAULT_STYLING.paginationClassName,
: table.getState().pagination.pageIndex + 1 tableClassNames.paginationClassName
} )}
onPrevPage={prevPageClickHandler} >
onNextPage={nextPageClickHandler} <Pagination
onPageChange={pageChangeHandler} totalItems={isServerSideTable ? totalItems : table.getRowCount()}
rowOptions={rowOptions} itemsPerPage={table.getState().pagination.pageSize}
onRowChange={onPageSizeChange} currentPage={
/> isServerSideTable
</div> ? page
)} : table.getState().pagination.pageIndex + 1
}
onPrevPage={prevPageClickHandler}
onNextPage={nextPageClickHandler}
onPageChange={pageChangeHandler}
rowOptions={rowOptions}
onRowChange={onPageSizeChange}
/>
</div>
)}
</div> </div>
); );
}; };
+23 -12
View File
@@ -25,8 +25,10 @@ export interface TabsProps
wrapper?: string; wrapper?: string;
tab?: string; tab?: string;
content?: string; content?: string;
tabHeaderWrapper?: string;
}; };
onTabChange?: (tabId: string) => void; onTabChange?: (tabId: string) => void;
sideContent?: ReactNode;
} }
const Tabs = ({ const Tabs = ({
@@ -38,6 +40,7 @@ const Tabs = ({
activeTabId: controlledActiveId, activeTabId: controlledActiveId,
className, className,
onTabChange, onTabChange,
sideContent,
...props ...props
}: TabsProps) => { }: TabsProps) => {
// State internal hanya dipakai kalau `activeTabId` (controlled) tidak diset // State internal hanya dipakai kalau `activeTabId` (controlled) tidak diset
@@ -59,6 +62,7 @@ const Tabs = ({
wrapper: wrapperClassName, wrapper: wrapperClassName,
tab: tabClassName, tab: tabClassName,
content: contentClassName, content: contentClassName,
tabHeaderWrapper: tabHeaderWrapperClassName,
} = typeof className === 'object' } = typeof className === 'object'
? className ? className
: { wrapper: className, tab: undefined }; : { wrapper: className, tab: undefined };
@@ -102,6 +106,10 @@ const Tabs = ({
tabClassName tabClassName
); );
const getSideContentClasses = () => {
return cn('flex flex-row', tabHeaderWrapperClassName);
};
const activeContent = tabs.find((tab) => tab.id === activeTabId)?.content; const activeContent = tabs.find((tab) => tab.id === activeTabId)?.content;
return ( return (
@@ -112,18 +120,21 @@ const Tabs = ({
typeof className === 'string' ? className : containerClassName typeof className === 'string' ? className : containerClassName
)} )}
> >
<div role='tablist' className={getTabsClasses()}> <div className={getSideContentClasses()}>
{tabs.map(({ id, label, disabled }) => ( <div role='tablist' className={getTabsClasses()}>
<button {tabs.map(({ id, label, disabled }) => (
key={id} <button
role='tab' key={id}
className={getTabClasses(id === activeTabId, disabled)} role='tab'
onClick={() => !disabled && handleTabChange(id)} className={getTabClasses(id === activeTabId, disabled)}
disabled={disabled} onClick={() => !disabled && handleTabChange(id)}
> disabled={disabled}
{label} >
</button> {label}
))} </button>
))}
</div>
{sideContent && sideContent}
</div> </div>
{activeContent && ( {activeContent && (
+203
View File
@@ -0,0 +1,203 @@
'use client';
import { useEffect, useMemo, useState } from 'react';
import { Icon } from '@iconify/react';
import { BaseApproval } from '@/types/api/api-general';
import Button from '@/components/Button';
import { cn, formatDate } from '@/lib/helper';
interface ApprovalStepsV2Props {
approvals?: BaseApproval[];
steps: {
step_number: number;
step_name: string;
}[];
maxVisibleSteps?: number;
className?: {
wrapper?: string;
stepsWrapper?: string;
stepsContainer?: string;
};
}
const ApprovalStepsV2 = ({
approvals,
steps,
maxVisibleSteps = 2,
className,
}: ApprovalStepsV2Props) => {
const [isSeeAll, setIsSeeAll] = useState(false);
const [formattedApprovals, setFormattedApprovals] = useState<
(BaseApproval & { isActive: boolean })[]
>([]);
const latestApprovalStepNumber =
approvals?.[approvals.length - 1].step_number ?? 0;
const lastStepNumber = steps[steps.length - 1].step_number;
const isLatestApprovalStepNumberLessThanLastStepNumber =
latestApprovalStepNumber < lastStepNumber;
const slicedFormattedApprovals = useMemo(() => {
return formattedApprovals.slice(0, isSeeAll ? undefined : maxVisibleSteps);
}, [formattedApprovals, isSeeAll]);
const seeMoreClickHandler = () => {
setIsSeeAll((prevVal) => !prevVal);
};
useEffect(() => {
if (approvals) {
const tempFormattedApprovals: (BaseApproval & { isActive: boolean })[] =
[];
approvals.forEach((approval) => {
tempFormattedApprovals.push({
...approval,
isActive: true,
});
});
if (isLatestApprovalStepNumberLessThanLastStepNumber) {
const latestApprovalStepNumberIndexInSteps = steps.findIndex(
(step) => step.step_number === latestApprovalStepNumber
);
const slicedSteps = steps.slice(
latestApprovalStepNumberIndexInSteps + 1
);
slicedSteps.forEach((step) => {
tempFormattedApprovals.push({
action: 'APPROVED',
action_at: new Date().toISOString(),
action_by: {
id: 0,
id_user: 0,
email: '',
name: '',
},
step_name: step.step_name,
step_number: step.step_number,
isActive: false,
});
});
}
setFormattedApprovals(tempFormattedApprovals);
}
}, [approvals]);
return (
<div
className={cn(
'w-full p-4 flex flex-col border-b border-base-content/10',
className?.wrapper
)}
>
<h4 className='text-base font-medium text-base-content/50 font-roboto'>
Progress Details
</h4>
<div
className={cn(
'mt-6 mb-8 flex flex-col gap-10',
className?.stepsWrapper
)}
>
{slicedFormattedApprovals.map((approval, idx) => {
const isApprovalActionCreated = approval.action === 'CREATED';
const isApprovalActionUpdated = approval.action === 'UPDATED';
const isApprovalActionRejected = approval.action === 'REJECTED';
const isApprovalActionApproved = approval.action === 'APPROVED';
const approvalIcon =
isApprovalActionCreated || isApprovalActionUpdated
? 'heroicons:clock-solid'
: isApprovalActionRejected
? 'heroicons:x-circle-solid'
: isApprovalActionApproved
? 'heroicons:check-badge-solid'
: 'heroicons:check-badge-solid';
return (
<div key={idx} className='w-full flex flex-row items-stretch gap-3'>
<div className='w-fit self-stretch relative'>
<div className='w-fit h-fit flex flex-col items-start'>
<Icon
icon={approvalIcon}
width={24}
height={24}
className={cn({
'text-warning':
isApprovalActionCreated || isApprovalActionUpdated,
'text-error': isApprovalActionRejected,
'text-success': isApprovalActionApproved,
'text-base-content/20': !approval.isActive,
})}
/>
{idx < formattedApprovals.length - 1 && (
<div className='absolute top-6 left-1/2 -translate-x-1/2 w-0 min-h-full h-[calc(100%)] mx-auto my-2 border border-dashed border-base-content/10' />
)}
</div>
</div>
<div
className={cn('w-full flex flex-col gap-1 text-base-content', {
'text-base-content/20': !approval.isActive,
})}
>
<div className='flex flex-col'>
<span className='text-xs'>{approval.step_name}</span>
<span className='text-sm font-semibold'>
{(isApprovalActionCreated || isApprovalActionUpdated) &&
'Diajukan oleh '}
{isApprovalActionRejected && 'Ditolak oleh '}
{isApprovalActionApproved && 'Disetujui oleh '}
{approval.isActive ? approval.action_by.name : '...'}
</span>
</div>
{approval.isActive && (
<p className='w-full max-w-60 p-3 bg-base-content/5 rounded-xl text-xs text-base-content/50'>
Created at :{' '}
{formatDate(approval.action_at, 'DD-MM-YYYY, HH:mm')}
<br />
Notes : {approval.notes ?? '-'}
</p>
)}
</div>
</div>
);
})}
</div>
{formattedApprovals.length > maxVisibleSteps && (
<Button
variant='outline'
color='none'
onClick={seeMoreClickHandler}
className={cn(
'px-3 py-2 gap-2.5 text-sm text-base-content/50 border border-base-content/10 rounded-lg transition-all'
)}
>
<Icon
icon='heroicons-outline:chevron-double-down'
width={20}
height={20}
className={cn('transition-all duration-300', {
'-rotate-180': isSeeAll,
})}
/>
See {isSeeAll ? 'Less' : 'More'}
</Button>
)}
</div>
);
};
export default ApprovalStepsV2;
+48
View File
@@ -0,0 +1,48 @@
import Button, { ButtonProps } from '@/components/Button';
import { getFilledFormikValuesCount } from '@/lib/formik-helper';
import { cn } from '@/lib/helper';
import { Icon } from '@iconify/react';
import { FormikValues } from 'formik';
export type ButtonFilterProps = ButtonProps & {
values: FormikValues;
onClick: () => void;
};
// 'bg-gradient-to-t from-blue-50 to-blue-100 border-blue-500 text-blue-600 hover:from-blue-100 hover:to-blue-200
const ButtonFilter = ({ values, onClick, ...props }: ButtonFilterProps) => {
return (
<Button
{...props}
onClick={onClick}
variant='outline'
color='none'
className={cn(
'rounded-lg max-h-10 font-semibold text-sm gap-1.5',
'text-sm text-base-content/50 border border-base-content/10 shadow-button-soft',
getFilledFormikValuesCount(values) > 0
? 'border-primary-gradient text-primary rounded-lg!'
: 'rounded-lg',
props.className
)}
>
<Icon
icon='heroicons:funnel'
width={20}
height={20}
className={
getFilledFormikValuesCount(values) > 0 ? 'text-blue-600' : ''
}
/>
Filter
{getFilledFormikValuesCount(values) > 0 && (
<span className='w-5 h-5 text-white bg-[#FF3535] rounded-lg border border-base-300 flex items-center justify-center text-xs'>
{getFilledFormikValuesCount(values)}
</span>
)}
</Button>
);
};
export default ButtonFilter;
+17
View File
@@ -0,0 +1,17 @@
import Button from '@/components/Button';
const PageNotFound = () => {
return (
<div className='w-full h-full flex-1 flex flex-col justify-center items-center gap-4'>
<h2 className='text-2xl font-bold text-error'>Halaman Tidak Ditemukan</h2>
<p className='text-gray-600 text-center'>
Halaman atau data yang anda cari tidak ditemukan.
</p>
<Button href='/dashboard' className='text-base-100'>
Kembali ke Dashboard
</Button>
</div>
);
};
export default PageNotFound;
+9 -2
View File
@@ -1,10 +1,17 @@
import Button from '@/components/Button';
const PermissionNotFound = () => { const PermissionNotFound = () => {
return ( return (
<div className='w-full h-screen flex flex-col justify-center items-center gap-4'> <div className='w-full h-screen flex flex-col justify-center items-center gap-4'>
<h2 className='text-2xl font-bold text-error'>Permission Not Found</h2> <h2 className='text-2xl font-bold text-error'>
Hak Akses Tidak Ditemukan
</h2>
<p className='text-gray-600 text-center'> <p className='text-gray-600 text-center'>
You do not have permission to access this page. Anda tidak memiliki hak akses untuk mengakses halaman ini.
</p> </p>
<Button href='/dashboard' className='text-base-100'>
Kembali ke Dashboard
</Button>
</div> </div>
); );
}; };
+26 -7
View File
@@ -5,6 +5,7 @@ import useSWR from 'swr';
import { useAuth } from '@/services/hooks/useAuth'; import { useAuth } from '@/services/hooks/useAuth';
import { httpClientFetcher, SWRHttpKey } from '@/services/http/client'; import { httpClientFetcher, SWRHttpKey } from '@/services/http/client';
import { AuthApi } from '@/services/api/auth';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper'; import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { BaseApiResponse, GetMeResponse } from '@/types/api/api-general'; import { BaseApiResponse, GetMeResponse } from '@/types/api/api-general';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
@@ -28,8 +29,8 @@ const RequireAuth = ({ children }: RequireAuthProps) => {
>('/sso/userinfo', httpClientFetcher, { >('/sso/userinfo', httpClientFetcher, {
shouldRetryOnError: false, shouldRetryOnError: false,
// refresh every 13 minutes // refresh every 12 minutes
refreshInterval: 13 * 60 * 1000, refreshInterval: 12 * 60 * 1000,
}); });
useEffect(() => { useEffect(() => {
@@ -55,6 +56,27 @@ const RequireAuth = ({ children }: RequireAuthProps) => {
setIsLoadingUser(isLoadingUserResponse); setIsLoadingUser(isLoadingUserResponse);
}, [isLoadingUserResponse]); }, [isLoadingUserResponse]);
useEffect(() => {
const interval = setInterval(
async () => {
await AuthApi.refresh();
},
12 * 60 * 1000
);
return () => clearInterval(interval);
}, []);
useEffect(() => {
const refreshUserSession = async () => {
await AuthApi.refresh();
};
if (user) {
refreshUserSession();
}
}, [user]);
if ( if (
(isLoadingUserResponse && !userResponse && !userErrorResponse) || (isLoadingUserResponse && !userResponse && !userErrorResponse) ||
(!userResponse && !userErrorResponse) (!userResponse && !userErrorResponse)
@@ -66,7 +88,7 @@ const RequireAuth = ({ children }: RequireAuthProps) => {
); );
} }
if (userErrorResponse) { if (!isLoadingUserResponse && userErrorResponse) {
return ( return (
<div className='w-full h-screen flex flex-col justify-center items-center gap-4'> <div className='w-full h-screen flex flex-col justify-center items-center gap-4'>
<h2 className='text-2xl font-bold text-error'>Authentication Failed</h2> <h2 className='text-2xl font-bold text-error'>Authentication Failed</h2>
@@ -74,10 +96,7 @@ const RequireAuth = ({ children }: RequireAuthProps) => {
Please try refreshing the page or contact support if the problem Please try refreshing the page or contact support if the problem
persists. persists.
</p> </p>
<button <button className='btn btn-primary' onClick={() => redirectToSSO()}>
className='btn btn-primary'
onClick={() => window.location.reload()}
>
Retry Retry
</button> </button>
</div> </div>
+60
View File
@@ -0,0 +1,60 @@
import Badge from '@/components/Badge';
import { cn } from '@/lib/helper';
import { Color } from '@/types/theme';
interface StatusBadgeProps {
color: Color;
text: string;
className?: {
badge?: string;
status?: string;
};
}
const StatusBadge = ({
color = 'neutral',
text,
className,
}: StatusBadgeProps) => {
return (
<Badge
variant='soft'
className={{
badge: cn(
'px-2 py-1 w-full flex flex-row justify-start gap-1 rounded-lg border border-base-content/10 text-xs font-medium text-base-content',
{
'bg-base-content/5': color === 'neutral',
'bg-success/30': color === 'success',
'bg-error/20': color === 'error',
'bg-primary/20': color === 'info',
'bg-[#FF9A20]/12': color === 'warning',
'bg-[#1166EF]/12': color === 'primary',
},
className?.badge
),
status: cn(className?.status),
}}
color={color}
>
<svg
height='12'
width='12'
xmlns='http://www.w3.org/2000/svg'
className={cn({
'text-base-content/10': color === 'neutral',
'text-[#008000]': color === 'success',
'text-error': color === 'error',
'text-primary': color === 'info',
'text-[#FF9A20]': color === 'warning',
'text-[#1166EF]': color === 'primary',
})}
>
<circle r='6' cx='6' cy='6' fill='currentColor' />
</svg>
{text}
</Badge>
);
};
export default StatusBadge;
@@ -58,6 +58,7 @@ const DrawerHeader = ({
if (leftIconOnClick) { if (leftIconOnClick) {
return ( return (
<button <button
type='button'
onClick={leftIconOnClick} onClick={leftIconOnClick}
className='hover:text-gray-400 bg-transparent border-none p-0' className='hover:text-gray-400 bg-transparent border-none p-0'
> >
@@ -72,12 +73,12 @@ const DrawerHeader = ({
return ( return (
<div <div
className={cn( className={cn(
'flex flex-row justify-between items-center px-4 pt-4', 'flex flex-row justify-between items-center px-4 pt-4 pb-4 border-b border-base-content/10',
className className
)} )}
> >
{/* Left Side */} {/* Left Side */}
<div className='flex flex-row h-full gap-2 items-center'> <div className='flex flex-row h-full gap-3 items-center'>
{renderLeftIcon()} {renderLeftIcon()}
{showDivider && subtitle && ( {showDivider && subtitle && (
@@ -85,7 +86,12 @@ const DrawerHeader = ({
)} )}
{subtitle && ( {subtitle && (
<div className={cn('text-sm text-neutral', subtitleClassName)}> <div
className={cn(
'text-sm font-medium text-base-content/50',
subtitleClassName
)}
>
{subtitle} {subtitle}
</div> </div>
)} )}
+84
View File
@@ -0,0 +1,84 @@
import Alert from '@/components/Alert';
import Button from '@/components/Button';
import { cn } from '@/lib/helper';
import { Icon } from '@iconify/react';
import { useState } from 'react';
/**
* Alert Unique Error List
* @param formErrorList - Array of error messages
* @param onClose - Function to close the alert
*/
const AlertErrorList = ({
formErrorList,
className,
onClose,
title,
}: {
formErrorList: string[];
className?: {
alert?: string;
button?: string;
headerWrapper?: string;
headerIcon?: string;
headerText?: string;
titleWrapper?: string;
ul?: string;
li?: string;
};
onClose: () => void;
title?: string;
}) => {
if (formErrorList.length === 0) return null;
return (
<Alert
color='error'
className={cn(
'w-full flex flex-col gap-2 px-3 rounded-lg',
className?.alert
)}
>
<div
className={cn(
'flex justify-between items-center gap-2 w-full',
className?.headerWrapper
)}
>
<div className={cn('flex items-center gap-2', className?.titleWrapper)}>
<Icon
icon='material-symbols:error-outline'
className={cn(className?.headerIcon)}
width={20}
height={20}
/>
<span className={cn('font-semibold text-sm', className?.headerText)}>
{title || `Terdapat ${formErrorList.length} error pada form:`}
</span>
</div>
<Button
onClick={onClose}
variant='link'
className={cn('ml-auto p-0 w-fit text-white', className?.button)}
color='none'
>
<Icon icon='material-symbols:close' width={20} height={20} />
</Button>
</div>
<ul
className={cn(
'list-disc list-inside pl-4 space-y-1.5 w-full',
className?.ul
)}
>
{formErrorList.map((error, index) => (
<li key={index} className={cn('text-sm', className?.li)}>
{error}
</li>
))}
</ul>
</Alert>
);
};
export default AlertErrorList;
@@ -0,0 +1,45 @@
'use client';
import { View, StyleSheet } from '@react-pdf/renderer';
import { PdfThead, PdfColumn } from './PdfThead';
import { PdfTbody, PdfTbodyCell } from './PdfTbody';
import { PdfTfoot, PdfTfootCell } from './PdfTfoot';
const styles = StyleSheet.create({
table: {
borderWidth: 1,
borderColor: '#000000',
marginBottom: 15,
},
});
interface PdfTableProps {
columns: PdfColumn[];
data: PdfTbodyCell[][];
footer?: PdfTfootCell[];
footerLabel?: string;
firstRow?: {
valueKey: string;
value: number;
align?: 'right';
color?: string;
};
}
export const PdfTable = ({
columns,
data,
footer,
footerLabel = 'Total',
firstRow,
}: PdfTableProps) => {
return (
<View style={styles.table}>
<PdfThead columns={columns} />
<PdfTbody columns={columns} rows={data} firstRow={firstRow} />
{footer && footer.length > 0 && (
<PdfTfoot columns={columns} cells={footer} label={footerLabel} />
)}
</View>
);
};
@@ -0,0 +1,219 @@
'use client';
import { Text, View, StyleSheet } from '@react-pdf/renderer';
export interface PdfColumn {
key: string;
header: string;
flex: number;
align?: 'left' | 'center' | 'right';
}
export interface PdfTbodyCell {
key: string;
value: string | number | React.ReactNode;
align?: 'left' | 'center' | 'right';
color?: string;
formatAs?: 'text' | 'date' | 'currency' | 'number';
formatDate?: string;
}
const styles = StyleSheet.create({
tableRow: {
flexDirection: 'row',
},
tableBorderBottom: {
borderBottomWidth: 1,
borderBottomColor: '#000000',
borderBottomStyle: 'solid',
},
tableCell: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'left',
},
tableCellLast: {
flex: 1,
padding: 4,
fontSize: 7,
borderRightWidth: 0,
},
tableCellRight: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'right',
},
tableCellCenter: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'center',
},
tableCellNo: {
flex: 0.5,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'center',
},
});
interface PdfTbodyProps {
columns: PdfColumn[];
rows: PdfTbodyCell[][];
firstRow?: {
valueKey: string;
value: number;
align?: 'right';
color?: string;
};
formatDate?: (date: string, format: string) => string;
formatNumber?: (num: number) => string;
formatCurrency?: (num: number) => string;
}
export const PdfTbody = ({ columns, rows, firstRow }: PdfTbodyProps) => {
return (
<>
{/* First Row */}
{firstRow && (
<View style={[styles.tableRow, styles.tableBorderBottom]}>
{columns.map((column, index) => {
const isLastColumn = index === columns.length - 1;
const isfirstRowColumn = column.key === firstRow.valueKey;
const align = column.align || 'center';
const cellStyle =
column.key === 'no'
? [styles.tableCellNo, { flex: column.flex }]
: isfirstRowColumn
? [
styles.tableCellRight,
{
flex: column.flex,
color: firstRow.color || 'black',
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: align === 'right'
? [
styles.tableCellRight,
{
flex: column.flex,
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: align === 'center'
? [
styles.tableCellCenter,
{
flex: column.flex,
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: isLastColumn
? [
styles.tableCellLast,
{
flex: column.flex,
borderRightWidth: 0,
},
]
: [styles.tableCell, { flex: column.flex }];
return (
<View key={column.key} style={cellStyle}>
<Text>{isfirstRowColumn ? firstRow.value : ''}</Text>
</View>
);
})}
</View>
)}
{/* Data Rows */}
{rows.map((row, rowIndex) => {
const isLastRow = rowIndex === rows.length - 1;
return (
<View
key={rowIndex}
style={[
styles.tableRow,
!isLastRow ? styles.tableBorderBottom : {},
]}
>
{columns.map((column, colIndex) => {
const cell = row.find((c) => c.key === column.key);
const isLastColumn = colIndex === columns.length - 1;
const align = cell?.align || column.align || 'center';
const cellStyle =
column.key === 'no'
? [styles.tableCellNo, { flex: column.flex }]
: align === 'right'
? [
styles.tableCellRight,
{
flex: column.flex,
color: cell?.color || 'black',
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: align === 'center'
? [
styles.tableCellCenter,
{
flex: column.flex,
color: cell?.color || 'black',
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: isLastColumn
? [
styles.tableCellLast,
{ flex: column.flex, borderRightWidth: 0 },
]
: [
styles.tableCell,
{
flex: column.flex,
color: cell?.color || 'black',
borderRightWidth: isLastColumn ? 0 : 1,
},
];
return (
<View key={column.key} style={cellStyle}>
{cell?.value !== undefined &&
cell?.value !== null &&
cell?.value !== '' ? (
typeof cell.value === 'object' ? (
cell.value
) : (
<Text>{String(cell.value)}</Text>
)
) : (
<Text>-</Text>
)}
</View>
);
})}
</View>
);
})}
</>
);
};
@@ -0,0 +1,131 @@
'use client';
import { Text, View, StyleSheet } from '@react-pdf/renderer';
export interface PdfColumn {
key: string;
header: string;
flex: number;
align?: 'left' | 'center' | 'right';
}
export interface PdfTfootCell {
key: string;
value: string | number;
align?: 'left' | 'center' | 'right';
flex?: number;
color?: string;
}
const styles = StyleSheet.create({
tableRow: {
flexDirection: 'row',
},
summaryRow: {
backgroundColor: '#F0F0F0',
fontWeight: 'bold',
},
tableCell: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'left',
},
tableCellLast: {
flex: 1,
padding: 4,
fontSize: 7,
borderRightWidth: 0,
},
tableCellRight: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'right',
},
tableCellCenter: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'center',
},
tableCellNo: {
flex: 0.5,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
textAlign: 'center',
},
});
interface PdfTfootProps {
columns: PdfColumn[];
cells: PdfTfootCell[];
label?: string;
}
export const PdfTfoot = ({
columns,
cells,
label = 'Total',
}: PdfTfootProps) => {
return (
<View style={[styles.tableRow, styles.summaryRow]}>
{columns.map((column, index) => {
const isLastColumn = index === columns.length - 1;
const cellData = cells.find((c) => c.key === column.key);
const cellStyle =
column.key === 'no'
? [
styles.tableCellNo,
{ flex: column.flex, borderRightWidth: isLastColumn ? 0 : 1 },
]
: cellData?.align === 'right'
? [
styles.tableCellRight,
{
flex: column.flex,
color: cellData?.color || 'black',
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: cellData?.align === 'center'
? [
styles.tableCellCenter,
{
flex: column.flex,
color: cellData?.color || 'black',
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: isLastColumn
? [styles.tableCellLast, { flex: column.flex }]
: [
styles.tableCell,
{
flex: column.flex,
color: cellData?.color || 'black',
},
];
return (
<View key={column.key} style={cellStyle}>
<Text>{column.key === 'no' ? label : cellData?.value || ''}</Text>
</View>
);
})}
</View>
);
};
@@ -0,0 +1,89 @@
'use client';
import { Text, View, StyleSheet } from '@react-pdf/renderer';
export interface PdfColumn {
key: string;
header: string;
flex: number;
align?: 'left' | 'center' | 'right';
}
const styles = StyleSheet.create({
tableRow: {
flexDirection: 'row',
},
tableHeader: {
backgroundColor: '#F5F5F5',
},
tableCellHeader: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
fontWeight: 'bold',
backgroundColor: '#F5F5F5',
borderBottomWidth: 1,
borderBottomColor: '#000000',
borderBottomStyle: 'solid',
paddingVertical: 12,
textAlign: 'center',
},
tableCellHeaderRight: {
flex: 1,
borderRightWidth: 1,
borderRightColor: '#000000',
borderRightStyle: 'solid',
padding: 4,
fontSize: 7,
fontWeight: 'bold',
backgroundColor: '#F5F5F5',
textAlign: 'right',
borderBottomWidth: 1,
borderBottomColor: '#000000',
borderBottomStyle: 'solid',
paddingVertical: 12,
},
});
interface PdfTheadProps {
columns: PdfColumn[];
}
export const PdfThead = ({ columns }: PdfTheadProps) => {
return (
<View style={[styles.tableRow, styles.tableHeader]}>
{columns.map((column, index) => {
const align = column.align || 'center';
const isLastColumn = index === columns.length - 1;
const cellStyle =
align === 'right'
? [
styles.tableCellHeaderRight,
{
flex: column.flex,
textAlign: 'right' as const,
borderRightWidth: isLastColumn ? 0 : 1,
},
]
: [
styles.tableCellHeader,
{
flex: column.flex,
textAlign: align as 'left' | 'center' | 'right',
borderRightWidth: isLastColumn ? 0 : 1,
},
];
return (
<View key={column.key} style={cellStyle}>
<Text>{column.header}</Text>
</View>
);
})}
</View>
);
};
+7
View File
@@ -0,0 +1,7 @@
export { PdfTable } from './PdfTable';
export { PdfThead } from './PdfThead';
export { PdfTbody } from './PdfTbody';
export { PdfTfoot } from './PdfTfoot';
export type { PdfColumn } from './PdfThead';
export type { PdfTbodyCell } from './PdfTbody';
export type { PdfTfootCell } from './PdfTfoot';
@@ -0,0 +1,32 @@
import IconSkeleton from '@/components/helper/skeleton/IconSkeleton';
import { Icon } from '@iconify/react';
const DataStateSkeleton = ({
icon,
title,
description,
}: {
icon: React.ReactNode;
title: string;
description: string;
}) => {
return (
<div className='flex flex-col items-center justify-center'>
<IconSkeleton
className={{
outer: 'mb-2.25',
}}
>
{icon}
</IconSkeleton>
<h3 className='text-base-content/50 font-semibold text-sm mb-1'>
{title}
</h3>
<p className='text-base-content/50 text-xs text-center max-w-xs'>
{description}
</p>
</div>
);
};
export default DataStateSkeleton;
@@ -0,0 +1,33 @@
import { cn } from '@/lib/helper';
import { ReactNode } from 'react';
const IconSkeleton = ({
children,
className,
}: {
children: ReactNode;
className?: {
outer?: string;
inner?: string;
};
}) => {
return (
<div
className={cn(
'w-12.5 h-12.5 bg-[var(--main-color-base-100,#FFFFFF)] border border-base-content/10 rounded-[0.875rem] shadow-[0px_25px_50px_-12px_#00000040] flex items-center justify-center',
className?.outer
)}
>
<div
className={cn(
'w-9.5 h-9.5 bg-primary rounded-lg border border-primary flex items-center justify-center shadow-[inset_0px_4px_4px_0px_#FFFFFF80,inset_0px_2px_0px_0px_#FFFFFF80]',
className?.inner
)}
>
{children}
</div>
</div>
);
};
export default IconSkeleton;
+51 -24
View File
@@ -113,7 +113,15 @@ const DateInput = ({
}; };
const handleSelectSingle = (selectedDate?: Date) => { const handleSelectSingle = (selectedDate?: Date) => {
if (!selectedDate) return; if (!selectedDate) {
setSelected(undefined);
setDisplayValue('');
const syntheticEvent = {
target: { name, value: '' },
} as unknown as React.ChangeEvent<HTMLInputElement>;
onChange?.(syntheticEvent);
return;
}
if (minDate && selectedDate < minDate) { if (minDate && selectedDate < minDate) {
setInternalError(`Tanggal tidak boleh sebelum ${min}`); setInternalError(`Tanggal tidak boleh sebelum ${min}`);
return; return;
@@ -136,7 +144,15 @@ const DateInput = ({
}; };
const handleSelectRange = (range?: { from?: Date; to?: Date }) => { const handleSelectRange = (range?: { from?: Date; to?: Date }) => {
if (!range) return; if (!range) {
setSelectedRange({});
setDisplayValue('');
const syntheticEvent = {
target: { name, value: { from: '', to: '' } },
} as unknown as React.ChangeEvent<HTMLInputElement>;
onChange?.(syntheticEvent);
return;
}
setSelectedRange(range); setSelectedRange(range);
const fromStr = range.from ? formatDate(range.from, 'DD/MM/YYYY') : ''; const fromStr = range.from ? formatDate(range.from, 'DD/MM/YYYY') : '';
@@ -188,17 +204,12 @@ const DateInput = ({
const finalErrorMessage = internalError || externalErrorMessage; const finalErrorMessage = internalError || externalErrorMessage;
return ( return (
<div <div className={cn('w-full flex flex-col text-start', className?.wrapper)}>
className={cn(
'w-full flex flex-col gap-2 text-start',
className?.wrapper
)}
>
{label && ( {label && (
<label <label
htmlFor={name} htmlFor={name}
className={cn( className={cn(
'w-full text-sm font-normal leading-5', 'w-full py-2 text-xs font-semibold leading-5',
{ 'text-error': finalIsError }, { 'text-error': finalIsError },
className?.label className?.label
)} )}
@@ -215,7 +226,7 @@ const DateInput = ({
<div <div
className={cn( className={cn(
'input h-12 bg-inherit px-4 py-2 text-base font-normal leading-6 w-full rounded transition-all duration-200 flex items-center border', 'input h-fit bg-inherit px-3 py-2.5 text-base font-normal leading-6 w-full rounded-lg transition-all duration-200 flex items-center border border-base-content/10',
{ {
'border-error': finalIsError, 'border-error': finalIsError,
'border-success': externalValid && !finalIsError, 'border-success': externalValid && !finalIsError,
@@ -234,7 +245,10 @@ const DateInput = ({
disabled={disabled} disabled={disabled}
readOnly // ✅ tidak bisa diketik manual readOnly // ✅ tidak bisa diketik manual
className={cn( className={cn(
'grow bg-transparent cursor-pointer focus:outline-none', 'grow bg-transparent cursor-pointer focus:outline-none text-sm leading-tight',
{
'cursor-not-allowed': readOnly,
},
className?.input className?.input
)} )}
/> />
@@ -245,10 +259,10 @@ const DateInput = ({
</div> </div>
)} )}
<Icon <Icon
icon='uil:calendar' icon='heroicons:calendar-date-range'
width={24} width={15}
height={24} height={15}
className='cursor-pointer text-dark' className='cursor-pointer text-base-content/20'
onClick={(e) => onClick={(e) =>
handleClick(e as unknown as React.MouseEvent<HTMLInputElement>) handleClick(e as unknown as React.MouseEvent<HTMLInputElement>)
} }
@@ -256,17 +270,17 @@ const DateInput = ({
</div> </div>
{!finalIsError && bottomLabel && ( {!finalIsError && bottomLabel && (
<p className='w-full text-sm opacity-60'>{bottomLabel}</p> <p className='w-full mt-1.5 text-xs opacity-60'>{bottomLabel}</p>
)} )}
{finalIsError && finalErrorMessage && ( {finalIsError && finalErrorMessage && (
<p className='w-full text-sm text-error'>{finalErrorMessage}</p> <p className='w-full mt-1.5 text-xs text-error'>{finalErrorMessage}</p>
)} )}
<Modal <Modal
ref={calendarModal.ref} ref={calendarModal.ref}
className={{ className={{
modal: 'rounded', modal: 'rounded',
modalBox: `!max-w-max min-h-${isRange ? '124' : '110'} flex flex-col`, modalBox: `max-w-max flex flex-col`,
}} }}
closeOnBackdrop closeOnBackdrop
> >
@@ -282,7 +296,11 @@ const DateInput = ({
endMonth={maxDate ?? new Date(new Date().getFullYear() + 5, 11)} endMonth={maxDate ?? new Date(new Date().getFullYear() + 5, 11)}
selected={selectedRange as DateRange} selected={selectedRange as DateRange}
onSelect={handleSelectRange} onSelect={handleSelectRange}
footer={<div className='text-center mt-3'>{displayValue}</div>} footer={
<div className='text-center py-2 text-base-content/65 font-semibold text-xs'>
{displayValue}
</div>
}
disabled={ disabled={
[ [
minDate ? { before: minDate } : undefined, minDate ? { before: minDate } : undefined,
@@ -312,17 +330,26 @@ const DateInput = ({
)} )}
<div className='mt-auto flex flex-col gap-2'> <div className='mt-auto flex flex-col gap-2'>
{isRange && ( {isRange && (
<small className='text-secondary'> <small className='text-base-content/65'>
Tekan dua kali untuk memilih tanggal awal Tekan dua kali untuk reset tanggal awal
</small> </small>
)} )}
<div className='flex h-full justify-end items-end gap-2'> <div className='flex h-full justify-end items-end gap-1.5 mt-3'>
<Button type='button' color='warning' onClick={handleResetDate}> <Button
type='button'
color='none'
className='bg-transparent hover:bg-base-content/10 border-none text-base text-base-content/65 px-3'
onClick={handleResetDate}
>
Reset Reset
</Button> </Button>
{isRange && ( {isRange && (
<Button type='button' onClick={handleSaveDate}> <Button
type='button'
className='rounded-lg px-3 py-2 text-white'
onClick={handleSaveDate}
>
Simpan Simpan
</Button> </Button>
)} )}
@@ -7,6 +7,7 @@ import TextArea, { TextAreaProps } from '@/components/input/TextArea';
interface DebouncedTextAreaProps extends TextAreaProps { interface DebouncedTextAreaProps extends TextAreaProps {
delay?: number; delay?: number;
ref?: React.RefObject<HTMLTextAreaElement | null>;
} }
const DebouncedTextArea = (props: DebouncedTextAreaProps) => { const DebouncedTextArea = (props: DebouncedTextAreaProps) => {
@@ -19,6 +20,11 @@ const DebouncedTextArea = (props: DebouncedTextAreaProps) => {
const [debouncedChangeEvent] = useDebounce(internalChangeEvent, delay ?? 300); const [debouncedChangeEvent] = useDebounce(internalChangeEvent, delay ?? 300);
const [debouncedValue] = useDebounce(internalValue, delay ?? 300); const [debouncedValue] = useDebounce(internalValue, delay ?? 300);
// Sync internal value with external props.value when it changes (e.g., form reset)
useEffect(() => {
setInternalValue(props.value);
}, [props.value]);
const internalChangeHandler: ChangeEventHandler<HTMLTextAreaElement> = ( const internalChangeHandler: ChangeEventHandler<HTMLTextAreaElement> = (
e e
) => { ) => {
@@ -35,6 +41,7 @@ const DebouncedTextArea = (props: DebouncedTextAreaProps) => {
return ( return (
<TextArea <TextArea
{...props} {...props}
ref={props.ref}
value={internalValue} value={internalValue}
onChange={internalChangeHandler} onChange={internalChangeHandler}
/> />
+19 -7
View File
@@ -33,6 +33,7 @@ const FileInput = ({
isError, isError,
errorMessage, errorMessage,
disabled = false, disabled = false,
required = false,
onChange, onChange,
onBlur, onBlur,
readOnly = false, readOnly = false,
@@ -40,7 +41,7 @@ const FileInput = ({
return ( return (
<div <div
className={cn( className={cn(
'w-full flex flex-col gap-2 text-start', 'w-full flex flex-col gap-0 text-start rounded-lg',
className?.wrapper className?.wrapper
)} )}
> >
@@ -48,7 +49,7 @@ const FileInput = ({
<label <label
htmlFor={name} htmlFor={name}
className={cn( className={cn(
'w-full text-sm font-normal leading-5', 'w-full py-2 text-xs font-semibold leading-5',
{ {
'text-error': isError, 'text-error': isError,
}, },
@@ -56,6 +57,13 @@ const FileInput = ({
)} )}
> >
{label} {label}
{required && (
<>
<span className='tooltip tooltip-error' data-tip='required'>
<span className='text-error'> *</span>
</span>
</>
)}
</label> </label>
)} )}
@@ -69,15 +77,19 @@ const FileInput = ({
onChange={onChange} onChange={onChange}
onBlur={onBlur} onBlur={onBlur}
disabled={disabled} disabled={disabled}
className={cn('grow file-input w-full h-12 rounded', className?.input)} className={cn(
'grow file-input w-full h-fit px-3 py-1.5 text-sm font-normal leading-6 rounded-lg! outline-none! transition-all duration-200 bg-white border-base-content/10',
className?.input
)}
readOnly={readOnly} readOnly={readOnly}
/> />
{bottomLabel && ( {!isError && bottomLabel && (
<p className='w-full text-sm opacity-60'>{bottomLabel}</p> <p className='w-full mt-1.5 text-xs opacity-60'>{bottomLabel}</p>
)}
{isError && errorMessage && (
<p className='w-full mt-1.5 text-xs text-error'>{errorMessage}</p>
)} )}
{isError && <p className='w-full text-sm text-error'>{errorMessage}</p>}
</div> </div>
); );
}; };
+395 -111
View File
@@ -9,15 +9,20 @@ import Select, {
SingleValue, SingleValue,
components as ReactSelectComponents, components as ReactSelectComponents,
ControlProps, ControlProps,
MenuListProps,
} from 'react-select'; } from 'react-select';
import CreatableSelect from 'react-select/creatable'; import CreatableSelect from 'react-select/creatable';
import makeAnimated from 'react-select/animated'; import makeAnimated from 'react-select/animated';
import { useDebounce } from 'use-debounce'; import { useDebounce } from 'use-debounce';
import { cn, getByPath } from '@/lib/helper'; import { cn, getByPath } from '@/lib/helper';
import useSWR from 'swr'; import useSWRInfinite from 'swr/infinite';
import { httpClientFetcher } from '@/services/http/client'; import { httpClientFetcher } from '@/services/http/client';
import { BaseApiResponse } from '@/types/api/api-general'; import {
import { isResponseSuccess } from '@/lib/api-helper'; BaseApiResponse,
ErrorApiResponse,
SuccessApiResponse,
} from '@/types/api/api-general';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
export interface OptionType { export interface OptionType {
value: string | number; value: string | number;
@@ -35,7 +40,9 @@ interface SelectInputBaseProps<T = OptionType> {
bottomLabel?: ReactNode; bottomLabel?: ReactNode;
options: T[]; options: T[];
optionComponent?: OptionComponent<T>; optionComponent?: OptionComponent<T>;
components?: Partial<typeof ReactSelectComponents>;
isDisabled?: boolean; isDisabled?: boolean;
readOnly?: boolean;
isLoading?: boolean; isLoading?: boolean;
isClearable?: boolean; isClearable?: boolean;
isRtl?: boolean; isRtl?: boolean;
@@ -47,6 +54,9 @@ interface SelectInputBaseProps<T = OptionType> {
wrapper?: string; wrapper?: string;
label?: string; label?: string;
select?: string; select?: string;
inputPrefix?: string;
inputSuffix?: string;
inputPrefixSuffixWrapper?: string;
}; };
isError?: boolean; isError?: boolean;
errorMessage?: string; errorMessage?: string;
@@ -55,10 +65,16 @@ interface SelectInputBaseProps<T = OptionType> {
delay?: number; delay?: number;
onInputChange?: (search: string) => void; onInputChange?: (search: string) => void;
startAdornment?: ReactNode; startAdornment?: ReactNode;
inputPrefix?: ReactNode;
inputSuffix?: ReactNode;
menuPortalTarget?: HTMLElement | null; menuPortalTarget?: HTMLElement | null;
closeMenuOnSelect?: boolean;
hideSelectedOptions?: boolean;
onMenuScrollToBottom?: ((event: WheelEvent | TouchEvent) => void) | undefined;
} }
interface SelectInputProps<T = OptionType> extends SelectInputBaseProps<T> { export interface SelectInputProps<T = OptionType>
extends SelectInputBaseProps<T> {
createables?: boolean; createables?: boolean;
value?: T | T[] | null; value?: T | T[] | null;
onChange?: (val: T | T[] | null) => void; onChange?: (val: T | T[] | null) => void;
@@ -73,7 +89,7 @@ const CustomControl = <
>( >(
props: ControlProps<Option, IsMulti, Group> props: ControlProps<Option, IsMulti, Group>
) => { ) => {
const { children } = props; const { children, innerProps } = props;
const customProps = props.selectProps as unknown as { const customProps = props.selectProps as unknown as {
shouldShowAdornment?: boolean; shouldShowAdornment?: boolean;
@@ -85,7 +101,7 @@ const CustomControl = <
return ( return (
<ReactSelectComponents.Control {...props}> <ReactSelectComponents.Control {...props}>
<div className='flex-1 px-4! py-1.5 gap-1 flex items-center'> <div className='flex-1 pl-3 gap-1 flex items-center' {...innerProps}>
{shouldShowAdornment && startAdornment} {shouldShowAdornment && startAdornment}
{children} {children}
</div> </div>
@@ -93,6 +109,29 @@ const CustomControl = <
); );
}; };
const CustomMenuList = <
Option,
IsMulti extends boolean,
Group extends GroupBase<Option>,
>(
props: MenuListProps<Option, IsMulti, Group>
) => {
const { children, selectProps, options } = props;
const { isLoading } = selectProps;
return (
<ReactSelectComponents.MenuList {...props}>
{children}
{options.length > 0 && isLoading && (
<div className='px-3 py-2 rounded-md text-center text-gray-400'>
<span className='loading loading-spinner loading-md' />
</div>
)}
</ReactSelectComponents.MenuList>
);
};
const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => { const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
const { const {
label, label,
@@ -101,6 +140,7 @@ const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
onChange, onChange,
options, options,
optionComponent, optionComponent,
components: customComponents,
isDisabled, isDisabled,
isLoading, isLoading,
isClearable, isClearable,
@@ -118,7 +158,13 @@ const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
createables = false, createables = false,
onInputChange, onInputChange,
startAdornment, startAdornment,
inputPrefix,
inputSuffix,
menuPortalTarget, menuPortalTarget,
closeMenuOnSelect,
hideSelectedOptions,
onMenuScrollToBottom,
readOnly,
} = props; } = props;
const [internalInputValue, setInternalInputValue] = useState(''); const [internalInputValue, setInternalInputValue] = useState('');
@@ -128,14 +174,18 @@ const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
const components = useMemo(() => { const components = useMemo(() => {
const base = isAnimated ? animatedComponents : {}; const base = isAnimated ? animatedComponents : {};
const customComponents = { ...base, IndicatorSeparator: () => null }; const mergedComponents = { ...base, IndicatorSeparator: () => null };
if (startAdornment) { if (startAdornment) {
customComponents.Control = CustomControl; mergedComponents.Control = CustomControl;
} }
return customComponents; if (customComponents) {
}, [isAnimated, startAdornment]); Object.assign(mergedComponents, customComponents);
}
return mergedComponents;
}, [isAnimated, startAdornment, customComponents]);
const internalInputChangeHandler = (val: string, meta: InputActionMeta) => { const internalInputChangeHandler = (val: string, meta: InputActionMeta) => {
if (meta.action === 'input-change') setInternalInputValue(val); if (meta.action === 'input-change') setInternalInputValue(val);
@@ -163,16 +213,11 @@ const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
}; };
return ( return (
<div <div className={cn('w-full flex flex-col text-start', className?.wrapper)}>
className={cn(
'w-full flex flex-col gap-2 text-start',
className?.wrapper
)}
>
{label && ( {label && (
<span <span
className={cn( className={cn(
'w-full text-sm font-normal leading-5', 'w-full py-2 text-xs font-semibold leading-5',
{ 'text-error': isError }, { 'text-error': isError },
className?.label className?.label
)} )}
@@ -189,87 +234,264 @@ const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
</span> </span>
)} )}
<SelectComponent<T, boolean, GroupBase<T>> {inputPrefix || inputSuffix ? (
instanceId='select' <div
value={value ?? (isMulti ? [] : null)} className={cn(
onChange={onChange ? handleChange : undefined} 'relative flex text-sm',
options={options} className?.inputPrefixSuffixWrapper
menuIsOpen={openMenu} )}
inputValue={internalInputValue} >
onInputChange={internalInputChangeHandler} {inputPrefix && (
onMenuClose={() => setInternalInputValue('')} <div
isMulti={isMulti} className={cn(
isDisabled={isDisabled} 'inline-flex items-center px-3 border border-r-0 border-base-content/10 rounded-l-lg transition-all duration-200',
isLoading={isLoading} {
isClearable={isClearable} 'bg-gray-100 border-base-content/10': !isDisabled,
isRtl={isRtl} 'bg-gray-50 border-base-content/10': isDisabled,
isSearchable={isSearchable} 'border-error': isError,
placeholder={placeholder} },
className={cn('w-full', className?.select)} className?.inputPrefix
classNames={{ )}
...(!startAdornment && { >
{inputPrefix}
</div>
)}
<SelectComponent<T, boolean, GroupBase<T>>
instanceId='select'
value={value ?? (isMulti ? [] : null)}
onChange={onChange ? handleChange : undefined}
options={options}
menuIsOpen={openMenu}
inputValue={internalInputValue}
onInputChange={internalInputChangeHandler}
onMenuClose={() => setInternalInputValue('')}
isMulti={isMulti}
isDisabled={isDisabled || readOnly}
isLoading={isLoading}
isClearable={isClearable}
isRtl={isRtl}
isSearchable={isSearchable}
placeholder={placeholder}
closeMenuOnSelect={closeMenuOnSelect}
hideSelectedOptions={hideSelectedOptions}
className={cn('w-full flex-1', className?.select)}
classNames={{
control: ({ isFocused, isDisabled }) =>
cn('w-full border bg-white transition-shadow', 'rounded-lg!', {
'cursor-pointer!': !readOnly && !isDisabled,
'border-red-500! ring-2 ring-red-200': isError,
'border-indigo-500 ring-2 ring-indigo-200':
isFocused && !startAdornment,
'border-base-content/10!': !isError && !isFocused,
'bg-gray-100 text-gray-400 cursor-not-allowed':
isDisabled && !readOnly,
'bg-transparent! cursor-not-allowed!': readOnly,
'rounded-l-none!': inputPrefix && !startAdornment,
'rounded-r-none!': inputSuffix && !startAdornment,
}),
valueContainer: () => cn('flex-1 px-3! pr-2! py-2.5! gap-1'),
placeholder: () =>
cn({
'text-gray-400 text-sm leading-tight': !isError,
'text-red-300!': isError,
}),
singleValue: () =>
cn({
'm-0! text-gray-900 text-sm leading-tight': !isError,
'text-error!': isError,
'text-gray-900!': readOnly,
}),
input: () => cn('text-gray-900 m-0! p-0! text-sm leading-tight'),
indicatorsContainer: () =>
cn('flex items-center gap-1 pr-3 py-2'),
dropdownIndicator: ({ isFocused }) =>
cn('p-0! rounded hover:bg-gray-100', {
'text-gray-900': isFocused,
'text-gray-500': !isFocused,
'text-error!': isError,
}),
clearIndicator: () => cn('p-0! rounded hover:bg-gray-100'),
menu: () =>
cn(
'border border-base-content/5 rounded-xl! bg-base-100 shadow-lg! my-1.5!'
),
menuList: () => cn('p-0! max-h-60 overflow-auto'),
option: ({ isFocused, isSelected }) =>
cn('px-3 py-2 rounded-md cursor-pointer!', {
'bg-indigo-600 text-white': isFocused,
'bg-blue-500!': isSelected,
'text-gray-700': !isFocused && !isSelected,
}),
multiValue: ({ getValue, index }) => {
const selectedValues = getValue() as T[];
return cn(
'bg-base-200! rounded-lg! py-[3px] px-2.5 m-0! flex items-center gap-1! w-fit gap-2!',
selectedValues[index]?.className
);
},
multiValueRemove: () => cn('p-0! w-3 h-3'),
multiValueLabel: ({ getValue, index }) => {
const selectedValues = getValue() as T[];
return cn(
'p-0! text-base-content! text-xs!',
selectedValues[index]?.labelClassName
);
},
}}
components={{
...components,
...(optionComponent ? { Option: optionComponent } : {}),
MenuList: CustomMenuList,
}}
{...(startAdornment && {
shouldShowAdornment,
startAdornment,
})}
menuPortalTarget={
typeof document !== 'undefined'
? (menuPortalTarget ?? document.body)
: undefined
}
styles={{
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
multiValue(base) {
return {
...base,
borderRadius: '8px',
};
},
}}
onMenuScrollToBottom={onMenuScrollToBottom}
/>
{inputSuffix && (
<div
className={cn(
'inline-flex items-center px-3 border border-l-0 border-base-content/10 rounded-r-lg transition-all duration-200',
{
'bg-gray-100 border-base-content/10': !isDisabled,
'bg-gray-50 border-base-content/10': isDisabled,
'border-error': isError,
},
className?.inputSuffix
)}
>
{inputSuffix}
</div>
)}
</div>
) : (
<SelectComponent<T, boolean, GroupBase<T>>
instanceId='select'
value={value ?? (isMulti ? [] : null)}
onChange={onChange ? handleChange : undefined}
options={options}
menuIsOpen={openMenu}
inputValue={internalInputValue}
onInputChange={internalInputChangeHandler}
onMenuClose={() => setInternalInputValue('')}
isMulti={isMulti}
isDisabled={isDisabled || readOnly}
isLoading={isLoading}
isClearable={isClearable}
isRtl={isRtl}
isSearchable={isSearchable}
placeholder={placeholder}
closeMenuOnSelect={closeMenuOnSelect}
hideSelectedOptions={hideSelectedOptions}
className={cn('w-full', className?.select)}
classNames={{
control: ({ isFocused, isDisabled }) => control: ({ isFocused, isDisabled }) =>
cn( cn(
'w-full min-h-12! rounded border bg-white transition-shadow cursor-pointer!', 'w-full border bg-white transition-shadow',
// Gunakan rounded-lg untuk semua kasus
'rounded-lg!',
{ {
'cursor-pointer!': !readOnly && !isDisabled,
'border-red-500! ring-2 ring-red-200': isError, 'border-red-500! ring-2 ring-red-200': isError,
'border-indigo-500 ring-2 ring-indigo-200': isFocused, 'border-indigo-500 ring-2 ring-indigo-200':
'border-gray-300': !isError && !isFocused, isFocused && !startAdornment,
'bg-gray-100 text-gray-400 cursor-not-allowed': isDisabled, 'border-base-content/10!': !isError && !isFocused,
'bg-gray-100 text-gray-400 cursor-not-allowed':
isDisabled && !readOnly,
'bg-transparent! cursor-not-allowed!': readOnly,
} }
), ),
valueContainer: () => cn('flex-1 px-4! py-2! gap-1'), valueContainer: () => cn('flex-1 px-3! pr-2! py-2.5! gap-1'),
}), placeholder: () =>
placeholder: () => cn({
cn({ 'text-gray-400': !isError, 'text-red-300!': isError }), 'text-gray-400 text-sm leading-tight': !isError,
singleValue: () => 'text-red-300!': isError,
cn({ 'text-gray-900': !isError, 'text-error!': isError }), }),
input: () => cn('text-gray-900'), singleValue: () =>
indicatorsContainer: () => cn('flex items-center gap-1 pr-2'), cn({
dropdownIndicator: ({ isFocused }) => 'm-0! text-gray-900 text-sm leading-tight': !isError,
cn('p-1 rounded hover:bg-gray-100', { 'text-error!': isError,
'text-gray-900': isFocused, 'text-gray-900!': readOnly,
'text-gray-500': !isFocused, }),
'text-error!': isError, input: () => cn('text-gray-900 m-0! p-0! text-sm leading-tight'),
}), indicatorsContainer: () => cn('flex items-center gap-1 pr-3 py-2'),
menu: () => dropdownIndicator: ({ isFocused }) =>
cn('border border-gray-200 rounded! bg-base-100 shadow-lg!'), cn('p-0! rounded hover:bg-gray-100', {
menuList: () => cn('p-2! max-h-60 overflow-auto'), 'text-gray-900': isFocused,
option: ({ isFocused, isSelected }) => 'text-gray-500': !isFocused,
cn('mt-1 px-3 py-2 rounded-md cursor-pointer!', { 'text-error!': isError,
'bg-indigo-600 text-white': isFocused, }),
'bg-blue-500!': isSelected, clearIndicator: () => cn('p-0! rounded hover:bg-gray-100'),
'text-gray-700': !isFocused && !isSelected, menu: () =>
}), cn(
multiValue: ({ getValue, index }) => { 'border border-base-content/5 rounded-xl! bg-base-100 shadow-lg! my-1.5!'
const selectedValues = getValue() as T[]; ),
return cn( menuList: () => cn('p-0! max-h-60 overflow-auto'),
'bg-indigo-50 rounded py-0.5 pl-2 pr-1 flex items-center gap-1!', option: ({ isFocused, isSelected }) =>
selectedValues[index]?.className cn('px-3 py-2 rounded-md cursor-pointer!', {
); 'bg-indigo-600 text-white': isFocused,
}, 'bg-blue-500!': isSelected,
multiValueLabel: ({ getValue, index }) => { 'text-gray-700': !isFocused && !isSelected,
const selectedValues = getValue() as T[]; }),
return cn('text-indigo-700', selectedValues[index]?.labelClassName); multiValue: ({ getValue, index }) => {
}, const selectedValues = getValue() as T[];
}} return cn(
components={{ 'bg-base-200! rounded-lg! py-[3px] px-2.5 m-0! flex items-center gap-1! w-fit gap-2!',
...components, selectedValues[index]?.className
...(optionComponent ? { Option: optionComponent } : {}), );
}} },
{...(startAdornment && { multiValueRemove: () => cn('p-0! w-3 h-3'),
shouldShowAdornment, multiValueLabel: ({ getValue, index }) => {
startAdornment, const selectedValues = getValue() as T[];
})} return cn(
menuPortalTarget={ 'p-0! text-base-content! text-xs!',
typeof document !== 'undefined' selectedValues[index]?.labelClassName
? (menuPortalTarget ?? document.body) );
: undefined },
} }}
styles={{ components={{
menuPortal: (base) => ({ ...base, zIndex: 9999 }), ...components,
}} ...(optionComponent ? { Option: optionComponent } : {}),
/> MenuList: CustomMenuList,
}}
{...(startAdornment && {
shouldShowAdornment,
startAdornment,
})}
menuPortalTarget={
typeof document !== 'undefined'
? (menuPortalTarget ?? document.body)
: undefined
}
styles={{
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
multiValue(base) {
return {
...base,
borderRadius: '8px',
};
},
}}
onMenuScrollToBottom={onMenuScrollToBottom}
/>
)}
{isError && <p className='w-full text-sm text-error'>{errorMessage}</p>} {isError && <p className='w-full text-sm text-error'>{errorMessage}</p>}
{!isError && bottomLabel && ( {!isError && bottomLabel && (
@@ -280,7 +502,7 @@ const SelectInput = <T extends OptionType>(props: SelectInputProps<T>) => {
}; };
const useSelect = <T,>( const useSelect = <T,>(
basePath: string, basePath: string | null,
valueKey: keyof T | string, valueKey: keyof T | string,
labelKey: keyof T | string, labelKey: keyof T | string,
searchKey: string = 'search', searchKey: string = 'search',
@@ -288,34 +510,96 @@ const useSelect = <T,>(
) => { ) => {
const [inputValue, setInputValue] = useState(''); const [inputValue, setInputValue] = useState('');
const optionsUrlParams = useMemo(() => { const pageKey = 'page';
return new URLSearchParams({ const limitKey = 'limit';
const limit = params?.['limit'] ?? 10;
const getKey = (
pageIndex: number,
previousPageData?: BaseApiResponse<T[]>
) => {
// stop when backend says no more pages
if (previousPageData && isResponseSuccess(previousPageData)) {
const meta = previousPageData.meta;
if (meta && meta.page >= meta.total_pages) return null;
}
const qs = new URLSearchParams({
...(params ?? {}),
[searchKey]: inputValue ?? '', [searchKey]: inputValue ?? '',
...params, [pageKey]: String(pageIndex + 1),
[limitKey]: String(limit),
}).toString(); }).toString();
}, [inputValue, searchKey, params]);
const optionsUrl = `${basePath}?${optionsUrlParams}`; return basePath ? `${basePath}?${qs}` : null;
};
const { data, isLoading } = useSWR(optionsUrl, async (url) => { const {
return await httpClientFetcher<BaseApiResponse<T[]>>(url); data: pages,
}); isLoading,
isValidating,
size,
setSize,
} = useSWRInfinite<BaseApiResponse<T[]>>(getKey, (url) =>
httpClientFetcher<BaseApiResponse<T[]>>(url)
);
const options = isResponseSuccess(data) const options = useMemo(() => {
? data.data.map((item) => { if (!pages) return [];
return {
value: getByPath<T, number>(item, valueKey as string), return pages.flatMap((page) =>
label: getByPath<T, string>(item, labelKey as string), isResponseSuccess(page)
}; ? page.data.map((item) => ({
}) value: getByPath<T, number>(item, valueKey as string),
: []; label: getByPath<T, string>(item, labelKey as string),
}))
: []
);
}, [pages, valueKey, labelKey]);
const lastPage = pages?.[pages.length - 1];
const hasMore =
!!lastPage &&
isResponseSuccess(lastPage) &&
!!lastPage.meta &&
lastPage.meta.page < lastPage.meta.total_pages;
const loadMore = () => {
if (!hasMore) return;
setSize(size + 1);
};
let formattedSuccessRawData: SuccessApiResponse<T[]> | undefined = undefined;
let formattedErrorRawData: ErrorApiResponse | undefined = undefined;
const latestPagesIndex = pages?.length ? pages.length - 1 : 0;
if (isResponseSuccess(pages?.[latestPagesIndex])) {
formattedSuccessRawData = {
...pages?.[latestPagesIndex],
data:
pages?.flatMap((page) => (isResponseSuccess(page) ? page.data : [])) ??
[],
};
}
if (isResponseError(pages?.[latestPagesIndex])) {
formattedErrorRawData = pages?.[latestPagesIndex];
}
return { return {
inputValue, inputValue,
setInputValue, setInputValue,
options, options,
isLoadingOptions: isLoading, rawData: isResponseSuccess(pages?.[latestPagesIndex])
rawData: data, ? formattedSuccessRawData
: formattedErrorRawData,
isLoadingOptions: isLoading || isValidating,
isLoadingMore: isValidating && size > 1,
hasMore,
loadMore,
}; };
}; };
@@ -0,0 +1,89 @@
'use client';
import { useMemo } from 'react';
import {
OptionProps,
GroupBase,
components as ReactSelectComponents,
} from 'react-select';
import SelectInput, { OptionType, SelectInputProps } from './SelectInput';
import { cn } from '@/lib/helper';
interface SelectInputCheckboxProps<T = OptionType>
extends Omit<
SelectInputProps<T>,
'closeMenuOnSelect' | 'hideSelectedOptions' | 'optionComponent'
> {
closeMenuOnSelect?: boolean;
hideSelectedOptions?: boolean;
}
const CheckboxOption = <
T extends OptionType,
IsMulti extends boolean,
Group extends GroupBase<T>,
>(
props: OptionProps<T, IsMulti, Group>
) => {
const { isSelected, label, innerRef, innerProps, className, isFocused } =
props;
return (
<div
ref={innerRef}
{...innerProps}
className={cn(
'flex items-center gap-3 p-3 cursor-pointer transition-all hover:bg-primary/5',
{
'bg-primary/5': isFocused,
},
className
)}
>
<input
type='checkbox'
checked={isSelected}
onChange={() => null}
className='checkbox checkbox-sm rounded-md checkbox-primary pointer-events-none border-base-content/10'
/>
<label className='cursor-pointer flex-1 select-none text-sm text-base-content/50 font-medium'>
{label}
</label>
</div>
);
};
const SelectInputCheckbox = <T extends OptionType>(
props: SelectInputCheckboxProps<T>
) => {
const {
closeMenuOnSelect = false,
hideSelectedOptions = false,
isMulti = true,
className,
...restProps
} = props;
const customComponents = useMemo(() => {
return {
Option: CheckboxOption as typeof ReactSelectComponents.Option,
};
}, []);
return (
<SelectInput<T>
{...restProps}
isMulti={isMulti}
closeMenuOnSelect={closeMenuOnSelect}
hideSelectedOptions={hideSelectedOptions}
className={{
...className,
select: cn(className?.select, 'select-checkbox'),
}}
components={customComponents}
/>
);
};
export default SelectInputCheckbox;
+77
View File
@@ -0,0 +1,77 @@
'use client';
import { useMemo } from 'react';
import {
OptionProps,
GroupBase,
components as ReactSelectComponents,
} from 'react-select';
import SelectInput, { OptionType, SelectInputProps } from './SelectInput';
import { cn } from '@/lib/helper';
interface SelectInputRadioProps<T = OptionType>
extends Omit<SelectInputProps<T>, 'closeMenuOnSelect' | 'optionComponent'> {
closeMenuOnSelect?: boolean;
}
const RadioOption = <
T extends OptionType,
IsMulti extends boolean,
Group extends GroupBase<T>,
>(
props: OptionProps<T, IsMulti, Group>
) => {
const { isSelected, label, innerRef, innerProps, className, isFocused } =
props;
return (
<div
ref={innerRef}
{...innerProps}
className={cn(
'flex items-center gap-3 p-3 cursor-pointer transition-all hover:bg-primary/5',
{
'bg-primary/5': isFocused,
},
className
)}
>
<input
type='radio'
checked={isSelected}
onChange={() => null}
className='radio radio-md radio-primary pointer-events-none'
/>
<label className='cursor-pointer flex-1 select-none text-sm text-base-content/50 font-medium'>
{label}
</label>
</div>
);
};
const SelectInputRadio = <T extends OptionType>(
props: SelectInputRadioProps<T>
) => {
const { closeMenuOnSelect = true, className, ...restProps } = props;
const customComponents = useMemo(() => {
return {
Option: RadioOption as typeof ReactSelectComponents.Option,
};
}, []);
return (
<SelectInput<T>
{...restProps}
closeMenuOnSelect={closeMenuOnSelect}
className={{
...className,
select: cn(className?.select, 'select-radio'),
}}
components={customComponents}
/>
);
};
export default SelectInputRadio;
+10 -5
View File
@@ -28,6 +28,7 @@ export interface TextAreaProps {
onChange?: ChangeEventHandler<HTMLTextAreaElement>; onChange?: ChangeEventHandler<HTMLTextAreaElement>;
onBlur?: FocusEventHandler<HTMLTextAreaElement>; onBlur?: FocusEventHandler<HTMLTextAreaElement>;
rows?: number; rows?: number;
ref?: React.RefObject<HTMLTextAreaElement | null>;
} }
const TextArea = ({ const TextArea = ({
@@ -49,11 +50,12 @@ const TextArea = ({
readOnly = false, readOnly = false,
isLoading = false, isLoading = false,
rows = 3, rows = 3,
ref,
}: TextAreaProps) => { }: TextAreaProps) => {
return ( return (
<div <div
className={cn( className={cn(
'w-full flex flex-col gap-2 text-start', 'w-full flex flex-col gap-0 text-start',
className?.wrapper className?.wrapper
)} )}
> >
@@ -61,7 +63,7 @@ const TextArea = ({
<label <label
htmlFor={name} htmlFor={name}
className={cn( className={cn(
'w-full text-sm font-normal leading-5', 'w-full py-2 text-xs font-semibold leading-5',
{ {
'text-error': isError, 'text-error': isError,
}, },
@@ -83,7 +85,7 @@ const TextArea = ({
<textarea <textarea
className={cn( className={cn(
'textarea h-auto px-4 py-2 text-base font-normal leading-6 w-full rounded outline-none! transition-all bg-white', 'textarea h-auto px-3 py-2.5 text-sm text-base-content font-normal leading-6 w-full rounded-lg outline-none! transition-all bg-white border-base-content/10',
{ {
'border-error': isError, 'border-error': isError,
'border-success!': isValid, 'border-success!': isValid,
@@ -99,6 +101,7 @@ const TextArea = ({
onBlur={onBlur} onBlur={onBlur}
disabled={disabled} disabled={disabled}
readOnly={readOnly} readOnly={readOnly}
ref={ref}
/> />
{(isLoading || endAdornment) && ( {(isLoading || endAdornment) && (
@@ -110,9 +113,11 @@ const TextArea = ({
)} )}
{!isError && bottomLabel && ( {!isError && bottomLabel && (
<p className='w-full text-sm opacity-60'>{bottomLabel}</p> <p className='w-full mt-1.5 text-xs opacity-60'>{bottomLabel}</p>
)}
{isError && (
<p className='w-full mt-1.5 text-xs text-error'>{errorMessage}</p>
)} )}
{isError && <p className='w-full text-sm text-error'>{errorMessage}</p>}
</div> </div>
); );
}; };
+29 -15
View File
@@ -21,6 +21,9 @@ export interface TextInputProps {
label?: string; label?: string;
inputWrapper?: string; inputWrapper?: string;
input?: string; input?: string;
inputPrefix?: string;
inputSuffix?: string;
inputPrefixSuffixWrapper?: string;
}; };
isError?: boolean; isError?: boolean;
isValid?: boolean; isValid?: boolean;
@@ -62,7 +65,7 @@ const TextInput = ({
return ( return (
<div <div
className={cn( className={cn(
'w-full flex flex-col gap-2 text-start', 'w-full flex flex-col gap-0 text-start rounded-lg',
className?.wrapper className?.wrapper
)} )}
> >
@@ -70,7 +73,7 @@ const TextInput = ({
<label <label
htmlFor={name} htmlFor={name}
className={cn( className={cn(
'w-full text-sm font-normal leading-5', 'w-full py-2 text-xs font-semibold leading-5',
{ {
'text-error': isError, 'text-error': isError,
}, },
@@ -90,15 +93,23 @@ const TextInput = ({
)} )}
{inputPrefix || inputSuffix ? ( {inputPrefix || inputSuffix ? (
<div className='relative flex'> <div
className={cn(
'relative flex text-sm',
className?.inputPrefixSuffixWrapper
)}
>
{inputPrefix && ( {inputPrefix && (
<div <div
className={cn( className={cn(
'inline-flex items-center px-4 py-2 border border-r-0 rounded-l-md transition-all duration-200', 'inline-flex items-center px-3 border border-r-0 border-base-content/10 rounded-l-lg transition-all duration-200',
{ {
'bg-gray-100 border-gray-300': !disabled, 'bg-gray-100 border-base-content/10': !disabled,
'bg-gray-50 border-gray-200': disabled, 'bg-gray-50 border-base-content/10': disabled,
} 'border-error': isError,
'border-success!': isValid,
},
className?.inputPrefix
)} )}
> >
{inputPrefix} {inputPrefix}
@@ -107,7 +118,7 @@ const TextInput = ({
<div <div
className={cn( className={cn(
'input h-12 text-base font-normal leading-6 flex-1 rounded-lg! outline-none! transition-all duration-200 flex items-center bg-white', 'input h-fit px-3 py-2.5 gap-1.5 text-sm font-normal leading-6 flex-1 rounded-lg! outline-none! transition-all duration-200 flex items-center bg-white border-base-content/10',
{ {
'border-error': isError, 'border-error': isError,
'border-success!': isValid, 'border-success!': isValid,
@@ -154,11 +165,14 @@ const TextInput = ({
{inputSuffix && ( {inputSuffix && (
<div <div
className={cn( className={cn(
'inline-flex items-center px-4 py-2 border border-l-0 rounded-r-md transition-all duration-200', 'inline-flex items-center px-3 border border-l-0 border-base-content/10 rounded-r-lg transition-all duration-200',
{ {
'bg-gray-100 border-gray-300': !disabled, 'bg-gray-100 border-base-content/10': !disabled,
'bg-gray-50 border-gray-200': disabled, 'bg-gray-50 border-base-content/10': disabled,
} 'border-error': isError,
'border-success!': isValid,
},
className?.inputSuffix
)} )}
> >
{inputSuffix} {inputSuffix}
@@ -168,7 +182,7 @@ const TextInput = ({
) : ( ) : (
<div <div
className={cn( className={cn(
'input h-12 px-4 py-2 text-base font-normal leading-6 w-full rounded-lg! outline-none! transition-all duration-200 bg-white', 'input h-fit px-3 py-2.5 gap-1.5 text-sm font-normal leading-6 w-full rounded-lg! outline-none! transition-all duration-200 bg-white border-base-content/10',
{ {
'border-error': isError, 'border-error': isError,
'border-success!': isValid, 'border-success!': isValid,
@@ -202,10 +216,10 @@ const TextInput = ({
)} )}
{!isError && bottomLabel && ( {!isError && bottomLabel && (
<p className='w-full text-sm opacity-60'>{bottomLabel}</p> <p className='w-full mt-1.5 text-xs opacity-60'>{bottomLabel}</p>
)} )}
{isError && errorMessage && ( {isError && errorMessage && (
<p className='w-full text-sm text-error'>{errorMessage}</p> <p className='w-full mt-1.5 text-xs text-error'>{errorMessage}</p>
)} )}
</div> </div>
); );
+146 -46
View File
@@ -8,10 +8,13 @@ import Button, { ButtonProps } from '@/components/Button';
import { cn } from '@/lib/helper'; import { cn } from '@/lib/helper';
export type IconPosition = 'left' | 'center' | 'right';
export interface ConfirmationModalProps { export interface ConfirmationModalProps {
ref: RefObject<HTMLDialogElement | null>; ref: RefObject<HTMLDialogElement | null>;
type?: 'info' | 'success' | 'error'; type?: 'info' | 'success' | 'error';
text?: string; text?: string;
subtitleText?: string;
closeOnBackdrop?: boolean; closeOnBackdrop?: boolean;
primaryButton?: ButtonProps & { primaryButton?: ButtonProps & {
text?: string; text?: string;
@@ -24,17 +27,78 @@ export interface ConfirmationModalProps {
modalBox?: string; modalBox?: string;
}; };
children?: React.ReactNode; children?: React.ReactNode;
iconSize?: number;
iconPosition?: IconPosition;
} }
const iconConfig = {
info: {
icon: 'material-symbols:info-outline-rounded',
iconClassName: 'text-info-content',
innerRingClassName: 'bg-info',
middleRingClassName: 'bg-info/12',
outerRingClassName: 'border-info/12 bg-info/8',
},
success: {
icon: 'heroicons:check',
iconClassName: 'text-white',
innerRingClassName: 'bg-success',
middleRingClassName: 'bg-success/12',
outerRingClassName: 'border-success/12 bg-success/8',
},
error: {
icon: 'heroicons:exclamation-triangle',
iconClassName: 'text-error-content',
innerRingClassName: 'bg-error',
middleRingClassName: 'bg-error/12',
outerRingClassName: 'border-error/12 bg-error/8',
},
} as const;
const ConfirmationModalIcon = ({
type,
size = 16,
}: {
type: 'info' | 'success' | 'error';
size?: number;
}) => {
const config = iconConfig[type];
return (
<div
className={cn('rounded-full border p-[5px]', config.outerRingClassName)}
>
<div className={cn('rounded-full p-2', config.middleRingClassName)}>
<div
className={cn(
'rounded-full p-1 flex items-center justify-center',
config.innerRingClassName
)}
>
<Icon
icon={config.icon}
width={size}
height={size}
className={config.iconClassName}
/>
</div>
</div>
</div>
);
};
const ConfirmationModal = ({ const ConfirmationModal = ({
ref, ref,
type = 'info', type = 'info',
text, text,
subtitleText,
closeOnBackdrop, closeOnBackdrop,
primaryButton, primaryButton,
secondaryButton, secondaryButton,
className, className,
children, children,
iconSize = 16,
iconPosition = 'center',
}: ConfirmationModalProps) => { }: ConfirmationModalProps) => {
const [isPrimaryButtonLoading, setIsPrimaryButtonLoading] = useState(false); const [isPrimaryButtonLoading, setIsPrimaryButtonLoading] = useState(false);
@@ -53,57 +117,84 @@ const ConfirmationModal = ({
}; };
return ( return (
<Modal ref={ref} closeOnBackdrop={closeOnBackdrop} className={className}> <Modal
<div className='w-full flex flex-col gap-4'> ref={ref}
closeOnBackdrop={closeOnBackdrop}
className={{
...className,
modalBox: cn(
'rounded-xl p-4 flex flex-col gap-4 max-h-[90vh]',
className?.modalBox
),
}}
>
<div
className={cn(
'flex flex-col gap-4',
children && 'sticky top-0 bg-inherit z-10'
)}
>
{iconPosition === 'center' ? (
<>
<div className='w-fit mx-auto'>
<ConfirmationModalIcon type={type} size={iconSize} />
</div>
<p className='text-center font-medium'>
{text ?? 'Apakah anda yakin ingin melakukan hal ini?'}
</p>
{subtitleText && (
<p className='text-center text-sm text-gray-400'>
{subtitleText}
</p>
)}
</>
) : (
<div
className={cn('flex flex-row items-center gap-3', {
'flex-row': iconPosition === 'left',
'flex-row-reverse': iconPosition === 'right',
})}
>
<div className='w-fit'>
<ConfirmationModalIcon type={type} size={iconSize} />
</div>
<div className='flex flex-col gap-1'>
<p className='text-sm font-semibold'>
{text ?? 'Apakah anda yakin ingin melakukan hal ini?'}
</p>
{subtitleText && (
<p className='text-xs text-base-content/50'>{subtitleText}</p>
)}
</div>
</div>
)}
</div>
{children && (
<div className='w-full flex-1 overflow-y-auto'>{children}</div>
)}
{(secondaryButton || primaryButton) && (
<div <div
className={cn( className={cn(
'w-fit p-4 mx-auto flex flex-row justify-center items-center rounded-full', 'w-full grid gap-3',
children && 'sticky bottom-0 bg-inherit z-10',
{ {
'bg-error': type === 'error', 'grid-cols-2': secondaryButton && primaryButton,
'bg-info': type === 'info', 'grid-cols-1':
'bg-success': type === 'success', (secondaryButton && !primaryButton) ||
(!secondaryButton && primaryButton),
} }
)} )}
> >
{type === 'info' && (
<Icon
icon='material-symbols:info-outline-rounded'
width={64}
height={64}
className='text-info-content'
/>
)}
{type === 'success' && (
<Icon
icon='qlementine-icons:success-12'
width={64}
height={64}
className='text-success-content'
/>
)}
{type === 'error' && (
<Icon
icon='solar:danger-triangle-linear'
width={64}
height={64}
className='text-error-content'
/>
)}
</div>
<p className='text-center font-medium'>
{text ?? 'Apakah anda yakin ingin melakukan hal ini?'}
</p>
{children && <div className='w-full'>{children}</div>}
<div className='w-full flex flex-row gap-2'>
{secondaryButton && secondaryButton.text && ( {secondaryButton && secondaryButton.text && (
<Button <Button
{...secondaryButton} {...secondaryButton}
variant='ghost' variant='outline'
color={secondaryButton?.color} color={secondaryButton?.color}
isLoading={secondaryButton?.isLoading} isLoading={secondaryButton?.isLoading}
disabled={ disabled={
@@ -111,8 +202,17 @@ const ConfirmationModal = ({
? secondaryButton?.isLoading ? secondaryButton?.isLoading
: isPrimaryButtonLoading : isPrimaryButtonLoading
} }
onClick={closeModalHandler} onClick={(e) => {
className='grow' if (secondaryButton?.onClick) {
secondaryButton.onClick(e);
} else {
closeModalHandler();
}
}}
className={cn(
'p-2 rounded-xl text-sm',
secondaryButton?.className
)}
> >
{secondaryButton?.text ?? 'Tidak'} {secondaryButton?.text ?? 'Tidak'}
</Button> </Button>
@@ -133,13 +233,13 @@ const ConfirmationModal = ({
? primaryButton?.isLoading ? primaryButton?.isLoading
: isPrimaryButtonLoading : isPrimaryButtonLoading
} }
className='grow' className={cn('p-2 rounded-xl text-sm', primaryButton?.className)}
> >
{primaryButton?.text ?? 'Ya'} {primaryButton?.text ?? 'Ya'}
</Button> </Button>
)} )}
</div> </div>
</div> )}
</Modal> </Modal>
); );
}; };
@@ -13,6 +13,7 @@ interface ConfirmationModalWithNotesProps
extends Omit<ConfirmationModalProps, 'children' | 'primaryButton'> { extends Omit<ConfirmationModalProps, 'children' | 'primaryButton'> {
rows?: number; rows?: number;
placeholder?: string; placeholder?: string;
onClose?: () => void;
primaryButton?: { primaryButton?: {
text?: string; text?: string;
@@ -32,6 +33,8 @@ const ConfirmationModalWithNotes: React.FC<ConfirmationModalWithNotesProps> = ({
className, className,
rows = 3, rows = 3,
placeholder = 'Catatan...', placeholder = 'Catatan...',
onClose,
...props
}) => { }) => {
const randomId = useId(); const randomId = useId();
const [notes, setNotes] = useState(''); const [notes, setNotes] = useState('');
@@ -40,6 +43,11 @@ const ConfirmationModalWithNotes: React.FC<ConfirmationModalWithNotesProps> = ({
setNotes(e.target.value); setNotes(e.target.value);
}; };
const closeModalHandler = () => {
onClose?.();
ref.current?.close();
};
return ( return (
<ConfirmationModal <ConfirmationModal
ref={ref} ref={ref}
@@ -48,13 +56,34 @@ const ConfirmationModalWithNotes: React.FC<ConfirmationModalWithNotesProps> = ({
closeOnBackdrop={closeOnBackdrop} closeOnBackdrop={closeOnBackdrop}
primaryButton={{ primaryButton={{
...primaryButton, ...primaryButton,
onClick: () => { onClick: (e) => {
primaryButton?.onClick?.(notes); if (primaryButton && primaryButton?.onClick) {
primaryButton?.onClick?.(notes);
} else {
closeModalHandler();
}
setNotes(''); setNotes('');
}, },
}} }}
secondaryButton={secondaryButton} secondaryButton={
secondaryButton
? {
text: secondaryButton?.text ?? 'Tidak',
onClick: (e) => {
if (secondaryButton && secondaryButton?.onClick) {
secondaryButton.onClick?.(e);
} else {
closeModalHandler();
}
setNotes('');
},
}
: undefined
}
className={className} className={className}
{...props}
> >
<TextArea <TextArea
name={randomId} name={randomId}
+9 -9
View File
@@ -39,16 +39,15 @@ const SidebarMenuItem = ({ item, activeLink }: SidebarMenuItemProps) => {
<li> <li>
<Link <Link
href={item.link} href={item.link}
className={cn( className={cn('px-3 py-1.5', {
{ 'text-base-content/60': !isItemActive,
'menu-active border-2 border-solid border-base-300': isItemActive, 'menu-active border-[1.5px] border-solid border-base-300':
}, isItemActive,
'px-3 py-1.5' })}
)}
> >
{item.icon && <Icon icon={item.icon} width={20} height={20} />} {item.icon && <Icon icon={item.icon} width={20} height={20} />}
<span className='text-base'>{item.text}</span> <span className='text-sm'>{item.text}</span>
</Link> </Link>
</li> </li>
); );
@@ -62,12 +61,13 @@ const SidebarMenuItem = ({ item, activeLink }: SidebarMenuItemProps) => {
<details open={isItemActive}> <details open={isItemActive}>
<summary <summary
className={cn({ className={cn({
'text-base-content/60': !isItemActive,
'text-primary': isItemActive, 'text-primary': isItemActive,
})} })}
> >
{item.icon && <Icon icon={item.icon} width={20} height={20} />} {item.icon && <Icon icon={item.icon} width={20} height={20} />}
<span className='text-base'>{item.text}</span> <span className='text-sm'>{item.text}</span>
</summary> </summary>
<ul> <ul>
@@ -88,7 +88,7 @@ const SidebarMenuItem = ({ item, activeLink }: SidebarMenuItemProps) => {
const SidebarMenu = ({ menu, activeLink }: SidebarMenuProps) => { const SidebarMenu = ({ menu, activeLink }: SidebarMenuProps) => {
return ( return (
<Menu> <Menu className='p-3'>
{menu.map((menuItem, menuIdx) => { {menu.map((menuItem, menuIdx) => {
return ( return (
<SidebarMenuItem <SidebarMenuItem
+4 -1
View File
@@ -309,9 +309,10 @@ const useApprovalSteps = ({
moduleId: string; moduleId: string;
params?: { params?: {
page?: number; page?: number;
limit: number; limit?: number | string;
search?: string; search?: string;
group_step_number?: boolean; group_step_number?: boolean;
order_by_date?: 'ASC' | 'DESC';
}; };
}) => { }) => {
// Membuat URL Parameters // Membuat URL Parameters
@@ -319,6 +320,8 @@ const useApprovalSteps = ({
page: params?.page?.toString() || '', page: params?.page?.toString() || '',
limit: params?.limit?.toString() || '', limit: params?.limit?.toString() || '',
search: params?.search || '', search: params?.search || '',
group_step_number: params?.group_step_number?.toString() || '',
order_by_date: params?.order_by_date || '',
}).toString(); }).toString();
// fetching data approvals // fetching data approvals
+35 -5
View File
@@ -19,12 +19,16 @@ import ClosingOverheadTabContent from '@/components/pages/closing/ClosingOverhea
import ClosingFinanceTabContent from '@/components/pages/closing/ClosingFinanceTabContent'; import ClosingFinanceTabContent from '@/components/pages/closing/ClosingFinanceTabContent';
import SalesReportTable from '@/components/pages/closing/sale/SalesReportTable'; import SalesReportTable from '@/components/pages/closing/sale/SalesReportTable';
import HppExpeditionReportTable from './hpp-ekspedisi/HppExpeditionReportTable'; import HppExpeditionReportTable from './hpp-ekspedisi/HppExpeditionReportTable';
import ClosingKandangList from '@/components/pages/closing/ClosingKandangList';
import { ProjectFlock } from '@/types/api/production/project-flock';
import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang';
interface ClosingDetailProps { interface ClosingDetailProps {
id: number; id: number;
initialValue?: ClosingGeneralInformation; initialValue?: ClosingGeneralInformation;
salesData?: BaseClosingSales; salesData?: BaseClosingSales;
hppExpeditionData?: ClosingHppExpedition; hppExpeditionData?: ClosingHppExpedition;
projectData?: ProjectFlock;
kandangData?: ProjectFlockKandang;
} }
const ClosingDetail: React.FC<ClosingDetailProps> = ({ const ClosingDetail: React.FC<ClosingDetailProps> = ({
@@ -32,6 +36,8 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
initialValue, initialValue,
salesData, salesData,
hppExpeditionData, hppExpeditionData,
projectData,
kandangData,
}) => { }) => {
const [activeTab, setActiveTab] = useState<string>('sapronak'); const [activeTab, setActiveTab] = useState<string>('sapronak');
@@ -45,7 +51,12 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
{ {
id: 'perhitunganSapronak', id: 'perhitunganSapronak',
label: 'Perhitungan Sapronak', label: 'Perhitungan Sapronak',
content: <ClosingSapronakCalculationTabContent projectFlockId={id} />, content: (
<ClosingSapronakCalculationTabContent
closingGeneralInformation={initialValue}
projectFlockId={id}
/>
),
}, },
{ {
id: 'penjualan', id: 'penjualan',
@@ -55,7 +66,13 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
{ {
id: 'overhead', id: 'overhead',
label: 'Overhead', label: 'Overhead',
content: <ClosingOverheadTabContent projectFlockId={id} />, content: (
<ClosingOverheadTabContent
projectFlockId={id}
generalInformation={initialValue}
kandangData={kandangData}
/>
),
}, },
{ {
id: 'hppEkspedisi', id: 'hppEkspedisi',
@@ -82,7 +99,9 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
<section className='w-full max-w-7xl pb-16'> <section className='w-full max-w-7xl pb-16'>
<header className='flex flex-col gap-4'> <header className='flex flex-col gap-4'>
<Button <Button
href='/closing' href={
!kandangData ? '/closing' : `/closing/detail/?closingId=${id}`
}
variant='link' variant='link'
className='w-fit p-0 text-primary' className='w-fit p-0 text-primary'
> >
@@ -93,7 +112,18 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
<h1 className='text-2xl font-bold text-center'>Detail Closing</h1> <h1 className='text-2xl font-bold text-center'>Detail Closing</h1>
</header> </header>
<ClosingGeneralInformationTable initialValue={initialValue} /> <ClosingGeneralInformationTable
initialValue={initialValue}
projectData={projectData}
kandangData={kandangData}
/>
{!kandangData && (
<ClosingKandangList
initialValue={initialValue}
projectData={projectData}
/>
)}
<Tabs <Tabs
activeTabId={activeTab} activeTabId={activeTab}
@@ -3,124 +3,82 @@ import Table, { TABLE_DEFAULT_STYLING } from '@/components/Table';
import { isResponseSuccess } from '@/lib/api-helper'; import { isResponseSuccess } from '@/lib/api-helper';
import { formatCurrency, formatTitleCase } from '@/lib/helper'; import { formatCurrency, formatTitleCase } from '@/lib/helper';
import { ClosingApi } from '@/services/api/closing'; import { ClosingApi } from '@/services/api/closing';
import { import { HppItem, ProfitLossItem } from '@/types/api/closing';
DataSummarySubTotal, import { useSearchParams } from 'next/navigation';
HppPurchaseData, import { useMemo } from 'react';
ProfitLossDataAmount,
} from '@/types/api/closing';
import useSWR from 'swr'; import useSWR from 'swr';
type HppTableRow =
| (HppPurchaseData & {
group_name: string;
group_index: number;
isGroupHeader?: boolean;
})
| {
group_name: string;
group_index: number;
isGroupHeader: true;
type?: never;
budgeting?: never;
realization?: never;
};
type ProfitLossTableRow =
| (DataSummarySubTotal & {
type: string;
group_name: string;
group_index: number;
isGroupHeader?: boolean;
})
| {
group_name: string;
group_index: number;
isGroupHeader: true;
type?: never;
rp_per_bird?: never;
rp_per_kg?: never;
amount?: never;
};
const ClosingFinanceTable = ({ const ClosingFinanceTable = ({
projectFlockId, projectFlockId,
}: { }: {
projectFlockId: number; projectFlockId: number;
}) => { }) => {
const searchParams = useSearchParams();
const kandangId = searchParams.get('kandangId');
const { data: finance, isLoading } = useSWR( const { data: finance, isLoading } = useSWR(
`/closing/finance/${projectFlockId}`, `/closing/finance/${projectFlockId}${kandangId ? `/${kandangId}` : ''}`,
() => ClosingApi.getFinance(projectFlockId) () =>
ClosingApi.getFinance(
projectFlockId,
kandangId ? Number(kandangId) : undefined
)
); );
const hppTableData: HppTableRow[] = isResponseSuccess(finance) const hppTableData: HppItem[] = useMemo(() => {
? finance.data.hpp_purchases.hpp.flatMap((hpp, groupIndex) => [ if (isResponseSuccess(finance)) {
// Group header row const customItems = {
{ label: 'HPP dan Pengeluaran',
group_name: hpp.group_name, code: 'custom_row',
group_index: groupIndex, } as HppItem;
isGroupHeader: true as const, const purchases = finance.data.hpp.items.filter(
}, (item) => item.category === 'purchase'
// Data rows );
...hpp.data.map((item) => ({ const totalBudgeting = {
group_name: hpp.group_name, label: 'HPP dan Bahan Baku',
group_index: groupIndex, code: 'custom_row',
type: item.type, } as HppItem;
budgeting: item.budgeting, const overheads = finance.data.hpp.items.filter(
realization: item.realization, (item) => item.category === 'overhead'
isGroupHeader: false as const, );
})), return [customItems, ...purchases, totalBudgeting, ...overheads];
]) }
: []; return [];
}, [finance]);
const profitLossTableData: ProfitLossTableRow[] = isResponseSuccess(finance) const profitLossTableData: ProfitLossItem[] = useMemo(() => {
? [ if (isResponseSuccess(finance)) {
// Pembelian group const incomes = finance.data.profit_loss.items.filter(
...finance.data.profit_loss.data.pembelian.map((item) => ({ (item) => item.type === 'income'
label: 'Pembelian', );
group_name: 'Pembelian', const purchases = finance.data.profit_loss.items.filter(
group_index: 1, (item) => item.type === 'purchase'
type: item.type, );
rp_per_bird: item.rp_per_bird, const overheads = finance.data.profit_loss.items.filter(
rp_per_kg: item.rp_per_kg, (item) => item.type === 'overhead'
amount: item.amount, );
isGroupHeader: false as const, const grossProfit = {
})), label: 'LABA RUGI BRUTO',
{ code: 'custom_row',
label: finance.data.profit_loss.data.summary.gross_profit.label, type: 'gross_profit',
group_name: 'Penjualan', rp_per_bird:
group_index: 0, finance.data.profit_loss.summary.gross_profit.rp_per_bird ?? 0,
isGroupHeader: true as const, rp_per_kg: finance.data.profit_loss.summary.gross_profit.rp_per_kg ?? 0,
type: finance.data.profit_loss.data.summary.gross_profit.label, amount: finance.data.profit_loss.summary.gross_profit.amount ?? 0,
rp_per_bird: } as ProfitLossItem;
finance.data.profit_loss.data.summary.gross_profit.rp_per_bird, const subtotal = {
rp_per_kg: label: 'Subtotal',
finance.data.profit_loss.data.summary.gross_profit.rp_per_kg, code: 'custom_row',
amount: finance.data.profit_loss.data.summary.gross_profit.amount, type: 'subtotal',
}, rp_per_bird:
// Penjualan group finance.data.profit_loss.summary.sub_total.rp_per_bird ?? 0,
...finance.data.profit_loss.data.penjualan.map((item) => ({ rp_per_kg: finance.data.profit_loss.summary.sub_total.rp_per_kg ?? 0,
label: 'Penjualan', amount: finance.data.profit_loss.summary.sub_total.amount ?? 0,
group_name: 'Penjualan', } as ProfitLossItem;
group_index: 0, return [...incomes, ...purchases, grossProfit, ...overheads, subtotal];
type: item.type, }
rp_per_bird: item.rp_per_bird, return [];
rp_per_kg: item.rp_per_kg, }, [finance]);
amount: item.amount,
isGroupHeader: false as const,
})),
{
label: finance.data.profit_loss.data.summary.sub_total.label,
group_name: 'Pembelian',
group_index: 1,
isGroupHeader: true as const,
type: finance.data.profit_loss.data.summary.sub_total.label,
rp_per_bird:
finance.data.profit_loss.data.summary.sub_total.rp_per_bird,
rp_per_kg: finance.data.profit_loss.data.summary.sub_total.rp_per_kg,
amount: finance.data.profit_loss.data.summary.sub_total.amount,
},
]
: [];
return ( return (
<div className='flex flex-col gap-4'> <div className='flex flex-col gap-4'>
@@ -133,35 +91,21 @@ const ClosingFinanceTable = ({
> >
<div className='grid grid-cols-2 gap-6'> <div className='grid grid-cols-2 gap-6'>
<div className='flex flex-col gap-1'> <div className='flex flex-col gap-1'>
<div> <div>Laba Rugi Brutto</div>
{isResponseSuccess(finance)
? formatTitleCase(
finance.data.profit_loss.data.summary.gross_profit
.label || '-'
)
: 'Laba Rugi Brutto'}
</div>
<div className='text-lg font-bold'> <div className='text-lg font-bold'>
{isResponseSuccess(finance) {isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.profit_loss.data.summary.gross_profit.amount finance.data.profit_loss.summary.gross_profit.amount
) )
: '-'} : '-'}
</div> </div>
</div> </div>
<div className='flex flex-col gap-1'> <div className='flex flex-col gap-1'>
<div> <div>Laba Rugi Netto</div>
{isResponseSuccess(finance)
? formatTitleCase(
finance.data.profit_loss.data.summary.net_profit.label ||
'-'
)
: 'Laba Rugi Netto'}
</div>
<div className='text-lg font-bold'> <div className='text-lg font-bold'>
{isResponseSuccess(finance) {isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.profit_loss.data.summary.net_profit.amount finance.data.profit_loss.summary.net_profit.amount
) )
: '-'} : '-'}
</div> </div>
@@ -169,11 +113,7 @@ const ClosingFinanceTable = ({
</div> </div>
</Card> </Card>
<Card <Card
title={ title='HPP Purchases'
isResponseSuccess(finance)
? finance.data.hpp_purchases.title
: 'HPP Purchases'
}
variant='bordered' variant='bordered'
collapsible collapsible
className={{ className={{
@@ -181,17 +121,18 @@ const ClosingFinanceTable = ({
}} }}
> >
<div className='mt-6 p-0 mb-0'> <div className='mt-6 p-0 mb-0'>
<Table<HppTableRow> <Table<HppItem>
data={hppTableData} data={hppTableData}
isLoading={isLoading}
columns={[ columns={[
{ {
header: 'No.', header: 'No.',
enableSorting: false, enableSorting: false,
accessorFn: (item, index) => { accessorFn: (item, index) => {
if (item.isGroupHeader) return '-'; if (item.code === 'custom_row') return '-';
const dataRowsBefore = hppTableData const dataRowsBefore = hppTableData
.slice(0, index) .slice(0, index)
.filter((row) => !row.isGroupHeader).length; .filter((row) => row.code !== 'custom_row').length;
return dataRowsBefore + 1; return dataRowsBefore + 1;
}, },
footer: (props) => { footer: (props) => {
@@ -199,9 +140,9 @@ const ClosingFinanceTable = ({
}, },
}, },
{ {
header: 'Type', header: 'Jenis',
enableSorting: false, enableSorting: false,
accessorFn: (item) => formatTitleCase(item.type || '-'), accessorFn: (item) => formatTitleCase(item.label || '-'),
}, },
{ {
header: 'Budgeting', header: 'Budgeting',
@@ -217,8 +158,8 @@ const ClosingFinanceTable = ({
return props.column.id === 'budgeting_rp_per_bird' && return props.column.id === 'budgeting_rp_per_bird' &&
isResponseSuccess(finance) isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.hpp_purchases.summary_hpp.budgeting finance.data.hpp.summary?.budgeting
.rp_per_bird || 0 ?.rp_per_bird || 0
) )
: '-'; : '-';
}, },
@@ -233,8 +174,8 @@ const ClosingFinanceTable = ({
return props.column.id === 'budgeting_rp_per_kg' && return props.column.id === 'budgeting_rp_per_kg' &&
isResponseSuccess(finance) isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.hpp_purchases.summary_hpp.budgeting finance.data.hpp.summary?.budgeting?.rp_per_kg ||
.rp_per_kg || 0 0
) )
: '-'; : '-';
}, },
@@ -249,8 +190,7 @@ const ClosingFinanceTable = ({
return props.column.id === 'budgeting_amount' && return props.column.id === 'budgeting_amount' &&
isResponseSuccess(finance) isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.hpp_purchases.summary_hpp.budgeting finance.data.hpp.summary?.budgeting?.amount || 0
.amount || 0
) )
: '-'; : '-';
}, },
@@ -271,8 +211,8 @@ const ClosingFinanceTable = ({
return props.column.id === 'realization_rp_per_bird' && return props.column.id === 'realization_rp_per_bird' &&
isResponseSuccess(finance) isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.hpp_purchases.summary_hpp.realization finance.data.hpp.summary?.realization
.rp_per_bird || 0 ?.rp_per_bird || 0
) )
: '-'; : '-';
}, },
@@ -287,8 +227,8 @@ const ClosingFinanceTable = ({
return props.column.id === 'realization_rp_per_kg' && return props.column.id === 'realization_rp_per_kg' &&
isResponseSuccess(finance) isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.hpp_purchases.summary_hpp.realization finance.data.hpp.summary?.realization
.rp_per_kg || 0 ?.rp_per_kg || 0
) )
: '-'; : '-';
}, },
@@ -303,8 +243,7 @@ const ClosingFinanceTable = ({
return props.column.id === 'realization_amount' && return props.column.id === 'realization_amount' &&
isResponseSuccess(finance) isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.hpp_purchases.summary_hpp.realization finance.data.hpp.summary?.realization?.amount || 0
.amount || 0
) )
: '-'; : '-';
}, },
@@ -314,7 +253,7 @@ const ClosingFinanceTable = ({
]} ]}
renderCustomRow={(row) => { renderCustomRow={(row) => {
const rowData = row.original; const rowData = row.original;
if (rowData.isGroupHeader) { if (rowData.code === 'custom_row') {
return ( return (
<tr <tr
key={row.id} key={row.id}
@@ -328,7 +267,7 @@ const ClosingFinanceTable = ({
className={TABLE_DEFAULT_STYLING.bodyColumnClassName} className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
> >
<div className='font-bold'> <div className='font-bold'>
{formatTitleCase(rowData.group_name ?? '-')} {formatTitleCase(rowData.label ?? '-')}
</div> </div>
</td> </td>
</tr> </tr>
@@ -341,11 +280,7 @@ const ClosingFinanceTable = ({
</div> </div>
</Card> </Card>
<Card <Card
title={ title='Profit/Loss'
isResponseSuccess(finance)
? finance.data.profit_loss.title
: 'Profit/Loss'
}
variant='bordered' variant='bordered'
collapsible collapsible
className={{ className={{
@@ -353,38 +288,32 @@ const ClosingFinanceTable = ({
}} }}
> >
<div className='mt-6 p-0 mb-0'> <div className='mt-6 p-0 mb-0'>
<Table<ProfitLossTableRow> <Table<ProfitLossItem>
data={profitLossTableData} data={profitLossTableData}
isLoading={isLoading}
columns={[ columns={[
{ {
header: 'Jenis', header: 'Jenis',
enableSorting: false, enableSorting: false,
accessorFn: (item) => item.type, accessorFn: (item) => item.label,
cell: (item) => ( cell: (item) => (
<div className=''> <div className=''>
{formatTitleCase(item.row.original.type || '-')} {formatTitleCase(item.row.original.label || '-')}
</div> </div>
), ),
footer: (item) => ( footer: () => (
<div className='font-bold uppercase'> <div className='font-bold uppercase'>LABA RUGI NETTO</div>
{isResponseSuccess(finance)
? formatTitleCase(
finance.data.profit_loss.data.summary.net_profit
.label || '-'
)
: '-'}
</div>
), ),
}, },
{ {
header: 'Rp/Ekor', header: 'Rp/Ekor',
enableSorting: false, enableSorting: false,
accessorFn: (item) => formatCurrency(item.rp_per_bird || 0), accessorFn: (item) => formatCurrency(item.rp_per_bird || 0),
footer: (item) => ( footer: () => (
<div className='font-bold'> <div className='font-bold'>
{isResponseSuccess(finance) {isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.profit_loss.data.summary.net_profit finance.data.profit_loss.summary.net_profit
.rp_per_bird || 0 .rp_per_bird || 0
) )
: formatCurrency(0)} : formatCurrency(0)}
@@ -395,11 +324,11 @@ const ClosingFinanceTable = ({
header: 'Rp/Kg', header: 'Rp/Kg',
enableSorting: false, enableSorting: false,
accessorFn: (item) => formatCurrency(item.rp_per_kg || 0), accessorFn: (item) => formatCurrency(item.rp_per_kg || 0),
footer: (item) => ( footer: () => (
<div className='font-bold'> <div className='font-bold'>
{isResponseSuccess(finance) {isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.profit_loss.data.summary.net_profit finance.data.profit_loss.summary.net_profit
.rp_per_kg || 0 .rp_per_kg || 0
) )
: formatCurrency(0)} : formatCurrency(0)}
@@ -410,11 +339,11 @@ const ClosingFinanceTable = ({
header: 'Jumlah (Rp)', header: 'Jumlah (Rp)',
enableSorting: false, enableSorting: false,
accessorFn: (item) => formatCurrency(item.amount || 0), accessorFn: (item) => formatCurrency(item.amount || 0),
footer: (item) => ( footer: () => (
<div className='font-bold'> <div className='font-bold'>
{isResponseSuccess(finance) {isResponseSuccess(finance)
? formatCurrency( ? formatCurrency(
finance.data.profit_loss.data.summary.net_profit finance.data.profit_loss.summary.net_profit
.amount || 0 .amount || 0
) )
: formatCurrency(0)} : formatCurrency(0)}
@@ -424,55 +353,30 @@ const ClosingFinanceTable = ({
]} ]}
renderCustomRow={(row) => { renderCustomRow={(row) => {
const rowData = row.original; const rowData = row.original;
if (rowData.isGroupHeader) { if (rowData.code === 'custom_row') {
if (rowData.amount) {
return (
<tr
key={row.id}
className={TABLE_DEFAULT_STYLING.footerRowClassName}
>
<td
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
>
<div className='font-bold ps-6 uppercase'>
{formatTitleCase(rowData.label ?? '-')}
</div>
</td>
<td
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
>
<div className='font-bold'>
{formatCurrency(rowData.rp_per_bird ?? 0)}
</div>
</td>
<td
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
>
<div className='font-bold'>
{formatCurrency(rowData.rp_per_kg ?? 0)}
</div>
</td>
<td
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
>
<div className='font-bold'>
{formatCurrency(rowData.amount ?? 0)}
</div>
</td>
</tr>
);
}
return ( return (
<tr <tr
key={row.id} key={row.id}
className={TABLE_DEFAULT_STYLING.bodyRowClassName} className={TABLE_DEFAULT_STYLING.footerRowClassName}
> >
<td <td className={TABLE_DEFAULT_STYLING.bodyColumnClassName}>
colSpan={4} <div className='font-bold ps-6 uppercase'>
className={TABLE_DEFAULT_STYLING.bodyColumnClassName} {formatTitleCase(rowData.label ?? '-')}
> </div>
</td>
<td className={TABLE_DEFAULT_STYLING.bodyColumnClassName}>
<div className='font-bold'> <div className='font-bold'>
{formatTitleCase(rowData.group_name ?? '-')} {formatCurrency(rowData.rp_per_bird ?? 0)}
</div>
</td>
<td className={TABLE_DEFAULT_STYLING.bodyColumnClassName}>
<div className='font-bold'>
{formatCurrency(rowData.rp_per_kg ?? 0)}
</div>
</td>
<td className={TABLE_DEFAULT_STYLING.bodyColumnClassName}>
<div className='font-bold'>
{formatCurrency(rowData.amount ?? 0)}
</div> </div>
</td> </td>
</tr> </tr>
@@ -1,12 +1,30 @@
import { formatNumber } from '@/lib/helper';
import { ClosingGeneralInformation } from '@/types/api/closing'; import { ClosingGeneralInformation } from '@/types/api/closing';
import { ProjectFlock } from '@/types/api/production/project-flock';
import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang';
import { useMemo } from 'react';
interface ClosingGeneralInformationProps { interface ClosingGeneralInformationProps {
initialValue?: ClosingGeneralInformation; initialValue?: ClosingGeneralInformation;
projectData?: ProjectFlock;
kandangData?: ProjectFlockKandang;
} }
const ClosingGeneralInformationTable = ({ const ClosingGeneralInformationTable = ({
initialValue, initialValue,
projectData,
kandangData,
}: ClosingGeneralInformationProps) => { }: ClosingGeneralInformationProps) => {
const chickinPopulation = useMemo(() => {
if (kandangData) {
return kandangData?.chickins?.reduce(
(acc, chickin) => acc + chickin.usage_qty,
0
);
}
return 0;
}, [kandangData]);
return ( return (
<div className='w-full my-4 @container'> <div className='w-full my-4 @container'>
<div className='flex flex-col @sm:flex-row gap-4'> <div className='flex flex-col @sm:flex-row gap-4'>
@@ -17,7 +35,9 @@ const ClosingGeneralInformationTable = ({
<tr> <tr>
<td>Lokasi</td> <td>Lokasi</td>
<td>:</td> <td>:</td>
<td>{initialValue?.location_name}</td> <td>
{initialValue?.location_name ?? projectData?.location?.name}
</td>
</tr> </tr>
<tr> <tr>
<td>Periode</td> <td>Periode</td>
@@ -25,14 +45,22 @@ const ClosingGeneralInformationTable = ({
<td>{initialValue?.period}</td> <td>{initialValue?.period}</td>
</tr> </tr>
<tr> <tr>
<td>Kategori</td> <td>Project Flock</td>
<td>:</td> <td>:</td>
<td>{initialValue?.project_category}</td> <td>
{initialValue?.project_flock?.name ??
projectData?.flock_name}
</td>
</tr> </tr>
<tr> <tr>
<td>Populasi</td> <td>Populasi</td>
<td>:</td> <td>:</td>
<td>{initialValue?.population} Ekor</td> <td>
{!kandangData
? formatNumber(initialValue?.population || 0)
: formatNumber(chickinPopulation || 0)}{' '}
Ekor
</td>
</tr> </tr>
<tr> <tr>
<td>Jenis Project</td> <td>Jenis Project</td>
@@ -40,9 +68,13 @@ const ClosingGeneralInformationTable = ({
<td>{initialValue?.project_type}</td> <td>{initialValue?.project_type}</td>
</tr> </tr>
<tr className='table-row @sm:hidden'> <tr className='table-row @sm:hidden'>
<td>Kandang Aktif</td> <td>Kandang {!kandangData && 'Aktif'}</td>
<td>:</td> <td>:</td>
<td>{initialValue?.active_house_count} Kandang</td> <td>
{!kandangData
? `${initialValue?.active_house_count} Kandang`
: kandangData?.kandang?.name}
</td>
</tr> </tr>
<tr className='table-row @sm:hidden'> <tr className='table-row @sm:hidden'>
<td>Status Pembayaran Penjualan</td> <td>Status Pembayaran Penjualan</td>
@@ -69,9 +101,13 @@ const ClosingGeneralInformationTable = ({
<table className='table table-zebra table-sm'> <table className='table table-zebra table-sm'>
<tbody> <tbody>
<tr> <tr>
<td>Kandang Aktif</td> <td>Kandang {!kandangData && 'Aktif'}</td>
<td>:</td> <td>:</td>
<td>{initialValue?.active_house_count} Kandang</td> <td>
{!kandangData
? `${initialValue?.active_house_count} Kandang`
: kandangData?.kandang?.name}
</td>
</tr> </tr>
<tr> <tr>
<td>Status Pembayaran Penjualan</td> <td>Status Pembayaran Penjualan</td>
@@ -0,0 +1,174 @@
'use client';
import { ChangeEventHandler, useEffect, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import { ColumnDef, SortingState } from '@tanstack/react-table';
import { Icon } from '@iconify/react';
import Table from '@/components/Table';
import Card from '@/components/Card';
import Collapse from '@/components/Collapse';
import { cn, formatNumber } from '@/lib/helper';
import { isResponseSuccess } from '@/lib/api-helper';
import { useTableFilter } from '@/services/hooks/useTableFilter';
import { ClosingApi } from '@/services/api/closing';
import { ClosingIncomingSapronakSummary } from '@/types/api/closing';
interface ClosingIncomingSapronaksSummaryTableProps {
projectFlockId: number;
}
const ClosingIncomingSapronaksSummaryTable = ({
projectFlockId,
}: ClosingIncomingSapronaksSummaryTableProps) => {
const searchParams = useSearchParams();
const kandangId = searchParams.get('kandangId');
const {
state: tableFilterState,
updateFilter,
setPage,
setPageSize,
toQueryString: getTableFilterQueryString,
} = useTableFilter({
initial: {
search: '',
nameSort: '',
},
paramMap: {
page: 'page',
pageSize: 'limit',
nameSort: 'sort_name',
},
});
const {
data: incomingSapronakSummaries,
isLoading: isLoadingIncomingSapronakSummaries,
} = useSWR(
`${ClosingApi.basePath}/${projectFlockId}/sapronak/summary${getTableFilterQueryString()}&type=incoming&kandang_id=${kandangId ? `${kandangId}` : ''}`,
ClosingApi.getAllIncomingSapronakSummaryFetcher,
{
keepPreviousData: true,
}
);
const [open, setOpen] = useState(true);
const [sorting, setSorting] = useState<SortingState>([]);
const [rowSelection, setRowSelection] = useState<Record<string, boolean>>({});
const incomingSapronaksColumns: ColumnDef<ClosingIncomingSapronakSummary>[] =
[
{
header: '#',
cell: (props) => props.row.index + 1,
},
{
accessorKey: 'category',
header: 'Kategori',
},
{
accessorKey: 'total_qty',
header: 'Total Kuantitas',
cell: (props) =>
`${formatNumber(props.row.original.total_qty)} ${props.row.original.uom.name}`,
},
];
const searchChangeHandler: ChangeEventHandler<HTMLInputElement> = (e) => {
updateFilter('search', e.target.value);
};
// track sorting
useEffect(() => {
const isNameSorted = sorting.find((sortItem) => sortItem.id === 'name');
if (!isNameSorted) {
updateFilter('nameSort', '');
} else {
updateFilter('nameSort', isNameSorted.desc ? 'desc' : 'asc');
}
}, [sorting, updateFilter]);
useEffect(() => {
if (!open) {
setOpen(
isResponseSuccess(incomingSapronakSummaries)
? incomingSapronakSummaries.data.length > 0
: false
);
}
}, [incomingSapronakSummaries, isResponseSuccess]);
return (
<Card
className={{
wrapper: 'w-full',
body: 'p-4 shadow',
}}
>
<Collapse
open={open}
onOpenChange={setOpen}
title={
<div className='card-actions p-4 justify-between items-center w-full'>
<div className='card-title'>Ringkasan Sapronak Masuk</div>
<Icon
icon='material-symbols:keyboard-arrow-down'
width={24}
height={24}
className={cn('text-primary transition-transform', {
'-rotate-180': open,
})}
/>
</div>
}
className='w-full!'
titleClassName='w-full p-0!'
>
<div className='w-full p-0'>
<Table<ClosingIncomingSapronakSummary>
data={
isResponseSuccess(incomingSapronakSummaries)
? incomingSapronakSummaries?.data
: []
}
columns={incomingSapronaksColumns}
pageSize={tableFilterState.pageSize}
onPageSizeChange={setPageSize}
rowOptions={[10, 20, 50, 100]}
page={
isResponseSuccess(incomingSapronakSummaries)
? incomingSapronakSummaries?.meta?.page
: 0
}
totalItems={
isResponseSuccess(incomingSapronakSummaries)
? incomingSapronakSummaries?.meta?.total_results
: 0
}
onPageChange={setPage}
isLoading={isLoadingIncomingSapronakSummaries}
sorting={sorting}
setSorting={setSorting}
rowSelection={rowSelection}
setRowSelection={setRowSelection}
className={{
containerClassName: cn({
'w-full mb-20':
isResponseSuccess(incomingSapronakSummaries) &&
incomingSapronakSummaries?.data?.length === 0,
}),
}}
/>
</div>
</Collapse>
</Card>
);
};
export default ClosingIncomingSapronaksSummaryTable;
@@ -1,6 +1,7 @@
'use client'; 'use client';
import { ChangeEventHandler, useEffect, useState } from 'react'; import { ChangeEventHandler, useEffect, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import useSWR from 'swr'; import useSWR from 'swr';
import { ColumnDef, SortingState } from '@tanstack/react-table'; import { ColumnDef, SortingState } from '@tanstack/react-table';
@@ -23,6 +24,9 @@ interface ClosingIncomingSapronaksTableProps {
const ClosingIncomingSapronaksTable = ({ const ClosingIncomingSapronaksTable = ({
projectFlockId, projectFlockId,
}: ClosingIncomingSapronaksTableProps) => { }: ClosingIncomingSapronaksTableProps) => {
const searchParams = useSearchParams();
const kandangId = searchParams.get('kandangId');
const { const {
state: tableFilterState, state: tableFilterState,
updateFilter, updateFilter,
@@ -43,11 +47,8 @@ const ClosingIncomingSapronaksTable = ({
const { data: incomingSapronaks, isLoading: isLoadingIncomingSapronaks } = const { data: incomingSapronaks, isLoading: isLoadingIncomingSapronaks } =
useSWR( useSWR(
`${ClosingApi.basePath}/${projectFlockId}/sapronak${getTableFilterQueryString()}&type=incoming`, `${ClosingApi.basePath}/${projectFlockId}/sapronak${getTableFilterQueryString()}&type=incoming&kandang_id=${kandangId ? `${kandangId}` : ''}`,
ClosingApi.getAllIncomingSapronakFetcher, ClosingApi.getAllIncomingSapronakFetcher
{
keepPreviousData: true,
}
); );
const [open, setOpen] = useState(true); const [open, setOpen] = useState(true);
@@ -0,0 +1,37 @@
import Button from '@/components/Button';
import { ClosingGeneralInformation } from '@/types/api/closing';
import { ProjectFlock } from '@/types/api/production/project-flock';
const ClosingKandangList = ({
initialValue,
projectData,
}: {
initialValue?: ClosingGeneralInformation;
projectData?: ProjectFlock;
}) => {
return (
<div className='w-full my-4 @container'>
<div className='flex flex-col @sm:flex-row gap-4'>
<div className='w-full'>
<div className='overflow-x-auto'>
<h1 className='font-bold my-4'>Kandang</h1>
<div className='flex flex-wrap gap-2 mb-4'>
{projectData?.kandangs?.map((kandang) => (
<Button
key={kandang.id}
variant='outline'
href={`/closing/detail/?closingId=${initialValue?.flock_id}&kandangId=${kandang.project_flock_kandang_id}`}
className='min-w-32'
>
{kandang.name}
</Button>
))}
</div>
</div>
</div>
</div>
</div>
);
};
export default ClosingKandangList;
@@ -0,0 +1,174 @@
'use client';
import { ChangeEventHandler, useEffect, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import { ColumnDef, SortingState } from '@tanstack/react-table';
import { Icon } from '@iconify/react';
import Table from '@/components/Table';
import Card from '@/components/Card';
import Collapse from '@/components/Collapse';
import { cn, formatNumber } from '@/lib/helper';
import { isResponseSuccess } from '@/lib/api-helper';
import { useTableFilter } from '@/services/hooks/useTableFilter';
import { ClosingApi } from '@/services/api/closing';
import { ClosingOutgoingSapronakSummary } from '@/types/api/closing';
interface ClosingOutgoingSapronaksSummaryTableProps {
projectFlockId: number;
}
const ClosingOutgoingSapronaksSummaryTable = ({
projectFlockId,
}: ClosingOutgoingSapronaksSummaryTableProps) => {
const searchParams = useSearchParams();
const kandangId = searchParams.get('kandangId');
const {
state: tableFilterState,
updateFilter,
setPage,
setPageSize,
toQueryString: getTableFilterQueryString,
} = useTableFilter({
initial: {
search: '',
nameSort: '',
},
paramMap: {
page: 'page',
pageSize: 'limit',
nameSort: 'sort_name',
},
});
const {
data: outgoingSapronakSummaries,
isLoading: isLoadingOutgoingSapronakSummaries,
} = useSWR(
`${ClosingApi.basePath}/${projectFlockId}/sapronak/summary${getTableFilterQueryString()}&type=outgoing&kandang_id=${kandangId ? `${kandangId}` : ''}`,
ClosingApi.getAllIncomingSapronakSummaryFetcher,
{
keepPreviousData: true,
}
);
const [open, setOpen] = useState(true);
const [sorting, setSorting] = useState<SortingState>([]);
const [rowSelection, setRowSelection] = useState<Record<string, boolean>>({});
const outgoingSapronaksColumns: ColumnDef<ClosingOutgoingSapronakSummary>[] =
[
{
header: '#',
cell: (props) => props.row.index + 1,
},
{
accessorKey: 'category',
header: 'Kategori',
},
{
accessorKey: 'total_qty',
header: 'Total Kuantitas',
cell: (props) =>
`${formatNumber(props.row.original.total_qty)} ${props.row.original.uom.name}`,
},
];
const searchChangeHandler: ChangeEventHandler<HTMLInputElement> = (e) => {
updateFilter('search', e.target.value);
};
// track sorting
useEffect(() => {
const isNameSorted = sorting.find((sortItem) => sortItem.id === 'name');
if (!isNameSorted) {
updateFilter('nameSort', '');
} else {
updateFilter('nameSort', isNameSorted.desc ? 'desc' : 'asc');
}
}, [sorting, updateFilter]);
useEffect(() => {
if (!open) {
setOpen(
isResponseSuccess(outgoingSapronakSummaries)
? outgoingSapronakSummaries.data.length > 0
: false
);
}
}, [outgoingSapronakSummaries, isResponseSuccess]);
return (
<Card
className={{
wrapper: 'w-full',
body: 'p-4 shadow',
}}
>
<Collapse
open={open}
onOpenChange={setOpen}
title={
<div className='card-actions p-4 justify-between items-center w-full'>
<div className='card-title'>Ringkasan Sapronak Keluar</div>
<Icon
icon='material-symbols:keyboard-arrow-down'
width={24}
height={24}
className={cn('text-primary transition-transform', {
'-rotate-180': open,
})}
/>
</div>
}
className='w-full!'
titleClassName='w-full p-0!'
>
<div className='w-full p-0'>
<Table<ClosingOutgoingSapronakSummary>
data={
isResponseSuccess(outgoingSapronakSummaries)
? outgoingSapronakSummaries?.data
: []
}
columns={outgoingSapronaksColumns}
pageSize={tableFilterState.pageSize}
onPageSizeChange={setPageSize}
rowOptions={[10, 20, 50, 100]}
page={
isResponseSuccess(outgoingSapronakSummaries)
? outgoingSapronakSummaries?.meta?.page
: 0
}
totalItems={
isResponseSuccess(outgoingSapronakSummaries)
? outgoingSapronakSummaries?.meta?.total_results
: 0
}
onPageChange={setPage}
isLoading={isLoadingOutgoingSapronakSummaries}
sorting={sorting}
setSorting={setSorting}
rowSelection={rowSelection}
setRowSelection={setRowSelection}
className={{
containerClassName: cn({
'w-full mb-20':
isResponseSuccess(outgoingSapronakSummaries) &&
outgoingSapronakSummaries?.data?.length === 0,
}),
}}
/>
</div>
</Collapse>
</Card>
);
};
export default ClosingOutgoingSapronaksSummaryTable;

Some files were not shown because too many files have changed in this diff Show More