Skip to content

Commit

Permalink
fix(ui+engine): Rename Case.title to case_title (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
daryllimyt committed Apr 23, 2024
1 parent 785c459 commit e8599ac
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/cases/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ export const columns: ColumnDef<Case>[] = [
},
},
{
accessorKey: "title",
accessorKey: "case_title",
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Case Title" />
),
cell: ({ row }) => {
return (
<div className="flex space-x-2">
<span className="max-w-[300px] truncate text-xs">
{row.getValue<Case["title"]>("title")}
{row.getValue<Case["case_title"]>("case_title")}
</span>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/cases/panel-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function CasePanelContent({ caseId }: CasePanelContentProps) {
}
const {
id,
title,
case_title,
status: caseStatus,
priority,
malice,
Expand Down Expand Up @@ -118,7 +118,7 @@ export function CasePanelContent({ caseId }: CasePanelContentProps) {
<SheetHeader>
<small className="text-xs text-muted-foreground">Case #{id}</small>
<div className="flex items-center justify-between">
<SheetTitle className="text-lg">{title}</SheetTitle>
<SheetTitle className="text-lg">{case_title}</SheetTitle>
<div className="flex items-center gap-2">
<PrioritySelect
priority={currentPriority}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/cases/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function CaseTable() {
const defaultToolbarProps: DataTableToolbarProps = {
filterProps: {
placeholder: "Filter cases...",
column: "title",
column: "case_title",
},
fields: [
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/workspace/panel/action/schemas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const LLMSummarizeTaskActionSchema = z.object({
})

const OpenCaseActionSchema = z.object({
title: z.string().min(1, { message: "Strings cannot be empty" }),
case_title: z.string().min(1, { message: "Strings cannot be empty" }),
payload: stringToJSONSchema,
malice: z.enum(["malicious", "benign"]),
status: z.enum(["open", "closed", "in_progress", "reported", "escalated"]),
Expand Down Expand Up @@ -288,7 +288,7 @@ const actionFieldSchemas: Partial<AllActionFieldSchemas> = {
},
},
open_case: {
title: { type: "input" },
case_title: { type: "input" },
payload: {
type: "json",
placeholder:
Expand Down
2 changes: 1 addition & 1 deletion tracecat/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def create_vdb_conn() -> lancedb.DBConnection:
pa.field("id", pa.string(), nullable=False),
pa.field("owner_id", pa.string(), nullable=False),
pa.field("workflow_id", pa.string(), nullable=False),
pa.field("title", pa.string(), nullable=False),
pa.field("case_title", pa.string(), nullable=False),
pa.field("payload", pa.string(), nullable=False), # JSON-serialized
pa.field("context", pa.string(), nullable=True), # JSON-serialized
pa.field("malice", pa.string(), nullable=False),
Expand Down
4 changes: 2 additions & 2 deletions tracecat/runner/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ async def run_open_case_action(
action_run_id: str,
workflow_id: str,
# Action Inputs
title: str,
case_title: str,
payload: dict[str, Any],
malice: Literal["malicious", "benign"],
status: Literal["open", "closed", "in_progress", "reported", "escalated"],
Expand All @@ -813,7 +813,7 @@ async def run_open_case_action(
id=action_run_id,
owner_id=role.user_id,
workflow_id=workflow_id,
title=title,
case_title=case_title,
payload=payload,
malice=malice,
status=status,
Expand Down
2 changes: 1 addition & 1 deletion tracecat/types/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class CaseParams(BaseModel):
updated_at: str # ISO 8601
# Case related fields
workflow_id: str
title: str
case_title: str
payload: dict[str, Any]
malice: Literal["malicious", "benign"]
status: Literal["open", "closed", "in_progress", "reported", "escalated"]
Expand Down
2 changes: 1 addition & 1 deletion tracecat/types/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Case(BaseModel):
id: str = Field(default_factory=lambda: uuid4().hex) # Action run id
owner_id: str # NOTE: Ideally this would inherit form db.Resource
workflow_id: str
title: str
case_title: str
payload: dict[str, Any]
malice: Literal["malicious", "benign"]
status: Literal["open", "closed", "in_progress", "reported", "escalated"]
Expand Down

0 comments on commit e8599ac

Please sign in to comment.