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
0b36a7ec
Commit
0b36a7ec
authored
7 years ago
by
Atte Keinänen
Browse files
Options
Downloads
Patches
Plain Diff
Fix the issue with flashing 'Custom' option in NQF
parent
c2332dec
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/new_query/containers/NewQueryOptions.jsx
+4
-4
4 additions, 4 deletions
...end/src/metabase/new_query/containers/NewQueryOptions.jsx
with
4 additions
and
4 deletions
frontend/src/metabase/new_query/containers/NewQueryOptions.jsx
+
4
−
4
View file @
0b36a7ec
...
...
@@ -72,7 +72,7 @@ export class NewQueryOptions extends Component {
// util to check if the user has write permission to a db
const
hasSQLPermission
=
(
db
)
=>
db
.
native_permissions
===
"
write
"
// to be able to use SQL the user must have write perm
s
issions on at least one db
// to be able to use SQL the user must have write permissions on at least one db
const
showSQLOption
=
isAdmin
||
metadata
.
databasesList
().
filter
(
hasSQLPermission
).
length
>
0
// if we can only show one option then we should just redirect
...
...
@@ -107,7 +107,7 @@ export class NewQueryOptions extends Component {
render
()
{
const
{
query
,
metadataFetched
,
isAdmin
,
metricSearchUrl
}
=
this
.
props
const
{
showMetricOption
,
showSQLOption
}
=
this
.
state
const
showCustomInsteadOfNewQuestionText
=
showMetricOption
const
showCustomInsteadOfNewQuestionText
=
showMetricOption
||
isAdmin
if
(
!
query
||
(
!
isAdmin
&&
(
!
metadataFetched
.
metrics
||
!
metadataFetched
.
segments
)))
{
return
<
LoadingAndErrorWrapper
loading
=
{
true
}
/>
...
...
@@ -118,7 +118,7 @@ export class NewQueryOptions extends Component {
<
div
className
=
"wrapper wrapper--trim lg-wrapper--trim xl-wrapper--trim flex-full px1 mt4 mb2 align-center"
>
<
div
className
=
"flex align-center justify-center"
style
=
{
{
minHeight
:
"
100%
"
}
}
>
<
ol
className
=
"flex-full Grid Grid--guttersXl Grid--full sm-Grid--normal"
>
{
showMetricOption
&&
{
(
showMetricOption
||
isAdmin
)
&&
<
li
className
=
"Grid-cell"
>
<
NewQueryOption
image
=
"/app/img/questions_illustration"
...
...
@@ -138,7 +138,7 @@ export class NewQueryOptions extends Component {
to
=
{
this
.
getGuiQueryUrl
}
/>
</
li
>
{
showSQLOption
&&
{
(
showSQLOption
||
isAdmin
)
&&
<
li
className
=
"Grid-cell"
>
<
NewQueryOption
image
=
"/app/img/sql_illustration"
...
...
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