This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Aug 15, 2023
-
-
Tim Macdonald authored
* Remove obsolete CLI flags for `export`; fix collection specification [Fixes #33168] * Allow comma-separated IDs
-
Cam Saul authored
-
Case Nelson authored
* Improve sql parameter mismatch error message It is possible to write native sql queries that try to hide parameters within comments or identifiers. Unfortunately PreparedStatement will almost always explode in these cases since you can only parameterize values in sql caluses. The error message of various drivers is quite poor, so we add a heuristic to look for these poor messages and replace it with a message prompting the user to look for a misuse of parameters. * Address review comments * Exclude drivers that do not support getParameterCount
-
Cam Saul authored
* Remove `:metabase.lib.*` keys from field refs when converting refs to legacy * Fix hardcoded database ID
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
metamben authored
Porting fix alias of joined column LHS of standard join conditions (#32987) * Check if the LHS has the alias of the current join before stripping its alias. * Remove dependent joins when removing a join
-
- Aug 14, 2023
-
-
Cam Saul authored
* Simplified impl. * Fix kondo errors * Cljs test fix
-
Alexander Polyankin authored
-
Tim Macdonald authored
* Search by table description [Fixes #25792]
-
Alexander Polyankin authored
-
- Aug 11, 2023
-
-
Nemanja Glumac authored
Fixes #33080
-
- Aug 10, 2023
-
-
Cam Saul authored
* Test metadata helper function consolidation * More code consolidation
-
lbrdnk authored
* Unify semicolon and comment handling in nested native queries * Use different comment and semicolon removal approach * Apply suggestions from code review Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com> * Update base and effective type verification for oracle * Avoid running test with snowflake and bigquery * Update `breakout-results` and test 1. In `breakout-results` case driver statement was redundant. Original code had field name and types hardcoded. During further examination, I've realized name and types are available thanks to the use of `qp.test/col`, so are just "unhardcoded" :) 2. `card-id-native-source-queries-test` is altered, so instead of hardcoding native sub-queries, roughly equivalent* mbql query is compiled and its native form is used. This way I can hopefully avoid problems with extraction of cloud databases' table names for testing purposes. * By roughly equivalent I mean instead of using * for selecting fields, mbql is compiled selecting fields explicitly. Also limit is added in some cases, but local testing showed no problems with that. --------- Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com>
-
lbrdnk authored
Modify `:contains`, `:starts-with` and `:ends-with` so field or expression can be used as the second argument (#32446) * Update `LIKE` to handle fields and expressions Previously only string could be used with like clause, ie. as second argument of `:starts-with`, `:ends-with` or `:contains`. This commit modifies translation of those functions, so fields or expressions can be used in place of second argument. * Make only expression or field args use `concat` Using concat with values unnecessarily complects generated sql. * Update tests * Extend mongo string matching capabilities Make mongo filter compilation use `$regexMatch` for `:contains`, `:starts-with` and `:ends-with` so expressions and fields can be matched against. * Adjust mongo specific tests * Update druid Druid's filters work with `:contains`, `:starts-with` and `:ends-with`, but only if second argument is literal pattern. This commit updates existing code, so expection is thrown if `pattern` has different form than `[:value ...]`. * Address review comments - sql * Address review comments - mongo * Use mbql `:concat` instead of `hx/call :concat` Vertica, orcacle and sqlite handle concat differently than other drivers. To overcome this limitation, `pre`, `post` and `arg` are wrapped into mbql's concat expression which is then translated with regards to the specifics of particular driver. * Update according to the review feedback --------- Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com>
-
- Aug 09, 2023
- Aug 08, 2023
-
-
Ngoc Khuat authored
-
- Aug 07, 2023
-
-
Tim Macdonald authored
* Fully hydrate PUT-ed collections, which the FE depends on [Fixes #30235] * Add repro test for #30235 * Set token features properly --------- Co-authored-by:
Denis Berezin <denis.berezin@metabase.com>
-
- Aug 06, 2023
-
-
Cam Saul authored
* QP: use Malli * Fix schema names * Fix missing namespaces * Fix busted stuff * Simplify the new schema * Test fix
* Test fixes * MongoDB fixes * FAST mu/defn * Malli registry * Misc fixes * Some cleanup * Misc cleanup and test fixes * mu/disable-enforcement * Test fix * Fix Cljs version of `disable-enforcement` * Misc improvements * Update tests * Fix Kondo warnings * Fix Kondo warnings * Fix busted Malli schema * PR feedback * Fix busted schema * Kondo fixx * Test fixes * Use Malli version of `describe` now that PR was merged * Work around https://github.com/metosin/malli/issues/924 * Test fixes * Improvements * Test fix -
Cam Saul authored
-
- Aug 04, 2023
-
-
Case Nelson authored
* [MLv2] Add function to sync join-condition temporal bucketing options * Return the modified join-condition instead of the whole query * Adding tests * Fix linter
-
- Aug 03, 2023
-
-
Cam Saul authored
* Prevent malicious H2 connection string properties * Disallow new H2 connections * Prevent mismatches between engine and details (#151) Co-authored-by:
Cam Saul <github@camsaul.com> * Fix Kondo lint warning * Test fix
* Fix E2E tests in `setup` spec * Fix E2E tests in `add-new-database` spec * Improved test --------- Co-authored-by:dan sutton <dan@dpsutton.com> Co-authored-by:
Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
-
Jerry Huang authored
* replace nils initial code * add test
-
Cal Herries authored
-
Cam Saul authored
* Migrate collection and permissions namespaces to Malli * Fix docstring * Fix Kondo warnings
-
Cam Saul authored
* FAST mu/defn * Malli registry * Misc fixes * Some cleanup * Misc cleanup and test fixes
* mu/disable-enforcement * Test fix * Fix Cljs version of `disable-enforcement` -
Ngoc Khuat authored
-
Noah Moss authored
* get rid of backfill query for user-recent-views * clean ns
-
Vamsi Peri authored
* Use the custom qualified-name function to retain the slash in the name * qualified the name in the error message as well * Added a test case
-
- Aug 02, 2023
-
-
Cam Saul authored
* `join-condition-lhs-display-name` should use join condition LHS * Revert testing context changes * Appease the whitespace linter
-
Cam Saul authored
-
Jesse Devaney authored
* add parameter mapping to heading cards * update unit tests for new props * memoize parameter mapped content * add heading card tests to text parameters spec * update test descriptions * add BE for params/substitute_tags * fix tests * fix test * update FE parameter substitution to use optional flag * heading cards should not escape characters * add test for dashboard sub * remove invalid specs -> desired behavior changed - enabled parameter mapping for heading cards - in parameter editing mode, we should display the option to map a parameter to a heading text variable, so we should not display the original text * fix react hook dependencies * improve parameterValues type * refactor E2E test to a unit test * address nits * fix spacing * update types and add unit tests * fix type errors --------- Co-authored-by:
Jerry Huang <jhuang37050@gmail.com>
-
Cam Saul authored
-
Braden Shepherdson authored
Fixes #32575
-
Kamil Mielnik authored
* Add actions dropdown to object detail modal (#32331) * Rename showActions to showControls * Use Flex * Import Flex from local modules * Make horizontalAttachments a prop in EntityMenu * Use EntityMenu to create actions dropdown * Render actions menu conditionally * Add useActionListQuery * Fetch actions in ObjectDetailHeader * Remove unused canRunActions prop * Move logic to root component * Fix tests * Use canRunAction and fetch databases in ObjectDetail view * Rename actions to actionItems and getActions to getActionItems * Extract getActionItems to utils * Update tests * Rename modelActions to actions * Extract isValidImplicitDeleteAction and isValidImplicitUpdateAction out of getActionItems * Consolidate getActionItems * Use theme scale values for Mantine Flex component * Either render all controls or none * Fix default props/state in EntityMenu * Fix props * Update ObjectDetail unit tests * Add unit tests for isValidImplicitDeleteAction and isValidImplicitUpdateAction * Update tests with more specific non-implicit action cases * Use singular form to match function interface * Add unit tests for getActionItems * Update test case name * Avoid using Database constructor - Use metadata.database() instead * Add integration tests for basic cases when action menu is rendered and not * Fix post-merge error * Endpoint to fetch implicit actions param values (#32466) * Add default update action to actions dropdown in object detail modal (#32433) * Rename showActions to showControls * Use Flex * Import Flex from local modules * Make horizontalAttachments a prop in EntityMenu * Use EntityMenu to create actions dropdown * Render actions menu conditionally * Add useActionListQuery * Fetch actions in ObjectDetailHeader * Remove unused canRunActions prop * Move logic to root component * Fix tests * Use canRunAction and fetch databases in ObjectDetail view * Rename actions to actionItems and getActions to getActionItems * Extract getActionItems to utils * Update tests * Rename modelActions to actions * Extract isValidImplicitDeleteAction and isValidImplicitUpdateAction out of getActionItems * Consolidate getActionItems * Use theme scale values for Mantine Flex component * Either render all controls or none * Fix default props/state in EntityMenu * Fix props * Update ObjectDetail unit tests * Add unit tests for isValidImplicitDeleteAction and isValidImplicitUpdateAction * Update tests with more specific non-implicit action cases * Use singular form to match function interface * Add unit tests for getActionItems * Update test case name * Sort imports * Rename initialValues to values * Rename dashcardParamValues to initialValues * Lift fetchInitialValues up from ActionParametersInputForm * Rename refetchValues to prefetchValues * Fix tests * Refactor shouldPrefetch to be a prop * Get rid of dashboard and dashcard props from ActionParametersInputForm * Lift the canPrefetch condition up as it is not desired outside of dashboards * Hook update action with temporary API * Use executeActionId in fetchInitialValues * Fix post-merge conflict * Rename prefetchValues to prefetchDashcardValues * Use the new endpoint * Use rem values instead of scale values - See https://github.com/metabase/metabase/pull/32331#discussion_r1267827835 * Lift data reloading out of executeRowAction * Add onSuccess prop to ActionExecuteModal * Use onSubmitSuccess from ActionParametersInputForm * Reload question after action is successful * Fix stale prop issues in ActionParametersInputForm * Fix object id in initialValues * Add prefetchesInitialValues prop to make useActionForm more generic * Ignore public actions for now * Fix id mixup * Update unit test * Remove redundant memoization * Use modern JS syntax instead of noop * Move getNextId to __support__/utils * Extract isImplicitDeleteAction & isImplicitUpdateAction * Reuse isImplicitDeleteAction * Log error to console * Get rid of useLatest * Fix post-merge build error * Add default delete action to actions dropdown in object detail modal (#32556) * Rename showActions to showControls * Use Flex * Import Flex from local modules * Make horizontalAttachments a prop in EntityMenu * Use EntityMenu to create actions dropdown * Render actions menu conditionally * Add useActionListQuery * Fetch actions in ObjectDetailHeader * Remove unused canRunActions prop * Move logic to root component * Fix tests * Use canRunAction and fetch databases in ObjectDetail view * Rename actions to actionItems and getActions to getActionItems * Extract getActionItems to utils * Update tests * Rename modelActions to actions * Extract isValidImplicitDeleteAction and isValidImplicitUpdateAction out of getActionItems * Consolidate getActionItems * Use theme scale values for Mantine Flex component * Either render all controls or none * Fix default props/state in EntityMenu * Fix props * Update ObjectDetail unit tests * Add unit tests for isValidImplicitDeleteAction and isValidImplicitUpdateAction * Update tests with more specific non-implicit action cases * Use singular form to match function interface * Add unit tests for getActionItems * Update test case name * Sort imports * Rename initialValues to values * Rename dashcardParamValues to initialValues * Lift fetchInitialValues up from ActionParametersInputForm * Rename refetchValues to prefetchValues * Fix tests * Refactor shouldPrefetch to be a prop * Get rid of dashboard and dashcard props from ActionParametersInputForm * Lift the canPrefetch condition up as it is not desired outside of dashboards * Hook update action with temporary API * Use executeActionId in fetchInitialValues * Fix post-merge conflict * Rename prefetchValues to prefetchDashcardValues * Use the new endpoint * Use rem values instead of scale values - See https://github.com/metabase/metabase/pull/32331#discussion_r1267827835 * Lift data reloading out of executeRowAction * Add onSuccess prop to ActionExecuteModal * Use onSubmitSuccess from ActionParametersInputForm * Reload question after action is successful * Fix stale prop issues in ActionParametersInputForm * Fix object id in initialValues * Add prefetchesInitialValues prop to make useActionForm more generic * Ignore public actions for now * Fix id mixup * Update unit test * Add DeleteObjectModal * Introduce useActionQuery * Use useActionQuery in DeleteObjectModal * Hook action execution * Fix typo in copy * Sort exports * Remove redundant memoization * Use modern JS syntax instead of noop * Move getNextId to __support__/utils * Extract isImplicitDeleteAction & isImplicitUpdateAction * Reuse isImplicitDeleteAction * Fix object modal getting closed with Escape key when delete or update modals are open * Rename isUpdateModalOpen to isActionExecuteModalOpen, updateActionId to actionId * Navigate to sibling row or close the modal on deletion * Revert "Navigate to sibling row or close the modal on deletion" This reverts commit 8b24685eee5cd968f53cc14b7194a66588fb5845. * Close object detail on deletion * Add error handling * Add error handling * Greatly simplify DeleteObjectModal - remove useActionQuery usage - remove useActionQuery - remove DeleteObjectModal.styled.tsx * Improve diff * Shorten code * Always cast objectId to number - See https://metaboat.slack.com/archives/C057T1QTB3L/p1690292706101109?thread_ts=1690279562.697669&cid=C057T1QTB3L "the reason you’re not seeing it fail on the sample dataset is probably because you’re using h2 for sample-dataset. it’ll fail the same if you use a postgres one. h2 is probably more loose in type so it allows sending a string for id. nevertheless, I think you can use cast it to the correct type using the param type. I think we did that on the UI where we execute actions from model details page." * Inline disabled into JSX * Use a more friendly error message when failed to delete an object because it's referenced by other objects - See: https://metaboat.slack.com/archives/C057LE0Q4PQ/p1690377421352469?thread_ts=1690208614.530869&cid=C057LE0Q4PQ * Revert "Use a more friendly error message when failed to delete an object because it's referenced by other objects" This reverts commit 28327ac9b53ae92300e579d047b7f136d54e581e. Friendly message is going to be implemented in https://github.com/metabase/metabase/issues/32694 * Rename initialValues back to dashcardParamValues in ActionVizForm * Tests for basic deletes and updates on object detail views (#32525) * Rename showActions to showControls * Use Flex * Import Flex from local modules * Make horizontalAttachments a prop in EntityMenu * Use EntityMenu to create actions dropdown * Render actions menu conditionally * Add useActionListQuery * Fetch actions in ObjectDetailHeader * Remove unused canRunActions prop * Move logic to root component * Fix tests * Use canRunAction and fetch databases in ObjectDetail view * Rename actions to actionItems and getActions to getActionItems * Extract getActionItems to utils * Update tests * Rename modelActions to actions * Extract isValidImplicitDeleteAction and isValidImplicitUpdateAction out of getActionItems * Consolidate getActionItems * Use theme scale values for Mantine Flex component * Either render all controls or none * Fix default props/state in EntityMenu * Fix props * Update ObjectDetail unit tests * Add unit tests for isValidImplicitDeleteAction and isValidImplicitUpdateAction * Update tests with more specific non-implicit action cases * Use singular form to match function interface * Add unit tests for getActionItems * Update test case name * Sort imports * Rename initialValues to values * Rename dashcardParamValues to initialValues * Lift fetchInitialValues up from ActionParametersInputForm * Rename refetchValues to prefetchValues * Fix tests * Refactor shouldPrefetch to be a prop * Get rid of dashboard and dashcard props from ActionParametersInputForm * Lift the canPrefetch condition up as it is not desired outside of dashboards * Hook update action with temporary API * Use executeActionId in fetchInitialValues * Fix post-merge conflict * Rename prefetchValues to prefetchDashcardValues * Use the new endpoint * Use rem values instead of scale values - See https://github.com/metabase/metabase/pull/32331#discussion_r1267827835 * Lift data reloading out of executeRowAction * Add onSuccess prop to ActionExecuteModal * Use onSubmitSuccess from ActionParametersInputForm * Reload question after action is successful * Fix stale prop issues in ActionParametersInputForm * Fix object id in initialValues * Add prefetchesInitialValues prop to make useActionForm more generic * Add test cases for other types of actions * Ignore public actions for now * Add e2e test for actions in object detail view * Add second step and extract helpers * Remove duplication by changing hierarchy * Add step with enabling model actions * Fix visiting model page * Remove redundant code * Ignore public actions for now * Fix id mixup * Update unit test * Add objectId argument and function to open the modal * Define whole order object to reuse * Implement assertOrderFormPrefilled * Assert Created At * Add assertion to check whether object with new id has been reloaded * Use all caps for constants * Verify updating an object * Fix test name * Assert toast is shown on update * Format code * Use writable tables instead of sample db to avoid persisting updates between tests - do not mock objects, assert against whatever comes from API * Format code to wake GitHub up * Add DeleteObjectModal * Introduce useActionQuery * Use useActionQuery in DeleteObjectModal * Hook action execution * Fix typo in copy * Sort exports * Remove redundant memoization * Use modern JS syntax instead of noop * Move getNextId to __support__/utils * Extract isImplicitDeleteAction & isImplicitUpdateAction * Reuse isImplicitDeleteAction * Fix object modal getting closed with Escape key when delete or update modals are open * Rename isUpdateModalOpen to isActionExecuteModalOpen, updateActionId to actionId * Navigate to sibling row or close the modal on deletion * Revert "Navigate to sibling row or close the modal on deletion" This reverts commit 8b24685eee5cd968f53cc14b7194a66588fb5845. * Close object detail on deletion * Add error handling * Add error handling * Greatly simplify DeleteObjectModal - remove useActionQuery usage - remove useActionQuery - remove DeleteObjectModal.styled.tsx * Improve diff * Shorten code * Rename initialValues back to dashcardParamValues in ActionVizForm * Extract assertScoreUpdatedInTable * Extract visitModelDetail * Add deletion and toast assertion * Remove unused arguments * Assert delete failed * Update tests order after starting with writable db * Move assertions to beginning of the test, remove enableDatabaseActions * Test disabling model actions * Add extra assertion * Update names * Update the deletion assertion * Remove unused code * Wrap tests in another describe, setup dashboard test * Fix setup, use asAdmin util * Add assertion for dashboard object view * Update test names * Extract actions to a constant * Add test to open update object modal * Update assertion order * Add test to open delete object modal * Organize tests * Add a test case for implicit public delete action & implicit archived delete action * Remove redundant async * Reuse findActionInActionMenu * Remove redundant constant * Fix tests * Add a test case for databases with disabled actions * Update wording * Use dataset instad of a query question * Revert name change as it does not make sense * Format code * Add a test case for users with no write permission * Add a test case for when showControls is false * Add a test case for models with clauses * Use metadata.question() instead of new Question() * Tests for various number of PKs in a model (#32784) * Add a test case for 0 PKs in a model * Add a test case for 2 PKs in a model * Improve test names * Fix typo * Use plural form for "PK" --------- Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com>
-
Ngoc Khuat authored
-
Braden Shepherdson authored
These are "porcelain" APIs to make FE management of the set of selected columns for a query much easier. `add-field` and `remove-field` will handle regular table fields, explicit join fields, and custom expressions correctly. One known quirk: if the set of `:fields` on a stage happens to match the default set, this is *not* noticed or fixed. Once an explicit list is set on a stage, it will forever have a list.
-