fix: add run by sdk UI chip

This commit is contained in:
Rohit Rajan
2026-01-04 18:51:15 +05:30
parent 28d20badf9
commit aa3b7672b7
4 changed files with 21 additions and 9 deletions

View File

@@ -548,9 +548,10 @@
}, },
"runs_table": { "runs_table": {
"run_type_chips": { "run_type_chips": {
"manual_run": "Manual Run", "manual_run": "Manual",
"scheduled_run": "Scheduled Run", "scheduled_run": "Scheduled",
"api": "API", "api": "API",
"sdk": "SDK",
"unknown_run_type": "Unknown Run Type" "unknown_run_type": "Unknown Run Type"
}, },
"run_status_chips": { "run_status_chips": {

View File

@@ -339,6 +339,7 @@ function formatRunResponse(run: any) {
runByUserId: run.runByUserId, runByUserId: run.runByUserId,
runByScheduleId: run.runByScheduleId, runByScheduleId: run.runByScheduleId,
runByAPI: run.runByAPI, runByAPI: run.runByAPI,
runBySDK: run.runBySDK,
data: { data: {
textData: {}, textData: {},
listData: {}, listData: {},

View File

@@ -46,6 +46,7 @@ class Run extends Model<RunAttributes, RunCreationAttributes> implements RunAttr
public runByUserId!: string; public runByUserId!: string;
public runByScheduleId!: string; public runByScheduleId!: string;
public runByAPI!: boolean; public runByAPI!: boolean;
public runBySDK!: boolean;
public serializableOutput!: Record<string, any>; public serializableOutput!: Record<string, any>;
public binaryOutput!: Record<string, any>; public binaryOutput!: Record<string, any>;
public retryCount!: number; public retryCount!: number;
@@ -114,6 +115,10 @@ Run.init(
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: true, allowNull: true,
}, },
runBySDK: {
type: DataTypes.BOOLEAN,
allowNull: true,
},
serializableOutput: { serializableOutput: {
type: DataTypes.JSONB, type: DataTypes.JSONB,
allowNull: true, allowNull: true,

View File

@@ -56,12 +56,14 @@ interface RunTypeChipProps {
runByUserId?: string; runByUserId?: string;
runByScheduledId?: string; runByScheduledId?: string;
runByAPI: boolean; runByAPI: boolean;
runBySDK?: boolean;
} }
const RunTypeChip: React.FC<RunTypeChipProps> = ({ runByUserId, runByScheduledId, runByAPI }) => { const RunTypeChip: React.FC<RunTypeChipProps> = ({ runByUserId, runByScheduledId, runByAPI, runBySDK }) => {
const { t } = useTranslation(); const { t } = useTranslation();
if (runByScheduledId) return <Chip label={t('runs_table.run_type_chips.scheduled_run')} color="primary" variant="outlined" />; if (runByScheduledId) return <Chip label={t('runs_table.run_type_chips.scheduled_run')} color="primary" variant="outlined" />;
if (runBySDK) return <Chip label={t('runs_table.run_type_chips.sdk')} color="primary" variant="outlined" />;
if (runByAPI) return <Chip label={t('runs_table.run_type_chips.api')} color="primary" variant="outlined" />; if (runByAPI) return <Chip label={t('runs_table.run_type_chips.api')} color="primary" variant="outlined" />;
if (runByUserId) return <Chip label={t('runs_table.run_type_chips.manual_run')} color="primary" variant="outlined" />; if (runByUserId) return <Chip label={t('runs_table.run_type_chips.manual_run')} color="primary" variant="outlined" />;
return <Chip label={t('runs_table.run_type_chips.unknown_run_type')} color="primary" variant="outlined" />; return <Chip label={t('runs_table.run_type_chips.unknown_run_type')} color="primary" variant="outlined" />;
@@ -84,12 +86,14 @@ export const CollapsibleRow = ({ row, handleDelete, isOpen, onToggleExpanded, cu
const [openSettingsModal, setOpenSettingsModal] = useState(false); const [openSettingsModal, setOpenSettingsModal] = useState(false);
const [userEmail, setUserEmail] = useState<string | null>(null); const [userEmail, setUserEmail] = useState<string | null>(null);
const runByLabel = row.runByScheduleId const runByLabel = row.runByScheduleId
? `${row.runByScheduleId}` ? `${row.runByScheduleId}`
: row.runByUserId : row.runByUserId
? `${userEmail}` ? `${userEmail}`
: row.runByAPI : row.runBySDK
? 'API' ? 'SDK'
: 'Unknown'; : row.runByAPI
? 'API'
: 'Unknown';
const logEndRef = useRef<HTMLDivElement | null>(null); const logEndRef = useRef<HTMLDivElement | null>(null);
@@ -254,6 +258,7 @@ export const CollapsibleRow = ({ row, handleDelete, isOpen, onToggleExpanded, cu
runByUserId={row.runByUserId} runByUserId={row.runByUserId}
runByScheduledId={row.runByScheduleId} runByScheduledId={row.runByScheduleId}
runByAPI={row.runByAPI ?? false} runByAPI={row.runByAPI ?? false}
runBySDK={row.runBySDK}
/> />
</Box> </Box>
</Box> </Box>