Skip to content

Commit 3896b4f

Browse files
committed
chore: added avatar basepath to env, changed header avatar source (PIN-8820)
1 parent fbb2723 commit 3896b4f

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

public/env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ window.pagopa_env = {
2222
FEATURE_FLAG_NOTIFICATION_CONFIG: 'true',
2323
FEATURE_FLAG_ESERVICE_PERSONAL_DATA: 'true',
2424
FEATURE_FLAG_USE_SIGNED_DOCUMENT: 'true',
25+
AVATAR_BASEPATH: 'http://selc-u-checkout-cdn-endpoint.azureedge.net'
2526
}

setupTests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const testConfigs = {
2727
FEATURE_FLAG_NOTIFICATION_CONFIG: 'true',
2828
FEATURE_FLAG_ESERVICE_PERSONAL_DATA: 'true',
2929
FEATURE_FLAG_USE_SIGNED_DOCUMENT: 'true',
30+
AVATAR_BASEPATH: 'http://selc-u-checkout-cdn-endpoint.azureedge.net',
3031
}
3132

3233
// runs a cleanup after each test case (e.g. clearing jsdom)

src/components/layout/Header.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import { useNavigate } from '@/router'
33
import { assistanceLink, documentationLink, pagoPaLink } from '@/config/constants'
44
import { HeaderAccount, HeaderProduct, type ProductSwitchItem } from '@pagopa/mui-italia'
5-
import { FE_LOGIN_URL, SELFCARE_BASE_URL, STAGE } from '@/config/env'
5+
import { FE_LOGIN_URL, SELFCARE_BASE_URL, STAGE, AVATAR_BASEPATH } from '@/config/env'
66
import type { PartySwitchItem } from '@pagopa/mui-italia/dist/components/PartySwitch'
77
import { useTranslation } from 'react-i18next'
88
import type { TFunction } from 'i18next'
@@ -26,6 +26,7 @@ export const getPartyList = (
2626
const generatePartyItem = (party: SelfcareInstitution) => ({
2727
id: party.id,
2828
name: party.description,
29+
logoUrl: `${AVATAR_BASEPATH}/institutions/${party.id}/logo.png`,
2930
productRole: (party.userProductRoles as Array<UserProductRole>)
3031
.map((role) => t(`userProductRole.${role}`))
3132
.join(', '),

src/config/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const GeneralConfigs = z.object({
1818
ERROR_DATA_DURATION_TIME: z.string().default('60000'),
1919
DELEGATIONS_ALLOWED_ORIGINS: z.string(),
2020
NOTIFICATION_COUNT_REFRESH_INTERVAL: z.coerce.number().default(30000),
21+
AVATAR_BASEPATH: z.url().default('http://selc-u-checkout-cdn-endpoint.azureedge.net'),
2122
})
2223

2324
const FeatureFlagConfigs = z.object({
@@ -116,6 +117,7 @@ export const {
116117
FEATURE_FLAG_ESERVICE_PERSONAL_DATA,
117118
FEATURE_FLAG_USE_SIGNED_DOCUMENT,
118119
DELEGATIONS_ALLOWED_ORIGINS,
120+
AVATAR_BASEPATH,
119121
} = parseConfigs()
120122

121123
export const APP_MODE = parseAppMode()

src/types/common.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type PagoPAEnvVars = {
2020
SIGNALHUB_PERSONAL_DATA_PROCESS_URL: string
2121
FEATURE_FLAG_ESERVICE_PERSONAL_DATA: string
2222
DELEGATIONS_ALLOWED_ORIGINS: string
23+
AVATAR_BASEPATH: string
2324
}
2425

2526
export type ExtendedWindow = Window & {

0 commit comments

Comments
 (0)