From 0f54ce6bd967f91093ea1fcbe231881b2e71d5a0 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 5 Dec 2024 17:16:27 +0100 Subject: [PATCH] - updated tables - displaying protocol id, columns for ndg and appointment; - added 2 buttons for download delega and download signed pdf for application; --- src/assets/scss/components/appPage.scss | 4 ++ .../PreInstructorDomandeTable/index.js | 11 +++- .../DownloadCompanyDelegation/index.js | 51 +++++++++++++++++++ .../DownloadSignedApplication/index.js | 45 ++++++++++++++++ src/pages/DomandaEditPreInstructor/index.js | 22 +++++++- .../components/AllDomandeTable/index.js | 16 +++--- .../BeneficiarioDomandeTable/index.js | 6 ++- .../PreInstructorSoccorsiTable/index.js | 15 +++--- 8 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 src/pages/DomandaEditPreInstructor/components/DownloadCompanyDelegation/index.js create mode 100644 src/pages/DomandaEditPreInstructor/components/DownloadSignedApplication/index.js diff --git a/src/assets/scss/components/appPage.scss b/src/assets/scss/components/appPage.scss index 8f40ad9..da0721a 100644 --- a/src/assets/scss/components/appPage.scss +++ b/src/assets/scss/components/appPage.scss @@ -342,6 +342,10 @@ .appPageSection__row { display: flex; gap: 1rem; + + &.autoFlow { + flex-wrap: wrap; + } } .appPageSection__pMeta { diff --git a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js index 537fa3c..4cac1b4 100644 --- a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js +++ b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js @@ -141,7 +141,16 @@ const PreInstructorDomandeTable = () => { header={header} emptyMessage={translationStrings.emptyMessage} onFilter={(e) => setFilters(e.filters)}> - + + + { + const [loading, setLoading] = useState(false); + const [delega, setDelega] = useState({}); + + const onClickDownload = () => { + if (delega.filePath) { + window.open(encodeURI(delega.filePath), '_blank').focus() + } + } + + const getDellegaCallback = (data) => { + if (data.data) { + setDelega([data.data]); + } + setLoading(false); + } + + const errDellegaCallback = () => { + setDelega([]); + setLoading(false); + } + + useEffect(() => { + setLoading(true); + CompanyService.getCompanyDelega(0, getDellegaCallback, errDellegaCallback, [ + ['applicationId', applicationId] + ]); + }, []) + + return (applicationId && applicationId !== 0 + ?