Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Apr 25, 2022
  2. Apr 24, 2022
  3. Apr 23, 2022
  4. Apr 22, 2022
    • Cam Saul's avatar
      Handle March 31st + 3 months (June 31st?) for Oracle (#21841) · b9cedccc
      Cam Saul authored
      * Handle March 31st + 3 months for Oracle (#10072)
      
      * Optimize out some casting in Oracle
      
      * rx util support varargs inside `opt`
      
      * hx/ math operators like + and - should propagate type information
      
      * Some dox tweaks
      
      * Fix SQLite busted behavior
      
      * Avoid unneeded casting in Vertica when adding temporal intervals
      
      * Lint error fixes
      
      * BigQuery fix for #21969
      
      * Add testing context for tests for #21968 and #21971
      b9cedccc
    • Alexander Lesnenko's avatar
      visual permissions fixes (#21799) · 404d4d1b
      Alexander Lesnenko authored
      * visual permissions fixes
      
      * fix permission table text wrap with an icon
      404d4d1b
    • Ariya Hidayat's avatar
    • Bryan Maass's avatar
      add implementations of write-body-to-stream for numbers / booleans (#21828) · b3c69861
      Bryan Maass authored
      * add implementations of write-body-to-stream for numbers / booleans
      * add tests for getting non-string settings over the api
      * remove blank line from end of api/segment.clj
      b3c69861
    • Ngoc Khuat's avatar
      Make /api/user works with Group managers (#21794) · 3675e8b4
      Ngoc Khuat authored
      
      * Make /api/user works with Group manager
      
      * add tests
      
      * fix linting
      
      * hope clj-kondo is happpy now
      
      * update docs
      
      * nit
      
      * GET /api/user/:id returns user_group_memberships and allow group manager
      
      * return additional fields if caller is Group Manager
      
      * fix ns
      
      * use set instead of list in tests
      
      * POST /api/user/:id takes user_group_memberships too
      
      * address Noah's comments
      
      * typo
      
      * sort by superuser -> group managers -> normal user when filter by group-id
      
      * FE: Group managers  (#21111)
      
      * group managers ui
      
      * update specs
      
      * review
      
      * review
      
      * fix merge
      
      Co-authored-by: default avatarAlexander Lesnenko <alxnddr@users.noreply.github.com>
      Co-authored-by: default avatarAleksandr Lesnenko <alxnddr@gmail.com>
      3675e8b4
    • Bryan Maass's avatar
      adds search param for database/:id/autocomplete_suggestions (#21887) · 931c2f65
      Bryan Maass authored
      - search qp will search for a substring
      - prefix qp works as it used to (searches for a prefix)
      - if both are included, prefer search.
      931c2f65
    • Diogo Mendes's avatar
      Skiping flake Permission test (#21955) · 5935584c
      Diogo Mendes authored
      * Quarantine test
      
      * Setting CI to burn tests
      
      * Increase timeout
      
      * Reverting stress test
      
      * Adding the whys to skip test
      5935584c
    • Noah Moss's avatar
      Markdown->Slack refactor and fix for nested bold/italic rendering (#21905) · d8cf20c6
      Noah Moss authored
      * refactor markdown->slack code to use a multimethod
      
      * solve nested bold & italic issue
      
      * fix docstring position
      
      * fix tests
      
      * restore a couple of comments
      
      * replace mrkdwn with slack in tests
      d8cf20c6
    • dpsutton's avatar
      Allow strings to be empty in metadata (#21880) · acdf2204
      dpsutton authored
      * Allow strings to be empty in metadata
      
      not sure why it originally required a nil or a non-blank string. But
      when you want to override a description and clear it out, the front-end
      text boxes will send over an empty string "".
      
      This value is useful on its own though. Particularly in mbql queries or
      in native models where you've identified an underlying field, it will
      merge the metadata of the underlying field with the metadata of the
      model. So if we keep a nil there the underlying can show up. Especially
      for mbql queries, where you have the underlying description to begin
      with, you clear it out and then it appears to remain. Because of this
      merging. Using an affirmative "" empty string value prevents the merge
      and we all are happy
      
      * Lets also fix #11097 while we're near
      
      not identical, but same problem enforced at the route rather than some
      schema though
      
      * Unneeded thread macro
      acdf2204
    • Gustavo Saiani's avatar
    • adam-james's avatar
      Handle Plural Translation and Path String Bugs for i18n (#21116) · b0ff7087
      adam-james authored
      The i18n in Metabase uses a service 'POEditor', which requires:
      
      1. all strings on the frontend and backend that need to have translations must be collected into a .pot file
      2. The .pot file is uploaded and people contribute translations for each phrase, per locale. These eventually get
      downloaded as locale.po (eg. German is 'de.po')
      3. Frontend and backend each take responsibility for generating required locale resources, which are then used to
      render the correct translations for the user's locale in the app.
      
      This process works just fine, but occasionally some bugs are found. These particular changes in this PR were found
      because of issue #15660 where a user reports that some of the 'binning options' are translated while others are not.
      
      Those particular strings originate form the backend via the API at `src/metabase/api/table.clj`, but the issue arises
      because the backend's locale resource files do not contain the entries for those translations. The mechanism is
      working just fine, it's the resource building process that has some issues.
      
      So, we can turn to the i18n build process, which is all found in `bin/i18n`, and is a mix of shell scripts and
      clojure.
      
      The script `update-translation-template` starts the process.
      There are a few steps in the process:
      
      1. generate metabase-frontend.pot -> uses Babel, I'm assuming this works for the purpose of this PR
      
      2. generate metabase-backend.pot  -> works fine. We can see in `locales/metabase-backend.pot`:
      
         #: src/metabase/api/table.clj
         msgid "Week"
         msgstr ""
      
      3. Join these files together with a tool 'msgcat' into metabase.pot
         - here is where we begin to see an issue.
         - there is NO entry that matches the example from 2. This is because msgcat has combined translation strings that
         match on the frontend into a single entry:
      
           #: frontend/src/metabase-lib/lib/Dimension.ts:1677
           #: frontend/src/metabase/lib/query_time.js:203
           #: frontend/src/metabase/parameters/components/widgets/DateRelativeWidget.jsx:25
           #: frontend/src/metabase/parameters/components/widgets/DateRelativeWidget.jsx:30
           #: src/metabase/api/table.clj
           msgid "Week"
           msgstr ""
      
         - and, more interestingly:
      
         #: frontend/src/metabase-lib/lib/Dimension.ts:1689
         #: frontend/src/metabase/lib/query_time.js:207 src/metabase/api/table.clj
         msgid "Quarter"
         msgstr ""
      
         - There are a bunch of #: lines, the last being the clj file, which means that "Week" is used both in the frontend
         and backend. So, the translated string can be used in both situations. The backend does handle the case of multiple
         #: paths, but does not handle the second situation, where there are actually 2 paths (space separated) in a single
         #: line.
      
      4. in the file `bin/i18n/src/create_artifacts/backend.clj` we create .edn files for each locale.
         - this is a map where the keys are the English strings and values are the translations from the locale.po file.
         - our logic in this file incorrectly assumes only a single path per #: line in the .pot file exists, and this is
         one place where things break. The 'backend-message?' predicate will fail on the second example in 3. so we don't
         ever translate that string.
         - Simultaneously, `i18n/common.clj` allows pluralized entries. In the case of "Week", we got "Week" and "Weeks"
         translated from POEditor. When a message is plural, the contents show up in a different location. Our backend code
         ignores plural, but this ends up throwing away our valid translation as well. When a message is plural, all
         translations show up in :str-plural as a seq, where the first entry is the singular translation. But, we (remove
         :pluarl?) so get nothing. This is why the binning options aren't translated. As a point of completeness: if a
         message has no plural, we correctly get the translated message from the :str key.
      
      The broken logic:
      - common.clj - po-messages-seq creates a seq of messages, where a message looks like:
      {:id "Week",
        :id-plural "Weeks",
        :str nil,
        :str-plural ("Woche" "Wochen"),
        :fuzzy? false,
        :plural? true,
        :source-references
        ("frontend/src/metabase/lib/query_time.js:203"
         "frontend/src/metabase/parameters/components/widgets/DateRelativeWidget.jsx:25"
         "frontend/src/metabase/parameters/components/widgets/DateRelativeWidget.jsx:30"
         "src/metabase/api/table.clj target/classes/metabase/api/table.clj"),
        :comment nil}
      
      or
      {:id "Day of Week",
        :id-plural nil,
        :str "Wochentag",
        :str-plural nil,
        :fuzzy? false,
        :plural? false,
        :source-references ("src/metabase/api/table.clj target/classes/metabase/api/table.clj"),
        :comment nil}
      
      Example 1 fails because the message is pluralized. :str is nil, but (first (:str-plural message)) has the correct
      translation. We are looking in the wrong spot in this case. Compare to Example 2 which does work.
      
      Notice a subtle thing that was actually wrong in examples 1 and 2 but worked by accident: some :source-references
      strings contain 2 paths. We see this failing here:
      
      {:id "Quarter",
       :id-plural "Quarters",
       :str nil,
       :str-plural ("Quartal" "Quartale"),
       :fuzzy? false,
       :plural? true,
       :source-references
       ("frontend/src/metabase/lib/query_time.js:207 src/metabase/api/table.clj" "target/classes/metabase/api/table.clj"),
       :comment nil}
      
      We can solve this different problem by using str/split in the backend-message? predicate.
      b0ff7087
    • Alexander Polyankin's avatar
    • Cam Saul's avatar
      51f439af
    • Anton Kulyk's avatar
      Fix sidebar icon doesn't support whitelabeling (#21939) · 6071382b
      Anton Kulyk authored
      * Fix `fill` hardcoded in SVG icons
      
      * Use HTML button for sidebar button
      
      * Fix style
      6071382b
    • Ryan Laurie's avatar
      Set consistent height for object detail modal (#21899) · 26ae3757
      Ryan Laurie authored
      * set consistent height for object detail modal
      26ae3757
    • Ryan Laurie's avatar
      better people name alignment (#21889) · b0bbcd17
      Ryan Laurie authored
      b0bbcd17
    • Ryan Laurie's avatar
      remove unnecessary X scrollbar (#21890) · 7cc7e844
      Ryan Laurie authored
      7cc7e844
    • Bryan Maass's avatar
      make sure we pass :port when creating ssh tunnels (#21775) · 5845dbbe
      Bryan Maass authored
      
      * make sure we pass :port when creating ssh tunnels
      
      - if it is not there, use the default port
      
      * pass a default :port every time we incorporate-ssh-tunnel-details
      
      * Update src/metabase/driver/sql_jdbc/connection.clj
      
      remove unused port destructuring
      
      Co-authored-by: default avatarBraden Shepherdson <Braden.Shepherdson@gmail.com>
      
      Co-authored-by: default avatarBraden Shepherdson <Braden.Shepherdson@gmail.com>
      5845dbbe
    • Nick Fitzpatrick's avatar
    • Anton Kulyk's avatar
      Hide drills for no-data users (#20320) · 3b8d88b5
      Anton Kulyk authored
      * Add repro
      
      * Disable drills for not editable queries
      
      * Fix drill name
      
      * Fix QuickFilterDrill tests
      
      * Disallow resizing table columns for no-data users
      
      * Fix x-ray drill
      
      * Fix repro
      
      * Disable "brush" drill for no-data users
      
      * Use default cursor on charts for no-data users
      
      * Revert TableInteractive changes
      3b8d88b5
    • Howon Lee's avatar
      Group-by fix for JSON columns. (#21741) · bad129cd
      Howon Lee authored
      Group-bys didn't work because you need two instances of the field and you couldn't have two instances of the field be considered by the postgres backend as the same. Ported over the BigQuery fix to this to apply to JSON columns as well.
      bad129cd
    • Anton Kulyk's avatar
      Enable object detail view on nested native queries (#21883) · 824c3a07
      Anton Kulyk authored
      * Reproduce #16938
      
      * Fix PK drill unavailable for nested native query
      
      * Clean up ObjectDetailDrill
      824c3a07
    • Anton Kulyk's avatar
      Fix native model view for no-data user (#21819) · 617dfb22
      Anton Kulyk authored
      * Hide native editor for no-data user on model page
      
      * Explain the change in a comment
      617dfb22
    • Ariya Hidayat's avatar
    • Alexander Polyankin's avatar
      Fix homepage background (#21914) · 4af6b217
      Alexander Polyankin authored
      4af6b217
    • Alexander Polyankin's avatar
Loading