diff --git a/public/locales/en/common.json b/public/locales/en/common.json index e1a8e73..83cdeb1 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,4 +1,5 @@ { + "ActivityNameTemplate": "Activity Name Template", "SaveChangesToLinkSSOAccount": "Save changes to trigger the process that will link your SSO Account.", "Account": "Account", "Activate": "Activate", diff --git a/src/components/common/Input.tsx b/src/components/common/Input.tsx index 75c0446..5c1441e 100644 --- a/src/components/common/Input.tsx +++ b/src/components/common/Input.tsx @@ -46,7 +46,6 @@ export interface InputProps { hidden?: boolean; autoComplete?: string; onChange?: (e: React.ChangeEvent) => void; - onTextAreaChange?: (e: React.ChangeEvent) => void; maxLength?: number; } @@ -65,7 +64,6 @@ function Input(props: InputProps) { hidden, autoComplete, onChange, - onTextAreaChange, ...rest } = props; @@ -117,7 +115,7 @@ function Input(props: InputProps) { id={name} className={className} name={name} - onChange={onTextAreaChange} + onChange={onChange} disabled={readOnly} value={showValue || defaultValue} autoComplete={autoComplete} diff --git a/src/modules/manager/workflowTemplates/WorkflowTemplateDetails.tsx b/src/modules/manager/workflowTemplates/WorkflowTemplateDetails.tsx index b593618..3afdbc6 100644 --- a/src/modules/manager/workflowTemplates/WorkflowTemplateDetails.tsx +++ b/src/modules/manager/workflowTemplates/WorkflowTemplateDetails.tsx @@ -29,6 +29,9 @@ const WorkflowTemplateDetails: React.FC<{ editMode: boolean }> = ({ loaded: false, data: { name: "", + domainId: {}, + activityNameTemplate: "", + description: "", } as CreateWorkflowTemplateVersion, errors: {}, redirect: "", @@ -43,6 +46,11 @@ const WorkflowTemplateDetails: React.FC<{ editMode: boolean }> = ({ // ----------------------------- form.schema = { name: Joi.string().required().max(450).label(t("WorkflowTemplateName")), + activityNameTemplate: Joi.string() + .required() + .max(450) + .label(t("ActivityNameTemplate")), + description: Joi.string().required().label(t("Description")), }; // ----------------------------- diff --git a/src/modules/manager/workflowTemplates/components/GeneralTab.tsx b/src/modules/manager/workflowTemplates/components/GeneralTab.tsx index 90df9fb..5eba2d7 100644 --- a/src/modules/manager/workflowTemplates/components/GeneralTab.tsx +++ b/src/modules/manager/workflowTemplates/components/GeneralTab.tsx @@ -6,10 +6,10 @@ import { renderInput, renderError, } from "../../../../components/common/formHelpers"; -import { WorkflowTemplateDraft } from "../WorkflowTemplateDetails"; +import { CreateWorkflowTemplateVersion } from "../services/WorkflowTemplateService"; interface GeneralTabProps { - data: WorkflowTemplateDraft; + data: CreateWorkflowTemplateVersion; errors: Record; isEditMode: boolean; onFieldChange: (e: React.ChangeEvent) => void; @@ -22,15 +22,13 @@ const GeneralTab: React.FC = ({ }) => { const { t } = useTranslation(); - const labelName = t("WorkflowTemplateName"); - return (
{renderError("_general", errors)} {renderInput( "name", - labelName, + t("WorkflowTemplateName"), data, errors, InputType.text, @@ -42,6 +40,35 @@ const GeneralTab: React.FC = ({ undefined, onFieldChange, )} + + {renderInput( + "activityNameTemplate", + t("ActivityNameTemplate"), + data, + errors, + InputType.text, + false, + "", + "", + 0, + true, + undefined, + onFieldChange, + )} + {renderInput( + "description", + t("Description"), + data, + errors, + InputType.textarea, + false, + "", + "", + 0, + true, + undefined, + onFieldChange, + )}
); }; diff --git a/src/modules/manager/workflowTemplates/services/WorkflowTemplateService.ts b/src/modules/manager/workflowTemplates/services/WorkflowTemplateService.ts index fbecbce..c897d9f 100644 --- a/src/modules/manager/workflowTemplates/services/WorkflowTemplateService.ts +++ b/src/modules/manager/workflowTemplates/services/WorkflowTemplateService.ts @@ -20,14 +20,21 @@ export type ReadWorkflowTemplate = { export type ReadWorkflowTemplateVersion = { id: bigint; guid?: string; + workflowId: GeneralIdRef; name: string; - address: string; - status: string; + domainId: GeneralIdRef; + activityNameTemplate: string; + description: string; }; -export type CreateWorkflowTemplateVersion = { +export interface CreateWorkflowTemplateVersion extends FormData { name: string; -}; + domainId: GeneralIdRef; + activityNameTemplate: string; + description: string; + + //Tasks //Need to get this working when I do the tasks tab +} export async function getTemplates( page: number,