appsmithorg / appsmithorg/appsmith

[Task]: [Development improvement] Cannot assign multiple values to the autocompleteDataType

Open
#10,548 0 comments 0 reactions 0 assignees View on GitHub
Autocomplete Needs Triaging Task
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

### Current Behavior

Currently we cannot assign multiple autocomplete values to `autocompleteDataType`. This property is present under `Property Validation Configuration -> expected`. Due to this we cannot provide auto complete suggestions for scenario were the expected type has two data types.

For example:

```JS
validation: {
type: ValidationTypes.FUNCTION,
params: {
fn: defaultOptionValidation,
expected: {
type: `string | number`,
example: `abc | {{1}}`,
autocompleteDataType: AutocompleteDataType.STRING,
},
},
},
```
Please find below loom video for reference:

[![LOOM DEMO](http://cdn.loom.com/sessions/thumbnails/08ccae622d4d4676a736d45b7a4d13bc-00001.gif)](https://www.loom.com/share/08ccae622d4d4676a736d45b7a4d13bc)

### Steps To Reproduce

Current behaviour example:
```JS
validation: {
type: ValidationTypes.FUNCTION,
params: {
fn: defaultSelectedValuesValidation,
expected: {
type: "String or Array",
example: `apple | ["apple", "orange"]`,
autocompleteDataType: AutocompleteDataType.STRING,
},
},
},
```

expected behaviour example:
```JS
validation: {
type: ValidationTypes.FUNCTION,
params: {
fn: defaultSelectedValuesValidation,
expected: {
type: "String or Number",
example: `apple | 123`,
autocompleteDataType: [AutocompleteDataType.STRING, AutocompleteDataType.NUMBER],
},
},
},
```

### Environment

Production

### Version

Cloud

Contributor guide

Open the contributing guide

Research direction

Search the codebase for `autocompleteDataType`, `AutocompleteDataType`, and the Property Validation Configuration `expected` handling. Reproduce the examples with string/number and string/array combinations, then verify that autocomplete suggestions support multiple declared data types and add or update the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.