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

PIN-5862 PIN-5861 - Fix actions label, textarea validation rules and improved delegations page loading UI #1052

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/dialogs/DialogRejectProducerDelegation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export const DialogRejectProducerDelegation: React.FC<DialogRejectProducerDelega
infoLabel={t('content.reason.infoLabel')}
focusOnMount
multiline
inputProps={{ maxLength: 1000 }}
rules={{ required: true, minLength: 20 }}
inputProps={{ maxLength: 250 }}
rules={{ required: true, minLength: 10 }}
/>
</DialogContent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const DialogRevokeProducerDelegation: React.FC<DialogRevokeProducerDelega
{tCommon('cancel')}
</Button>
<Button variant="contained" disabled={!isConfirmCheckboxChecked} onClick={handleRevoke}>
{tCommon('revoke')}
{t('actions.revoke')}
</Button>
</DialogActions>
</Dialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import { TenantHooks } from '@/api/tenant'
import { hasTenantGivenProducerDelegationAvailability } from '@/utils/tenant.utils'

export const DelegationsAvailabilityTab: React.FC = () => {
return (
<React.Suspense fallback={<DelegationsAvailabilitySectionSkeleton />}>
<DelegationsAvailabilitySection />
</React.Suspense>
)
}

const DelegationsAvailabilitySection: React.FC = () => {
const { t } = useTranslation('party', { keyPrefix: 'delegations.availabilityTab' })
const { t: tCommon } = useTranslation('common')
const { isAdmin } = AuthHooks.useJwt()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down Expand Up @@ -47,7 +50,9 @@ export const DelegationsGrantedTab: React.FC = () => {
</Link>
</Stack>
)}
<DelegationsTable delegationType="DELEGATION_GRANTED" params={queryParams} />
<React.Suspense fallback={<DelegationsTableSkeleton delegationType="DELEGATION_GRANTED" />}>
<DelegationsTable delegationType="DELEGATION_GRANTED" params={queryParams} />
</React.Suspense>
<Pagination {...paginationProps} totalPages={totalPageCount} />
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions src/static/locales/en/shared-components.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
"content": {
"description": "The delegate will lose management of your e-service <strong>{{eserviceName}} with producer delegation</strong>, 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</1>.",
"checkbox": "I have read and I want to proceed with the revocation"
},
"actions": {
"revoke": "Revoke delegation"
}
},
"dialogRejectDelegatedVersionDraft": {
Expand Down
3 changes: 3 additions & 0 deletions src/static/locales/it/shared-components.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
"content": {
"description": "Il delegato perderà la gestione del tuo e-service <strong>{{eserviceName}} con delega all'erogazione</strong>, 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</1>.",
"checkbox": "Ho letto e voglio procedere con la revoca"
},
"actions": {
"revoke": "Revoca la delega"
}
},
"dialogRejectDelegatedVersionDraft": {
Expand Down
Loading