appsmithorg / appsmithorg/appsmith
[Task]: Allow usage of multiple validations for validation property inside property pane config
- Dominant language
- TypeScript
- Stars
- 40.9k
- Forks
- 4.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 45
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### SubTasks
- Allow assigning `validation` property of the property pane config as an array so that multiple validations can be passed. For example,
```JS
validation: [{
type: ValidationTypes.ARRAY,
params: {
unique: ["value"],
default: [],
children: {
type: ValidationTypes.OBJECT,
params: {
required: true,
allowedKeys: [{
name: "label",
type: ValidationTypes.TEXT,
params: {
default: "",
required: true,
},
},
{
name: "value",
type: ValidationTypes.TEXT,
params: {
default: "",
},
},
],
},
},
},
},
{
type: ValidationTypes.FUNCTION,
params: {
fn: minDateValidation,
expected: {
type: "String | number",
example: `apple | 123124`,
autocompleteDataType: AutocompleteDataType.STRING,
},
},
}
],
```
- Also, a new property called `validationOperationType` which will accept two values. First is the `ALL` which tells that All the validation should PASS in the given array of validations. Second is the `ONE` which tells that any of the validation can be true out of the above mentioned validations.
Contributor guide
Assessment
This issue has not been assessed yet.