Repository navigation
Conversation
Add a repeatable `profile.link` component ({ type, value }, max 10) to
`api::profile.profile`, accept and validate `links` in the user and
organization profile endpoints, and populate it in their responses.
Social types store only the handle; `website`/`other` store a full URL.
The legacy `website`/`github` fields are kept until migrated.
See docs/adr/0003-profile-links.md.
|
@ayhid is attempting to deploy a commit to the Strapi-Website Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Part 1 of 6 — profile links. Branched from
develop; no dependencies.Summary
Adds a repeatable
profile.linkcomponent ({ type, value }, max 10) toapi::profile.profileaslinks, and lets the personal and organization profile endpoints read, write and validate it. This is the data layer for replacing the separate Website / GitHub inputs with a single multi-type Links field.Why
Members want to list more places they can be found (LinkedIn, X, YouTube, …). One string field per network doesn't scale — see ADR 0003 (
docs/adr/0003-profile-links.md) for the data-shape decision.Changes
profile.linkcomponent —typeenum (website,github,linkedin,x,instagram,youtube,linktree,other),valuestring (required, max 2048).api::profile.profile— new repeatablelinks(max 10).website/githubare kept for now.utils/profile-links.ts— server-side backstop validation, mirroring what the web form will enforce: social types must be a bare handle matching that network's username rules (e.g.octocat);website/othermust be a fullhttp(s)://URL.pickProfileLinkskeeps onlytype+ trimmedvalueper link, so clients can't pass componentids through to the document service;nullclears the list.linksadded touserProfileFields/organizationProfileFieldsand validated viavalidateProfileData.getProfilepopulateslinks;updateProfile(user + organization) returnslinksin its response.components.d.ts,contentTypes.d.ts).Test plan
pnpm --filter cms --filter web check-typespnpm --filter cms buildnullclears, pasted URL in a handle type, invalid URL, unknown type, empty value, 11 links, non-array, extra keys/idstrippedPUT /api/users/me/profilewithlinks→ response includeslinks;GETreturns themPUT /api/organizations/:id/profileFollow-ups (rest of the stack)
website/githubintolinks(src/migration/, behindENABLE_MIGRATION)website/githubonce the migration has run in productionDeploy note: the migration (part 2) must run in production before part 6 ships, or existing website/GitHub links would briefly disappear from public pages.