description not as required input
parent
b6fc2a87f5
commit
c958e0cb2f
|
@ -220,18 +220,21 @@ export function MyFormInput({
|
||||||
ruleMessageValueMinLengthRequired,
|
ruleMessageValueMinLengthRequired,
|
||||||
inputPlaceholder,
|
inputPlaceholder,
|
||||||
inputType,
|
inputType,
|
||||||
|
inputNotRequired,
|
||||||
}) {
|
}) {
|
||||||
const commonProps = {
|
const commonProps = {
|
||||||
...propsInput,
|
...propsInput,
|
||||||
placeholder: inputPlaceholder,
|
placeholder: inputPlaceholder,
|
||||||
};
|
};
|
||||||
|
|
||||||
const myFormItemRules = [
|
const myFormItemRules = [];
|
||||||
{
|
|
||||||
|
if (!inputNotRequired) {
|
||||||
|
myFormItemRules.push({
|
||||||
required: true,
|
required: true,
|
||||||
message: ruleMessageValueRequired,
|
message: ruleMessageValueRequired,
|
||||||
},
|
});
|
||||||
];
|
}
|
||||||
|
|
||||||
if (formItemRules) {
|
if (formItemRules) {
|
||||||
myFormItemRules.push(...formItemRules);
|
myFormItemRules.push(...formItemRules);
|
||||||
|
|
|
@ -811,13 +811,8 @@ function ModalAddEditServiceActivity({
|
||||||
body.name = formServiceActivityName;
|
body.name = formServiceActivityName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
// description is not required
|
||||||
formServiceActivityDescription !==
|
body.description = formServiceActivityDescription;
|
||||||
addEditServiceActivityModalOptions.activity.description
|
|
||||||
) {
|
|
||||||
validateFields.push("serviceActivityDescription");
|
|
||||||
body.description = formServiceActivityDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
formServiceActivityPrice !==
|
formServiceActivityPrice !==
|
||||||
|
@ -980,11 +975,9 @@ function ServiceActivityDescriptionFormInput({
|
||||||
showCount: true,
|
showCount: true,
|
||||||
}}
|
}}
|
||||||
inputType="textarea"
|
inputType="textarea"
|
||||||
|
inputNotRequired
|
||||||
formItemName={formItemName}
|
formItemName={formItemName}
|
||||||
setIsInputValid={setIsInputValid}
|
setIsInputValid={setIsInputValid}
|
||||||
minLength={
|
|
||||||
Constants.GLOBALS.MIN_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH
|
|
||||||
}
|
|
||||||
maxLength={
|
maxLength={
|
||||||
Constants.GLOBALS.MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH
|
Constants.GLOBALS.MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,6 @@ export const Constants = {
|
||||||
MAX_STORE_SERVICE_NAME_LENGTH: 64,
|
MAX_STORE_SERVICE_NAME_LENGTH: 64,
|
||||||
MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 3,
|
MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 3,
|
||||||
MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 64,
|
MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 64,
|
||||||
MIN_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 3,
|
|
||||||
MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 1024,
|
MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 1024,
|
||||||
MIN_STORE_SERVICE_ACTIVITY_PRICE: 0,
|
MIN_STORE_SERVICE_ACTIVITY_PRICE: 0,
|
||||||
MAX_STORE_SERVICE_ACTIVITY_PRICE: 10000000,
|
MAX_STORE_SERVICE_ACTIVITY_PRICE: 10000000,
|
||||||
|
|
Loading…
Reference in New Issue