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
d5e10361
Unverified
Commit
d5e10361
authored
7 years ago
by
Kyle Doherty
Browse files
Options
Downloads
Patches
Plain Diff
hook up
parent
8103e379
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/admin/settings/components/SettingsXrayForm.jsx
+18
-17
18 additions, 17 deletions
...c/metabase/admin/settings/components/SettingsXrayForm.jsx
frontend/src/metabase/admin/settings/selectors.js
+8
-1
8 additions, 1 deletion
frontend/src/metabase/admin/settings/selectors.js
with
26 additions
and
18 deletions
frontend/src/metabase/admin/settings/components/SettingsXrayForm.jsx
+
18
−
17
View file @
d5e10361
...
...
@@ -6,23 +6,23 @@ import Icon from 'metabase/components/Icon'
import
COSTS
from
'
metabase/xray/costs
'
const
SettingsXrayForm
=
({
settings
,
elements
,
updateSetting
})
=>
<
div
>
<
div
className
=
"mx2"
>
<
h2
>
X-Rays and Comparisons
</
h2
>
</
div
>
const
SettingsXrayForm
=
({
settings
,
elements
,
updateSetting
})
=>
{
const
maxCost
=
Object
.
assign
({},
...
elements
.
filter
(
e
=>
e
.
key
===
'
xray-max-cost
'
,))
const
enabled
=
Object
.
assign
({},
...
elements
.
filter
(
e
=>
e
.
key
===
'
enable-xrays
'
,))
return
(
<
div
>
<
div
className
=
"mx2"
>
<
h2
>
X-Rays and Comparisons
</
h2
>
</
div
>
<
ol
className
=
"mt4"
>
{
elements
.
map
(
element
=>
<
ol
className
=
"mt4"
>
<
SettingsSetting
key
=
{
e
lement
.
key
}
setting
=
{
e
lement
}
updateSetting
=
{
updateSetting
}
key
=
{
e
nabled
.
key
}
setting
=
{
e
nabled
}
updateSetting
=
{
(
value
)
=>
updateSetting
(
enabled
,
value
)
}
/>
)
}
</
ol
>
</
ol
>
{
settings
[
'
xrays-enabled
'
]
&&
(
<
div
className
=
"mx2 text-measure"
>
<
h3
>
Maximum Cost
</
h3
>
<
p
className
=
"m0 text-paragraph"
>
...
...
@@ -35,10 +35,10 @@ const SettingsXrayForm = ({ settings, elements, updateSetting }) =>
<
li
className
=
{
cx
(
'
flex align-center mb2 cursor-pointer text-brand-hover
'
,
{
'
text-brand
'
:
settings
[
'
xray-
max
-c
ost
'
]
===
key
}
{
'
text-brand
'
:
max
C
ost
.
value
===
key
}
)
}
key
=
{
key
}
onClick
=
{
()
=>
updateSetting
()
}
onClick
=
{
()
=>
updateSetting
(
maxCost
,
key
)
}
>
<
Icon
className
=
"flex-no-shrink"
...
...
@@ -56,7 +56,8 @@ const SettingsXrayForm = ({ settings, elements, updateSetting }) =>
})
}
</
ol
>
</
div
>
)
}
</
div
>
</
div
>
)
}
export
default
SettingsXrayForm
This diff is collapsed.
Click to expand it.
frontend/src/metabase/admin/settings/selectors.js
+
8
−
1
View file @
d5e10361
...
...
@@ -372,7 +372,14 @@ const SECTIONS = [
{
key
:
"
enable-xrays
"
,
display_name
:
"
Enable X-Rays
"
,
type
:
"
boolean
"
type
:
"
boolean
"
,
allowValueCollection
:
true
},
{
key
:
"
xray-max-cost
"
,
type
:
"
string
"
,
allowValueCollection
:
true
}
]
}
...
...
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