Project Registration - Implementation Plan
Last Updated: 2025-12-23 Status: In Progress Total Issues: 57 (in Backlog)
Overview
This page tracks the implementation plan for Project Registration workflow improvements. Issues are grouped by root cause and prioritized by impact.
GitHub Project: View Project Board
Progress Summary
| Phase | Focus | Issues | Status |
|---|---|---|---|
| 1 | Critical Bugs (Autosave/PR#) | #156, #149, #130, #116 | Pending |
| 2 | Permissions & Roles | 7 issues | Pending |
| 3 | Notes & Search | 3 issues | Pending |
| 4 | Auth & Session | 6 issues | Pending |
| 5 | Workflow States | 6 issues | Pending |
| 6 | Form UI | 6 issues | Pending |
| 7 | Best Practices Refactor | - | Pending |
Issue Categories
Category A: Autosave & PR# Issues (4 issues) - CRITICAL
Root Cause: Backend returns empty projectId, race conditions in autosave
| Issue | Title | Status |
|---|---|---|
| #156 | Work Owner can't create task without PR# | |
| #149 | Autosave corrupts task/project | |
| #130 | PR# auto-save race condition | |
| #116 | Autosave breaks dropdown |
Category B: Permission & Role Issues (7 issues)
Root Cause: Missing role checks, incorrect authorization
| Issue | Title | Status |
|---|---|---|
| #126 | Contractor: Detail tab missing | |
| #127 | Purchasing can't delete owner's attachments | |
| #132 | Ownership change rule before approval | |
| #137 | System Admin edit projects anytime | |
| #138 | Owner view others' tasks but not edit | |
| #152 | Contractor cannot view task details | |
| #158 | Update Role matrix for Safety Officer/Area |
Category C: Workflow State Issues (11 issues)
Root Cause: Missing workflow commands, state transitions
| Issue | Title | Status |
|---|---|---|
| #73 | Owner can't hand over to contractor at start | |
| #76 | Approved to Closed transition | |
| #78 | Recall cannot be done once canceled | |
| #84 | Cannot view canceled task | |
| #85 | Restore canceled task | |
| #86 | Cancellation status inconsistency | |
| #106 | Pre-start Work Permit workflow | |
| #107 | Disable reviews after completion | |
| #154 | Clarify second submission routing | |
| #155 | Auto-create 3 tasks for contractor | |
| #160 | Safety Officer/Area tasks |
Category D: Form & UI Issues (6 issues)
Root Cause: UI improvements needed
| Issue | Title | Status |
|---|---|---|
| #108 | Improve pre-work procedures form | |
| #117 | Redesign pre-work form | |
| #120 | Remove default setting option | |
| #131 | Sort PR# by Unused/Used | |
| #150 | Test long Thai text | |
| #153 | Project info on contractor tasks |
Category E: Auth & Email Issues (7 issues)
Root Cause: Session/email configuration
| Issue | Title | Status |
|---|---|---|
| #41 | Automatic email invitation | |
| #118 | Session expires causing data loss | |
| #119 | Duplicate email clears form | |
| #121 | Extend invite expiry to 72 hours | |
| #122 | Add non-expiring app link | |
| #123 | Direct app URL when expired | |
| #124 | Password visibility toggle |
Category F: Notes & Attachments Issues (2 issues)
Root Cause: Endpoint/permission issues
| Issue | Title | Status |
|---|---|---|
| #151 | Cannot add Note (405 Error) | |
| #127 | Attachment ownership |
Category G: Search & Filter Issues (2 issues)
Root Cause: Missing/broken functionality
| Issue | Title | Status |
|---|---|---|
| #57 | Search button not working | |
| #71 | Improving task search |
Category H: Admin & Settings Issues (3 issues)
Root Cause: Missing admin features
| Issue | Title | Status |
|---|---|---|
| #35 | System Admin define workspace area | |
| #64 | Update user info on dialog | |
| #134 | Clear All Data option |
Category I: Future Features (15 issues)
Root Cause: New feature requests
| Issue | Title | Priority |
|---|---|---|
| #45 | Digital signature/approval | Medium |
| #55 | Joint project creation | Medium |
| #56 | Project key as PR No. | Low |
| #65 | Work procedure confirmation doc | Medium |
| #69 | Contractor position during training | Low |
| #70 | QR Code public display | Low |
| #75 | Enhance command flow | Medium |
| #82 | Contractor accounts via agents | Low |
| #87 | Improve Task Assignee/Assigner | Medium |
| #92 | Work-owner role behavior | Medium |
| #97 | Contractor supervisor section | Low |
| #133 | Lock record after approval | High |
| #135 | Frontend mockup next phase | Low |
| #136 | Test email notifications | Testing |
| #159 | Email to contractor after approval | Medium |
Implementation Details
Phase 1: Critical Bug Fixes
Goal: Fix blocking autosave/PR# issues
Root Cause Analysis:
// SaveTaskDocumentFormEndpoint.cs (Line 58)
// BUG: Returns hardcoded Guid.Empty instead of actual projectId
await Send.ResultAsync(
TypedResults.Ok(new SaveTaskDocumentFormResponse(
documentFormRequest.Task.Id,
Guid.Empty // <-- BUG: Should return task.ProjectId
))
);
Fix Steps:
- Update
SaveTaskDocumentFormEndpoint.csto return actual projectId - Update frontend to sync projectId from response
- Add autosave request deduplication
- Pause autosave when dropdown is open
- Allow task creation without PR# (warning instead of block)
Files to Modify:
backend/SafetyApp.WebApi/Features/Tasks/SaveTaskDocumentFormEndpoint.csfrontend/src/app/features/docs/forms/project-registration-form.component.tsfrontend/src/app/features/tasks/review-task/review-task.service.ts
Phase 7: Apply Work Permit Best Practices (LAST)
Goal: Modernize Project Registration form using patterns from Work Permit prototype
Best Practices to Apply:
- Extract Sub-Components (reduce 1,122 lines to ~300 lines)
- Add Collapsible Sections with expand/collapse buttons
- Migrate to FormInput Model for type-safe form inputs
- Use Inline-Edit Component for space-efficient fields
Changelog
2025-12-23
- Initial plan created
- 57 issues categorized into 9 categories
- 7 implementation phases defined
- Plan persisted to docs site