Refactor cases pane's component and UI
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Image, Button, Tooltip, Card, CardBody } from "@nextui-org/react";
|
||||
import { AttachmentType } from "./caseTypes";
|
||||
import { AttachmentType } from "../../../../../../../types/case";
|
||||
import { Trash, ArrowDownToLine } from "lucide-react";
|
||||
|
||||
type Props = {
|
||||
@@ -13,9 +13,9 @@ import {
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Save, Plus, ArrowLeft, ArrowUpFromLine } from "lucide-react";
|
||||
import { priorities, testTypes, templates } from "@/config/selection";
|
||||
import CaseStepsEditor from "./case-steps-editor";
|
||||
import CaseAttachmentsEditor from "./case-attachments-editor";
|
||||
import { CaseType, AttachmentType } from "./caseTypes";
|
||||
import CaseStepsEditor from "./CaseStepsEditor";
|
||||
import CaseAttachmentsEditor from "./CaseAttachmentsEditor";
|
||||
import { CaseType, AttachmentType } from "@/types/case";
|
||||
import {
|
||||
fetchCase,
|
||||
fetchCreateStep,
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Textarea, Button, Tooltip } from "@nextui-org/react";
|
||||
import { StepType } from "./caseTypes";
|
||||
import { StepType } from "../../../../../../../types/case";
|
||||
import { Plus, Trash } from "lucide-react";
|
||||
|
||||
type Props = {
|
||||
@@ -1,50 +0,0 @@
|
||||
type CaseType = {
|
||||
id: number;
|
||||
title: string;
|
||||
state: number;
|
||||
priority: number;
|
||||
type: number;
|
||||
automationStatus: number;
|
||||
description: string;
|
||||
template: number;
|
||||
preConditions: string;
|
||||
expectedResults: string;
|
||||
folderId: number;
|
||||
Steps: StepType[];
|
||||
Attachments: AttachmentType[];
|
||||
};
|
||||
|
||||
type CaseStepType = {
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
CaseId: number;
|
||||
StepId: number;
|
||||
};
|
||||
|
||||
type StepType = {
|
||||
id: number;
|
||||
step: string;
|
||||
result: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
caseSteps: CaseStepType;
|
||||
};
|
||||
|
||||
type CaseAttachmentType = {
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
CaseId: number;
|
||||
AttachmentId: number;
|
||||
};
|
||||
|
||||
type AttachmentType = {
|
||||
id: number;
|
||||
title: string;
|
||||
detail: string;
|
||||
path: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
caseAttachments: CaseAttachmentType;
|
||||
};
|
||||
|
||||
export { CaseType, StepType, AttachmentType };
|
||||
@@ -1,4 +1,4 @@
|
||||
import CaseEditor from "./case-editor";
|
||||
import CaseEditor from "./CaseEditor";
|
||||
|
||||
export default function Page({
|
||||
params,
|
||||
|
||||
Reference in New Issue
Block a user