Skip to content

feat: use new A3 endpoints for change reportee and redirect (v4)#4168

Open
framitdavid wants to merge 2 commits intomainfrom
feat/use-new-a3-endpoint-for-redirect
Open

feat: use new A3 endpoints for change reportee and redirect (v4)#4168
framitdavid wants to merge 2 commits intomainfrom
feat/use-new-a3-endpoint-for-redirect

Conversation

@framitdavid
Copy link
Copy Markdown
Contributor

@framitdavid framitdavid commented May 5, 2026

Description

This PR updates how navigation back to the inbox is handled by switching to the new endpoint available in Altinn 3.

The change ensures alignment with the updated access management flow and replaces the previous endpoint with the new, supported alternative.

The new endpoint was introduced here:
Altinn/altinn-access-management-frontend#2167

Test App

This build can be testet with the app "redirect-inbox-simple-app".
https://altinn.studio/repos/ttd/redirect-inbox-simple-app

TT02

https://ttd.apps.tt02.altinn.no/ttd/redirect-inbox-simple-app/#/instance/51432356/804fd79a-58f7-4bb2-9174-a2e3aacc27c1/Task_1/Side1

Related Issue(s)

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually (tt02)
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • Tests

    • Updated test assertions to match the revised redirect URL format in the reportee change workflow.
  • Refactor

    • Adjusted redirect URL construction to use the new access-management redirect format and encoded target parameters for party-switching flows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

The PR switches party-change redirects to the access-management endpoint accessmanagement/api/v1/reportee/changeandredirect, changes the query parameters to partyId + goTo, adds an buildAccessManagementBaseUrl helper, updates buildArbeidsflateRedirectUrl to use the new base, and updates tests to assert the new URL format.

Changes

Redirect Endpoint Migration

Layer / File(s) Summary
Helper
src/utils/urls/urlHelper.ts
Add buildAccessManagementBaseUrl(altinnHost) to construct https://am.ui.${altinnHost}/.
Core Implementation
src/utils/urls/urlHelper.ts
redirectAndChangeParty(goTo, partyId) now returns accessmanagement/api/v1/reportee/changeandredirect URL with partyId and encoded goTo (replaces ui/Reportee/ChangeReporteeAndRedirect and R).
Wiring / Consumer
src/utils/urls/urlHelper.ts
buildArbeidsflateRedirectUrl updated to use extractAltinnHost(host) and to prefix the result with the access-management base URL (${amBaseUrl}${redirectAndChangeParty(targetUrl, partyId)}). Comment updated.
Tests
src/utils/urls/urlHelper.test.ts
Updated expected URLs in returnUrlToArchive() tests (both "without dialogId" and "with dialogId") to the new am.ui.<host>/accessmanagement/api/v1/reportee/changeandredirect format with partyId and encoded goTo.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: migrating to new A3 endpoints for reportee change and redirect functionality.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description follows the required template structure with all major sections completed, including a clear explanation of changes, related issue link, and verification/QA checklist items marked.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/use-new-a3-endpoint-for-redirect

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@framitdavid
Copy link
Copy Markdown
Contributor Author

/publish

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

PR release:

  • <link rel="stylesheet" type="text/css" href="https://altinncdn.no/toolkits/altinn-app-frontend/4.29.2-pr.4951.use-new-a3-endpoint-for-redirect.84f8c5c7/altinn-app-frontend.css">
  • <script src="https://altinncdn.no/toolkits/altinn-app-frontend/4.29.2-pr.4951.use-new-a3-endpoint-for-redirect.84f8c5c7/altinn-app-frontend.js"></script>

⚙️ Building...
✅ Done!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

@framitdavid
Copy link
Copy Markdown
Contributor Author

/publish

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

PR release:

  • <link rel="stylesheet" type="text/css" href="https://altinncdn.no/toolkits/altinn-app-frontend/4.29.2-pr.4960.use-new-a3-endpoint-for-redirect.3bd21f50/altinn-app-frontend.css">
  • <script src="https://altinncdn.no/toolkits/altinn-app-frontend/4.29.2-pr.4960.use-new-a3-endpoint-for-redirect.3bd21f50/altinn-app-frontend.js"></script>

⚙️ Building...
✅ Done!

@framitdavid framitdavid added backport This PR should be cherry-picked onto older release branches kind/other Pull requests containing chores/repo structure/other changes labels May 5, 2026
@framitdavid framitdavid moved this to 🔎 In review in Team Altinn Studio May 5, 2026
Copy link
Copy Markdown
Contributor

@Magnusrm Magnusrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ok! ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR should be cherry-picked onto older release branches kind/other Pull requests containing chores/repo structure/other changes

Projects

Status: 🔎 In review

Development

Successfully merging this pull request may close these issues.

2 participants