-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error if filter index pattern is missing #66979
Add error if filter index pattern is missing #66979
Conversation
}), | ||
}); | ||
valueLabel = this.props.intl.formatMessage({ | ||
errorMessage = valueLabel = this.props.intl.formatMessage({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notification was removed as it renders multiple times - showing the error message on the filter is clear enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested using steps from description. Dashboard is displayed and see error in filter 👍
One note: I was trying to fix broken filter from UI, it allowed me to take new existing index pattern, which is great. But is looks it didn't save changes, please see:
I think, if this is a quick fix, it worth fixing?
Also, I'd consider adding a test for this bug.
Maybe even a functional one,
I'd setup it the following way:
- Prepare a saved query with broken filter upfront (using API or esarchiver). (just do not click UI for this)
- Open any dashboard and apply the saved query
- Assert that dashboard is displayed
docs/development/plugins/data/public/kibana-plugin-plugins-data-public.baseformatterspublic.md
Outdated
Show resolved
Hide resolved
FYI, when tested noticed regression in master: #67003 |
I tried to reproduce "Empty/broken dashboard" in master using the steps from the description, but I still can see the dashboard. Just filter isn't working. Is there a way to get into state with empty dashboard? or it is not possible in Master? |
…ndex-pattern-filter
@Dosant I suspect that the reason you didn't see it update is because of a problem with the build system at the moment (it seems that plugins are built, but they are actually still building for a few mins after kibana seems to start). Also working on adding the test you requested and fixing the broken test as well. |
…/kibana into bug/missing-index-pattern-filter
@@ -93,6 +93,12 @@ export class IndexPatternsService { | |||
).savedObjects; | |||
} | |||
|
|||
getAll = async (refresh: boolean = false) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattkime what do you think of this?
* Filters may be applied from an index pattern other than the active index patterns list provided. | ||
* Retrieve the actual index pattern from the filter for validation. | ||
*/ | ||
getIndexPatterns() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get index patterns once in filter bar and pass them to each FilterItem
this.props.filter.meta.disabled ? 'disabled' : 'enabled' | ||
}`; | ||
const dataTestSubjPinned = `filter-${isFilterPinned(filter) ? 'pinned' : 'unpinned'}`; | ||
private isValidLabel(labelConfig: LabelOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke down the logic in this component to helper functions for easier debugging and reviewing
@Dosant validated that 7.8 works with the new |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* add error if filter index pattern is gone * docs change - why? * Fix i18n * Added a functional test for broken filters (field + index pattern) * Clarify readme * Moved readme * New warning status * Remove getAll * git pull upstream master * Fix translation files * Fix merge * added filterbar texts * disabled correction * Disable check in maps test until elastic#64861 is resolved * Fix tests, warning state is not disabled. * Adjust warning filter - ignore filters from "foreign" index pattern, that are still applicable * Add an additional unrelaeted filter test * Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss Co-authored-by: Caroline Horn <[email protected]> * Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss Co-authored-by: Caroline Horn <[email protected]> * Fixed test data * Revert mapping * Update data with missing test * Update test to match data * Code review Co-authored-by: Caroline Horn <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* add error if filter index pattern is gone * docs change - why? * Fix i18n * Added a functional test for broken filters (field + index pattern) * Clarify readme * Moved readme * New warning status * Remove getAll * git pull upstream master * Fix translation files * Fix merge * added filterbar texts * disabled correction * Disable check in maps test until #64861 is resolved * Fix tests, warning state is not disabled. * Adjust warning filter - ignore filters from "foreign" index pattern, that are still applicable * Add an additional unrelaeted filter test * Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss Co-authored-by: Caroline Horn <[email protected]> * Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss Co-authored-by: Caroline Horn <[email protected]> * Fixed test data * Revert mapping * Update data with missing test * Update test to match data * Code review Co-authored-by: Caroline Horn <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Caroline Horn <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* add error if filter index pattern is gone * docs change - why? * Fix i18n * Added a functional test for broken filters (field + index pattern) * Clarify readme * Moved readme * New warning status * Remove getAll * git pull upstream master * Fix translation files * Fix merge * added filterbar texts * disabled correction * Disable check in maps test until elastic#64861 is resolved * Fix tests, warning state is not disabled. * Adjust warning filter - ignore filters from "foreign" index pattern, that are still applicable * Add an additional unrelaeted filter test * Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss Co-authored-by: Caroline Horn <[email protected]> * Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss Co-authored-by: Caroline Horn <[email protected]> * Fixed test data * Revert mapping * Update data with missing test * Update test to match data * Code review Co-authored-by: Caroline Horn <[email protected]> Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json.gz
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
This fix didn't go into 7.8.1 |
Summary
Note: Commented out maps test - fix in #64861
See #67177 for full explanation.
Release Notes
This PR adds error and warning statuses to
FilterBar
filters, according to the following scenarios:Error state:
Warning state:
To reproduce
Error filter
Warning filter
The filter should appear in an error state
Checklist
Delete any items that are not applicable to this PR.
For maintainers