Skip to content

feat(developer): write content-type local field display labels (#4463) - #4469

Merged
natechadwick merged 1 commit into
mainfrom
feat/issue-4463-ct-field-label-write
Sep 12, 2026
Merged

natechadwick merged 1 commit into
mainfrom
feat/issue-4463-ct-field-label-write

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

Summary

Parent: #1690 slice 12 (CT_FIELD_LABELS_WRITE). An Admin with a held content-type design lock can set a local field display label from Developer → Content Types field table. PUT /services/contenttypes/{idOrName} writes fields[].label onto the display mapping (Workbench UI set). GET round-trips the stored label (trailing colon when the value does not already end with :). System/shared labels stay 400. Blank label is 400. Unknown field is 404. Unlocked/stolen lock is 409. Non-Admin is 403. Live designGaps no longer emits CT_FIELD_LABELS_WRITE.

Operator: Grok: night-issue-prs (model grok-4.6)

Fixes #4463

Test plan

  1. Standalone mvnw clean install on rest, projects/sitemanage, WebUI (see C3).
  2. QA H2: perc-devctl qa-up --skip-image-build → qa-health → qa-deploy-war-jars --restart-jetty → qa-health → qa-deploy-webui → qa-health.
  3. npm run test:surface -- --path tests/developer-content-type-field-labels.spec.js (2 passed). Console clean; no related server.log ERROR/FATAL in the test window.
  4. Reviewer: Admin → Developer → Content Types → Lock → edit a local field label → Save (lock stays held) → GET detail shows the new label.

Checklist

  • Product documentation — updated product-docs/8.2/admin/developer-content-types.md and product-docs/8.2/developer/rest.md
  • Unit / module tests — adaptor + REST resource + Vitest on ContentTypeDetailPanel; changed modules green under standalone mvnw clean install
  • WebUI + Playwright — modules/perc-qa-automation/frontend/tests/developer-content-type-field-labels.spec.js
  • Build gates — each changed Maven module: standalone clean install (no skipTests); reverse-deps when final/API shape changes
  • Cross-platform — N/A (no path/file I/O)

C3 evidence

  • modules_built: rest, projects/sitemanage, WebUI
  • build_evidence:
    • cd rest && ../mvnw.cmd clean install — BUILD SUCCESS; Tests run: 1394, Failures: 0
    • cd projects/sitemanage && ../../mvnw.cmd clean install — BUILD SUCCESS; Tests run: 2715, Failures: 0, Skipped: 125
    • cd WebUI && ../mvnw.cmd clean install — BUILD SUCCESS; Surefire Tests run: 69, Failures: 0; Vitest Tests 4235 passed (443 files)
  • downstream_checked: sitemanage standalone clean install (implements rest IContentTypesAdaptor; no final/signature break). No extra reverse-deps required.

C5 UI proof

  • qa-up: python docker/scripts/perc-devctl.py qa-up --skip-image-build — RESULT:OK; TEST_CMS_URL=http://127.0.0.1:9993; container perc-matrix-cms-h2
  • qa-health after up: RESULT:OK HTTP:200 HEALTH:healthy
  • deploy: qa-deploy-war-jars --restart-jetty RESULT:OK; qa-health again RESULT:OK; qa-deploy-webui RESULT:OK; qa-health RESULT:OK
  • Playwright: npm run test:surface -- --path tests/developer-content-type-field-labels.spec.js — 2 passed (11.2s)
  • console-clean=yes
  • server.log-clean=yes (test window: login + local-field ALTER/save; no ERROR/FATAL for this feature)

Co-Authored by Grok Build 1.0.25 using grok-4.6 with agent night-issue-prs.

Admin PUT content-type detail now persists local field display labels
on the display mapping (held lock). SPA Fields table edits labels after
Lock; Save keeps the lock. Drop CT_FIELD_LABELS_WRITE from designGaps.

> Co-Authored by Grok Build 1.0.25 using grok-4.6 with agent night-issue-prs.
@kilo-code-bot

kilo-code-bot Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (14 files)
  • projects/sitemanage/src/main/java/com/percussion/apibridge/ContentTypeAdaptor.java — new applyLocalFieldDisplayLabel (static, package-private) correctly enforces local-field-only, blank→400, system/shared→400, unknown field→404; refactored applyFieldUpdates to use existing findField helper (consistent with lines 1637/1691/1825); CT_FIELD_LABELS_WRITE gap removed. Error types match mapMutationFailure mapping in rest (IllegalArgumentException→400, WebApplicationException→pass-through 404).
  • projects/sitemanage/src/test/java/com/percussion/apibridge/ContentTypeAdaptorUpdateTest.java — 4 adaptor tests cover success, blank-label-400, system-field-400, unknown-field-404; stub helpers match production types (PSField with TYPE_LOCAL/TYPE_SYSTEM).
  • projects/sitemanage/src/test/java/com/percussion/apibridge/DesignGapsStructuredTest.java — asserts CT_FIELD_LABELS_WRITE no longer emitted.
  • rest/src/main/java/com/percussion/rest/contenttypes/ContentTypeField.java — @Schema doc updated for label.
  • rest/src/main/java/com/percussion/rest/contenttypes/ContentTypesResource.java — @ApiResponse descriptions updated to mention blank/system-shared label (400) and content type/field not found (404); consistent with mapMutationFailure.
  • rest/src/main/java/com/percussion/rest/contenttypes/IContentTypesAdaptor.java — Javadoc updated to mention local field label.
  • rest/src/test/java/com/percussion/rest/contenttypes/ContentTypesResourceDetailTest.java — 2 resource-level tests verify 400 (blank label) and 404 (unknown field) mapping through mapMutationFailure.
  • WebUI/src/main/ts/api/developer/contentTypesApi.ts — label added to ContentTypeUpdateBody.fields Pick type.
  • WebUI/src/main/ts/developer/ContentTypeDetailPanel.tsx — label input rendered only for draft && isLocal fields; disabled when !canEdit; setFieldLabel guards on cur.local; handleSave validates blank local labels before PUT; patch sends d.label.trim() only for local fields with changed labels; fieldsDirty/dirty flags track label changes correctly.
  • WebUI/src/main/ts/developer/messages.ts — CT_FIELD_LABEL_BLANK added; CT_FIELDS_HINT updated.
  • WebUI/src/test/ts/developer/ContentTypeDetailPanel.test.tsx — 4 Vitest cases cover read-only-until-lock, save-with-label-keeps-lock, blank-label-400, system-field-no-input.
  • modules/perc-qa-automation/frontend/tests/developer-content-type-field-labels.spec.js — Playwright spec with console guards, lock-409 non-theft, and GET round-trip verification.
  • product-docs/8.2/admin/developer-content-types.md — documents local field label edit after lock and status codes.
  • product-docs/8.2/developer/rest.md — PUT description and status-code table updated.

No CRITICAL, WARNING, or SUGGESTION findings. The change class (label write on PUT detail) is fully closed: adaptor interface doc, adaptor impl, adaptor + resource unit tests, WebUI input + Vitest, Playwright E2E, and product docs are all present and consistent. Error mapping through mapMutationFailure correctly produces 400 for IllegalArgumentException (blank/system-shared label) and 404 for WebApplicationException (unknown field), matching the documented status codes.

Fix Link: https://app.kilo.ai/cloud-agent-fork/review/86317655-8006-4790-afa5-12795ce622bd


Reviewed by free · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@natechadwick
natechadwick merged commit f2c6e42 into main Sep 12, 2026
9 checks passed
@natechadwick
natechadwick deleted the feat/issue-4463-ct-field-label-write branch September 12, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model:grok-4.6 Session model grok-4.6 operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue 1690 slice 12: content-type field display label write (CT_FIELD_LABELS_WRITE)

2 participants