[GroupBy] Add views filters to groupBy query 2/2: handle anyFieldFilter (#14791)
Following https://github.com/twentyhq/twenty/pull/14762 In this PR - moved logic around any field filter formatting to twenty-shared - added any field filter to the filters applied to groupBy when viewId is defined - added integration test
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import { isNonEmptyArray } from '../isNonEmptyArray';
|
||||
|
||||
describe('isNonEmptyArray', () => {
|
||||
it('should return true for a non empty array', () => {
|
||||
expect(isNonEmptyArray([1])).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for an empty array', () => {
|
||||
expect(isNonEmptyArray([])).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for a null value', () => {
|
||||
expect(isNonEmptyArray(null)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for an undefined value', () => {
|
||||
expect(isNonEmptyArray(undefined)).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
import { isNumber } from '@sniptt/guards';
|
||||
|
||||
export const isNonEmptyArray = <T>(
|
||||
probableArray: T[] | readonly T[] | undefined | null,
|
||||
): probableArray is NonNullable<T[]> => {
|
||||
if (
|
||||
Array.isArray(probableArray) &&
|
||||
isNumber(probableArray.length) &&
|
||||
probableArray.length > 0
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user