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
8f5b35ea
Commit
8f5b35ea
authored
6 years ago
by
Maz Ameli
Browse files
Options
Downloads
Patches
Plain Diff
restyle FieldApp
parent
50b5c252
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/admin/datamodel/containers/FieldApp.jsx
+18
-28
18 additions, 28 deletions
...tend/src/metabase/admin/datamodel/containers/FieldApp.jsx
frontend/src/metabase/components/Select.jsx
+1
-1
1 addition, 1 deletion
frontend/src/metabase/components/Select.jsx
with
19 additions
and
29 deletions
frontend/src/metabase/admin/datamodel/containers/FieldApp.jsx
+
18
−
28
View file @
8f5b35ea
...
...
@@ -41,9 +41,6 @@ import { rescanFieldValues, discardFieldValues } from "../field";
import
{
has_field_values_options
}
from
"
metabase/lib/core
"
;
import
colors
from
"
metabase/lib/colors
"
;
const
SelectClasses
=
"
h3 bordered border-dark shadowed p2 inline-block flex align-center rounded text-bold
"
;
const
mapStateToProps
=
(
state
,
props
)
=>
{
return
{
databaseId
:
parseInt
(
props
.
params
.
databaseId
),
...
...
@@ -203,17 +200,17 @@ export default class FieldApp extends Component {
title
=
{
t
`Visibility`
}
description
=
{
t
`Where this field will appear throughout Metabase`
}
/>
<
FieldVisibilityPicker
triggerClasses
=
{
SelectClasses
}
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
/>
<
div
style
=
{
{
maxWidth
:
400
}
}
>
<
FieldVisibilityPicker
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
/>
</
div
>
</
Section
>
<
Section
>
<
SectionHeader
title
=
{
t
`Type`
}
/>
<
SectionHeader
title
=
{
t
`
Field
Type`
}
/>
<
SpecialTypeAndTargetPicker
triggerClasses
=
{
SelectClasses
}
field
=
{
field
.
getPlainObject
()
}
updateField
=
{
this
.
onUpdateField
}
idfields
=
{
idfields
}
...
...
@@ -227,7 +224,6 @@ export default class FieldApp extends Component {
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
,
})
}
...
...
@@ -322,7 +318,7 @@ export class FieldHeader extends Component {
return
(
<
div
>
<
InputBlurChange
className
=
"h
1
AdminInput bordered rounded border-dark block mb1"
className
=
"h
2
AdminInput bordered rounded border-dark block mb1"
value
=
{
this
.
props
.
field
.
display_name
}
onChange
=
{
this
.
onNameChange
}
placeholder
=
{
this
.
props
.
field
.
name
}
...
...
@@ -462,16 +458,14 @@ export class FieldValueMapping extends Component {
}
export
const
Section
=
({
children
})
=>
(
<
section
className
=
"my
3
"
>
{
children
}
</
section
>
<
section
className
=
"my
4 pb4 border-bottom
"
>
{
children
}
</
section
>
);
export
const
SectionHeader
=
({
title
,
description
})
=>
(
<
div
className
=
"
border-bottom py2
mb2"
>
<
h
2
className
=
"text-italic"
>
{
title
}
</
h
2
>
<
div
className
=
"mb2"
>
<
h
4
>
{
title
}
</
h
4
>
{
description
&&
(
<
p
className
=
"mb0 text-medium mt1 text-paragraph text-measure"
>
{
description
}
</
p
>
<
p
className
=
"mb0 text-medium mt1"
>
{
description
}
</
p
>
)
}
</
div
>
);
...
...
@@ -704,7 +698,6 @@ export class FieldRemapping extends Component {
description
=
{
t
`Choose to show the original value from the database, or have this field display associated or custom information.`
}
/>
<
Select
triggerClasses
=
{
SelectClasses
}
value
=
{
mappingType
}
onChange
=
{
this
.
onSetMappingType
}
options
=
{
this
.
getAvailableMappingTypes
()
}
...
...
@@ -716,18 +709,15 @@ export class FieldRemapping extends Component {
triggerElement
=
{
<
SelectButton
hasValue
=
{
hasFKMappingValue
}
className
=
{
cx
(
"
flex inline-block no-decoration h3 p2 shadowed
"
,
{
"
border-error
"
:
dismissedInitialFkTargetPopover
,
"
border-dark
"
:
!
dismissedInitialFkTargetPopover
,
},
)
}
className
=
{
cx
(
"
flex inline-block no-decoration
"
,
{
"
border-error
"
:
dismissedInitialFkTargetPopover
,
"
border-dark
"
:
!
dismissedInitialFkTargetPopover
,
})
}
>
{
fkMappingField
?
(
fkMappingField
.
display_name
)
:
(
<
span
className
=
"text-
light
"
>
{
t
`Choose a field`
}
</
span
>
<
span
className
=
"text-
medium
"
>
{
t
`Choose a field`
}
</
span
>
)
}
</
SelectButton
>
}
...
...
@@ -768,7 +758,7 @@ export class FieldRemapping extends Component {
export
const
RemappingNamingTip
=
()
=>
(
<
div
className
=
"bordered rounded p1 mt1 mb2 border-brand"
>
<
span
className
=
"text-brand text-bold"
>
{
t
`Tip:`
}
</
span
>
<
span
className
=
"text-brand text-bold"
>
{
t
`Tip:
`
}
</
span
>
{
t
`You might want to update the field name to make sure it still makes sense based on your remapping choices.`
}
</
div
>
);
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/components/Select.jsx
+
1
−
1
View file @
8f5b35ea
...
...
@@ -313,7 +313,7 @@ class LegacySelect extends Component {
<
div
className
=
{
cx
(
"
flex align-center
"
,
!
value
&&
(
!
values
||
values
.
length
===
0
)
?
"
text-
light
"
:
""
,
!
value
&&
(
!
values
||
values
.
length
===
0
)
?
"
text-
medium
"
:
""
,
)
}
>
{
values
&&
values
.
length
!==
0
?
(
...
...
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