fix: send instance_id as number; rotate funnel chart x-axis labels

This commit is contained in:
Bhanu Prakash Sai Potteri 2026-05-23 16:16:53 +05:30
parent 179c956926
commit 82934cd191
2 changed files with 17 additions and 4 deletions

View File

@ -319,9 +319,10 @@ export function performActivity(
activityId: string, activityId: string,
data?: Record<string, unknown>, data?: Record<string, unknown>,
): Promise<WorkflowResponse> { ): Promise<WorkflowResponse> {
const numericInstanceId = Number(instanceId);
return request("POST", `/app/${APP_ID}/activity`, { return request("POST", `/app/${APP_ID}/activity`, {
workflow_uuid: workflowUuid, workflow_uuid: workflowUuid,
instance_id: instanceId, instance_id: Number.isNaN(numericInstanceId) ? instanceId : numericInstanceId,
activity_id: activityId, activity_id: activityId,
data, data,
}); });
@ -334,12 +335,15 @@ export function submitForm(
instanceId?: string, instanceId?: string,
deviceType = "desktop", deviceType = "desktop",
): Promise<WorkflowResponse> { ): Promise<WorkflowResponse> {
const numericInstanceId = instanceId ? Number(instanceId) : undefined;
return request("POST", `/app/${APP_ID}/form/submit`, { return request("POST", `/app/${APP_ID}/form/submit`, {
workflow_uuid: workflowUuid, workflow_uuid: workflowUuid,
activity_id: activityId, activity_id: activityId,
device_type: deviceType, device_type: deviceType,
form_data: formData, form_data: formData,
...(instanceId ? { instance_id: instanceId } : {}), ...(numericInstanceId && !Number.isNaN(numericInstanceId)
? { instance_id: numericInstanceId }
: {}),
}); });
} }

View File

@ -385,9 +385,18 @@ function DashboardContent({
<Legend verticalAlign="middle" align="right" layout="vertical" iconType="circle" wrapperStyle={{ fontSize: 12 }} /> <Legend verticalAlign="middle" align="right" layout="vertical" iconType="circle" wrapperStyle={{ fontSize: 12 }} />
</RPieChart> </RPieChart>
) : ( ) : (
<RBarChart data={data} margin={{ top: 5, right: 10, left: -10, bottom: 5 }}> <RBarChart data={data} margin={{ top: 5, right: 10, left: -10, bottom: 50 }}>
<CartesianGrid strokeDasharray="3 3" stroke="#f5f5f4" vertical={false} /> <CartesianGrid strokeDasharray="3 3" stroke="#f5f5f4" vertical={false} />
<XAxis dataKey="name" tick={{ fontSize: 11, fill: "#78716c" }} interval={0} axisLine={false} tickLine={false} /> <XAxis
dataKey="name"
tick={{ fontSize: 11, fill: "#78716c" }}
interval={0}
angle={-25}
textAnchor="end"
height={60}
axisLine={false}
tickLine={false}
/>
<YAxis tick={{ fontSize: 11, fill: "#78716c" }} allowDecimals={false} axisLine={false} tickLine={false} /> <YAxis tick={{ fontSize: 11, fill: "#78716c" }} allowDecimals={false} axisLine={false} tickLine={false} />
<Tooltip cursor={{ fill: ACCENT_SOFT }} contentStyle={{ fontSize: 12, borderRadius: 12, border: "none", boxShadow: "0 4px 12px rgba(0,0,0,0.1)" }} /> <Tooltip cursor={{ fill: ACCENT_SOFT }} contentStyle={{ fontSize: 12, borderRadius: 12, border: "none", boxShadow: "0 4px 12px rgba(0,0,0,0.1)" }} />
<Bar dataKey="value" radius={[8, 8, 0, 0]}> <Bar dataKey="value" radius={[8, 8, 0, 0]}>