Skip to content

Commit

Permalink
Fix for Tool Opening.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodkiran committed Feb 7, 2024
1 parent f140397 commit 08c0780
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
22 changes: 4 additions & 18 deletions packages/ui/src/ui-component/table/MarketplaceTable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import PropTypes from 'prop-types'
import { useNavigate } from 'react-router-dom'
import { styled } from '@mui/material/styles'
import Table from '@mui/material/Table'
import TableBody from '@mui/material/TableBody'
Expand Down Expand Up @@ -31,8 +30,7 @@ const StyledTableRow = styled(TableRow)(({ theme }) => ({
}
}))

export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterByType, filterByFramework }) => {
const navigate = useNavigate()
export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterByType, filterByFramework, goToCanvas, goToTool }) => {
const openTemplate = (selectedTemplate) => {
if (selectedTemplate.flowData) {
goToCanvas(selectedTemplate)
Expand All @@ -41,20 +39,6 @@ export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterBy
}
}

const goToTool = (selectedTool) => {
const dialogProp = {
title: selectedTool.templateName,
type: 'TEMPLATE',
data: selectedTool
}
setToolDialogProps(dialogProp)
setShowToolDialog(true)
}

const goToCanvas = (selectedChatflow) => {
navigate(`/marketplace/${selectedChatflow.id}`, { state: selectedChatflow })
}

return (
<>
<TableContainer style={{ marginTop: '30', border: 1 }} component={Paper}>
Expand Down Expand Up @@ -156,5 +140,7 @@ MarketplaceTable.propTypes = {
filterFunction: PropTypes.func,
filterByBadge: PropTypes.func,
filterByType: PropTypes.func,
filterByFramework: PropTypes.func
filterByFramework: PropTypes.func,
goToTool: PropTypes.func,
goToCanvas: PropTypes.func
}
2 changes: 2 additions & 0 deletions packages/ui/src/views/marketplaces/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ const Marketplace = () => {
filterByType={filterByType}
filterByBadge={filterByBadge}
filterByFramework={filterByFramework}
goToTool={goToTool}
goToCanvas={goToCanvas}
/>
)}

Expand Down

0 comments on commit 08c0780

Please sign in to comment.