Skip to content

Commit 9e0b4bb

Browse files
authored
Merge pull request #1670 from pagopa/alignment-dev-120226
2 parents 8835081 + 982f9d6 commit 9e0b4bb

File tree

7 files changed

+55
-27
lines changed

7 files changed

+55
-27
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "interop-dashboard-frontend",
3-
"version": "1.6.3",
3+
"version": "1.7.0",
44
"type": "module",
55
"scripts": {
66
"dev": "vite",
@@ -23,7 +23,7 @@
2323
"@mui/material": "^5.16.14",
2424
"@mui/system": "^5.14.9",
2525
"@mui/x-date-pickers": "^6.13.0",
26-
"@pagopa/interop-fe-commons": "^1.5.2",
26+
"@pagopa/interop-fe-commons": "^1.5.3",
2727
"@pagopa/mui-italia": "^1.8.0",
2828
"@tanstack/react-query": "^5.51.4",
2929
"@tanstack/react-query-devtools": "^5.51.4",

src/api/api.generatedTypes.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,8 @@ export interface NotificationsCountBySection {
24402440
/** @format int32 */
24412441
'api-e-service': number
24422442
/** @format int32 */
2443+
'api-interop': number
2444+
/** @format int32 */
24432445
totalCount: number
24442446
}
24452447
notifiche: {
@@ -3291,6 +3293,15 @@ export interface GetNotificationDeeplinkParams {
32913293
entityId: string
32923294
}
32933295

3296+
export interface GetDigestNotificationDeeplinkParams {
3297+
/** The id of the entity */
3298+
entityId?: string
3299+
/** The selfcare ID for the institution (optional, falls back to generic URL if not provided) */
3300+
selfcareId?: string
3301+
/** The type of the notification */
3302+
digestNotificationType: string
3303+
}
3304+
32943305
export namespace Consumers {
32953306
/**
32963307
* @description retrieves a list of consumer agreements
@@ -8830,6 +8841,28 @@ export namespace EmailDeepLink {
88308841
export type RequestHeaders = {}
88318842
export type ResponseBody = any
88328843
}
8844+
/**
8845+
* @description Redirect the user to the correct deepLink based on digest notification type and entity id
8846+
* @tags digestEmailDeepLink
8847+
* @name GetDigestNotificationDeeplink
8848+
* @summary Redirect the user to the correct deepLink based on digest notification type and entity id
8849+
* @request GET:/emailDeepLink/{digestNotificationType}
8850+
*/
8851+
export namespace GetDigestNotificationDeeplink {
8852+
export type RequestParams = {
8853+
/** The type of the notification */
8854+
digestNotificationType: string
8855+
}
8856+
export type RequestQuery = {
8857+
/** The id of the entity */
8858+
entityId?: string
8859+
/** The selfcare ID for the institution (optional, falls back to generic URL if not provided) */
8860+
selfcareId?: string
8861+
}
8862+
export type RequestBody = never
8863+
export type RequestHeaders = {}
8864+
export type ResponseBody = any
8865+
}
88338866
}
88348867

88358868
export namespace ApiDocs {

src/api/auth/auth.services.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { SAMLTokenRequest, SessionToken } from '../api.generatedTypes'
55
import { MOCK_TOKEN, STORAGE_KEY_SESSION_TOKEN } from '@/config/constants'
66
import { TokenExchangeError } from '@/utils/errors.utils'
77
import { parseJwt } from './auth.utils'
8-
import { setMixpanelIdentifier } from '@/config/tracking'
98
import { hasSessionExpired } from '@/utils/common.utils'
109

1110
async function swapTokens(identity_token: string) {
@@ -25,7 +24,6 @@ async function getSessionToken(): Promise<string | null> {
2524
return null
2625
}
2726
window.localStorage.setItem(STORAGE_KEY_SESSION_TOKEN, sessionToken)
28-
if (parsedJwt.jwt?.uid) setMixpanelIdentifier(parsedJwt.jwt?.uid)
2927
return sessionToken
3028
}
3129

src/config/tracking.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ const getTrackingDefaultProps = () => {
8787
return {}
8888
}
8989

90-
export const { trackEvent, useTrackPageViewEvent, setMixpanelIdentifier } =
91-
initTracking<MixPanelEvent>({
92-
enabled: isTrackingEnabled,
93-
oneTrustScriptUrl:
94-
INTEROP_RESOURCES_BASE_URL + `/onetrust/oneTrust_production/scripttemplates/otSDKStub.js`,
95-
domainScriptUrl: ONETRUST_DOMAIN_SCRIPT_ID,
96-
mixpanelToken: MIXPANEL_PROJECT_ID,
97-
getDefaultProps: getTrackingDefaultProps,
98-
nonce: (window as unknown as ExtendedWindow).nonce,
99-
})
90+
export const { trackEvent, useTrackPageViewEvent } = initTracking<MixPanelEvent>({
91+
enabled: isTrackingEnabled,
92+
oneTrustScriptUrl:
93+
INTEROP_RESOURCES_BASE_URL + `/onetrust/oneTrust_production/scripttemplates/otSDKStub.js`,
94+
domainScriptUrl: ONETRUST_DOMAIN_SCRIPT_ID,
95+
mixpanelToken: MIXPANEL_PROJECT_ID,
96+
getDefaultProps: getTrackingDefaultProps,
97+
nonce: (window as unknown as ExtendedWindow).nonce,
98+
})

src/hooks/__tests__/useGetConsumerPurposesActions.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,11 @@ describe('check if useGetConsumerPurposesActions returns the correct actions bas
4848
expect(result.current.actions).toHaveLength(0)
4949
})
5050

51-
it('shoud only return clone action if an archived purpose is given', () => {
51+
it('should not return any action if the current state of purpose is ARCHIVED', () => {
5252
const purposeMock = createMockPurpose({ currentVersion: { state: 'ARCHIVED' } })
5353
const { result } = renderUseGetConsumerPurposesActionsHook(purposeMock)
5454

55-
const cloneAction = result.current.actions.find((action) => action.label === 'clone')
56-
57-
expect(result.current.actions).toHaveLength(1)
58-
expect(cloneAction).toBeTruthy()
55+
expect(result.current.actions).toHaveLength(0)
5956
})
6057

6158
it('should return the publish and delete functions if the current version is in draft', () => {

src/hooks/useGetConsumerPurposesActions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { useCheckRiskAnalysisVersionMismatch } from './useCheckRiskAnalysisVersi
1414
import { useCurrentRoute, useNavigate } from '@/router'
1515
import { match } from 'ts-pattern'
1616

17+
// Source of truth about purpose here: https://pagopa.atlassian.net/wiki/spaces/PDNDI/pages/626360386/Purpose+Version+Lifecycle
18+
1719
function useGetConsumerPurposesActions(purpose?: Purpose) {
1820
const { t: tCommon } = useTranslation('common', { keyPrefix: 'actions' })
1921
const { t } = useTranslation('purpose', { keyPrefix: 'consumerView' })
@@ -199,10 +201,9 @@ function useGetConsumerPurposesActions(purpose?: Purpose) {
199201
)
200202
.with(
201203
{
202-
isDeliverMode: true,
203204
isArchived: true,
204205
},
205-
() => [cloneAction]
206+
() => []
206207
)
207208
// purpose in DRAFT state
208209
.with(

0 commit comments

Comments
 (0)