From 4fd110a33de70dfe7ff24a3be6979a685639741c Mon Sep 17 00:00:00 2001 From: cproudlock Date: Sun, 12 Jul 2026 06:07:36 -0400 Subject: [PATCH] Wire relationship directionality and dualpath controls propagation Symmetric relationship types (isdirectional flag, migration 7d19) show one entry per peer on the relationships card - a Dualpath pair no longer lists its partner twice - and directional types read naturally instead of Outgoing/Incoming. Deleting a collapsed entry removes every underlying direction row. Propagation is now real (migration 7d20): relationship types declare propagation-through pairs in relationshiptypepropagations (M:N, replacing the never-consumed single column); creating a controls link on either bay of a Dualpath pair auto-creates it on the partner, mirrored across both endpoints because live data stores controls as bay -> PC. flask relationships propagate backfills existing data (29 rows fanned out on the WJ dataset, idempotent). This also completes the tree that commit 1d21bf0 accidentally split (core/models/__init__ imported RelationshipTypePropagation ahead of the file that defines it), returning CI to green. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 13 + .../src/components/AssetRelationships.vue | 158 ++++++++--- .../views/settings/RelationshipTypesList.vue | 14 +- .../7d19_relationshiptype_directional.py | 70 +++++ .../7d20_relationshiptypepropagations.py | 109 ++++++++ shopdb/cli/__init__.py | 156 +++++++++-- shopdb/core/api/assets.py | 148 ++++++++++- shopdb/core/models/relationship.py | 76 +++++- .../test_relationship_directional.py | 106 ++++++++ .../test_relationship_propagation.py | 249 ++++++++++++++++++ 10 files changed, 1023 insertions(+), 76 deletions(-) create mode 100644 migrations/versions/7d19_relationshiptype_directional.py create mode 100644 migrations/versions/7d20_relationshiptypepropagations.py create mode 100644 tests/test_core/test_relationship_directional.py create mode 100644 tests/test_core/test_relationship_propagation.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d41ef3c..b769a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,16 @@ ADR-007 and ADR-002. ### Added +- Relationship propagation, wired and data-driven: relationship types + declare propagation-through pairs (relationshiptypepropagations M:N, + replacing the never-consumed single column); creating a controls link on + one Dualpath bay auto-creates it on the partner bay, and + `flask relationships propagate` backfills existing data. +- Employee photos, mode-aware: self-hosted directory employees support + upload/replace/delete (admin), served publicly for kiosk cards; external + directory mode passes the HR-supplied picture URL through read-only. One + resolver feeds the shopfloor recognition/recert cards and the employee + detail hero in either mode. - Vendor-model photo management. New admin-gated core endpoints `POST /api/models//image` (multipart `file`, png/jpg/jpeg/gif/webp/svg, one image per model, replace semantics) and @@ -66,6 +76,9 @@ ADR-007 and ADR-002. ### Fixed +- Following a relationship link between two assets of the same type now loads + the destination page instead of stale content (router-view keyed on path; + query-only URL changes still avoid a remount). - Asset relationships card no longer lists a symmetric peer twice. Relationship types gain `relationshiptypes.isdirectional` (migration `7d19_relationshiptype_directional`; seeded false for the connection-like diff --git a/frontend/src/components/AssetRelationships.vue b/frontend/src/components/AssetRelationships.vue index a8e19c2..9f4a95f 100644 --- a/frontend/src/components/AssetRelationships.vue +++ b/frontend/src/components/AssetRelationships.vue @@ -18,30 +18,32 @@