WS-2209-UAS GET -Single Article status retrieval with new feature toggle#13827
WS-2209-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. |
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
|
I notice the Save button flashes for a second and then disappears when visiting this article: http://localhost:7081/hindi/articles/crmxzlpygjpo?renderer_env=live Is that expected? I think it should operate the other way around if that is the case, being hidden initially and then showing after hydration. |
This reverts commit 13f2038.
…GET-UAS-single-article-status
So debugged on this .
We will handle this flashing in future tickets by providing a placeholder skeleton and proper error handling. |
…GET-UAS-single-article-status
…GET-UAS-single-article-status
…GET-UAS-single-article-status
…GET-UAS-single-article-status
Resolves JIRA: https://bbc.atlassian.net/browse/WS-2209
Summary
GET UAS API integration for fetching single article's Save status
Code changes
Testing
ckns_atkn(for UAS) andckns_id(to enable IDCTA) cookies → add it localhost cookie storageNote: 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.