Repository navigation
(CF-56) Feat/shared distribution list - #53
Merged
Merged
Conversation
…nect/Disconnect to Link/Unlink
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
The list of linked distributions belonged to a browser: it lived in
localStorage, so another browser, another device or another account landed on the connect screen even when distributions were already linked. That is also why a viewer was asked to connect a distribution (CF-54). It could not do so either, since creating a target is editor-only.The list is now the team's: it is the API's target registry (
GET /targets), loaded each time the console loads.Console
DELETE /targets/{id}, registry only — the rules table is untouched and the distribution stays live) removes it for everyone.sub(their email if the token has none), so switching changes nothing for anyone else and the next person on the same browser never inherits it. If the selected one was unlinked by a teammate, the console falls back to the first.PUT) instead of registering a new one. It also keeps the redirect function ARN, which it used to show empty and drop on save.localStoragekeys the list used to live in are deleted on load. Nothing is migrated: the console was not live yet.Link / Unlink wording (CF-57)
Every Connect / Connected / Connecting / Disconnect that refers to a distribution is now Link / Linked / Linking / Unlink, with the strings from the ticket. The Unlink section says the distribution stays live and its rules keep running at the edge, that it is removed for everyone, and where the user lands.
API
A target is now one linked distribution, named after its distribution ID.
POSTandPUT /targetsrefuse a name already taken (409 TARGET_EXISTS,"<name>" is already linked); an ID and its ARN count as the same name. They no longer refuse a second target on the same table: two distributions served by one rules table are two linked distributions. Before, the second one silently reused the first one's target and name.Things to know
dev, changing the table in Settings registered a new target and left the old one behind, under the same name. Once this is deployed, those show up as duplicate rows for everyone, and saving Settings on one answers "That distribution is already linked" until an editor unlinks the extra one. Worth checkingGET /targetson the sandbox environments after the deploy.docs/screenshots/console-connect.pngin the README still shows the old wording.Tests
Lint, typecheck,
generate:api:check, unit tests (edge 145, API 680, UI 586) and Playwright 167/167, all green. The e2e API stub now keeps its targets as a registry would (create, rename, delete), and new specs cover a viewer's read-only console, unlinking (next one, last one, refused), a selection unlinked by a teammate before and during a session (including a list that still returns it), two distributions on one table, linking one a teammate already linked, and two users keeping their own selection on one browser.Ticket
CF-56, CF-54, CF-57
Checklist
shared/schemas and theirshared/examples/were updated together (n/a)$refs the updated schemas — no inline redefinition (n/a)aws_cloudfront_distribution(except underexamples/)