-
- Downloads
Allow setting labels for filters (#44352)
* Add csv-stringify package * Split values at comma WIP: Parse values using json * Add label to ParameterValue and add ParameterValue to value config * Use custom label in FieldValuesWidget * Allow passing displayValue from outside of RemappedValue * Allow passing displayValue in ParameterFieldWidgetValue * Get custom value label in FormatterParameterValue * Allow rendering custom displayValue in FieldValuesWidget * Add custom ParameterValue types * Fix ParameterValuePicker type * Fix jest import for csv-stringify * Add missing RTKQ exports for paramters * Use direct implementation of useGetParameterValues * Fix ValueSourceModal tests * Add tests for value parsing and stringifying * Use custom label in list too * Render the custom label in a parameter value * Setup parameter mocks in embed test * Add info about splitting values with comma * Add model hint when user is using labels * Add test for cusom labels on dashboards * Handle label-value pairs in test * Test custom labels in parameter search input * Use the label to parse the value for text inputs * Fix comma's to commas Co-authored-by:Kamil Mielnik <kamil@kamilmielnik.com> * Use strong instead of styling link * Use getInput instead of ignoring eslint rule * Use arrow function * Add newlines between tests * Use uppercase for test value * Name value * Use getLabel and getValue helpers to avoid indexing confusion * Pull out confusing condition * Move out getLabel helper * Be more explicit about non-existent config values Co-authored-by:
Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com> * Move setupParameterValuesEndpoints to setup * Add loading state * Do not use alert to implement info box * Fix formatting * Remove undefined from getValue signature * Use getLearnUrl * Remove dependency on column * Make custom field labels work in the absence of fields * Support custom values for non-field parameters * Add test for native question parameters * Add newline in test * Add test case for when show-metabase-links is false * Just fall back to rendering value when fetching label, or in case it failed * Add test for loading state of FormattedParameterValue * Do not fetch custom label for FormattedParameterValue * Add table with ip addresses * Add test for IPAddress filter with custom labels * Add test for custom labels on type/Quantity fields * Remove getInput helper in test * Remove unused hasCustomLabel value * Split up into common and premium tests * Make fieldValues a map for performance --------- Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com> Co-authored-by:
Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Showing
- e2e/support/helpers/e2e-filter-helpers.js 12 additions, 1 deletione2e/support/helpers/e2e-filter-helpers.js
- e2e/support/test_tables.js 16 additions, 1 deletione2e/support/test_tables.js
- e2e/support/test_tables_data.js 11 additions, 0 deletionse2e/support/test_tables_data.js
- e2e/test/scenarios/dashboard-filters/dashboard-filters-source.cy.spec.js 180 additions, 12 deletions...ios/dashboard-filters/dashboard-filters-source.cy.spec.js
- e2e/test/scenarios/native-filters/sql-filters-source.cy.spec.js 229 additions, 13 deletions...st/scenarios/native-filters/sql-filters-source.cy.spec.js
- frontend/src/metabase-types/api/parameters.ts 6 additions, 2 deletionsfrontend/src/metabase-types/api/parameters.ts
- frontend/src/metabase/api/parameters.ts 3 additions, 0 deletionsfrontend/src/metabase/api/parameters.ts
- frontend/src/metabase/components/FieldValuesWidget/FieldValuesWidget.tsx 101 additions, 27 deletions...tabase/components/FieldValuesWidget/FieldValuesWidget.tsx
- frontend/src/metabase/components/FieldValuesWidget/FieldValuesWidget.unit.spec.tsx 40 additions, 3 deletions...ponents/FieldValuesWidget/FieldValuesWidget.unit.spec.tsx
- frontend/src/metabase/components/FieldValuesWidget/utils.ts 14 additions, 1 deletionfrontend/src/metabase/components/FieldValuesWidget/utils.ts
- frontend/src/metabase/containers/RemappedValue.jsx 5 additions, 11 deletionsfrontend/src/metabase/containers/RemappedValue.jsx
- frontend/src/metabase/parameters/components/FormattedParameterValue/FormattedParameterValue.tsx 37 additions, 2 deletions...nents/FormattedParameterValue/FormattedParameterValue.tsx
- frontend/src/metabase/parameters/components/FormattedParameterValue/FormattedParameterValue.unit.spec.tsx 48 additions, 0 deletions...attedParameterValue/FormattedParameterValue.unit.spec.tsx
- frontend/src/metabase/parameters/components/ParameterValuePicker/core.ts 7 additions, 1 deletion...tabase/parameters/components/ParameterValuePicker/core.ts
- frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceModal.unit.spec.tsx 65 additions, 3 deletions...ponents/ValuesSourceModal/ValuesSourceModal.unit.spec.tsx
- frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceTypeModal.module.css 8 additions, 0 deletions...onents/ValuesSourceModal/ValuesSourceTypeModal.module.css
- frontend/src/metabase/parameters/components/ValuesSourceModal/ValuesSourceTypeModal.tsx 43 additions, 14 deletions...rs/components/ValuesSourceModal/ValuesSourceTypeModal.tsx
- frontend/src/metabase/parameters/components/ValuesSourceModal/tests/common.unit.spec.tsx 394 additions, 0 deletions...s/components/ValuesSourceModal/tests/common.unit.spec.tsx
- frontend/src/metabase/parameters/components/ValuesSourceModal/tests/premium.unit.spec.tsx 82 additions, 0 deletions.../components/ValuesSourceModal/tests/premium.unit.spec.tsx
- frontend/src/metabase/parameters/components/ValuesSourceModal/tests/setup.tsx 123 additions, 0 deletions...e/parameters/components/ValuesSourceModal/tests/setup.tsx
Loading
Please register or sign in to comment