appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.78k stars 3.63k forks source link

[Task]: Allow usage of multiple validations for validation property inside property pane config #10273

Open keyurparalkar opened 2 years ago

keyurparalkar commented 2 years ago

Is there an existing issue for this?

SubTasks

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,
            },
        },
    }
],
keyurparalkar commented 2 years ago

cc: @riodeuno @somangshu @sbalaji1192