Service Report #013 In Review
Date: 2026-02-11
This report covers 18 issues from MoM 2026-02-11 (#374). Improvements span JSA Preparation, Tool List Preparation, digital signatures, and notification workflows.
Feature Overview
1. Prevent backdating start date and inspection date
Issue: #376 Thai Name: ไม่ควรย้อนหลังวันที่เริ่มงานและวันที่นัดตรวจเครื่องมือ
MoM Quote: Item 1
"ไม่ควรย้อนหลังได้ — จัดซื้อ: วันที่เริ่มไม่ควรย้อนหลังได้ / ผู้รับเหมา: วันที่นัดตรวจเครื่องมือ ไม่ควรย้อนหลังได้"
Description: Two date fields should not allow past dates:
- Purchasing role: Project start date cannot be set in the past
- Contractor role: Tool inspection appointment date cannot be set in the past
Location:
- My Tasks → Project Registration → Purchasing info → Start date
- My Tasks → Tool List Preparation → Tool inspection appointment date
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Purchasing edits project start date → Cannot select past dates | ⌛ Pending |
| 2 | Contractor sets tool inspection date → Cannot select past dates | ⌛ Pending |
| 3 | Future dates can still be selected normally | ⌛ Pending |
2. Contractor: Allow editing digital signatures
Issue: #377 Thai Name: ผู้รับเหมา ให้แก้ไขลายเซ็นได้
MoM Quote: Item 2
"ผู้รับเหมา ให้แก้ไขลายเซ็นได้"
Description: Previously, once a signature was placed, it could not be changed even if the form was still editable. Now, clicking on an already-signed signature field while the form is editable opens the signature dialog to allow re-signing. This applies to both single signature fields and signature grids (4-signature layouts).
Location: My Tasks → Any form with signature fields (Tool List, Work Permit, etc.)
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Contractor signs a field → Signature appears with name and date | ⌛ Pending |
| 2 | Click on already-signed field (while form editable) → Dialog opens to re-sign | ⌛ Pending |
| 3 | Re-sign with new signature → Old signature replaced | ⌛ Pending |
| 4 | After form submission → Signature is locked (no editing) | ⌛ Pending |
| 5 | Signature grid (4 signatures) → Same re-sign behavior works | ⌛ Pending |
3. Email notification mismatch on project approval
Issue: #378 Thai Name: ความแตกต่างของข้อความแจ้งเตือนผ่านอีเมลกับแจ้งเตือนในแอป
MoM Quote: Item 3
"SR: เจ้าของงาน: ความแตกต่างของข้อความ แจ้งเตือนผ่านอีเมล กับ แจ้งเตือนผู้รับเหมาเมื่ออนุมัติโครงการ"
Description: Email notifications were using the wrong templates for different workflow types. JSA approval was using the project-approved template, Work Permit had no email template at all, and Training Enrollment was also using the wrong template. Each workflow type now has its own dedicated email template with correct messaging.
Location: Email inbox + In-app notifications (bell icon)
Behavior
| Workflow | Email Template | Subject |
|---|---|---|
| Project Registration | project-approved | Project Approved |
| Tool List | tool-list-approved | Tool List Approved |
| JSA | jsa-approved | JSA Approved |
| Work Permit | work-permit-approved (new) | Work Permit Approved |
| Training | training-approved | Training Enrollment Approved |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Approve JSA → Email says "JSA Approved" (not "Project Approved") | ⌛ Pending |
| 2 | Approve Work Permit → Email notification received with correct template | ⌛ Pending |
| 3 | Approve Training → Email says "Training Enrollment Approved" | ⌛ Pending |
| 4 | In-app notification matches email content for each workflow type | ⌛ Pending |
4. JSA submission must be from main page
Issue: #379 Thai Name: ผู้รับเหมา: การส่ง JSA ต้องส่งจากหน้าหลัก
MoM Quote: Item 4
"ผู้รับเหมา: การส่ง JSA ต้องส่งจากหน้าหลัก เนื่องจาก 1 งานจะมี JSA ชุดเดียวแต่มีหลายแบบได้"
Description: All workflow commands (Submit, Approve, Request Change, Cancel) are available on the document list page (main page). Since one task has one JSA set with multiple forms, managing the workflow from the main page makes more sense. During the review state, individual JSA documents must be approved before executing the workflow-level Approve command (see item 26).
Location: My Tasks → JSA Preparation task → Document list (main page)
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open JSA task as contractor → See Submit button on document list page | ⌛ Pending |
| 2 | Click Submit from document list → JSA is submitted for review | ⌛ Pending |
| 3 | Open JSA task as WO/SO reviewer → See Approve / Request Change buttons on document list page | ⌛ Pending |
5. Must approve all JSA documents before approving task
Issue: #380 Thai Name: เจ้าของงาน/จป: ต้องอนุมัติเอกสาร JSA ทุกรายการก่อนอนุมัติงาน
MoM Quote: Item 5
"เจ้าของงาน/จป: 6.1 ต้องเข้าไปดู JSA ทุกอันถึงจะอนุมัติได้ / 6.2 ถ้าจะปฏิเสธหรือแก้ไข ไม่จำเป็นต้องดูทั้งหมด"
Description: Upgraded from view-tracking to formal document-level approval (see item 26):
- WO/SO must individually approve each JSA document using the approve button on each document's toolbar
- Clicking the workflow-level "Approve JSA" button without approving all documents shows an error dialog with a count (e.g., "อนุมัติแล้ว 1 จาก 3 รายการ")
- Request Change and Cancel commands do NOT require approving all documents
- JSA forms are read-only during the review state — reviewers can only view and approve
- WO and SO each approve independently (co-review)
Location: My Tasks → JSA Preparation task → Review state (WO/SO)
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open JSA form as WO → Form is read-only, approve button visible on toolbar | ⌛ Pending |
| 2 | Click approve button → Document approved, button changes to green "อนุมัติแล้ว" | ⌛ Pending |
| 3 | Document list → Approved JSA has green background/border | ⌛ Pending |
| 4 | Click "Approve JSA" without approving all → Error dialog shows count | ⌛ Pending |
| 5 | Approve all JSA documents → Click "Approve JSA" → Proceeds to confirmation | ⌛ Pending |
| 6 | Request Change button → Available without approving all documents | ⌛ Pending |
| 7 | SO opens same task → Must approve independently from WO | ⌛ Pending |
| 8 | After Request Change → All approvals cleared, reviewer must re-approve | ⌛ Pending |
6. Remove JSA rejection button
Issue: #381 Thai Name: เอาปฏิเสธ JSA ออก
MoM Quote: Item 6
"เอาปฏิเสธ JSA ออก"
Description: Remove the JSA rejection button from the Safety Officer review state. Only Approve and Request Change should remain.
Location: My Tasks → JSA Preparation task → SO review state
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open JSA as SO reviewer → No "Reject" button visible | ⌛ Pending |
| 2 | Approve and Request Change buttons still work normally | ⌛ Pending |
7. JSA read-only view with comment area for WO/SO
Issue: #382 Thai Name: เจ้าของงาน/จป: JSA เป็น read-only ให้เพิ่มพื้นที่คอมเม้น
MoM Quote: Item 7
"เจ้าของงาน / จป : JSA จะเป็นเห็นแบบ read only ให้เพิ่มพื้นที่คอมเม้นด้านล่าง คล้ายระบบ Note"
Description: When WO/SO views a JSA in review state, the form is read-only. A comment area should be visible at the bottom for adding review notes.
Location: My Tasks → JSA Preparation task → Review state → JSA form (WO/SO view)
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open JSA as WO/SO reviewer → Form fields are read-only | ⌛ Pending |
| 2 | Comment section visible at bottom of JSA form | ⌛ Pending |
| 3 | Can add a comment → Comment saved and visible | ⌛ Pending |
8. Auto-fill signature from personal settings
Issue: #383 Thai Name: บุคคลภายใน: ตั้งลายเซ็นในข้อมูลส่วนบุคคลและนำมาเติมอัตโนมัติ
MoM Quote: Item 8
"เจ้าของงาน/จป/พท: ถือว่าเป็นบุคคลภายในหน่วยงาน ให้มีระบบตั้งลายเซ็นในข้อมูลส่วนบุคคล เเละนำมาเติมในฟอร์มต่างๆอัตโนมัติ ไม่ต้องกรอกรหัสผ่านทุกครั้ง"
Description: Internal staff (WO, SO, WAO) can save their personal signature in Profile Settings. When signing any document, the saved signature auto-loads onto the canvas and password verification is skipped. Contractors must always verify with password. The "Use saved signature" button is also available for manual loading.
Location:
- Profile Settings → ลายมือชื่อส่วนตัว (save signature)
- Any form with signature fields → Signature dialog (auto-fill)
Behavior
| User Type | Saved Signature | Password | Auto-fill |
|---|---|---|---|
| Internal staff (WO, SO, WAO) | Yes → skip password | Not required | Signature auto-loads on dialog open |
| Internal staff (no saved) | Draw manually | Required | No auto-fill |
| Contractor | Draw manually | Always required | No auto-fill |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Save signature in Profile Settings → Signature appears with saved date | ⌛ Pending |
| 2 | WO/SO/WAO opens signature dialog → Saved signature auto-loads, password hidden, green banner shown | ⌛ Pending |
| 3 | Check confirmation checkbox → Click Sign → Signed without password | ⌛ Pending |
| 4 | Clear canvas → Draw new signature → Password field reappears | ⌛ Pending |
| 5 | Contractor opens signature dialog → No auto-fill, password required | ⌛ Pending |
| 6 | First-time dialog open (fresh login) → Signature still auto-loads (no timing issue) | ⌛ Pending |
9. Remove Workspace Owner from JSA workflow
Issue: #384 Thai Name: เจ้าของพื้นที่: ยังไม่เกี่ยวข้องกับ JSA ให้ตัดออก
MoM Quote: Item 9
"เจ้าของพื้นที่: ยังไม่เกี่ยวข้องกับ JSA ให้ตัดออก"
Description: Workspace Owner (WAO) role is removed from the JSA workflow entirely — both workflow commands and signature field.
Location: My Tasks → JSA task → JSA document → Signatures section
Changes
| Area | Before | After |
|---|---|---|
| Workflow commands | WAO had no commands | No change (already correct) |
| Signature section | 4 fields: ผู้จัดทำ, ผู้อนุมัติ, เจ้าของพื้นที่, ผู้ควบคุมงาน | 3 fields: ผู้จัดทำ (ผู้รับเหมา), ผู้อนุมัติ (เจ้าหน้าที่ความปลอดภัย), ผู้อนุมัติ (เจ้าของงาน) |
| Layout | 4 equal columns | 4 columns: Contractor (col 1), empty (col 2), SO (col 3), WO (col 4) |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | JSA workflow does not assign any tasks to Workspace Owner | 🔍 In Review |
| 2 | JSA signature section shows 3 signatures (no WAO) | ⌛ Pending |
| 3 | Contractor signature on the left, SO and WO on the right | ⌛ Pending |
| 4 | Labels show role names: ผู้อนุมัติ (เจ้าหน้าที่ความปลอดภัย), ผู้อนุมัติ (เจ้าของงาน) | ⌛ Pending |
10. Co-approval status via signature fields
Issue: #385 Thai Name: อนุมัติร่วม: ดูสถานะการอนุมัติแต่ละตำแหน่งจากช่องลายเซ็น
MoM Quote: Item 10
"เจ้าของงาน/จป : กรณีอนุมัติร่วมทุกครั้ง จะมีวิธีการใดทราบว่าแต่ละส่วนตำแหน่งอื่นอนุมัติเเล้ว ถ้าทำตามข้อ 9 ดูที่ช่องลายเซ็นได้หรือไม่"
Description: During co-approval, each role's approval status should be visible via the signature fields. Once a role approves (and their signature is filled), other approvers can see who has already signed.
Location: My Tasks → Any task with co-approval → Signature section
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | WO approves → Signature appears in WO field | ⌛ Pending |
| 2 | SO opens same task → Can see WO's signature already filled | ⌛ Pending |
| 3 | SO approves → Both signatures visible | ⌛ Pending |
11. Save completed JSA as personal template
Issue: #386 Thai Name: เจ้าของงาน: JSA ที่เสร็จแล้วให้มีปุ่มบันทึกต้นแบบของฉัน
MoM Quote: Item 11
"เจ้าของงาน: JSA ในงานที่เสร็จสิ้นเเล้ว ต้องแก้ไขไม่ได้ แต่ ให้มีปุ่มบันทึกต้นแบบของฉัน"
Description: When viewing a completed JSA task, the form is read-only but a "Save as Template" button is available for Contractor, Work Owner, and Safety Officer to save the JSA as a reusable template. Contractor saves as a Contractor template; WO and SO save as System templates. Additionally, Work Owner now has access to the JSA Template settings page (เครื่องมือ → ต้นแบบ JSA) for full template management.
Location:
- My Tasks → Completed JSA task → JSA form → "บันทึกเป็นต้นแบบ" button
- เครื่องมือ → ต้นแบบ JSA (now available for WO)
Behavior
| Role | Save as Template | Template Type | JSA Template Settings |
|---|---|---|---|
| Contractor | Yes | Contractor template | Yes (own templates) |
| Work Owner | Yes | System template | Yes (system templates) |
| Safety Officer | Yes | System template | Yes (system templates) |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open completed JSA as WO → Form is read-only, "Save as Template" button visible | ⌛ Pending |
| 2 | Open completed JSA as Contractor → "Save as Template" button visible | ⌛ Pending |
| 3 | Open completed JSA as SO → "Save as Template" button visible | ⌛ Pending |
| 4 | WO clicks "Save as Template" → Template saved successfully | ⌛ Pending |
| 5 | Contractor clicks "Save as Template" → Template saved successfully | ⌛ Pending |
| 6 | WO opens เครื่องมือ → ต้นแบบ JSA → Page loads (no redirect) | ⌛ Pending |
| 7 | WO can edit, create, and remove system templates | ⌛ Pending |
| 8 | New JSA task → Can select saved template | ⌛ Pending |
12. Admin: Configure work hours setting
Issue: #387 Thai Name: System Admin: ตั้งค่าเวลางาน
MoM Quote: Item 12
"system admin ให้ตั้งค่าเวลางานได้ เช่นเริ่ม 8.00-17.00"
Description: System administrators can configure work hours (start time and end time) in system settings. The settings page uses a tab layout for scalability: "ทั่วไป" (General) tab for regional settings and "เวลาทำงาน" (Work Hours) tab for work hours. Time inputs use Angular Material Timepicker with 30-minute intervals.
Location: เครื่องมือ → ตั้งค่าระบบ → แท็บ "เวลาทำงาน"
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Admin opens system settings → Two tabs visible: "ทั่วไป" and "เวลาทำงาน" | ⌛ Pending |
| 2 | Click "เวลาทำงาน" tab → Work hours section visible with time pickers | ⌛ Pending |
| 3 | Set start time to 08:00 and end time to 17:00 → Click Save → Saved | ⌛ Pending |
| 4 | Refresh page → Values persist | ⌛ Pending |
| 5 | Click time picker → Options list opens → Click outside → List closes | ⌛ Pending |
13. Default tool inspection time to work start time
Issue: #388 Thai Name: ผู้รับเหมา: เวลานัดตรวจเครื่องมือให้เป็นเวลาเริ่มงานเป็นค่าเริ่มต้น
MoM Quote: Item 13
"ผู้รับเหมา: เวลานัดตรวจเครื่องมือให้เป็นเวลาเริ่มงานเป็นค่าเริ่มต้น"
Description: When contractor opens the tool list form, the time picker shows the configured work start time as the default. When picking an appointment date for the first time, the time is automatically set to the work start time. Contractor can still override the time.
Location: My Tasks → Tool List Preparation → วัน/เวลานัดตรวจ
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Admin sets work hours to 09:00-18:00 → Open tool list as contractor → Time picker shows 09:00 | ⌛ Pending |
| 2 | Pick appointment date → Time auto-fills with work start time | ⌛ Pending |
| 3 | Contractor changes the time to a different value → Saved | ⌛ Pending |
| 4 | Change date after time is set → Existing time preserved (not reset) | ⌛ Pending |
14. Lock issue date and change trash icon to black
Issue: #389 Thai Name: ผู้รับเหมา: ออกวันที่ต้องแก้ไขไม่ได้ และไอคอนถังขยะเปลี่ยนเป็นสีดำ
MoM Quote: Item 14
"ผู้รับเหมา : รายการเครื่องมือ > ออกวันที่ต้องแก้ไขไม่ได้ เและ ไอคอนถังขยะเปลี่ยนเป็นสีดำ"
Description: In the tool list:
- Issue date (ออกวันที่) field should be read-only for contractors
- Trash/delete icon should be black instead of gray
Location: My Tasks → Tool List Preparation → Tool items table
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open tool list as contractor → Issue date field is read-only | ⌛ Pending |
| 2 | Trash icon is black (not gray) | ⌛ Pending |
| 3 | Trash icon still works to delete the item | ⌛ Pending |
15. Tool inspection: Auto-fill date on Pass, remark on Fail
Issue: #390 Thai Name: เจ้าของงาน: ตรวจเครื่องมือ Pass จะออกวันที่ ณ ตอนนั้น / Fail ให้แก้ไข remark ได้
MoM Quote: Item 15
"เจ้าของงาน: ตรวจเครื่องมือถ้ากด Pass จะออกวันที่ ที่ ณ ตอนนั้น (แต่ยังสามารถแก้ไขเปลี่ยนได้) ถ้ากด Fail ไม่ขึ้นวันที่ในช่อง ออกวันที่ เเลให้แก้ไข remark ได้"
Description: When Work Owner inspects tools:
- Pass: Auto-fill issue date with current date (still editable)
- Fail: Clear issue date, show remark field for comments
Location: My Tasks → Tool List Preparation → Review state (WO) → Tool inspection
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Mark tool as Pass → Issue date auto-fills with today's date | ⌛ Pending |
| 2 | Pass date is still editable (can change to different date) | ⌛ Pending |
| 3 | Mark tool as Fail → Issue date is cleared | ⌛ Pending |
| 4 | Fail → Remark field becomes editable | ⌛ Pending |
| 5 | Change from Pass to Fail → Date cleared, remark shown | ⌛ Pending |
16. Remove reject button from tool list
Issue: #391 Thai Name: เจ้าของงาน: รายการเครื่องมือปุ่มปฏิเสธนำออก
MoM Quote: Item 16
"เจ้าของงาน: รายการเครื่องมือปุ่ม ปฏิเสธ นำออก"
Description: Remove the Reject button from the Tool List review state. Only Approve and Request Change should remain.
Location: My Tasks → Tool List Preparation → WO review state
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open tool list as WO reviewer → No "Reject" button visible | ⌛ Pending |
| 2 | Approve and Request Change buttons still work normally | ⌛ Pending |
17. WO: Signature auto-fill follows personal settings
Issue: #392 Thai Name: เจ้าของงาน: ลายเซ็นยึดตามข้อ 9 (ตั้งค่าส่วนบุคคล)
MoM Quote: Item 17
"เจ้าของงาน : ลายเซ็นยืดตามข้อ 9"
Description: Same behavior as #383 — applies to Work Owner specifically. When WO signs any approval form (Tool List inspection, JSA approval, etc.), the saved personal signature auto-loads and password is skipped. WO only needs to check the confirmation checkbox and click Sign.
Location: My Tasks → Tool List / JSA approval → Signature fields → Signature dialog
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | WO has saved signature → "Use saved signature" appears in dialog | ⌛ Pending |
| 2 | Click "Use saved signature" → Signature loaded → Verify with password → Signed | ⌛ Pending |
18. Remove tool list requirement from WP
Issue: #393 Thai Name: ผู้รับเหมา: ตอนขอ WP ไม่ต้องมีรายการเครื่องมือ
MoM Quote: Item 18
"ผู้รับเหมา: ตอนขอ WP ไม่ต้องมีรายการเครื่องมือ (จะเป็นการตรวจสติ๊กเกอร์หมดอายุที่ตัวเครื่องมือ โดยสติ๊กเกอร์นี้ติดไว้ตอนตรวจเครื่องมือ)"
Description: Work Permit request does not require a completed tool list. The tool sticker check is done physically on the equipment itself. Already verified: no tool list prerequisite check exists in TaskLifecycleService.cs.
Location: My Tasks → Create Work Permit task
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Create WP without completed tool list → Allowed | 🔍 In Review |
Internal Improvements
19. Completed tasks: Force read-only mode on all document forms
Description: When a task is completed, cancelled, or not assigned to the current user, all document forms must be fully read-only. Previously, forms in generic-mode workflows (JSA, Tool List, Project Registration, Training Enrollment) remained editable even after task completion.
Location: All workflows except Work Permit (which already had correct behavior)
Root Cause: generic-task-document.component.ts always returned { canEdit: true, isLocked: false } regardless of task status.
Fix: Form permissions now respect the task's editability state (checks task status, assignee, and workflow terminal state).
Affected Workflows
| Workflow | Forms | Before | After |
|---|---|---|---|
| JSA Preparation | JSA Form | Editable on completed tasks | Read-only |
| Tool List Preparation | Tool List, Manpower Name List | Editable on completed tasks | Read-only |
| Project Registration | Project Registration, Pre-Work Procedures | Editable on completed tasks | Read-only |
| Training Enrollment | Training Enrollment Form | Editable on completed tasks | Read-only |
| Work Permit Request | All permit forms | Already correct | No change |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open completed JSA task → All fields read-only | ⌛ Pending |
| 2 | Open completed Tool List task → All fields read-only | ⌛ Pending |
| 3 | Open completed Project Registration → All fields read-only | ⌛ Pending |
| 4 | Open active task as non-assignee → Forms read-only | ⌛ Pending |
20. Digital signature behavior by role
Description: Summary of digital signature behavior across all user types. Internal staff (WO, SO, WAO) get auto-populated signatures with no password required. Contractors can save signatures but must click to insert and always verify with password.
Location: All forms with signature fields → Signature dialog
Behavior by Role
| Internal Staff (WO, SO, WAO) | Contractor | |
|---|---|---|
| Save signature in Profile | Yes | Yes |
| Auto-populate on dialog open | Yes (automatic) | No |
| "ใช้ลายมือชื่อที่บันทึกไว้" button | Yes (but not needed — already auto-loaded) | Yes — must click manually to insert |
| Password | Skipped (when using saved signature) | Always required |
| "บันทึกเป็นลายมือชื่อส่วนตัว" checkbox | Yes (when drawing new) | Yes (when drawing new) |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | WO opens signature dialog → Saved signature auto-loads, no password field | ⌛ Pending |
| 2 | SO opens signature dialog → Same auto-load behavior as WO | ⌛ Pending |
| 3 | Contractor opens signature dialog → No auto-load, password required | ⌛ Pending |
| 4 | Contractor clicks "ใช้ลายมือชื่อที่บันทึกไว้" → Signature inserted, password still required | ⌛ Pending |
| 5 | Internal staff clears canvas → Draws new signature → Password field reappears | ⌛ Pending |
21. Workflow status labels consistency
Description: Standardized workflow status labels across JSA and Tool List workflows for consistency.
Location: My Tasks → Task cards → Status labels
Changes
| Workflow | State | Before | After |
|---|---|---|---|
| JSA Preparation | SO Review | จป. ตรวจสอบ | ตรวจสอบร่วม (Co-Review) |
| JSA Preparation | Approved | เสร็จสิ้น | อนุมัติแล้ว (Approved) |
| JSA Preparation | Completed | เสร็จสิ้น | อนุมัติแล้ว (Approved) |
| Tool List Preparation | Approved | อนุมัติ | อนุมัติแล้ว (Approved) |
| Tool List Preparation | Completed | เสร็จสิ้น | อนุมัติแล้ว (Approved) |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | JSA task in SO review state → Shows "ตรวจสอบร่วม" | ⌛ Pending |
| 2 | Completed JSA task → Shows "อนุมัติแล้ว" (not "เสร็จสิ้น") | ⌛ Pending |
| 3 | Completed Tool List task → Shows "อนุมัติแล้ว" (not "เสร็จสิ้น") | ⌛ Pending |
22. Work Permit requires approved JSA
Description: Work Permit creation now requires an approved JSA for the same project. If JSA is not approved or still in progress, the system blocks WP creation with a specific error message.
Location: My Tasks → Create Task → Work Permit (สร้างงาน → การขอใบอนุญาตทำงาน)
Behavior
| JSA Status | WP Creation | Error Message |
|---|---|---|
| No JSA exists | Blocked | JSA ยังไม่ได้รับการอนุมัติ กรุณาอนุมัติ JSA ก่อนสร้าง Work Permit |
| JSA in progress | Blocked | JSA กำลังดำเนินการ กรุณารออนุมัติก่อนสร้าง Work Permit |
| JSA approved (Closed) | Allowed | — |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Create WP for project with no JSA → Error message shown | ⌛ Pending |
| 2 | Create WP for project with active JSA → Error message shown | ⌛ Pending |
| 3 | Create WP for project with approved JSA → Task created successfully | ⌛ Pending |
23. Project selection shows related task status
Description: The project selection dialog (used when creating Tool List, JSA, or Work Permit) now shows related task status badges for each project. For Work Permit creation, projects without an approved JSA are visually greyed out and show a warning.
Location: My Tasks → Create Task → Select Project dialog
Behavior
| Badge | Meaning |
|---|---|
| Green badge (e.g., "JSA: อนุมัติแล้ว") | Related task is approved |
| Yellow badge (e.g., "JSA: ตรวจสอบร่วม") | Related task is in progress |
| Red warning text | JSA not approved — WP creation blocked |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open project selection for WP → Projects show JSA/TL status badges | ⌛ Pending |
| 2 | Project with approved JSA → Selectable, green badge | ⌛ Pending |
| 3 | Project without approved JSA → Greyed out, shows warning | ⌛ Pending |
24. My Tasks: collapsible sub-categories and icon fix
Description: Two improvements to the My Tasks page:
- Finished tasks section now has individually collapsible sub-sections (อนุมัติแล้ว, งานที่ถูกปฏิเสธ, งานที่ยกเลิก) with chevron toggle icons
- Fixed expansion panel chevron icon not rotating to match expanded/collapsed state (was always pointing down)
Location: My Tasks page → Section headers
Behavior
| Section | Default State | Chevron |
|---|---|---|
| ต้องดำเนินการ | Always expanded | No toggle |
| รอผู้อื่นดำเนินการ | Collapsed | Down (collapsed) / Up (expanded) |
| งานที่เสร็จสิ้นแล้ว | Collapsed | Down (collapsed) / Up (expanded) |
| — อนุมัติแล้ว | Expanded (when parent open) | Down / Up |
| — งานที่ถูกปฏิเสธ | Collapsed | Down / Up |
| — งานที่ยกเลิก | Collapsed | Down / Up |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Expand "รอผู้อื่นดำเนินการ" → Chevron rotates to point UP | ⌛ Pending |
| 2 | Collapse section → Chevron rotates back to DOWN | ⌛ Pending |
| 3 | Expand "งานที่เสร็จสิ้นแล้ว" → Sub-sections visible with their own toggles | ⌛ Pending |
| 4 | Collapse/expand individual sub-sections → Works independently | ⌛ Pending |
25. System Settings: tab layout and timepicker
Description: System Settings page reorganized from stacked cards to a tabbed layout. Work hours now use Angular Material Timepicker with 30-minute interval dropdown instead of plain HTML time inputs.
Location: เครื่องมือ → ตั้งค่าระบบ
Changes
| Area | Before | After |
|---|---|---|
| Layout | Two stacked cards | Two tabs: "ทั่วไป" and "เวลาทำงาน" |
| Time input | Plain HTML <input type="time"> | Angular Material Timepicker with 30-min intervals |
| Time selection | Manual typing | Dropdown list (00:00, 00:30, 01:00, ...) |
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open system settings → Two tabs visible | ⌛ Pending |
| 2 | "ทั่วไป" tab → Regional settings (first day of week) | ⌛ Pending |
| 3 | "เวลาทำงาน" tab → Time pickers with 30-min intervals | ⌛ Pending |
| 4 | Select time from dropdown → Value saved correctly | ⌛ Pending |
26. Document-Level Approval for JSA review
Description: Replaced the simple view-tracking mechanism (items 4 and 5) with a formal document-level approval system. During the JSA review state, WO/SO must individually approve each JSA document before executing the workflow-level "Approve JSA" command. Approvals are stored in Temporal workflow state and cleared automatically on Request Change.
Location: My Tasks → JSA Preparation task → Review state → Each JSA document
Key Changes
| Area | Before | After |
|---|---|---|
| Approval mechanism | View tracking (open each JSA) | Per-document approve button on toolbar |
| Approve button behavior | Disabled until all viewed | Always clickable, hard validation on click |
| Visual feedback | None | Green background/border on approved documents in list |
| Form editability | Editable during review | Read-only during review (view + approve only) |
| Approval state | Frontend-only (lost on refresh) | Stored in Temporal workflow (persistent) |
| Co-review (WO + SO) | Shared view tracking | Independent approvals per reviewer |
| On Request Change | View state cleared | All document approvals cleared |
Approve Button States
| State | Button | Icon | Style |
|---|---|---|---|
| Not approved | "อนุมัติเอกสาร" | check_circle_outline | Gray border |
| Approved | "อนุมัติแล้ว" | verified | Green border, green background |
Hard Validation Dialog
When clicking "Approve JSA" without approving all documents:
- Title: "ไม่สามารถอนุมัติได้"
- Message: "กรุณาอนุมัติเอกสาร JSA ทุกรายการก่อนอนุมัติงาน"
- Count: "อนุมัติแล้ว N จาก M รายการ"
What to Test
| # | Test Case | Status |
|---|---|---|
| 1 | Open JSA as WO reviewer → Form is read-only (no editing, no add row, no delete) | ⌛ Pending |
| 2 | Approve button visible on JSA form toolbar (left side) | ⌛ Pending |
| 3 | Click approve → Button changes to green "อนุมัติแล้ว" | ⌛ Pending |
| 4 | Click "อนุมัติแล้ว" again → Revokes approval (back to gray) | ⌛ Pending |
| 5 | Document list → Approved JSA shows green background and bold green left border | ⌛ Pending |
| 6 | Click "Approve JSA" without all approved → Error dialog with count | ⌛ Pending |
| 7 | Approve all JSA documents → Click "Approve JSA" → Confirmation dialog opens | ⌛ Pending |
| 8 | WO approves all + executes Approve → SO opens task → SO must approve independently | ⌛ Pending |
| 9 | SO sends Request Change → Contractor resubmits → All approvals cleared | ⌛ Pending |
| 10 | Non-JSA workflows (Project Registration, Tool List) → No approve button on documents | ⌛ Pending |
Summary
| # | Feature | Issue | Type | Status |
|---|---|---|---|---|
| 1 | Prevent backdating dates | #376 | Enhancement | ✅ Done |
| 2 | Contractor edit signatures | #377 | Enhancement | ✅ Done |
| 3 | Email notification mismatch | #378 | Bug Fix | ✅ Done |
| 4 | JSA submit from main page | #379 | Enhancement | ✅ Done |
| 5 | Approve all JSA docs before approve | #380 | Enhancement | ✅ Done |
| 6 | Remove JSA rejection | #381 | Enhancement | ✅ Done |
| 7 | JSA comments for WO/SO | #382 | Enhancement | ✅ Done |
| 8 | Auto-fill signature | #383 | Enhancement | ✅ Done |
| 9 | Remove WAO from JSA | #384 | Enhancement | ✅ Done |
| 10 | Co-approval status | #385 | Enhancement | ✅ Done |
| 11 | Save JSA as template | #386 | Enhancement | ✅ Done |
| 12 | Work hours setting | #387 | Enhancement | ✅ Done |
| 13 | Default inspection time | #388 | Enhancement | ✅ Done |
| 14 | Lock issue date + icon | #389 | Enhancement | ✅ Done |
| 15 | Pass/Fail auto-date | #390 | Enhancement | ✅ Done |
| 16 | Remove tool list rejection | #391 | Enhancement | ✅ Done |
| 17 | WO signature auto-fill | #392 | Enhancement | ✅ Done |
| 18 | Remove TL from WP | #393 | Enhancement | 🔍 In Review |
| 19 | Force read-only on completed tasks | — | Bug Fix | 🔍 In Review |
| 20 | Digital signature behavior by role | — | Enhancement | 🔍 In Review |
| 21 | Workflow status labels consistency | — | Enhancement | 🔍 In Review |
| 22 | Work Permit requires approved JSA | — | Enhancement | 🔍 In Review |
| 23 | Project selection related task status | — | Enhancement | 🔍 In Review |
| 24 | My Tasks collapsible sub-categories + icon fix | — | Bug Fix | 🔍 In Review |
| 25 | System Settings tabs + timepicker | — | Enhancement | 🔍 In Review |
| 26 | Document-Level Approval for JSA review | — | Enhancement | 🔍 In Review |