Conversation
| const originFilters = this.state.originFilters?.filter((f) => f.key !== filter.key && !f.nonApplicable) ?? []; | ||
| const otherFilters = this.state.filters | ||
| .filter((f) => f.key !== filter.key && !f.nonApplicable) | ||
| .concat(originFilters); |
There was a problem hiding this comment.
we need to check in values too for non applicability, otherwise if we have some nonapplicable filters and search for values, nothing will come up because of that nonexistent label being set on the query
| * order, so duplicates with the same key+origin are matched positionally within | ||
| * their group rather than relying on global array ordering. | ||
| */ | ||
| export function buildApplicabilityMatcher(response: DrilldownsApplicability[]) { |
There was a problem hiding this comment.
I've been looking into a different way of more safely handling the returned applicability results. The API will return an array with the filter data and whether they are applicable or not, but there is nothing enforcing the backend to return the array in the same order as it was received. We used a map before with the assumption that there will be no 2 filters with the same key or origin which is what the map key was formed from.
I am experimenting with this map of queues which would better preserve two filters with the same key and no origin, for example, but would still depend on the ds returning the relative order of these 2 filters for example. PromDS would return the relative order properly, but there is no way to enforce it, this needs to be intentional.
With just a simple map we'd just lose one key along the way...
| const filtersApplicabilityEnabled = this._adhocFiltersVar?.state.applicabilityEnabled; | ||
| const groupByApplicabilityEnabled = this._groupByVar?.state.applicabilityEnabled; | ||
|
|
||
| if (!filtersApplicabilityEnabled && !groupByApplicabilityEnabled) { |
There was a problem hiding this comment.
this is basically the grafana FF check
📦 Published PR as canary version:
7.2.0--canary.1373.22762235062.0✨ Test out this PR locally via:
npm install @grafana/scenes@7.2.0--canary.1373.22762235062.0 npm install @grafana/scenes-react@7.2.0--canary.1373.22762235062.0 # or yarn add @grafana/scenes@7.2.0--canary.1373.22762235062.0 yarn add @grafana/scenes-react@7.2.0--canary.1373.22762235062.0