chore: lint
This commit is contained in:
@@ -74,12 +74,12 @@ export const IntegrationSettingsModal = ({
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
recordingId,
|
recordingId,
|
||||||
notify,
|
notify,
|
||||||
setRerenderRobots
|
setRerenderRobots
|
||||||
} = useGlobalInfoStore();
|
} = useGlobalInfoStore();
|
||||||
|
|
||||||
const [recording, setRecording] = useState<any>(null);
|
const [recording, setRecording] = useState<any>(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ export const IntegrationSettingsModal = ({
|
|||||||
// Handle Airtable base selection
|
// Handle Airtable base selection
|
||||||
const handleAirtableBaseSelect = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleAirtableBaseSelect = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const selectedBase = airtableBases.find((base) => base.id === e.target.value);
|
const selectedBase = airtableBases.find((base) => base.id === e.target.value);
|
||||||
|
|
||||||
if (selectedBase) {
|
if (selectedBase) {
|
||||||
setSettings((prevSettings) => ({
|
setSettings((prevSettings) => ({
|
||||||
...prevSettings,
|
...prevSettings,
|
||||||
@@ -184,7 +184,7 @@ export const IntegrationSettingsModal = ({
|
|||||||
setSettings((prevSettings) => ({
|
setSettings((prevSettings) => ({
|
||||||
...prevSettings,
|
...prevSettings,
|
||||||
airtableTableId: e.target.value,
|
airtableTableId: e.target.value,
|
||||||
airtableTableName: selectedTable?.name||"",
|
airtableTableName: selectedTable?.name || "",
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -209,10 +209,10 @@ export const IntegrationSettingsModal = ({
|
|||||||
},
|
},
|
||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Refresh recording data immediately
|
// Refresh recording data immediately
|
||||||
await refreshRecordingData();
|
await refreshRecordingData();
|
||||||
|
|
||||||
notify("success", t("integration_settings.google.notifications.sheet_selected"));
|
notify("success", t("integration_settings.google.notifications.sheet_selected"));
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -239,9 +239,9 @@ export const IntegrationSettingsModal = ({
|
|||||||
},
|
},
|
||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
await refreshRecordingData();
|
await refreshRecordingData();
|
||||||
|
|
||||||
notify("success", t("integration_settings.airtable.notifications.base_selected"));
|
notify("success", t("integration_settings.airtable.notifications.base_selected"));
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -262,14 +262,14 @@ export const IntegrationSettingsModal = ({
|
|||||||
{ robotId: recordingId },
|
{ robotId: recordingId },
|
||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Clear UI state
|
// Clear UI state
|
||||||
setSpreadsheets([]);
|
setSpreadsheets([]);
|
||||||
setSettings({ ...settings, spreadsheetId: "", spreadsheetName: "" });
|
setSettings({ ...settings, spreadsheetId: "", spreadsheetName: "" });
|
||||||
|
|
||||||
// Refresh recording data
|
// Refresh recording data
|
||||||
await refreshRecordingData();
|
await refreshRecordingData();
|
||||||
|
|
||||||
notify("success", t("integration_settings.google.notifications.integration_removed"));
|
notify("success", t("integration_settings.google.notifications.integration_removed"));
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -290,13 +290,13 @@ export const IntegrationSettingsModal = ({
|
|||||||
{ robotId: recordingId },
|
{ robotId: recordingId },
|
||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
setAirtableBases([]);
|
setAirtableBases([]);
|
||||||
setAirtableTables([]);
|
setAirtableTables([]);
|
||||||
setSettings({ ...settings, airtableBaseId: "", airtableBaseName: "", airtableTableName:"", airtableTableId: "" });
|
setSettings({ ...settings, airtableBaseId: "", airtableBaseName: "", airtableTableName: "", airtableTableId: "" });
|
||||||
|
|
||||||
await refreshRecordingData();
|
await refreshRecordingData();
|
||||||
|
|
||||||
notify("success", t("integration_settings.airtable.notifications.integration_removed"));
|
notify("success", t("integration_settings.airtable.notifications.integration_removed"));
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -322,13 +322,13 @@ export const IntegrationSettingsModal = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchRecordingInfo = async () => {
|
const fetchRecordingInfo = async () => {
|
||||||
if (!recordingId) return;
|
if (!recordingId) return;
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
const recording = await getStoredRecording(recordingId);
|
const recording = await getStoredRecording(recordingId);
|
||||||
if (recording) {
|
if (recording) {
|
||||||
setRecording(recording);
|
setRecording(recording);
|
||||||
|
|
||||||
if (preSelectedIntegrationType) {
|
if (preSelectedIntegrationType) {
|
||||||
setSettings(prev => ({ ...prev, integrationType: preSelectedIntegrationType }));
|
setSettings(prev => ({ ...prev, integrationType: preSelectedIntegrationType }));
|
||||||
}
|
}
|
||||||
@@ -345,10 +345,10 @@ export const IntegrationSettingsModal = ({
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchRecordingInfo();
|
fetchRecordingInfo();
|
||||||
}, [recordingId, preSelectedIntegrationType]);
|
}, [recordingId, preSelectedIntegrationType]);
|
||||||
|
|
||||||
@@ -378,11 +378,11 @@ export const IntegrationSettingsModal = ({
|
|||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
modalStyle={modalStyle}
|
modalStyle={modalStyle}
|
||||||
>
|
>
|
||||||
<div style={{
|
<div style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
padding: "20px"
|
padding: "20px"
|
||||||
}}>
|
}}>
|
||||||
<div style={{ display: "flex", gap: "20px" }}>
|
<div style={{ display: "flex", gap: "20px" }}>
|
||||||
<Button
|
<Button
|
||||||
@@ -413,7 +413,7 @@ export const IntegrationSettingsModal = ({
|
|||||||
</GenericModal>
|
</GenericModal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GenericModal isOpen={isOpen} onClose={handleClose} modalStyle={modalStyle}>
|
<GenericModal isOpen={isOpen} onClose={handleClose} modalStyle={modalStyle}>
|
||||||
<div style={{
|
<div style={{
|
||||||
@@ -562,7 +562,7 @@ export const IntegrationSettingsModal = ({
|
|||||||
<p>{t("integration_settings.airtable.descriptions.sync_info")}</p>
|
<p>{t("integration_settings.airtable.descriptions.sync_info")}</p>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={authenticateWithAirtable}
|
onClick={authenticateWithAirtable}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
>
|
>
|
||||||
@@ -581,7 +581,7 @@ export const IntegrationSettingsModal = ({
|
|||||||
) : airtableBases.length === 0 ? (
|
) : airtableBases.length === 0 ? (
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={fetchAirtableBases}
|
onClick={fetchAirtableBases}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
>
|
>
|
||||||
@@ -621,7 +621,7 @@ export const IntegrationSettingsModal = ({
|
|||||||
</TextField>
|
</TextField>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={updateAirtableBase}
|
onClick={updateAirtableBase}
|
||||||
style={{ marginTop: "10px" }}
|
style={{ marginTop: "10px" }}
|
||||||
disabled={!settings.airtableBaseId || loading}
|
disabled={!settings.airtableBaseId || loading}
|
||||||
|
|||||||
Reference in New Issue
Block a user