Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jun 28, 2021
  2. Jun 23, 2021
    • dpsutton's avatar
      Cache results dont affect average execution time (#16720) · d4121d04
      dpsutton authored
      * Only save successful-query-execution if it wasnt a cached result
      
      the only thing this function does is update the rolling average query
      execution time
      
      * Failing tests for cache execution stats
      
      These tests fail, but they shouldn't.
      
      The save-execution information should not be called twice, and the
      average execution duration should remain the same. What's happening is
      that it is getting called twice just in the cache call, and only one
      of those has the new key `:metrics/ignore-execution-time`. This
      remains a mystery to me
      
      * Don't call completion arity from step arity
      
      the `(rf acc)` call violated the terms of transduction. If it does
      need to be there, perhaps it could be used with reduced
      
      wary of #12207 (which fixes #12165) and seeing if that crops up again.
      
      - i had introduced :metrics/ignore-execution-time but this was because
      i thought that we were running a simple query (limit 1) to get col
      metadata. Now that i know we were just being a bit careless with `(rf
      acc)` this extra information is no longer needed, and we can just
      react to cached data.
      
      * hoist closing paren
      d4121d04
    • Cam Saul's avatar
      :wave: `get-id` (#16730) · f3847cb8
      Cam Saul authored
      f3847cb8
    • Noah Moss's avatar
  3. Jun 22, 2021
  4. Jun 18, 2021
    • Howon Lee's avatar
      Fix issue with the collections appearing in the list page (#16562) · 5156d881
      Howon Lee authored
      I thought the collections appearing in the list page problem was solved, but this turned out to be a bug with the ttest. Upon actual inspection the lists remained.
      
      To fix this without changing all sorts of crap that depended upon collections api contract (we futzed with the output but the futzing of the output is transparent to the frontend because of the entity thing they got going on), needed a way to elicit null response from collections endpoint. shoved one in. then renamed it because the first name, "dummy", makes it all sound kind of jank, so 'no-model' for explicitly asking for no model without handing in an empty set, which turns into the set of all models.
      
      This is an 80% unjankening. Full unjankening would entail whacking this special case.
      5156d881
    • Anton Kulyk's avatar
      Fix can't unarchive question without data access (#16590) · fd9d2816
      Anton Kulyk authored
      * Fix can't unarchive question without data access
      
      * Test API checks perms when unarchiving a card
      fd9d2816
  5. Jun 17, 2021
  6. Jun 16, 2021
  7. Jun 15, 2021
    • dpsutton's avatar
      Don't compute only on non-zero scores (#16598) · 0f5de39b
      dpsutton authored
      * Don't compute only on non-zero scores
      
      I was removing a helper function when refactoring the scoring. That
      had a filter on :score?. I'm not sure why i translated this to only
      interpret the denominator of scoring to only include scores that were
      positive. This is obviously wrong.
      
      Also, previously, all databases would be returned in the archived
      query which seems obviously wrong. Databases cannot be archived and so
      should never appear when searching for archived items.
      
      * Add some tests
      
      - had been asserting that ee-score = os-score if not in an official
      collection. This is actually hard to do under the current scheme, and
      actually not important. The important bit is that the relative
      ordering is the same. It had been adding 0 score 2 weight previously,
      and removing all scores with a score of 0. This created a bad way to
      score, as something with 1/2, 0/3, 0/4, 0/10 (net score 1/2=0.5) would
      appear higher than something with 1/2, 1/3, 1/4, 3/10 (net score
      6/19=0.315) and it really shouldn't. The former really should
      be (1/19=0.05). And since we are adding in a denominator of
      2 (official collection weight) all of the scores are actually smaller,
      but that's ok, as they are all proportionately smaller.
      0f5de39b
    • Alexander Lesnenko's avatar
      hide snippets folders from the collections sidebar (#16576) · 4a44cbbc
      Alexander Lesnenko authored
      
      * hide snippets folders from the collections sidebar
      
      * namespace test thing
      
      Co-authored-by: default avatarhowon lee <hlee.howon@gmail.com>
      4a44cbbc
    • dpsutton's avatar
      Lookup ip address for new login email off thread (#16348) · f5380503
      dpsutton authored
      * Lookup ip address for new login email off thread
      
      * Deref with timeout
    • dpsutton's avatar
      Fix last edit query (#16520) · a80ac907
      dpsutton authored
      * Correct query for last edits
      
      * tests ensure we get latest revisions
      a80ac907
    • dpsutton's avatar
      Sort by last_edited_by (#16388) · f08bea47
      dpsutton authored
      for last edits, now can sort by last_edited_at (previously
      last_edited) and last_edited_by
      f08bea47
    • Nemanja Glumac's avatar
      Merge `release-x.39.x` including ae6e9d9f (#16575) · 835fba84
      Nemanja Glumac authored
      * Cleanup from dump-load-entities-test (#16281)
      
      Updating dump-load-entities-test test so that dump dir is actually deleted at the end
      
      * Revamp Cypress custom commands (#16292)
      
      * Extract UI custom commands
      
      * Extract user related custom commands
      
      * Extract overwrites
      
      * Extract permissions related custom commands
      
      * Extract API custom commands
      
      * Extract helpers custom commands
      
      * Extract database related custom commands
      
      * Rename `helpers` group to `visibility`
      
      * Rename custom command `isInViewport` to `isRenderedWithinViewport`
      
      * Unskip repro for #15119 (#16297)
      
      * Create composite Cypress custom command `cy.createQuestionAndDashboard` (#16294)
      
      * Add composite Cypress custom command `createQuestionAndDashboard`
      
      * Refactor the existing test to use new Cypress custom command
      
      * Refactor repro for #13062 using the new Cypress custom command
      
      * Use the `describe` block instead of using `forEach` for complex repro
      
      * Add space between test cases
      
      * #12629 Repro: Human-readable number formatting not working properly (#16231)
      
      * Fix `nosql` user's email address (#16306)
      
      * Generate correct SQL for columns from joins inside other joins or source queries (#16254)
      
      * Fix joining a join inside a nested queries (#12928)
      
      * Code cleanup & dox
      
      * Tests for #13649
      
      * Test fixes :wrench:
      
      
      
      * Remove unit tests snapshots (#16321)
      
      * Remove snapshots from `Calendar.unit.spec.js`
      
      * Remove snapshots from `DashCard.unit.spec.js`
      
      * Remove snapshots generated for "internal" components
      
      * Remove unused import
      
      * Remove snapshot related command from `scripts`
      
      * Remove `noSnapshotTest` from internal components
      
      * Remove `react-test-renderer`
      
      * filter nulls out of histograms (#16345)
      
      * #15993 Repro: Click behavior with filter pass-thru does not show filters defined on question (#16342)
      
      * #16334 Repro: Click Behavior targeting a question with filter mapped causes the visualization type to change (#16343)
      
      * Add repro for #16334
      
      * Expand test assertion
      
      * #16327 Repro: Double binning menu for date fields when using Saved Question (Native) (#16359)
      
      * #16322 Repro: "Custom mapping" is only available, when "A list of all values" is set (and after a browser refresh) (#16361)
      
      * #16226 Repro: LDAP/Email settings gets cleared if validation fails (#16364)
      
      * Add repro for #16226
      
      * Extract email settings into a separate file
      
      * Add repro for #16226 (Email)
      
      * switch to column settings when sidebar is already open (#16368)
      
      * align labels on non-bars in combo charts (#16369)
      
      * #16378 Repro: Cannot enable JWT authentication (#16384)
      
      * Fix JS error on JWT settings form (#16394)
      
      * fix default updateSettings function in SettingsBatchForm
      
      * unskip repro
      
      * #12128 Repro: Can't change label on empty row value (#16426)
      
      * Post-merge fix
      
      * Post-merge fix 2
      I didn't solve this merge conflict properly in the original merge.
      
      Co-authored-by: default avatarJeff Evans <jeff303@users.noreply.github.com>
      Co-authored-by: default avatarCam Saul <1455846+camsaul@users.noreply.github.com>
      Co-authored-by: default avatarPaul Rosenzweig <paulrosenzweig@users.noreply.github.com>
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      835fba84
  8. Jun 14, 2021
    • Anton Kulyk's avatar
      Revert "Feature | Collection Metadata (#16510)" (#16570) · bd40d2e1
      Anton Kulyk authored
      This reverts commit 82757d60.
      bd40d2e1
    • Anton Kulyk's avatar
      Feature | Collection Metadata (#16510) · 82757d60
      Anton Kulyk authored
      
      * Display last edit info in Question and Dashboard headers (#16354)
      
      * Add LastEditInfoLabel component
      
      * Fix Header component's import order
      
      * Display last edit info in Dashboard header
      
      * Display last edit info in Question header
      
      * Show "edited by you" if user is the last editor
      
      * Add prop types for Header component
      
      * Add prop-types for ViewHeader component
      
      * Switch the collection page to table-based layout, display last edit info (#16357)
      
      * Extract color functions from EntityItem body
      
      * Refactor EntityItem not to use `switch` statement
      
      * Extract `<EntityItem.Icon />` component
      
      * Extract `<EntityItem.Name />` component
      
      * Extract `<EntityItem.Menu />` component
      
      * Add basic table components for collection items
      
      * Update item name style
      
      * Update `last-edit-info` columns text style
      
      * Make CollectionContent wider
      
      * Highlight pinned items
      
      * Add `renderItem` prop to BaseItemsTable
      
      * Add links to table items' entity pages
      
      * Connect `data-metabase-event` to table items
      
      * Make table items selectable for bulk actions
      
      * Remove filtering E2E test
      
      Collection items filtering is going to be replaced with sorting
      
      * Fix cypress collection item selectors
      
      * Fix cypress pinned items assertions
      
      * Add collection item actions menu
      
      * Fix "Type" column style
      
      * Fix layout when there are no pinned items
      
      * Add CollectionContent's empty state
      
      * Fix typo
      
      * Update table row height
      
      * Add table rows separators
      
      * Remove replaced components
      
      * Remove filtering logic from CollectionContent
      
      * Fix pulses display in collection items table
      
      * Remove note about filtering E2E tests
      
      Collection items filtering is going to be replaced with sorting
      
      * Move BaseTableItem into its own file
      
      * Remove redundant conditional render
      
      * Fix col's span attribute
      
      * Don't use `useCallback` for itemRenderer
      
      * Extract ItemsTable's renderItem
      
      * Extract PinnedItemsTable's renderItem
      
      * Fix `EntityItemIcon` margin prop usage
      
      * Remove not used props from `EntityItem`
      
      * Fix string prop notation
      
      * Add IconButtonWrapper component
      
      * Use IconButtonWrapper for EntityItem's icon
      
      * Update BaseTableItem's EntityIcon usage
      
      * Move EntityItemWrapper to .styled file
      
      * Rename `EntityItemIcon` to `EntityIconCheckBox`
      
      * Sort by last_edited_by (#16388)
      
      for last edits, now can sort by last_edited_at (previously
      last_edited) and last_edited_by
      
      * Remove "Pinned items" text assertion
      
      The category title is removed in this PR by design
      
      * Add drag-n-drop to collection items tables (#16360)
      
      * Don't wrap ItemDragSource children with <div />
      
      react-dnd allows wrapping only native DOM elements with DND helpers.
      
      With the new table layout, we now need to drag table rows (td elements).
      
      Rendering a td with ItemDragSource results in invalid HTML as table body's direct children should only include td elements.
      
      * Rename `selected` prop to `selectedItems`
      
      * Pass ItemDragSource props to table item
      
      * Replace styled TableRow with plain <tr />
      
      Table row is wrapped with ItemDragSource, that only accepts native DOM elements as its children
      
      So styled-components can't be used here
      
      * Make table row draggable
      
      * Add headless mode to BaseItemsTable
      
      * Add prop hiding table row's bottom border
      
      * Fix typo and split large comment
      
      * Render full table row when dragging
      
      * Add empty PinnedItemsTable drop area
      
      * Add empty ItemsTable drop area
      
      * Wrap PinnedItemsTable with drop area
      
      * Wrap ItemsTable with drop area
      
      * Extract `<tr />` style
      
      Co-authored-by: default avatarGustavo Saiani <gustavo@poe.ma>
      
      * Fix width style
      
      Co-authored-by: default avatarGustavo Saiani <gustavo@poe.ma>
      
      * Run prettier
      
      * Reference issue about post-pulses work
      
      Co-authored-by: default avatarGustavo Saiani <gustavo@poe.ma>
      
      * Fix last edit query (#16520)
      
      * Correct query for last edits
      
      * tests ensure we get latest revisions
      
      * Add tooltip displaying the exact time of the last collection item edit (#16492)
      
      * Add sorting to collection items (#16385)
      
      * Add sorting params to Search entity
      
      * Remove pinned items sorting by `collection_position`
      
      * Add default sorting to collection items
      
      * Add sorting controls
      
      * Add test IDs to table head and columns
      
      * Move pagination tests into separate file
      
      * Make pagination tests independent from dataset
      
      * Allow creating pinned items via API in Cypress
      
      * Add sorting E2E tests
      
      * Fix sorting by "Last edited at" column
      
      * Add sorting by "Last edited by" column
      
      * Fix BaseItemsTable unit test
      
      * Order by _revision_ id, not _user_ id (#16536)
      
      * Fix UI flash when sorting collection items (#16511)
      
      * Optionaly keep prev list value in EntityListLoader
      
      * Use prop-types in EntityListLoader
      
      * Fix UI flash when sorting collection items
      
      * Fix empty state displayed before items are fetched
      
      * Alias condition statement
      
      * Unify shouldUpdatePrevList condition
      
      * Fix react/display-name
      
      * Rename keepPreviousList —> keepListWhileLoading
      
      * Swap list and previous list internally
      
      * Replace `_.isEqual` check with plain `!==`
      
      * Fix border radius for circle icon
      
      * Rename Header's `showBadge` into `hasBadge`
      
      * Add tests for collections metadata (#16538)
      
      Co-authored-by: default avatardpsutton <dan@dpsutton.com>
      Co-authored-by: default avatarGustavo Saiani <gustavo@poe.ma>
      82757d60
  9. Jun 11, 2021
  10. Jun 10, 2021
  11. Jun 09, 2021
  12. Jun 08, 2021
  13. Jun 07, 2021
  14. Jun 03, 2021
    • Howon Lee's avatar
      Audit optimization for questions (#16220) · e8378db3
      Howon Lee authored
      
      Peeps want to make questions faster, but we don't give the data about query execution in a very user-friendly way. Here's it in a user-friendly way.
      
      Co-authored-by: default avatarAlexander Lesnenko <alxnddr@users.noreply.github.com>
      e8378db3
    • dpsutton's avatar
      Paginated collection metadata (#16275) · 8e3b4ad8
      dpsutton authored
      * Add the last-edit-info to the child query
      
      just for cards right now, need to extend to dashboards and then make
      sure we clean it up into the proper map.
      
      Have a set of all columns that are required and ensure those are in
      each query. Nulls need to be cast to the correct type if they aren't a
      text column (at least on postgres, need to investigate h2 and mysql).
      
      * Correct find last-edit-info for cards and dashboards
      
      * Move from group-by max id to self join
      
      * Paginate and search on collection items
      
      - include the metadata information in the query
        - to accomplish this, make a backstop to add all columns into each
          query
        - need types to union the null. in postgres it assumes all nulls are
          text. Haven't checked what mysql and h2 do here yet
      - sort_column: name, last_edited, model
      - sort_direction: asc, desc
      
      * Add default sort column and direction
      
      * handle mysql
      
      mysql doesn't need types on nulls to unify them
      
      * Correct batch post processing for cards and dashboards
      
      * Correct order of expectations
      
      they were alphabetical inside of models
      previous order:
      - acme products           | pulse
      - electro-magnetic pulse  | pulse
      - birthday card           | card
      - dine & Dashboard        | dashboard
      
      and is now ordered solely by name
      
      * Tests and sort on lower name after timestamp
      
      When sorting by last edited, lots of things don't have this, so don't
      want arbitrary sorting, but sort by name afterwards
      
      * Ensure nulls go to the end of the list
      
      * Tests
      
      * trying to make h2, mysql, and pg happy
      
      sorting timestamps and always having nulls last is quite difficult
      
      * Make diff bigger
      
      this was going in as a string and losing the timezone information, so
      was actually advancing time.
      
      Now: (java.time.OffsetDateTime/now)
      "2021-06-01T13:59:33.165483Z"
      
      Minus 2 hours: (.minusHours (java.time.OffsetDateTime/now) 2)
      "2021-06-01T11:59:27.528500Z"
      
      As seen in the code:
      ;; unaltered "now"
      "2021-06-01T08:55:28"
      ;; altered "two hours ago"
      "2021-06-01T11:55:29" <- UTC shenanigans. so just bump back 24 hours
      
      * Sort by model ranking
      
      * Remove clj-time and use ZonedDateTime instead of OffsetDateTime
      8e3b4ad8
  15. Jun 02, 2021
    • dpsutton's avatar
      Authority Level on collections (formerly Typed collections) (#16191) · ad753b18
      dpsutton authored
      * Add type on collection
      
      * Search with collection type
      
      * Cleanup bounded heap accumulator
      
      * Make search conditionally bump official collection items
      
      * collection api and tests
      
      * Put collection type onto hydrated cards on dashboards
      
      * Move official collection type scoring into ee codebase
      
      * ensure ee and oss agree when not official collection
      
      * Mark Collections tree with type
      
      * Remove unnecessary `and`s when no check for enhancements
      
      * Tests for setting collection tree type
      
      * Include hydration for collection type on dashboards
      
      * Make sure created test collections are cleaned up
      
      * Cleanup tests, don't search on collection_type
      
      looks for all text fields and searches the term against that. official
      would bring back all official types. no bueno
      
      * Docstring on protocol and don't shadow comparator
      
      * update to new ee impl var passing style
      
      * Collection model ensures no type change on personal collection
      
      * Check for personal collection when updating type
      
      model checks for personal collection and rejects in the update but
      doesn't check for children of personal collection.
      
      * Update checking for unchangeable properties of a personal collection
      
      * Cleanup: type collection tree, batched hydration, combine error checks
      
      * Cleanup
      
      * move bounded-heap accumulator to utils
      
      * switch to test.check testing
      
      * Bad test just to see what our CI will report
      
      * remove purposeful failing test (was for CI)
      
      * collection.type -> collection.authority_level
      
      * Test the actual ee scoring impl, not the wrapped one
      
      locally i had enhancements enabled so the tests were passing, but in
      CI it was failing as it did not have enhancements enabled
      ad753b18
  16. Jun 01, 2021
  17. May 27, 2021
Loading