Skip to content

JM: Put FileMaker archive buttons beside person and org codes, and link back - #2648

Merged
maebeale merged 17 commits into
mainfrom
maebeale/archive-data-filemaker
Oct 13, 2026
Merged

maebeale merged 17 commits into
mainfrom
maebeale/archive-data-filemaker

Conversation

@maebeale

@maebeale maebeale commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 helper + concern seam, admin-only views across people/orgs/archive

Admins can jump straight between a person or org and its FileMaker archive record, in both directions. If there's a code, but it doesn't match, it shows as strikethrough.

Fixes

  • Archive links skipped the policy. The edit-page nav buttons checked only ?admin=true. An owner editing their own profile with that param saw their FileMaker code and a link that 403s.
    • filemaker_archive_links now checks allowed_to?(:show?, :fm_archive) and returns nothing otherwise.
    • With the policy check in place, the ?admin=true gate is no longer needed.

Changes

  • Archive links in the code field's hint on person and org edit ("In the archive: 00006 00012").
    • A code with no archive row renders struck through, flagging a likely typo. line-through! so a link class's underline can't hide it.
  • Nav buttons read just "Rolodex" / "FM project" / "FM organization" when there's one code. With several, each button adds its code. "Rolodex" sits left of "Activity".
    • Nav buttons appear only for codes the archive holds. A missing code shows struck through in the hint, never as a dead nav button.
  • Org codes match in full against FM projects or FM organizations. P00023 and ORG00023 are different records; a bare 00023 matches neither.
    • Org edit nav: "FM project" for its projects. "FM organization" for direct ORG… codes plus each project's parent (Project.OrgID), de-duplicated.
    • FM organization archive pages link back to orgs carrying that ORG… code or any of its projects' codes (Project.OrgID).
    • ADR-0005 gains an id-pattern grid per archive table. P is shared by projects and participants, so nothing routes by prefix.
  • Archive → portal. fm_archives#show gets an "In the portal" section linking the people/orgs carrying that code.
  • One declaration per model. filemaker_archived_in FmRolodex replaces passing archive:/table: at every call site.
    • with_filemaker_code(code) uses FIND_IN_SET over the whitespace-stripped list, so 000066 doesn't match 00006.
  • Commas only; all whitespace dropped. Tabs, line breaks, and non-breaking spaces are stripped in Ruby and SQL (REGEXP_REPLACE … [[:space:]]). ; or / aren't separators.
    • normalizes :filemaker_code saves the sorted a, b form. Existing rows change only when edited — no backfill.

Affiliations follow in the stacked #2649.

Screenshot 2026-10-12 at 5 09 48 PM Screenshot 2026-10-12 at 5 45 01 PM Screenshot 2026-10-12 at 5 10 26 PM Screenshot 2026-10-12 at 5 43 43 PM

🤖 Generated with Claude Code

@maebeale maebeale changed the title WIP: FileMaker archive links from people, orgs, and affiliations Put FileMaker archive buttons beside person and org codes, and link back Oct 12, 2026
@maebeale
maebeale marked this pull request as ready for review October 12, 2026 20:58
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch from 4cf1e32 to 525f133 Compare October 12, 2026 21:00
@maebeale
maebeale requested a review from jmilljr24 October 12, 2026 21:11
@maebeale maebeale changed the title Put FileMaker archive buttons beside person and org codes, and link back JM: Put FileMaker archive buttons beside person and org codes, and link back Oct 12, 2026
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch 4 times, most recently from 45dd33c to ddde227 Compare October 12, 2026 23:26
maebeale and others added 8 commits October 12, 2026 19:36
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The archive buttons in the edit-page nav checked only the ?admin=true param,
so an owner editing their own profile with it set saw their FileMaker code and
a link that 403s. The helper now checks the archive policy, so admin mode no
longer needs to gate it.

Each model declares which archive table its codes point into, so call sites
stop repeating the table and the archive can find the portal records carrying
a code. That gives the archive record a way back to the person or org, and an
org's edit page a link to the FileMaker agency its project sits under.

Codes the archive has no row for render struck through beside the input,
flagging a likely typo instead of disappearing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ck through

A nav button reading "Rolodex 00006" repeats the code already beside it; the code only
helps when a record has several to tell apart. A missing code's underline was hiding
its strikethrough, so it looked like a working link.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Chips beside the input crowded the row; the hint keeps the links with the field they
describe without widening it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codes pasted from FileMaker or a spreadsheet carry tabs, line breaks, and non-breaking
spaces that broke both the archive links and the archive's link back. Saving stores the
sorted comma-space form, so edited records settle into one shape without a backfill.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
That's the name the archive uses for the table it opens.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A nav button for a code the archive has no row for rendered struck through
and went nowhere. The top bar now drops those; the code field's hint keeps
showing them struck through, where the typo gets fixed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Archive links read the table from the model's declaration, so the ADR's per-call
archive:/table: example no longer works.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/archive-data-filemaker branch from ddde227 to 4976121 Compare October 12, 2026 23:37
maebeale and others added 9 commits October 12, 2026 19:56
…tions

An org can carry an ORG… code as well as a P… one, and the prefix is part of the id —
P00023 and ORG00023 are different records — so codes are looked up whole, never by
their number. ADR-0005 now records each archive table's id pattern as we learn them,
since prefixes overlap (P is both projects and participants).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Profiled every archive table's fm_id shape in prod. Project ids are all also valid
participant ids, and X/D/numeric ids collide across tables too, which is why codes are
looked up whole in their declared tables rather than routed by prefix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Affiliations almost all carry project codes and resources carry quotation codes, which
contradicts the mapping ADR-0005 recorded for them — flagged open rather than flipped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Their shape fits a project id, but a personnel id missing its S fits too; only checking
each row against its person and org can tell.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Nearly every org carries a project code, not an ORG code, so the archive page for an
FM organization showed no portal orgs. It now also finds orgs carrying any of its
projects' codes, in one query.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Production resource codes are almost all quotation ids on Leader spotlight
resources, and nearly all of them exist in the quotations archive.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Checked against each affiliation's own person and org in production: the P-codes are
the org's project id, not Personnel ids missing their S.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Each issue type gets a fix; the affected records will be listed by id only, so the ADR
never names a record or repeats its code.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ids and issue type only, from a read-only production run, so the ADR names no record
and repeats no code.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale merged commit 6fb6455 into main Oct 13, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/archive-data-filemaker branch October 13, 2026 00:51
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