Skip to content
Snippets Groups Projects
Unverified Commit e4e34df9 authored by Kamil Mielnik's avatar Kamil Mielnik Committed by GitHub
Browse files

[MLv2] [FE] Migrate data reference (#37694)


* Migrate StructuredQuery.prototype.filter in ObjectDetailView

* [MLv2] Add `legacy-column->metadata` for converting `DatasetColumn`

The query and stage are unfortunately required to correctly handle
aggregation references.

Note that the JS version of this name is `legacy_column__GT_metadata`,
with the double underscore.

* Add TS wrapper

* Use fromLegacyColumn

* Make code more backwards-compatible

* Make code more backwards-compatible

* Remove type argument from startNewCard

* Migrate startNewcard in actions/object-detail to MLv2

* Fix filter clause

* Use numberFilterClause when dealing with numbers

* Use numberFilterClause when dealing with numbers in ObjectDetailView

* Always pass metadata to getQuestionUrl

* Partially migrate getQuestion

* Handle metricId & segmentId in getQuestion

* Order functions

* Return after handling the metric and use setDisplay after handling all the clauses

* Update frontend/src/metabase/visualizations/components/ObjectDetail/ObjectDetailView.tsx

Co-authored-by: default avatarUladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

* Do not pass tableId to Question.create

* Rename aggregateCount to aggregateByCount

* Do not pass tableId to Question.create

* Simplify code

* Get databaseId from Question instea of raw dataset query

* Fix code order

* Allow Field to be passed to fromLegacyColumn

* Prettier

* Handle fieldId in getQuestion

* Drop getQuestionOld

* Drop startNewCard

* Move aggregateByCount to metabase-lib/aggregation

* Migrate loadObjectDetailFKReferences to MLv2

* Reuse Lib.aggregateByCount

* Reverse logic

* Use proper Field type

* Handle field not being present in metadata

* Remove Q_DEPRECATED.createQuery

* Remove unused argument

* Make ObjectDetail.unit.spec.tsx tests pass

* Fix setting display

* Fix typo

* Add missing typing

* Fix withDefaultTemporalBucket usage

* Update getQuestion tests

* Add `null` to aggregation assertions
- pending question: https://metaboat.slack.com/archives/C04CYTEL9N2/p1705408133622419



* Remove unnecessary props argument from getMetadata calls

* Add missing metadata

* Handle missing table

* Format code

* Make sure setDisplay is called even if table is not available

* Use correct values in assertions

* Skip tests failing because of BE issue

---------

Co-authored-by: default avatarBraden Shepherdson <braden@metabase.com>
Co-authored-by: default avatarAlexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: default avatarUladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
parent f40e8f0b
No related branches found
No related tags found
No related merge requests found
Showing
with 288 additions and 266 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment