clickup-execute-sys-2012-2026-05-19

activetype/docdomain/execution

ClickUp Execute Report — SYS-2012 — PID Validation in Custom Cover Letter

TL;DR

Bug: after selecting Yes, entering a PID, then switching Set PID? to No, submit still showed a PID mandatory alert on Custom Cover Letter create (generate-cl). Fixed by syncing PID validators before submit and refreshing control validity on toggle (parity with view-cl edit flow). Time tracking could not start (ClickUp Advanced Time Tracking usage limit).

ClickUp Context

  • Task: https://app.clickup.com/t/86b9wj4te
  • Status: to do
  • Assignees: Mg Terok
  • Due date: none
  • Parent/Subtasks: none
  • Problem statement from task:
    • Alert "PID mandatory" appears when user selects No after previously selecting Yes and entering a PID.
    • Repro: Yes → input PID → No → Submit.

Obsidian Context (Projects)

  • [[Projects/anabatic-contract-management-system/anabatic-contract-management-system]] — CMS hub; Custom cover letters use template_for_id === 1 (see generate-cl.component.ts).
  • [[Projects/anabatic-contract-management-system/context/index]] — vault context index for CMS.

Obsidian Context (Resources)

  • No additional Resources notes referenced; fix is localized to frontend form validation.

Proposed Execution Plan

  1. Locate PID / need_pid handling in cover letter modules.
  2. Compare create (generate-cl) vs edit (view-cl) submit paths.
  3. Port syncNeedPidAndPidFieldBeforeSubmit and harden changeNeedPID on create.
  4. Manual QA on Custom CL create path.

Executed Changes

  • Repo: frontend-contract-portal-dev
  • File: src/app/modules/generate-cl/generate-cl.component.ts
    • Added syncNeedPidAndPidFieldBeforeSubmit() — aligns need_pid, need_pid_label, showPID, and pid validators with current Y/N selection before validation.
    • saveCoverLetter() now calls sync before updateValueAndValidity / invalid-form Swal.
    • changeNeedPID() now clears validators, nulls pid when No, patches need_pid_label, and calls updateValueAndValidity on the pid control (fixes stale required state after Yes → No).
  • Note: view-cl already had syncNeedPidAndPidFieldBeforeSubmit at submit; bug was specific to create flow.

Acceptance Criteria Mapping

CriterionVerification
No PID mandatory alert when Set PID? = No after Yes → PID → NoManual: Custom CL create → Yes → type PID → No → Submit or Save Draft — form should proceed without PID in invalid list
Yes still requires PIDManual: Yes → empty PID → Submit — PID should appear in invalid modal
Edit draft path unaffected / consistentview-cl already syncs on submit; spot-check edit if QA has bandwidth

Risks and Unknowns

  • Risk: Other cover letter surfaces (e.g. legacy template paths) might duplicate PID logic — mitigated by matching view-cl pattern.
  • Unknown: Whether reporters also hit edit (view-cl) before fix; edit path was already guarded.

Validation Plan

  • Manual repro on generate-cl (Custom, template_for_id=1).
  • Optional: extend Playwright cover-letter flow for Yes → PID → No → submit (not run in this session).

Validation Results

  • Lint: No issues on generate-cl.component.ts (IDE diagnostics).
  • Build / E2E: Not run (workspace rules: no build; Playwright needs env/auth).
  • ClickUp time tracking: Failed — workspace Advanced Time Tracking at 100/100 usage limit.

Next Actions

  1. Mg Terok / QA: Manual verify repro on beta/local Custom CL create.
  2. Mg Terok: Move SYS-2012 to in review / done after QA sign-off.
  3. Optional: Add Playwright case for PID toggle regression on custom create.

Sources

  • https://app.clickup.com/t/86b9wj4te
  • [[Projects/anabatic-contract-management-system/anabatic-contract-management-system]]
  • frontend-contract-portal-dev/src/app/modules/generate-cl/generate-cl.component.ts
  • frontend-contract-portal-dev/src/app/modules/view-cl/view-cl.component.ts (reference implementation)

Related

  • Intake: moved from Inbox/clickup-execute-SYS-2012-2026-05-19.md during scheduled inbox triage (2026-05-19).
  • Stale duplicate of this note removed again from Inbox/ (scheduled triage 2026-05-20); inbox copy used broken hub path Projects/contract-management-system/….