This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Jan 21, 2022
-
-
Alexander Lesnenko authored
* data-picker-empty-state * specs
-
Nemanja Glumac authored
-
Howon Lee authored
Static viz errors are of basically two kinds: 1. Someone futzed up their query, which we can't do anything about 2. We futzed up the rendering, which is our fault. Display those two errors differently.
-
Ariya Hidayat authored
-
Joe Bordes authored
-
Alexander Lesnenko authored
* SelectButton component and stories * update imports * specs * fix forwardRef * update select button usages for data modeling feature * remove custom enter press handlers * update specs * add outline * specs * specs * specs * specs
-
Alexander Polyankin authored
-
Alexander Polyankin authored
-
- Jan 20, 2022
-
-
Ariya Hidayat authored
We will fall back to the manual workaround of tweaking the commit timestamp.
-
Cam Saul authored
`add-alias-info`: recognize `:field` clauses in join source queries to be the same if it has a `:temporal-unit` (#19789) * Backport Debug QP improvements from #19754 * Enable test * "Fuzzy" matching when looking for Fields in join source queries * Add/update tests * Test fix
* Remove trailing whitespace * Fix a few docstrings -
Cam Saul authored
* Add whats new for driver authors in 0.42.0 [ci skip] * Apply suggestions from code review [ci skip] Co-authored-by:
Jeff Bruemmer <jeff@metabase.com> Co-authored-by:
Jeff Bruemmer <jeff@metabase.com>
-
Cam Saul authored
-
Cam Saul authored
* Postgres: avoid unnecessary casts of DATE or TIMESTAMPTZ to TIMESTAMP * Update src/metabase/util/honeysql_extensions.clj * Update test/metabase/driver/postgres_test.clj
-
Jeff Evans authored
* Add drive scope to BigQuery client Adding new drive auth scope in order to be able to query Google Drive files created in BigQuery as external tables Adding new test to confirm such a table can be queried successfully
-
Jeff Bruemmer authored
-
Cam Saul authored
* Don't add `:join-alias` to `:field` clauses for fields that came from source query's source table * Some test fixes
* Test fixes * Test fix * Test fix -
Cam Saul authored
* Add test for #7487 * Fix error message * Update test for new error message
-
Ariya Hidayat authored
-
Alexander Lesnenko authored
-
Anton Kulyk authored
* Use `display_name` for metadata completeness calc * Fix unit tests
-
Cam Saul authored
* The return of parallel tests * Cleanup
-
Cam Saul authored
* `partial=` * Diff improvements * Update test/metabase/test_runner/effects.clj
-
Alexander Polyankin authored
-
Alexander Lesnenko authored
-
Noah Moss authored
-
Anton Kulyk authored
-
Ariya Hidayat authored
-
Anton Kulyk authored
* Add function returning column type icon * Display column type icon in the results table * Add `left` prop to SelectButton * Display field type icon in SemanticTypePicker * Remove "three_dots" icon Replaced with "ellipsis" with background color * Add `fallback` arg to `getSemanticTypeIcon` * Switch to `getSemanticTypeIcon` * Fix `getSemanticTypeIcon`
-
Nemanja authored
-
Nemanja Glumac authored
Fixes the appearance of the main navbar while editing metadata.
-
Anton Kulyk authored
* RIP checksum Now that users can edit the metadata the checksum prevents that and would throw it away when edited. We'll treat the metadata as valid if it conforms. The UI isn't really expected to modify type information anyways. * Ns checker is a harsh disciplinarian * Extract `fields` variable in dataset editor * Allow extra onChange callback to form fields * Only show metadata sidebar when field is selected * Add onChange callback to semantic type picker * Add action for overwriting results metadata * Connect essential fields to form * display_name * description * semantic_type TBD: mapped database column for native datasets * Fix missing import * Fix sidebar inputs loosing focus while typing * Ensure focused field is in sync * Refactor FK and currency to be form fields * Use `field.settings` to keep formatting changes * Remove "display_as" from form definition * Connect remaining fields * Remove CurrencyPicker in favor of formatting input * Fix incomplete field metadata Results metadata doesn't contain everything we need for the editor. 'Global' metadata is the most complete, though it shouldn't be muted while in the editor, only once a user saves the changes Now we only keep focused field ref in state and derive the metadata by merging global metadata and query's results metadata. Query results metadata is mutated by the editor, so merging them both will do the job * Fix ViewSidebar prop type * Fix prop type warnings * Add default values for some fields * Connect MappedFieldPicker * Fix MappedFieldPicker closes after loading fields Sidebar dependant on IDFields was rerendering once additional metadata was loaded, causing DataSelector to unmount Fixed by moving IDFields subscription to FKTargetPicker directly (the only component that actually needs them) * Hide metadata popovers in dataset editor * Disable saving invalid dataset editor changes Disables "Save changes" button if: * there is at least one field with empty display name * the underlying query is empty * Add `onChangeSetting` prop to ColumnSettings The existing `onChange` passes the whole settings object as an argument. On the other hand, `onChangeSetting` passes only the changed setting which is useful for storing metadata diff * Keep field metadata diff in redux * Ignore column width reset events in metadata editor * Preserve metadata diff between query edits * A few important changes: - ensure that we don't throw away metadata and return an empty channel in the card api if the query hasn't changed - ensure api/dataset uses `:metadata/dataset-metadata` - hydrate fields on api/table/card__id/query_metadata so that it has target and fk information - preserve id so this information can be recovered† †: When a user enters an id we preserve it, but it also gets confusing if that's the actual field's id or the user-identified id. This is important when we drill down (and probably lots of other places too if they start assuming an id means they know exactly what is going on). A situation based on the orders table: Suppose you make a native question ```sql SELECT "PUBLIC"."ORDERS"."ID" AS "ID", "PUBLIC"."ORDERS"."USER_ID" AS "user_id_bro", -- note this is renamed "PUBLIC"."ORDERS"."PRODUCT_ID" AS "PRODUCT_ID", "PUBLIC"."ORDERS"."SUBTOTAL" AS "SUBTOTAL", "PUBLIC"."ORDERS"."TAX" AS "TAX", "PUBLIC"."ORDERS"."TOTAL" AS "TOTAL", "PUBLIC"."ORDERS"."DISCOUNT" AS "DISCOUNT", "PUBLIC"."ORDERS"."CREATED_AT" AS "CREATED_AT", "PUBLIC"."ORDERS"."QUANTITY" AS "QUANTITY" FROM "PUBLIC"."ORDERS" LIMIT 15 ``` In my db, the "USER_ID" column is field 3 and points at field 22. Our db knows that field 3 is called "USER_ID". But in the source query that column is actually called "user_id_bro". And lots of places assume that if there's a field's `:id` it knows what the name is. This is obviously incorrect here. It is a very important distinction that this column "is basically field 3 USER_ID" and this is literally the field "USER_ID". So if you do a drilldown based on this information, the FE will issue a query to "select field 3 from card__127" which expands to roughly "select USER_ID from (select ... USER_ID as user_id_bro ...)" and this query obviously will fail. * Don't put nil on a channel, clean ns i honestly don't know why the results-metadata and encrypt deps were there. I didn't add them but they just got caught in the linter for some reason. I don't understand it. * Update tests to include target and has_field_values * Correct final test * Select enough information for FK to work in UI * Pass mapped column's properties to BE * Qualify which semantic_type FK/PK we remove Previously always removed these semantic types. Now only remove when they do not have an id there. One thing I'm confused about though is that native fields should never have a semantic type anyways. There's no way for one to end up there, certainly not FK or PK right? So i want to delete this entire method because as I understand it it's not possible to trigger its conditions except for the new user-entered information, in which case we want to preserve it. But I have no idea why Mr. Chesterton built this function so I don't want to delete it. Bug reports and connecting them back to this change is so hard. Because it can be things like "native query with an aggregation named "blah" bucketed by month break when you drilldown into this column" and that's because it includes a semantic_type that breaks something. It's all very at-a-distance so hard to trace back to this. * Fix failed queries handling * Support custom column metadata editing * Hide empty sections in semantic type picker * Remove redundant import * Fetch database ID fields in FKTargetPicker * Allow aliasing EntityObjectLoader's entity prop * Reset DataSelector's state when ID props change * Fix MappedFieldPicker * Fixed saved question picker regression * Select description and settings when merging result_metadata Annotate columns allows for settings to be preserved from datasets. Example ```clojure ;; shows a little bar in the UI. quite nice :settings {:show_mini_bar true, :decimals 0}, ``` These settings were correctly preserved in annotate.clj but dropped in the final merging in result_metadata.clj. Fun times in metadata land * Let dataset revisions preserve metadata * Only wrap form fields with custom onChange handler This prevents form fields from extra re-renders * Fix summarize sidebar behavior * Fix e2e test * Update cypress expectations Previously expected really generic placeholder text in search boxes. But in `api/table/card__id/query_metadata` we hydrate native columns with `:has_field_values` so that when a user identifies an underlying field on datasets, we have extra information. This change comes about because the hydrate for `:has_field_values` doesn't hit the db and look for field values but uses a heuristic. And this heuristic works for native fields and finds that they are searchable because when they are text or textlike and improves the search bar. Code from models/field.clj below ```clojure (defn- is-searchable? "Is this `field` a Field that you should be presented with a search widget for (to search its values)? If so, we can give it a `has_field_values` value of `search`." [{base-type :base_type}] ;; For the time being we will consider something to be "searchable" if it's a text Field since the `starts-with` ;; filter that powers the search queries (see `metabase.api.field/search-values`) doesn't work on anything else (or (isa? base-type :type/Text) (isa? base-type :type/TextLike))) (defn- infer-has-field-values "Determine the value of `has_field_values` we should return for a `Field` As of 0.29.1 this doesn't require any DB calls! :D" [{has-field-values :has_field_values, :as field}] (or ;; if `has_field_values` is set in the DB, use that value; but if it's `auto-list`, return the value as `list` to ;; avoid confusing FE code, which can remain blissfully unaware that `auto-list` is a thing (when has-field-values (if (= (keyword has-field-values) :auto-list) :list has-field-values)) ;; otherwise if it does not have value set in DB we will infer it (if (is-searchable? field) :search :none))) (defn with-has-field-values "Infer what the value of the `has_field_values` should be for Fields where it's not set. See documentation for `has-field-values-options` above for a more detailed explanation of what these values mean." {:batched-hydrate :has_field_values} [fields] (for [field fields] (when field (assoc field :has_field_values (infer-has-field-values field))))) ``` * Ignore `has_field_values` for field literals Field literals are field using a column title instead of a numeric ID. They're usually coming from native or nested queries. Metadata propagation changes introduced for data models, made the BE send a guessed `has_field_values` property for field literals too. But searching through possible field values isn't properly supported yet and it's difficult to prevent `has_field_values` being sent to the FE, so this makes the FE ignore it for field literals * Fix E2E test * Fix field literal check * Ensure `:has_field_values` only goes on fields with ids when a user selects an id to back a native field, we want to hydrate the field_value information and the target info. But _ONLY_ when they have ids. The hydration for `:has_field_values` works on a heuristic, not by hitting the db and seeing if we have field values and will give information about native fields that do not have backing field information. * Ensure no annotations on numeric field ids we put the vector id on each field when there's no numeric id field. I have no idea why and the comment `;; TODO -- what????` explains the thinking there. So only annotate where we have numeric ids (fields that we know how to identify fields in the db) and not when we have a made up vector id * Revert changes to FieldValuesWidget * Fix character case * Show `has_field_values` selector when ID is known * Undo the testing for indiscriminant hydration previously had put target and has_field_values on every native field which doesn't work well for the UI. Had to clean up the remaining tests to no longer expect it * Select `:dataset` when creating a new question when duplicating a question, we send over this info and need to select it from the existing question. * Ensure card is saved with boolean dataset info largely just for testing which does not send a `:dataset false` property in some cases. In regular usage there should always be an initial value * Remove dead code * Replace TODO with a meaningful comment * Type Field type * Select only what we need on the source card Co-authored-by:
dan sutton <dan@dpsutton.com>
-
Anton Kulyk authored
* Forward form field ref * Focus "display_name" when selecting a new field * Hide query editor in metadata mode This will remove it from the "tab-flow" * Pass tabIndex prop to form text inputs * Add basic tab flow for metadata editor * Allow passing more props to SelectButton * Allow passing props to AccordionList's search input * Use numbers for tab indexes * Fix SelectButton's props type * Add special type picker to tab flow * Fix initial field focusing * Add "tab" icon * Add basic TabHintToast component * Show tab hint toast in metadata editor * Export wrapped CustomFormField * Forward SelectButton ref * Add react-virtualized scrollToColumn prop to Table * Don't open SemanticTypePicker on focus * Open SemanticTypePicker on "Enter" key press * Improve tabbing experience * automatically scroll the InteractiveTable while tabbing through columns * focus the first column on hitting "Enter" on the last column * Remove failed experiment It was my last hope to combine both props, but no lucj * Animate sidebar when focused field changes * Minor rename * Fix mapped field picker component * Pass visibility callbacks to trigger elements * Handle focus for mapped field picker * Pass searchPlaceholder to Select * Pass triggerable's onClose prop to Select * Add onClose prop to DataSelector * Use Select from special type picker * Handle focus for MappedFieldPicker * Add :focus style for essential select inputs * Fix jump from last to first column on tab key
-
Anton Kulyk authored
-
Anton Kulyk authored
* Convert SelectButton to TypeScript * Add onClick prop to SelectButton * Extract FormFieldDivider component * Pass dataset into field metadata sidebar * Add function to get field metadata form fields * Simplify field visibility options generation * Allow to provide custom form field widgets * Add `renderSearchSection` prop to AccordionList * Add SemanticTypePicker component * Use SemanticTypePicker * Add FieldSelector (DataSelector subset) * Allow hiding DataSelector trigger expand control * Add MappedFieldPicker component * Use MappedFieldPicker for native datasets * Simplify mapped field name formatting * Fix dataset type usage * Remove redundant props * Disable fuzzy search for SemanticTypePicker * Allow hiding empty AccordionList sections in search * Don't show empty sections in SemanticTypePicker * Add formatting section to field metadata form * Fix FormFieldDivider margin * Add FK target and currency pickers * Hide column title from formatting section * Wire up column formatting updates * Convert ChartSettingsWidget to TypeScript * Use styled-components for ChartSettingsWidget * Add "variant" prop to ChartSettingsWidget * Unify sidebar form UI * Fix hidden column settings are forcefully shown * Add "column type" field label * Fix ChartSettingsWidget label size in defaul mode * Use "radio" input for "view_as" field * Use "Text" instead of "Off" for view_as field * Use tab layout in field metadata sidebar * Hide Formatting tab if missing formatting opts * Fix hidden formatting fields behavior * Fix E2E test using renamed label * change view_as label to "Display as" * Remove divider from expanded semantic type picker * Move FormFieldDivider into sidebar's .styled file * Choose "view_as" widget depending on options count * use "radio" for exactly two options * use "select" when there are > 2 options * Change selected radio button look * Use "text-dark" in sidebar form * Set height for semantic type picker * Use Field's displayName method for formatting Co-authored-by:
Maz Ameli <maz@metabase.com>
-
Anton Kulyk authored
-
Anton Kulyk authored
* Add "Edit metadata" button * Add functions calculating metadata completeness * Add simple metadata completeness bar * Add animated percent label * Allow overwriting ProgressBar height * Decrease progress bar height * Allow using tippy `delay` prop for tooltips * Add tooltip for metadata indicator * Fix percent label position * Fix optional ProgressBar props * Allow customizing ProgressBar via styled components * Only show indication color on hover (except 50% progress) * Add basic tests for metadata indicator * Use "Customize metadata" button name * Fix percent label centering * slightly increase tooltip delay * slightly lower threshold for the 'some' text * Update UI assertions * Fix TypeScript errors * Fix percent rounding * Add useHover hook * Add transition style to ProgressBar * Don't compute indication color in CSS Co-authored-by:
Maz Ameli <maz@metabase.com>
-
Alexander Polyankin authored
-
- Jan 19, 2022
-
-
Cam Saul authored
* Better error messages on collection permissions errors * Test fixes
-
Dalton authored
* add balloons icon * add icon prop to semantic type metadata map * add functions for getting semantic type icon and name * update/rename DimensionLabel component * Fix unit tests * add tests for util fns * fix e2e tests reliant on old label
-
Cam Saul authored
* Add test for #15538 * Add extra validation for native source queries * Add test for sql-source-query validation
-