Resolve "Define dropdown values from an existing store"
requested to merge 2489-define-dropdown-values-from-an-existing-store into 2517-improve-dropdow-element-to-allow-to-change-the-display
What is in this MR
The dropdown element values are manual for now but we want to be able to link these values to an existing dropdown values from a field of a table.
- Add properties:
- One to select the type of options: manual options, Options from a data source field, formulas options
- formula_value: formula field
- formula_name: formula field
- selected_option_source: formula
New data providerDataSourceSelectOptionsDataProviderType
-> that looks the defined data sources and use the related service to get the existing options. This data provider returns the array of select options for each field of the data source that have options- Add two serializer values regarding context_data and its schema:
- Implement these new methods for the existing service types (Get row, list rows, upsert row)
- Improve the
DataSourceDataProviderType
to include the schema from the context_data to the schema returned by the DataSourceDataProvider (FE and BE). Include the data to thegetDataContent
as well. - The new values should be accessible in the data explorer like that:
- Then add an option to select whether you want manual options, Options from a data source field (not in this MR), formulas options
- Implement the formulas options with two formulas:
- Check that it's not necessary to migrate the formula as it should work as previously.
- (V2, future MR) Then implement the
option from data source
populating the formulas behind the scene when you select a field (listed from the data provider may be?)
How to test this MR
-
Create a page in the AB
-
Create one or more data source that reference DB tables with single and/or multi select fields
-
Add a choice element to the page
-
Select "Formulas" radio button
-
Play with the Value and Name formula fields, use the new <Data source name> Metadata property to fill the values, example:
Merge Request Checklist
-
changelog.md has been updated if required. -
New/updated Premium/Enterprise features are separated correctly in the premium or enterprise folder -
The latest Chrome and Firefox have been used to test any new frontend features -
Documentation has been updated -
Quality Standards are met -
Performance: tables are still fast with 100k+ rows, 100+ field tables -
The redoc API pages have been updated for any REST API changes -
Our custom API docs are updated for changes to endpoints accessed via api tokens -
The UI/UX has been updated following UI Style Guide
Closes #2489
Edited by Andrea Disarò