From 4b81b0b5f67bc1666dfde8262abfe5a04cccaa2f Mon Sep 17 00:00:00 2001 From: yadhap Dahal Date: Thu, 5 Sep 2024 10:02:07 -0400 Subject: [PATCH 1/3] Removed incorrectly implemented and non-functional print asset functionality. The original goal was to print asset-related data. This incorreclty implemented functionality attempts to generate the file directly from the DOM, which is not the correct method. The proper implementation would involve generating a PDF with asset details on the server and sending it to the client via res.sendFile --- .../application/Assets/AssetsTable.js | 48 ---- .../application/Assets/TitleRenderer.js | 7 +- .../components/application/Assets/index.js | 32 --- .../application/Assets/pdf/FileDetailsPdf.jsx | 154 ----------- .../Assets/pdf/GroupDetailsPdf.jsx | 100 ------- .../Assets/pdf/IndexDetailsPdf.jsx | 83 ------ .../application/Assets/pdf/JobDetailsPdf.jsx | 185 ------------- .../Assets/pdf/QueryDetailsPdf.jsx | 85 ------ .../Assets/pdf/SelectDetailsForPdfDialog.jsx | 260 ------------------ .../application/Assets/pdf/downloadPdf.js | 58 ---- .../Assets/pdf/pdfStyledComponents.js | 123 --------- 11 files changed, 1 insertion(+), 1134 deletions(-) delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/FileDetailsPdf.jsx delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/GroupDetailsPdf.jsx delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/IndexDetailsPdf.jsx delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/JobDetailsPdf.jsx delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/QueryDetailsPdf.jsx delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/SelectDetailsForPdfDialog.jsx delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/downloadPdf.js delete mode 100644 Tombolo/client-reactjs/src/components/application/Assets/pdf/pdfStyledComponents.js diff --git a/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js b/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js index f25e56ba..90d5697c 100644 --- a/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js +++ b/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js @@ -7,7 +7,6 @@ import { EditOutlined, QuestionCircleOutlined, FolderOpenOutlined, - FilePdfOutlined, AreaChartOutlined, } from '@ant-design/icons'; @@ -16,8 +15,6 @@ import MoveAssetsDialog from './MoveAssetsDialog'; import { hasEditPermission } from '../../common/AuthUtil.js'; import { Constants } from '../../common/Constants'; import { assetsActions } from '../../../redux/actions/Assets'; -import SelectDetailsForPdfDialog from '../Assets/pdf/SelectDetailsForPdfDialog'; -import { getNestedAssets } from '../Assets/pdf/downloadPdf'; import ReactMarkdown from 'react-markdown'; import DeleteAsset from '../../common/DeleteAsset'; import Text from '../../common/Text.jsx'; @@ -38,9 +35,6 @@ function AssetsTable({ openGroup, handleEditGroup, refreshGroups }) { const { assetTypeFilter, keywords } = assetReducer.searchParams; const [assetToMove, setAssetToMove] = useState({ id: '', type: '', title: '', selectedKeys: {} }); - const [selectedAsset, setSelectedAsset] = useState(); - const [toPrintAssets, setToPrintAssets] = useState([]); - const [selectDetailsforPdfDialogVisibility, setSelectDetailsforPdfDialogVisibility] = useState(false); const [assets, setAssets] = useState([]); const fetchDataAndRenderTable = async () => { @@ -72,13 +66,6 @@ function AssetsTable({ openGroup, handleEditGroup, refreshGroups }) { fetchDataAndRenderTable(); }, [applicationId, assetTypeFilter, keywords, selectedGroup?.selectedKeys?.id]); - //Execute generate pdf function after asset is selected - useEffect(() => { - if (selectedAsset) { - generatePdf(); - } - }, [selectedAsset]); - //When edit icon is clicked const handleEdit = (id, type, action, vizUrl) => { dispatch(assetsActions.assetSelected(id, applicationId, '')); @@ -377,21 +364,6 @@ function AssetsTable({ openGroup, handleEditGroup, refreshGroups }) { /> - }> - - getNestedAssets( - applicationId, - setSelectedAsset, - setSelectDetailsforPdfDialogVisibility, - record, - setToPrintAssets - ) - } - /> - - {record.type === 'File' ? ( record.visualization ? ( }> @@ -415,15 +387,6 @@ function AssetsTable({ openGroup, handleEditGroup, refreshGroups }) { }, ]; - //Generate PDF & printing task complete function - const generatePdf = () => { - setSelectDetailsforPdfDialogVisibility(true); - }; - - const printingTaskCompleted = () => { - setSelectDetailsforPdfDialogVisibility(false); - }; - return (
@@ -461,17 +424,6 @@ function AssetsTable({ openGroup, handleEditGroup, refreshGroups }) { application={applicationReducer.application} /> ) : null} - - {/* Dialog box to select which element to export as PDF */} - {selectDetailsforPdfDialogVisibility ? ( - - ) : null} ); } diff --git a/Tombolo/client-reactjs/src/components/application/Assets/TitleRenderer.js b/Tombolo/client-reactjs/src/components/application/Assets/TitleRenderer.js index d1f5e0a4..0aa38256 100644 --- a/Tombolo/client-reactjs/src/components/application/Assets/TitleRenderer.js +++ b/Tombolo/client-reactjs/src/components/application/Assets/TitleRenderer.js @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { DeleteOutlined, EyeOutlined, FilePdfOutlined, FolderOutlined, PlusOutlined } from '@ant-design/icons'; +import { DeleteOutlined, EyeOutlined, FolderOutlined, PlusOutlined } from '@ant-design/icons'; import { useDispatch } from 'react-redux'; import { Dropdown } from 'antd'; @@ -42,11 +42,6 @@ const TitleRenderer = ({ nodeData, handleMenuClick }) => { label: , icon: , }, - { - key: 'Print-Assets', - label: , - icon: , - }, ]; const isRootNode = nodeData.key === '0-0'; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/index.js b/Tombolo/client-reactjs/src/components/application/Assets/index.js index 07fb6c71..efb9593c 100644 --- a/Tombolo/client-reactjs/src/components/application/Assets/index.js +++ b/Tombolo/client-reactjs/src/components/application/Assets/index.js @@ -15,8 +15,6 @@ import AssetsTable from './AssetsTable'; import TitleRenderer from './TitleRenderer.js'; import MoveAssetsDialog from './MoveAssetsDialog'; import useModal from '../../../hooks/useModal'; -import SelectDetailsForPdfDialog from '../Assets/pdf/SelectDetailsForPdfDialog'; -import { getNestedAssets } from '../Assets/pdf/downloadPdf'; import { CreateGroupDialog } from './CreateGroupDialog'; import Text, { i18n } from '../../common/Text'; import InfoDrawer from '../../common/InfoDrawer'; @@ -56,9 +54,6 @@ const Assets = () => { const [editGroup, setEditGroup] = useState({ edit: false, groupId: '' }); const [itemToMove, setItemToMove] = useState({}); - const [selectDetailsforPdfDialogVisibility, setSelectDetailsforPdfDialogVisibility] = useState(false); - const [selectedAsset, setSelectedAsset] = useState(); - const [toPrintAssets, setToPrintAssets] = useState([]); const [searchKeyword, setSearchKeyword] = useState(''); const [openHelp, setOpenHelp] = useState(false); @@ -151,16 +146,6 @@ const Assets = () => { } }; - const handlePrintAssets = () => { - getNestedAssets( - application.applicationId, - setSelectedAsset, - setSelectDetailsforPdfDialogVisibility, - { ...selectedKeys, type: 'Group' }, - setToPrintAssets - ); - }; - const handleMenuClick = (e, group) => { const goTo = (point) => { dispatch(assetsActions.newAsset(application.applicationId, selectedKeys.id)); @@ -178,7 +163,6 @@ const Assets = () => { 'Edit-Group': () => openNewGroupDialog({ edit: true, groupId: '' }), 'Delete-Group': () => handleDeleteGroup(), 'Move-Group': () => openMoveAssetDialog({ ...group, type: 'Group' }), - 'Print-Assets': () => handlePrintAssets(), }; const runAction = actions[e.key]; @@ -304,11 +288,6 @@ const Assets = () => { { key: 'RealBI Dashboard', icon: , label: 'RealBI Dashboard' }, ]; - //Generate PDF & printing task complete function - const printingTaskCompleted = () => { - setSelectDetailsforPdfDialogVisibility(false); - }; - return (
@@ -378,17 +357,6 @@ const Assets = () => { application={applicationReducer.application} /> ) : null} - - {/* Dialog box to select which element to export as PDF */} - {selectDetailsforPdfDialogVisibility ? ( - - ) : null} ); diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/FileDetailsPdf.jsx b/Tombolo/client-reactjs/src/components/application/Assets/pdf/FileDetailsPdf.jsx deleted file mode 100644 index 495c8e72..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/FileDetailsPdf.jsx +++ /dev/null @@ -1,154 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { authHeader, handleError } from '../../../common/AuthHeader'; -import ReactMarkdown from 'react-markdown'; -import { downloadPdf } from './downloadPdf'; -import { useSelector } from 'react-redux'; -import { message } from 'antd'; -import { PdfContainer, Heading, SectionTitle, TableContainer, Table } from './pdfStyledComponents'; - -function FileDetailsPdf(props) { - //Local States - const [basicData, setBasicData] = useState({}); - const [fileLayouts, setFileLayouts] = useState([]); - const consumers = useSelector((state) => state.applicationReducer.consumers); - const th = ['Field', 'Type', 'Description']; - - //Get consumer name - const getConsumerName = (consumers, consumerType, consumerId) => { - let name = ''; - consumers.map((consumer) => { - if (consumer.assetType === consumerType && consumer.id === consumerId) { - name = consumer.name; - } - }); - return name; - }; - - //Remove elements from DOM - const removeElements = (elms) => elms.forEach((el) => el.remove()); - - //Remove all elements except the ones selected - useEffect(() => { - if (props.selectedAssetType !== 'Group') { - let elements = document.querySelector('.pdfContainer'); - let childElements = Array.from(elements.childNodes).map((item) => item.className); - const exportClasses = props.classesToExport; - - childElements = childElements.filter((item) => !exportClasses.includes(item)); - - childElements.map((item) => { - removeElements(document.querySelectorAll(`.${item}`)); - }); - } - }, []); - - //Make call to get data when component loads - useEffect(() => { - fetch('/api/file/read/file_details?file_id=' + props.selectedAssetId + '&app_id=' + props.applicationId, { - headers: authHeader(), - }) - .then((response) => { - if (response.ok) { - return response.json(); - } - handleError(response); - }) - .then((data) => { - setBasicData(data.basic); - return data; - }) - .then((data) => { - setFileLayouts(data.file_layouts); - if (props.assets?.length == 1) { - setTimeout(() => { - downloadPdf(data.basic.title, 'pdfContainer'); - props.printingTaskCompleted(); - }, 1000); - } - }) - .catch((error) => { - console.log('error', error); - message.error('Unable to fetch data to create pdf'); - props.printingTaskCompleted(); - }); - }, []); - - return ( - -
- File - {basicData?.title} - Basic Details - -
- Title : {basicData.title} -
-
- Name : {basicData.name} -
-
- Scope : {basicData.scope} -
-
- service URL : - {basicData.serviceURL} -
- -
- Is Super File : - {basicData.isSuperFile ? 'Yes' : 'No'} -
-
- Supplier : - {getConsumerName(consumers, 'Supplier', basicData.supplier)} -
-
- Consumer : - {getConsumerName(consumers, 'Consumer', basicData.consumer)} -
-
- Owner : - {getConsumerName(consumers, 'Owner', basicData.owner)} -
-
- Description : - -
-
- -
- Layout - {fileLayouts.length > 0 ? ( - - - - - {th.map((head, index) => ( - - ))} - - - - {fileLayouts.map((value, index) => { - return ( - - - - - - ); - })} - -
{head}
{value.name}{value.type}{value.description}
-
- ) : ( -
No Layout data
- )} -
-
- ); -} - -export default FileDetailsPdf; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/GroupDetailsPdf.jsx b/Tombolo/client-reactjs/src/components/application/Assets/pdf/GroupDetailsPdf.jsx deleted file mode 100644 index ca4130cf..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/GroupDetailsPdf.jsx +++ /dev/null @@ -1,100 +0,0 @@ -import React, { useEffect } from 'react'; -import FileDetailsPdf from './FileDetailsPdf'; -import IndexDetailsPdf from './IndexDetailsPdf'; -import QueryDetailsPdf from './QueryDetailsPdf'; -import { downloadPdf } from './downloadPdf'; -import JobDetailsPdf from './JobDetailsPdf'; - -function GroupDetailsPdf(props) { - //Local state and variables - const { nestedAssets: assets, applicationId } = props; - - useEffect(() => { - //Remove unchecked elements from DOM - const removeElements = (elms) => elms.forEach((el) => el.remove()); - let elements = document.querySelectorAll('.pdfContainer'); - let elementArray = Array.from(elements); - let childNodes = []; - let childNodesArray = []; - elementArray.map((item) => childNodes.push(item.childNodes)); - childNodes.map((item) => childNodesArray.push(Array.from(item))); - let flattenNodesArray = childNodesArray.flat(); - let childElements = flattenNodesArray.map((item) => item.className); - const exportClasses = props.classesToExport; - - let sortedElements = childElements.filter((item) => !exportClasses.includes(item)); - - sortedElements.map((item) => { - removeElements(document.querySelectorAll(`.${item}`)); - }); - }, []); - - useEffect(() => { - setTimeout(() => { - const ele = document.getElementById('ecl_render'); - if (ele) { - ele.innerHTML = ele.innerHTML.replace(/;/g, ';
'); - } - downloadPdf('assetDetails', 'pdfContainerWraper'); - props.printingTaskCompleted(); - }, 2000); - }, []); - - return ( -
- {assets.map((asset, index) => { - switch (asset.type) { - case 'File': - return ( - - ); - - case 'Index': - return ( - - ); - - case 'Query': - return ( - - ); - - case 'Job': - return ( - - ); - } - })} -
- ); -} - -export default GroupDetailsPdf; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/IndexDetailsPdf.jsx b/Tombolo/client-reactjs/src/components/application/Assets/pdf/IndexDetailsPdf.jsx deleted file mode 100644 index e6614246..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/IndexDetailsPdf.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { PdfContainer, SectionTitle, Heading } from './pdfStyledComponents'; -import { authHeader, handleError } from '../../../common/AuthHeader'; -import { downloadPdf } from './downloadPdf'; -import ReactMarkdown from 'react-markdown'; -import { message } from 'antd'; - -function IndexDetailsPdf(props) { - //Local State & variables - const { selectedAssetId, applicationId, printingTaskCompleted } = props; - const [indexData, setIndexData] = useState(); - - //Fetch Index details and store in local state when componnet loads - useEffect(() => { - const abortFetch = new AbortController(); - fetch( - '/api/index/read/index_details?index_id=' + selectedAssetId + '&app_id=' + applicationId, - { - headers: authHeader(), - }, - { - signal: abortFetch, - } - ) - .then((response) => { - if (response.ok) { - return response.json(); - } - handleError(response); - }) - .then((data) => { - setIndexData(data); - }) - .catch((error) => { - console.log(error); - message.error('Unable to fetch data to create pdf'); - printingTaskCompleted(); - }); - - //Clean up - return () => { - abortFetch.abort(); - }; - }, []); - - //Once data is set in state - useEffect(() => { - if (indexData && props.assets?.length == 1) { - downloadPdf(indexData.basic.title, 'pdfContainer'); - printingTaskCompleted(); - } - }, [indexData]); - - return ( - -
- Index - {indexData?.basic.title} - Basic Details -
- Title : {indexData?.basic.title} -
-
- Name : {indexData?.basic.name} -
-
- Primary Service : {indexData?.basic.primaryService} -
-
- Backup Service : {indexData?.basic.backupService} -
-
- Path : {indexData?.basic.qualifiedPath} -
-
- Description : - -
-
-
- ); -} - -export default IndexDetailsPdf; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/JobDetailsPdf.jsx b/Tombolo/client-reactjs/src/components/application/Assets/pdf/JobDetailsPdf.jsx deleted file mode 100644 index 195b08e1..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/JobDetailsPdf.jsx +++ /dev/null @@ -1,185 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import ReactMarkdown from 'react-markdown'; -import { PdfContainer, Heading, BasicTitle, TableContainer, Table } from './pdfStyledComponents'; -import { authHeader, handleError } from '../../../common/AuthHeader'; -import { downloadPdf } from './downloadPdf'; - -function JobDetailsPdf(props) { - //Local States & vars - const [data, setData] = useState(); - const { selectedAssetId, applicationId } = props; - const [input, setInput] = useState(); - const [output, setOutput] = useState(); - - //Make api call and get job detail and set in local state - useEffect(() => { - let url = `/api/job/job_details?job_id=${selectedAssetId}&app_id=${applicationId}`; - - fetch(url, { - headers: authHeader(), - }) - .then((response) => { - if (response.ok) { - return response.json(); - } - handleError(response); - }) - .then((data) => { - setData(data); - }) - .catch((error) => { - console.log(error); - }); - }, []); - - //once the job data is pulled and set in local state - useEffect(() => { - //Saperate input and output files - if (data) { - setInput(data.jobfiles.filter((item) => item.file_type === 'input')); - setOutput(data.jobfiles.filter((item) => item.file_type === 'output')); - } - - setTimeout(() => { - if (data) { - //Break lines for ecl code - const ele = document.getElementById('ecl_render'); - if (ele) { - ele.innerHTML = ele.innerHTML.replace(/;/g, ';
'); - } - } - - if (data && props.assets?.length == 1) { - downloadPdf(data.title, 'pdfContainer'); - props.printingTaskCompleted(); - } - }, 1000); - }, [data]); - - //Remove elements from DOM - const removeElements = (elms) => elms.forEach((el) => el.remove()); - - //Remove all elements except the ones selected - useEffect(() => { - if (props.selectedAssetType !== 'Group') { - let elements = document.querySelector('.pdfContainer'); - let childElements = Array.from(elements.childNodes).map((item) => item.className); - const exportClasses = props.classesToExport; - - childElements = childElements.filter((item) => !exportClasses.includes(item)); - - childElements.map((item) => { - removeElements(document.querySelectorAll(`.${item}`)); - }); - } - }, []); - - //Table Headers - const th = ['Name', 'Description']; - - return ( - -
- Job - {data?.title} - Baic Data -
- Job Type : {data?.jobType} -
-
- Name : {data?.name} -
-
- Title : - {data?.title} -
-
- Git Repo : - {data?.gitRepo} -
-
- Entry BWR : - {data?.entryBWR} -
-
- Contact E-mail : - {data?.contact} -
-
- Author - {data?.author} -
-
- Description : - -
-
-
- ECL - - {data?.ecl} - - - {/* */} -
- -
- Input Files - {input?.length > 0 ? ( - - - - - {th.map((head, index) => ( - - ))} - - - - {input?.map((value, index) => { - return ( - - - - - ); - })} - -
{head}
{value.name}{value.description}
-
- ) : ( -
No input Files
- )} -
-
- Output Files - {output?.length > 0 ? ( - - - - - {th.map((head, index) => ( - - ))} - - - - {output?.map((value, index) => { - return ( - - - - - ); - })} - -
{head}
{value.name}{value.description}
-
- ) : ( -
No output Files
- )} -
-
- ); -} - -export default JobDetailsPdf; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/QueryDetailsPdf.jsx b/Tombolo/client-reactjs/src/components/application/Assets/pdf/QueryDetailsPdf.jsx deleted file mode 100644 index be7070d0..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/QueryDetailsPdf.jsx +++ /dev/null @@ -1,85 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { PdfContainer, Heading, BasicTitle } from './pdfStyledComponents'; -import { authHeader, handleError } from '../../../common/AuthHeader'; -import ReactMarkdown from 'react-markdown'; -import { downloadPdf } from './downloadPdf'; -import { message } from 'antd'; - -function QueryDetailsPdf(props) { - //Local state - const [queryData, setQueryData] = useState(); - - //Load query details when component loads and store in local state - useEffect(() => { - const abortFetch = new AbortController(); - fetch( - '/api/query/query_details?query_id=' + props.selectedAssetId + '&app_id=' + props.applicationId, - { - headers: authHeader(), - }, - { signal: abortFetch } - ) - .then((response) => { - if (response.ok) { - return response.json(); - } - handleError(response); - }) - .then((data) => { - setQueryData(data); - }) - .catch((error) => { - console.log(error); - message.error('Unable to fetch data to create pdf'); - props.printingTaskCompleted(); - }); - - //Clean up - return () => { - abortFetch.abort(); - }; - }, []); - - //Print when fetching and set state is complete - useEffect(() => { - setTimeout(() => { - if (queryData && props.assets?.length == 1) { - downloadPdf(queryData.title, 'pdfContainer'); - props.printingTaskCompleted(); - } - }, 1000); - }, [queryData]); - - return ( - -
- Query - {queryData?.title} - Basic Details - -
- Title : {queryData?.title} -
-
- Name : {queryData?.name} -
- -
- Git Repo :   - {queryData?.gitRepo} -
-
- Description : - -
-
-
- ); -} - -export default QueryDetailsPdf; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/SelectDetailsForPdfDialog.jsx b/Tombolo/client-reactjs/src/components/application/Assets/pdf/SelectDetailsForPdfDialog.jsx deleted file mode 100644 index bcc975cb..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/SelectDetailsForPdfDialog.jsx +++ /dev/null @@ -1,260 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { useSelector } from 'react-redux'; -import { Modal, Button, Checkbox, Collapse, message } from 'antd'; -import _ from 'lodash'; - -import FileDetailsPdf from './FileDetailsPdf'; -import QueryDetailsPdf from './QueryDetailsPdf'; -import IndexDetailsPdf from './IndexDetailsPdf'; -import GroupDetailsPdf from './GroupDetailsPdf'; -import { CollapseWrapper, PanelItems } from './pdfStyledComponents'; -import JobDetailsPdf from './JobDetailsPdf'; -import Text from '../../../common/Text'; - -function SelectDetailsForPdfDialog(props) { - //Local States and variables - const fileOptions = [ - { name: , value: 'filePdf_basic', active: true, checked: true }, - { name: , value: 'filePdf_layout', active: true, checked: false }, - ]; - const indexOptions = [ - { name: , value: 'indexPdf_basic', active: true, checked: true }, - ]; - const queryOptions = [ - { name: , value: 'queryPdf_basic', active: true, checked: true }, - ]; - const jobOptions = [ - { name: , value: 'jobPdf_basic', active: true, checked: true }, - { name: 'ECL', value: 'jobPdf_ecl', active: true, checked: false }, - { name: , value: 'jobPdf_inputFiles', active: true, checked: false }, - { name: , value: 'jobPdf_outputFiles', active: true, checked: false }, - ]; - const [classesToExportAsPdf, setClassesToExport] = useState([]); - const [downloadPdf, setDownloadPdf] = useState(false); - const [filteredAssets, setFilteredAssets] = useState(); - const [assetTypes, setAssetTypes] = useState(); - const { Panel } = Collapse; - - //Getting application id - const applicationId = useSelector((state) => state.applicationReducer.application.applicationId); - - useEffect(() => { - let assets = props.toPrintAssets.filter((item) => item.type !== 'Group'); - setFilteredAssets(assets); - - // removing duplicate file type - const sortedAssetType = [...assets.reduce((map, obj) => map.set(obj.type, obj.type), new Map()).values()]; - setAssetTypes(sortedAssetType); - sortedAssetType.map((item) => { - setClassesToExport((arr) => [...arr, _.lowerCase(item) + 'Pdf_basic']); - }); - }, []); - - //Handle checkbox change - const handleCheckboxChange = ({ target }) => { - const { checked, exporting } = target; - if (checked) { - setClassesToExport([...classesToExportAsPdf, exporting]); - } else { - setClassesToExport(classesToExportAsPdf.filter((item) => item !== exporting)); - } - }; - //Checkboxes - function renderCheckBoxes() { - return ( - - - {assetTypes?.map((asset, index) => { - switch (asset) { - case 'File': - return ( - - {fileOptions.map((option, index) => { - return ( - - - {option.name} - - - ); - })} - - ); - - case 'Query': - return ( - - {queryOptions.map((option, index) => { - return ( - - - {option.name} - - - ); - })} - - ); - - case 'Index': - return ( - - {indexOptions.map((option, index) => { - return ( - - - {option.name} - - - ); - })} - - ); - - case 'Job': - return ( - - {jobOptions.map((option, index) => { - return ( - - - {option.name} - - - ); - })} - - ); - } - })} - - - ); - } - - //What to print based asset selection - const divToPrint = (filteredAssets) => { - if (filteredAssets.length == 1) { - switch (filteredAssets[0].type) { - case 'File': - return ( -
- -
- ); - - case 'Query': - return ( -
- -
- ); - - case 'Index': - return ( -
- -
- ); - - case 'Job': - return ( -
- -
- ); - } - } else if (filteredAssets.length > 1) { - return ( - - ); - } - }; - - //When download PDF button is clicked - const downloadDoc = () => { - if (classesToExportAsPdf.length == 0) { - message.config({ top: 100 }); - message.error('Select one or more options'); - } else { - setDownloadPdf(true); - } - }; - - return ( - } - onOk={downloadDoc} - onCancel={() => props.setVisiblity(false)} - width={650} - footer={[ - , - , - ]}> - {renderCheckBoxes()} -
{downloadPdf ? divToPrint(filteredAssets) : null}
-
- ); -} - -export default SelectDetailsForPdfDialog; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/downloadPdf.js b/Tombolo/client-reactjs/src/components/application/Assets/pdf/downloadPdf.js deleted file mode 100644 index 5a48e097..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/downloadPdf.js +++ /dev/null @@ -1,58 +0,0 @@ -import jsPDF from 'jspdf'; -import { authHeader, handleError } from '../../../common/AuthHeader'; -import { message } from 'antd'; - -// Download pdf file -export function downloadPdf(fileName, targetClass) { - const doc = new jsPDF('p', 'pt', 'a4', true); - - const target = document.getElementsByClassName(targetClass); - - doc.html(target[0], { - margin: [400, 60, 40, 60], - callback: function (doc) { - // let pageCount = doc.internal.getNumberOfPages(); - // doc.deletePage(pageCount); - doc.save(`${fileName}.pdf`); - }, - }); -} - -export const getNestedAssets = ( - applicationId, - setSelectedAsset, - setSelectDetailsforPdfDialogVisibility, - record, - setToPrintAssets -) => { - if (record.type === 'Group') { - let url = `/api/groups/nestedAssets?app_id=${applicationId}&group_id=${record.id}`; - fetch(url, { - headers: authHeader(), - }) - .then((response) => { - if (response.ok) { - return response.json(); - } - handleError(response); - }) - .then((data) => { - let allGroups = data.every((item) => item.type === 'Group'); - if (allGroups || data.length < 1) { - message.error('No assets found to Print in the selected group'); - } else { - setSelectedAsset({ id: record.id, type: 'Group' }); - setToPrintAssets(data); - setSelectDetailsforPdfDialogVisibility(true); - } - }) - .catch((error) => { - console.log(error); - }); - } else { - setSelectedAsset({ id: record.id, type: record.type }); - setToPrintAssets([{ id: record.id, type: record.type }]); - - setSelectDetailsforPdfDialogVisibility(true); - } -}; diff --git a/Tombolo/client-reactjs/src/components/application/Assets/pdf/pdfStyledComponents.js b/Tombolo/client-reactjs/src/components/application/Assets/pdf/pdfStyledComponents.js deleted file mode 100644 index a55b96f3..00000000 --- a/Tombolo/client-reactjs/src/components/application/Assets/pdf/pdfStyledComponents.js +++ /dev/null @@ -1,123 +0,0 @@ -import styled from 'styled-components'; -//Styled components -export const PdfContainer = styled.div` -// min-height: 842px; -width: 595px; -padding: 30px; -display: flex; -flex-direction: column; -align-items: flex-start; -font-size: 11.5px; -position: relative; -margin-right: 50px !important; - - //All Asset Type - > .queryPdf_basic, .filePdf_basic, .indexPdf_basic { - - > .read-only-markdown *{ - text-align: left; - } - > .read-only-markdown { - > h1,h2,h3,h4,h5,h6,h1{ - font-size: 12px; - font-weight: 600; - } - - > .reactMarkdown { - padding-left: 5px; - } - } - } - } - - //File Specific - > .filePdf_layout { - margin-top: -30px; - } - } -`; - -//Basic Title - eg : Basic Details -export const BasicTitle = styled.div` - margin-top: 10px; - font-size: 16px; - font-weight: 700; -`; - -//Page Heading -export const Heading = styled.div` - margin: 0px 0px 0px -10px; - width: 550px !important; - padding: 5px 0px 5px 15px; - font-size: 18px; - background: lightgray; - font-weight: 700; - display: flex; - align-items: center; - margin-bottom: 10px; - > * { - margin-right: 10px; - } -`; - -//Section title.Eg - basic info, layout info etc -export const SectionTitle = styled.div` - font-size: 15px; - font-weight: 700; -`; - -//Table -export const TableContainer = styled.div` - margin-top: 30px; - > h3 { - font-size: 18px; - font-weight: bold; - } -`; - -export const Table = styled.table` - width: 100%; - border-style: solid - border-width: thin; - page-break-inside : auto - th, - td, - tr { - width: 100%; - } - th, - td, - tr { - padding: 5px; - border: 0.5px solid gray; - } - th { - text-align: left; - } - td { - width: 198px; - } -`; - -//Footer -export const Footer = styled.div` - position: absolute; - bottom: 20px; - width: 200px; - margin: 0px 15px 0px -15px; - width: 90%; - font-size: 12px; - border-top: 1px solid lightgray; - text-align: right; - padding: 5px; -`; - -//Styled Components For Pdf Dialog Box -export const CollapseWrapper = styled.div` - > div .ant-collapse-header { - font-weight: bold; - } -`; -export const PanelItems = styled.div` - text-align: left; -`; From e069ebab73978331e7c5949e35b85cde5cba87cd Mon Sep 17 00:00:00 2001 From: yadhap Dahal Date: Thu, 5 Sep 2024 10:36:55 -0400 Subject: [PATCH 2/3] removed jspdf package that was used for printing files from DOM --- Tombolo/client-reactjs/package-lock.json | 164 +---------------------- Tombolo/client-reactjs/package.json | 3 - 2 files changed, 3 insertions(+), 164 deletions(-) diff --git a/Tombolo/client-reactjs/package-lock.json b/Tombolo/client-reactjs/package-lock.json index 1cff9fb4..acfb3fa1 100644 --- a/Tombolo/client-reactjs/package-lock.json +++ b/Tombolo/client-reactjs/package-lock.json @@ -29,7 +29,6 @@ "http-proxy-middleware": "^1.0.6", "i18next": "^21.9.1", "i18next-http-backend": "^1.4.1", - "jspdf": "^2.3.1", "jwt-decode": "^2.2.0", "moment": "^2.30.1", "papaparse": "^5.2.0", @@ -6561,12 +6560,6 @@ "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "dev": true }, - "node_modules/@types/raf": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", - "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==", - "optional": true - }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", @@ -8003,17 +7996,6 @@ "node": ">= 4.0.0" } }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, "node_modules/autoprefixer": { "version": "10.4.19", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", @@ -8446,15 +8428,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", - "optional": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -8646,17 +8619,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/btoa": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", - "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", - "bin": { - "btoa": "bin/btoa.js" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -8781,31 +8743,6 @@ } ] }, - "node_modules/canvg": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.10.tgz", - "integrity": "sha512-qwR2FRNO9NlzTeKIPIKpnTY6fqwuYSequ8Ru8c0YkYU7U0oW+hLUvWadLvAu1Rl72OMNiFhoLu4f8eUjQ7l/+Q==", - "optional": true, - "dependencies": { - "@babel/runtime": "^7.12.5", - "@types/raf": "^3.4.0", - "core-js": "^3.8.3", - "raf": "^3.4.1", - "regenerator-runtime": "^0.13.7", - "rgbcolor": "^1.0.1", - "stackblur-canvas": "^2.0.0", - "svg-pathdata": "^6.0.3" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/canvg/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "optional": true - }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz", @@ -9223,7 +9160,7 @@ "version": "3.37.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.0.tgz", "integrity": "sha512-fu5vHevQ8ZG4og+LXug8ulUtVxjOcEYvifJr7L5Bfq9GOztVqsKd9/59hUk2ZSbCrS3BqUr3EpaYGIYzq7g3Ug==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "funding": { "type": "opencollective", @@ -9380,15 +9317,6 @@ "postcss": "^8.4" } }, - "node_modules/css-line-break": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", - "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", - "optional": true, - "dependencies": { - "utrie": "^1.0.2" - } - }, "node_modules/css-loader": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz", @@ -10483,12 +10411,6 @@ "url": "https://github.com/fb55/domhandler?sponsor=1" } }, - "node_modules/dompurify": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.2.tgz", - "integrity": "sha512-5vSyvxRAb45EoWwAktUT3AYqAwXK4FL7si22Cgj46U6ICsj/YJczCN+Bk7WNABIQmpWRymGfslMhrRUZkQNnqA==", - "optional": true - }, "node_modules/domutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", @@ -11875,11 +11797,6 @@ "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, - "node_modules/fflate": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", - "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" - }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -13028,19 +12945,6 @@ } } }, - "node_modules/html2canvas": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", - "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", - "optional": true, - "dependencies": { - "css-line-break": "^2.1.0", - "text-segmentation": "^1.0.3" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/htmlparser2": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", @@ -17929,23 +17833,6 @@ "node": ">=0.10.0" } }, - "node_modules/jspdf": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.5.1.tgz", - "integrity": "sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA==", - "dependencies": { - "@babel/runtime": "^7.14.0", - "atob": "^2.1.2", - "btoa": "^1.2.1", - "fflate": "^0.4.8" - }, - "optionalDependencies": { - "canvg": "^3.0.6", - "core-js": "^3.6.0", - "dompurify": "^2.2.0", - "html2canvas": "^1.0.0-rc.5" - } - }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -19258,7 +19145,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "devOptional": true + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -21008,7 +20895,7 @@ "version": "3.4.1", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", - "devOptional": true, + "dev": true, "dependencies": { "performance-now": "^2.1.0" } @@ -22671,15 +22558,6 @@ "node": ">=0.10.0" } }, - "node_modules/rgbcolor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", - "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==", - "optional": true, - "engines": { - "node": ">= 0.8.15" - } - }, "node_modules/right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -23442,15 +23320,6 @@ "node": ">=8" } }, - "node_modules/stackblur-canvas": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", - "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==", - "optional": true, - "engines": { - "node": ">=0.1.14" - } - }, "node_modules/stackframe": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", @@ -24018,15 +23887,6 @@ "resolved": "https://registry.npmjs.org/svg-path-parser/-/svg-path-parser-1.1.0.tgz", "integrity": "sha512-jGCUqcQyXpfe38R7RFfhrMyfXcBmpMNJI/B+4CE9/Unkh98UporAc461GTthv+TVDuZXsBx7/WiwJb1Oh4tt4A==" }, - "node_modules/svg-pathdata": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz", - "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==", - "optional": true, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/svgo": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", @@ -24394,15 +24254,6 @@ "node": ">=8" } }, - "node_modules/text-segmentation": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", - "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", - "optional": true, - "dependencies": { - "utrie": "^1.0.2" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -25115,15 +24966,6 @@ "node": ">= 0.4.0" } }, - "node_modules/utrie": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", - "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", - "optional": true, - "dependencies": { - "base64-arraybuffer": "^1.0.2" - } - }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", diff --git a/Tombolo/client-reactjs/package.json b/Tombolo/client-reactjs/package.json index cd1316ed..78fc63af 100644 --- a/Tombolo/client-reactjs/package.json +++ b/Tombolo/client-reactjs/package.json @@ -24,13 +24,10 @@ "http-proxy-middleware": "^1.0.6", "i18next": "^21.9.1", "i18next-http-backend": "^1.4.1", - "jspdf": "^2.3.1", "jwt-decode": "^2.2.0", "moment": "^2.30.1", "papaparse": "^5.2.0", - "postcss": ">=8.4.31", - "re-resizable": "^6.9.1", "react": "^18.2.0", "react-dom": "^18.2.0", From 24925faee030e7ae0127f1abe2cbb7b90ce580f7 Mon Sep 17 00:00:00 2001 From: yadhap Dahal Date: Fri, 6 Sep 2024 09:13:12 -0400 Subject: [PATCH 3/3] Removed print functionality option from asset table --- .../application/Assets/AssetsTable.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js b/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js index 9b692d3d..d74b0854 100644 --- a/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js +++ b/Tombolo/client-reactjs/src/components/application/Assets/AssetsTable.js @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { Table, message, Tooltip, Divider, Space, Typography, Button } from 'antd'; import { useHistory } from 'react-router'; import { useSelector, useDispatch } from 'react-redux'; -import { DeleteOutlined, EditOutlined, FolderOpenOutlined, FilePdfOutlined } from '@ant-design/icons'; +import { DeleteOutlined, EditOutlined, FolderOpenOutlined } from '@ant-design/icons'; import { authHeader, handleError } from '../../common/AuthHeader.js'; import MoveAssetsDialog from './MoveAssetsDialog'; @@ -323,21 +323,6 @@ function AssetsTable({ openGroup, handleEditGroup, refreshGroups }) { onClick={() => openMoveAssetDialog(record.id, record.type, record.name, selectedGroup)} /> - - }> - - getNestedAssets( - applicationId, - setSelectedAsset, - setSelectDetailsforPdfDialogVisibility, - record, - setToPrintAssets - ) - } - /> - ), },