Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Apr 04, 2021
  2. Apr 02, 2021
    • Cam Saul's avatar
    • dpsutton's avatar
      Throw an error if a setting already exists (#15359) · 17ccd713
      dpsutton authored
      * Throw an error if a setting already exists
      
      ```clojure
      setting-test=> (defsetting site-name (deferred-tru "A testing setting") :visibility :public)
      Execution error (ExceptionInfo) at metabase.models.setting/register-setting! (setting.clj:464).
      Setting :site-name already registered in metabase.public-settings
      setting-test=> (pprint (ex-data *e))
      {:existing-setting
       {:description "The name used for this instance of Metabase.",
        :cache? true,
        :default "Metabase",
        :name :site-name,
        :type :string,
        :sensitive? false,
        :tag java.lang.String,
        :namespace metabase.public-settings,
        :visibility :admin}}
      nil
      ```
      
      * Tests in ci are run from user
      
      * Appease eastwood; don't shadow function `setting-name`
      
      this pattern is exactly what the helpful protocol does. i actually
      wanted to call that protocol but it throws an error if it doesn't
      exist which is a bit much for our purposes
      
      * Move namespace name into setting information
      17ccd713
    • Paul Rosenzweig's avatar
    • Jeff Evans's avatar
      Only attempt to sync schemas that have some/any possible permissions (#15291) · e8c347b8
      Jeff Evans authored
      Only attempt to sync schemas that have some/any possible permissions
      
      Make syncable-schemas multimethod, whose base implementation is the same as the previous private fn
      
      Override syncable-schemas for Redshift to add a filtering step to the transducer pipeline to check for the schema privilege, by calling the HAS_SCHEMA_PRIVILEGE Redshift function to check for USAGE permission
      
      Making all-schemas function public since it's now invoked from the Redshift driver
      
      Fixing redshift-types-test to remove order flakiness
      
      Adding test that confirms that a real schemas with no permissions aren't synced
      e8c347b8
    • dpsutton's avatar
      Put schema forms in meta for schemas (#15325) · b7ca7e5d
      dpsutton authored
      ```clojure
      schema=> (->> (ns-publics 'metabase.mbql.schema)
                    (keep (fn [[s v]] (:clause-form (meta v))))
                    (run! pprint))
      
      [:not-null :field Field]
      [:interval :n s/Int :unit RelativeDatetimeUnit]
      [:regex-match-first :s StringExpressionArg :pattern s/Str]
      [:var :field-or-expression FieldOrExpressionDef]
      [:does-not-contain
       :field
       StringExpressionArg
       :string-or-field
       StringExpressionArg
       :options
       (optional StringFilterOptions)]
      [:= :field EqualityComparable :value-or-field EqualityComparable :more-values-or-fields (rest EqualityComparable)]
      [:log :x NumericExpressionArg]
      [:< :field OrderComparable :value-or-field OrderComparable]
      [:floor :x NumericExpressionArg]
      [:metric :metric-id (s/cond-pre helpers/IntGreaterThanZero helpers/NonBlankString)]
      [:ends-with :field StringExpressionArg :string-or-field StringExpressionArg :options (optional StringFilterOptions)]
      [:relative-datetime :n (s/cond-pre (s/eq :current) s/Int) :unit (optional RelativeDatetimeUnit)]
      [:sum :field-or-expression FieldOrExpressionDef]
      [:time-interval
       :field
       field
       :n
       (s/cond-pre s/Int (s/enum :current :last :next))
       :unit
       RelativeDatetimeUnit
       :options
       (optional TimeIntervalOptions)]
      [:rtrim :s StringExpressionArg]
      [:ceil :x NumericExpressionArg]
      [:starts-with :field StringExpressionArg :string-or-field StringExpressionArg :options (optional StringFilterOptions)]
      [:<= :field OrderComparable :value-or-field OrderComparable]
      [:upper :s StringExpressionArg]
      [:* :x NumericExpressionArg :y NumericExpressionArg :more (rest NumericExpressionArg)]
      [:min :field-or-expression FieldOrExpressionDef]
      [:inside
       :lat-field
       OrderComparable
       :lon-field
       OrderComparable
       :lat-max
       OrderComparable
       :lon-min
       OrderComparable
       :lat-min
       OrderComparable
       :lon-max
       OrderComparable]
      [:ltrim :s StringExpressionArg]
      [:desc :field FieldOrAggregationReference]
      [:contains :field StringExpressionArg :string-or-field StringExpressionArg :options (optional StringFilterOptions)]
      [:expression :expression-name helpers/NonBlankString]
      [:is-empty :field Field]
      [:substring :s StringExpressionArg :start NumericExpressionArg :length (optional NumericExpressionArg)]
      [:stddev :field-or-expression FieldOrExpressionDef]
      [:> :field OrderComparable :value-or-field OrderComparable]
      [:replace :s StringExpressionArg :match s/Str :replacement s/Str]
      [:sqrt :x NumericExpressionArg]
      [:concat :a StringExpressionArg :b StringExpressionArg :more (rest StringExpressionArg)]
      [:count-where :pred Filter]
      [:- :x NumericExpressionArg :y NumericExpressionArgOrInterval :more (rest NumericExpressionArgOrInterval)]
      [:asc :field FieldOrAggregationReference]
      [:cum-count :field (optional Field)]
      [:value :value s/Any :type-info (s/maybe ValueTypeInfo)]
      [:or
       :first-clause
       (s/recursive #'Filter)
       :second-clause
       (s/recursive #'Filter)
       :other-clauses
       (rest (s/recursive #'Filter))]
      [:exp :x NumericExpressionArg]
      [:time :time (s/cond-pre java.time.LocalTime java.time.OffsetTime) :unit TimeUnit]
      [:between :field OrderComparable :min OrderComparable :max OrderComparable]
      [:sum-where :field-or-expression FieldOrExpressionDef :pred Filter]
      [:not :clause (s/recursive #'Filter)]
      [:cum-sum :field-or-expression FieldOrExpressionDef]
      [:coalesce :a ExpressionArg :b ExpressionArg :more (rest ExpressionArg)]
      [:is-null :field Field]
      [:/ :x NumericExpressionArg :y NumericExpressionArg :more (rest NumericExpressionArg)]
      [:>= :field OrderComparable :value-or-field OrderComparable]
      [:not-empty :field Field]
      [:distinct :field-or-expression FieldOrExpressionDef]
      [:percentile :field-or-expression FieldOrExpressionDef :percentile NumericExpressionArg]
      [:round :x NumericExpressionArg]
      [:power :x NumericExpressionArg :y NumericExpressionArg]
      [:aggregation-options :aggregation UnnamedAggregation :options AggregationOptions]
      [:+ :x NumericExpressionArg :y NumericExpressionArgOrInterval :more (rest NumericExpressionArgOrInterval)]
      [:abs :x NumericExpressionArg]
      [:median :field-or-expression FieldOrExpressionDef]
      [:share :pred Filter]
      [:case :clauses CaseClauses :options (optional CaseOptions)]
      [:segment :segment-id (s/cond-pre helpers/IntGreaterThanZero helpers/NonBlankString)]
      [:max :field-or-expression FieldOrExpressionDef]
      [:!= :field EqualityComparable :value-or-field EqualityComparable :more-values-or-fields (rest EqualityComparable)]
      [:count :field (optional Field)]
      [:lower :s StringExpressionArg]
      [:length :s StringExpressionArg]
      [:trim :s StringExpressionArg]
      [:and
       :first-clause
       (s/recursive #'Filter)
       :second-clause
       (s/recursive #'Filter)
       :other-clauses
       (rest (s/recursive #'Filter))]
      [:avg :field-or-expression FieldOrExpressionDef]
      [:aggregation :aggregation-clause-index s/Int]
      nil
      schema=>
      ```
      b7ca7e5d
    • Nemanja Glumac's avatar
      Fix failing smoke tests in CI (#15461) · d95b8cae
      Nemanja Glumac authored
      d95b8cae
    • Nemanja Glumac's avatar
      Turn on `eslint-react/prop-types` rule and make it error out for new files (#15450) · fb3b85f7
      Nemanja Glumac authored
      * Switch the rule to "error"
      
      * Disable linting for `prop-types` in unit tests
      
      * Disable linting for `prop-types` in all affected files
      fb3b85f7
    • Nemanja Glumac's avatar
      Upgrade Cypress to v6.8.0 (latest) (#15451) · 4f7e5672
      Nemanja Glumac authored
      * Upgrade Cypress to v6.8.0 (latest)
      
      * Fix failing test in CI
      
      * Fix the problem where Cypress does not render Nav bar locally
      
      More info:
      - https://www.eliostruyf.com/tests-running-iframe-cypress-e2e-tests/
      - https://docs.cypress.io/faq/questions/using-cypress-faq#Is-there-any-way-to-detect-if-my-app-is-running-under-Cypress
      4f7e5672
    • Howon Lee's avatar
      flambers thing is a much better idea (#15428) · 855d07a3
      Howon Lee authored
      855d07a3
  3. Apr 01, 2021
  4. Mar 31, 2021
  5. Mar 30, 2021
  6. Mar 29, 2021
    • Luis Paolini's avatar
      Update common.clj (#15335) · 795c1729
      Luis Paolini authored
      795c1729
    • Dalton's avatar
      add string/number operator subtypes to dashboard parameter filters (#15068) · f10e9cf2
      Dalton authored
      
      * Remove location sub-categories
      
      These sub-categories are only for filtering the list of options
      when mapping a parameter filter to a field. Since we are introducing
      operator types as a sub-category of location, city/zip/etc. just get in
      the way.
      
      * add number section + number/string operator subtypes
      
      Light refactor of meta/Dashboard changes
      
      rmv 'all-options' options (for now)
      
      * add/update parameter type icons
      
      * pass operator to ParameterFieldWidget + show input per operator field
      
      * Add operator helper fns that aren't dependent on fields/tables
      
      * Make operator prop optional
      
      fix date filter err
      
      * add combined  name for native question filter widget type list
      
      Otherwise, a field that matches both "Location" and "Category"
      options will show duplicate "Starts with" options, etc. Now,
      that'll look like "Category - Starts with" and "Location - Starts with"
      
      * correct some unused prop/arg passing
      
      * Convert location/category parameter types to string for query
      
      location/category don't mean anything to BE but we use them for
      "reasons" on the FE. Reasons are legacy reliance on unique-ness of
      the parameter.type value, primarily.
      
      * operators in backend
      
      * Remove errant tap>
      
      * Docstrings and differing numbers in tests in some dbs
      
      * Make unary private so docstring checker ~shuts-up~ is satisfied
      
      * Don't parse arguments to operators params
      
      they were coming in just fine from the FE as numeric or string
      types. no need to ensure strings everywhere and parse here
      
      * add max-width to PopoverPicker
      
      * rmv unused value
      
      * use combinedName on dashboard parameters
      
      * fix parameter to mbql code
      
      * Ensure = operator filter popovers have no label
      
      This is to match "old" style of parameter popover
      
      * Update Cypress tests to reflect new parameter flow
      
      fix cypress dashboard parameter tests
      
      Fix more cy tests
      
      * Don't call fk/joinAlias on ExpressionDimension
      
      The methods don't exist on ExpressionDimension class.
      
      This doesn't make them work (yet), but it prevents the app
      from crashing.
      
      * Namespace doc and remove unnecessary comment
      
      * tap>-spy in dev
      
      * first pass at substitution of new operators in native
      
      * Docstring on wrap-value-literals-in-mbql to appease the gods
      
      * variadic equality operators (string/= number/=)
      
      * move functions out of component file
      
      * Pass parameter object to tag editor for use in default input
      
      We should inline this input eventually because it looks ugly.
      
      * map parameters in Questions to correct type
      
      * continue to pass janky fake parameter for text/number tags
      
      * mongo native substitution
      
      * variadic not-equals for string and number
      
      * Docstring and use correct function to make errors
      
      * add number/between dash param cy test
      
      * Update function name to better reflect behavior
      
      * Add unit tests for paramer/operator util fns
      
      add unit tests for parameter util functions
      
      add unit test for operator util fns
      
      * add variadic string 'is not' param operator option
      
      * Modify operator parameter display labels
      
      don't append 'matches exactly' to location/category parameters
      
      label tweaks
      
      Update cy tests to reference correct label name
      
      rmv it.only
      
      * Desugar mongo parameters mbql
      
      desugaring makes for a bit more verbose query but that's ok.This
      change was done to ensure that we negated regexes in a correct way,
      and to do so we always return the string version. This ensures that it
      can be json/generate-string'd for native parameters or left as
      datastructures and sent to monger
      
      * Cleanup stale comments and fixup docstring for consistency
      
      * Arglists metadata on defmulti and denude some threaded forms
      
      * add single arity number tag predicate to variable filter
      
      * add Location operators to fix parameter<->filter mapping
      
      For question filters to work we need for the new parameter operators
      to be supported by "location" fields in all areas of the app.
      
      * Don't show coords for param number widgets
      
      I don't think we want to support all the various number operators when
      dealing with coordinates, so in order to avoid that I'm preventing the
      mapping of number parameter operator to coord fields.
      
      * prevent mapping of tags to non-equal operators
      
      while possibly useful to end users, this needs more UI work on the
      native question side of things.
      
      * Ensure parameter values are wrapped in an array
      
      When an = operator is mapped to a field AND a tag, it ends up not being
      wrapped in an array due to the TextWidget (I think).
      
      ensure parameter value is an array
      
      ensure number params have an array value
      
      * Sort imports correctly
      
      clojure-lsp used to do this incorrectly (sorting `[` before `j`) and
      that has now been fixed
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      f10e9cf2
    • Dalton's avatar
      Add CollapseSection UI component (#15358) · f7bb82dd
      Dalton authored
      * Add CollapseSection component
      
      * Replace header string prop with header node prop
      
      * update nounage open/closed --> expanded/collapsed
      
      * add className prop
      f7bb82dd
    • Howon Lee's avatar
      Check to see if `done` button is enabled whenever custom expr changes (#15293) · bc92d8ca
      Howon Lee authored
      This is done by firing an event on change which mutates if blankness of the input changes
      bc92d8ca
    • Dalton's avatar
      add default param value selector (#15361) · 922b9036
      Dalton authored
      922b9036
  7. Mar 28, 2021
  8. Mar 27, 2021
Loading