From c0f83b2a6d2fd7a0efca80ae96abd158de9641f7 Mon Sep 17 00:00:00 2001 From: Carmine Porricelli Date: Thu, 19 Dec 2024 14:40:43 +0100 Subject: [PATCH] PIN-5862 PIN-5861 - Fix actions label, textarea validation rules and improved delegations page loading UI (#1052) * Fix revoke action label and reject textfield validation rules * Improved delegations page loading state UI --- .../dialogs/DialogRejectProducerDelegation.tsx | 4 ++-- .../dialogs/DialogRevokeProducerDelegation.tsx | 2 +- .../DelegationAvailabilityTab.tsx | 8 ++++++++ .../DelegationsGrantedTab/DelegationsGrantedTab.tsx | 13 +++++++++---- .../DelegationsReceivedTab.tsx | 1 - src/static/locales/en/shared-components.json | 3 +++ src/static/locales/it/shared-components.json | 3 +++ 7 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/components/dialogs/DialogRejectProducerDelegation.tsx b/src/components/dialogs/DialogRejectProducerDelegation.tsx index 33d610689..91eee100d 100644 --- a/src/components/dialogs/DialogRejectProducerDelegation.tsx +++ b/src/components/dialogs/DialogRejectProducerDelegation.tsx @@ -48,8 +48,8 @@ export const DialogRejectProducerDelegation: React.FC diff --git a/src/components/dialogs/DialogRevokeProducerDelegation.tsx b/src/components/dialogs/DialogRevokeProducerDelegation.tsx index f5a132529..c44f7f7db 100644 --- a/src/components/dialogs/DialogRevokeProducerDelegation.tsx +++ b/src/components/dialogs/DialogRevokeProducerDelegation.tsx @@ -74,7 +74,7 @@ export const DialogRevokeProducerDelegation: React.FC diff --git a/src/pages/DelegationsPage/DelegationsAvailabilityTab/DelegationAvailabilityTab.tsx b/src/pages/DelegationsPage/DelegationsAvailabilityTab/DelegationAvailabilityTab.tsx index 1038dfe4c..92db60396 100644 --- a/src/pages/DelegationsPage/DelegationsAvailabilityTab/DelegationAvailabilityTab.tsx +++ b/src/pages/DelegationsPage/DelegationsAvailabilityTab/DelegationAvailabilityTab.tsx @@ -10,6 +10,14 @@ import { TenantHooks } from '@/api/tenant' import { hasTenantGivenProducerDelegationAvailability } from '@/utils/tenant.utils' export const DelegationsAvailabilityTab: React.FC = () => { + return ( + }> + + + ) +} + +const DelegationsAvailabilitySection: React.FC = () => { const { t } = useTranslation('party', { keyPrefix: 'delegations.availabilityTab' }) const { t: tCommon } = useTranslation('common') const { isAdmin } = AuthHooks.useJwt() diff --git a/src/pages/DelegationsPage/DelegationsGrantedTab/DelegationsGrantedTab.tsx b/src/pages/DelegationsPage/DelegationsGrantedTab/DelegationsGrantedTab.tsx index 741012c3b..3fcfdb83b 100644 --- a/src/pages/DelegationsPage/DelegationsGrantedTab/DelegationsGrantedTab.tsx +++ b/src/pages/DelegationsPage/DelegationsGrantedTab/DelegationsGrantedTab.tsx @@ -8,12 +8,15 @@ import { keepPreviousData, useQuery } from '@tanstack/react-query' import { AuthHooks } from '@/api/auth' import { DelegationQueries } from '@/api/delegation' import { Link } from '@/router' -import { DelegationsTable } from '@/components/shared/DelegationTable/DelegationsTable' +import { + DelegationsTable, + DelegationsTableSkeleton, +} from '@/components/shared/DelegationTable/DelegationsTable' export const DelegationsGrantedTab: React.FC = () => { const { t: tCommon } = useTranslation('common') - const { isAdmin } = AuthHooks.useJwt() - const currentUserOrganizationId = AuthHooks.useJwt().jwt?.organizationId + const { isAdmin, jwt } = AuthHooks.useJwt() + const currentUserOrganizationId = jwt?.organizationId const { paginationParams, paginationProps, getTotalPageCount } = usePagination({ limit: 10 }) @@ -47,7 +50,9 @@ export const DelegationsGrantedTab: React.FC = () => { )} - + }> + + ) diff --git a/src/pages/DelegationsPage/components/DelegationsReceivedTab/DelegationsReceivedTab.tsx b/src/pages/DelegationsPage/components/DelegationsReceivedTab/DelegationsReceivedTab.tsx index 57454e376..916162fb7 100644 --- a/src/pages/DelegationsPage/components/DelegationsReceivedTab/DelegationsReceivedTab.tsx +++ b/src/pages/DelegationsPage/components/DelegationsReceivedTab/DelegationsReceivedTab.tsx @@ -8,7 +8,6 @@ import { } from '../../../../components/shared/DelegationTable/DelegationsTable' import { keepPreviousData, useQuery } from '@tanstack/react-query' import { DelegationQueries } from '@/api/delegation' -import type { DelegationType } from '@/types/party.types' export const DelegationsReceivedTab: React.FC = () => { const { jwt } = AuthHooks.useJwt() diff --git a/src/static/locales/en/shared-components.json b/src/static/locales/en/shared-components.json index b99f7539a..87c77b54e 100644 --- a/src/static/locales/en/shared-components.json +++ b/src/static/locales/en/shared-components.json @@ -170,6 +170,9 @@ "content": { "description": "The delegate will lose management of your e-service {{eserviceName}} with producer delegation, and the agreements and the purposes associated with it. The e-service will return under your control in the state it was in at the time of revocation. Do you have doubts? <1>Read the guide.", "checkbox": "I have read and I want to proceed with the revocation" + }, + "actions": { + "revoke": "Revoke delegation" } }, "dialogRejectDelegatedVersionDraft": { diff --git a/src/static/locales/it/shared-components.json b/src/static/locales/it/shared-components.json index f6ec27e9f..27949b0ea 100644 --- a/src/static/locales/it/shared-components.json +++ b/src/static/locales/it/shared-components.json @@ -170,6 +170,9 @@ "content": { "description": "Il delegato perderà la gestione del tuo e-service {{eserviceName}} con delega all'erogazione, e delle richieste di fruizione e le finalità ad esso associate. L’e-service tornerà sotto il tuo controllo nello stato in cui si trova all’atto della revoca. Hai dubbi? <1>Consulta la guida.", "checkbox": "Ho letto e voglio procedere con la revoca" + }, + "actions": { + "revoke": "Revoca la delega" } }, "dialogRejectDelegatedVersionDraft": {