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
fd15f62d
Commit
fd15f62d
authored
5 years ago
by
Paul Rosenzweig
Committed by
Kyle Doherty
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Close modal when unmounting QB (#11707)
* close modal when unmounting QB * add test
parent
fea20a40
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/query_builder/containers/QueryBuilder.jsx
+2
-0
2 additions, 0 deletions
...nd/src/metabase/query_builder/containers/QueryBuilder.jsx
frontend/test/metabase/scenarios/query_builder.cy.spec.js
+23
-0
23 additions, 0 deletions
frontend/test/metabase/scenarios/query_builder.cy.spec.js
with
25 additions
and
0 deletions
frontend/src/metabase/query_builder/containers/QueryBuilder.jsx
+
2
−
0
View file @
fd15f62d
...
...
@@ -218,6 +218,8 @@ export default class QueryBuilder extends Component {
window
.
removeEventListener
(
"
resize
"
,
this
.
handleResize
);
clearTimeout
(
this
.
timeout
);
this
.
closeModal
();
// close any modal that might be open
}
// When the window is resized we need to re-render, mainly so that our visualization pane updates
...
...
This diff is collapsed.
Click to expand it.
frontend/test/metabase/scenarios/query_builder.cy.spec.js
+
23
−
0
View file @
fd15f62d
...
...
@@ -133,6 +133,29 @@ describe("query builder", () => {
.
should
(
"
not.exist
"
);
});
});
describe
(
"
resetting state
"
,
()
=>
{
it
(
"
should reset modal state when navigating away
"
,
()
=>
{
// create a question and add it to a modal
loadOrdersTable
();
cy
.
contains
(
"
Save
"
).
click
();
cy
.
get
(
"
.ModalContent
"
)
.
contains
(
"
button
"
,
"
Save
"
)
.
click
();
cy
.
contains
(
"
Yes please!
"
).
click
();
cy
.
contains
(
"
Orders over time
"
).
click
();
// create a new question to see if the "add to a dashboard" modal is still there
cy
.
contains
(
"
Browse Data
"
).
click
();
cy
.
contains
(
"
Sample Dataset
"
).
click
();
cy
.
contains
(
"
Orders
"
).
click
();
// This next assertion might not catch bugs where the modal displays after
// a quick delay. With the previous presentation of this bug, the modal
// was immediately visible, so I'm not going to add any waits.
cy
.
contains
(
"
Add this question to a dashboard
"
).
should
(
"
not.exist
"
);
});
});
});
function
loadOrdersTable
()
{
...
...
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