This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Apr 08, 2022
-
-
adam-james authored
* Add `:is_installer` key to users returned from api/user/current * Add `:has_question_and_dashboard` Key to current users via hydration This is also part of the starting page project, it's a key that helps the frontend serve more specific data to the user. * Moved `permissions-set` function up so I can use it in hydration * Adjust recents query and first pass at popular items query Recents: Before, the recent query would look at the ViewLog, which records a view on cards even when it was only 'viewed' via a dashboard. For dashboards and tables, we don't need to make a change. For cards, we now query the QueryExecution table and use started_at as a proxy for the last viewed timestamp, and can then only grab cards with an execution context of 'question'. Popular: We now want to have a notion of 'popular' items as well, which can look different than 'recents'. This is the first attempt at a reasonable query with scoring system. The score takes into account: - recency of view - count of views total - if the card/dashboard is 'verified' (enterprise) - if the cad/dashboard is inside an 'official' Collection (enterprise) The popular score currently uses only the *current-user-id* to fetch items, so popularity is (in this commit, at least) a per-user concept. * Fixed mistake and renamed endpoint * Typo fix * Clean up QueryExecution in tests * Indent, naming, and some simple defs * try to reduce db calls for :has_question_and_dashboard I've moved the fn out of the hydration system to guarantee that it only runs for a single user, and is only used in `GET /api/user/current` (and not accidentally used in other spots via hydration mechanism). Still don't know how to check Card and Dashboard tables more efficiently * ViewLog and QueryExecution have different timestamps. Can't compare Pushing this for some review, but might want to build a proper way to compare, so that recent cards and recent dashboards/tables are sorted equally * fix namespace sorting * Fix the endpoint name * Sorting mixed date time formats 'works' but not ideal This formats the timestamps into strings and uses those for comparison. Not perfect. Pushing in case people are trying the branch * Use simpler db function * Let views and runs query work with one user or all users Popular_items are an all-users notion, but recent_views applies only to the current user. * Unify view_log.timestamp to query_execution.started_at type these used to both be `DATETIME` in the migration file. Then migration 168 bumped up the type of the view_log.timestamp column: ``` - changeSet: id: 168 author: camsaul comment: Added 0.36.0 changes: - modifyDataType: tableName: query_execution columnName: started_at newDataType: ${timestamp_type} ``` So these were no longer the same on h2 (and possibly mysql). But sorting viewlogs and query_executions would fail. ```clojure activity=> (->> (ViewLog) first :timestamp #_type) "0x6a33e42e" "2022-04-04T21:57:07.471"] activity=> (->> (ViewLog) first :timestamp type) java.time.LocalDateTime activity=> (->> (QueryExecution) first :started_at #_type) "0x7af249ac" "2022-04-04T21:57:07.625738Z"] activity=> (->> (QueryExecution) first :started_at type) java.time.OffsetDateTime ``` The LocalDateTime and OffsetDateTime were not comparable. So make them identical types again. * Bookmarked results should not show up in recents/ popular. This is done in a db query to still try fetch enough items from the db to present to the user. Filtering bookmarked items later may result in an empty list. It's possible that the firt N results are all bookmarked, and then the frontend would have no items to show. Filtering bookmarked results out from the beginning increases the chances of a non-empty result. * :first_login populated with the earliest login timestamp. If there is a first login timestamp, that is used. If one does not exist, we assume it's the first time logging in and use an OffsetDateTime (now). This is possible since the login_history is done off thread, so on a real first login, we might hit the db before the login is logged, resulting in an empty list returned. On subsequent checks, we should see a proper timestamp from the db. Since this is used to check if a user is 'new' (within 7 days of first logging in), the accuracy of the timestamp matters on the order of days, not milliseconds, so this should be ok. * Passing test * Popular_items test Tweak the create-views! function to more consistently order items. And creates views for dashboards/tables (ViewLog) and cards (QueryExecution) in a unified way, meaning we can reliably order views, and write tests more easily. Note that the popular_items test may have to change if the scoring math changes. * Fix e2e test * Fix nit and bug - forgot to remove '0' from the and clause, so we didn't get the expected boolean - popular_items not WIP * another nit * Fix popular items on the frontend Co-authored-by:
Alexander Polyankin <alexander.polyankin@metabase.com> Co-authored-by:
dan sutton <dan@dpsutton.com>
-
Ariya Hidayat authored
-
Alexander Lesnenko authored
* settings global permission * fix specs * Enforce Setting permissions (cont) (#21464) * settings global permission * more api permissions enforcement * only admin could call token checks * address Noah's comments * clean ns * clean ns
Co-authored-by:Aleksandr Lesnenko <alxnddr@gmail.com> * hide subscriptions buttons for users with no permissions * fix specs * review fixes * update spec Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com>
-
Cam Saul authored
-
Alexander Polyankin authored
-
Alexander Lesnenko authored
* data model permission * update api contract * fix linter * fix specs * data model users ui with specs
-
Noah Moss authored
* first pass * a few more endpoints * add can_access_db_details to /api/user/common
-
Mahatthana (Kelvin) Nomsawadi authored
* Fix MongoDB's native query preview overflow * Misc * Native query code tagging updated * Added responsive max-height to native code modal * Padding added to native code modal for mobile Co-authored-by:
losrebellos <ben@benoitvinay.com>
-
Kyle Doherty authored
* improve the positioning of the settings trigger * pass isOpen to determine width * check for reduced motion preference for IconWrapper transition
-
Ngoc Khuat authored
-
- Apr 07, 2022
-
-
Bryan Maass authored
* handle unset last-updated times * magic number -> zoned-time-epoch * test that slack cache gets filled when slack-channels-and-usernames-last-update is nil. - remove a comment
-
Cam Saul authored
-
adam-james authored
-
Alexander Polyankin authored
-
Ariya Hidayat authored
-
Gustavo Saiani authored
-
Ariya Hidayat authored
Co-authored-by:
Ryan Laurie <iethree@gmail.com>
-
Noah Moss authored
* add can_access_data_model key to api/user/current * add exclude_uneditable flag to /api/database/:id/metadata * clean ns * WIP figuring out how to update perm checks for Field model * fix errors * fix more errors * tests for field APIs * table perms changes * tests for table API * fix function call * clean ns * perm enforcement for other table APIs * perm enforcement for other field APIs * address comments
-
Alexander Polyankin authored
-
Ariya Hidayat authored
-
Alexander Polyankin authored
-
Gustavo Saiani authored
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
Ngoc Khuat authored
-
Nemanja Glumac authored
* Fix collections permission flake * Reinforce `collection-items-listing` spec
-
Ngoc Khuat authored
* fix failed to sync admin group * address noah's comments and add migration script * document for run-with-data-migration-index * update comments * fix name space * adding data_migrations tests * add docg * make sure we don't remove admin group if sso and ldap are not configured * fix tests for be-ee * fix tests for oss * misc docs updates * remove data-migration-index * return some newlines * is it failling here? * update data_migration docs * update data_migration docs * fix all styling comments * make migration to run both in oss and enterprise and make sure the tests are accounted for that * fix failed namespace checks * Add a comment to the test * fix per comments * Update permissions.clj * tweaking with the
icon * refactor with-temporary-raw-setting-values * update comments * Add extension for cert file * address Noah's comments
-
- Apr 06, 2022
-
-
Nemanja Glumac authored
* Use multi-line command to run Cypress in GHA
-
Nemanja Glumac authored
-
Diogo Mendes authored
* Unskiping and adding extra assert * Stress test change * Reverting Stress Test
-
Nemanja Glumac authored
-
Noah Moss authored
* fix bug * address Dan's feedback * move the real-number? helper to metabase.utils and use it here * oops, fix build * second try at fixing build * third try
-
Noah Moss authored
-
Ryan Laurie authored
* add correct currency symbol to filter inputs * show currency symbol in between inputs * lift currency prefix logic up component tree * remove unused function * fix existing tests * test currency prefixes * fix test nesting * get currency symbols for columns from our currency map * use visualization settings for currency inputs * use keyForColumn() to get visualization settings
-
Nemanja Glumac authored
-
Benoit Vinay authored
* Enforce checkbox icon width * QuestionList layout updated for wrapping * Scroll updates for questions search * Remove debugging props * Layout updated * QuestionList uses List from virtualized and ellipsis+popover for long names * Checkbox component clean up * Checkbox types fixed * Misc * Fix for default checked * Reset export label * Misc updates from review
-
Ariya Hidayat authored
-
Howon Lee authored
Intended design of the JSON thing entails backing off on specific types if we find conflicting ones up to a point. Also there has to be a limit on the cardinality of the generated JSON fields. This one puts it in
-
- Apr 05, 2022
-
-
adam-james authored
* Use collection permissions fns to select correct timelines The Timelines permissions are 1:1 with collection permissions, so on the GET timelines endpoint, use the existing collection permissions functions to help efficiently check timeline permissions. * Add permissions tests to timeline api * Root lacks most collection properties no need to hydrate parent id, effective location, etc Co-authored-by:
dan sutton <dan@dpsutton.com>
-
Cam Saul authored
* Clear out existing DashboardCards when running load with --mode update * Namespace cleanup * Fix circular references * Another test fix * Settings cache needs to be per-app-DB * (Experimental -- new application DB dynamic var) * Create truly rebindable `metabase.db.connection/*application-db*` * call-on-change-fn -> call-on-change * Revert unneeded commit * Namespace cleanup * Add missing docstrings * Appease linters again * Fix handler stats logging middleware * PR feedback * PR feedback: slight optimization * Remove NOCOMMIT * PR feedback * Clean namespace
-