Skip to content

Commit 7f22a77

Browse files
committed
Merge branch 'markdownify' of https://github.com/getmaxun/maxun into markdownify
2 parents 565c858 + ac0c70e commit 7f22a77

File tree

2 files changed

+50
-31
lines changed

2 files changed

+50
-31
lines changed

src/components/robot/RecordingsTable.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ const TableRowMemoized = memo(({ row, columns, handlers }: any) => {
110110
case 'integrate':
111111
return (
112112
<MemoizedTableCell key={column.id} align={column.align}>
113-
<MemoizedIntegrateButton
114-
handleIntegrate={() => handlers.handleIntegrateRecording(row.id, row.name, row.params || [])}
115-
robotType={row.type}
116-
/>
113+
<MemoizedIntegrateButton handleIntegrate={() => handlers.handleIntegrateRecording(row.id, row.name, row.params || [])} />
117114
</MemoizedTableCell>
118115
);
119116
case 'options':
@@ -713,22 +710,13 @@ const ScheduleButton = ({ handleSchedule }: ScheduleButtonProps) => {
713710

714711
interface IntegrateButtonProps {
715712
handleIntegrate: () => void;
716-
robotType: string;
717713
}
718714

719-
const IntegrateButton = ({ handleIntegrate, robotType }: IntegrateButtonProps) => {
720-
const isDisabled = robotType === 'scrape';
721-
715+
const IntegrateButton = ({ handleIntegrate }: IntegrateButtonProps) => {
722716
return (
723-
<IconButton
724-
aria-label="integrate"
725-
size="small"
726-
onClick={isDisabled ? undefined : handleIntegrate}
727-
disabled={isDisabled}
728-
sx={{
729-
opacity: isDisabled ? 0.4 : 1,
730-
cursor: isDisabled ? 'not-allowed' : 'pointer',
731-
}}
717+
<IconButton aria-label="add" size="small" onClick={() => {
718+
handleIntegrate();
719+
}}
732720
>
733721
<Power />
734722
</IconButton>

src/components/robot/pages/RobotIntegrationPage.tsx

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export const RobotIntegrationPage = ({
128128
"googleSheets" | "airtable" | "webhook" | null
129129
>(integrationType);
130130

131+
const isScrapeRobot = recording?.recording_meta?.type === "scrape";
132+
131133
const authenticateWithGoogle = () => {
132134
if (!recordingId) {
133135
console.error("Cannot authenticate: recordingId is null");
@@ -729,26 +731,55 @@ export const RobotIntegrationPage = ({
729731
width: "100%",
730732
}}
731733
>
732-
<Button variant="outlined" onClick={() => {
733-
if (!recordingId) return;
734-
setSelectedIntegrationType("googleSheets");
735-
setSettings({ ...settings, integrationType: "googleSheets" });
736-
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
737-
navigate(`${basePath}/${recordingId}/integrate/googleSheets`);
738-
}} style={{ display: "flex", flexDirection: "column", alignItems: "center", background: 'white', color: '#ff00c3' }}>
734+
<Button
735+
variant="outlined"
736+
disabled={isScrapeRobot}
737+
onClick={() => {
738+
if (isScrapeRobot) return;
739+
if (!recordingId) return;
740+
setSelectedIntegrationType("googleSheets");
741+
setSettings({ ...settings, integrationType: "googleSheets" });
742+
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
743+
navigate(`${basePath}/${recordingId}/integrate/googleSheets`);
744+
}}
745+
style={{
746+
display: "flex",
747+
flexDirection: "column",
748+
alignItems: "center",
749+
background: 'white',
750+
color: isScrapeRobot ? "#aaa" : "#ff00c3",
751+
opacity: isScrapeRobot ? 0.5 : 1,
752+
cursor: isScrapeRobot ? "not-allowed" : "pointer",
753+
}}
754+
>
739755
<img src="https://ik.imagekit.io/ys1blv5kv/gsheet.svg" alt="Google Sheets" style={{ margin: "6px" }} />
740756
Google Sheets
741757
</Button>
742-
<Button variant="outlined" onClick={() => {
743-
if (!recordingId) return;
744-
setSelectedIntegrationType("airtable");
745-
setSettings({ ...settings, integrationType: "airtable" });
746-
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
747-
navigate(`${basePath}/${recordingId}/integrate/airtable`);
748-
}} style={{ display: "flex", flexDirection: "column", alignItems: "center", background: 'white', color: '#ff00c3' }}>
758+
<Button
759+
variant="outlined"
760+
disabled={isScrapeRobot}
761+
onClick={() => {
762+
if (isScrapeRobot) return;
763+
if (!recordingId) return;
764+
setSelectedIntegrationType("airtable");
765+
setSettings({ ...settings, integrationType: "airtable" });
766+
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
767+
navigate(`${basePath}/${recordingId}/integrate/airtable`);
768+
}}
769+
style={{
770+
display: "flex",
771+
flexDirection: "column",
772+
alignItems: "center",
773+
background: 'white',
774+
color: isScrapeRobot ? "#aaa" : "#ff00c3",
775+
opacity: isScrapeRobot ? 0.5 : 1,
776+
cursor: isScrapeRobot ? "not-allowed" : "pointer",
777+
}}
778+
>
749779
<img src="https://ik.imagekit.io/ys1blv5kv/airtable.svg" alt="Airtable" style={{ margin: "6px" }} />
750780
Airtable
751781
</Button>
782+
752783
<Button variant="outlined" onClick={() => {
753784
if (!recordingId) return;
754785
setSelectedIntegrationType("webhook");

0 commit comments

Comments
 (0)