Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/Confirmation modal adding special contact + handle PEC in validation on Management Page #1485

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

mflauti
Copy link
Collaborator

@mflauti mflauti commented Feb 25, 2025

Short description

This PR contains the code to implement the functionalities described below

List of changes proposed in this pull request

  • show a confirmation dialog to inform the user that the special contact he wants to add will override a previously set one
  • prevent every user who gets access to the digital domicile management page when the default PEC address is validating, which represents a corner case, from taking any of the actions usually available on the same page.

@AndreaCimini90 AndreaCimini90 self-assigned this Feb 26, 2025
>
{onConfirmLabel}
</Button>
{slotsProps?.closeButton?.onClick && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this use slots as done for wizard component

{onCloseLabel}
</Button>
)}
{slotsProps?.confirmButton?.onClick && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as before

import { AddressType, ChannelType, DigitalAddress, Sender } from '../../../models/contacts';
import LegalContactAssociationDialog from '../LegalContactAssociationDialog';

vi.mock('react-i18next', () => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed

<ConfirmationModal
open={open}
title={t(`special-contacts.legal-association-title${blockConfirmation}`, { ns: 'recapiti' })}
// slotsProps={slotsProps ?? undefined}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this

<ConfirmationModal
open={open}
title={t(`special-contacts.legal-association-title${blockConfirmation}`, { ns: 'recapiti' })}
// slotsProps={slotsProps ?? undefined}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this

if (oldAddress) {
setModalOpen({
type: ModalType.CONFIRM_LEGAL_ASSOCIATION,
data: {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need pass this data through state and not directly through modal properties?

if (oldAddress) {
setModalOpen({
type: ModalType.CONFIRM_LEGAL_ASSOCIATION,
data: {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as for pg

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