feat: google_sheets_name column
This commit is contained in:
@@ -20,6 +20,7 @@ interface RobotAttributes {
|
||||
recording_meta: RobotMeta;
|
||||
recording: RobotWorkflow;
|
||||
google_sheets_email?: string | null;
|
||||
google_sheets_name?: string | null;
|
||||
google_sheet_id?: string | null;
|
||||
google_access_token?: string | null;
|
||||
google_refresh_token?: string | null;
|
||||
@@ -32,6 +33,7 @@ class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements R
|
||||
public recording_meta!: RobotMeta;
|
||||
public recording!: RobotWorkflow;
|
||||
public google_sheets_email!: string | null;
|
||||
public google_sheets_name?: string | null;
|
||||
public google_sheet_id?: string | null;
|
||||
public google_access_token!: string | null;
|
||||
public google_refresh_token!: string | null;
|
||||
@@ -56,6 +58,10 @@ Robot.init(
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
google_sheets_name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
google_sheet_id: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
|
||||
@@ -93,7 +93,7 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I
|
||||
if (!recordingId) return;
|
||||
const recording = await getStoredRecording(recordingId);
|
||||
if (recording) {
|
||||
setGoogleSheetsEmail(recording.google_sheets_email); // Assuming this is how the email is stored
|
||||
setGoogleSheetsEmail(recording.google_sheets_email);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -113,7 +113,6 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I
|
||||
}}>
|
||||
<Typography sx={{ margin: '20px 0px' }}>Google Sheets Integration</Typography>
|
||||
|
||||
{/* If Google Sheets email is empty, show Google OAuth button */}
|
||||
{!googleSheetsEmail ? (
|
||||
<Button
|
||||
variant="contained"
|
||||
@@ -125,7 +124,6 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
{/* Show user info and allow spreadsheet selection once authenticated */}
|
||||
{userInfo && (
|
||||
<>
|
||||
<Typography sx={{ marginBottom: '10px' }}>
|
||||
@@ -160,7 +158,6 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I
|
||||
Fetch Google Spreadsheets
|
||||
</button>
|
||||
|
||||
{/* Display selected spreadsheet name */}
|
||||
{settings.spreadsheetId && (
|
||||
<Typography sx={{ marginBottom: '10px' }}>
|
||||
Selected Spreadsheet ID: {settings.spreadsheetId}
|
||||
|
||||
Reference in New Issue
Block a user