Merge branch 'markdownify' of https://github.com/getmaxun/maxun into markdownify

This commit is contained in:
amhsirak
2025-11-20 19:30:43 +05:30
2 changed files with 50 additions and 31 deletions

View File

@@ -110,10 +110,7 @@ const TableRowMemoized = memo(({ row, columns, handlers }: any) => {
case 'integrate': case 'integrate':
return ( return (
<MemoizedTableCell key={column.id} align={column.align}> <MemoizedTableCell key={column.id} align={column.align}>
<MemoizedIntegrateButton <MemoizedIntegrateButton handleIntegrate={() => handlers.handleIntegrateRecording(row.id, row.name, row.params || [])} />
handleIntegrate={() => handlers.handleIntegrateRecording(row.id, row.name, row.params || [])}
robotType={row.type}
/>
</MemoizedTableCell> </MemoizedTableCell>
); );
case 'options': case 'options':
@@ -713,22 +710,13 @@ const ScheduleButton = ({ handleSchedule }: ScheduleButtonProps) => {
interface IntegrateButtonProps { interface IntegrateButtonProps {
handleIntegrate: () => void; handleIntegrate: () => void;
robotType: string;
} }
const IntegrateButton = ({ handleIntegrate, robotType }: IntegrateButtonProps) => { const IntegrateButton = ({ handleIntegrate }: IntegrateButtonProps) => {
const isDisabled = robotType === 'scrape';
return ( return (
<IconButton <IconButton aria-label="add" size="small" onClick={() => {
aria-label="integrate" handleIntegrate();
size="small" }}
onClick={isDisabled ? undefined : handleIntegrate}
disabled={isDisabled}
sx={{
opacity: isDisabled ? 0.4 : 1,
cursor: isDisabled ? 'not-allowed' : 'pointer',
}}
> >
<Power /> <Power />
</IconButton> </IconButton>

View File

@@ -128,6 +128,8 @@ export const RobotIntegrationPage = ({
"googleSheets" | "airtable" | "webhook" | null "googleSheets" | "airtable" | "webhook" | null
>(integrationType); >(integrationType);
const isScrapeRobot = recording?.recording_meta?.type === "scrape";
const authenticateWithGoogle = () => { const authenticateWithGoogle = () => {
if (!recordingId) { if (!recordingId) {
console.error("Cannot authenticate: recordingId is null"); console.error("Cannot authenticate: recordingId is null");
@@ -729,26 +731,55 @@ export const RobotIntegrationPage = ({
width: "100%", width: "100%",
}} }}
> >
<Button variant="outlined" onClick={() => { <Button
if (!recordingId) return; variant="outlined"
setSelectedIntegrationType("googleSheets"); disabled={isScrapeRobot}
setSettings({ ...settings, integrationType: "googleSheets" }); onClick={() => {
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots"; if (isScrapeRobot) return;
navigate(`${basePath}/${recordingId}/integrate/googleSheets`); if (!recordingId) return;
}} style={{ display: "flex", flexDirection: "column", alignItems: "center", background: 'white', color: '#ff00c3' }}> setSelectedIntegrationType("googleSheets");
setSettings({ ...settings, integrationType: "googleSheets" });
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
navigate(`${basePath}/${recordingId}/integrate/googleSheets`);
}}
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
background: 'white',
color: isScrapeRobot ? "#aaa" : "#ff00c3",
opacity: isScrapeRobot ? 0.5 : 1,
cursor: isScrapeRobot ? "not-allowed" : "pointer",
}}
>
<img src="https://ik.imagekit.io/ys1blv5kv/gsheet.svg" alt="Google Sheets" style={{ margin: "6px" }} /> <img src="https://ik.imagekit.io/ys1blv5kv/gsheet.svg" alt="Google Sheets" style={{ margin: "6px" }} />
Google Sheets Google Sheets
</Button> </Button>
<Button variant="outlined" onClick={() => { <Button
if (!recordingId) return; variant="outlined"
setSelectedIntegrationType("airtable"); disabled={isScrapeRobot}
setSettings({ ...settings, integrationType: "airtable" }); onClick={() => {
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots"; if (isScrapeRobot) return;
navigate(`${basePath}/${recordingId}/integrate/airtable`); if (!recordingId) return;
}} style={{ display: "flex", flexDirection: "column", alignItems: "center", background: 'white', color: '#ff00c3' }}> setSelectedIntegrationType("airtable");
setSettings({ ...settings, integrationType: "airtable" });
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
navigate(`${basePath}/${recordingId}/integrate/airtable`);
}}
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
background: 'white',
color: isScrapeRobot ? "#aaa" : "#ff00c3",
opacity: isScrapeRobot ? 0.5 : 1,
cursor: isScrapeRobot ? "not-allowed" : "pointer",
}}
>
<img src="https://ik.imagekit.io/ys1blv5kv/airtable.svg" alt="Airtable" style={{ margin: "6px" }} /> <img src="https://ik.imagekit.io/ys1blv5kv/airtable.svg" alt="Airtable" style={{ margin: "6px" }} />
Airtable Airtable
</Button> </Button>
<Button variant="outlined" onClick={() => { <Button variant="outlined" onClick={() => {
if (!recordingId) return; if (!recordingId) return;
setSelectedIntegrationType("webhook"); setSelectedIntegrationType("webhook");