Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
1fe85051
Unverified
Commit
1fe85051
authored
5 years ago
by
Paul Rosenzweig
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cover visualization with "mouse blocker" if dashboard is being edited (#10931)
parent
86d32bf3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/visualizations/components/CardRenderer.jsx
+17
-5
17 additions, 5 deletions
...d/src/metabase/visualizations/components/CardRenderer.jsx
with
17 additions
and
5 deletions
frontend/src/metabase/visualizations/components/CardRenderer.jsx
+
17
−
5
View file @
1fe85051
...
...
@@ -25,6 +25,8 @@ export default class CardRenderer extends Component {
series
:
PropTypes
.
array
.
isRequired
,
renderer
:
PropTypes
.
func
.
isRequired
,
onRenderError
:
PropTypes
.
func
.
isRequired
,
isEditing
:
PropTypes
.
bool
,
isDashboard
:
PropTypes
.
bool
,
};
_deregister
:
?
DeregisterFunction
;
...
...
@@ -59,7 +61,8 @@ export default class CardRenderer extends Component {
}
renderChart
()
{
if
(
this
.
props
.
width
==
null
||
this
.
props
.
height
==
null
)
{
const
{
width
,
height
,
isDashboard
,
isEditing
,
isSettings
}
=
this
.
props
;
if
(
width
==
null
||
height
==
null
)
{
return
;
}
...
...
@@ -69,15 +72,24 @@ export default class CardRenderer extends Component {
this
.
_deregisterChart
();
// reset the DOM:
let
element
=
parent
.
firstChild
;
if
(
element
)
{
parent
.
removeChild
(
element
);
for
(
const
child
of
parent
.
children
)
{
parent
.
removeChild
(
child
);
}
// create a new container element
element
=
document
.
createElement
(
"
div
"
);
const
element
=
document
.
createElement
(
"
div
"
);
parent
.
appendChild
(
element
);
if
(
isDashboard
&&
isEditing
&&
!
isSettings
)
{
// If this card is a dashboard that's currently being edited, we cover the
// content to prevent interaction with the chart. The !isSettings
// exception is to handle modals that appear above a dashboard.
const
mouseBlocker
=
document
.
createElement
(
"
div
"
);
mouseBlocker
.
classList
.
add
(
"
spread
"
);
mouseBlocker
.
style
.
setProperty
(
"
pointer-events
"
,
"
all
"
);
parent
.
appendChild
(
mouseBlocker
);
}
try
{
this
.
_deregister
=
this
.
props
.
renderer
(
element
,
this
.
props
);
}
catch
(
err
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment