Skip to content

Commit

Permalink
Merge branch 'feat/upgrade-caricamento-massivo' of github.com:teamdig…
Browse files Browse the repository at this point in the history
…itale/monitoraggio.repubblicadigitale.gov.it into feat/upgrade-caricamento-massivo
  • Loading branch information
sgravinadxc committed Sep 25, 2024
2 parents 4462399 + 3000d87 commit e9ae880
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 21 deletions.
13 changes: 12 additions & 1 deletion fe-piattaforma/src/components/AccordionRow/accordionRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,18 @@ const AccordionRow: React.FC<AccordionRowI> = ({
color='primary'
/>
</Button>
) : null}
) : <Button
className='px-2'
aria-label='Informazioni'
title='Caricamento fallito'
>
<Icon
icon='it-info-circle'
color='primary'
aria-label='Info'
aria-hidden
/>
</Button>}
</div>
{((onTooltipInfo || innerInfo?.onTooltipInfo) &&
innerInfo?.isPresentInList) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ const ActivityReportTable = forwardRef(function ActivityReportTable(
const { projectId, enteId } = useParams();

const searchReports = useCallback(
(newPage: number) => {
(newPage: number, showLoaderFlag = true) => {
if (projectId && (enteId || projectContext)) {
dispatch(showLoader());
if(showLoaderFlag)
dispatch(showLoader());
searchActivityReport(
newPage - 1,
10,
Expand Down Expand Up @@ -130,7 +131,7 @@ const ActivityReportTable = forwardRef(function ActivityReportTable(
searchReports(1);

const interval = setInterval(() => {
searchReports(1);
searchReports(1, false);
}, 30000);

return () => clearInterval(interval);
Expand Down
40 changes: 25 additions & 15 deletions fe-piattaforma/src/components/Table/view/tableDesktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Icon,
Label,
Table as TableKit,
Tooltip,
UncontrolledTooltip,
} from 'design-react-kit';
import clsx from 'clsx';
Expand Down Expand Up @@ -186,9 +187,8 @@ const TableDesktop: React.FC<TableI> = (props) => {
<Button
onClick={() => onActionClick[CRUDActionTypes.EDIT](td)}
className='mr-4 p-0'
aria-label={`Modifica ${
td?.nome || td?.label || td?.name
}`}
aria-label={`Modifica ${td?.nome || td?.label || td?.name
}`}
>
<Icon
icon='it-pencil'
Expand All @@ -209,9 +209,8 @@ const TableDesktop: React.FC<TableI> = (props) => {
onActionClick[CRUDActionTypes.DELETE](td)
}
className='mr-4 p-0'
aria-label={`Elimina ${
td?.nome || td?.label || td?.name
}`}
aria-label={`Elimina ${td?.nome || td?.label || td?.name
}`}
>
<Icon
icon='it-less-circle'
Expand All @@ -230,9 +229,8 @@ const TableDesktop: React.FC<TableI> = (props) => {
<Button
onClick={() => onActionClick[CRUDActionTypes.CLONE](td)}
className='mr-4 p-0'
aria-label={`Clona ${
td?.nome || td?.label || td?.name
}`}
aria-label={`Clona ${td?.nome || td?.label || td?.name
}`}
>
<Icon
icon='it-copy'
Expand All @@ -254,9 +252,8 @@ const TableDesktop: React.FC<TableI> = (props) => {
onActionClick[CRUDActionTypes.VIEW](td)
}
className='p-0'
aria-label={`Vai al dettaglio di ${
td?.nome || td?.label || td?.name
}`}
aria-label={`Vai al dettaglio di ${td?.nome || td?.label || td?.name
}`}
>
<Icon
icon='it-chevron-right'
Expand All @@ -271,7 +268,7 @@ const TableDesktop: React.FC<TableI> = (props) => {
) : null}
{(
td.actions &&
td.jobStatus === "SUCCESS" &&
td.jobStatus === "SUCCESS" &&
td.actions
.toString()
.includes(CRUDActionTypes.DOWNLOAD)
Expand All @@ -292,12 +289,25 @@ const TableDesktop: React.FC<TableI> = (props) => {
aria-hidden
/>
</Button>
) : null}
) :
<Button
className='p-0'
aria-label='Informazioni'
title='Caricamento fallito'
>
<Icon
icon='it-info-circle'
color='primary'
aria-label='Info'
aria-hidden
/>
</Button>
}
</div>
</td>
) : null}
{((onTooltipInfo || td?.onTooltipInfo) && td?.isPresentInList) ||
td?.failedCSV ? (
td?.failedCSV ? (
<td id={`tooltip-${td.id}-${i}`}>
<div className='d-inline-flex position-relative'>
<UncontrolledTooltip
Expand Down
4 changes: 2 additions & 2 deletions fe-piattaforma/src/components/Table/view/tableMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const TableMobile: React.FC<MobileTableI> = ({
clickDeleteAction: onActionClick?.[CRUDActionTypes.DELETE]
? () => onActionClick?.[CRUDActionTypes.DELETE](item)
: undefined,
clickDownloadAction: onActionClick?.[CRUDActionTypes.DOWNLOAD]
? () => onActionClick?.[CRUDActionTypes.DOWNLOAD](item)
clickDownloadAction: onActionClick?.[CRUDActionTypes.DOWNLOAD] && item.jobStatus === 'SUCCESS'
? () => {onActionClick?.[CRUDActionTypes.DOWNLOAD](item)}
: undefined,
innerInfo: isEmpty(rest) ? undefined : { id, ...rest },
};
Expand Down

0 comments on commit e9ae880

Please sign in to comment.