feat: Convert workflow definition entity type to a free-text field and update tenant ID API parameter.
This commit is contained in:
parent
5a0da32699
commit
8b9ac59c3f
@ -99,7 +99,7 @@ const workflowSchema = z
|
||||
name: z.string().min(1, "Name is required"),
|
||||
code: z.string().min(1, "Code is required"),
|
||||
description: z.string().optional(),
|
||||
entity_type: z.enum(["document", "capa", "supplier", "training"]),
|
||||
entity_type: z.string().min(1, "entity_type is required").max(100, "entity_type must be at most 100 characters"),
|
||||
status: z.enum(["draft", "active", "deprecated", "archived"]),
|
||||
source_module: z.array(z.string()).optional(),
|
||||
source_module_id: z
|
||||
@ -235,7 +235,7 @@ export const WorkflowDefinitionModal = ({
|
||||
name: "",
|
||||
code: "",
|
||||
description: "",
|
||||
entity_type: "document",
|
||||
entity_type: "",
|
||||
status: "draft",
|
||||
source_module: [],
|
||||
source_module_id: [],
|
||||
@ -350,7 +350,7 @@ export const WorkflowDefinitionModal = ({
|
||||
name: "",
|
||||
code: "",
|
||||
description: "",
|
||||
entity_type: "document",
|
||||
entity_type: "",
|
||||
status: "draft",
|
||||
source_module: [],
|
||||
source_module_id: [],
|
||||
@ -591,7 +591,14 @@ export const WorkflowDefinitionModal = ({
|
||||
error={errors.description?.message as any}
|
||||
/>
|
||||
</div>
|
||||
<Controller
|
||||
<FormField
|
||||
label="Entity Type"
|
||||
placeholder="e.g. Document, CAPA, Supplier, Training"
|
||||
required
|
||||
{...register("entity_type")}
|
||||
error={errors.entity_type?.message as any}
|
||||
/>
|
||||
{/* <Controller
|
||||
name="entity_type"
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
@ -610,7 +617,7 @@ export const WorkflowDefinitionModal = ({
|
||||
disabled={isEdit}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
<Controller
|
||||
name="status"
|
||||
control={control}
|
||||
|
||||
@ -200,7 +200,7 @@ const WorkflowDefinitionsTable = ({
|
||||
key: "entity_type",
|
||||
label: "Entity Type",
|
||||
render: (wf) => (
|
||||
<span className="text-sm text-[#6b7280] capitalize">
|
||||
<span className="text-sm text-[#6b7280]">
|
||||
{wf.entity_type}
|
||||
</span>
|
||||
),
|
||||
|
||||
@ -30,7 +30,7 @@ class WorkflowService {
|
||||
}
|
||||
|
||||
async getDefinition(id: string, tenantId?: string): Promise<WorkflowDefinitionResponse> {
|
||||
const params = tenantId ? { tenant_id: tenantId } : {};
|
||||
const params = tenantId ? { tenantId: tenantId } : {};
|
||||
const response = await apiClient.get<WorkflowDefinitionResponse>(`${this.baseUrl}/definitions/${id}`, { params });
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user