Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feat/pn-4727
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCimini90 committed May 10, 2024
2 parents 5c85e77 + 8dd9c41 commit 2bf2133
Show file tree
Hide file tree
Showing 34 changed files with 333 additions and 81 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.4.2](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.3...v2.4.2) (2024-05-02)

**Note:** Version bump only for package send-monorepo





## [2.4.2-RC.3](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.2...v2.4.2-RC.3) (2024-04-29)


### Bug Fixes

* **pn-10623:** Create notification with sender denomination greater than 80 characters ([#1197](https://github.com/pagopa/pn-frontend/issues/1197)) ([44dff14](https://github.com/pagopa/pn-frontend/commit/44dff14e44be442a42cdee3b0249d662b8a40724))





## [2.4.1](https://github.com/pagopa/pn-frontend/compare/v2.4.1-RC.1...v2.4.1) (2024-04-09)

**Note:** Version bump only for package send-monorepo
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "2.4.1",
"version": "2.4.2",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
16 changes: 16 additions & 0 deletions packages/pn-commons/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.4.2](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.3...v2.4.2) (2024-05-02)

**Note:** Version bump only for package @pagopa-pn/pn-commons





## [2.4.2-RC.3](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.2...v2.4.2-RC.3) (2024-04-29)

**Note:** Version bump only for package @pagopa-pn/pn-commons





## [2.4.1](https://github.com/pagopa/pn-frontend/compare/v2.4.1-RC.1...v2.4.1) (2024-04-09)

**Note:** Version bump only for package @pagopa-pn/pn-commons
Expand Down
2 changes: 1 addition & 1 deletion packages/pn-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pagopa-pn/pn-commons",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"main": "./src/index.ts",
"dependencies": {
Expand Down
19 changes: 19 additions & 0 deletions packages/pn-pa-webapp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.4.2](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.3...v2.4.2) (2024-05-02)

**Note:** Version bump only for package @pagopa-pn/pn-pa-webapp





## [2.4.2-RC.3](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.2...v2.4.2-RC.3) (2024-04-29)


### Bug Fixes

* **pn-10623:** Create notification with sender denomination greater than 80 characters ([#1197](https://github.com/pagopa/pn-frontend/issues/1197)) ([44dff14](https://github.com/pagopa/pn-frontend/commit/44dff14e44be442a42cdee3b0249d662b8a40724))





## [2.4.1](https://github.com/pagopa/pn-frontend/compare/v2.4.1-RC.1...v2.4.1) (2024-04-09)

**Note:** Version bump only for package @pagopa-pn/pn-pa-webapp
Expand Down
2 changes: 1 addition & 1 deletion packages/pn-pa-webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pagopa-pn/pn-pa-webapp",
"description": "Backoffice di SEND per la Pubblica Amministrazione",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
Expand Down
16 changes: 16 additions & 0 deletions packages/pn-personafisica-login/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.4.2](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.3...v2.4.2) (2024-05-02)

**Note:** Version bump only for package @pagopa-pn/pn-personafisica-login





## [2.4.2-RC.3](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.2...v2.4.2-RC.3) (2024-04-29)

**Note:** Version bump only for package @pagopa-pn/pn-personafisica-login





## [2.4.1](https://github.com/pagopa/pn-frontend/compare/v2.4.1-RC.1...v2.4.1) (2024-04-09)

**Note:** Version bump only for package @pagopa-pn/pn-personafisica-login
Expand Down
2 changes: 1 addition & 1 deletion packages/pn-personafisica-login/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pagopa-pn/pn-personafisica-login",
"description": "Pagina di login di SEND per il cittadino",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"homepage": "auth",
"dependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/pn-personafisica-login/src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const Login = () => {
SPID_IDP_NAME: 'CIE',
SPID_IDP_ID: SPID_CIE_ENTITY_ID,
});

PFLoginEventStrategyFactory.triggerEvent(PFLoginEventsType.SEND_LOGIN_METHOD, {
entityID: 'cie',
});
};

if (showIDPS) {
Expand Down
16 changes: 16 additions & 0 deletions packages/pn-personafisica-webapp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.4.2](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.3...v2.4.2) (2024-05-02)

**Note:** Version bump only for package @pagopa-pn/pn-personafisica-webapp





## [2.4.2-RC.3](https://github.com/pagopa/pn-frontend/compare/v2.4.2-RC.2...v2.4.2-RC.3) (2024-04-29)

**Note:** Version bump only for package @pagopa-pn/pn-personafisica-webapp





## [2.4.1](https://github.com/pagopa/pn-frontend/compare/v2.4.1-RC.1...v2.4.1) (2024-04-09)

**Note:** Version bump only for package @pagopa-pn/pn-personafisica-webapp
Expand Down
2 changes: 1 addition & 1 deletion packages/pn-personafisica-webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pagopa-pn/pn-personafisica-webapp",
"description": "SEND - Servizio Notifiche Digitali per il cittadino",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ const DigitalContactElem = forwardRef<{ editContact: () => void }, Props>(
if (onDeleteCbk) {
onDeleteCbk();
}
PFEventStrategyFactory.triggerEvent(getEventByContactType(contactType), {
senderId,
});
PFEventStrategyFactory.triggerEvent(getEventByContactType(contactType), senderId);
})
.catch((error) => {
console.error('Error occurred:', error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ const DigitalContactsCodeVerificationProvider: FC<{ children?: ReactNode }> = ({
const [isConfirmationModalVisible, setIsConfirmationModalVisible] = useState(false);
const [errorMessage, setErrorMessage] = useState<ErrorMessage>();

const [isSpecialContactMode, setIsSpecialContactMode] = useState(false);

const initialProps = {
labelRoot: '',
labelType: '',
Expand Down Expand Up @@ -112,18 +110,17 @@ const DigitalContactsCodeVerificationProvider: FC<{ children?: ReactNode }> = ({

const sendSuccessEvent = (type: LegalChannelType | CourtesyChannelType) => {
if (type === LegalChannelType.PEC) {
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_ADD_PEC_UX_SUCCESS, {
isSpecialContact: isSpecialContactMode,
});
PFEventStrategyFactory.triggerEvent(
PFEventsType.SEND_ADD_PEC_UX_SUCCESS,
modalProps.senderId
);
return;
}
PFEventStrategyFactory.triggerEvent(
type === CourtesyChannelType.SMS
? PFEventsType.SEND_ADD_SMS_UX_SUCCESS
: PFEventsType.SEND_ADD_EMAIL_UX_SUCCESS,
{
isSpecialContact: isSpecialContactMode,
}
modalProps.senderId
);
};
const handleCodeVerification = (verificationCode?: string, noCallback: boolean = false) => {
Expand All @@ -136,17 +133,20 @@ const DigitalContactsCodeVerificationProvider: FC<{ children?: ReactNode }> = ({
}
if (verificationCode) {
if (modalProps.digitalDomicileType === LegalChannelType.PEC) {
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_ADD_PEC_UX_CONVERSION, {
isSpecialContact: isSpecialContactMode,
});
PFEventStrategyFactory.triggerEvent(
PFEventsType.SEND_ADD_PEC_UX_CONVERSION,
modalProps.senderId
);
} else if (modalProps.digitalDomicileType === CourtesyChannelType.SMS) {
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_ADD_SMS_UX_CONVERSION, {
isSpecialContact: isSpecialContactMode,
});
PFEventStrategyFactory.triggerEvent(
PFEventsType.SEND_ADD_SMS_UX_CONVERSION,
modalProps.senderId
);
} else if (modalProps.digitalDomicileType === CourtesyChannelType.EMAIL) {
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_ADD_EMAIL_UX_CONVERSION, {
isSpecialContact: isSpecialContactMode,
});
PFEventStrategyFactory.triggerEvent(
PFEventsType.SEND_ADD_EMAIL_UX_CONVERSION,
modalProps.senderId
);
}
}
if (!actionToBeDispatched) {
Expand Down Expand Up @@ -203,30 +203,24 @@ const DigitalContactsCodeVerificationProvider: FC<{ children?: ReactNode }> = ({
recipientId: string,
senderId: string,
senderName?: string,
callbackOnValidation?: (status: 'validated' | 'cancelled') => void,
isSpecialContact?: boolean
callbackOnValidation?: (status: 'validated' | 'cancelled') => void
) => {
setIsSpecialContactMode(!!isSpecialContact);
/* eslint-disable functional/no-let */
let labelRoot = '';
let labelType = '';
/* eslint-enable functional/no-let */
if (digitalDomicileType === LegalChannelType.PEC) {
labelRoot = 'legal-contacts';
labelType = 'pec';
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_ADD_PEC_START, {
isSpecialContact,
});
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_ADD_PEC_START, senderId);
} else {
labelRoot = 'courtesy-contacts';
labelType = digitalDomicileType === CourtesyChannelType.SMS ? 'phone' : 'email';
PFEventStrategyFactory.triggerEvent(
digitalDomicileType === CourtesyChannelType.SMS
? PFEventsType.SEND_ADD_SMS_START
: PFEventsType.SEND_ADD_EMAIL_START,
{
isSpecialContact,
}
senderId
);
}
setModalProps({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,21 @@ const DomicileBanner = forwardRef(({ source = 'home_notifiche' }: Props, ref) =>
navigate(routes.RECAPITI);
}, []);

const lackingAddressTypes = useMemo(
() =>
[LegalChannelType.PEC, CourtesyChannelType.EMAIL, CourtesyChannelType.IOMSG].filter(
(type) => !defaultAddresses.some((address) => address.channelType === type)
),
[defaultAddresses]
);

const messageIndex = Math.floor(Math.random() * lackingAddressTypes.length);
const messageType = lackingAddressTypes[messageIndex] as string;

/* if (returnDomicileBannerType) {
returnDomicileBannerType(messageType);
} */
const messageType = useMemo(() => {
const lackingAddressTypes = [
LegalChannelType.PEC,
CourtesyChannelType.EMAIL,
CourtesyChannelType.IOMSG,
].filter((type) => !defaultAddresses.some((address) => address.channelType === type));
const messageIndex = Math.floor(Math.random() * lackingAddressTypes.length);
return lackingAddressTypes.length > 0 ? (lackingAddressTypes[messageIndex] as string) : null;
}, [defaultAddresses]);

useEffect(() => {
if (lackingAddressTypes.length === 0) {
if (!messageType) {
dispatch(closeDomicileBanner());
}
}, [lackingAddressTypes]);
}, [messageType]);

useImperativeHandle(ref, () => messageType);

Expand Down
7 changes: 4 additions & 3 deletions packages/pn-personafisica-webapp/src/pages/AppStatus.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ const AppStatus = () => {
};

useEffect(() => {
PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_SERVICE_STATUS, {
service_status_OK: appStatus.currentStatus?.appIsFullyOperative,
});
PFEventStrategyFactory.triggerEvent(
PFEventsType.SEND_SERVICE_STATUS,
appStatus.currentStatus?.appIsFullyOperative
);
}, [getCurrentAppStatus]);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createSlice } from '@reduxjs/toolkit';

import { DigitalAddress } from '../../models/contacts';
import { acceptDelegation, rejectDelegation } from '../delegation/actions';
import { Delegator } from '../delegation/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
} from '@pagopa-pn/pn-commons';

export class SendAddContactActionStrategy implements EventStrategy {
performComputations(isSpecialContact: boolean): TrackedEvent<{ other_contact: string }> {
performComputations(senderId: string): TrackedEvent<{ other_contact: string }> {
return {
[EventPropertyType.TRACK]: {
event_category: EventCategory.UX,
event_type: EventAction.ACTION,
other_contact: isSpecialContact ? 'yes' : 'no',
other_contact: senderId !== 'default' ? 'yes' : 'no',
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
} from '@pagopa-pn/pn-commons';

export class SendAddContactScreenViewStrategy implements EventStrategy {
performComputations(isSpecialContact: boolean): TrackedEvent<{ other_contact: string }> {
performComputations(senderId: string): TrackedEvent<{ other_contact: string }> {
return {
[EventPropertyType.TRACK]: {
event_category: EventCategory.UX,
event_type: EventAction.SCREEN_VIEW,
other_contact: isSpecialContact ? 'yes' : 'no',
other_contact: senderId !== 'default' ? 'yes' : 'no',
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ export class SendAddCourtesyAddressStrategy implements EventStrategy {
[EventPropertyType.PROFILE]: {
SEND_HAS_EMAIL: 'yes',
},
[EventPropertyType.SUPER_PROPERTY]: {
SEND_HAS_EMAIL: 'yes',
},
};
}

return {
[EventPropertyType.PROFILE]: {
SEND_HAS_SMS: 'yes',
},
[EventPropertyType.SUPER_PROPERTY]: {
SEND_HAS_SMS: 'yes',
},
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class SendAddLegalAddressStrategy implements EventStrategy {

return {
[EventPropertyType.PROFILE]: { SEND_HAS_PEC: 'yes' },
[EventPropertyType.SUPER_PROPERTY]: { SEND_HAS_PEC: 'yes' },
};
}
}
Loading

0 comments on commit 2bf2133

Please sign in to comment.