Skip to content

Show the template ID without Templates read on lists, broadcasts, automations and segments - #536

Merged
pierre-b merged 2 commits into
devfrom
fix/template-selector-without-templates-read
Nov 12, 2026
Merged

pierre-b merged 2 commits into
devfrom
fix/template-selector-without-templates-read

Conversation

@pierre-b

@pierre-b pierre-b commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What

#520 fixed the transactional notification drawer only. This PR applies the same fix to the lists, broadcasts, automations and segments screens. For a member without Templates read, templates.list and templates.get answer 403, so these screens showed a blank template field. Now:

  • Template fields: they show the stored template ID, locked. A lock icon (with a hover and keyboard tooltip) says that Templates read is needed to see or choose the template. This covers the list double opt-in template, the broadcast variations, the automation email nodes and "Clicked a link" trigger filter, and the segment email conditions.
  • No more refused requests: these screens stop requesting the templates. That means the lists cards, the broadcast sender fields, the automations canvas and the segment condition summaries.
  • Labels: broadcast cards and automation email nodes name the template by its ID, instead of "Untitled" or "Template set".
  • Saving: works as before. No create or update path of these resources checks Templates read.

Each page passes !!permissions?.templates?.read down. These props are required:

  • CreateListDrawer
  • UpsertBroadcastDrawer
  • ChangeVariationSenderModal
  • UpsertAutomationDrawer and AutomationProvider (which put it in the editor context)
  • SegmentsFilter and ButtonUpsertSegment

The leaf components default it to true.

No backend change, no migration, no environment variable, no docs change.

Plan and tests

Plan: plans/fix-template-selectors-without-templates-read-plan.md, which lists the test file and cases for every implementation file. Each test checks behaviour both with and without the permission. Test files:

  • TemplateSelectorInput
  • ListDrawer (new)
  • ListsPage
  • UpsertBroadcastDrawer
  • VariationSenderSelect
  • ChangeVariationSenderModal
  • BroadcastsPage.templatesRead (new)
  • AutomationContext
  • NodeConfigPanel
  • TriggerConfigForm
  • EmailConfigForm (new)
  • ConditionsField
  • EmailNode
  • UpsertAutomationDrawer (new)
  • AutomationsPage
  • form_leaf_templates_read (new)
  • button_upsert_preview
  • SegmentsFilter (new)
  • ContactsPage

cd console && npm run lingui:extract && npx vitest run && npx tsc -b && npx eslint . && npm run build passes locally: 249 files, 4533 tests. The new string is translated in the 8 catalogues.

Known, not handled

  • Other template reads still refused on a click: the message history template preview, the blog post drawer, and the email builder preview.
  • Broadcasts list: it is still requested with with_templates: true. The server then tries each variation's template and logs the refusal.

…omations and segments

The template fields of these screens now get the member's Templates read permission: without it they show the stored template ID with a lock explaining why, and the screens no longer request templates the member cannot read. Broadcast cards and automation email nodes name their template by ID instead of "Untitled" or "Template set".
Tests now check every drawer of the broadcast and automation pages, including the edit drawers and the empty pages. The lists page shows neither the template ID nor a preview while the permissions load, the lock is reachable by keyboard, and the changelog says only the fields carry it.
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.96%. Comparing base (6fd8432) to head (c9e964f).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #536      +/-   ##
==========================================
- Coverage   88.97%   88.96%   -0.01%     
==========================================
  Files         377      377              
  Lines       73836    73836              
==========================================
- Hits        65692    65690       -2     
- Misses       5435     5436       +1     
- Partials     2709     2710       +1     
Flag Coverage Δ
unit 88.96% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pierre-b
pierre-b merged commit 5726103 into dev Nov 12, 2026
5 checks passed
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