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
2af39498
Unverified
Commit
2af39498
authored
5 years ago
by
Maz Ameli
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add more special field type groupings and reorganize them (#11947)
* add more field types and reorganize them * update snapshots
parent
68a15a35
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/lib/core.js
+149
-130
149 additions, 130 deletions
frontend/src/metabase/lib/core.js
frontend/test/metabase/internal/__snapshots__/components.unit.spec.js.snap
+2
-2
2 additions, 2 deletions
...abase/internal/__snapshots__/components.unit.spec.js.snap
with
151 additions
and
132 deletions
frontend/src/metabase/lib/core.js
+
149
−
130
View file @
2af39498
...
...
@@ -2,6 +2,7 @@ import { TYPE } from "metabase/lib/types";
import
{
t
}
from
"
ttag
"
;
export
const
field_special_types
=
[
/* Overall Row */
{
id
:
TYPE
.
PK
,
name
:
t
`Entity Key`
,
...
...
@@ -20,29 +21,16 @@ export const field_special_types = [
section
:
t
`Overall Row`
,
description
:
t
`Points to another table to make a connection.`
,
},
{
id
:
TYPE
.
AvatarURL
,
name
:
t
`Avatar Image URL`
,
section
:
t
`Common`
,
},
/* Common */
{
id
:
TYPE
.
Category
,
name
:
t
`Category`
,
section
:
t
`Common`
,
},
{
id
:
TYPE
.
City
,
name
:
t
`City`
,
section
:
t
`Common`
,
},
{
id
:
TYPE
.
Country
,
name
:
t
`Country`
,
section
:
t
`Common`
,
},
{
id
:
TYPE
.
Currency
,
name
:
t
`Currency`
,
id
:
TYPE
.
Comment
,
name
:
t
`Comment`
,
section
:
t
`Common`
,
},
{
...
...
@@ -51,209 +39,240 @@ export const field_special_types = [
section
:
t
`Common`
,
},
{
id
:
TYPE
.
Email
,
name
:
t
`
Email
`
,
id
:
TYPE
.
Number
,
name
:
t
`
Number
`
,
section
:
t
`Common`
,
},
{
id
:
TYPE
.
Enum
,
name
:
t
`
Enum
`
,
id
:
TYPE
.
Title
,
name
:
t
`
Title
`
,
section
:
t
`Common`
,
},
/* Location */
{
id
:
TYPE
.
ImageURL
,
name
:
t
`
Image URL
`
,
section
:
t
`
Comm
on`
,
id
:
TYPE
.
City
,
name
:
t
`
City
`
,
section
:
t
`
Locati
on`
,
},
{
id
:
TYPE
.
SerializedJSON
,
name
:
t
`
Field containing JSON
`
,
section
:
t
`
Comm
on`
,
id
:
TYPE
.
Country
,
name
:
t
`
Country
`
,
section
:
t
`
Locati
on`
,
},
{
id
:
TYPE
.
Latitude
,
name
:
t
`Latitude`
,
section
:
t
`
Comm
on`
,
section
:
t
`
Locati
on`
,
},
{
id
:
TYPE
.
Longitude
,
name
:
t
`Longitude`
,
section
:
t
`Common`
,
},
{
id
:
TYPE
.
Number
,
name
:
t
`Number`
,
section
:
t
`Common`
,
section
:
t
`Location`
,
},
{
id
:
TYPE
.
State
,
name
:
t
`State`
,
section
:
t
`
Comm
on`
,
section
:
t
`
Locati
on`
,
},
{
id
:
TYPE
.
UNIXTimestampSeconds
,
name
:
t
`
UNIX Timestamp (Seconds)
`
,
section
:
t
`
Comm
on`
,
id
:
TYPE
.
ZipCode
,
name
:
t
`
Zip Code
`
,
section
:
t
`
Locati
on`
,
},
/* Financial */
{
id
:
TYPE
.
UNIXTimestampMilliseconds
,
name
:
t
`
UNIX Timestamp (Milliseconds)
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Cost
,
name
:
t
`
Cost
`
,
section
:
t
`
Financial
`
,
},
{
id
:
TYPE
.
URL
,
name
:
t
`
URL
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Currency
,
name
:
t
`
Currency
`
,
section
:
t
`
Financial
`
,
},
{
id
:
TYPE
.
ZipCode
,
name
:
t
`
Zip Code
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Discount
,
name
:
t
`
Discount
`
,
section
:
t
`
Financial
`
,
},
{
id
:
TYPE
.
Quantity
,
name
:
t
`
Quantity
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
GrossMargin
,
name
:
t
`
Gross margin
`
,
section
:
t
`
Financial
`
,
},
{
id
:
TYPE
.
Income
,
name
:
t
`Income`
,
section
:
t
`
Common
`
,
section
:
t
`
Financial
`
,
},
{
id
:
TYPE
.
Discount
,
name
:
t
`
Discount
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Price
,
name
:
t
`
Price
`
,
section
:
t
`
Financial
`
,
},
/* Numeric */
{
id
:
TYPE
.
CreationTimestamp
,
name
:
t
`
Creation timestamp
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Quantity
,
name
:
t
`
Quantity
`
,
section
:
t
`
Numeric
`
,
},
{
id
:
TYPE
.
CreationTim
e
,
name
:
t
`
Creation tim
e`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Scor
e
,
name
:
t
`
Scor
e`
,
section
:
t
`
Numeric
`
,
},
{
id
:
TYPE
.
CreationDat
e
,
name
:
t
`
Creation dat
e`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Shar
e
,
name
:
t
`
Shar
e`
,
section
:
t
`
Numeric
`
,
},
/* Profile */
{
id
:
TYPE
.
CancelationTimestamp
,
name
:
t
`
Cancelation timestamp
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Birthdate
,
name
:
t
`
Birthday
`
,
section
:
t
`
Profile
`
,
},
{
id
:
TYPE
.
C
ancelationTime
,
name
:
t
`C
ancelation time
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
C
ompany
,
name
:
t
`C
ompany
`
,
section
:
t
`
Profile
`
,
},
{
id
:
TYPE
.
CancelationDate
,
name
:
t
`
Cancelation date
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Email
,
name
:
t
`
Email
`
,
section
:
t
`
Profile
`
,
},
{
id
:
TYPE
.
DeletionTimestamp
,
name
:
t
`
Deletion timestamp
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Owner
,
name
:
t
`
Owner
`
,
section
:
t
`
Profile
`
,
},
{
id
:
TYPE
.
DeletionTime
,
name
:
t
`
Deletion time
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
Subscription
,
name
:
t
`
Subscription
`
,
section
:
t
`
Profile
`
,
},
{
id
:
TYPE
.
DeletionDate
,
name
:
t
`
Deletion date
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
User
,
name
:
t
`
User
`
,
section
:
t
`
Profile
`
,
},
/* Date and Time */
{
id
:
TYPE
.
Product
,
name
:
t
`
Product
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
CancelationDate
,
name
:
t
`
Cancelation date
`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
User
,
name
:
t
`
User
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
CancelationTime
,
name
:
t
`
Cancelation time
`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
Source
,
name
:
t
`
Source
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
CancelationTimestamp
,
name
:
t
`
Cancelation timestamp
`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
Pric
e
,
name
:
t
`
Pric
e`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
CreationDat
e
,
name
:
t
`
Creation dat
e`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
JoinTimestamp
,
name
:
t
`
Joi
n time
stamp
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
CreationTime
,
name
:
t
`
Creatio
n time`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
JoinTime
,
name
:
t
`Join time`
,
section
:
t
`Common`
,
id
:
TYPE
.
CreationTimestamp
,
name
:
t
`Creation timestamp`
,
section
:
t
`Date and Time`
,
},
{
id
:
TYPE
.
DeletionDate
,
name
:
t
`Deletion date`
,
section
:
t
`Date and Time`
,
},
{
id
:
TYPE
.
DeletionTime
,
name
:
t
`Deletion time`
,
section
:
t
`Date and Time`
,
},
{
id
:
TYPE
.
DeletionTimestamp
,
name
:
t
`Deletion timestamp`
,
section
:
t
`Date and Time`
,
},
{
id
:
TYPE
.
JoinDate
,
name
:
t
`Join date`
,
section
:
t
`
Common
`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
Shar
e
,
name
:
t
`
Shar
e`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
JoinTim
e
,
name
:
t
`
Join tim
e`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
Owner
,
name
:
t
`
Owner
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
JoinTimestamp
,
name
:
t
`
Join timestamp
`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
Company
,
name
:
t
`
Company
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
UNIXTimestampMilliseconds
,
name
:
t
`
UNIX Timestamp (Milliseconds)
`
,
section
:
t
`
Date and Time
`
,
},
{
id
:
TYPE
.
Subscription
,
name
:
t
`
Subscription
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
UNIXTimestampSeconds
,
name
:
t
`
UNIX Timestamp (Seconds)
`
,
section
:
t
`
Date and Time
`
,
},
/* Categorical */
{
id
:
TYPE
.
Score
,
name
:
t
`
Score
`
,
section
:
t
`C
ommon
`
,
id
:
TYPE
.
Enum
,
name
:
t
`
Enum
`
,
section
:
t
`C
ategorical
`
,
},
{
id
:
TYPE
.
Title
,
name
:
t
`
Title
`
,
section
:
t
`C
ommon
`
,
id
:
TYPE
.
Product
,
name
:
t
`
Product
`
,
section
:
t
`C
ategorical
`
,
},
{
id
:
TYPE
.
Comment
,
name
:
t
`
Comment
`
,
section
:
t
`C
ommon
`
,
id
:
TYPE
.
Source
,
name
:
t
`
Source
`
,
section
:
t
`C
ategorical
`
,
},
/* URLs */
{
id
:
TYPE
.
Cost
,
name
:
t
`
Cost
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
AvatarURL
,
name
:
t
`
Avatar Image URL
`
,
section
:
t
`
URLs
`
,
},
{
id
:
TYPE
.
GrossMargin
,
name
:
t
`
Gross margin
`
,
section
:
t
`
Common
`
,
id
:
TYPE
.
ImageURL
,
name
:
t
`
Image URL
`
,
section
:
t
`
URLs
`
,
},
{
id
:
TYPE
.
Birthdate
,
name
:
t
`Birthday`
,
section
:
t
`Common`
,
id
:
TYPE
.
URL
,
name
:
t
`URL`
,
section
:
t
`URLs`
,
},
/* Other */
{
id
:
TYPE
.
SerializedJSON
,
name
:
t
`Field containing JSON`
,
section
:
t
`Other`
,
},
];
...
...
This diff is collapsed.
Click to expand it.
frontend/test/metabase/internal/__snapshots__/components.unit.spec.js.snap
+
2
−
2
View file @
2af39498
...
...
@@ -1023,7 +1023,7 @@ exports[`Select should render "kitchen_sink" correctly 1`] = `
,
</span>
<span>
Avatar Image URL
Category
</span>
</span>
...
...
@@ -1064,7 +1064,7 @@ exports[`Select should render "multiple" correctly 1`] = `
,
</span>
<span>
Avatar Image URL
Category
</span>
</span>
...
...
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