Skip to content

feature: lang integration from selfcare (PIN-7690) #1632

Open
alten-dturus wants to merge 9 commits intodevfrom
feature/PIN-7690_lang-integration-from-selfcare
Open

feature: lang integration from selfcare (PIN-7690) #1632
alten-dturus wants to merge 9 commits intodevfrom
feature/PIN-7690_lang-integration-from-selfcare

Conversation

@alten-dturus
Copy link
Collaborator

No description provided.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

@borgesis95 borgesis95 marked this pull request as ready for review February 5, 2026 13:41
Copilot AI review requested due to automatic review settings February 5, 2026 13:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR integrates language parameter passing between this application and the selfcare portal, enabling consistent language experience when users navigate between the two systems. The implementation adds a language query parameter to all selfcare URLs and includes logic to detect and apply language preferences from URL parameters.

Changes:

  • Added language detection from URL query parameters with automatic language switching
  • Updated all selfcare portal URLs to include the current language parameter
  • Upgraded @pagopa/interop-fe-commons to version 1.5.2 and pinned react-router-dom to a specific version range

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/router/routes.tsx Added zod schema for validating allowed languages (it, en)
src/router/components/RoutesWrapper/RoutesWrapper.tsx Added useEffect to parse 'lang' query parameter and switch language accordingly
src/components/sidebar/InteropSidebarItems.tsx Added language parameter to selfcare users and groups page URLs
src/components/layout/Header.tsx Added language parameter to all selfcare navigation URLs (token-exchange, dashboard)
src/components/dialogs/DialogDeleteOperator.tsx Added language parameter to selfcare user page URL
src/components/layout/test/Header.test.tsx Updated test expectations to include language parameter in URLs
package.json Updated @pagopa/interop-fe-commons to 1.5.2 and react-router-dom to ^6.16.0
package-lock.json Updated lock file reflecting dependency changes
src/App.tsx Removed extraneous blank lines (whitespace-only changes)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +33
useEffect(() => {
const language = AllowedLanguage.safeParse(searchParams.get('lang'))
if (language.success) {
switchLang(language.data)
} else {
console.warn('Language URL params is not valid')
}
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The warning message will be logged even when the 'lang' query parameter is absent (null). This will cause unnecessary console warnings on every page load when users navigate without the lang parameter. Consider checking if the parameter exists before logging the warning, or only log when an invalid value is explicitly provided.

Copilot uses AI. Check for mistakes.
"@mui/x-date-pickers": "^6.13.0",
"@pagopa/interop-fe-commons": "^1.4.6",
"@pagopa/interop-fe-commons": "^1.5.2",
"@pagopa/mui-italia": "^1.8.0",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The upgraded version of '@pagopa/interop-fe-commons' (1.5.2) requires '@pagopa/mui-italia' version ^1.9.0 as a peer dependency, but package.json specifies ^1.8.0. This peer dependency mismatch could lead to runtime issues or warnings during installation. Update '@pagopa/mui-italia' to at least version 1.9.0 to satisfy the peer dependency requirement.

Suggested change
"@pagopa/mui-italia": "^1.8.0",
"@pagopa/mui-italia": "^1.9.0",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants