From 63ca3253b6cf82b96d8cd7f3eeb2d91b2da2b8e3 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 24 Apr 2025 16:11:37 +0200 Subject: [PATCH] - added btn 'csv report'; --- .../components/AllBandiTableAsync/index.js | 55 ++++++++++++++++--- .../components/ElementSetting/index.js | 2 +- .../ElementSettingTableColumns/index.js | 1 - .../ElementSettingTableColumnsForCsv/index.js | 4 +- .../components/LatestBandiTableAsync/index.js | 45 +++++++++++++-- .../index.js | 44 ++++++++++++++- src/service/application-service.js | 4 ++ 7 files changed, 138 insertions(+), 17 deletions(-) diff --git a/src/pages/Bandi/components/AllBandiTableAsync/index.js b/src/pages/Bandi/components/AllBandiTableAsync/index.js index 6b81818..8649c73 100644 --- a/src/pages/Bandi/components/AllBandiTableAsync/index.js +++ b/src/pages/Bandi/components/AllBandiTableAsync/index.js @@ -6,6 +6,7 @@ import translationStrings from '../../../../translationStringsForComponents'; // api import BandoService from '../../../../service/bando-service'; +import ApplicationService from '../../../../service/application-service'; // tools import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString'; @@ -14,6 +15,7 @@ import getFormattedDateString from '../../../../helpers/getFormattedDateString'; import getBandoLabel from '../../../../helpers/getBandoLabel'; import getBandoSeverity from '../../../../helpers/getBandoSeverity'; import getQueryParamsForPaginatedEndpoint from '../../../../helpers/getQueryParamsForPaginatedEndpoint'; +import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse'; // components import { DataTable } from 'primereact/datatable'; @@ -41,7 +43,7 @@ const AllBandiTableAsync = () => { status: { value: null, matchMode: 'equals' } } }); - const statuses = ['DRAFT','PUBLISH','EXPIRED']; + const statuses = ['DRAFT', 'PUBLISH', 'EXPIRED']; const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]); @@ -63,7 +65,8 @@ const AllBandiTableAsync = () => { const getCallback = (resp) => { if (resp.status === 'SUCCESS') { - const { body, totalRecords, + const { + body, totalRecords, //currentPage, totalPages, pageSize } = resp.data; setTotalRecordsNum(totalRecords); @@ -86,9 +89,44 @@ const AllBandiTableAsync = () => { }; const actionsBodyTemplate = (rowData) => { - return -