Fix build linter issues
This commit is contained in:
@ -10,6 +10,7 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata
|
||||
import { ObjectMetadataItemIdentifier } from '@/object-metadata/types/ObjectMetadataItemIdentifier';
|
||||
import { OrderByField } from '@/object-metadata/types/OrderByField';
|
||||
import { getRecordOptimisticEffectDefinition } from '@/object-record/graphql/optimistic-effect-definition/getRecordOptimisticEffectDefinition';
|
||||
import { ObjectRecordFilter } from '@/object-record/types/ObjectRecordFilter';
|
||||
import { filterUniqueRecordEdgesByCursor } from '@/object-record/utils/filterUniqueRecordEdgesByCursor';
|
||||
import { DEFAULT_SEARCH_REQUEST_LIMIT } from '@/search/hooks/useFilteredSearchEntityQuery';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
@ -25,7 +26,6 @@ import {
|
||||
PaginatedRecordTypeResults,
|
||||
} from '../types/PaginatedRecordTypeResults';
|
||||
import { mapPaginatedRecordsToRecords } from '../utils/mapPaginatedRecordsToRecords';
|
||||
import { ObjectRecordFilter } from '@/object-record/types/ObjectRecordFilter';
|
||||
|
||||
export const useFindManyRecords = <
|
||||
RecordType extends { id: string } & Record<string, any>,
|
||||
@ -140,7 +140,9 @@ export const useFindManyRecords = <
|
||||
|
||||
if (isNonEmptyArray(previousEdges) && isNonEmptyArray(nextEdges)) {
|
||||
newEdges = filterUniqueRecordEdgesByCursor([
|
||||
// eslint-disable-next-line no-unsafe-optional-chaining
|
||||
...prev?.[objectMetadataItem.namePlural]?.edges,
|
||||
// eslint-disable-next-line no-unsafe-optional-chaining
|
||||
...fetchMoreResult?.[objectMetadataItem.namePlural]?.edges,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -3,10 +3,10 @@ import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
|
||||
import { Company } from '@/companies/types/Company';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { turnFiltersIntoObjectRecordFilters } from '@/object-record/utils/turnFiltersIntoWhereClause';
|
||||
import { turnSortsIntoOrderBy } from '@/object-record/object-sort-dropdown/utils/turnSortsIntoOrderBy';
|
||||
import { useRecordBoardScopedStates } from '@/object-record/record-board/hooks/internal/useRecordBoardScopedStates';
|
||||
import { PaginatedRecordTypeResults } from '@/object-record/types/PaginatedRecordTypeResults';
|
||||
import { turnFiltersIntoObjectRecordFilters } from '@/object-record/utils/turnFiltersIntoWhereClause';
|
||||
import { Opportunity } from '@/pipeline/types/Opportunity';
|
||||
import { PipelineStep } from '@/pipeline/types/PipelineStep';
|
||||
|
||||
|
||||
@ -3,10 +3,10 @@ import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { useObjectNameSingularFromPlural } from '@/object-metadata/hooks/useObjectNameSingularFromPlural';
|
||||
import { turnFiltersIntoObjectRecordFilters } from '@/object-record/utils/turnFiltersIntoWhereClause';
|
||||
import { turnSortsIntoOrderBy } from '@/object-record/object-sort-dropdown/utils/turnSortsIntoOrderBy';
|
||||
import { useRecordTableScopedStates } from '@/object-record/record-table/hooks/internal/useRecordTableScopedStates';
|
||||
import { useRecordTable } from '@/object-record/record-table/hooks/useRecordTable';
|
||||
import { turnFiltersIntoObjectRecordFilters } from '@/object-record/utils/turnFiltersIntoWhereClause';
|
||||
import { signInBackgroundMockCompanies } from '@/sign-in-background-mock/constants/signInBackgroundMockCompanies';
|
||||
|
||||
import { useFindManyRecords } from './useFindManyRecords';
|
||||
|
||||
@ -25,7 +25,7 @@ export const turnSortsIntoOrderBy = (
|
||||
[fields[0].name]: 'DescNullsFirst',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
sorts.forEach((sort) => {
|
||||
const correspondingField = fields.find(
|
||||
(field) => field.id === sort.fieldMetadataId,
|
||||
|
||||
@ -2,12 +2,12 @@ import { RecordBoardScopeInternalContext } from '@/object-record/record-board/sc
|
||||
import { getRecordBoardScopedStates } from '@/object-record/record-board/utils/getRecordBoardScopedStates';
|
||||
import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';
|
||||
|
||||
type useRecordBoardScopedStates = {
|
||||
type useRecordBoardScopedStatesProps = {
|
||||
recordBoardScopeId?: string;
|
||||
};
|
||||
|
||||
export const useRecordBoardScopedStates = (
|
||||
args?: useRecordBoardScopedStates,
|
||||
args?: useRecordBoardScopedStatesProps,
|
||||
) => {
|
||||
const { recordBoardScopeId } = args ?? {};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ScopedStateKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/ScopedStateKey';
|
||||
import { createScopeInternalContext } from '@/ui/utilities/recoil-scope/scopes-internal/utils/createScopeInternalContext';
|
||||
|
||||
type RecordBoardScopeInternalContext = ScopedStateKey;
|
||||
type RecordBoardScopeInternalContextType = ScopedStateKey;
|
||||
|
||||
export const RecordBoardScopeInternalContext =
|
||||
createScopeInternalContext<RecordBoardScopeInternalContext>();
|
||||
createScopeInternalContext<RecordBoardScopeInternalContextType>();
|
||||
|
||||
@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { IconPlus, IconSettings } from '@/ui/display/icon';
|
||||
import { IconSettings } from '@/ui/display/icon';
|
||||
import { useLazyLoadIcons } from '@/ui/input/hooks/useLazyLoadIcons';
|
||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
|
||||
|
||||
@ -36,7 +36,6 @@ export type FloatFilter = {
|
||||
is?: IsFilter;
|
||||
};
|
||||
|
||||
|
||||
export type DateFilter = {
|
||||
eq?: string;
|
||||
gt?: string;
|
||||
@ -61,12 +60,21 @@ export type FullNameFilter = {
|
||||
lastName?: StringFilter;
|
||||
};
|
||||
|
||||
export type LeafFilter = UUIDFilter | StringFilter | FloatFilter | DateFilter | CurrencyFilter | URLFilter | FullNameFilter
|
||||
export type LeafFilter =
|
||||
| UUIDFilter
|
||||
| StringFilter
|
||||
| FloatFilter
|
||||
| DateFilter
|
||||
| CurrencyFilter
|
||||
| URLFilter
|
||||
| FullNameFilter;
|
||||
|
||||
export type ObjectRecordFilter = {
|
||||
and?: ObjectRecordFilter[];
|
||||
or?: ObjectRecordFilter[];
|
||||
not?: ObjectRecordFilter;
|
||||
} | {
|
||||
[fieldName: string]: LeafFilter
|
||||
}
|
||||
export type ObjectRecordFilter =
|
||||
| {
|
||||
and?: ObjectRecordFilter[];
|
||||
or?: ObjectRecordFilter[];
|
||||
not?: ObjectRecordFilter;
|
||||
}
|
||||
| {
|
||||
[fieldName: string]: LeafFilter;
|
||||
};
|
||||
|
||||
@ -1,8 +1,16 @@
|
||||
import {
|
||||
CurrencyFilter,
|
||||
DateFilter,
|
||||
FloatFilter,
|
||||
FullNameFilter,
|
||||
ObjectRecordFilter,
|
||||
StringFilter,
|
||||
URLFilter,
|
||||
} from '@/object-record/types/ObjectRecordFilter';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { Field } from '~/generated/graphql';
|
||||
|
||||
import { Filter } from '../object-filter-dropdown/types/Filter';
|
||||
import { CurrencyFilter, DateFilter, FloatFilter, FullNameFilter, ObjectRecordFilter, StringFilter, URLFilter } from '@/object-record/types/ObjectRecordFilter';
|
||||
|
||||
export type RawUIFilter = Omit<Filter, 'definition'> & {
|
||||
definition: {
|
||||
@ -16,11 +24,11 @@ export const turnFiltersIntoObjectRecordFilters = (
|
||||
): ObjectRecordFilter => {
|
||||
const objectRecordFilters: ObjectRecordFilter[] = [];
|
||||
|
||||
for(const rawUIFilter of rawUIFilters) {
|
||||
for (const rawUIFilter of rawUIFilters) {
|
||||
const correspondingField = fields.find(
|
||||
(field) => field.id === rawUIFilter.fieldMetadataId,
|
||||
);
|
||||
|
||||
|
||||
if (!correspondingField) {
|
||||
throw new Error(
|
||||
`Could not find field ${rawUIFilter.fieldMetadataId} in metadata object`,
|
||||
@ -38,7 +46,7 @@ export const turnFiltersIntoObjectRecordFilters = (
|
||||
ilike: `%${rawUIFilter.value}%`,
|
||||
} as StringFilter,
|
||||
});
|
||||
break
|
||||
break;
|
||||
case ViewFilterOperand.DoesNotContain:
|
||||
objectRecordFilters.push({
|
||||
not: {
|
||||
@ -47,7 +55,7 @@ export const turnFiltersIntoObjectRecordFilters = (
|
||||
} as StringFilter,
|
||||
},
|
||||
});
|
||||
break
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
`Unknown operand ${rawUIFilter.operand} for ${rawUIFilter.definition.type} filter`,
|
||||
@ -107,6 +115,7 @@ export const turnFiltersIntoObjectRecordFilters = (
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const parsedRecordIds = JSON.parse(rawUIFilter.value) as string[];
|
||||
|
||||
if (parsedRecordIds.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user