-
- Downloads
Store Parameter Values Set by User on a per-user basis (#40415)
* Store Parameter Values Set by User on a per-user basis This is a WIP for #28181 and the notion doc: https://www.notion.so/metabase/Tech-Maintain-user-level-state-in-dashboards-for-filters-fc16909a3216482f896934dd94b54f9a Still to do: - [ ] validate the table/model design - [ ] hook up the endpoints mentioned in the doc (2 in api/dashboard) - [ ] return the user specific parameter values on /api/dashboard/:dashboardID endpoints - [ ] write a few tests to capture the intent of this feature * Accidentally deleted a digit in the change ID timestamp * first pass at writing user param values to the db. It's in a doseq here which is probably not the correct way to go yet, but it's a step in the right direction. * Hydrate dashboard response with `:last_used_param_values` key If the user has previously set a parameter's value, it will show up in the map under that parameter id. If the user has no parameter value set, that entry will be 'null'. * Use proper fn name * Only save or retreive user params if there's a current user id * Add model to necessary lists * Only run query when there are parameter ids to run it with * Add a test to confirm that last_used_param_values works * Add models test namespace for CRUD test * The hydration is checked in the dashboard api test already
Showing
- enterprise/backend/src/metabase_enterprise/serialization/v2/models.clj 1 addition, 0 deletions...ckend/src/metabase_enterprise/serialization/v2/models.clj
- enterprise/backend/test/metabase_enterprise/models/entity_id_test.clj 1 addition, 0 deletions...ackend/test/metabase_enterprise/models/entity_id_test.clj
- resources/migrations/001_update_migrations.yaml 52 additions, 0 deletionsresources/migrations/001_update_migrations.yaml
- src/metabase/api/dashboard.clj 1 addition, 0 deletionssrc/metabase/api/dashboard.clj
- src/metabase/cmd/copy.clj 2 additions, 1 deletionsrc/metabase/cmd/copy.clj
- src/metabase/models/user_parameter_value.clj 55 additions, 0 deletionssrc/metabase/models/user_parameter_value.clj
- src/metabase/query_processor/dashboard.clj 4 additions, 0 deletionssrc/metabase/query_processor/dashboard.clj
- test/metabase/api/dashboard_test.clj 33 additions, 0 deletionstest/metabase/api/dashboard_test.clj
- test/metabase/models/user_parameter_value_test.clj 22 additions, 0 deletionstest/metabase/models/user_parameter_value_test.clj
Loading
Please register or sign in to comment