UAS GET -Single Article status retrieval with new feature toggle#13827
UAS GET -Single Article status retrieval with new feature toggle#13827
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an initial “Save for later” integration against the UAS Activity API, gated behind a new uasEnable feature toggle, so article pages can fetch and reflect a single article’s saved status.
Changes:
- Introduces
uasEnabletoggle (enabled in local forhindi, disabled in test/live). - Adds UAS utilities + hooks (
useUASButton,useUASFetchSaveStatus) to decide visibility and fetch saved status. - Adds a temporary
SaveArticleButtonand wires it intoArticlePage.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/pages/ArticlePage/ArticlePage.tsx | Adds SaveArticleButton into the timestamp area and passes article/service/auth state. |
| src/app/lib/uasApi/uasUtility.ts | Adds shared UAS constants and helpers (globalId builder, article id parsing). |
| src/app/lib/uasApi/index.ts | Switches activity type allow-list import to the new utility module. |
| src/app/lib/uasApi/activityTypes.ts | Removes the old activityTypes module (moved to uasUtility). |
| src/app/lib/config/toggles/testConfig.js | Adds uasEnable toggle (off). |
| src/app/lib/config/toggles/localConfig.js | Adds uasEnable toggle (on for hindi). |
| src/app/lib/config/toggles/liveConfig.js | Adds uasEnable toggle (off). |
| src/app/hooks/useUASFetchSaveStatus/index.ts | New hook to fetch saved status via UAS GET. |
| src/app/hooks/useUASFetchSaveStatus/index.test.tsx | Tests for the saved-status fetch hook. |
| src/app/hooks/useUASButton/index.ts | New hook to gate/show the button and fetch saved status based on toggle/env/sign-in. |
| src/app/hooks/useUASButton/index.test.tsx | Tests for the gating/show logic hook. |
| src/app/components/SaveArticleButton/index.tsx | New temporary button component (logic only; UI TBD). |
| src/app/components/SaveArticleButton/index.test.tsx | Tests for the new button component. |
| src/app/components/SaveArticleButton/index.styles.ts | Temporary styles for the button. |
| {/* Temporary SaveArticleButton */} | ||
| <SaveArticleButton | ||
| isSignedIn={isSignedIn} | ||
| articleId={parseArticleID(articleId)} | ||
| service={service} | ||
| /> |
There was a problem hiding this comment.
SaveArticleButton is rendered unconditionally inside the timestamp block. On AMP/Lite/App variants (which are explicitly gated for other interactive UI like ContinueReading), this risks rendering a non-functional button or incorrect saved state because client-side hooks/fetch may not run. Consider gating this behind !isAmp && !isLite && !isApp (or moving it to a canonical-only area).
There was a problem hiding this comment.
@jinidev, as far as I remember AMP and Lite sites are our of scope, but would we good to double check with Jon
There was a problem hiding this comment.
Thanks Elvinas .Yes will ask , thats why kept this suggestion open
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…GET-UAS-single-article-status
…b.com/bbc/simorgh into ws-2209-GET-UAS-single-article-status
| "topBarOJs": { | ||
| "enabled": true, | ||
| }, | ||
| "uasEnable": { |
There was a problem hiding this comment.
Normally feature toggles does not contain enable suffix, probably it could be uasPersonalization or similar?
Resolves JIRA: https://bbc.atlassian.net/browse/WS-2209
Summary
GET UAS API integration for fetching single article's Save status
Code changes
Testing
Sign in to https://account.test.bbc.com/account/settings?web=true and copy the ckns_atkn cookie value → add it localhost cookie storage
Enable "Access-Control-Allow-Origin" for localhost (to avoid CORS issues)

Open any Hindi article page → with feature toggle ON, verify “Save for later” button is visible
Note: The “Save for later” button design is not yet finalized by UX; this PR focuses only on the API integration and logic for fetching saved status. UI/UX work will follow in a separate PR.