diff --git a/frontend/src/common/services/hitasApi/reports.ts b/frontend/src/common/services/hitasApi/reports.ts index 296aa68fc..bfa1175b7 100644 --- a/frontend/src/common/services/hitasApi/reports.ts +++ b/frontend/src/common/services/hitasApi/reports.ts @@ -62,6 +62,9 @@ export const downloadSalesByPostalCodeAndAreaReportPDF = ({ export const downloadRegulatedHousingCompaniesPDF = () => fetchAndDownloadPDF("/reports/download-regulated-housing-companies-report"); +export const downloadRegulatedHalfHitasHousingCompaniesExcel = () => + fetchAndDownloadPDF("/reports/download-regulated-half-hitas-housing-companies-report"); + export const downloadUnregulatedHousingCompaniesPDF = () => fetchAndDownloadPDF("/reports/download-unregulated-housing-companies-report"); diff --git a/frontend/src/common/services/utils.ts b/frontend/src/common/services/utils.ts index 373afda50..6cf83f3a3 100644 --- a/frontend/src/common/services/utils.ts +++ b/frontend/src/common/services/utils.ts @@ -54,7 +54,10 @@ export const fetchAndDownloadPDF = (url: string, method: "GET" | "POST" = "GET", } }) // eslint-disable-next-line no-console - .catch((error) => console.error(error)); + .catch((error) => { + console.error(error); + hdsToast.error(`Virhe ladattaessa tiedostoa. (${error?.message ?? error})`); + }); }; export const safeInvalidate = (error, tags) => (!error ? tags : []); diff --git a/frontend/src/features/reports/ReportsPage.tsx b/frontend/src/features/reports/ReportsPage.tsx index 36aabd1c5..2b62956e9 100644 --- a/frontend/src/features/reports/ReportsPage.tsx +++ b/frontend/src/features/reports/ReportsPage.tsx @@ -2,6 +2,7 @@ import {Accordion} from "hds-react"; import {Divider, Heading} from "../../common/components"; import { HousingCompanyReportRegulated, + HousingCompanyReportRegulatedHalfHitas, HousingCompanyReportReleased, HousingCompanyStatusTable, } from "./components/HousingCompanyReports"; @@ -34,6 +35,8 @@ const ReportsPage = () => { + + diff --git a/frontend/src/features/reports/components/HousingCompanyReports.tsx b/frontend/src/features/reports/components/HousingCompanyReports.tsx index 336ef2bc9..a866d7acd 100644 --- a/frontend/src/features/reports/components/HousingCompanyReports.tsx +++ b/frontend/src/features/reports/components/HousingCompanyReports.tsx @@ -3,6 +3,7 @@ import {DownloadButton, Heading, QueryStateHandler} from "../../../common/compon import {IHousingCompanyState} from "../../../common/schemas"; import { downloadHousingCompanyStatesReportPDF, + downloadRegulatedHalfHitasHousingCompaniesExcel, downloadRegulatedHousingCompaniesPDF, downloadUnregulatedHousingCompaniesPDF, useGetHousingCompanyStatesQuery, @@ -70,6 +71,23 @@ export const HousingCompanyReportRegulated = () => { ); }; +export const HousingCompanyReportRegulatedHalfHitas = () => { + return ( +
+
+ Säännellyt Puolihitas-yhtiöt + Listaus sääntelyn piirissä olevista Puolihitas-taloyhtiöistä +
+ +
+
+
+ ); +}; + export const HousingCompanyReportReleased = () => { return (
diff --git a/frontend/src/features/reports/components/OwnerReports.tsx b/frontend/src/features/reports/components/OwnerReports.tsx index c573c83b8..6e81a72e6 100644 --- a/frontend/src/features/reports/components/OwnerReports.tsx +++ b/frontend/src/features/reports/components/OwnerReports.tsx @@ -1,4 +1,4 @@ -import {DownloadButton, Heading} from "../../../common/components"; +import {Divider, DownloadButton, Heading} from "../../../common/components"; import {downloadMultipleOwnershipsReportPDF, downloadRegulatedOwnershipsReportExcel} from "../../../common/services"; const OwnerReports = () => { @@ -19,6 +19,7 @@ const OwnerReports = () => {
+
Sääntelyn piirissä olevien Hitas-asuntojen omistajat