Skip to content
Snippets Groups Projects
Unverified Commit 52d699d3 authored by Cam Saül's avatar Cam Saül
Browse files

Add new :type/TextLike for things like 'inet` that aren't text per-se :sunglasses:

parent c9b926d7
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import { isa, isFK, TYPE } from "metabase/lib/types";
// primary field types used for picking operators, etc
export const NUMBER = "NUMBER";
export const STRING = "STRING";
export const STRING_LIKE = "STRING_LIKE";
export const BOOLEAN = "BOOLEAN";
export const DATE_TIME = "DATE_TIME";
export const LOCATION = "LOCATION";
......@@ -33,6 +34,9 @@ const TYPES = {
base: [TYPE.Text],
special: [TYPE.Text]
},
[STRING_LIKE]: {
base: [TYPE.TextLike]
},
[BOOLEAN]: {
base: [TYPE.Boolean]
},
......@@ -268,6 +272,12 @@ const OPERATORS_BY_TYPE_ORDERED = {
{ name: "STARTS_WITH", verboseName: "Starts with", advanced: true},
{ name: "ENDS_WITH", verboseName: "Ends with", advanced: true}
],
[STRING_LIKE]: [
{ name: "=", verboseName: "Is" },
{ name: "!=", verboseName: "Is not" },
{ name: "IS_NULL", verboseName: "Is empty", advanced: true },
{ name: "NOT_NULL", verboseName: "Not empty", advanced: true }
],
[DATE_TIME]: [
{ name: "=", verboseName: "Is" },
{ name: "<", verboseName: "Before" },
......@@ -497,6 +507,7 @@ export const ICON_MAPPING = {
[LOCATION]: 'location',
[COORDINATE]: 'location',
[STRING]: 'string',
[STRING_LIKE]: 'string',
[NUMBER]: 'int',
[BOOLEAN]: 'io'
};
......
......@@ -42,8 +42,6 @@
(derive :type/SerializedJSON :type/Text)
(derive :type/SerializedJSON :type/Collection)
(derive :type/IPAddress :type/Text)
;;; DateTime Types
(derive :type/DateTime :type/*)
......@@ -61,6 +59,11 @@
(derive :type/Boolean :type/*)
;;; Text-Like Types: Things that should be displayed as text for most purposes but that shouldn't support advanced filter options like starts with / contains
(derive :type/TextLike :type/*)
(derive :type/IPAddress :type/TextLike)
;;; "Virtual" Types
(derive :type/Address :type/*)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment