Skip to content

Link an affiliation's FileMaker code to the archive - #2649

Merged
maebeale merged 1 commit into
mainfrom
maebeale/archive-links-affiliations
Oct 13, 2026
Merged

maebeale merged 1 commit into
mainfrom
maebeale/archive-links-affiliations

Conversation

@maebeale

@maebeale maebeale commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 one model declaration, one form field, admin-only

Admins can open an affiliation's FileMaker record from its edit page, and the archive record links back to the affiliation.

  • Affiliation → fm_projects, then fm_personnels, per ADR-0005. Production affiliation codes are their program's project id (1,531 of 1,535), with one real PS personnel id.
    • ADR-0005's affiliation row now names this link instead of "no UI link yet".
  • A project's archive page lists the affiliations carrying its code, next to its org. On a big program that can be a long list of "Person at Org" chips.
  • Uses the hint pattern from JM: Put FileMaker archive buttons beside person and org codes, and link back #2648: "In the archive: P2775" under the code input. A code with no archive row shows struck through.
  • Including FilemakerCoded also applies its normalizes to affiliation codes: whitespace is stripped and the list is saved sorted.

🤖 Generated with Claude Code

@maebeale
maebeale marked this pull request as ready for review October 12, 2026 20:04
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch 2 times, most recently from 526132a to 16a98ab Compare October 12, 2026 22:02
@maebeale
maebeale force-pushed the maebeale/archive-links-affiliations branch from 282928a to d725a87 Compare October 12, 2026 22:17
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch from d1cea11 to af52177 Compare October 12, 2026 22:47
@maebeale
maebeale force-pushed the maebeale/archive-links-affiliations branch from d725a87 to 9612125 Compare October 12, 2026 22:51
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch 2 times, most recently from 45dd33c to ddde227 Compare October 12, 2026 23:26
@maebeale
maebeale force-pushed the maebeale/archive-links-affiliations branch from 9612125 to 1e2ff66 Compare October 12, 2026 23:27
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch from ddde227 to 4976121 Compare October 12, 2026 23:37
@maebeale

Copy link
Copy Markdown
Collaborator Author

🤖 From Claude: Production data says affiliation codes are project ids, not Personnel ids, so filemaker_archived_in FmPersonnel would strike through nearly every one. Details below; ADR-0005 on #2648 now records all of this.

What prod affiliations hold (read-only profile, 2026-10-12)

  • 1,535 codes: 1,531 are P + 4 digits, 1 is a real PS Personnel id, 3 are junk (ORG05589, PP208, 09856).
  • All 1,531 P codes are real projects, and 1,518 equal the affiliation's own org code.
  • Read as Personnel ids missing the S: the name matched the affiliation's person once, its project matched the org never. As participant ids: never the org.
  • 13 carry a real project that isn't their org's code — wrong org, or an org missing that code. Worth a hand check.

Change before merging

  • Affiliation: filemaker_archived_in FmProject, FmPersonnel (projects first; Personnel catches the lone PS).
  • Keep it to the field hint (filemaker_code_hint). A nav button would just repeat the org page's "FM project" link 99% of the time.
  • A real Personnel link (person × project) isn't derivable yet: it needs the person's Rolodex code, and only one prod person has one.
  • With Affiliation in PORTAL_MODELS and archived in FmProject, a project's archive page lists every affiliation on that project under "In the portal". Fine if wanted; otherwise cap it or group it under the org.
  • Dev seed (Seed fake FileMaker archive data for dev + ADR for filemaker_code mapping #2658) stamps affiliations with PS… codes. Switch to the org's P… code so dev matches prod.

Rebase notes once #2648 merges (it moved a lot)

  • filemaker_agency_links → filemaker_organization_links; new filemaker_project_links; "FM agency" → "FM organization".
  • Organization is now filemaker_archived_in FmProject, FmOrganization; codes match in full (P00023 ≠ ORG00023 ≠ 00023).
  • FilemakerCoded: commas are the only separator, all whitespace is dropped (Ruby + SQL REGEXP_REPLACE … [[:space:]]), and normalizes saves the sorted a, b form. Including it on Affiliation picks all that up.
  • New with_any_filemaker_code(codes) scope; fm_archives#show also lists orgs through Project.OrgID for FM organization pages.
  • Expect conflicts in filemaker_helper.rb, filemaker_coded.rb, fm_archives_controller.rb, the org/people edit views, ADR-0005, features.yml, and the three FileMaker specs.

Base automatically changed from maebeale/archive-data-filemaker to main October 13, 2026 00:51
The affiliation edit page took a FileMaker code but offered no way to open it.
Per ADR-0005, production affiliation codes are their program's project id, with
one real Personnel id, so affiliations look a code up in projects, then
personnel. A project's archive page lists the affiliations carrying its code
alongside its org.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/archive-links-affiliations branch from 1e2ff66 to 64e9837 Compare October 13, 2026 01:28
@maebeale
maebeale merged commit cd131a3 into main Oct 13, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/archive-links-affiliations branch October 13, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant