feat(territories): show attribution kind on /me/territories pages#207
Merged
Conversation
Publishers can already see the attribution kind (campaign, phones) as a watermark on the territory PDF, but the /me/territories list and detail pages didn't surface it. Add a badge for non-default kinds so publishers know up front whether the territory is a distribution campaign or a phones territory before they start working it.
…ritories
The attribution-kind badges previously used the success (green) and info
(blue) variants, which collide with the status badge palette sitting on
the same row. Replace with a neutral secondary fill plus a Phone or
Megaphone icon, so the kind reads as categorical (not as another
status), and so it disambiguates from the territory type label rendered
just below ("Téléphone" the territory kind vs "Téléphones" the
attribution kind).
Extract the lookup into AttributionKindBadge to remove duplication
between the list and the detail route, and to give one place to add a
tooltip later.
…oader shape Apply PR review follow-ups: - Rename local Props to AttributionKindBadgeProps to match the dominant *Props convention in the codebase. - Make the Default branch explicit instead of falling through to the trailing return null. TerritoryAttributionKind is a Prisma const-object union (not a TS enum), so the trailing return null silently absorbs any future variant; an explicit Default branch makes the intent visible and leaves the fall-through reserved for the unreachable case. - Assert attribution.type in the getUserTerritoriesWithDetails test so dropping the type field from the Prisma select would now break a test instead of silently hiding the badge in prod. Fix the mock value while there: Prisma surfaces schema enum names (PascalCase), not the @map-ed lowercase DB value.
Mention the new assignment-type indicator on the publisher-facing territory list and detail pages, and note in the assignment-types section that the kind is surfaced in three places (PDF watermark, list card, detail header) so publishers always know how to approach the territory. Default (door-to-door) intentionally shows no indicator anywhere.
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.
Summary
/me/territorieslist cards and/me/territories/:iddetail header.attributions_type_campaign/attributions_type_phoneParaglide keys, so no new translations are needed.Test plan
/me/territoriesand/me/territories/:id.