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
a6a2f37f
Commit
a6a2f37f
authored
7 years ago
by
Simon Belak
Browse files
Options
Downloads
Patches
Plain Diff
Fix identation
parent
e26018ff
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/lib/core.js
+200
-160
200 additions, 160 deletions
frontend/src/metabase/lib/core.js
with
200 additions
and
160 deletions
frontend/src/metabase/lib/core.js
+
200
−
160
View file @
a6a2f37f
import
{
TYPE
}
from
"
metabase/lib/types
"
;
import
{
t
}
from
"
c-3po
"
;
export
const
field_special_types
=
[{
'
id
'
:
TYPE
.
PK
,
'
name
'
:
t
`Entity Key`
,
'
section
'
:
'
Overall Row
'
,
'
description
'
:
t
`The primary key for this table.`
},
{
'
id
'
:
TYPE
.
Name
,
'
name
'
:
t
`Entity Name`
,
'
section
'
:
'
Overall Row
'
,
'
description
'
:
t
`The "name" of each record. Usually a column called "name", "title", etc.`
},
{
'
id
'
:
TYPE
.
FK
,
'
name
'
:
t
`Foreign Key`
,
'
section
'
:
'
Overall Row
'
,
'
description
'
:
t
`Points to another table to make a connection.`
},
{
'
id
'
:
TYPE
.
AvatarURL
,
'
name
'
:
t
`Avatar Image URL`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Category
,
'
name
'
:
t
`Category`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
City
,
'
name
'
:
t
`City`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Country
,
'
name
'
:
t
`Country`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Description
,
'
name
'
:
t
`Description`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Email
,
'
name
'
:
t
`Email`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Enum
,
'
name
'
:
t
`Enum`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
ImageURL
,
'
name
'
:
t
`Image URL`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
SerializedJSON
,
'
name
'
:
t
`Field containing JSON`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Latitude
,
'
name
'
:
t
`Latitude`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Longitude
,
'
name
'
:
t
`Longitude`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Number
,
'
name
'
:
t
`Number`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
State
,
'
name
'
:
t
`State`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
UNIXTimestampSeconds
,
'
name
'
:
t
`UNIX Timestamp (Seconds)`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
UNIXTimestampMilliseconds
,
'
name
'
:
t
`UNIX Timestamp (Milliseconds)`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
URL
,
'
name
'
:
t
`URL`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
ZipCode
,
'
name
'
:
t
`Zip Code`
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Quantity
,
'
name
'
:
'
Quantity
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Income
,
'
name
'
:
'
Income
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Discount
,
'
name
'
:
'
Discount
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
CreationTimestamp
,
'
name
'
:
'
Creation timestamp
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Product
,
'
name
'
:
'
Product
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
User
,
'
name
'
:
'
User
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Source
,
'
name
'
:
'
Source
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Price
,
'
name
'
:
'
Price
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
JoinTimestamp
,
'
name
'
:
'
Join timestamp
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Share
,
'
name
'
:
'
Share
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Owner
,
'
name
'
:
'
Owner
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Company
,
'
name
'
:
'
Company
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Subscription
,
'
name
'
:
'
Subscription
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Score
,
'
name
'
:
'
Score
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Description
,
'
name
'
:
'
Description
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Title
,
'
name
'
:
'
Title
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Comment
,
'
name
'
:
'
Comment
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
Cost
,
'
name
'
:
'
Cost
'
,
'
section
'
:
'
Common
'
},
{
'
id
'
:
TYPE
.
GrossMargin
,
'
name
'
:
'
Gross margin
'
,
'
section
'
:
'
Common
'
}];
export
const
field_special_types
=
[
{
id
:
TYPE
.
PK
,
name
:
t
`Entity Key`
,
section
:
"
Overall Row
"
,
description
:
t
`The primary key for this table.`
,
},
{
id
:
TYPE
.
Name
,
name
:
t
`Entity Name`
,
section
:
"
Overall Row
"
,
description
:
t
`The "name" of each record. Usually a column called "name", "title", etc.`
,
},
{
id
:
TYPE
.
FK
,
name
:
t
`Foreign Key`
,
section
:
"
Overall Row
"
,
description
:
t
`Points to another table to make a connection.`
,
},
{
id
:
TYPE
.
AvatarURL
,
name
:
t
`Avatar Image URL`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Category
,
name
:
t
`Category`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
City
,
name
:
t
`City`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Country
,
name
:
t
`Country`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Description
,
name
:
t
`Description`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Email
,
name
:
t
`Email`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Enum
,
name
:
t
`Enum`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
ImageURL
,
name
:
t
`Image URL`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
SerializedJSON
,
name
:
t
`Field containing JSON`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Latitude
,
name
:
t
`Latitude`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Longitude
,
name
:
t
`Longitude`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Number
,
name
:
t
`Number`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
State
,
name
:
t
`State`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
UNIXTimestampSeconds
,
name
:
t
`UNIX Timestamp (Seconds)`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
UNIXTimestampMilliseconds
,
name
:
t
`UNIX Timestamp (Milliseconds)`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
URL
,
name
:
t
`URL`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
ZipCode
,
name
:
t
`Zip Code`
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Quantity
,
name
:
"
Quantity
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Income
,
name
:
"
Income
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Discount
,
name
:
"
Discount
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
CreationTimestamp
,
name
:
"
Creation timestamp
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Product
,
name
:
"
Product
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
User
,
name
:
"
User
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Source
,
name
:
"
Source
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Price
,
name
:
"
Price
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
JoinTimestamp
,
name
:
"
Join timestamp
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Share
,
name
:
"
Share
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Owner
,
name
:
"
Owner
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Company
,
name
:
"
Company
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Subscription
,
name
:
"
Subscription
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Score
,
name
:
"
Score
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Description
,
name
:
"
Description
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Title
,
name
:
"
Title
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Comment
,
name
:
"
Comment
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
Cost
,
name
:
"
Cost
"
,
section
:
"
Common
"
,
},
{
id
:
TYPE
.
GrossMargin
,
name
:
"
Gross margin
"
,
section
:
"
Common
"
,
},
];
export
const
field_special_types_map
=
field_special_types
.
reduce
(
(
map
,
type
)
=>
Object
.
assign
({},
map
,
{
[
type
.
id
]:
type
}),
...
...
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