Fixed problem with the text area not revalidating.
This commit is contained in:
parent
a5bda77fcf
commit
eec4b334d8
@ -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",
|
||||
|
||||
@ -46,7 +46,6 @@ export interface InputProps {
|
||||
hidden?: boolean;
|
||||
autoComplete?: string;
|
||||
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
onTextAreaChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => 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}
|
||||
|
||||
@ -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")),
|
||||
};
|
||||
|
||||
// -----------------------------
|
||||
|
||||
@ -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<string, string>;
|
||||
isEditMode: boolean;
|
||||
onFieldChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
@ -22,15 +22,13 @@ const GeneralTab: React.FC<GeneralTabProps> = ({
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
|
||||
const labelName = t("WorkflowTemplateName");
|
||||
|
||||
return (
|
||||
<div>
|
||||
{renderError("_general", errors)}
|
||||
|
||||
{renderInput(
|
||||
"name",
|
||||
labelName,
|
||||
t("WorkflowTemplateName"),
|
||||
data,
|
||||
errors,
|
||||
InputType.text,
|
||||
@ -42,6 +40,35 @@ const GeneralTab: React.FC<GeneralTabProps> = ({
|
||||
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,
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user