Compare commits

...

916 Commits

Author SHA1 Message Date
randy-ar 77a7b6ccf8 fix(FE): change options value debt supplier 2026-01-13 11:23:17 +07:00
randy-ar 0ac14fe342 fix(FE): fixing floating action button project flock and change page size 2026-01-13 11:11:10 +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
ValdiANS 500c30c2bc feat(FE-331): implement permission guard in transfer to laying 2025-12-27 16:05:50 +07:00
ValdiANS 507c4005af feat(FE-331): implement permission guard in recording 2025-12-27 14:34:59 +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
ValdiANS 9e0d3e2bbf feat(FE-331): implement permission guard in project flock 2025-12-26 21:08:00 +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
ValdiANS 4be719b9d8 feat(FE-331): implement permission guard in purchase 2025-12-26 16:21:22 +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
ValdiANS 1152cd2bef chore(FE-331): update report permission 2025-12-26 15:46:06 +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
ValdiANS df6c1ae49d feat(FE-331): implement permission guard in marketing 2025-12-24 15:43:45 +07:00
ValdiANS 42a56a08d7 chore(FE-331): update /marketing/detail/ permission name 2025-12-24 15:31: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
ValdiANS 6ed7dcfa6d feat(FE-331): implement permission guard in expense 2025-12-24 11:08:37 +07:00
ValdiANS dda29e10d1 chore: change "Biaya Operasional" menu text to "Biaya" 2025-12-24 11:07:40 +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
ValdiANS 9d9b9d93db feat(FE-331): implement permission guard in closing 2025-12-24 09:41:48 +07:00
ValdiANS f41899dbc9 feat(FE-331): add /report route to ROUTE_PERMISSIONS 2025-12-24 09:24:16 +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
ValdiANS de63b6721a feat(FE-331): implement permission guard in inventory 2025-12-23 16:40:32 +07:00
ValdiANS a200dac23c chore(FE-331): fix inventory route path 2025-12-23 16:39:08 +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
ValdiANS fcfd2fb576 Merge branch 'feat/FE/US-304/permission-guard' into feat/FE/US-304/permission-guard-master-data 2025-12-23 15:55:50 +07:00
ValdiANS 2c28d0a831 Merge branch 'feat/FE/US-304/permission-guard' into feat/FE/US-304/permission-guard-master-data 2025-12-23 15:53:05 +07:00
rstubryan 907afbb062 chore(FE): Add Recharts deps and run tsc in pre-commit 2025-12-23 15:51:26 +07:00
ValdiANS addfaff692 feat(FE-331): implement permission guard in master data 2025-12-23 12:10:07 +07:00
ValdiANS ecdbb764d5 feat(FE-331): only show menu if user has the permission 2025-12-23 12:09:49 +07:00
ValdiANS a3be3de338 feat(FE-331): return PermissionNotFound component if user is not permitted 2025-12-23 12:09:06 +07:00
ValdiANS 9e895af62a chore: refresh user data every 13 minutes 2025-12-23 12:08:39 +07:00
ValdiANS 1f9992c1c8 feat(FE-331): add permissions to MAIN_DRAWER_LINKS 2025-12-23 12:08:16 +07:00
ValdiANS 574fb3b371 feat(FE-331): create ROUTE_PERMISSION constant 2025-12-23 12:07:55 +07:00
ValdiANS 4643a39c3e feat(FE-331): create RequirePermission helper component 2025-12-23 12:07:38 +07:00
ValdiANS 88b8767ca4 chore: lint 2025-12-23 12:07:24 +07:00
ValdiANS de19cc5de2 feat(FE-331): create PermissionNotFound component 2025-12-23 12:07:14 +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
Adnan Zahir a4b9b3fd2f Merge branch 'feat/FE/US-334/expedition-hpp-report' into 'development'
[FEAT/FE][US#334] Slicing and Integrate API Expedition HPP Report Table

See merge request mbugroup/lti-web-client!111
2025-12-23 10:57:59 +07:00
Adnan Zahir b91a199d13 Merge branch 'feat/FE/US-339/purchase-report' into 'development'
[FEAT/FE][US#339] Slicing and Integrate API Purchase Report Page

See merge request mbugroup/lti-web-client!109
2025-12-23 10:57:46 +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 bf16d259bd Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-334/expedition-hpp-report 2025-12-23 10:43:56 +07:00
rstubryan 5ae299a4b5 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/purchase-report 2025-12-23 10:31:32 +07:00
Adnan Zahir c840f881bb Merge branch 'feat/FE/US-352/daily-kandang-hpp-report' into 'development'
[FEAT/FE][US#352] HPP Harian Per Kandang Report

See merge request mbugroup/lti-web-client!114
2025-12-23 10:20:10 +07:00
Adnan Zahir 6f16cf6deb Merge branch 'feat/FE/US-338/expense-report' into 'development'
[FEAT/FE][US#338] Expense Report

See merge request mbugroup/lti-web-client!110
2025-12-23 10:19:43 +07:00
Adnan Zahir 5b4bc136f2 Merge branch 'feat/FE/US-336/finance-report' into 'development'
[FEAT/FE][US#336] Reporting Closing Finance

See merge request mbugroup/lti-web-client!108
2025-12-23 10:19:02 +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 346d655406 refactor(FE): Upgrade xlsx and add HPP per kandang tab 2025-12-23 09:25:26 +07:00
rstubryan 5ff132070c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-352/daily-kandang-hpp-report 2025-12-23 09:24:17 +07:00
randy-ar 398a09bf3b Merge branch 'development' into 'feat/FE/US-336/finance-report'
# Conflicts:
#   src/config/constant.ts
2025-12-23 02:22:41 +00:00
randy-ar 4e1315a027 Merge branch 'development' into 'feat/FE/US-338/expense-report'
# Conflicts:
#   src/components/pages/closing/ClosingDetail.tsx
2025-12-23 02:21:47 +00:00
Adnan Zahir dcf2acc799 Merge branch 'feat/FE/US-333/overhead-report' into 'development'
[FEAT/FE][US#333] Reporting Closing Overhead

See merge request mbugroup/lti-web-client!107
2025-12-22 17:45:56 +07:00
randy-ar 67a3ce2906 fix(FE): resolve conflict with branch development 2025-12-22 16:53:06 +07:00
randy-ar 1d28e80b66 fix(FE): resolve conflict with branch development 2025-12-22 16:45:18 +07:00
randy-ar 9dae6f1e95 fix(FE): resolve merge conflict with branch development 2025-12-22 16:34:49 +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
Adnan Zahir 4bc9926356 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!106
2025-12-22 15:38:54 +07:00
ValdiANS ea32056ca8 feat(FE-347): adjust getProductionData method 2025-12-22 15:29:39 +07:00
ValdiANS ddfdfe4d91 Merge branch 'development' into feat/FE/US-335/production-data-report 2025-12-22 15:28:01 +07:00
ValdiANS 7ea16d6a8a Merge branch 'development' into feat/FE/US-335/production-data-report 2025-12-22 15:23:15 +07:00
ValdiANS 206d6c0b4e Merge branch 'development' into feat/FE/US-335/production-data-report 2025-12-22 15:15:04 +07:00
Adnan Zahir 382721059a Merge branch 'feat/FE/US-340/marketing-report' into 'development'
[FEAT/FE][US#340] Marketing Report

See merge request mbugroup/lti-web-client!103
2025-12-22 14:47:12 +07:00
Rivaldi A N S 6a71828167 Merge branch 'feat/FE/US-352/TASK-355-356-357-slicing-and-integrate-kandang-hpp-daily-report-page' into 'feat/FE/US-352/daily-kandang-hpp-report'
[FEAT/FE][US#352/TASK-355-356-357] Slicing and Integrate API Hpp Harian Per Kandang Report

See merge request mbugroup/lti-web-client!113
2025-12-20 03:53:12 +00:00
rstubryan a5e79570c5 refactor(FE-356): Clarify 'Sisa Kg' label to specify Ayam 2025-12-20 10:30:11 +07:00
rstubryan 804aa700d3 feat(FE-356): Display egg production and HPP in PDF export 2025-12-20 10:26:18 +07:00
rstubryan 982a5d0d11 feat(FE-356): Display egg production and HPP in PDF export 2025-12-20 10:25:40 +07:00
rstubryan 478e9eb541 refactor(FE-356): Use summaryTotal and memoize per-weight summary 2025-12-20 10:18:50 +07:00
rstubryan 9e0631a415 feat(FE-355,357): Use summary totals and show egg metrics 2025-12-20 10:13:48 +07:00
rstubryan 18ca7d8a59 refactor(FE-357): Reference summary.total in footers 2025-12-20 09:50:19 +07:00
rstubryan eb8a1567c6 refactor(FE-355): Render weight-range summaries as table rows 2025-12-20 09:47:50 +07:00
rstubryan a0e63ea2d4 refactor(FE-355): Use flexRender and prepend default row in table 2025-12-20 09:37:42 +07:00
rstubryan 1ac35691ff refactor(FE-355): Move td classes into tr with [&_td] utilities 2025-12-20 09:32:35 +07:00
Rivaldi A N S f9aa254c18 Merge branch 'dev/randy' into 'feat/FE/US-338/expense-report'
[FIX/FE][US#338] Fixing Export PDF Using jspdf Library

See merge request mbugroup/lti-web-client!112
2025-12-20 02:17:37 +00:00
rstubryan c8effe4473 feat(FE-355,357): Render per-weight-range summary rows 2025-12-20 09:17:31 +07:00
rstubryan c230c8000b refactor(FE-355,356,257): Use API summary per_weight_range for HPP
reports
2025-12-20 08:52:34 +07:00
randy-ar a7267370a0 fix(FE): fix export report expense & fix report closing table view & fix project flock form set disable inofrmasi umum on edit 2025-12-19 17:20:02 +07:00
rstubryan daddebc0a6 refactor(FE-357): Refactor HppPerKandang types and add BaseMetadata 2025-12-19 16:30:06 +07:00
rstubryan 856d1f5c0c feat(FE): Filter supplier options by SAPRONAK category 2025-12-19 14:05:50 +07:00
rstubryan da5a577fde refactor(FE-357): Add key to summary table row 2025-12-19 13:46:02 +07:00
rstubryan c36d1ee153 feat(FE-355): Add custom row renderer to HppPerKandangTab 2025-12-19 13:40:41 +07:00
rstubryan 7259de8b14 feat(FE): Add renderCustomRow prop to Table 2025-12-19 12:56:25 +07:00
Rivaldi A N S 9e576cf444 Merge branch 'feat/FE/US-334/TASK-344-345-slicing-and-integrate-expedition-hpp-report-table' into 'feat/FE/US-334/expedition-hpp-report'
[FEAT/FE][US#334/TASK-344-345] Slicing and Integrate API Expedition HPP Report Table

See merge request mbugroup/lti-web-client!105
2025-12-19 03:33:05 +00:00
rstubryan d7b828cb47 chore(FE): Add xlsx@0.20.3 from SheetJS CDN 2025-12-19 10:24:16 +07:00
Rivaldi A N S f757e5f6ba Merge branch 'dev/randy' into 'feat/FE/US-338/expense-report'
[FEAT/FE][US#338] Expense Report

See merge request mbugroup/lti-web-client!104
2025-12-19 03:17:50 +00:00
rstubryan 7f694c7298 chore(FE): Bump Next.js to 15.5.9 2025-12-19 10:17:08 +07:00
Rivaldi A N S 5326fc918a Merge branch 'feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page' into 'feat/FE/US-339/purchase-report'
[FEAT/FE][US#339/TASK-361-362-363-367] Slicing and Integrate API Purchase Report Page

See merge request mbugroup/lti-web-client!101
2025-12-19 03:06:04 +00:00
Rivaldi A N S 6658312427 Merge branch 'dev/randy' into 'feat/FE/US-336/finance-report'
[FEAT/FE][US#336] Reporting Closing Finance

See merge request mbugroup/lti-web-client!100
2025-12-19 02:51:28 +00:00
Rivaldi A N S de73c626b1 Merge branch 'dev/randy' into 'feat/FE/US-333/overhead-report'
[FEAT/FE][US#333] Reporting Closing Overhead

See merge request mbugroup/lti-web-client!99
2025-12-19 02:47:10 +00:00
ValdiANS faaa10b74b chore(FE-347): update ClosingProductionData type 2025-12-19 09:39:56 +07:00
ValdiANS d66eaf08c0 chore(FE-347): set return type for getProductionData method 2025-12-19 09:39:43 +07:00
ValdiANS a6a6ff9f72 feat: create dummyClosingProductionData 2025-12-19 09:38:57 +07:00
ValdiANS 5a21a3b44c chore(FE-347): adjust UI based on updated ClosingProductionData type 2025-12-19 09:38:39 +07:00
rstubryan 00e0126e42 refactor(FE-357): Use string weights and parse floats for filters 2025-12-18 20:35:47 +07:00
rstubryan 2f23755510 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-352/TASK-355-356-357-slicing-and-integrate-kandang-hpp-daily-report-page 2025-12-18 20:27:08 +07:00
rstubryan 996e132660 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-18 20:18:02 +07:00
rstubryan e3eda4f5e4 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-334/TASK-344-345-slicing-and-integrate-expedition-hpp-report-table 2025-12-18 20:15:19 +07:00
ValdiANS 7cc616ff41 Merge branch 'development' into feat/FE/US-335/production-data-report 2025-12-18 19:29:27 +07:00
randy-ar 0b75d68494 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2025-12-18 19:01:48 +07:00
randy-ar 83224e046b fix(FE): fix submenu stock product name 2025-12-18 19:00:30 +07:00
ValdiANS 096a8d394e Merge branch 'development' into feat/FE/US-335/production-data-report 2025-12-18 18:50:22 +07:00
randy-ar 11bf6ad760 feat(FE): adding xlsx package 2025-12-18 18:14:56 +07:00
randy-ar c8a834f84a feat(FE): adding export xlsx for report expense, change report data fetching, adding progress bar 2025-12-18 18:13:27 +07:00
kris ead5ba759d Update .gitlab-ci.yml file 2025-12-18 10:00:38 +00:00
rstubryan 8ceca2cc59 refactor(FE-345): Rename CostOfRevenueExpedition to HppExpedition 2025-12-18 16:38:39 +07:00
rstubryan 8dc23f83cd refactor(FE-335): Rename expedition HPP types and update usages 2025-12-18 16:26:09 +07:00
Rivaldi A N S 57f53b0a04 Merge branch 'feat/FE/US-340/TASK-364-365-368-marketing-report' into 'feat/FE/US-340/marketing-report'
[FEAT/FE][US#340/TASK#364-365-368] Marketing Report

See merge request mbugroup/lti-web-client!102
2025-12-18 09:25:46 +00:00
ValdiANS 7e0aa4f790 feat(FE-365): create marketing report types 2025-12-18 16:19:30 +07:00
ValdiANS 2fe4ec981c chore: remove double declaration 2025-12-18 16:18:25 +07:00
ValdiANS cf41fbfdaf feat(FE-365): create Marketing Report API Service 2025-12-18 16:18:11 +07:00
ValdiANS 86cef78a12 feat(FE-347): create product data dummy data 2025-12-18 16:13:37 +07:00
ValdiANS fa63bd8ff9 feat: create marketing-report.dummy.ts for marketing report dummy data 2025-12-18 16:12:19 +07:00
ValdiANS d9b41a6760 feat: add laporan menu, FILTER_TYPE_OPTIONS, and MARKETING_TYPE_OPTIONS 2025-12-18 16:11:59 +07:00
ValdiANS c9cf33f1ad feat(FE-364): create MarketingReportContent component 2025-12-18 16:10:10 +07:00
ValdiANS 33d8d2aa2a feat(FE-364): create DailyMarketingsTable component 2025-12-18 16:09:34 +07:00
ValdiANS 61d85154fd feat(FE-368): create DailyMarketingReportPDF component 2025-12-18 16:08:46 +07:00
ValdiANS 466ea47121 feat(FE-364): create DailyMarketingReportContent component 2025-12-18 16:08:15 +07:00
ValdiANS 3a35c72e06 feat: add isLoading prop 2025-12-18 16:07:19 +07:00
ValdiANS 09d36f504b feat: refresh user data every 13 minutes 2025-12-18 16:07:04 +07:00
ValdiANS b9b7e45bc7 chore: update Dropdown component 2025-12-18 16:06:48 +07:00
ValdiANS e49c247f02 chore: update Tabs component 2025-12-18 16:06:41 +07:00
ValdiANS b8c6f94db8 feat(FE-364): create Marketing Report page 2025-12-18 16:06:19 +07:00
ValdiANS 5def3c9f17 chore: update next version and install xlsx 2025-12-18 16:04:43 +07:00
rstubryan 447b8067f7 refactor(FE-345): Rename hpp-ekspedisi endpoint to expedition-hpp 2025-12-18 15:55:20 +07:00
rstubryan 4a8f2b1e1d feat(FE-345): Add HPP expedition types and API method 2025-12-18 15:49:01 +07:00
rstubryan 36389bae2a refactor(FE-364): Refactor purchases export to use supplier reports 2025-12-18 15:11:34 +07:00
rstubryan d001b05c4e refactor(FE-361,363,364): Use per-supplier report arrays for export 2025-12-18 14:58:54 +07:00
rstubryan 20494657c6 refactor(FE-363): Extract row and summary types for logistic report 2025-12-18 14:35:10 +07:00
rstubryan 2d8e479b6c refactor(FE-363): Switch LogisticApi service to reports endpoint 2025-12-18 14:16:00 +07:00
rstubryan fef7f0e29b refactor(FE-363): Use relative endpoint for logistic reports 2025-12-18 13:59:11 +07:00
rstubryan 81d242bd1d refactor(FE-361,363): Add sort order selector to PurchasesPerSupplierTab 2025-12-18 13:57:58 +07:00
rstubryan 1be596921a refactor(FE-363): Fetch export data on demand via callback 2025-12-18 13:50:38 +07:00
rstubryan 8fb1ccbdce refactor(FE-364): Add hyphen before timestamp in export filenames 2025-12-18 13:40:26 +07:00
rstubryan 85fddcb19a refactor(FE-364): Timestamp purchases-per-supplier export filenames 2025-12-18 13:39:05 +07:00
rstubryan 915e68f755 refactor(FE-363): Send joined filter params to logistic report API 2025-12-18 13:35:40 +07:00
rstubryan 87adbf8547 refactor(FE-363): Accept array filters in logistic purchase report 2025-12-18 13:31:08 +07:00
rstubryan e8492f87ba refactor(FE-364): Enable multi-select filters for purchases report 2025-12-18 13:28:00 +07:00
rstubryan ceae338c73 refactor(FE-356): Include period in export filenames 2025-12-18 13:10:21 +07:00
rstubryan fa7824224c refactor(FE-356): Use timestamped filename for HPP export 2025-12-18 13:05:01 +07:00
rstubryan 6b30457ec2 feat(FE-356): Include filter details in export header 2025-12-18 13:02:16 +07:00
rstubryan 843fa6ee7a refactor(FE-357): Make area/location/kandang filters multi-select 2025-12-18 12:56:05 +07:00
randy-ar a935ffd9f5 fix(FE): fixing floating button & revert require auth component 2025-12-18 11:33:18 +07:00
rstubryan 1de98db4ba refactor(FE-361): Hide unused logistic tabs and adjust card 2025-12-18 11:31:05 +07:00
rstubryan f844c9ff2c refactor(FE-357): Use relative URL for marketing sale reports 2025-12-18 11:19:23 +07:00
rstubryan 83fc92d48b refactor(FE-356): Refactor weight-range grouping and format currency 2025-12-18 11:12:30 +07:00
rstubryan 4edd4f1285 feat(FE-356): Add egg production and HPP fields to PDF export 2025-12-18 09:57:21 +07:00
rstubryan cc3765abcd refactor(FE-356): Add egg production and pricing columns 2025-12-18 09:50:11 +07:00
rstubryan 3497a6346c refactor(FE-357): Deduplicate totals and supplier aggregation 2025-12-18 09:47:52 +07:00
rstubryan 69b4ca455e refactor(FE-355): Guard HPP total calculation for empty data 2025-12-18 09:33:13 +07:00
rstubryan 320bc52244 refactor(FE-355,357): Show HPP and average DOC totals in table footer 2025-12-18 09:24:49 +07:00
rstubryan 40f2d0ba93 refactor(FE-355): Reorder egg_value_rp column in HppPerKandangTab 2025-12-18 09:12:28 +07:00
rstubryan 481a643b3c refactor(FE-355): Use summary fallbacks for report footers 2025-12-18 09:11:21 +07:00
rstubryan 9b2d98f7ce feat(FE-355,357): Add egg columns to HPP table and disable sale tabs 2025-12-18 08:59:07 +07:00
ValdiANS 3e8c29df64 Merge branch 'feat/FE/US-335/production-data-report' into feat/FE/US-340/TASK-364-365-368-marketing-report 2025-12-17 15:58:23 +07:00
rstubryan 6155929e14 refactor(FE-357): Use hppPerKandangExport instead of fetchAllExportData 2025-12-17 14:54:28 +07:00
rstubryan 7c9f68d3a3 feat(FE-363): Add Excel export loading and combine export state 2025-12-17 14:44:36 +07:00
randy-ar 918e85e0cc fix(FE): resolve merge conflict with branch development 2025-12-17 14:26:03 +07:00
randy-ar bb80e9e9c6 fix(FE): remove dummy data and integrate live API for closing finance and fixing closing UI when given data is null 2025-12-17 14:22:15 +07:00
rstubryan 80fd75dfc1 refactor(FE-357): Rename API response and export fetch vars 2025-12-17 14:14:27 +07:00
rstubryan e1b562c175 refactor(FE-357): Refactor export data fetching and handlers 2025-12-17 14:05:29 +07:00
rstubryan 9365320b03 feat(FE-357): Add loading state for export 2025-12-17 13:45:00 +07:00
rstubryan e515438312 refactor(FE-355): Use NumberInput and SelectInput for filters 2025-12-17 13:33:51 +07:00
rstubryan 530ef4982d refactor(FE-355,357): Use summary fields for egg HPP and total value 2025-12-17 13:04:26 +07:00
rstubryan a8c3b1a66f feat(FE-356): Include HPP and supplier aggregates in export 2025-12-17 11:56:42 +07:00
rstubryan 62d4d7b7db refactor(FE): Fix Dropdown import path 2025-12-17 11:49:41 +07:00
rstubryan 57df2e9aed Merge branch 'dev/restu' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-352/TASK-355-356-357-slicing-and-integrate-kandang-hpp-daily-report-page 2025-12-17 11:48:24 +07:00
rstubryan 9ea86fe5c3 Merge branch 'dev/restu' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-17 11:47:57 +07:00
rstubryan ecf1677c27 Merge branch 'dev/restu' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-334/TASK-344-345-slicing-and-integrate-expedition-hpp-report-table 2025-12-17 11:47:36 +07:00
rstubryan c1e075b1ff refactor(FE): refactor Dropdown component API and Navbar usage 2025-12-17 11:47:12 +07:00
rstubryan c70cfbd450 feat(FE-355,356,357): Add PDF export for HPP per kandang report 2025-12-17 11:42:45 +07:00
rstubryan 4cc41c0167 feat(FE-355,357): Use API summary for weighted averages 2025-12-17 11:11:44 +07:00
rstubryan 730b7903a7 feat(FE-355): Remove pagination from HppPerKandangTab 2025-12-17 11:01:01 +07:00
rstubryan 78efd587be feat(FE-355,357): Add aggregated footers for HPP per kandang table 2025-12-17 10:54:02 +07:00
rstubryan 3d91c12874 feat(FE-355,356,357): Implement HPP Per Kandang report tab 2025-12-17 10:38:56 +07:00
rstubryan 12e6d60745 feat(FE-357): Rename HppPerkandang types and update API path 2025-12-17 10:37:05 +07:00
rstubryan 01313f0b09 refactor(FE-363): Move logistic API to report/logistic-stock 2025-12-17 10:05:32 +07:00
rstubryan 9f521a6a08 refactor(FE-363): Rename logistic stock report API method 2025-12-17 10:00:35 +07:00
rstubryan 43afc5781c feat(FE-355): Add sale report tabs and marketing layout 2025-12-17 09:50:55 +07:00
rstubryan 0f7f4e891c feat(FE-357): Add marketing sales report API and types 2025-12-17 09:50:36 +07:00
randy-ar b02b458034 feat(FE): Closing Finance and adjust reports expense filter request 2025-12-16 17:52:59 +07:00
rstubryan 304084ea2c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-334/TASK-344-345-slicing-and-integrate-expedition-hpp-report-table 2025-12-16 16:21:39 +07:00
rstubryan 204a1098a3 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-16 16:20:35 +07:00
rstubryan c04cd29ac7 refactor(FE-363): Use snake_case for totals in purchases tab 2025-12-16 15:19:47 +07:00
Adnan Zahir 224f7ddeea Merge branch 'feat/FE/US-284/sapronak-calculation-report' into 'development'
[FEAT/FE][US#284] Add Feature Perhitungan Sapronak Closing Report

See merge request mbugroup/lti-web-client!98
2025-12-16 15:00:47 +07:00
rstubryan d17c11e2f2 feat(FE-364): Implement Excel export for purchases per supplier 2025-12-16 14:48:17 +07:00
randy-ar f58b03ba0e fix(FE): revert auth component 2025-12-16 14:24:52 +07:00
rstubryan c9544e1bd0 refactor(FE-361): Format quantity with formatNumber 2025-12-16 14:21:58 +07:00
randy-ar d348cee4e6 fix(FE): resolve merge conflict 2025-12-16 14:17:23 +07:00
rstubryan 1560908101 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-334/TASK-344-345-slicing-and-integrate-expedition-hpp-report-table 2025-12-16 14:08:45 +07:00
rstubryan 874bc27e4c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-16 13:57:40 +07:00
Adnan Zahir be238779a4 Merge branch 'dev/hotfix/restu' into 'development'
[HOTFIX/FE] Fixing Recording and Approval Button

See merge request mbugroup/lti-web-client!97
2025-12-16 13:57:24 +07:00
rstubryan aea39a878a Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-16 13:57:09 +07:00
rstubryan 84e562e22c refactor(FE-364): Refine PDF table cell styles and header alignment 2025-12-16 13:56:48 +07:00
Adnan Zahir 8db7b6d5e9 Merge branch 'feat/FE/US-279/closing-button' into 'development'
[FEAT/FE][US#279] Add Feature Closing Produksi (Project Flock)

See merge request mbugroup/lti-web-client!96
2025-12-16 13:56:20 +07:00
rstubryan 5c8bc4fc6e feat(FE-364): Center align badge in PDF export styles 2025-12-16 13:52:55 +07:00
rstubryan 9ba3fa1b6c refactor(FE-364): refactor PDF table styles and remove total styles 2025-12-16 13:34:36 +07:00
rstubryan 6f18c58042 refactor(FE-364): refactor PDF table styles and remove total styles 2025-12-16 13:33:57 +07:00
rstubryan 0d8e642b4e refactor(FE-364): update PDF export layout and parameter badges 2025-12-16 13:26:16 +07:00
rstubryan 615d4d5ffe feat(FE-364): Add PDF export for purchases per supplier 2025-12-16 12:00:56 +07:00
rstubryan 2a00da0298 refactor(FE-361): Make filter layout responsive 2025-12-16 11:12:30 +07:00
rstubryan 68437b3b7e feat(FE-361,363): Add product category filter and API params 2025-12-16 10:26:31 +07:00
rstubryan 31b2a5a548 refactor(FE-361,363): Adapt PurchasesPerSupplier to new report shape 2025-12-16 10:01:13 +07:00
rstubryan 4d997256ad refactor(FE-363): Update logistic report API endpoint and types 2025-12-16 10:00:39 +07:00
rstubryan 7ea9e10ad2 chore(FE): Add xlsx dependency from SheetJS CDN 2025-12-15 16:34:00 +07:00
rstubryan 245da2595c fix(FE-vulnerability): Bump Next.js to 15.5.9 2025-12-15 16:29:27 +07:00
rstubryan 45f1e923b7 feat(FE-361,363): Add export dropdown to PurchasesPerSupplier tab 2025-12-15 15:10:22 +07:00
Rivaldi A N S ebe752b27b Merge branch 'feat/FE/US-284/TASK-324-325-slicing-and-integration-sapronak-calculation-closing-report' into 'feat/FE/US-284/sapronak-calculation-report'
[FEAT/FE][US#284/TASK#324-325] Add Feature Perhitungan Sapronak Closing Report

See merge request mbugroup/lti-web-client!71
2025-12-15 07:54:59 +00:00
rstubryan 3c3c2345c7 feat(FE-361): Update action buttons in PurchasesPerSupplierTab 2025-12-15 14:14:34 +07:00
rstubryan 3f78cfdb63 refactor(FE): refactor Dropdown component API and Navbar usage 2025-12-15 14:04:16 +07:00
rstubryan 69eaae6d43 feat(FE=361,363): Add Submit button to PurchasesPerSupplierTab 2025-12-15 11:41:12 +07:00
ValdiANS 65b60cc464 chore(FE-347): update closings API endpoint '/closings' 2025-12-15 11:13:18 +07:00
rstubryan 5c9332537c feat(FE-363): Add pagination to purchases per supplier report 2025-12-15 11:08:05 +07:00
rstubryan 63c2a240d2 refactor(FE-363): Use SWR key+fetcher with params for logistic report 2025-12-13 12:03:56 +07:00
rstubryan fd2e1f8b96 refactor(FE-363): Replace LogisticService with LogisticApi instance 2025-12-13 11:51:41 +07:00
rstubryan fdb3e0481a refactor(FE-363): Rename response variable to purchasePerSupplier 2025-12-13 11:46:00 +07:00
rstubryan 9bc632c286 feat(FE-361): Add Reset button to clear report filters 2025-12-13 11:34:37 +07:00
rstubryan 81f98c5f06 feat(FE-361): Add pagination control to supplier purchases table 2025-12-13 11:21:04 +07:00
rstubryan 0983f154d2 refactor(FE-363): Rename SupplierWithItems type for clarity 2025-12-13 10:57:56 +07:00
rstubryan bd4c51cb04 refactor(FE-361,363): Refactor purchases-per-supplier report to use API 2025-12-13 10:55:15 +07:00
randy-ar 9c09395677 feat(FE-338): Slicing UI Halaman Reporting BOP & API integration & refactor debounce input: adding useEffect for sync value 2025-12-11 18:23:55 +07:00
rstubryan 67b5187d39 feat(FE-363): Add Logistic API service and update types 2025-12-11 15:47:21 +07:00
rstubryan 5de5dcffc0 fix(FE): Area import path in logistic-stock types 2025-12-11 15:28:26 +07:00
rstubryan 51ff739926 Merge branch 'dev/hotfix/restu' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-11 15:23:15 +07:00
rstubryan 238edfeca2 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-11 15:22:21 +07:00
rstubryan bd8d121113 feat(FE-344,345): Integrate HPP Ekspedisi into Closing detail 2025-12-11 15:04:37 +07:00
rstubryan 38b91a57f0 refactor(FE-345): Remove unused fields from BaseClosingSales 2025-12-11 14:43:54 +07:00
randy-ar d0abc0e9ff fix(FE): adjust inventory adjustment and inventory product table 2025-12-11 14:35:27 +07:00
rstubryan 4262e8e286 refactor(FE-344): Add Cost of Revenue Expedition table 2025-12-11 14:27:29 +07:00
randy-ar 48c163c1cd fix(FE): remove pengajuan from project flock kandang approval lines 2025-12-11 14:00:46 +07:00
rstubryan 3c03494bd3 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-334/TASK-344-345-slicing-and-integrate-expedition-hpp-report-table 2025-12-11 14:00:19 +07:00
rstubryan 3dd36b8248 fix(FE): Parse recordingId and hide actions for rejected 2025-12-11 11:05:20 +07:00
rstubryan 12698004e1 fix(FE): Update recording detail links to include production path 2025-12-11 10:47:25 +07:00
rstubryan a0ca8e8f69 Merge branch 'feat/FE/US-279/closing-button' of gitlab.com:mbugroup/lti-web-client into dev/hotfix/restu 2025-12-11 10:46:52 +07:00
rstubryan 69206d4524 fix(FE): Update recording detail links to include production path 2025-12-11 10:46:38 +07:00
rstubryan a73f9a1acd fix(FE): Update recording detail links to include production path 2025-12-11 10:46:21 +07:00
randy-ar 4ea56f2e18 fix(FE): fixing closing button project flock 2025-12-11 01:20:48 +07:00
Rivaldi A N S 48649df409 Merge branch 'dev/randy' into 'feat/FE/US-279/closing-button'
[FEAT/FE][US#279/TASK#312-313] Add Feature Closing Produksi (Project Flock)

See merge request mbugroup/lti-web-client!72
2025-12-10 18:06:46 +00:00
randy-ar c53f9352be fix(FE): closing project flock & merge development 2025-12-11 00:32:54 +07:00
Adnan Zahir df632526d2 Merge branch 'dev/hotfix/restu' into 'development'
[HOTFIX/FE] Fixing Credit Term issue on Purchase

See merge request mbugroup/lti-web-client!95
2025-12-11 00:10:33 +07:00
rstubryan 4ec455b3b7 feat(FE): Add credit_term to purchase forms and types 2025-12-10 23:54:59 +07:00
randy-ar 4f4fd3e6b7 fix(FE): pull development 2025-12-10 23:19:43 +07:00
Adnan Zahir 0d7dd0a110 Merge branch 'feat/FE/US-278/purchase-and-expense' into 'development'
[FEAT/FE][US#278] Adjust Purchase Request and Purchase Order (Expense Extended)

See merge request mbugroup/lti-web-client!86
2025-12-10 23:18:50 +07:00
Adnan Zahir 9bf4fd585d Merge branch 'feat/FE/US-282/egg-grading-adjustment' into 'development'
[FEAT/FE][US#282] Adjustment Recording Egg Grading

See merge request mbugroup/lti-web-client!85
2025-12-10 23:18:20 +07:00
kris a77a360410 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!94
2025-12-10 15:31:00 +00:00
ValdiANS 9628ee88ad chore: add condition for redirecting to SSO 2025-12-10 21:47:58 +07:00
ValdiANS 4356bd8803 fix: remove redirectToSSO 2025-12-10 21:43:05 +07:00
kris cbf1660da5 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!93
2025-12-10 11:53:47 +00:00
ValdiANS 37f59f9470 fix: remove unnecessary code 2025-12-10 18:50:58 +07:00
kris 6e3b25eb98 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!92
2025-12-10 11:11:50 +00:00
ValdiANS f939f4b0fb fix: return children only if userResponse success and user is set 2025-12-10 18:10:08 +07:00
ValdiANS 720ff2128f fix: add use-client and export dynamic 2025-12-10 18:09:30 +07:00
ValdiANS 280fffe6a5 fix: add use-client 2025-12-10 18:09:21 +07:00
ValdiANS 6340a5e519 fix: export dynamic 2025-12-10 18:09:10 +07:00
kris d4fc0b4a4f Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!91
2025-12-10 10:32:40 +00:00
ValdiANS 4f595c7cad chore: wrap router.replace in useEffect 2025-12-10 17:31:21 +07:00
ValdiANS 3826b8ea53 feat: set trailingSlash to true 2025-12-10 17:31:06 +07:00
kris 5cc82f1615 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!90
2025-12-10 10:16:33 +00:00
ValdiANS cfaac14820 chore: return loading text if all condition unmet 2025-12-10 17:15:23 +07:00
kris b39d1f5c2e Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!89
2025-12-10 10:08:42 +00:00
ValdiANS 30ab48e426 fix: redirect to dashboard if pathname is in root path 2025-12-10 17:07:44 +07:00
kris 88c640df18 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!88
2025-12-10 10:00:08 +00:00
ValdiANS 017b081832 fix: redirect to SSO if user isnt exist and show loading state if still loading user 2025-12-10 16:57:45 +07:00
ValdiANS 83d76f7de4 fix: set isLoadingUser in useAuth hook 2025-12-10 16:57:20 +07:00
randy-ar 9af140e58d fix(FE): fix merge conflict 2025-12-10 16:56:25 +07:00
randy-ar 654aa50cc7 fix(FE): fix merge conflict 2025-12-10 16:53:50 +07:00
randy-ar 814e8db1ba fix(FE): resolve merge conflict development 2025-12-10 16:45:54 +07:00
randy-ar d1883654bc fix(FE): resolve merge conflict development 2025-12-10 16:44:52 +07:00
kris 2c6ad71fd3 Update .gitlab-ci.yml file 2025-12-10 09:42:13 +00:00
randy-ar 6c31d933b0 fix(FE): resolve merge conflict 2025-12-10 16:41:21 +07:00
Mitra Berlian Unggas b806c0f0a1 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!87
2025-12-10 09:36:29 +00:00
randy-ar a073488c2c fix(FE): fixing closing project flock and fetching data in closing report 2025-12-10 16:32:50 +07:00
Rivaldi A N S 7efb2a4dbb Merge branch 'feat/FE/US-278/TASK-311-adjustment-purchase-and-expense' into 'feat/FE/US-278/purchase-and-expense'
[FEAT/FE][US#278/TASK-311] Adjust Purchase Request and Purchase Order (Expense Extended)

See merge request mbugroup/lti-web-client!83
2025-12-10 09:27:50 +00:00
Rivaldi A N S 01d1ed8f0d Merge branch 'feat/FE/US-282/TASK-318-319-slicing-and-adjustment-egg-grading-form' into 'feat/FE/US-282/egg-grading-adjustment'
[FEAT/FE][US#282/TASK-318-319] Adjustment Recording Egg Grading

See merge request mbugroup/lti-web-client!84
2025-12-10 09:25:32 +00:00
ValdiANS aed58ef10c hotfix: Implement client-side dashboard redirect with loading spinner, improve authentication error handling by clearing user state on 401, and extend SSO redirect loop protection. 2025-12-10 16:23:51 +07:00
rstubryan f105852a07 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-282/TASK-318-319-slicing-and-adjustment-egg-grading-form 2025-12-10 15:52:30 +07:00
rstubryan 21d6fc8579 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-278/TASK-311-adjustment-purchase-and-expense 2025-12-10 15:44:58 +07:00
kris eea1fcb513 Update .gitlab-ci.yml file 2025-12-10 08:43:08 +00:00
rstubryan 312580a7fc Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-10 15:37:16 +07:00
rstubryan 7c4d5e68fa Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-282/TASK-318-319-slicing-and-adjustment-egg-grading-form 2025-12-10 15:36:36 +07:00
rstubryan b74e43c483 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-278/TASK-311-adjustment-purchase-and-expense 2025-12-10 15:36:12 +07:00
Adnan Zahir dbff1bda3d Merge branch 'dev/hotfix/restu' into 'development'
[HOTFIX/FE] Fixing Penjualan Tabs (Misplacement Issue)

See merge request mbugroup/lti-web-client!81
2025-12-10 15:33:54 +07:00
Adnan Zahir 244c564f06 Merge branch 'fix/redirect-error' into 'development'
[HOTFIX/FE] Fixing redirect issues

See merge request mbugroup/lti-web-client!82
2025-12-10 15:31:31 +07:00
ValdiANS 757e0435ac hotfix: use redirectToSSO function 2025-12-10 15:21:46 +07:00
ValdiANS 46d70e36dd feat: create auth-helper file and redirectToSSO helper function 2025-12-10 15:21:10 +07:00
ValdiANS 0cc9d0e94e hotfix: Centralize SSO redirection logic into a new helper with loop protection, integrate it into the HTTP client and RequireAuth component, and add an authentication failure UI. 2025-12-10 15:18:37 +07:00
rstubryan d7199fad53 hotfix(FE): Pass sales data to ClosingDetail and fix sales API 2025-12-10 15:05:52 +07:00
rstubryan 8c2683c440 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-10 14:34:12 +07:00
rstubryan 9c7033b53a feat(FE-361): Migrate main drawer links to SidebarMenuItem 2025-12-10 14:17:12 +07:00
rstubryan 07bfe0a20b Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page 2025-12-10 14:12:25 +07:00
rstubryan b9e69b243f Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-282/TASK-318-319-slicing-and-adjustment-egg-grading-form 2025-12-10 13:59:04 +07:00
rstubryan 8dec4915a2 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-278/TASK-311-adjustment-purchase-and-expense 2025-12-10 13:57:07 +07:00
rstubryan 7be32326a9 feat(FE-311): Disable approval actions when rejected 2025-12-10 13:56:13 +07:00
randy-ar c416fdbdaa fix(FE): resolve conflit merge development 2025-12-10 13:51:19 +07:00
Adnan Zahir 270e8ff0c6 Merge branch 'dev/hot-fix/randy' into 'development'
[HOTFIX/FE] Fixing Dropdown Button Logout

See merge request mbugroup/lti-web-client!80
2025-12-10 13:44:20 +07:00
Adnan Zahir 64abc5001d Merge branch 'feat/FE/US-285/marketing-closing-report' into 'development'
[FEAT/FE][US#285] Add Feature Marketing Closing Report (Sales/Penjualan)

See merge request mbugroup/lti-web-client!77
2025-12-10 13:38:26 +07:00
randy-ar f48cfca650 fix(FE): revert require auth component 2025-12-10 13:35:42 +07:00
rstubryan a116f7ca66 fix(FE): Remove closing detail page and layout 2025-12-10 13:32:29 +07:00
rstubryan 429f5ffb62 feat(FE-311): Add rejection modals and accept handler 2025-12-10 13:30:40 +07:00
randy-ar eed142a85f hotfix(FE): fixing dropdown logout and floating button max size 2025-12-10 13:25:07 +07:00
rstubryan 48f228de1c Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-278/TASK-311-adjustment-purchase-and-expense 2025-12-10 13:08:36 +07:00
rstubryan c92abfc9ab Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-285/marketing-closing-report 2025-12-10 11:54:05 +07:00
rstubryan 7e999b2e34 feat(FE): Show sales report on closing detail page 2025-12-10 11:53:47 +07:00
rstubryan e90c7d993c Merge branch ‘development’ of gitlab.com:mbugroup/lti-web-client into
feat/FE/US-285/marketing-closing-report
2025-12-10 11:44:46 +07:00
rstubryan 99fbcaaea3 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-285/marketing-closing-report 2025-12-10 11:40:43 +07:00
Adnan Zahir 865b0b3d8f Merge branch 'fix/FE/US-163-164/api-integration-adjustment-in-expense-request-and-realization' into 'development'
[FIX/FE][US#163-164] API Integration Adjustment in Expense Request and Realization

See merge request mbugroup/lti-web-client!78
2025-12-10 11:32:21 +07:00
Adnan Zahir a4c83f99a7 Merge branch 'feat/FE/US-286/inventory-management-product-stock' into 'development'
[FEAT/FE][US#286] Inventory Product Stock

See merge request mbugroup/lti-web-client!76
2025-12-10 11:25:27 +07:00
rstubryan e23b698fc7 feat(FE-363): Add TypeScript definitions for logistic stock report 2025-12-10 11:18:54 +07:00
Adnan Zahir 294c971fea Merge branch 'feat/FE/US-280/project-flock-budget' into 'development'
[FEAT/FE][US#280] Project Flock Budgets

See merge request mbugroup/lti-web-client!75
2025-12-10 11:14:07 +07:00
randy-ar 8a8128a692 fix(FE): resolve merge conflict checkbox and constant 2025-12-10 10:09:56 +07:00
randy-ar 649dd70ea7 Merge branch 'development' of https://gitlab.com/mbugroup/lti-web-client into dev/randy 2025-12-10 10:03:28 +07:00
Adnan Zahir 44b9210ccc Merge branch 'feat/FE/US-283/sapronak-closing-report' into 'development'
[FEAT/FE][US#283] Sapronak Closing Report

See merge request mbugroup/lti-web-client!74
2025-12-10 09:42:35 +07:00
rstubryan e3f90a49d0 feat(FE-361): Extract LogisticStockTabs component 2025-12-10 09:22:09 +07:00
rstubryan a1679ba5ff feat(FE-363): Add data type and date range filters 2025-12-09 21:49:26 +07:00
rstubryan 8a7149c123 feat(FE-361): Add logistic stock tabs and tweak styles 2025-12-09 20:19:00 +07:00
rstubryan f87854ed07 refactor(FE-361): Remove wrapper top margin and clear table margin 2025-12-09 18:51:36 +07:00
rstubryan 1ef7130661 refactor(FE-344): Export TABLE_DEFAULT_STYLING and refine classes 2025-12-09 18:45:38 +07:00
rstubryan 066c356d4f refactor(FE-339): Export TABLE_DEFAULT_STYLING and refine table classes 2025-12-09 18:44:35 +07:00
randy-ar 8c7640eb9c feat(FE-333): adding feature overhead closing report 2025-12-09 18:14:46 +07:00
rstubryan 8f5dd1851a refactor(FE-361): Refactor table and pagination components 2025-12-09 18:04:33 +07:00
randy-ar 489815ecaf fix(FE): revert require auth component 2025-12-09 18:04:06 +07:00
randy-ar f9dfe7b27f feat(FE-284): Refactor table component support for nesting header 2025-12-09 17:57:46 +07:00
rstubryan 6a926f881d feat(FE-334): Use column footers and fix closing loading check 2025-12-09 17:51:11 +07:00
rstubryan 68dd5b1121 refactor(FE-344): Add table cell side borders in sales report 2025-12-09 17:49:50 +07:00
rstubryan 5a3c7d71b0 refactor(FE-345): HPP ekspedisi API path to use /closings 2025-12-09 17:48:03 +07:00
rstubryan 5ad61d483a refactor(FE-344): update pagination UI and table footer handling 2025-12-09 16:47:59 +07:00
ValdiANS 1567a4016f feat(FE-347): use ClosingProductionDataTabContent in dataProduksi tab 2025-12-09 15:55:32 +07:00
ValdiANS 8b8702b1b8 feat(FE-346): create ClosingProductionDataTabContent component 2025-12-09 15:51:33 +07:00
rstubryan b039ec832b feat(FE-361): Add logistic-stock report page and table footer 2025-12-09 15:49:59 +07:00
ValdiANS abf2735b86 feat(FE-347): add getProductionData method 2025-12-09 15:46:12 +07:00
ValdiANS a26099b507 feat(FE-347): create ClosingProductionData type 2025-12-09 15:32:17 +07:00
rstubryan d7384752a0 feat(FE-361): Add Laporan report menu with logistic submenu 2025-12-09 14:11:15 +07:00
rstubryan dfecef2e0c feat(FE-344,345): Fetch and render HPP Ekspedisi report 2025-12-09 13:28:47 +07:00
rstubryan 80fd8bb7ba feat(FE-344,345): Add CosExpeditionReportTable component 2025-12-09 13:28:14 +07:00
rstubryan 44b9f94cec feat(FE-345): Add getHppEkspedisi to ClosingApiService 2025-12-09 13:27:15 +07:00
rstubryan e3b3f5ccdc feat(FE-345): Add Cost of Services expedition types and export
ClosingSales
2025-12-09 13:26:19 +07:00
ValdiANS 33691f45bb chore(FE-323): update outgoing sapronak API endpoint 2025-12-09 11:38:57 +07:00
ValdiANS 2c72c44be4 chore(FE-323): update incoming sapronak API endpoint 2025-12-09 11:38:53 +07:00
ValdiANS 98dfd4564c chore(FE-323): change closing API route path 2025-12-09 11:37:26 +07:00
ValdiANS a795d78c80 Merge branch 'development' into feat/FE/US-283/sapronak-closing-report 2025-12-09 10:58:43 +07:00
randy-ar 8a0adf847e fix(FE-279): adjust closing project flock kandang 2025-12-09 10:33:38 +07:00
rstubryan 8e80d668fa refactor(FE-311): Remove credit_term from purchase request data and UI 2025-12-09 10:13:48 +07:00
rstubryan a45de4fb13 refactor(FE-311): Remove grand_total and due_date from purchases 2025-12-09 09:58:15 +07:00
rstubryan 6ee5bc3f1b refactor(FE-318,319): Remove egg grading schema and UI logic 2025-12-08 23:37:20 +07:00
rstubryan 012fe800bc refactor(FE-318,319): Remove laying grading checks and simplify approval 2025-12-08 23:35:55 +07:00
rstubryan c3835d5128 refactor(FE-319): Renumber RECORDINGS approval workflow steps 2025-12-08 23:35:12 +07:00
rstubryan 7c4bd81364 feat(FE-319): Remove recording grading feature 2025-12-08 23:34:01 +07:00
rstubryan 545af8267a feat(FE-319): Refactor recording types and simplify payloads 2025-12-08 23:33:34 +07:00
rstubryan 2e6a724b2f refactor(FE-319): Use approval step 2 and remove grading button 2025-12-08 20:13:10 +07:00
rstubryan 305b8e5005 refactor(FE-319): Remove Grading-Telur step from RECORDINGS workflow 2025-12-08 20:12:18 +07:00
rstubryan 5deca5739f refactor(FE-318): Add egg weight column and separate inputs 2025-12-08 20:08:35 +07:00
rstubryan b464432581 chore(FE): Add .claude to .gitignore 2025-12-08 18:49:17 +07:00
rstubryan 512ad5175e refactor(FE-311): Default received_qty and remove transport_total 2025-12-08 18:37:58 +07:00
rstubryan a7d884b5f0 refactor(FE-311): Use latest_approval instead of approval 2025-12-08 18:14:38 +07:00
rstubryan ce75eb25d7 refactor(FE-311): Show previous values only in edit mode 2025-12-08 17:55:22 +07:00
rstubryan c7911f01f2 refactor(FE-311): Remove Total Transport header from approval form 2025-12-08 17:43:44 +07:00
rstubryan 68874a1c14 feat(FE-311): Use latest_approval for purchase approvals 2025-12-08 17:42:23 +07:00
rstubryan 7cc2a31745 Merge branch 'feat/FE/US-280/project-flock-budget' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-278/TASK-311-adjustment-purchase-and-expense 2025-12-08 16:28:09 +07:00
rstubryan f5663b82aa refactor(ci): clean up .gitlab-ci.yml by removing unnecessary whitespace 2025-12-08 14:43:53 +07:00
rstubryan 3a7f1f4812 refactor(FE-311): remove transport_total field and update approval actions 2025-12-08 14:42:39 +07:00
rstubryan 32ffc1f14c chore(prettier): Remove trailing whitespace in .gitlab-ci.yml 2025-12-08 14:08:40 +07:00
rstubryan 58fb9b0c08 chore(CVE): Bump Next to 15.5.7 and ignore .claude 2025-12-08 14:07:25 +07:00
randy-ar 3569955e7f fix(FE): fix warn issue next js 2025-12-08 14:01:13 +07:00
randy-ar 7df743ebf5 fix(FE): adjust sapronak calculation to closing detail page 2025-12-08 10:24:41 +07:00
rstubryan 86a0faaa52 chore(ci): clean up .gitlab-ci.yml by removing unnecessary whitespace 2025-12-08 10:09:21 +07:00
rstubryan df3f342214 chore(CVE): update Next.js version to ^15.5.7 in package.json and package-lock.json 2025-12-08 10:07:00 +07:00
rstubryan c3c1bbbe96 feat(FE-326): Add egg weight field to recording forms 2025-12-08 09:47:22 +07:00
ValdiANS dc0fd7a3ed chore: format code 2025-12-07 15:00:25 +07:00
ValdiANS 5782abb531 refactor: change expense_date to transaction_date 2025-12-07 14:59:51 +07:00
ValdiANS 2d1cabb86b refactor: update CreateExpensePayload, UpdateExpensePayload, and CreateExpenseRealizationPayload types 2025-12-07 14:59:25 +07:00
Rivaldi A N S b362fd1748 Merge branch 'feat/FE/US-285/TASK-326-327-slicing-and-integration-marketing-closing-report' into 'feat/FE/US-285/marketing-closing-report'
[FEAT/FE][US#285/TASK#326-327] Add Feature Marketing Closing Report (Sales/Penjualan)

See merge request mbugroup/lti-web-client!70
2025-12-06 10:25:38 +00:00
Rivaldi A N S 3411aa9b1b Merge branch 'dev/randy' into 'feat/FE/US-286/inventory-management-product-stock'
[FEAT/FE][US#286] Inventory Product Stock

See merge request mbugroup/lti-web-client!69
2025-12-06 10:25:19 +00:00
Rivaldi A N S 1f29e3cb50 Merge branch 'dev/randy' into 'feat/FE/US-280/project-flock-budget'
[FEAT/FE][US#280] Project Flock Budgets

See merge request mbugroup/lti-web-client!68
2025-12-06 10:23:34 +00:00
Rivaldi A N S b671de1336 Merge branch 'feat/FE/US-283/TASK-320-321-322-323-sapronak-closing-report' into 'feat/FE/US-283/sapronak-closing-report'
[FEAT/FE][US#283/TASK#320-321-322-323] Sapronak Closing Report

See merge request mbugroup/lti-web-client!73
2025-12-06 10:18:01 +00:00
ValdiANS 090a3183f7 feat(FE-323): create Closing type 2025-12-06 17:14:09 +07:00
ValdiANS 17865d733d feat(FE-323): create ClosingApiService 2025-12-06 17:13:53 +07:00
ValdiANS 5be67ef01c chore: update formatDate helper function 2025-12-06 17:13:27 +07:00
ValdiANS 7f326bedd4 chore(FE-320): add Closing menu 2025-12-06 17:13:00 +07:00
ValdiANS c350bc0be2 feat(FE-321): create ClosingSapronakTabContent component 2025-12-06 16:54:44 +07:00
ValdiANS 6f7627ac92 feat(FE-321): create ClosingOutgoingSapronaksTable component 2025-12-06 16:54:27 +07:00
ValdiANS 1ae5c1bd64 feat(FE-321): create ClosingIncomingSapronaksTable component 2025-12-06 16:54:15 +07:00
ValdiANS 5bb366026d feat(FE-321): create ClosingGeneralInformationTable component 2025-12-06 16:53:54 +07:00
ValdiANS 9888dc4356 feat(FE-321): create ClosingDetail component 2025-12-06 16:53:39 +07:00
ValdiANS 7615daa22a chore: update Pagination component 2025-12-06 16:53:20 +07:00
ValdiANS 435cc0aedc feat(FE-321): create layout file for closing detail route 2025-12-06 16:53:05 +07:00
ValdiANS d189252551 feat(FE-321): create Closing detail page 2025-12-06 16:52:45 +07:00
ValdiANS d85cf29193 feat(FE-320): create ClosingsTable component 2025-12-06 16:52:12 +07:00
ValdiANS 84ff5e178b feat(FE-320): create Closing list page 2025-12-06 16:51:48 +07:00
ValdiANS 72840e2193 chore: set container size value 2025-12-06 16:46:14 +07:00
ValdiANS ea2ada8224 chore: update daisyui version 2025-12-06 16:44:31 +07:00
randy-ar b97cc39854 fix(FE): revert RequireAuth component and closing logic 2025-12-06 13:10:03 +07:00
randy-ar 195bbbe449 fix(FE): change closing folder name 2025-12-06 12:51:13 +07:00
randy-ar 375b50b646 fix(FE): revert RequireAuth Component 2025-12-06 12:45:07 +07:00
randy-ar a5c71ff8ce feat(FE-284): Slicing and API Integration Perhitungan Sapronak 2025-12-06 12:43:22 +07:00
randy-ar e09074eed0 feat(FE): add sapronak table 2025-12-06 11:55:47 +07:00
randy-ar ffbf886718 fix(FE): adjust chickin and closing after submit 2025-12-06 11:38:28 +07:00
rstubryan b3f7b8a3c5 feat(FE-326): Add totals footer row to sales report table 2025-12-06 10:26:26 +07:00
rstubryan e407410c4a feat(FE-Storyless): Add footer support to Table component 2025-12-06 10:25:40 +07:00
randy-ar 341cb42452 feat(FE): adding temporary perhitungan sapronak 2025-12-06 10:05:10 +07:00
rstubryan 99b9df27a7 refactor(FE-326): Comment _closing for copy-paste function 2025-12-06 09:58:38 +07:00
rstubryan 27c867036f refactor(FE-327): Update import paths for consistency in SalesReportTable 2025-12-06 09:51:40 +07:00
rstubryan c9552dec2d refactor(FE-326): Remove custom header rows and simplify Table 2025-12-06 09:47:38 +07:00
rstubryan aad24c3c58 refactor(FE-327): Rename salesBroilerData to salesData 2025-12-06 09:12:02 +07:00
rstubryan ff1493b520 refactor(FE-326): Remove avgPriceAct/totalAct and use partner totals,
fix badge case
2025-12-06 09:09:41 +07:00
rstubryan 4ff1649991 chore(FE-327): Remove unused state from SalesReportTable 2025-12-06 08:56:14 +07:00
rstubryan 4fe53f364a refactor(FE-326): Remove Tabs wrapper from SalesReportTable 2025-12-06 08:54:12 +07:00
randy-ar 85fdb4f7dd refactor(FE): refactor chickin views and adjust approval logic in project flocks 2025-12-06 00:15:30 +07:00
randy-ar 885e4250fd feat(FE-279): Add functionality closing project flock 2025-12-05 22:55:11 +07:00
rstubryan eaf118845c feat(FE-327): Include Kandang in sales data and display name 2025-12-05 19:15:38 +07:00
rstubryan 30db7ee95d refactor(FE-327): change SalesReportTable to use new API fields 2025-12-05 18:27:45 +07:00
rstubryan 5869e0434b refactor(FE-327): change closing API paths and sales types 2025-12-05 18:26:58 +07:00
rstubryan f205c66509 refactor(FE-327): Rename Ekor label to Kuantitas 2025-12-05 17:49:59 +07:00
rstubryan 46e072bbcf refactor(FE-327): Map Indonesian sales fields and add API sample 2025-12-05 11:15:41 +07:00
rstubryan c31b284cf4 refactor(FE-327): Split BaseClosingSales into BaseSales and wrapper 2025-12-05 11:14:52 +07:00
ValdiANS bac3f30ce3 chore: update Table component 2025-12-04 23:09:08 +07:00
ValdiANS be725d42c3 chore: add Size type 2025-12-04 22:46:26 +07:00
ValdiANS b37c3f87b0 chore: set color for menu foreground and background 2025-12-04 22:46:18 +07:00
ValdiANS ae4c17b391 chore: create isPathActive helper 2025-12-04 22:45:57 +07:00
ValdiANS 48dd6d7218 chore: update MAIN_DRAWER_LINKS structure 2025-12-04 22:45:48 +07:00
ValdiANS cee3d4ba90 chore: create SidebarMenu component 2025-12-04 22:45:29 +07:00
ValdiANS a8d7fdc30d chore: update Menu component 2025-12-04 22:45:20 +07:00
ValdiANS 2bb2da74e6 chore: update CheckboxInput component 2025-12-04 22:45:13 +07:00
ValdiANS fd024fdb8f chore: update Pagination component 2025-12-04 22:44:43 +07:00
ValdiANS 79a89ea193 chore: use SidebarMenu component 2025-12-04 22:44:17 +07:00
ValdiANS 611655e408 chore: update gitlab-ci 2025-12-04 22:42:57 +07:00
ValdiANS 702943c55c chore: update next, daisyui, and eslint-config-next library 2025-12-04 22:36:22 +07:00
rstubryan 075d945a59 refactor(FE-326): Use placeholder for sales type in header 2025-12-04 21:29:45 +07:00
rstubryan 7d9a88cf3b feat(FE-326,327): Add sortable table headers and styling 2025-12-04 20:14:29 +07:00
rstubryan b095208fae refactor(FE-327): Temporarily map Indonesian sales fields to English 2025-12-04 17:41:22 +07:00
randy-ar c69d9dd605 fix(FE): revert require auth component to correct file 2025-12-04 16:39:00 +07:00
randy-ar a1d0c7b331 fix(FE): adjust data types for inventory product stock 2025-12-04 16:35:10 +07:00
randy-ar e0a8514814 fix(FE): adjust data types for project flock and product stock inventory 2025-12-04 16:13:47 +07:00
rstubryan 949761d59d feat(FE-326,327): add footer rendering to SalesReportTable for total sales display 2025-12-04 14:25:27 +07:00
rstubryan 15ced14e20 refactor(FE-Storyless): add footer rendering support to Table component 2025-12-04 14:25:11 +07:00
rstubryan 492efb18e2 chore: update next.js to version 15.5.7 in package.json and package-lock.json 2025-12-04 14:15:58 +07:00
rstubryan 8ea29579ec feat(FE-326,327): add layout and closing detail page with sales report integration 2025-12-04 14:10:57 +07:00
randy-ar dc6b0eaec6 fix(FE): change datatype location in inventory products 2025-12-04 14:10:46 +07:00
rstubryan 1a4a05308f refactor(FE-326,327): enhance SalesReportTable to handle empty sales data and conditionally render summary row 2025-12-04 14:08:44 +07:00
rstubryan ba40bbb1d3 refactor(FE-327): remove dummy sales data and update ClosingApiService to fetch real sales data from API 2025-12-04 14:07:10 +07:00
rstubryan 647b002065 refactor(FE-326): change SalesReportTable to use BaseClosingSales type and support initial values 2025-12-04 11:55:57 +07:00
rstubryan 991a594ee1 refactor(FE-326): Add ClosingApiService and types for closing sales data 2025-12-04 11:51:11 +07:00
randy-ar 3b846bf11c fix(FE): fixing error suspense layout 2025-12-04 02:06:33 +07:00
randy-ar 3e07316678 feat(FE-328-329-330): Adding Feature Inventory Product Stocks 2025-12-04 02:05:34 +07:00
rstubryan 411c2586f5 chore(format): prettier format 2025-12-03 22:32:11 +07:00
rstubryan 3a87b039bf feat(FE-326): Add SalesReportTable component 2025-12-03 22:31:10 +07:00
rstubryan 50559caf52 feat(FE-326): Support custom header rows and cell render hook 2025-12-03 22:28:18 +07:00
rstubryan 8fbe6aa148 chore(FE-Storyless): Add .claude to .gitignore 2025-12-03 22:26:33 +07:00
randy-ar 873a4b308d fix(FE): resolve conflict pull branch development 2025-12-03 21:21:42 +07:00
randy-ar f0ec758d7f feat(FE-314-315): API Integration project budgets and refactoring UI 2025-12-03 21:09:12 +07:00
rstubryan 88878f7613 Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu 2025-12-03 10:55:39 +07:00
randy-ar 31f758d680 refactor(FE): refactor UI detail from page into drawer 2025-12-02 16:25:55 +07:00
randy-ar 9eba5ffeca feat(FE): create floation actions button 2025-12-02 12:37:03 +07:00
randy-ar 6b5838b5aa feat(FE): refactor drawer zustand store 2025-12-02 11:01:53 +07:00
randy-ar c76f3a3715 feat(FE): US#278 slicing UI from and client side validation 2025-12-02 04:11:01 +07:00
randy-ar 48435a9cbb fix(FE): change import module to absolute path 2025-12-01 10:22:00 +07:00
randy-ar 2ace95a0db feat(FE): add drawer ui store 2025-12-01 10:13:28 +07:00
randy-ar 892bb19dfd refactor(FE): change project flock form, detail and chickin view using drawer 2025-11-28 16:41:01 +07:00
rstubryan 7a76719547 refactor(FE-Storyless): remove console, window and err catch 2025-11-27 13:46:53 +07:00
rstubryan 4b6144d0b4 refactor(FE-Storyless): update import paths for schema files to use absolute paths 2025-11-27 13:36:12 +07:00
389 changed files with 51897 additions and 8524 deletions
+3
View File
@@ -42,3 +42,6 @@ next-env.d.ts
# idea
.idea
# claude
.claude
+48 -29
View File
@@ -2,6 +2,17 @@ stages:
- build
- deploy
# ==========================================================
# ✅ Global defaults
# ==========================================================
default:
tags:
- server-development-biznet
interruptible: true
# ==========================================================
# 🏗️ Build Template
# ==========================================================
.build_template: &build_template
stage: build
image: node:20-alpine
@@ -39,6 +50,9 @@ stages:
- out/
expire_in: 1 week
# ==========================================================
# 🚀 Deploy Template
# ==========================================================
.deploy_template: &deploy_template
stage: deploy
image:
@@ -73,8 +87,8 @@ stages:
if [ "$CI_COMMIT_BRANCH" = "development" ]; then
ENVIRONMENT_NAME="WEB-LTI-DEV"
elif [ "$CI_COMMIT_BRANCH" = "master" ]; then
ENVIRONMENT_NAME="WEB-LTI-PROD"
elif [ "$CI_COMMIT_BRANCH" = "staging" ]; then
ENVIRONMENT_NAME="WEB-LTI-STAGING"
else
ENVIRONMENT_NAME="UNKNOWN"
fi
@@ -82,11 +96,11 @@ stages:
if [ "$STATUS" = "success" ]; then
COLOR=3066993
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
COLOR=15158332
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
jq -n \
@@ -114,7 +128,9 @@ stages:
curl -sS -H "Content-Type: application/json" -d @payload.json "$DISCORD_WEBHOOK_URL"
# ====== DEVELOPMENT (Branch development) ======
# ==========================================================
# ==== DEVELOPMENT (Branch development) ======
# ==========================================================
build:dev:
<<: *build_template
rules:
@@ -122,11 +138,10 @@ build:dev:
environment:
name: development
variables:
# NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id'
# NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-api-sso.mbugroup.id'
NEXT_PUBLIC_LTI_URL: 'https://dev-lti-erp.mbugroup.id'
NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-auth-erp.mbugroup.id'
NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id/api'
NEXT_PUBLIC_CLIENT_ID: 'Lumbung-Telur-Indonesia'
deploy:dev:
<<: *deploy_template
@@ -141,26 +156,30 @@ deploy:dev:
name: development
url: https://dev-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
# ==========================================================
# ====== STAGING (Branch staging) ======
# ==========================================================
build:staging:
<<: *build_template
rules:
- if: '$CI_COMMIT_BRANCH == "staging"'
environment:
name: staging
variables:
NEXT_PUBLIC_LTI_URL: 'https://stg-lti-erp.mbugroup.id'
NEXT_PUBLIC_SSO_LOGIN_URL: 'https://stg-auth-erp.mbugroup.id'
NEXT_PUBLIC_API_BASE_URL: 'https://stg-api-lti.mbugroup.id/api'
NEXT_PUBLIC_CLIENT_ID: 'Lumbung-Telur-Indonesia'
deploy:staging:
<<: *deploy_template
needs: ['build:staging']
rules:
- if: '$CI_COMMIT_BRANCH == "staging"'
variables:
S3_BUCKET: 'stg-lti-erp.mbugroup.id'
AWS_REGION: 'ap-southeast-3'
CLOUDFRONT_DISTRIBUTION_ID: 'E2V6PPO1AUIU7H'
environment:
name: staging
url: https://stg-lti-erp.mbugroup.id
+1 -1
View File
@@ -1,3 +1,3 @@
npm run format
npm run lint
npm run build
npx tsc --noEmit
+1
View File
@@ -3,6 +3,7 @@ import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
output: 'export',
images: { unoptimized: true },
trailingSlash: true,
};
export default nextConfig;
+3466 -34
View File
File diff suppressed because it is too large Load Diff
+20 -5
View File
@@ -15,20 +15,35 @@
"@tanstack/match-sorter-utils": "^8.19.4",
"@tanstack/react-table": "^8.21.3",
"axios": "^1.12.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"embla-carousel-react": "^8.6.0",
"formik": "^2.4.6",
"input-otp": "^1.4.2",
"jspdf": "^3.0.4",
"jspdf-autotable": "^5.0.2",
"lucide-react": "^0.562.0",
"moment": "^2.30.1",
"next": "15.5.7",
"react": "19.1.0",
"next": "15.5.9",
"next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.1.2",
"react-day-picker": "^9.11.1",
"react-dom": "19.1.0",
"react-dom": "^19.1.2",
"react-dropzone": "^14.3.8",
"react-hook-form": "^7.70.0",
"react-hot-toast": "^2.6.0",
"react-number-format": "^5.4.4",
"react-resizable-panels": "2.1.7",
"react-select": "^5.10.2",
"recharts": "^3.6.0",
"sonner": "^2.0.7",
"swr": "^2.3.6",
"tailwind-merge": "^3.3.1",
"use-debounce": "^10.0.6",
"vaul": "^1.1.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
"yup": "^1.7.0",
"zustand": "^5.0.8"
},
@@ -39,9 +54,9 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"daisyui": "^5.1.12",
"daisyui": "^5.5.8",
"eslint": "^9",
"eslint-config-next": "15.5.3",
"eslint-config-next": "^15.5.7",
"husky": "^9.1.7",
"prettier": "^3.6.2",
"tailwindcss": "^4",
+95
View File
@@ -0,0 +1,95 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import ClosingDetail from '@/components/pages/closing/ClosingDetail';
import { ClosingApi } from '@/services/api/closing';
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 router = useRouter();
const searchParams = useSearchParams();
const closingId = searchParams.get('closingId');
const kandangId = searchParams.get('kandangId'); // project flock kandang ID
const { data: closing, isLoading: isLoadingClosing } = useSWR(
closingId,
(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(
closingId ? `sales-${closingId}` : null,
() => ClosingApi.getPenjualan(Number(closingId))
);
const { data: hppEkspedisiData, isLoading: isLoadingHppEkspedisi } = useSWR(
closingId ? `hpp-ekspedisi-${closingId}` : null,
() => ClosingApi.getHppEkspedisi(Number(closingId))
);
if (!closingId) {
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 (!isLoadingClosing && (!closing || isResponseError(closing))) {
router.replace('/404');
return;
}
const isLoading =
isLoadingClosing ||
isLoadingSales ||
isLoadingHppEkspedisi ||
isLoadingProject ||
isLoadingKandang;
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoading && <span className='loading loading-spinner loading-xl' />}
{!isLoading && isResponseSuccess(closing) && (
<ClosingDetail
id={Number(closingId)}
initialValue={closing.data}
salesData={isResponseSuccess(salesData) ? salesData.data : undefined}
hppExpeditionData={
isResponseSuccess(hppEkspedisiData)
? hppEkspedisiData.data
: undefined
}
projectData={
isResponseSuccess(projectData) ? projectData.data : undefined
}
kandangData={
isResponseSuccess(kandangData) ? kandangData.data : undefined
}
/>
)}
</div>
);
};
export default ClosingDetailPage;
+11
View File
@@ -0,0 +1,11 @@
import ClosingsTable from '@/components/pages/closing/ClosingsTable';
const Closing = () => {
return (
<section className='w-full p-4'>
<ClosingsTable />
</section>
);
};
export default Closing;
@@ -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 = () => {
return (
<section className='w-full p-4'>
<h1 className='text-3xl font-bold text-primary'>Dashboard</h1>
</section>
);
return <DashboardProduction />;
};
export default Dashboard;
+1 -1
View File
@@ -37,7 +37,7 @@ const ExpenseRealization = () => {
const isExpenseCanBeRealized =
isResponseSuccess(expense) &&
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 (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;
+11
View File
@@ -0,0 +1,11 @@
import SuspenseHelper from '@/components/helper/SuspenseHelper';
const Layout = ({
children,
}: Readonly<{
children: React.ReactNode;
}>) => {
return <SuspenseHelper>{children}</SuspenseHelper>;
};
export default Layout;
+41
View File
@@ -0,0 +1,41 @@
'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>
);
}
console.log(finance);
// 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;
+40 -20
View File
@@ -1,32 +1,46 @@
@import 'tailwindcss';
@plugin "daisyui";
@import '../styles/daisyui.css';
@import '../figma-make/styles/theme.css';
@plugin "daisyui/theme" {
name: 'lti';
default: false;
prefersdark: false;
color-scheme: 'light';
--color-base-100: oklch(98% 0.001 106.423);
--color-base-200: oklch(97% 0.001 106.424);
--color-base-300: oklch(92% 0.003 48.717);
--color-base-content: oklch(22.389% 0.031 278.072);
--color-primary: oklch(60% 0.126 221.723);
--color-primary-content: oklch(100% 0 0);
--color-secondary: oklch(52% 0.105 223.128);
--color-secondary-content: oklch(100% 0 0);
--color-accent: oklch(45% 0.085 224.283);
--color-accent-content: oklch(100% 0 0);
--color-neutral: oklch(39% 0.07 227.392);
--color-neutral-content: oklch(100% 0 0);
--color-info: oklch(58% 0.158 241.966);
--color-info-content: oklch(100% 0 0);
--color-success: oklch(62% 0.194 149.214);
--color-success-content: oklch(100% 0 0);
--color-warning: oklch(85% 0.199 91.936);
--color-warning-content: oklch(0% 0 0);
--color-error: oklch(57% 0.245 27.325);
--color-error-content: oklch(100% 0 0);
/* Primary Colors */
--color-primary: oklch(39.4% 0.177 301.9);
--color-primary-content: oklch(87.5% 0.038 274.5);
/* Secondary Colors */
--color-secondary: oklch(60.1% 0.258 335.7);
--color-secondary-content: oklch(99.4% 0.007 337.8);
/* Accent Colors */
--color-accent: oklch(76.2% 0.155 170.8);
--color-accent-content: oklch(7.2% 0.007 167.6);
/* Neutral Colors */
--color-neutral: oklch(22.4% 0.032 258.8);
--color-neutral-content: oklch(87.7% 0.016 257);
/* Base Colors */
--color-base-100: oklch(100% 0 0); /* #ffffff */
--color-base-200: oklch(97.2% 0 0); /* #f2f2f2 */
--color-base-300: oklch(93.1% 0.002 249.7); /* #e5e6e6 */
--color-base-content: oklch(18.6% 0.024 257.7); /* #1f2937 */
/* Status/Utility Colors */
--color-info: oklch(67.4% 0.176 238.9);
--color-info-content: oklch(0% 0 0); /* #000000 */
--color-success: oklch(62.3% 0.147 149);
--color-success-content: oklch(100% 0 0); /* #ffffff */
--color-warning: oklch(82.2% 0.165 91.9);
--color-warning-content: oklch(0% 0 0); /* #000000 */
--color-error: oklch(61.8% 0.203 27.8);
--color-error-content: oklch(100% 0 0); /* #fffffff */
--radius-selector: 0rem;
--radius-field: 0.25rem;
--radius-box: 0.25rem;
@@ -43,6 +57,12 @@
@theme {
--font-inter: var(--font-inter);
--container-sm: 40rem;
--container-md: 48rem;
--container-lg: 64rem;
--container-xl: 80rem;
--container-2xl: 96rem;
}
html {
@@ -12,8 +12,6 @@ const DetailInventoryAdjustment = () => {
// Ambil data dari router state
useEffect(() => {
console.log('Router State');
console.log(window.history.state);
const state = window.history.state?.usr as
| { inventoryAdjustment?: InventoryAdjustment }
| undefined;
@@ -26,9 +24,6 @@ const DetailInventoryAdjustment = () => {
const finalData = inventoryAdjustment;
console.log('Final Data');
console.log(finalData);
if (!finalData) {
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
@@ -0,0 +1,11 @@
import SuspenseHelper from '@/components/helper/SuspenseHelper';
const Layout = ({
children,
}: Readonly<{
children: React.ReactNode;
}>) => {
return <SuspenseHelper>{children}</SuspenseHelper>;
};
export default Layout;
+50
View File
@@ -0,0 +1,50 @@
'use client';
import InventoryProductDetail from '@/components/pages/inventory/product/detail/InventoryProductDetail';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { InventoryProductApi } from '@/services/api/inventory';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
const InventoryProductDetailPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
const inventoryProductId = searchParams.get('inventoryProductId');
const { data: inventoryProduct, isLoading: isLoadingInventoryProduct } =
useSWR(inventoryProductId, (id: number) =>
InventoryProductApi.getSingle(id)
);
if (!inventoryProductId) {
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 (
!isLoadingInventoryProduct &&
(!inventoryProduct || isResponseError(inventoryProduct))
) {
router.replace('/404');
return;
}
return (
<div className='size-full'>
{isLoadingInventoryProduct && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingInventoryProduct && isResponseSuccess(inventoryProduct) && (
<InventoryProductDetail inventoryProduct={inventoryProduct.data} />
)}
</div>
);
};
export default InventoryProductDetailPage;
+11
View File
@@ -0,0 +1,11 @@
import InventoryProductTable from '@/components/pages/inventory/product/InventoryProductTable';
const InventoryProductPage = () => {
return (
<div className='size-full'>
<InventoryProductTable />
</div>
);
};
export default InventoryProductPage;
+2
View File
@@ -3,6 +3,7 @@ import { Inter } from 'next/font/google';
import '@/app/globals.css';
import { Toaster } from 'react-hot-toast';
import { Toaster as SonnerToaster } from '@/figma-make/components/base/sonner';
import MainDrawer from '@/components/MainDrawer';
import RequireAuth from '@/components/helper/RequireAuth';
@@ -35,6 +36,7 @@ export default function RootLayout({
</RequireAuth>
<Toaster />
<SonnerToaster position='top-right' />
</body>
</html>
);
+1
View File
@@ -7,4 +7,5 @@ const Marketing = () => {
</div>
);
};
export default Marketing;
@@ -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;
+21 -3
View File
@@ -1,11 +1,29 @@
import { redirect } from 'next/navigation';
'use client';
import { useEffect } from 'react';
import { usePathname, useRouter } from 'next/navigation';
import { useAuth } from '@/services/hooks/useAuth';
import { redirectToSSO } from '@/lib/auth-helper';
export default function Home() {
redirect('/dashboard');
const { user, isLoadingUser } = useAuth();
const router = useRouter();
const pathname = usePathname();
useEffect(() => {
if (pathname === '/') {
router.replace('/dashboard');
}
}, [pathname]);
if (isLoadingUser) {
return (
<main className='w-full h-full min-h-screen flex flex-row justify-center items-center'>
<h1>LTI ERP</h1>
<span className='loading loading-spinner loading-lg'></span>
</main>
);
}
return <>Loading...</>;
}
@@ -1,10 +1,18 @@
'use client';
import ProjectFlockForm from '@/components/pages/production/project-flock/form/ProjectFlockForm';
import React, { useImperativeHandle } from 'react';
import toast from 'react-hot-toast';
const AddProjectFlock = () => {
// useImperativeHandle(ref, () => ({
// validate() {
// toast.success('Validating');
// return false;
// },
// }));
return (
<section className='w-full p-4 flex flex-row justify-center'>
<section className='w-full flex flex-row justify-center'>
<ProjectFlockForm formType='add' />
</section>
);
@@ -44,7 +44,7 @@ export default function AddChickinKandang() {
return (
<>
<section className='w-full p-4'>
<section className='size-full'>
{isLoading && <span className='loading loading-spinner loading-xl' />}
{!isLoading &&
isResponseSuccess(projectFlockKandang) &&
@@ -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 p-4'>
<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 p-4'>
<ChickinTable />
</section>
);
};
export default Chickin;
@@ -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,63 @@
'use client';
import ProjectFlockClosingForm from '@/components/pages/production/project-flock/closing/ProjectFlockClosingForm';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { ProjectFlockKandangApi } from '@/services/api/production';
import { ProjectFlockApi } from '@/services/api/production/project-flock';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
const ProjectFlockClosingPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
const projectFlockId = searchParams.get('projectFlockId');
const projectFlockKandangId = searchParams.get('projectFlockKandangId');
const { data: projectFlockKandang, isLoading: isLoadingProjectFlockKandang } =
useSWR(`get-flock-kandang-id/${projectFlockKandangId}`, () =>
ProjectFlockKandangApi.getSingle(parseInt(projectFlockKandangId ?? ''))
);
const { data: projectFlock, isLoading: isLoadingProjectFlock } = useSWR(
`get-flock-id/${projectFlockId}`,
() => ProjectFlockApi.getSingle(parseInt(projectFlockId ?? ''))
);
if (!projectFlockId || !projectFlockKandangId) {
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 (
!isLoadingProjectFlock &&
(!projectFlock || isResponseError(projectFlock)) &&
!isLoadingProjectFlockKandang &&
(!projectFlockKandang || isResponseError(projectFlockKandang))
) {
router.replace('/404');
return;
}
return (
<div className='w-full h-full flex flex-col justify-center'>
{isLoadingProjectFlock ||
(isLoadingProjectFlockKandang && (
<span className='loading loading-spinner loading-xl' />
))}
{isResponseSuccess(projectFlock) &&
isResponseSuccess(projectFlockKandang) && (
<ProjectFlockClosingForm
projectFlock={projectFlock.data}
projectFlockKandang={projectFlockKandang.data}
/>
)}
</div>
);
};
export default ProjectFlockClosingPage;
@@ -37,7 +37,7 @@ const ProjectFlockEdit = () => {
}
return (
<div className='w-full p-4 flex flex-col justify-center'>
<div className='w-full flex flex-col justify-center'>
{isLoadingProjectFlock && (
<span className='loading loading-spinner loading-xl' />
)}
@@ -1,12 +1,13 @@
'use client';
import ProjectFlockDetail from '@/components/pages/production/project-flock/detail/ProjectFlockDetail';
import ProjectFlockForm from '@/components/pages/production/project-flock/form/ProjectFlockForm';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { ProjectFlockApi } from '@/services/api/production/project-flock';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
const ProjectFlockDetail = () => {
const ProjectFlockDetailPage = () => {
const router = useRouter();
const searchParams = useSearchParams();
@@ -37,19 +38,17 @@ const ProjectFlockDetail = () => {
}
return (
<div className='w-full p-4 flex flex-col justify-center'>
<div className='w-full h-full flex flex-col justify-center'>
{isLoadingProjectFlock && (
<span className='loading loading-spinner loading-xl' />
)}
{isResponseSuccess(projectFlock) && (
<ProjectFlockForm
formType='detail'
initialValues={projectFlock.data}
refreshProjectFlocks={refreshProjectFlock}
/>
<ProjectFlockDetail projectFlock={projectFlock.data} />
)}
</div>
);
};
export default ProjectFlockDetail;
export default ProjectFlockDetailPage;
ProjectFlockDetail;
ProjectFlockDetail;
@@ -0,0 +1,60 @@
'use client';
import { usePathname, useRouter } from 'next/navigation';
import Drawer from '@/components/Drawer';
import React, { ReactNode } from 'react';
import ProjectFlockTable from '@/components/pages/production/project-flock/ProjectFlockTable';
import { useUiStore } from '@/stores/ui/ui.store';
export default function ProjectFlockLayout({
children,
}: {
children: ReactNode;
}) {
const pathname = usePathname();
const router = useRouter();
const toggleValidate = useUiStore((s) => s.toggleValidate);
const isAdd = pathname.includes('/add');
const isEdit = pathname.includes('/detail/edit');
const isDetail = pathname.includes('/detail');
const isChickin = pathname.includes('/chickin/add/kandang');
const isClosing = pathname.includes('/closing');
const isOpen = isAdd || isEdit || isDetail || isChickin || isClosing;
const handleBackdropClick = () => {
const unsub = useUiStore.getState().subscribeIsValid((isValid) => {
if (isValid) {
unsub(); // berhenti listen
router.push('/production/project-flock');
}
});
toggleValidate();
};
return (
<>
{/* List page always rendered */}
<div className='min-h-sceen w-full relative'>
<ProjectFlockTable
refresh={() => !isOpen && router.push('/production/project-flock')}
/>
</div>
{/* Render Drawer only on /add */}
<Drawer
open={isOpen}
setOpen={(v) => {
if (!v) router.push('/production/project-flock');
}}
closeOnBackdropClick={isDetail ? true : false}
onBackdropClick={handleBackdropClick}
variant='right'
zIndex='99999'
sidebarContent={isOpen && <div className=''>{children}</div>}
/>
</>
);
}
+1 -1
View File
@@ -2,7 +2,7 @@ import ProjectFlockTable from '@/components/pages/production/project-flock/Proje
const ProjectFlock = () => {
return (
<section className='w-full p-4'>
<section className='size-full p-4'>
<ProjectFlockTable />
</section>
);
@@ -14,7 +14,7 @@ const RecordingEdit = () => {
const { data: recording, isLoading: isLoadingRecording } = useSWR(
recordingId,
(id: number) => RecordingApi.getSingle(id) // Gunakan RecordingApi
(id: string) => RecordingApi.getSingle(parseInt(id))
);
if (!recordingId) {
+1 -1
View File
@@ -14,7 +14,7 @@ const RecordingDetail = () => {
const { data: recording, isLoading: isLoadingRecording } = useSWR(
recordingId,
(id: number) => RecordingApi.getSingle(id)
(id: string) => RecordingApi.getSingle(parseInt(id))
);
if (!recordingId) {
@@ -1,49 +0,0 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import GradingForm from '@/components/pages/production/recording/grading/form/GradingForm';
import { RecordingApi } from '@/services/api/production';
import { isResponseSuccess } from '@/lib/api-helper';
const AddGrading = () => {
const router = useRouter();
const searchParams = useSearchParams();
const recordingId = searchParams.get('recording_id');
const { data: recording, isLoading: isLoadingRecording } = useSWR(
recordingId && recordingId !== 'new' ? [recordingId] : null,
([id]) => RecordingApi.getSingle(parseInt(id))
);
if (
recordingId &&
recordingId !== 'new' &&
!isLoadingRecording &&
(!recording || !isResponseSuccess(recording))
) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{recordingId && recordingId !== 'new' && isLoadingRecording && (
<span className='loading loading-spinner loading-xl' />
)}
{(!recordingId ||
recordingId === 'new' ||
(!isLoadingRecording && recording && isResponseSuccess(recording))) && (
<GradingForm
type='add'
initialValues={
isResponseSuccess(recording) ? recording.data?.eggs?.[0] : undefined
}
/>
)}
</div>
);
};
export default AddGrading;
@@ -1,53 +0,0 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import GradingForm from '@/components/pages/production/recording/grading/form/GradingForm';
import { RecordingApi } from '@/services/api/production';
import { isResponseSuccess } from '@/lib/api-helper';
const EditGrading = () => {
const router = useRouter();
const searchParams = useSearchParams();
const recordingId = searchParams.get('recordingId');
const gradingId = searchParams.get('gradingId');
const { data: recording, isLoading: isLoadingRecording } = useSWR(
recordingId ? [recordingId] : null,
([id]) => RecordingApi.getSingle(parseInt(id))
);
if (!recordingId) {
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 (!isLoadingRecording && (!recording || !isResponseSuccess(recording))) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingRecording && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingRecording && recording && isResponseSuccess(recording) && (
<GradingForm
type='edit'
initialValues={recording.data.eggs?.find(
(egg) => egg.id === parseInt(gradingId || '0')
)}
/>
)}
</div>
);
};
export default EditGrading;
@@ -1,52 +0,0 @@
'use client';
import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import GradingForm from '@/components/pages/production/recording/grading/form/GradingForm';
import { RecordingApi } from '@/services/api/production';
import { isResponseSuccess } from '@/lib/api-helper';
const DetailGrading = () => {
const router = useRouter();
const searchParams = useSearchParams();
const gradingId = searchParams.get('gradingId');
const { data: grading, isLoading: isLoadingGrading } = useSWR(
gradingId ? [gradingId] : null,
([id]) => RecordingApi.getSingle(parseInt(id))
);
if (!gradingId) {
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 (!isLoadingGrading && (!grading || !isResponseSuccess(grading))) {
router.replace('/404');
return;
}
return (
<div className='w-full p-4 flex flex-row justify-center'>
{isLoadingGrading && (
<span className='loading loading-spinner loading-xl' />
)}
{!isLoadingGrading && grading && isResponseSuccess(grading) && (
<GradingForm
type='detail'
initialValues={grading.data.eggs?.find(
(egg) => egg.id === parseInt(gradingId)
)}
/>
)}
</div>
);
};
export default DetailGrading;
@@ -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;
+11
View File
@@ -0,0 +1,11 @@
import SuspenseHelper from '@/components/helper/SuspenseHelper';
const Layout = ({
children,
}: Readonly<{
children: React.ReactNode;
}>) => {
return <SuspenseHelper>{children}</SuspenseHelper>;
};
export default Layout;
+5
View File
@@ -0,0 +1,5 @@
const ReportExpenseDetail = () => {
return <div>ReportExpenseDetail</div>;
};
export default ReportExpenseDetail;
+13
View File
@@ -0,0 +1,13 @@
'use client';
import ReportExpenseTable from '@/components/pages/report/expense/ReportExpenseTable';
const ReportExpense = () => {
return (
<div className='w-full p-4'>
<ReportExpenseTable />
</div>
);
};
export default ReportExpense;
+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 SuspenseHelper from '@/components/helper/SuspenseHelper';
const Layout = ({
children,
}: Readonly<{
children: React.ReactNode;
}>) => {
return <SuspenseHelper>{children}</SuspenseHelper>;
};
export default Layout;
+7
View File
@@ -0,0 +1,7 @@
import LogisticStockTabs from '@/components/pages/report/logistic-stock/LogisticStockTabs';
const LogisticStock = () => {
return <LogisticStockTabs />;
};
export default LogisticStock;
+11
View File
@@ -0,0 +1,11 @@
import SuspenseHelper from '@/components/helper/SuspenseHelper';
const Layout = ({
children,
}: Readonly<{
children: React.ReactNode;
}>) => {
return <SuspenseHelper>{children}</SuspenseHelper>;
};
export default Layout;
+11
View File
@@ -0,0 +1,11 @@
import MarketingReportContent from '@/components/pages/report/MarketingReportContent';
const MarketingReportPage = () => {
return (
<section className='w-full p-4'>
<MarketingReportContent />
</section>
);
};
export default MarketingReportPage;
+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 { cn } from '@/lib/helper';
import type { Color, Variant, Size } from '@/types/theme';
export interface BadgeProps
extends Omit<HTMLAttributes<HTMLSpanElement>, 'className'> {
children?: ReactNode;
className?: {
badge?: string;
status?: string;
};
variant?: 'default' | 'outline' | 'ghost' | 'soft' | 'dash';
color?:
| 'neutral'
| 'primary'
| 'secondary'
| 'accent'
| 'info'
| 'success'
| 'warning'
| 'error';
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
statusIndicator?: boolean;
variant?: Variant;
color?: Color;
size?: Size;
}
const Badge = ({
children,
className,
statusIndicator = false,
variant = 'default',
color,
size = 'md',
@@ -34,7 +30,7 @@ const Badge = ({
const getBadgeClasses = () => {
const baseClasses = 'badge';
const variantClasses = {
const variantClasses: Record<Variant, string> = {
default: '',
outline: 'badge-outline',
ghost: 'badge-ghost',
@@ -42,7 +38,7 @@ const Badge = ({
dash: 'badge-dash',
};
const colorClasses = {
const colorClasses: Record<Color, string> = {
neutral: 'badge-neutral',
primary: 'badge-primary',
secondary: 'badge-secondary',
@@ -51,9 +47,10 @@ const Badge = ({
success: 'badge-success',
warning: 'badge-warning',
error: 'badge-error',
none: '',
};
const sizeClasses = {
const sizeClasses: Record<Size, string> = {
xs: 'badge-xs',
sm: 'badge-sm',
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 (
<span className={getBadgeClasses()} {...props}>
{statusIndicator && <span className={getStatusClasses()} />}
{children}
</span>
);
+1 -1
View File
@@ -4,7 +4,7 @@ import { HTMLAttributes, ReactNode, useState } from 'react';
import { cn } from '@/lib/helper';
import Image from 'next/image';
import Collapse from './Collapse';
import Collapse from '@/components/Collapse';
import { Icon } from '@iconify/react';
export interface CardProps
+137 -6
View File
@@ -10,28 +10,115 @@ interface DrawerProps {
open: boolean;
setOpen: (newOpenState: boolean) => void;
openOnLarge?: boolean;
variant?: 'sidebar' | 'left' | 'right';
zIndex?: string;
className?: DrawerClassName;
onBackdropClick?: () => void;
closeOnBackdropClick?: boolean;
expandedContent?: ReactNode;
expandedWidth?: string;
}
type DrawerClassName = {
drawer?: string;
drawerContent?: string;
drawerSide?: string;
drawerOverlay?: string;
drawerSidebarContent?: string;
};
const Drawer = ({
children,
sidebarContent,
open,
setOpen,
openOnLarge,
variant = 'sidebar',
zIndex = '20',
className,
onBackdropClick,
closeOnBackdropClick = true,
expandedContent,
expandedWidth = 'w-[400px]',
}: DrawerProps) => {
const getDrawerClassNames = (): DrawerClassName => {
const baseClassNames = {
drawer: 'drawer',
drawerContent: 'drawer-content',
drawerSide: 'drawer-side',
drawerOverlay: 'drawer-overlay',
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]';
}
return 'w-full sm:min-w-120 sm:w-fit';
};
if (variant === 'sidebar') {
return {
...baseClassNames,
drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent,
getSidebarWidth()
),
};
} else if (variant === 'right') {
return {
...baseClassNames,
drawer: cn(baseClassNames.drawer, 'drawer-end'),
drawerSide: cn(
baseClassNames.drawerSide,
'border-l border-solid border-gray-200 sm:drawer-side w-screen top-0 right-0 fixed z-21'
),
drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent,
getSidebarWidth()
),
};
} else if (variant === 'left') {
return {
...baseClassNames,
drawerSide: cn(
baseClassNames.drawerSide,
'border-l border-solid border-gray-200 drawer-side w-screen top-0 right-0 fixed z-21'
),
drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent,
getSidebarWidth()
),
};
}
return baseClassNames; // Fallback for default or unknown variant
};
const varianClassName = getDrawerClassNames();
const toggleDrawer = () => {
setOpen(!open);
};
const closeDrawer = () => {
if (closeOnBackdropClick) {
setOpen(false);
}
onBackdropClick && onBackdropClick();
};
return (
<div
className={cn('drawer', {
className={cn(
'drawer',
{
'lg:drawer-open': openOnLarge,
})}
},
varianClassName?.drawer,
className?.drawer
)}
>
<input
type='checkbox'
@@ -40,18 +127,62 @@ const Drawer = ({
className='drawer-toggle'
/>
<div className='drawer-content'>{children}</div>
{/* Drawer Content */}
<div
className={cn(varianClassName?.drawerContent, className?.drawerContent)}
>
{children}
</div>
<div className='drawer-side border-r border-solid border-gray-200 z-20'>
{/* Drawer Side */}
<div
className={cn(
varianClassName?.drawerSide,
className?.drawerSide,
zIndex
)}
>
<label
aria-label='close sidebar'
className='drawer-overlay'
className={cn(
varianClassName?.drawerOverlay,
className?.drawerOverlay
)}
onClick={closeDrawer}
/>
<div className='min-h-full w-full max-w-[300px] lg:w-[300px] bg-base-100'>
{/* Sidebar Content - Full height container */}
<div
className={cn(
'flex h-screen bg-base-100 overflow-hidden',
variant === 'right' && 'flex-row'
)}
>
{/* Primary Sidebar Content */}
<div
className={cn(
varianClassName?.drawerSidebarContent,
className?.drawerContent,
'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',
expandedWidth
)}
>
<div className='overflow-y-auto flex-1 h-full'>
{expandedContent}
</div>
</div>
)}
</div>
</div>
</div>
);
+114
View File
@@ -0,0 +1,114 @@
import React, { ReactNode, useState, useRef } from 'react';
import { cn } from '@/lib/helper';
export interface DropdownProps {
trigger: ReactNode;
children: ReactNode;
className?: {
wrapper?: string;
trigger?: string;
content?: string;
};
align?: 'start' | 'center' | 'end';
direction?: 'top' | 'bottom' | 'left' | 'right';
hover?: boolean;
defaultOpen?: boolean;
open?: boolean;
close?: boolean;
controlled?: boolean;
}
const Dropdown = ({
trigger,
children,
className,
align,
direction,
hover,
defaultOpen = false,
open,
close,
controlled = false,
}: DropdownProps) => {
const [isOpen, setIsOpen] = useState(defaultOpen);
const dropdownRef = useRef<HTMLDivElement>(null);
const toggleDropdown = () => {
if (!controlled) {
const newState = !isOpen;
setIsOpen(newState);
}
};
const getWrapperClasses = () => {
const openState = controlled ? open : isOpen;
return cn(
'dropdown',
{
'dropdown-start': align === 'start',
'dropdown-center': align === 'center',
'dropdown-end': align === 'end',
'dropdown-top': direction === 'top',
'dropdown-bottom': direction === 'bottom',
'dropdown-left': direction === 'left',
'dropdown-right': direction === 'right',
'dropdown-hover': hover,
'dropdown-open': openState && !close,
'dropdown-close': close,
},
className?.wrapper
);
};
const getTriggerClasses = () => {
return cn(className?.trigger);
};
const getContentClasses = () => {
return cn(
'dropdown-content z-[9999] shadow-sm bg-base-100 rounded-box',
className?.content
);
};
if (controlled) {
return (
<div className={getWrapperClasses()}>
{trigger}
{open && !close && (
<div tabIndex={-1} className={getContentClasses()}>
{children}
</div>
)}
</div>
);
}
return (
<div ref={dropdownRef} className={getWrapperClasses()}>
<div
tabIndex={0}
role='button'
className={getTriggerClasses()}
onClick={toggleDropdown}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
toggleDropdown();
}
}}
>
{trigger}
</div>
{!close && (
<div tabIndex={-1} className={getContentClasses()}>
{children}
</div>
)}
</div>
);
};
export default Dropdown;
+171
View File
@@ -0,0 +1,171 @@
'use client';
import Button from '@/components/Button';
import Tooltip from '@/components/Tooltip';
import { cn } from '@/lib/helper';
import { Icon } from '@iconify/react';
import { useAuth } from '@/services/hooks/useAuth';
type FloatingActionsButtonProps = {
actions: {
action: 'DETAIL' | 'EDIT' | 'DELETE';
icon: string;
label?: string;
onClick?: () => void;
hidden?: boolean;
disabled?: boolean;
permissions?: string | string[];
}[];
approvals: {
action: 'APPROVED' | 'REJECTED';
icon: string;
label?: string;
onClick?: () => void;
disabled?: boolean;
permissions?: string | string[];
}[];
selectedRowIds: number[];
onClose: () => void;
};
const FloatingActionsButton = ({
actions,
approvals,
selectedRowIds,
onClose,
}: FloatingActionsButtonProps) => {
const { permissionCheck } = useAuth();
// Jika tidak ada baris yang dipilih, jangan tampilkan FAB
const positionStyles =
selectedRowIds.length > 0
? 'bottom-[5%] opacity-100'
: 'bottom-[-5%] opacity-0';
// Helper untuk menentukan gaya warna tombol approval
const getApprovalColor = (action: 'APPROVED' | 'REJECTED') => {
if (action === 'APPROVED') return 'success';
if (action === 'REJECTED') return 'error';
return 'primary';
};
const getActionColor = (action: 'DETAIL' | 'EDIT' | 'DELETE') => {
if (action === 'DETAIL') return 'white';
if (action === 'EDIT') return 'warning';
if (action === 'DELETE') return 'error';
return 'primary';
};
return (
// Container utama FAB
<div
className={cn(
`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',
'bg-slate-950 backdrop-blur-md'
)}
>
<div className='flex flex-col gap-3'>
{/* === BARIS ATAS: Status Seleksi dan Actions (Termasuk Close) === */}
<div className='flex justify-between items-center text-white'>
<h4 className='text-base font-semibold'>
{selectedRowIds.length} Selected
</h4>
<div className='flex flex-row gap-1 items-stretch'>
<div className='flex gap-4 items-center'>
{/* Render Aksi dari props.actions */}
{actions
.filter((action) => {
if (action.hidden) return false;
if (action.permissions) {
if (typeof action.permissions === 'string') {
return permissionCheck(action.permissions);
}
return action.permissions.some((permission) =>
permissionCheck(permission)
);
}
return true;
})
.map((action, index) => {
return (
<Button
key={index}
onClick={action.onClick}
className='text-white hover:text-gray-400 tooltip tooltip-bottom p-0'
variant='link'
disabled={action.disabled}
>
<Tooltip content={action.label || action.action}>
<Icon
icon={action.icon}
width={20}
height={20}
className={`text-${getActionColor(action.action)} font-thin`}
/>
</Tooltip>
</Button>
);
})}
<div className='border-[0.5px] border-white/30 h-full'></div>
{/* Tombol Close */}
<Button
onClick={onClose}
className='text-white hover:text-gray-400 p-0'
variant='link'
>
<Tooltip content='Close'>
<Icon icon='mdi:close' width={20} height={20} />
</Tooltip>
</Button>
</div>
</div>
</div>
{/* === BARIS BAWAH: Approval Buttons (Approve/Reject) === */}
<div className={`grid grid-cols-${approvals.length} gap-3`}>
{approvals
.filter((approval) => {
if (approval.permissions) {
if (typeof approval.permissions === 'string') {
return permissionCheck(approval.permissions);
}
return approval.permissions.some((permission) =>
permissionCheck(permission)
);
}
return true;
})
.map((approval, index) => (
<Button
key={index}
onClick={approval.onClick}
className={cn(
'btn btn-lg w-full',
'bg-white/20 border-white/30',
'text-white/50 font-semibold flex items-center gap-2 rounded-lg transition-all duration-200',
approval.disabled
? 'cursor-not-allowed'
: 'hover:text-white/100 hover:bg-white/40 hover:border-white/50'
)}
disabled={approval.disabled}
>
<Icon
icon={approval.icon}
width={20}
height={20}
className={`text-${getApprovalColor(approval.action)}`}
/>
{approval.label || approval.action}
</Button>
))}
</div>
</div>
</div>
);
};
export default FloatingActionsButton;
+21 -147
View File
@@ -1,161 +1,24 @@
'use client';
import { useCallback, useState } from 'react';
import { useCallback } from 'react';
import { usePathname } from 'next/navigation';
import Image from 'next/image';
import { Icon } from '@iconify/react';
import Drawer from '@/components/Drawer';
import Menu from '@/components/menu/Menu';
import MenuItem from '@/components/menu/MenuItem';
import Navbar from '@/components/Navbar';
import Collapse from '@/components/Collapse';
import Button from '@/components/Button';
import SidebarMenu from '@/components/molecules/SidebarMenu';
import PermissionNotFound from '@/components/helper/PermissionNotFound';
import { useUiStore } from '@/stores/ui/ui.store';
import { MAIN_DRAWER_LINKS } from '@/config/constant';
import { cn } from '@/lib/helper';
type CollapseMenuProps = {
title: string;
link: string;
icon: string;
submenu?: CollapseMenuProps[];
depth?: number;
};
const isPathActive = (pathname: string, link?: string) => {
if (!link) return false;
const splittedPathname = pathname.split('/');
const splittedLink = link.split('/');
const isActiveLinkValid = splittedLink.every((linkChunk, idx) => {
return linkChunk === splittedPathname[idx];
});
return pathname.startsWith(link) && isActiveLinkValid;
};
const CollapseMenu = ({
title,
link,
icon,
submenu,
depth = 0,
}: CollapseMenuProps) => {
const pathname = usePathname();
const isActive = isPathActive(pathname, link);
const [open, setOpen] = useState(isActive);
const menuCollapseTitle = (
<div
className={cn(
'w-full px-3 py-2 rounded-md text-base font-semibold transition-colors flex flex-row justify-between items-center gap-2 hover:bg-primary/10 opacity-40',
{
'bg-primary/10 opacity-100': open || isActive,
}
)}
>
<div className='flex flex-row items-center gap-2'>
<Icon icon={icon} width={20} height={20} />
<span>{title}</span>
</div>
<Icon
icon='cuida:caret-up-outline'
width={20}
height={20}
className={cn('transition-transform', {
'rotate-90': !open,
'rotate-180': open,
})}
/>
</div>
);
return (
<Collapse
open={open}
title={menuCollapseTitle}
onOpenChange={setOpen}
className='w-full'
titleClassName='w-full p-0!'
>
<Menu>
<div
className='w-full py-0.5 flex flex-col gap-0.5'
style={{
paddingLeft: `${0.5 * (depth + 1)}rem`,
}}
>
{submenu?.map((item, idx) => {
const hasSubmenu = item.submenu && item.submenu.length > 0;
if (!hasSubmenu) {
return (
<MenuItem
key={idx}
title={item.title}
href={item.link}
icon={item.icon}
active={isPathActive(pathname, item.link)}
/>
);
}
return (
<CollapseMenu
key={idx}
title={item.title}
link={item.link}
icon={item.icon}
submenu={item.submenu}
depth={depth + 1}
/>
);
})}
</div>
</Menu>
</Collapse>
);
};
const MainDrawerMenu = () => {
const pathname = usePathname();
return (
<Menu>
{MAIN_DRAWER_LINKS.map((item, idx) => {
const hasSubmenu = item.submenu && item.submenu.length > 0;
if (!hasSubmenu) {
return (
<MenuItem
key={idx}
title={item.title}
href={item.link}
icon={item.icon}
active={pathname.startsWith(item.link)}
/>
);
}
return (
<CollapseMenu
key={idx}
title={item.title}
link={item.link}
icon={item.icon}
submenu={item.submenu}
/>
);
})}
</Menu>
);
};
import { isPathActive } from '@/lib/helper';
import { ROUTE_PERMISSIONS } from '@/config/route-permission';
import { useAuth } from '@/services/hooks/useAuth';
const MainDrawerContent = () => {
const pathname = usePathname();
const { setMainDrawerOpen } = useUiStore();
const closeMainDrawerHandler = () => {
@@ -191,7 +54,7 @@ const MainDrawerContent = () => {
</div>
</div>
<MainDrawerMenu />
<SidebarMenu menu={MAIN_DRAWER_LINKS} activeLink={pathname} />
</div>
);
};
@@ -202,6 +65,13 @@ const MainDrawer = ({
}>) => {
const { mainDrawerOpen, setMainDrawerOpen } = useUiStore();
const pathname = usePathname();
const { permissionCheck } = useAuth();
const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`;
const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) =>
permissionCheck(permission)
);
const getPageTitle = useCallback(() => {
let title = '';
@@ -216,9 +86,9 @@ const MainDrawer = ({
const hasSubmenu = menu?.submenu && menu?.submenu.length > 0;
if (!title) {
title += menu?.title;
title += menu?.text;
} else {
title += ' - ' + menu?.title;
title += ' - ' + menu?.text;
}
if (!hasSubmenu || !menu.submenu) return;
@@ -241,6 +111,10 @@ const MainDrawer = ({
setMainDrawerOpen(!mainDrawerOpen);
};
if (!isPermitted) {
return <PermissionNotFound />;
}
return (
<Drawer
open={mainDrawerOpen}
+14 -10
View File
@@ -7,6 +7,7 @@ import { Icon } from '@iconify/react';
import Menu from '@/components/menu/Menu';
import MenuItem from '@/components/menu/MenuItem';
import Button from '@/components/Button';
import Dropdown from '@/components/Dropdown';
import { useAuth } from '@/services/hooks/useAuth';
import { AuthApi } from '@/services/api/auth';
@@ -52,21 +53,24 @@ const Navbar = ({ title, toggleSidebar }: NavbarProps) => {
</div>
<div className='flex gap-2'>
<div className='dropdown dropdown-end'>
<div
tabIndex={0}
role='button'
className='btn btn-ghost btn-circle avatar'
>
<div className='w-10 rounded-full border grid place-items-center'>
<Dropdown
align='end'
direction='bottom'
trigger={
<div className='btn btn-ghost btn-circle avatar'>
<div className='w-10 rounded-full border flex justify-center items-center'>
<Icon icon='uil:user' width={40} height={40} />
</div>
</div>
<Menu className='dropdown-content w-52 mt-3 p-2 bg-base-100 shadow rounded-box menu-sm'>
}
className={{
content: 'w-52 mt-3',
}}
>
<Menu>
<MenuItem title='Logout' onClick={logoutClickHandler} />
</Menu>
</div>
</Dropdown>
</div>
</div>
);
+167 -77
View File
@@ -1,7 +1,9 @@
'use client';
import { ReactNode } from 'react';
import { ChangeEventHandler, ReactNode } from 'react';
import { Icon } from '@iconify/react';
import Button from '@/components/Button';
import { cn } from '@/lib/helper';
@@ -17,16 +19,18 @@ const PaginationButton = ({
disabled?: boolean;
onClick?: () => void;
}) => (
<button
className={cn(
'join-item btn btn-ghost p-2.5 rounded-lg text-sm font-medium text-gray-500 aspect-square',
'disabled:text-gray-700 disabled:pointer-events-auto! disabled:cursor-not-allowed! disabled:bg-gray-50 disabled:active:translate-y-0'
)}
<Button
variant='ghost'
color='none'
disabled={disabled}
onClick={onClick}
className={cn(
'join-item w-10 h-10 grid place-items-center p-2.5 rounded-lg! text-sm font-semibold text-base-content/50 aspect-square',
'disabled:text-primary disabled:pointer-events-auto! disabled:cursor-not-allowed! disabled:bg-primary/10 disabled:active:translate-y-0'
)}
>
{content}
</button>
</Button>
);
const EtcPaginationButton = ({
@@ -48,7 +52,7 @@ const EtcPaginationButton = ({
tabIndex={0}
role='button'
className={cn(
'join-item btn btn-ghost p-2.5 rounded-lg text-sm font-medium text-gray-500 aspect-square'
'join-item btn btn-ghost p-2.5 rounded-lg! text-sm font-medium text-gray-500 aspect-square'
)}
>
...
@@ -57,7 +61,7 @@ const EtcPaginationButton = ({
<div className='dropdown-content'>
<ul
tabIndex={0}
className='menu bg-base-100 rounded-lg z-1 w-fit min-w-max max-h-64 p-1 shadow-sm mb-2 overflow-y-auto flex-nowrap'
className='menu bg-base-100 rounded-lg! z-1 w-fit min-w-max max-h-64 p-1 shadow-sm mb-2 overflow-y-auto flex-nowrap'
>
{pages.map((pageNumber) => (
<li key={pageNumber}>
@@ -76,7 +80,7 @@ const EtcPaginationButton = ({
<button
disabled
className={cn(
'join-item btn btn-ghost p-2.5 rounded-lg text-sm font-medium text-gray-500 aspect-square'
'join-item btn btn-ghost p-2.5 rounded-lg! text-sm font-medium text-gray-500 aspect-square'
)}
>
...
@@ -90,16 +94,20 @@ const Pagination = ({
currentPage = 1,
totalItems = 0,
itemsPerPage = 10,
rowOptions = [10, 20, 50, 100],
onPageChange,
onPrevPage = () => {},
onNextPage = () => {},
onRowChange,
}: {
currentPage: number;
totalItems: number;
itemsPerPage: number;
rowOptions?: number[];
onPageChange: (pageNumber: number) => void;
onPrevPage: () => void;
onNextPage: () => void;
onRowChange?: (row: number) => void;
}) => {
const totalPages =
Math.ceil(totalItems / itemsPerPage) === 0
@@ -107,30 +115,139 @@ const Pagination = ({
: Math.ceil(totalItems / itemsPerPage);
const pageChangeHandler = (pageNumber: number) => onPageChange(pageNumber);
const firstPageClickHandler = () => onPageChange(1);
const lastPageClickHandler = () => onPageChange(totalPages);
return (
<div>
<div className='join w-full justify-between items-center gap-3'>
<button
const rowChangeHandler: ChangeEventHandler<HTMLSelectElement> = (e) => {
onRowChange?.(Number(e.target.value));
};
const DisplayedRowCountSelect = () => (
<div className='flex flex-row items-center gap-4'>
<span className='text-sm font-medium text-base-content/50'>Showing</span>
<select
defaultValue={itemsPerPage}
onChange={rowChangeHandler}
className='select select-xs w-fit pl-3 pr-7 text-base-content/50'
>
{rowOptions.map((rowOption, rowOptionIdx) => (
<option
key={rowOptionIdx}
value={rowOption}
className='text-base-content active:text-neutral-content'
>
{rowOption} Per page
</option>
))}
</select>
</div>
);
const GoToFirstPageButton = () => (
<Button
disabled={currentPage === 1}
onClick={onPrevPage}
onClick={firstPageClickHandler}
variant='ghost'
color='none'
className={cn(
'join-item btn btn-outline group px-3 py-2 text-sm font-semibold rounded-lg border border-gray-300 shadow-xs hidden sm:flex justify-center items-center gap-1.5',
'disabled:bg-[initial]! disabled:text-gray-400 disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
'join-item w-10 h-10 grid place-items-center p-2.5 rounded-lg! text-sm font-semibold text-base-content/50 aspect-square',
'disabled:bg-[initial]! disabled:text-base-content disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
<Icon
icon='uil:arrow-left'
icon='heroicons:chevron-double-left'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>{' '}
Previous
</button>
/>
</Button>
);
{totalPages <= 7 && (
<div className='join-item join gap-0.5'>
{range(1, totalPages).map((pageNumber) => (
const PrevPageButton = () => (
<Button
disabled={currentPage === 1}
onClick={onPrevPage}
variant='ghost'
color='none'
className={cn(
'join-item w-10 h-10 grid place-items-center p-2.5 rounded-lg! text-sm font-semibold text-base-content/50 aspect-square',
'disabled:bg-[initial]! disabled:text-base-content disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
<Icon
icon='heroicons:chevron-left'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>
</Button>
);
const GoToLastPageButton = () => (
<Button
variant='ghost'
color='none'
disabled={currentPage === totalPages}
onClick={lastPageClickHandler}
className={cn(
'join-item w-10 h-10 grid place-items-center p-2.5 rounded-lg! text-sm font-semibold text-base-content/50 aspect-square',
'disabled:bg-[initial]! disabled:text-base-content disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
<Icon
icon='heroicons:chevron-double-right'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>
</Button>
);
const NextPageButton = () => (
<Button
variant='ghost'
color='none'
disabled={currentPage === totalPages}
onClick={onNextPage}
className={cn(
'join-item w-10 h-10 grid place-items-center p-2.5 rounded-lg! text-sm font-semibold text-base-content/50 aspect-square',
'disabled:bg-[initial]! disabled:text-base-content disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
<Icon
icon='heroicons:chevron-right'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>
</Button>
);
const PageInfo = () => (
<span className='text-nowrap text-sm font-medium text-base-content/50'>
Page {currentPage} of {totalPages}
</span>
);
return (
<div className='@container'>
<div className='flex flex-row justify-center items-center'>
<div className='hidden @md:block'>
<DisplayedRowCountSelect />
</div>
<div className='join w-full justify-end @md:justify-center items-center gap-0.5'>
<div className='hidden @md:block'>
<GoToFirstPageButton />
</div>
<div className='hidden @md:block'>
<PrevPageButton />
</div>
{totalPages <= 7 &&
range(1, totalPages).map((pageNumber) => (
<PaginationButton
key={pageNumber}
content={pageNumber}
@@ -138,11 +255,9 @@ const Pagination = ({
onClick={() => pageChangeHandler(pageNumber)}
/>
))}
</div>
)}
{totalPages > 7 && (
<div className='join-item join gap-0.5'>
<>
<PaginationButton
content={1}
disabled={currentPage === 1}
@@ -272,61 +387,36 @@ const Pagination = ({
onClick={() => pageChangeHandler(totalPages)}
/>
)}
</div>
</>
)}
<button
disabled={currentPage === totalPages}
onClick={onNextPage}
className={cn(
'join-item btn btn-outline group px-3 py-2 text-sm font-semibold rounded-lg border border-gray-300 shadow-xs hidden sm:flex justify-center items-center gap-1.5',
'disabled:bg-[initial]! disabled:text-gray-400 disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
Next{' '}
<Icon
icon='uil:arrow-right'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>
</button>
<div className='hidden @md:block'>
<NextPageButton />
</div>
<div className='flex gap-2 mt-2 sm:hidden'>
<button
disabled={currentPage === 1}
onClick={onPrevPage}
className={cn(
'join-item btn btn-outline group px-3 py-2 text-sm font-semibold rounded-lg border border-gray-300 shadow-xs flex justify-center items-center gap-1.5',
'disabled:bg-[initial]! disabled:text-gray-400 disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
<Icon
icon='uil:arrow-left'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>{' '}
Previous
</button>
<div className='hidden @md:block'>
<GoToLastPageButton />
</div>
</div>
<button
disabled={currentPage === totalPages}
onClick={onNextPage}
className={cn(
'join-item btn btn-outline group px-3 py-2 text-sm font-semibold rounded-lg border border-gray-300 shadow-xs flex justify-center items-center gap-1.5',
'disabled:bg-[initial]! disabled:text-gray-400 disabled:pointer-events-auto! disabled:cursor-not-allowed disabled:active:translate-y-0'
)}
>
Next{' '}
<Icon
icon='uil:arrow-right'
width={20}
height={20}
className='text-gray-400 group-disabled:text-gray-300'
/>
</button>
<div className='hidden @md:block'>
<PageInfo />
</div>
</div>
<div className='flex @md:hidden flex-col justify-center items-end gap-2'>
<div className='flex flex-row items-center gap-0.5'>
<GoToFirstPageButton />
<PrevPageButton />
<NextPageButton />
<GoToLastPageButton />
</div>
<div className='flex flex-row items-center gap-4'>
<DisplayedRowCountSelect />
<PageInfo />
</div>
</div>
</div>
);
+139 -35
View File
@@ -14,6 +14,7 @@ import {
SortingState,
OnChangeFn,
Row,
HeaderContext,
} from '@tanstack/react-table';
import { rankItem } from '@tanstack/match-sorter-utils';
import { Icon } from '@iconify/react';
@@ -31,6 +32,9 @@ interface TableClassNames {
tableBodyClassName?: string;
bodyRowClassName?: string;
bodyColumnClassName?: string;
tableFooterClassName?: string;
footerRowClassName?: string;
footerColumnClassName?: string;
paginationClassName?: string;
}
@@ -38,6 +42,7 @@ export interface TableProps<TData extends object> {
data: TData[];
columns: ColumnDef<TData, unknown>[];
pageSize?: number;
onPageSizeChange?: (pageSize: number) => void;
totalItems?: number;
page?: number;
onPageChange?: (page: number) => void;
@@ -52,6 +57,15 @@ export interface TableProps<TData extends object> {
rowSelection?: Record<string, boolean>;
setRowSelection?: OnChangeFn<Record<string, boolean>>;
enableRowSelection?: boolean | ((row: Row<TData>) => boolean);
renderFooter?: boolean;
withCheckbox?: boolean;
rowOptions?: number[];
/**
* Custom row renderer. Should return a complete <tr> element or null.
* This gives full control over the row structure including colspan.
* Return null to render the default row.
*/
renderCustomRow?: (row: Row<TData>) => ReactNode | null;
}
const DUMMY_SKELETON_DATA = [{}, {}, {}, {}, {}];
@@ -64,28 +78,36 @@ const emptyContentDefaultValue = (
</div>
);
export const TABLE_DEFAULT_STYLING = {
containerClassName: 'w-full mb-20',
tableWrapperClassName:
'overflow-x-auto border border-solid border-base-content/10 rounded-lg',
tableClassName: 'font-inter w-full table-auto text-sm font-medium',
tableHeaderClassName: '',
headerRowClassName: '',
headerColumnClassName:
'px-4 py-3 border-base-content/10 text-base-content/50',
tableBodyClassName: '',
bodyRowClassName: 'border-t border-base-content/10',
bodyColumnClassName: 'px-4 py-3 text-base-content',
paginationClassName: '',
tableFooterClassName: 'font-semibold border-base-content/10',
footerRowClassName: 'bg-base-200 border-t-2 border-base-content/10',
footerColumnClassName: 'p-4 text-base-content whitespace-nowrap',
};
const Table = <TData extends object>({
data = [],
columns = [],
pageSize = 10,
onPageSizeChange,
totalItems,
page,
onPageChange,
isLoading = false,
fuzzySearchValue,
onFuzzySearchValueChange,
className = {
containerClassName: '',
tableWrapperClassName: '',
tableClassName: '',
tableHeaderClassName: '',
headerRowClassName: '',
headerColumnClassName: '',
tableBodyClassName: '',
bodyRowClassName: '',
bodyColumnClassName: '',
paginationClassName: '',
},
className = TABLE_DEFAULT_STYLING,
emptyContent = emptyContentDefaultValue,
sorting,
setSorting,
@@ -93,12 +115,21 @@ const Table = <TData extends object>({
rowSelection,
setRowSelection,
enableRowSelection,
renderFooter = false,
withCheckbox = false,
rowOptions = [10, 20, 50, 100],
renderCustomRow,
}: TableProps<TData>) => {
const isServerSideTable =
totalItems !== undefined &&
page !== undefined &&
onPageChange !== undefined;
const tableClassNames = {
...TABLE_DEFAULT_STYLING,
...className,
};
const [pagination, setPagination] = useState({
pageIndex: 0,
pageSize: pageSize,
@@ -191,37 +222,67 @@ const Table = <TData extends object>({
}, [pageSize, setPageSize]);
return (
<div className={className.containerClassName}>
<div className={className.tableWrapperClassName}>
<table className={className.tableClassName}>
<thead className={className.tableHeaderClassName}>
<div className={tableClassNames.containerClassName}>
<div className={tableClassNames.tableWrapperClassName}>
<table className={tableClassNames.tableClassName}>
<thead className={tableClassNames.tableHeaderClassName}>
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id} className={className.headerRowClassName}>
{headerGroup.headers.map((header) => (
<tr
key={headerGroup.id}
className={tableClassNames.headerRowClassName}
>
{headerGroup.headers.map((header) => {
const columnRelativeDepth =
header.depth - header.column.depth;
if (
!header.isPlaceholder &&
columnRelativeDepth > 1 &&
header.id === header.column.id
) {
return null;
}
let rowSpan = 1;
if (header.isPlaceholder) {
const leafs = header.getLeafHeaders();
rowSpan = leafs[leafs.length - 1].depth - header.depth;
}
return (
<th
key={header.id}
colSpan={header.colSpan}
rowSpan={rowSpan}
onClick={header.column.getToggleSortingHandler()}
className={cn(
header.column.getCanSort()
? 'cursor-pointer select-none'
: '',
className.headerColumnClassName
{
'first:w-9 first:pr-0': withCheckbox,
},
{
'border-b': header.colSpan > 1,
},
tableClassNames.headerColumnClassName
)}
>
<div className='flex items-center gap-1'>
<div
className={cn('flex items-center gap-1 min-h-full', {
'justify-center': header.colSpan > 1,
})}
>
{flexRender(
header.column.columnDef.header,
header.getContext()
)}
{header.column.getCanSort() && (
<div className='flex items-center'>
<div className='w-4 h-4 relative flex flex-col items-center'>
<Icon
icon='lucide:arrow-up'
width={12}
height={12}
icon='heroicons:chevron-up-16-solid'
width={18}
height={18}
className={cn(
'absolute -top-1',
'transition-all ease-in-out duration-200',
header.column.getIsSorted() === 'asc'
? 'text-black'
@@ -229,10 +290,11 @@ const Table = <TData extends object>({
)}
/>
<Icon
icon='lucide:arrow-down'
width={12}
height={12}
icon='heroicons:chevron-down-16-solid'
width={18}
height={18}
className={cn(
'absolute -bottom-1.5',
'transition-all ease-in-out duration-200',
header.column.getIsSorted() === 'desc'
? 'text-black'
@@ -243,25 +305,65 @@ const Table = <TData extends object>({
)}
</div>
</th>
))}
);
})}
</tr>
))}
</thead>
<tbody className={className.tableBodyClassName}>
{table.getRowModel().rows.map((row) => (
<tr key={row.id} className={className.bodyRowClassName}>
<tbody className={tableClassNames.tableBodyClassName}>
{table.getRowModel().rows.map((row) => {
const customRowContent = renderCustomRow?.(row);
if (customRowContent) {
return renderCustomRow?.(row);
}
return (
<tr key={row.id} className={tableClassNames.bodyRowClassName}>
{row.getVisibleCells().map((cell) => (
<td key={cell.id} className={className.bodyColumnClassName}>
<td
key={cell.id}
className={cn(
{ 'first:w-9 first:pr-0': withCheckbox },
tableClassNames.bodyColumnClassName
)}
>
{!isLoading &&
flexRender(cell.column.columnDef.cell, cell.getContext())}
flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
{isLoading && <div className='skeleton w-full h-4' />}
</td>
))}
</tr>
))}
);
})}
</tbody>
<tfoot className={cn(tableClassNames.tableFooterClassName)}>
{renderFooter && (
<tr className={cn(tableClassNames.footerRowClassName)}>
{table.getAllLeafColumns().map((column) => (
<td
key={column.id}
className={cn(
{ 'first:w-9 first:pr-0': withCheckbox },
tableClassNames.footerColumnClassName
)}
>
{column.columnDef.footer &&
flexRender(column.columnDef.footer, {
column,
header: column.columnDef,
table,
} as HeaderContext<TData, unknown>)}
</td>
))}
</tr>
)}
</tfoot>
</table>
</div>
@@ -270,7 +372,7 @@ const Table = <TData extends object>({
emptyContent}
{data.length > 0 && table.getRowModel().rows.length > 0 && !isLoading && (
<div className={cn('mt-5', className.paginationClassName)}>
<div className={cn('mt-5', tableClassNames.paginationClassName)}>
<Pagination
totalItems={isServerSideTable ? totalItems : table.getRowCount()}
itemsPerPage={table.getState().pagination.pageSize}
@@ -282,6 +384,8 @@ const Table = <TData extends object>({
onPrevPage={prevPageClickHandler}
onNextPage={nextPageClickHandler}
onPageChange={pageChangeHandler}
rowOptions={rowOptions}
onRowChange={onPageSizeChange}
/>
</div>
)}
+11 -4
View File
@@ -21,6 +21,7 @@ export interface TabsProps
className?:
| string
| {
container?: string;
wrapper?: string;
tab?: string;
content?: string;
@@ -53,8 +54,12 @@ const Tabs = ({
onTabChange?.(tabId);
};
const { wrapper: wrapperClassName, tab: tabClassName } =
typeof className === 'object'
const {
container: containerClassName,
wrapper: wrapperClassName,
tab: tabClassName,
content: contentClassName,
} = typeof className === 'object'
? className
: { wrapper: className, tab: undefined };
@@ -104,7 +109,7 @@ const Tabs = ({
{...props}
className={cn(
'w-full',
typeof className === 'string' ? className : undefined
typeof className === 'string' ? className : containerClassName
)}
>
<div role='tablist' className={getTabsClasses()}>
@@ -121,7 +126,9 @@ const Tabs = ({
))}
</div>
{activeContent && <div className='mt-4'>{activeContent}</div>}
{activeContent && (
<div className={cn('mt-4', contentClassName)}>{activeContent}</div>
)}
</div>
);
};
+114
View File
@@ -0,0 +1,114 @@
import React, { ReactNode, useState, useRef } from 'react';
import { cn } from '@/lib/helper';
export interface DropdownProps {
trigger: ReactNode;
children: ReactNode;
className?: {
wrapper?: string;
trigger?: string;
content?: string;
};
align?: 'start' | 'center' | 'end';
direction?: 'top' | 'bottom' | 'left' | 'right';
hover?: boolean;
defaultOpen?: boolean;
open?: boolean;
close?: boolean;
controlled?: boolean;
}
const Dropdown = ({
trigger,
children,
className,
align,
direction,
hover,
defaultOpen = false,
open,
close,
controlled = false,
}: DropdownProps) => {
const [isOpen, setIsOpen] = useState(defaultOpen);
const dropdownRef = useRef<HTMLDivElement>(null);
const toggleDropdown = () => {
if (!controlled) {
const newState = !isOpen;
setIsOpen(newState);
}
};
const getWrapperClasses = () => {
const openState = controlled ? open : isOpen;
return cn(
'dropdown',
{
'dropdown-start': align === 'start',
'dropdown-center': align === 'center',
'dropdown-end': align === 'end',
'dropdown-top': direction === 'top',
'dropdown-bottom': direction === 'bottom',
'dropdown-left': direction === 'left',
'dropdown-right': direction === 'right',
'dropdown-hover': hover,
'dropdown-open': openState && !close,
'dropdown-close': close,
},
className?.wrapper
);
};
const getTriggerClasses = () => {
return cn(className?.trigger);
};
const getContentClasses = () => {
return cn(
'dropdown-content z-[9999] shadow-sm bg-base-100 rounded-box',
className?.content
);
};
if (controlled) {
return (
<div className={getWrapperClasses()}>
{trigger}
{open && !close && (
<div tabIndex={-1} className={getContentClasses()}>
{children}
</div>
)}
</div>
);
}
return (
<div ref={dropdownRef} className={getWrapperClasses()}>
<div
tabIndex={0}
role='button'
className={getTriggerClasses()}
onClick={toggleDropdown}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
toggleDropdown();
}
}}
>
{trigger}
</div>
{!close && (
<div tabIndex={-1} className={getContentClasses()}>
{children}
</div>
)}
</div>
);
};
export default Dropdown;
@@ -0,0 +1,12 @@
const PermissionNotFound = () => {
return (
<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>
<p className='text-gray-600 text-center'>
You do not have permission to access this page.
</p>
</div>
);
};
export default PermissionNotFound;
+65 -22
View File
@@ -1,56 +1,84 @@
'use client';
import { ReactNode, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import useSWRImmutable from 'swr/immutable';
import useSWR from 'swr';
import { useAuth } from '@/services/hooks/useAuth';
import { httpClientFetcher, SWRHttpKey } from '@/services/http/client';
import { AuthApi } from '@/services/api/auth';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { BaseApiResponse, GetMeResponse } from '@/types/api/api-general';
import { AxiosError } from 'axios';
import { redirectToSSO } from '@/lib/auth-helper';
interface RequireAuthProps {
children?: ReactNode;
}
const RequireAuth = ({ children }: RequireAuthProps) => {
const router = useRouter();
const { setUser, setIsLoadingUser } = useAuth();
const { user, setUser, setIsLoadingUser } = useAuth();
const {
data: userResponse,
isLoading: isLoadingUserResponse,
error: userErrorResponse,
} = useSWRImmutable<
} = useSWR<
GetMeResponse & { ok?: boolean },
AxiosError<BaseApiResponse>,
SWRHttpKey
>('/sso/userinfo', httpClientFetcher, {
shouldRetryOnError: false,
revalidateOnFocus: false,
revalidateOnReconnect: false,
refreshInterval: 0,
});
useEffect(() => {
setIsLoadingUser(isLoadingUserResponse);
}, [isLoadingUserResponse, setIsLoadingUser]);
// refresh every 12 minutes
refreshInterval: 12 * 60 * 1000,
});
useEffect(() => {
if (isResponseSuccess(userResponse)) {
setUser(userResponse.data);
} else if (
isResponseError(userErrorResponse?.response?.data) &&
typeof window !== 'undefined'
) {
router.replace(
`${process.env.NEXT_PUBLIC_SSO_LOGIN_URL as string}?redirect_url=${window.location.href}`
);
}
}, [userResponse, userErrorResponse, setIsLoadingUser, setUser]);
}, [userResponse, setUser]);
if (isLoadingUserResponse && !userResponse && !userErrorResponse) {
// Explicitly handle 401 redirect from the component level
useEffect(() => {
if (
isResponseError(userResponse) &&
userErrorResponse?.response?.status === 401
) {
// Clear cache to prevent stale data from rendering children
// mutate('/sso/userinfo', undefined, { revalidate: false }); // Optional: if using global mutate
setUser(undefined);
redirectToSSO();
}
}, [userErrorResponse, setUser, userResponse]);
useEffect(() => {
setIsLoadingUser(isLoadingUserResponse);
}, [isLoadingUserResponse]);
useEffect(() => {
const interval = setInterval(
async () => {
await AuthApi.refresh();
},
12 * 60 * 1000
);
return () => clearInterval(interval);
}, []);
useEffect(() => {
const refreshUserSession = async () => {
await AuthApi.refresh();
};
refreshUserSession();
}, []);
if (
(isLoadingUserResponse && !userResponse && !userErrorResponse) ||
(!userResponse && !userErrorResponse)
) {
return (
<div className='w-full flex flex-row justify-center items-center p-4'>
<span className='loading loading-spinner loading-xl' />
@@ -58,7 +86,22 @@ const RequireAuth = ({ children }: RequireAuthProps) => {
);
}
return <>{isResponseSuccess(userResponse) && children}</>;
if (!isLoadingUserResponse && userErrorResponse) {
return (
<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>
<p className='text-gray-600'>
Please try refreshing the page or contact support if the problem
persists.
</p>
<button className='btn btn-primary' onClick={() => redirectToSSO()}>
Retry
</button>
</div>
);
}
return <>{isResponseSuccess(userResponse) && user && children}</>;
};
export default RequireAuth;
@@ -0,0 +1,28 @@
'use client';
import { useAuth } from '@/services/hooks/useAuth';
interface RequirePermissionProps {
children: React.ReactNode;
permissions: string | string[];
}
const RequirePermission = ({
children,
permissions,
}: RequirePermissionProps) => {
const { permissionCheck } = useAuth();
const isPermitted =
typeof permissions === 'string'
? permissionCheck(permissions)
: permissions.some((permission) => permissionCheck(permission));
if (!isPermitted) {
return null;
}
return <>{children}</>;
};
export default RequirePermission;
@@ -0,0 +1,104 @@
'use client';
import { Icon } from '@iconify/react';
import Link from 'next/link';
import { ReactNode } from 'react';
import { cn } from '@/lib/helper';
export interface DrawerHeaderProps {
// Left side props
leftIcon?: string;
leftIconSize?: number;
leftIconHref?: string;
leftIconOnClick?: () => void;
leftIconClassName?: string;
// Subtitle/label props
subtitle?: string | ReactNode;
subtitleClassName?: string;
// Right side actions (children)
children?: ReactNode;
// Container props
className?: string;
showDivider?: boolean;
}
const DrawerHeader = ({
leftIcon = 'mdi:close',
leftIconSize = 24,
leftIconHref,
leftIconOnClick,
leftIconClassName,
subtitle,
subtitleClassName,
children,
className,
showDivider = true,
}: DrawerHeaderProps) => {
const renderLeftIcon = () => {
const iconElement = (
<Icon
icon={leftIcon}
width={leftIconSize}
height={leftIconSize}
className={cn('cursor-pointer', leftIconClassName)}
/>
);
if (leftIconHref) {
return (
<Link href={leftIconHref} className='hover:text-gray-400'>
{iconElement}
</Link>
);
}
if (leftIconOnClick) {
return (
<button
onClick={leftIconOnClick}
className='hover:text-gray-400 bg-transparent border-none p-0'
>
{iconElement}
</button>
);
}
return iconElement;
};
return (
<div
className={cn(
'flex flex-row justify-between items-center px-4 pt-4',
className
)}
>
{/* Left Side */}
<div className='flex flex-row h-full gap-2 items-center'>
{renderLeftIcon()}
{showDivider && subtitle && (
<div className='divider divider-horizontal p-0 m-0'></div>
)}
{subtitle && (
<div className={cn('text-sm text-neutral', subtitleClassName)}>
{subtitle}
</div>
)}
</div>
{/* Right Side Actions */}
{children && (
<div className='flex flex-row gap-3 justify-end items-center'>
{children}
</div>
)}
</div>
);
};
export default DrawerHeader;
+49
View File
@@ -0,0 +1,49 @@
import Alert from '@/components/Alert';
import Button from '@/components/Button';
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,
onClose,
}: {
formErrorList: string[];
onClose: () => void;
}) => {
if (formErrorList.length === 0) return null;
return (
<Alert color='error' className='w-full flex flex-col gap-2 px-4 m-4'>
<div className='flex justify-between items-center gap-2 w-full'>
<div className='flex items-center gap-2'>
<Icon icon='material-symbols:error-outline' width={24} height={24} />
<span className='font-semibold'>
Terdapat {formErrorList.length} error pada form:
</span>
</div>
<Button
onClick={onClose}
variant='link'
className='ml-auto p-0 w-fit text-white'
color='none'
>
<Icon icon='material-symbols:close' width={24} height={24} />
</Button>
</div>
<ul className='list-disc list-inside pl-8 space-y-1 w-full'>
{formErrorList.map((error, index) => (
<li key={index} className='text-sm'>
{error}
</li>
))}
</ul>
</Alert>
);
};
export default AlertErrorList;
+13 -2
View File
@@ -2,8 +2,9 @@
import { HTMLProps, useEffect, useRef } from 'react';
import { cn } from '@/lib/helper';
import { Size } from '@/types/theme';
interface CheckboxInputProps extends HTMLProps<HTMLInputElement> {
interface CheckboxInputProps extends Omit<HTMLProps<HTMLInputElement>, 'size'> {
name: string;
label?: string;
indeterminate?: boolean;
@@ -16,6 +17,7 @@ interface CheckboxInputProps extends HTMLProps<HTMLInputElement> {
isError?: boolean;
isValid?: boolean;
errorMessage?: string;
size?: Size;
}
const CheckboxInput = ({
@@ -27,10 +29,19 @@ const CheckboxInput = ({
isValid,
isError,
errorMessage,
size = 'sm',
...rest
}: CheckboxInputProps) => {
const ref = useRef<HTMLInputElement>(null!);
const checkboxBaseClassName = cn('checkbox cursor-pointer rounded-md', {
'checkbox-xs': size === 'xs',
'checkbox-sm': size === 'sm',
'checkbox-md': size === 'md',
'checkbox-lg': size === 'lg',
'checkbox-xl': size === 'xl',
});
useEffect(() => {
if (typeof indeterminate === 'boolean') {
ref.current.indeterminate = !rest.checked && indeterminate;
@@ -53,7 +64,7 @@ const CheckboxInput = ({
id={name}
name={name}
className={cn(
'checkbox cursor-pointer',
checkboxBaseClassName,
{
'border-error': isError,
'border-success': isValid,
+2 -2
View File
@@ -7,11 +7,11 @@ import {
useState,
} from 'react';
import { cn, formatDate } from '@/lib/helper';
import Modal, { useModal } from '../Modal';
import { DateRange, DayPicker, Matcher } from 'react-day-picker';
import 'react-day-picker/dist/style.css';
import Button from '../Button';
import { Icon } from '@iconify/react';
import Modal, { useModal } from '@/components/Modal';
import Button from '@/components/Button';
export interface DateInputProps {
label?: string;
@@ -24,6 +24,11 @@ const DebouncedTextInput = (props: DebouncedTextInputProps) => {
setInternalChangeEvent(e);
};
// Sync internal value with external value prop changes (e.g., from reset)
useEffect(() => {
setInternalValue(props.value);
}, [props.value]);
useEffect(() => {
if (debouncedChangeEvent) {
onChange?.(debouncedChangeEvent);
+8
View File
@@ -33,6 +33,7 @@ const FileInput = ({
isError,
errorMessage,
disabled = false,
required = false,
onChange,
onBlur,
readOnly = false,
@@ -56,6 +57,13 @@ const FileInput = ({
)}
>
{label}
{required && (
<>
<span className='tooltip tooltip-error' data-tip='required'>
<span className='text-error'> *</span>
</span>
</>
)}
</label>
)}
+138 -39
View File
@@ -1,6 +1,11 @@
'use client';
import { ChangeEventHandler, ReactNode } from 'react';
import {
ChangeEventHandler,
ReactNode,
createContext,
useContext,
} from 'react';
import { cn } from '@/lib/helper';
export interface RadioOption {
@@ -8,37 +13,74 @@ export interface RadioOption {
value: string;
}
export interface RadioInputProps {
label?: string;
bottomLabel?: string;
// DaisyUI Radio Colors
export type RadioColor =
| 'neutral'
| 'primary'
| 'secondary'
| 'accent'
| 'success'
| 'warning'
| 'info'
| 'error';
// DaisyUI Radio Sizes
export type RadioSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
// Context untuk RadioGroup
interface RadioGroupContextValue {
name: string;
value?: string;
options: RadioOption[];
variant?: string;
className?: {
wrapper?: string;
label?: string;
radioWrapper?: string;
radio?: string;
};
isError?: boolean;
isValid?: boolean;
errorMessage?: string;
required?: boolean;
color?: RadioColor;
size?: RadioSize;
disabled?: boolean;
startAdornment?: ReactNode;
endAdornment?: ReactNode;
onChange?: ChangeEventHandler<HTMLInputElement>;
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
}
const RadioInput = ({
const RadioGroupContext = createContext<RadioGroupContextValue | undefined>(
undefined
);
const useRadioGroup = () => {
const context = useContext(RadioGroupContext);
if (!context) {
throw new Error('RadioGroupItem must be used within RadioGroup');
}
return context;
};
// RadioGroup Component
export interface RadioGroupProps {
label?: string;
bottomLabel?: string;
name: string;
value?: string;
options?: RadioOption[];
color?: RadioColor;
size?: RadioSize;
className?: {
wrapper?: string;
label?: string;
radioWrapper?: string;
};
isError?: boolean;
errorMessage?: string;
required?: boolean;
disabled?: boolean;
onChange?: ChangeEventHandler<HTMLInputElement>;
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
children?: ReactNode;
}
export const RadioGroup = ({
label,
bottomLabel,
name,
value,
options,
variant = 'radio-primary',
color = 'primary',
size = 'md',
className,
isError,
errorMessage,
@@ -46,8 +88,20 @@ const RadioInput = ({
disabled = false,
onChange,
onBlur,
}: RadioInputProps) => {
children,
}: RadioGroupProps) => {
const contextValue: RadioGroupContextValue = {
name,
value,
color,
size,
disabled,
onChange,
onBlur,
};
return (
<RadioGroupContext.Provider value={contextValue}>
<div className={cn('w-full flex flex-col gap-2', className?.wrapper)}>
{/* Label atas */}
{label && (
@@ -74,27 +128,18 @@ const RadioInput = ({
className?.radioWrapper
)}
>
{options.map((option) => (
<label
{/* Jika options diberikan, render otomatis */}
{options &&
options.map((option) => (
<RadioGroupItem
key={option.value}
className={cn(
'flex flex-row items-center gap-2 cursor-pointer',
disabled && 'opacity-60 cursor-not-allowed'
)}
>
<input
type='radio'
name={name}
value={option.value}
checked={value === option.value}
onChange={onChange}
onBlur={onBlur}
disabled={disabled}
className={cn('radio', variant, className?.radio)}
label={option.label}
/>
<span className='text-sm'>{option.label}</span>
</label>
))}
{/* Atau gunakan children untuk custom rendering */}
{children}
</div>
{/* Label bawah */}
@@ -107,7 +152,61 @@ const RadioInput = ({
<p className='text-sm text-error'>{errorMessage}</p>
)}
</div>
</RadioGroupContext.Provider>
);
};
export default RadioInput;
// RadioGroupItem Component
export interface RadioGroupItemProps {
value: string;
label?: string;
className?: string;
disabled?: boolean;
color?: RadioColor;
size?: RadioSize;
}
export const RadioGroupItem = ({
value,
label,
className,
disabled: itemDisabled,
color: itemColor,
size: itemSize,
}: RadioGroupItemProps) => {
const {
name,
value: groupValue,
color: groupColor,
size: groupSize,
disabled: groupDisabled,
onChange,
onBlur,
} = useRadioGroup();
const isDisabled = itemDisabled ?? groupDisabled;
const radioColor = itemColor ?? groupColor;
const radioSize = itemSize ?? groupSize;
return (
<label
className={cn(
'flex flex-row items-center gap-2 cursor-pointer',
isDisabled && 'opacity-60 cursor-not-allowed',
className
)}
>
<input
type='radio'
name={name}
value={value}
checked={groupValue === value}
onChange={onChange}
onBlur={onBlur}
disabled={isDisabled}
className={cn('radio', `radio-${radioColor}`, `radio-${radioSize}`)}
/>
{label && <span className='text-sm'>{label}</span>}
</label>
);
};
+20 -4
View File
@@ -1,16 +1,32 @@
import { ReactNode } from 'react';
import { cn } from '@/lib/helper';
import { Size } from '@/types/theme';
interface MenuProps {
children?: ReactNode;
size?: Size;
direction?: 'vertical' | 'horizontal';
className?: string;
}
const Menu = ({ children, className }: MenuProps) => {
return (
<ul className={cn('menu w-full p-0 gap-0.5', className)}>{children}</ul>
);
const Menu = ({
children,
size = 'md',
direction = 'vertical',
className,
}: MenuProps) => {
const menuBaseClassName = cn('menu w-full', {
'menu-xs': size === 'xs',
'menu-sm': size === 'sm',
'menu-md': size === 'md',
'menu-lg': size === 'lg',
'menu-xl': size === 'xl',
'menu-vertical': direction === 'vertical',
'menu-horizontal': direction === 'horizontal',
});
return <ul className={cn(menuBaseClassName, className)}>{children}</ul>;
};
export default Menu;
+15 -2
View File
@@ -8,6 +8,7 @@ interface MenuItemProps {
href?: string;
icon?: string;
active?: boolean;
isLoading?: boolean;
onClick?: () => void;
className?: string;
}
@@ -17,6 +18,7 @@ const MenuItem = ({
href,
icon,
active = false,
isLoading = false,
className,
onClick,
}: MenuItemProps) => {
@@ -50,17 +52,28 @@ const MenuItem = ({
return (
<li>
{href && (
{!isLoading && href && (
<Link href={href} className={menuItemBaseClassName}>
{menuItemContent}
</Link>
)}
{!href && (
{!isLoading && !href && (
<button className={menuItemBaseClassName} onClick={onClick}>
{menuItemContent}
</button>
)}
{isLoading && (
<button className={menuItemBaseClassName}>
<span
className={cn('loading loading-dots loading-md mx-auto', {
'text-gray-400': !active,
'text-black': active,
})}
/>
</button>
)}
</li>
);
};
+104 -37
View File
@@ -8,10 +8,13 @@ import Button, { ButtonProps } from '@/components/Button';
import { cn } from '@/lib/helper';
export type IconPosition = 'left' | 'center' | 'right';
export interface ConfirmationModalProps {
ref: RefObject<HTMLDialogElement | null>;
type?: 'info' | 'success' | 'error';
text?: string;
subtitleText?: string;
closeOnBackdrop?: boolean;
primaryButton?: ButtonProps & {
text?: string;
@@ -24,17 +27,84 @@ export interface ConfirmationModalProps {
modalBox?: string;
};
children?: React.ReactNode;
iconSize?: number;
iconPosition?: IconPosition;
}
const iconConfig = {
info: {
icon: 'material-symbols:info-outline-rounded',
iconClassName: 'text-info-content',
bgClassName: 'bg-info',
outerRingClassName: 'bg-info/20',
borderClassName: 'border-info',
},
success: {
icon: 'heroicons:check',
iconClassName: 'text-white',
bgClassName: 'bg-[#00D390]',
outerRingClassName: 'bg-[#00D3901F]',
borderClassName: 'border-[#CCF7EB]',
},
error: {
icon: 'solar:danger-triangle-linear',
iconClassName: 'text-error-content',
bgClassName: 'bg-[#f03338]',
outerRingClassName: 'bg-[#f3cdcd]',
borderClassName: 'border-[#fff0ef]',
},
} as const;
const ConfirmationModalIcon = ({
type,
size = 24,
}: {
type: 'info' | 'success' | 'error';
size?: number;
}) => {
const config = iconConfig[type];
return (
<div className='flex items-center justify-center p-2'>
<div
className={cn(
'rounded-full border-4 p-1',
config.outerRingClassName,
config.borderClassName
)}
>
<div className={cn('rounded-full p-1', config.outerRingClassName)}>
<div
className={cn(
'rounded-full p-3 flex items-center justify-center',
config.bgClassName
)}
>
<Icon
icon={config.icon}
width={size}
height={size}
className={config.iconClassName}
/>
</div>
</div>
</div>
</div>
);
};
const ConfirmationModal = ({
ref,
type = 'info',
text,
subtitleText,
closeOnBackdrop,
primaryButton,
secondaryButton,
className,
children,
iconSize = 32,
iconPosition = 'center',
}: ConfirmationModalProps) => {
const [isPrimaryButtonLoading, setIsPrimaryButtonLoading] = useState(false);
@@ -55,55 +125,52 @@ const ConfirmationModal = ({
return (
<Modal ref={ref} closeOnBackdrop={closeOnBackdrop} className={className}>
<div className='w-full flex flex-col gap-4'>
<div
className={cn(
'w-fit p-4 mx-auto flex flex-row justify-center items-center rounded-full',
{
'bg-error': type === 'error',
'bg-info': type === 'info',
'bg-success': type === 'success',
}
)}
>
{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'
/>
)}
{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-4', {
'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='font-medium'>
{text ?? 'Apakah anda yakin ingin melakukan hal ini?'}
</p>
{subtitleText && (
<p className='text-sm text-gray-400'>{subtitleText}</p>
)}
</div>
</div>
)}
{children && <div className='w-full'>{children}</div>}
<div className='w-full flex flex-row gap-2'>
{secondaryButton && secondaryButton.text && (
<Button
{...secondaryButton}
variant='ghost'
variant='outline'
color={secondaryButton?.color}
isLoading={secondaryButton?.isLoading}
disabled={
+105
View File
@@ -0,0 +1,105 @@
import Link from 'next/link';
import Menu from '@/components/menu/Menu';
import { Icon } from '@iconify/react';
import { cn, isPathActive } from '@/lib/helper';
import { useAuth } from '@/services/hooks/useAuth';
export interface SidebarMenuItem {
type?: 'item' | 'title';
text: string;
link: string;
icon?: string;
submenu?: SidebarMenuItem[];
permission?: string[];
}
interface SidebarMenuItemProps {
item: SidebarMenuItem;
activeLink: string;
}
interface SidebarMenuProps {
menu: SidebarMenuItem[];
activeLink: string;
}
const SidebarMenuItem = ({ item, activeLink }: SidebarMenuItemProps) => {
const { permissionCheck } = useAuth();
const isItemActive = isPathActive(activeLink, item.link);
const isUserPermitted = item.permission
? item.permission?.some((permissionName) => permissionCheck(permissionName))
: true;
if (!isUserPermitted) {
return null;
}
const menuItemWithoutSubmenu = (
<li>
<Link
href={item.link}
className={cn(
{
'menu-active border-2 border-solid border-base-300': isItemActive,
},
'px-3 py-1.5'
)}
>
{item.icon && <Icon icon={item.icon} width={20} height={20} />}
<span className='text-base'>{item.text}</span>
</Link>
</li>
);
if (!item.submenu || item.submenu.length === 0) {
return menuItemWithoutSubmenu;
}
const menuItemWithSubmenu = (
<li>
<details open={isItemActive}>
<summary
className={cn({
'text-primary': isItemActive,
})}
>
{item.icon && <Icon icon={item.icon} width={20} height={20} />}
<span className='text-base'>{item.text}</span>
</summary>
<ul>
{item.submenu.map((submenuItem, submenuIdx) => (
<SidebarMenuItem
key={`submenu#${submenuIdx}`}
item={submenuItem}
activeLink={activeLink}
/>
))}
</ul>
</details>
</li>
);
return menuItemWithSubmenu;
};
const SidebarMenu = ({ menu, activeLink }: SidebarMenuProps) => {
return (
<Menu>
{menu.map((menuItem, menuIdx) => {
return (
<SidebarMenuItem
key={menuIdx}
item={menuItem}
activeLink={activeLink}
/>
);
})}
</Menu>
);
};
export default SidebarMenu;
+52 -16
View File
@@ -144,33 +144,45 @@ const ApprovalSteps = ({ approvals }: ApprovalStepsProps) => {
export const formatGroupedApprovalsToApprovalSteps = (
approvalLine: ApprovalLine,
groupedApprovals: BaseGroupedApproval[],
latestApproval: BaseApproval
groupedApprovals: BaseGroupedApproval[] | undefined,
latestApproval: BaseApproval | undefined
): ApprovalStepsProps['approvals'] => {
const formattedApprovalSteps: ApprovalStepsProps['approvals'] =
approvalLine.map((approvalLineItem) => {
const approvalGroup = groupedApprovals.find(
const approvalGroup = groupedApprovals?.find(
(approvalGroupItem) =>
approvalGroupItem.step_number === approvalLineItem.step_number
);
const currentStepNumber = approvalLineItem.step_number;
const lastStepNumber =
groupedApprovals[groupedApprovals.length - 1]?.step_number;
groupedApprovals?.[groupedApprovals.length - 1]?.step_number;
const isLatestApprovalRejected = latestApproval.action === 'REJECTED';
const isLatestApprovalRejected = latestApproval?.action === 'REJECTED';
if (!approvalGroup && currentStepNumber <= lastStepNumber) {
throw new Error(
`Approval dengan ${approvalLineItem.step_name} tidak ditemukan!`
);
// Only throw error if we have a valid lastStepNumber to compare against
if (
!approvalGroup &&
lastStepNumber !== undefined &&
currentStepNumber <= lastStepNumber
) {
// throw new Error(
// `Approval dengan ${approvalLineItem.step_name} tidak ditemukan!`
// );
}
if (!approvalGroup) {
const isWaiting = currentStepNumber === latestApproval.step_number + 1;
// Check if this step is waiting (only if we have latestApproval)
const isWaiting =
latestApproval?.step_number !== undefined &&
currentStepNumber === latestApproval.step_number + 1;
// Check if previous approval was rejected
const isPreviousApprovalRejected =
groupedApprovals[groupedApprovals.length - 1].approvals[0].action ===
'REJECTED';
groupedApprovals &&
groupedApprovals.length > 0 &&
groupedApprovals[groupedApprovals.length - 1]?.approvals?.[0]
?.action === 'REJECTED';
return {
name: approvalLineItem.step_name,
@@ -184,7 +196,11 @@ export const formatGroupedApprovalsToApprovalSteps = (
let approvalStatus: ApprovalStepStatus = 'IDLE';
if (approvalGroup.step_number <= latestApproval.step_number) {
// Only compare if latestApproval and its step_number exist
if (
latestApproval?.step_number !== undefined &&
approvalGroup.step_number <= latestApproval.step_number
) {
if (approvalGroup.approvals) {
switch (approvalGroup?.approvals[0]?.action) {
case 'CREATED':
@@ -203,6 +219,7 @@ export const formatGroupedApprovalsToApprovalSteps = (
}
}
} else if (
latestApproval?.step_number !== undefined &&
approvalGroup.step_number === latestApproval.step_number + 1 &&
!isLatestApprovalRejected
) {
@@ -292,7 +309,7 @@ const useApprovalSteps = ({
moduleId: string;
params?: {
page?: number;
limit: number;
limit: number | string;
search?: string;
group_step_number?: boolean;
};
@@ -353,14 +370,33 @@ const useApprovalSteps = ({
// Formatting Akhir
const approvals = useMemo(() => {
if (isLoading || !approvalLines.length || !latestApproval) {
if (isLoading || !approvalLines.length) {
return [];
}
// Try to derive latestApproval from groupedApprovals if not provided
let effectiveLatestApproval = latestApproval;
if (!effectiveLatestApproval && groupedApprovals.length > 0) {
// Get all approvals from grouped data
const allApprovals = groupedApprovals.flatMap((group) => group.approvals);
if (allApprovals.length > 0) {
// Use the most recent approval (last in array)
effectiveLatestApproval = allApprovals[allApprovals.length - 1];
}
}
// If still no latestApproval, return empty
if (!effectiveLatestApproval) {
return [];
}
try {
return formatGroupedApprovalsToApprovalSteps(
approvalLines,
groupedApprovals,
latestApproval
effectiveLatestApproval
);
} catch (error) {
console.warn('Gagal memformat approval steps:', error);
@@ -0,0 +1,136 @@
'use client';
import { useMemo, useState } from 'react';
import { Icon } from '@iconify/react';
import Button from '@/components/Button';
import Tabs from '@/components/Tabs';
import ClosingGeneralInformationTable from '@/components/pages/closing/ClosingGeneralInformationTable';
import ClosingSapronakTabContent from '@/components/pages/closing/ClosingSapronakTabContent';
import ClosingProductionDataTabContent from '@/components/pages/closing/ClosingProductionDataTabContent';
import {
ClosingGeneralInformation,
BaseClosingSales,
ClosingHppExpedition,
} from '@/types/api/closing';
import ClosingSapronakCalculationTabContent from '@/components/pages/closing/ClosingSapronakCalculationTabContent';
import ClosingOverheadTabContent from '@/components/pages/closing/ClosingOverheadTabContent';
import ClosingFinanceTabContent from '@/components/pages/closing/ClosingFinanceTabContent';
import SalesReportTable from '@/components/pages/closing/sale/SalesReportTable';
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 {
id: number;
initialValue?: ClosingGeneralInformation;
salesData?: BaseClosingSales;
hppExpeditionData?: ClosingHppExpedition;
projectData?: ProjectFlock;
kandangData?: ProjectFlockKandang;
}
const ClosingDetail: React.FC<ClosingDetailProps> = ({
id,
initialValue,
salesData,
hppExpeditionData,
projectData,
kandangData,
}) => {
const [activeTab, setActiveTab] = useState<string>('sapronak');
const closingDetailTabs = useMemo(() => {
const validTabs = [
{
id: 'sapronak',
label: 'Sapronak',
content: <ClosingSapronakTabContent projectFlockId={id} />,
},
{
id: 'perhitunganSapronak',
label: 'Perhitungan Sapronak',
content: (
<ClosingSapronakCalculationTabContent
closingGeneralInformation={initialValue}
projectFlockId={id}
/>
),
},
{
id: 'penjualan',
label: 'Penjualan',
content: <SalesReportTable initialValues={salesData} />,
},
{
id: 'overhead',
label: 'Overhead',
content: <ClosingOverheadTabContent projectFlockId={id} />,
},
{
id: 'hppEkspedisi',
label: 'HPP Ekspedisi',
content: <HppExpeditionReportTable initialValues={hppExpeditionData} />,
},
{
id: 'dataProduksi',
label: 'Data Produksi',
content: <ClosingProductionDataTabContent projectFlockId={id} />,
},
{
id: 'keuangan',
label: 'Keuangan',
content: <ClosingFinanceTabContent projectFlockId={id} />,
},
];
return validTabs;
}, [initialValue]);
return (
<>
<section className='w-full max-w-7xl pb-16'>
<header className='flex flex-col gap-4'>
<Button
href={
!kandangData ? '/closing' : `/closing/detail/?closingId=${id}`
}
variant='link'
className='w-fit p-0 text-primary'
>
<Icon icon='uil:arrow-left' width={24} height={24} />
Kembali
</Button>
<h1 className='text-2xl font-bold text-center'>Detail Closing</h1>
</header>
<ClosingGeneralInformationTable
initialValue={initialValue}
projectData={projectData}
kandangData={kandangData}
/>
{!kandangData && (
<ClosingKandangList
initialValue={initialValue}
projectData={projectData}
/>
)}
<Tabs
activeTabId={activeTab}
onTabChange={setActiveTab}
tabs={closingDetailTabs}
variant='lifted'
className={{
wrapper: 'w-full mt-4',
}}
/>
</section>
</>
);
};
export default ClosingDetail;
@@ -0,0 +1,17 @@
import ClosingFinanceTable from '@/components/pages/closing/ClosingFinanceTable';
const ClosingFinanceTabContent = ({
projectFlockId,
}: {
projectFlockId: number;
}) => {
return (
<div className='flex flex-col gap-4'>
{projectFlockId && (
<ClosingFinanceTable projectFlockId={projectFlockId} />
)}
</div>
);
};
export default ClosingFinanceTabContent;
@@ -0,0 +1,595 @@
import Card from '@/components/Card';
import Table, { TABLE_DEFAULT_STYLING } from '@/components/Table';
import { isResponseSuccess } from '@/lib/api-helper';
import { formatCurrency, formatTitleCase } from '@/lib/helper';
import { ClosingApi } from '@/services/api/closing';
import {
DataSummarySubTotal,
HppPurchaseData,
ProfitLossDataAmount,
} from '@/types/api/closing';
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: string;
group_name: string;
group_index: number;
isGroupHeader: false;
budgeting?: { rp_per_bird: number; rp_per_kg: number; amount: number };
realization?: { rp_per_bird: number; rp_per_kg: number; amount: number };
};
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 = ({
projectFlockId,
}: {
projectFlockId: number;
}) => {
const { data: finance, isLoading } = useSWR(
`/closing/finance/${projectFlockId}`,
() => ClosingApi.getFinance(projectFlockId)
);
const staticHppRows: Array<{
group_name: string;
type: string;
group_index: number;
}> = [
{
group_name: 'HPP dan Pengeluaran',
type: 'Pembelian PAKAN',
group_index: 0,
},
{
group_name: 'HPP dan Pengeluaran',
type: 'Pembelian STARTER',
group_index: 0,
},
{
group_name: 'HPP dan Pengeluaran',
type: 'Pembelian DOC',
group_index: 0,
},
{
group_name: 'HPP dan Pengeluaran',
type: 'Pembelian PULLET',
group_index: 0,
},
{
group_name: 'HPP dan Pengeluaran',
type: 'Pembelian LAYER',
group_index: 0,
},
{
group_name: 'HPP dan Bahan Baku',
type: 'Pengeluaran Overhead',
group_index: 1,
},
{
group_name: 'HPP dan Bahan Baku',
type: 'Beban Ekspedisi',
group_index: 1,
},
];
const hppTableData: HppTableRow[] = [
{
group_name: 'HPP dan Pengeluaran',
group_index: 0,
isGroupHeader: true as const,
},
...staticHppRows
.filter((row) => row.group_index === 0)
.map((staticRow) => {
const apiData = isResponseSuccess(finance)
? finance.data.hpp_purchases.hpp
.find((g) => g.group_name === staticRow.group_name)
?.data.find((d) => d.type === staticRow.type)
: null;
return {
group_name: staticRow.group_name,
group_index: staticRow.group_index,
type: staticRow.type,
budgeting: apiData?.budgeting || {
rp_per_bird: 0,
rp_per_kg: 0,
amount: 0,
},
realization: apiData?.realization || {
rp_per_bird: 0,
rp_per_kg: 0,
amount: 0,
},
isGroupHeader: false as const,
};
}),
{
group_name: 'HPP dan Bahan Baku',
group_index: 1,
isGroupHeader: true as const,
},
...staticHppRows
.filter((row) => row.group_index === 1)
.map((staticRow) => {
const apiData = isResponseSuccess(finance)
? finance.data.hpp_purchases.hpp
.find((g) => g.group_name === staticRow.group_name)
?.data.find((d) => d.type === staticRow.type)
: null;
return {
group_name: staticRow.group_name,
group_index: staticRow.group_index,
type: staticRow.type,
budgeting: apiData?.budgeting || {
rp_per_bird: 0,
rp_per_kg: 0,
amount: 0,
},
realization: apiData?.realization || {
rp_per_bird: 0,
rp_per_kg: 0,
amount: 0,
},
isGroupHeader: false as const,
};
}),
{
group_name: 'HPP',
group_index: 2,
isGroupHeader: true as const,
},
];
const profitLossTableData: ProfitLossTableRow[] = isResponseSuccess(finance)
? [
// Pembelian group
...finance.data.profit_loss.data.pembelian.map((item) => ({
label: 'Pembelian',
group_name: 'Pembelian',
group_index: 1,
type: item.type,
rp_per_bird: item.rp_per_bird,
rp_per_kg: item.rp_per_kg,
amount: item.amount,
isGroupHeader: false as const,
})),
{
label: finance.data.profit_loss.data.summary.gross_profit.label,
group_name: 'Penjualan',
group_index: 0,
isGroupHeader: true as const,
type: finance.data.profit_loss.data.summary.gross_profit.label,
rp_per_bird:
finance.data.profit_loss.data.summary.gross_profit.rp_per_bird,
rp_per_kg:
finance.data.profit_loss.data.summary.gross_profit.rp_per_kg,
amount: finance.data.profit_loss.data.summary.gross_profit.amount,
},
// Penjualan group
...finance.data.profit_loss.data.penjualan.map((item) => ({
label: 'Penjualan',
group_name: 'Penjualan',
group_index: 0,
type: item.type,
rp_per_bird: item.rp_per_bird,
rp_per_kg: item.rp_per_kg,
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 (
<div className='flex flex-col gap-4'>
<>
<Card
variant='bordered'
className={{
wrapper: 'w-full',
}}
>
<div className='grid grid-cols-2 gap-6'>
<div className='flex flex-col gap-1'>
<div>
{isResponseSuccess(finance)
? formatTitleCase(
finance.data.profit_loss.data.summary.gross_profit
.label || '-'
)
: 'Laba Rugi Brutto'}
</div>
<div className='text-lg font-bold'>
{isResponseSuccess(finance)
? formatCurrency(
finance.data.profit_loss.data.summary.gross_profit.amount
)
: '-'}
</div>
</div>
<div className='flex flex-col gap-1'>
<div>
{isResponseSuccess(finance)
? formatTitleCase(
finance.data.profit_loss.data.summary.net_profit.label ||
'-'
)
: 'Laba Rugi Netto'}
</div>
<div className='text-lg font-bold'>
{isResponseSuccess(finance)
? formatCurrency(
finance.data.profit_loss.data.summary.net_profit.amount
)
: '-'}
</div>
</div>
</div>
</Card>
<Card
title={
isResponseSuccess(finance)
? finance.data.hpp_purchases.title
: 'HPP Purchases'
}
variant='bordered'
collapsible
className={{
wrapper: 'w-full',
}}
>
<div className='mt-6 p-0 mb-0'>
<Table<HppTableRow>
data={hppTableData}
columns={[
{
header: 'No.',
enableSorting: false,
accessorFn: (item, index) => {
if (item.isGroupHeader) return '-';
const dataRowsBefore = hppTableData
.slice(0, index)
.filter((row) => !row.isGroupHeader).length;
return dataRowsBefore + 1;
},
footer: (props) => {
return 'HPP';
},
},
{
header: 'Type',
enableSorting: false,
accessorFn: (item) => formatTitleCase(item.type || '-'),
},
{
header: 'Budgeting',
enableSorting: false,
columns: [
{
header: 'Rp/Ekor',
id: 'budgeting_rp_per_bird',
enableSorting: false,
accessorFn: (item) =>
formatCurrency(item.budgeting?.rp_per_bird || 0),
footer: (props) => {
return props.column.id === 'budgeting_rp_per_bird' &&
isResponseSuccess(finance)
? formatCurrency(
finance.data.hpp_purchases.summary_hpp?.budgeting
?.rp_per_bird || 0
)
: '-';
},
},
{
header: 'Rp/Kg',
id: 'budgeting_rp_per_kg',
enableSorting: false,
accessorFn: (item) =>
formatCurrency(item.budgeting?.rp_per_kg || 0),
footer: (props) => {
return props.column.id === 'budgeting_rp_per_kg' &&
isResponseSuccess(finance)
? formatCurrency(
finance.data.hpp_purchases.summary_hpp?.budgeting
?.rp_per_kg || 0
)
: '-';
},
},
{
header: 'Jumlah (Rp)',
id: 'budgeting_amount',
enableSorting: false,
accessorFn: (item) =>
formatCurrency(item.budgeting?.amount || 0),
footer: (props) => {
return props.column.id === 'budgeting_amount' &&
isResponseSuccess(finance)
? formatCurrency(
finance.data.hpp_purchases.summary_hpp?.budgeting
?.amount || 0
)
: '-';
},
},
],
},
{
header: 'Realization',
enableSorting: false,
columns: [
{
header: 'Rp/Ekor',
id: 'realization_rp_per_bird',
enableSorting: false,
accessorFn: (item) =>
formatCurrency(item.realization?.rp_per_bird || 0),
footer: (props) => {
return props.column.id === 'realization_rp_per_bird' &&
isResponseSuccess(finance)
? formatCurrency(
finance.data.hpp_purchases.summary_hpp
?.realization?.rp_per_bird || 0
)
: '-';
},
},
{
header: 'Rp/Kg',
id: 'realization_rp_per_kg',
enableSorting: false,
accessorFn: (item) =>
formatCurrency(item.realization?.rp_per_kg || 0),
footer: (props) => {
return props.column.id === 'realization_rp_per_kg' &&
isResponseSuccess(finance)
? formatCurrency(
finance.data.hpp_purchases.summary_hpp
?.realization?.rp_per_kg || 0
)
: '-';
},
},
{
header: 'Jumlah (Rp)',
id: 'realization_amount',
enableSorting: false,
accessorFn: (item) =>
formatCurrency(item.realization?.amount || 0),
footer: (props) => {
return props.column.id === 'realization_amount' &&
isResponseSuccess(finance)
? formatCurrency(
finance.data.hpp_purchases.summary_hpp
?.realization?.amount || 0
)
: '-';
},
},
],
},
]}
renderCustomRow={(row) => {
const rowData = row.original;
if (rowData.isGroupHeader) {
return (
<tr
key={row.id}
className={TABLE_DEFAULT_STYLING.bodyRowClassName}
>
<td
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
></td>
<td
colSpan={7}
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
>
<div className='font-bold'>
{formatTitleCase(rowData.group_name ?? '-')}
</div>
</td>
</tr>
);
}
return null;
}}
renderFooter={isResponseSuccess(finance)}
/>
</div>
</Card>
<Card
title={
isResponseSuccess(finance)
? finance.data.profit_loss.title
: 'Profit/Loss'
}
variant='bordered'
collapsible
className={{
wrapper: 'w-full',
}}
>
<div className='mt-6 p-0 mb-0'>
<Table<ProfitLossTableRow>
data={profitLossTableData}
columns={[
{
header: 'Jenis',
enableSorting: false,
accessorFn: (item) => item.type,
cell: (item) => (
<div className=''>
{formatTitleCase(item.row.original.type || '-')}
</div>
),
footer: (item) => (
<div className='font-bold uppercase'>
{isResponseSuccess(finance)
? formatTitleCase(
finance.data.profit_loss.data.summary.net_profit
.label || '-'
)
: '-'}
</div>
),
},
{
header: 'Rp/Ekor',
enableSorting: false,
accessorFn: (item) => formatCurrency(item.rp_per_bird || 0),
footer: (item) => (
<div className='font-bold'>
{isResponseSuccess(finance)
? formatCurrency(
finance.data.profit_loss.data.summary.net_profit
.rp_per_bird || 0
)
: formatCurrency(0)}
</div>
),
},
{
header: 'Rp/Kg',
enableSorting: false,
accessorFn: (item) => formatCurrency(item.rp_per_kg || 0),
footer: (item) => (
<div className='font-bold'>
{isResponseSuccess(finance)
? formatCurrency(
finance.data.profit_loss.data.summary.net_profit
.rp_per_kg || 0
)
: formatCurrency(0)}
</div>
),
},
{
header: 'Jumlah (Rp)',
enableSorting: false,
accessorFn: (item) => formatCurrency(item.amount || 0),
footer: (item) => (
<div className='font-bold'>
{isResponseSuccess(finance)
? formatCurrency(
finance.data.profit_loss.data.summary.net_profit
.amount || 0
)
: formatCurrency(0)}
</div>
),
},
]}
renderCustomRow={(row) => {
const rowData = row.original;
if (rowData.isGroupHeader) {
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 (
<tr
key={row.id}
className={TABLE_DEFAULT_STYLING.bodyRowClassName}
>
<td
colSpan={4}
className={TABLE_DEFAULT_STYLING.bodyColumnClassName}
>
<div className='font-bold'>
{formatTitleCase(rowData.group_name ?? '-')}
</div>
</td>
</tr>
);
}
return null;
}}
className={{
paginationClassName: 'hidden',
}}
renderFooter={isResponseSuccess(finance)}
/>
</div>
</Card>
</>
</div>
);
};
export default ClosingFinanceTable;

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