Commit Graph

118 Commits

Author SHA1 Message Date
Ichsan Kurniawan 230213cd2e Handle unstarted assignment phases
Represent pending assignments with no active phase, show Development as the next milestone, and align the grid and list steppers' rails with their stage dots.
2026-11-10 19:01:16 +07:00
Ichsan Kurniawan aa99536a32 Route server requests through local API
Use BASE_URL_API_LOCAL_SERVER for server-side data requests and load the layout session through the cached helper. Update production URLs to HTTPS and use 127.0.0.1 for local API endpoints.
2026-11-10 17:23:53 +07:00
Ichsan Kurniawan b329a89f2d Add local API endpoints to env configs
Configure local-server API URLs for development, staging, and production, and add an internal NextAuth URL for development.
2026-11-10 16:43:56 +07:00
Ichsan Kurniawan 7d6549f892 Enforce page and action-based permissions
Use RBAC permissions to guard dashboard pages and control approval and export actions. Reuse cached sessions and refine permission badges and available icons.
2026-11-10 16:32:15 +07:00
Ichsan Kurniawan e67f671983 Enforce assignment permissions and show active milestones
Gate assignment creation and editing by the relevant permissions, show ongoing milestones on the timeline, and restrict the forbidden-page admin link to authorized users. Also use the shared RBAC role type and tighten sidebar active-state matching.
2026-11-10 11:27:05 +07:00
Ichsan Kurniawan 279b642a7a Apply RBAC permissions across admin and tasks
Enforce page access and action-level permissions across admin and task views, including exports and record actions. Move user creation to a client component behind server-side permission checks, standardize data fetching, and remove the deprecated user-role route.
2026-11-09 17:32:31 +07:00
Ichsan Kurniawan 1b37ff65f5 Enforce action permissions across admin pages
Gate administration actions by role permissions, centralize cached session access for data fetching, and return forbidden responses for unauthorized pages. Also lazy-load user exports and adjust search field sizing.
2026-11-09 15:02:29 +07:00
Ichsan Kurniawan 8478b1f28f Add access-denied pages and improve admin states
Add dedicated 403 pages for the app and admin area, enable Next.js forbidden handling, and improve admin loading, navigation, and error-boundary experiences.
2026-11-07 20:27:39 +07:00
Ichsan Kurniawan 7f8e6637e4 Move auth config and build admin menus
Extract NextAuth configuration into a shared library, load admin sidebar items from role permissions, and update related RBAC types and UI.
2026-11-06 18:25:54 +07:00
Ichsan Kurniawan b149903b2e Add hierarchical role permission controls
Make parent menus gate child permissions and cascade select or clear actions through descendants. Update role detail rendering for nested menus and the revised API shape, with related RBAC UI and sidebar adjustments.
2026-11-05 21:59:25 +07:00
Ichsan Kurniawan 66b23eecca Move RBAC permission row into user-role feature
Keep the role-permission row with the user-role components and update imports to use the canonical UI badge.
2026-11-05 20:40:59 +07:00
Ichsan Kurniawan 6ffe7746c8 Improve RBAC management and permissions UI
Unify interactive and read-only role permission rows, refine role and menu forms and labels, and correct the access-permissions sidebar route. Update role payloads and admin-menu handling.
2026-11-05 20:37:39 +07:00
Ichsan Kurniawan 751b28fab2 Add RBAC menu and role management
Adds permission, menu, and role administration with hierarchical access controls, plus admin breadcrumbs and a redirect from the legacy user-role page. Remove `credentials.md` before committing; it contains server credentials.
2026-11-05 19:01:40 +07:00
Mohamad Ihsan 4d2ceefba7 Merge branch 'project-assignment' of https://github.com/ichsankurnia/hats-app into project-assignment 2026-11-05 13:09:47 +07:00
Mohamad Ihsan c4972f467a update testing note 2026-11-05 13:09:42 +07:00
Ichsan Kurniawan b71d84db06 Add assignment validation and attention alerts
Validate project years and Work Order code availability, confirm before discarding unsaved changes, and surface critical or behind-schedule assignments in dashboard warnings and stats. Also update assignment form and dashboard labels.
2026-11-05 11:27:05 +07:00
Ichsan Kurniawan 20b77dc0b7 Add PWA support with offline fallback
Add installable app metadata and icons, register a service worker for asset and page caching, and provide an offline page when navigation fails.
2026-11-04 20:47:26 +07:00
Ichsan Kurniawan 47076b1d09 Improve task search and filtering
Search clients and assignments by employee, add end-user filters to client details, and refine filter options and sorting behavior.
2026-11-04 16:03:26 +07:00
Ichsan Kurniawan f0cc469d24 Update client actions and dashboard labels
Show client edit and delete actions directly in grid and list views, simplify work-order and dashboard metric labels, and adjust spacing for milestone timelines without upcoming milestones.
2026-11-04 14:34:58 +07:00
Ichsan Kurniawan ce6750ff02 Add timestamps to activity logs
Require a date and time when creating activity logs, allow minute-level selection, and improve date-picker scrolling within dialogs.
2026-10-20 15:41:55 +07:00
Ichsan Kurniawan de8d463b97 Move task queries into utils
Relocate the task query module and update its type and route imports to use the new `utils/queries` path.
2026-10-20 15:41:25 +07:00
Ichsan Kurniawan 08a3e351ac Add task metadata and cached queries
Add route-specific metadata for task, client, assignment, and project pages. Centralize task data fetches in React-cached query helpers and reuse them across metadata generation and page rendering.
2026-10-19 20:30:48 +07:00
Ichsan Kurniawan b57ad30bfe Use theme-specific dashboard logos
Switch the dashboard logo between light and dark variants based on the active theme, and add the light logo asset.
2026-10-18 19:13:16 +07:00
Ichsan Kurniawan 93d2c272f2 Lazy-load task views and dialogs
Dynamically import client and assignment lists, grids, forms, filters, and activity timelines to reduce initial bundle work, with loading placeholders for list and grid views. Also refine client logo corners and assignment activity accents.
2026-10-17 21:53:06 +07:00
Ichsan Kurniawan a991f114ef Show assignment progress and latest activity
Add actual progress and latest activity details to assignment grid and list views, and show linked project names in the list. Remove a debug log from the assignment detail page.
2026-10-17 21:26:05 +07:00
Ichsan Kurniawan 390d03204a Add activity log timeline
Show assignment history on a date-based milestone timeline and refine milestone date positioning. Update activity log submission and description limits, refresh progress editing controls, and adjust the system log badge color.
2026-10-16 19:26:25 +07:00
Ichsan Kurniawan 3fbecab072 Add assignment progress and activity logging
Add modals for updating real progress and recording activity logs, and enhance the milestone timeline with date-based positioning and activity details. Update dashboard metrics to show active internal memos.
2026-10-16 15:37:20 +07:00
Ichsan Kurniawan f2e9136e47 Improve milestone progress track contrast
Use clearer neutral track colors for client progress bars and milestone timelines in light and dark themes.
2026-10-16 12:12:08 +07:00
Ichsan Kurniawan 38f21de78a Align progress colors with delivery health
Derive assignment status from scheduled phases that have started, map milestone colors to delivery health, and refine client timeline spacing and contrast.
2026-10-15 21:11:53 +07:00
Ichsan Kurniawan 9bc9d630a2 Add status-colored milestone timeline
Connect milestones with status-colored gradient segments and improve node hover styling. Remove debug logging from the task page and timeline.
2026-10-15 19:37:59 +07:00
Ichsan Kurniawan 09a049ce98 Add live milestone timelines to client views
Show upcoming assignment milestones with grouped agenda details and status-based colors. Use API status counts for client stage summaries and align status indicators across project timelines.
2026-10-15 18:52:32 +07:00
Ichsan Kurniawan 1953c28632 Improve assignment status date handling
Support both date schema variants when resolving statuses and rendering milestone timelines. Show interval descriptions in project history, use assignment status badges consistently, and remove debug logs.
2026-10-15 15:27:38 +07:00
Ichsan Kurniawan e7c6f1b17b Align technical status schedules and UI
This commit updates the technical status flow to support the newer `data` payload format while preserving legacy `date` handling across timelines, overview helpers, and assignment detail views. It also adds per-interval descriptions for date ranges, improves schedule editing/deletion UX, and refreshes status badge colors and default work-order/client fallback values for a more consistent experience.
2026-10-15 13:23:51 +07:00
Ichsan Kurniawan e8818bc234 Align assignment status pipeline UI
This update prioritizes technical status and date-matched assignment status resolution, then falls back to project status when needed. It also tightens milestone/timeline behavior by removing the deploy phase, reordering the stage flow, and adding tooltips for assignment codes, project info, and date ranges. The assignment list and overview helpers now use the resolved status consistently across the dashboard.
2026-10-14 17:45:06 +07:00
Ichsan Kurniawan f0526e4096 Add assignment timeline and activity log
This change adds a milestone timeline and development activity log for assignment detail pages, including a JSON comparison modal for activity history entries. It also extends assignment history types and overview helper logic to surface progress, delivery health, and milestone dates more accurately.
2026-10-14 15:47:50 +07:00
Ichsan Kurniawan 6f52078aa5 Redesign project assignment list
This commit refreshes the client project assignment UI with a new dashboard summary, streamlined card layouts, and shared assignment overview helpers. It adds phase/progress tracking, delivery health indicators, and improved team/status calculations across the assignment grid and list views. It also updates the project assignment type definitions and bumps the app version.
2026-10-13 20:42:59 +07:00
Ichsan Kurniawan 9a04ba7738 Revamp client overview dashboard
This update redesigns the task dashboard around client overview metrics, adding summary cards, project status breakdowns, and milestone timelines for each client. It also adds an active-first sort option, supports customizable search placeholders, and passes the full client list into the dashboard while wrapping the client views in Suspense for smoother loading.
2026-10-13 18:36:38 +07:00
Ichsan Kurniawan fccb901e2a Fix assignment deletion and team removal
This update changes assignment deletion labels to prefer WO/IM names, adds a configurable payload to ConfirmDelete for non-DELETE API calls, and switches team member removal to a PUT endpoint with status REMOVED. It also shortens project autofill toast duration, cleans out stale commented code on the client detail page, and updates the task error badge wording to better reflect app-level failures.
2026-10-13 16:56:20 +07:00
Ichsan Kurniawan 90a34330eb Add assignment tooltips and polish tooltip styles
This update adds richer hover tooltips for assignment codes and date ranges in both grid and list views, showing clearer labels like work order or memo codes and full start/end dates. It also standardizes tooltip visuals with a popover-style card, improved spacing, and better consistency across assignment cards.
2026-10-13 14:47:34 +07:00
Ichsan Kurniawan 0cf6a34522 Lazy-load modal components and fix promote flow
Replace eager modal/action component imports with dynamic (client-only) imports and add a shared ModalActionLoader UI for loading states. Use dynamic imports for ManageTeam, UpdateAdministrationStatus, UpdateTechnicalStatus, and ConfirmDeleteWithInput. Add ConvertedAssignmentBadge to assignment detail. Update ProjectAssignmentForm: replace useSearchParams with useRouter, prevent pre-filling project/work order fields when promoting (isPromote), adjust step handling, and skip project selector when promoting. Minor refactor to improve client-side performance and UX.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-13 13:30:18 +07:00
Ichsan Kurniawan c6aa1c912a Add ConvertedAssignmentBadge and IM conversion UI
Introduce ConvertedAssignmentBadge component to surface conversions between Internal Memos (IM) and Projects with hovercard details for both directions. Integrate the badge into AssignmentGrid and AssignmentList, add origin IM link when a project assignment lacks a project, and reuse formatAssignmentDate. Extend IProjectAssignment type to include im and list_wo fields to support the new UI data paths.
2026-10-13 13:29:37 +07:00
Ichsan Kurniawan a8c15cf3f6 Add task error UI and diagnostic asset
Add a client-side TaskError component at app/(dashboard)/task/error.tsx that displays friendly error states, logs details via clientLogger, offers retry/back/home actions, and a collapsible diagnostics pane with clipboard export and toast feedback. Uses motion/react, lucide-react icons and existing UI primitives (Button, Badge, Card). Also add the illustration asset public/assets/illustrations/server_task_error.webp referenced by the component.
2026-10-13 13:27:26 +07:00
Ichsan Kurniawan 83330418bc Add 'Promote to Project' flow for assignments
Introduce a promote-to-project workflow and related UI/logic changes.

Key changes:
- Add Promote button/link in AssignmentDetail, AssignmentGrid, and AssignmentList to open the ProjectAssignmentForm in promote mode.
- Propagate isPromote flag through pages and ProjectAssignmentForm: lock type to Project, prevent selecting IM, adjust headings/labels, and show badges.
- When promoting, set payload fields (project_id, im_id) accordingly and POST to create a Project from an existing IM.
- Autofill project/work-order fields from existing project selection and fetch WO sequence when project selected.
- Update validation messages, toasts, and minor UI/text sizing tweaks.
- Update UpdateAdministrationStatus to read/write notes (project_assignment_status_notes) and use it as initial remark.
- Extend IProjectAssignment type with im_id and project_assignment_status_notes.
- Remove .env.production.local (deleted).

Files changed: multiple components under app/(dashboard)/task and type.assignment.ts (see diff).
2026-10-12 18:41:10 +07:00
Ichsan Kurniawan f9e4f3de87 Add admin status updates and modal polish
Adds a dedicated administration-status workflow across client, assignment, and project views, including a new UpdateAdministrationStatus modal and action entries in assignment menus. It also improves modal layout consistency, prioritizes project-assignment status badges in list/grid views, and expands badge variants for administration and technical lifecycle states.
2026-10-12 13:32:00 +07:00
Ichsan Kurniawan 8b82372100 Add technical badges and delete confirmation
This update adds dedicated badge variants for technical progression states (Development, SIT, UAT, PTR, Go-live, BAST, Warranty) and improves status text matching for those stages. It also adds a confirmation dialog when deleting a schedule interval, including cleanup for the final remaining interval so the status description is cleared when appropriate and users are told when notes are being removed.
2026-10-12 10:51:08 +07:00
Ichsan Kurniawan f07990a3fb Refactor technical status workflow
Replace the legacy timeline status modal with a technical-status editor that supports multiple date intervals and descriptive notes. Update task views to use the new Update Technical Status action, normalize status-history parsing for array-based date records, and improve badge formatting for technical stages like SIT, UAT, PTR, Go-Live, and BAST.
2026-10-09 18:37:26 +07:00
Ichsan Kurniawan 98ce715ac6 Update ProjectAssignmentForm.tsx 2026-10-08 20:06:56 +07:00
Ichsan Kurniawan de8dafcd92 Enable React Compiler in Next config
This change enables the React Compiler in the Next.js configuration and adds the required Babel plugin dependency. The goal is to allow the app to use React Compiler optimizations during builds and improve rendering performance.
2026-10-08 17:36:42 +07:00
Ichsan Kurniawan bab7bbe272 Improve project assignment flow and form UX
This adds a clearer project assignment workflow with existing-project import, work-order sync, and stronger validation for project and work-order details. It also introduces reusable checkbox and input-group UI primitives and a dedicated loading state for the project assignment screen.
2026-10-08 17:36:25 +07:00
Ichsan Kurniawan aa91f1ac4c Add internal memo metrics to client views
Default client detail view now opens in list mode. The client model and listing UI now include `total_im`, showing internal memo counts across grid and list cards, and the profile summary adds the new metric. This also improves the empty-state description behavior and keeps the client summary stats consistent across views.
2026-10-08 13:19:41 +07:00