Fixed problem with the text area not revalidating.

This commit is contained in:
Colin Dawson 2026-02-10 22:52:40 +00:00
parent a5bda77fcf
commit eec4b334d8
5 changed files with 53 additions and 12 deletions

View File

@ -1,4 +1,5 @@
{ {
"ActivityNameTemplate": "Activity Name Template",
"SaveChangesToLinkSSOAccount": "Save changes to trigger the process that will link your SSO Account.", "SaveChangesToLinkSSOAccount": "Save changes to trigger the process that will link your SSO Account.",
"Account": "Account", "Account": "Account",
"Activate": "Activate", "Activate": "Activate",

View File

@ -46,7 +46,6 @@ export interface InputProps {
hidden?: boolean; hidden?: boolean;
autoComplete?: string; autoComplete?: string;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void; onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
onTextAreaChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
maxLength?: number; maxLength?: number;
} }
@ -65,7 +64,6 @@ function Input(props: InputProps) {
hidden, hidden,
autoComplete, autoComplete,
onChange, onChange,
onTextAreaChange,
...rest ...rest
} = props; } = props;
@ -117,7 +115,7 @@ function Input(props: InputProps) {
id={name} id={name}
className={className} className={className}
name={name} name={name}
onChange={onTextAreaChange} onChange={onChange}
disabled={readOnly} disabled={readOnly}
value={showValue || defaultValue} value={showValue || defaultValue}
autoComplete={autoComplete} autoComplete={autoComplete}

View File

@ -29,6 +29,9 @@ const WorkflowTemplateDetails: React.FC<{ editMode: boolean }> = ({
loaded: false, loaded: false,
data: { data: {
name: "", name: "",
domainId: {},
activityNameTemplate: "",
description: "",
} as CreateWorkflowTemplateVersion, } as CreateWorkflowTemplateVersion,
errors: {}, errors: {},
redirect: "", redirect: "",
@ -43,6 +46,11 @@ const WorkflowTemplateDetails: React.FC<{ editMode: boolean }> = ({
// ----------------------------- // -----------------------------
form.schema = { form.schema = {
name: Joi.string().required().max(450).label(t("WorkflowTemplateName")), 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")),
}; };
// ----------------------------- // -----------------------------

View File

@ -6,10 +6,10 @@ import {
renderInput, renderInput,
renderError, renderError,
} from "../../../../components/common/formHelpers"; } from "../../../../components/common/formHelpers";
import { WorkflowTemplateDraft } from "../WorkflowTemplateDetails"; import { CreateWorkflowTemplateVersion } from "../services/WorkflowTemplateService";
interface GeneralTabProps { interface GeneralTabProps {
data: WorkflowTemplateDraft; data: CreateWorkflowTemplateVersion;
errors: Record<string, string>; errors: Record<string, string>;
isEditMode: boolean; isEditMode: boolean;
onFieldChange: (e: React.ChangeEvent<HTMLInputElement>) => void; onFieldChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
@ -22,15 +22,13 @@ const GeneralTab: React.FC<GeneralTabProps> = ({
}) => { }) => {
const { t } = useTranslation<typeof Namespaces.Common>(); const { t } = useTranslation<typeof Namespaces.Common>();
const labelName = t("WorkflowTemplateName");
return ( return (
<div> <div>
{renderError("_general", errors)} {renderError("_general", errors)}
{renderInput( {renderInput(
"name", "name",
labelName, t("WorkflowTemplateName"),
data, data,
errors, errors,
InputType.text, InputType.text,
@ -42,6 +40,35 @@ const GeneralTab: React.FC<GeneralTabProps> = ({
undefined, undefined,
onFieldChange, 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,
)}
</div> </div>
); );
}; };

View File

@ -20,14 +20,21 @@ export type ReadWorkflowTemplate = {
export type ReadWorkflowTemplateVersion = { export type ReadWorkflowTemplateVersion = {
id: bigint; id: bigint;
guid?: string; guid?: string;
workflowId: GeneralIdRef;
name: string; name: string;
address: string; domainId: GeneralIdRef;
status: string; activityNameTemplate: string;
description: string;
}; };
export type CreateWorkflowTemplateVersion = { export interface CreateWorkflowTemplateVersion extends FormData {
name: string; name: string;
}; domainId: GeneralIdRef;
activityNameTemplate: string;
description: string;
//Tasks //Need to get this working when I do the tasks tab
}
export async function getTemplates( export async function getTemplates(
page: number, page: number,