Repository navigation
Share the Tags screen from email-blocks as TagManager - #200
Merged
Merged
Conversation
Hosts such as CourseLit need tag management (counts, rename, delete) and would otherwise re-implement the dashboard's Tags page. Move it into @sendlit/email-blocks as TagManager and use it from the dashboard: - The host passes functions for SendLit's /tags endpoints, an optional sequenceHref and link component for the "still used in" list, a loading indicator and an error-message mapper - Tag types are declared in the package (with a test that they match the contract) so the published types don't point at the private api-contract - Docs page and changeset
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.
Why
CourseLit needs tag management (contact counts, rename everywhere, delete) and would otherwise re-implement the dashboard's Tags page, which is how the last round of copies drifted. The screen now lives in
@sendlit/email-blocksand the dashboard uses the same export.What
TagManagerin@sendlit/email-blocks: lists every tag with its contact count, renames a tag everywhere it's used, and deletes one after showing the segments, broadcasts, sequences and signup forms that still name it. The host passes:listTags,getTagReferences,renameTag,deleteTag(its calls to SendLit's/tagsendpoints, made through its own backend);sequenceHrefandlinkComponentfor the "still used in" links, aloadingIndicator, and anerrorMessagemapper.TagManagerwith the dashboard's API calls,Link,LoadingandApiErrormessages. Behaviour and copy are unchanged.TagSummary,TagReferences,RenameTagResult,DeleteTagResult) are declared in the package and exported. Importing them from the private@sendlit/api-contractmade the published.d.tspoint at a chunk that doesn't exist; a test checks the local types match the contract.@sendlit/email-blocks.Tests
bun --filter @sendlit/email-blocks test: 22 pass, including new tests for the notice text and for the types matching the contract.tsc --noEmitclean for the package andapps/web;bun run buildof the package emitstag-manager.d.tsresolving totag-manager-types./tags.