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
272d5994
Commit
272d5994
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Add tabs to FieldApp
parent
932351ae
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/admin/datamodel/containers/FieldApp.jsx
+100
-79
100 additions, 79 deletions
...tend/src/metabase/admin/datamodel/containers/FieldApp.jsx
with
100 additions
and
79 deletions
frontend/src/metabase/admin/datamodel/containers/FieldApp.jsx
+
100
−
79
View file @
272d5994
...
...
@@ -15,6 +15,7 @@ import InputBlurChange from "metabase/components/InputBlurChange";
import
Select
from
"
metabase/components/Select
"
;
import
SaveStatus
from
"
metabase/components/SaveStatus
"
;
import
Breadcrumbs
from
"
metabase/components/Breadcrumbs
"
;
import
Radio
from
"
metabase/components/Radio
"
;
import
ButtonWithStatus
from
"
metabase/components/ButtonWithStatus
"
;
import
MetabaseAnalytics
from
"
metabase/lib/analytics
"
;
...
...
@@ -72,6 +73,10 @@ const mapDispatchToProps = {
@
connect
(
mapStateToProps
,
mapDispatchToProps
)
export
default
class
FieldApp
extends
Component
{
state
=
{
tab
:
"
general
"
,
};
saveStatus
:
null
;
props
:
{
...
...
@@ -197,87 +202,103 @@ export default class FieldApp extends Component {
<
SaveStatus
ref
=
{
ref
=>
(
this
.
saveStatus
=
ref
)
}
/>
</
div
>
<
Section
>
<
FieldHeader
field
=
{
field
}
updateFieldProperties
=
{
this
.
onUpdateFieldProperties
}
updateFieldDimension
=
{
this
.
onUpdateFieldDimension
}
/>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Visibility`
}
description
=
{
t
`Where this field will appear throughout Metabase`
}
/>
<
FieldVisibilityPicker
triggerClasses
=
{
SelectClasses
}
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
/>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Type`
}
/>
<
SpecialTypeAndTargetPicker
triggerClasses
=
{
SelectClasses
}
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
idfields
=
{
idfields
}
selectSeparator
=
{
<
SelectSeparator
/>
}
/>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Filtering on this field`
}
description
=
{
t
`When this field is used in a filter, what should people use to enter the value they want to filter on?`
}
/>
<
Select
triggerClasses
=
{
SelectClasses
}
value
=
{
_
.
findWhere
(
has_field_values_options
,
{
value
:
field
.
has_field_values
,
})
}
onChange
=
{
option
=>
this
.
onUpdateFieldProperties
({
has_field_values
:
option
.
value
,
})
}
options
=
{
has_field_values_options
}
/>
</
Section
>
<
Section
>
<
FieldRemapping
field
=
{
field
}
table
=
{
table
}
fields
=
{
metadata
.
fields
}
updateFieldProperties
=
{
this
.
onUpdateFieldProperties
}
updateFieldValues
=
{
this
.
onUpdateFieldValues
}
updateFieldDimension
=
{
this
.
onUpdateFieldDimension
}
deleteFieldDimension
=
{
this
.
onDeleteFieldDimension
}
fetchTableMetadata
=
{
fetchTableMetadata
}
/>
</
Section
>
<
Section
>
<
UpdateCachedFieldValues
rescanFieldValues
=
{
()
=>
this
.
props
.
rescanFieldValues
(
field
.
id
)
}
discardFieldValues
=
{
()
=>
this
.
props
.
discardFieldValues
(
field
.
id
)
}
<
div
className
=
"border-bottom"
>
<
Radio
value
=
{
this
.
state
.
tab
}
onChange
=
{
tab
=>
this
.
setState
({
tab
})
}
options
=
{
[
{
name
:
t
`General`
,
value
:
"
general
"
},
{
name
:
t
`Formatting`
,
value
:
"
formatting
"
},
]
}
underlined
/>
</
Section
>
</
div
>
<
Section
>
<
ColumnSettings
value
=
{
(
field
&&
field
.
settings
)
||
{}
}
onChange
=
{
this
.
onUpdateFieldSettings
}
column
=
{
field
}
/>
</
Section
>
{
this
.
state
.
tab
===
"
formatting
"
?
(
<
Section
>
<
ColumnSettings
value
=
{
(
field
&&
field
.
settings
)
||
{}
}
onChange
=
{
this
.
onUpdateFieldSettings
}
column
=
{
field
}
/>
</
Section
>
)
:
(
<
div
>
<
Section
>
<
FieldHeader
field
=
{
field
}
updateFieldProperties
=
{
this
.
onUpdateFieldProperties
}
updateFieldDimension
=
{
this
.
onUpdateFieldDimension
}
/>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Visibility`
}
description
=
{
t
`Where this field will appear throughout Metabase`
}
/>
<
FieldVisibilityPicker
triggerClasses
=
{
SelectClasses
}
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
/>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Type`
}
/>
<
SpecialTypeAndTargetPicker
triggerClasses
=
{
SelectClasses
}
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
idfields
=
{
idfields
}
selectSeparator
=
{
<
SelectSeparator
/>
}
/>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Filtering on this field`
}
description
=
{
t
`When this field is used in a filter, what should people use to enter the value they want to filter on?`
}
/>
<
Select
triggerClasses
=
{
SelectClasses
}
value
=
{
_
.
findWhere
(
has_field_values_options
,
{
value
:
field
.
has_field_values
,
})
}
onChange
=
{
option
=>
this
.
onUpdateFieldProperties
({
has_field_values
:
option
.
value
,
})
}
options
=
{
has_field_values_options
}
/>
</
Section
>
<
Section
>
<
FieldRemapping
field
=
{
field
}
table
=
{
table
}
fields
=
{
metadata
.
fields
}
updateFieldProperties
=
{
this
.
onUpdateFieldProperties
}
updateFieldValues
=
{
this
.
onUpdateFieldValues
}
updateFieldDimension
=
{
this
.
onUpdateFieldDimension
}
deleteFieldDimension
=
{
this
.
onDeleteFieldDimension
}
fetchTableMetadata
=
{
fetchTableMetadata
}
/>
</
Section
>
<
Section
>
<
UpdateCachedFieldValues
rescanFieldValues
=
{
()
=>
this
.
props
.
rescanFieldValues
(
field
.
id
)
}
discardFieldValues
=
{
()
=>
this
.
props
.
discardFieldValues
(
field
.
id
)
}
/>
</
Section
>
</
div
>
)
}
</
div
>
</
div
>
)
}
...
...
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