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
925e3c43
Unverified
Commit
925e3c43
authored
2 years ago
by
Maz Ameli
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make it clearer you're creating a new question when saving (#26048)
* make it clearer you're creating a new question * fix the function
parent
78d506c5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/containers/SaveQuestionModal.jsx
+14
-5
14 additions, 5 deletions
frontend/src/metabase/containers/SaveQuestionModal.jsx
frontend/test/metabase/scenarios/native/native-mongo.cy.spec.js
+6
-4
6 additions, 4 deletions
...nd/test/metabase/scenarios/native/native-mongo.cy.spec.js
with
20 additions
and
9 deletions
frontend/src/metabase/containers/SaveQuestionModal.jsx
+
14
−
5
View file @
925e3c43
...
...
@@ -14,6 +14,16 @@ import { generateQueryDescription } from "metabase-lib/queries/utils/description
import
"
./SaveQuestionModal.css
"
;
const
getSingleStepTitle
=
(
questionType
,
showSaveType
)
=>
{
if
(
questionType
===
"
model
"
)
{
return
t
`Save model`
;
}
else
if
(
showSaveType
)
{
return
t
`Save question`
;
}
else
{
return
t
`Save new question`
;
}
};
export
default
class
SaveQuestionModal
extends
Component
{
static
propTypes
=
{
card
:
PropTypes
.
object
.
isRequired
,
...
...
@@ -104,17 +114,16 @@ export default class SaveQuestionModal extends Component {
?
t
`First, save your question`
:
t
`First, save your model`
;
const
singleStepTitle
=
questionType
===
"
question
"
?
t
`Save question`
:
t
`Save model`
;
const
title
=
this
.
props
.
multiStep
?
multiStepTitle
:
singleStepTitle
;
const
showSaveType
=
!
card
.
id
&&
!!
originalCard
&&
!
originalCard
.
dataset
&&
originalCard
.
can_write
;
const
singleStepTitle
=
getSingleStepTitle
(
questionType
,
showSaveType
);
const
title
=
this
.
props
.
multiStep
?
multiStepTitle
:
singleStepTitle
;
const
nameInputPlaceholder
=
questionType
===
"
question
"
?
t
`What is the name of your question?`
...
...
This diff is collapsed.
Click to expand it.
frontend/test/metabase/scenarios/native/native-mongo.cy.spec.js
+
6
−
4
View file @
925e3c43
...
...
@@ -21,9 +21,11 @@ describe("scenarios > question > native > mongo", { tags: "@external" }, () => {
});
it
(
"
can save a native MongoDB query
"
,
()
=>
{
cy
.
get
(
"
.ace_content
"
).
type
(
`[ { $count: "Total" } ]`
,
{
parseSpecialCharSequences
:
false
,
});
cy
.
get
(
"
.ace_content
"
)
.
should
(
"
be.visible
"
)
.
type
(
`[ { $count: "Total" } ]`
,
{
parseSpecialCharSequences
:
false
,
});
cy
.
get
(
"
.NativeQueryEditor .Icon-play
"
).
click
();
cy
.
wait
(
"
@dataset
"
);
...
...
@@ -32,7 +34,7 @@ describe("scenarios > question > native > mongo", { tags: "@external" }, () => {
cy
.
findByText
(
"
Save
"
).
click
();
cy
.
findByTextEnsureVisible
(
"
Save question
"
);
cy
.
findByTextEnsureVisible
(
"
Save
new
question
"
);
modal
().
within
(()
=>
{
cy
.
findByLabelText
(
"
Name
"
).
clear
().
should
(
"
be.empty
"
).
type
(
"
mongo count
"
);
...
...
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