Board V2 - Part 1 (#2619)
* improve useComputeDefinitionsFromFieldMetadata to prevent infinit loops * fix viewFields * improve initial seeding * fix height 100% * fix filters and sorts * allow filter on currency * remove probability from filter * fix opportunities count * fix persist filters and sorts
This commit is contained in:
@ -9,9 +9,6 @@ export type FieldType =
|
||||
| 'DOUBLE_TEXT'
|
||||
| 'EMAIL'
|
||||
| 'ENUM'
|
||||
| 'MONEY_AMOUNT_'
|
||||
| 'MONEY_AMOUNT'
|
||||
| 'MONEY'
|
||||
| 'NUMBER'
|
||||
| 'PHONE'
|
||||
| 'PROBABILITY'
|
||||
|
||||
@ -33,9 +33,9 @@ export const MultipleFiltersDropdownContent = () => {
|
||||
{filterDefinitionUsedInDropdown.type === 'TEXT' && (
|
||||
<ObjectFilterDropdownTextSearchInput />
|
||||
)}
|
||||
{filterDefinitionUsedInDropdown.type === 'NUMBER' && (
|
||||
<ObjectFilterDropdownNumberSearchInput />
|
||||
)}
|
||||
{['NUMBER', 'CURRENCY'].includes(
|
||||
filterDefinitionUsedInDropdown.type,
|
||||
) && <ObjectFilterDropdownNumberSearchInput />}
|
||||
{filterDefinitionUsedInDropdown.type === 'DATE_TIME' && (
|
||||
<ObjectFilterDropdownDateSearchInput />
|
||||
)}
|
||||
|
||||
@ -1 +1,6 @@
|
||||
export type FilterType = 'TEXT' | 'DATE_TIME' | 'ENTITY' | 'NUMBER';
|
||||
export type FilterType =
|
||||
| 'TEXT'
|
||||
| 'DATE_TIME'
|
||||
| 'ENTITY'
|
||||
| 'NUMBER'
|
||||
| 'CURRENCY';
|
||||
|
||||
@ -8,6 +8,7 @@ export const getOperandsForFilterType = (
|
||||
switch (filterType) {
|
||||
case 'TEXT':
|
||||
return [ViewFilterOperand.Contains, ViewFilterOperand.DoesNotContain];
|
||||
case 'CURRENCY':
|
||||
case 'NUMBER':
|
||||
case 'DATE_TIME':
|
||||
return [ViewFilterOperand.GreaterThan, ViewFilterOperand.LessThan];
|
||||
|
||||
@ -62,6 +62,23 @@ export const turnFiltersIntoWhereClauseV2 = (
|
||||
`Unknown operand ${filter.operand} for ${filter.definition.type} filter`,
|
||||
);
|
||||
}
|
||||
case 'CURRENCY':
|
||||
switch (filter.operand) {
|
||||
case ViewFilterOperand.GreaterThan:
|
||||
whereClause[correspondingField.name] = {
|
||||
amountMicros: { gte: parseFloat(filter.value) * 1000000 },
|
||||
};
|
||||
return;
|
||||
case ViewFilterOperand.LessThan:
|
||||
whereClause[correspondingField.name] = {
|
||||
amountMicros: { lte: parseFloat(filter.value) * 1000000 },
|
||||
};
|
||||
return;
|
||||
default:
|
||||
throw new Error(
|
||||
`Unknown operand ${filter.operand} for ${filter.definition.type} filter`,
|
||||
);
|
||||
}
|
||||
case 'DATE_TIME':
|
||||
switch (filter.operand) {
|
||||
case ViewFilterOperand.GreaterThan:
|
||||
|
||||
Reference in New Issue
Block a user