Repository navigation
fix: keep if conditions when moving a canvas item across containers - #10041
Closed
nishantmonu51 wants to merge 1 commit into
Closed
nishantmonu51 wants to merge 1 commit into
nishantmonu51 wants to merge 1 commit into
Conversation
Dragging a canvas item into another tab, out of a tab group, or into the top-level rows goes through `moveItemAcrossContainers`, which spliced the raw YAML item into the destination without reading the `if` conditions of the source tab group, tab or row. The moved item lost the visibility it inherited and became visible to every viewer; in embeds and public URLs restricted to the canvas, its metrics view also became queryable. Fold the source container's conditions that the destination doesn't already apply into the item's own `if`, mirroring what the same-container move and `deleteTab` already do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
moveItemAcrossContainersspliced the raw YAML item into the destination without reading theifof the source tab group, tab or row, so an item dragged into another tab, out of a tab group or onto the top-level rows became visible to every viewer. In embeds and public URLs restricted to the canvas, its metrics view became queryable too.if, as the same-container move anddeleteTabalready do.Steps to reproduce:
if: '{{ has "finance" .user.groups }}'and add a KPI.if, and "View as" a user outsidefinanceshows it.Introduced by #10006. Not present in 0.90.
Checklist: