Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions server/src/db/config/database.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotenv from 'dotenv';
dotenv.config({ path: './.env' });
// CommonJS format for database.js
require('dotenv').config({ path: './.env' });

// Validate required environment variables
const requiredEnvVars = ['DB_USER', 'DB_PASSWORD', 'DB_NAME', 'DB_HOST', 'DB_PORT'];
Expand All @@ -10,7 +10,6 @@ requiredEnvVars.forEach(envVar => {
}
});


module.exports = {
development: {
username: process.env.DB_USER,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.addColumn('robot', 'description', {
type: Sequelize.TEXT,
allowNull: true
});
},

down: async (queryInterface, Sequelize) => {
await queryInterface.removeColumn('robot', 'description');
}
};
28 changes: 17 additions & 11 deletions server/src/models/Robot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ interface RobotWorkflow {
interface RobotAttributes {
id: string;
userId?: number;
description?: string | null;
recording_meta: RobotMeta;
recording: RobotWorkflow;
google_sheet_email?: string | null;
google_sheet_name?: string | null;
google_sheet_id?: string | null;
google_access_token?: string | null;
google_refresh_token?: string | null;
airtable_base_id?: string | null;
airtable_base_name?: string | null;
airtable_table_name?: string | null;
airtable_access_token?: string | null;
airtable_refresh_token?: string | null;
airtable_base_id?: string | null;
airtable_base_name?: string | null;
airtable_table_name?: string | null;
airtable_access_token?: string | null;
airtable_refresh_token?: string | null;
schedule?: ScheduleConfig | null;
airtable_table_id?: string | null;
}
Expand All @@ -52,19 +53,20 @@ interface RobotCreationAttributes extends Optional<RobotAttributes, 'id'> { }
class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements RobotAttributes {
public id!: string;
public userId!: number;
public description!: string | null;
public recording_meta!: RobotMeta;
public recording!: RobotWorkflow;
public google_sheet_email!: string | null;
public google_sheet_name!: string | null;
public google_sheet_id!: string | null;
public google_access_token!: string | null;
public google_refresh_token!: string | null;
public airtable_base_id!: string | null;
public airtable_base_name!: string | null;
public airtable_table_name!: string | null;
public airtable_access_token!: string | null;
public airtable_refresh_token!: string | null;
public airtable_table_id!: string | null;
public airtable_base_id!: string | null;
public airtable_base_name!: string | null;
public airtable_table_name!: string | null;
public airtable_access_token!: string | null;
public airtable_refresh_token!: string | null;
public airtable_table_id!: string | null;
public schedule!: ScheduleConfig | null;
}

Expand All @@ -79,6 +81,10 @@ Robot.init(
type: DataTypes.INTEGER,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: true,
},
recording_meta: {
type: DataTypes.JSONB,
allowNull: false,
Expand Down
10 changes: 10 additions & 0 deletions src/components/recorder/SaveRecording.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const SaveRecording = ({ fileName }: SaveRecordingProps) => {
const [openModal, setOpenModal] = useState<boolean>(false);
const [needConfirm, setNeedConfirm] = useState<boolean>(false);
const [saveRecordingName, setSaveRecordingName] = useState<string>(fileName);
const [saveRecordingDescription, setSaveRecordingDescription] = useState<string>("");
const [waitingForSave, setWaitingForSave] = useState<boolean>(false);

const { browserId, setBrowserId, notify, recordings, isLogin, recordingName, retrainRobotId } = useGlobalInfoStore();
Expand Down Expand Up @@ -153,6 +154,15 @@ export const SaveRecording = ({ fileName }: SaveRecordingProps) => {
variant="outlined"
value={saveRecordingName}
/>
<TextField
required
sx={{ width: '300px', margin: '15px 0px' }}
onChange={handleChangeOfTitle}
id="title"
label={t('Description (optional)')}
variant="outlined"
value={saveRecordingDescription}
/>
{needConfirm
?
(<React.Fragment>
Expand Down