Skip to content
Snippets Groups Projects
Commit b5914161 authored by Tom Robinson's avatar Tom Robinson
Browse files

Exclude ENTITY, LOCATION, and DATE_TIME from SUMMABLE fields

parent f9429eaa
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,8 @@ const TYPES = {
},
[SUMMABLE]: {
include: [NUMBER]
include: [NUMBER],
exclude: [ENTITY, LOCATION, DATE_TIME]
},
[CATEGORY]: {
base: ["BooleanField"],
......@@ -67,7 +68,15 @@ export function isFieldType(type, field) {
return true;
}
}
// recursively check to see if it's another field th:
// recursively check to see if it's NOT another field type:
if (def.exclude) {
for (let excludeType of def.exclude) {
if (isFieldType(excludeType, field)) {
return false;
}
}
}
// recursively check to see if it's another field type:
if (def.include) {
for (let includeType of def.include) {
if (isFieldType(includeType, field)) {
......
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