chore: ADR-0079 — migrate record titles to nameField (framework v11)#80
Merged
Conversation
…ADR-0079)
ADR-0079 retires the render-only `titleFormat` template (the server can't
return or query it) in favor of `displayNameField`, which names a REAL field
holding the record's display title.
Migrated all 40 objects that declared a `titleFormat`:
- Single placeholder `{{record.X}}` → `displayNameField: 'X'`, removed
titleFormat (most objects; 18 already had a matching displayNameField, so
only the redundant titleFormat + now-unused tmpl import were dropped).
- Composites with all-local placeholders → added a stored `display_name`
formula field and pointed displayNameField at it:
* compliance_control F`coalesce(record.code,'') + ' · ' + coalesce(record.title,'')`
* hr_time_off_request F`coalesce(record.leave_type,'') + ' · ' + string(record.start_date) + ' → ' + string(record.end_date)`
* procurement_receipt F`'Receipt ' + coalesce(record.receipt_number,'')`
* hr_employee F`!isBlank(record.preferred_name) ? record.preferred_name : record.full_name`
(helpdesk_ticket already had displayNameField:'name', a real field — kept
that rather than re-introducing a composite formula.)
- Placeholders that were lookups or dot-walks (unreferenceable in a stored
field per ADR-0072) → degraded to the most identifying LOCAL field, with a
code comment noting the dropped reference:
* content_metric → period_start (dropped {{publication}} lookup)
* content_publication → published_at (dropped {{piece}}/{{channel}} lookups)
* pm_timesheet → work_date (dropped {{person.name}} dot-walk)
* pm_resource → role (dropped {{person.name}}/{{project.name}} dot-walks)
CEL string concat uses single-quoted literals with nullable operands wrapped
in coalesce(…, '') and date fields in string(…); verified against the real
@objectstack/formula engine.
Build (objectstack build, all 9 packages), typecheck (tsc --noEmit), and
prettier --check all pass. Zero titleFormat / tmpl references remain.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Completes the ADR-0079 record-title migration on framework v11.2.0, which lands `nameField` as the canonical title key. v10 only had the `displayNameField` alias and rejected `nameField` (ADR-0032 unknown-key guard), so the first migration pass targeted the alias. - Bump all @objectstack/* ^10.2.0 → ^11.2.0 across 10 domain packages (+ pnpm-workspace.yaml release-age pins) - Rename displayNameField → nameField across all 40 migrated objects (single-field titles + composite formula-field titles) Verified on v11.2.0: pnpm -r build OK (9 packages), pnpm -r typecheck clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADR-0079 — 记录标题迁移到
nameField(canonical)退役 render-only 的
titleFormat(服务端无法返回 / 查询 / 排序它),改用 ADR-0079 的nameField—— 指向一个真实存储字段作为记录标题。改动
nameField是 v11 才落地的 canonical 键(v10 仅有displayNameField别名,且 ADR-0032 未知键守卫直接拒nameField)。nameField: 'the_field'。returnType: 'text'的 formula 字段并指定为nameField(服务端可返回 / 排序)。验证(v11.2.0)
build✓ /typecheck✓ /validate(仅既有 widget 警告)/test全过。配合 framework#2434(foundation)+ #2458(autoprov)+ #2463(lint gate)。