Create resolvers and controllers for core views (#13624)
Created: - Services - Resolvers - Controllers - Tests for services - Integration tests for GraphQL and Rest Updated the Rest API playground Added new feature flag `IS_CORE_VIEW_ENABLED` Updated `viewFilter` `operand` and `view` `type` to be enums rather than strings and generated migration file. Closes https://github.com/twentyhq/core-team-issues/issues/1259 --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
import { ViewFilterOperand as SharedViewFilterOperand } from 'twenty-shared/types';
|
||||
|
||||
import { ViewFilterOperand } from 'src/engine/core-modules/view/enums/view-filter-operand';
|
||||
|
||||
const operandMapping: Record<SharedViewFilterOperand, ViewFilterOperand> = {
|
||||
[SharedViewFilterOperand.Is]: ViewFilterOperand.IS,
|
||||
[SharedViewFilterOperand.IsNotNull]: ViewFilterOperand.IS_NOT_NULL,
|
||||
[SharedViewFilterOperand.IsNot]: ViewFilterOperand.IS_NOT,
|
||||
[SharedViewFilterOperand.LessThanOrEqual]:
|
||||
ViewFilterOperand.LESS_THAN_OR_EQUAL,
|
||||
[SharedViewFilterOperand.GreaterThanOrEqual]:
|
||||
ViewFilterOperand.GREATER_THAN_OR_EQUAL,
|
||||
[SharedViewFilterOperand.IsBefore]: ViewFilterOperand.IS_BEFORE,
|
||||
[SharedViewFilterOperand.IsAfter]: ViewFilterOperand.IS_AFTER,
|
||||
[SharedViewFilterOperand.Contains]: ViewFilterOperand.CONTAINS,
|
||||
[SharedViewFilterOperand.DoesNotContain]: ViewFilterOperand.DOES_NOT_CONTAIN,
|
||||
[SharedViewFilterOperand.IsEmpty]: ViewFilterOperand.IS_EMPTY,
|
||||
[SharedViewFilterOperand.IsNotEmpty]: ViewFilterOperand.IS_NOT_EMPTY,
|
||||
[SharedViewFilterOperand.IsRelative]: ViewFilterOperand.IS_RELATIVE,
|
||||
[SharedViewFilterOperand.IsInPast]: ViewFilterOperand.IS_IN_PAST,
|
||||
[SharedViewFilterOperand.IsInFuture]: ViewFilterOperand.IS_IN_FUTURE,
|
||||
[SharedViewFilterOperand.IsToday]: ViewFilterOperand.IS_TODAY,
|
||||
[SharedViewFilterOperand.VectorSearch]: ViewFilterOperand.VECTOR_SEARCH,
|
||||
};
|
||||
|
||||
export const convertViewFilterOperandToCoreOperand = (
|
||||
sharedOperand: SharedViewFilterOperand,
|
||||
): ViewFilterOperand => {
|
||||
return operandMapping[sharedOperand];
|
||||
};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ViewFilterValue } from 'src/engine/metadata-modules/view/types/view-filter-value.type';
|
||||
import { ViewFilterValue } from 'src/engine/core-modules/view/types/view-filter-value.type';
|
||||
|
||||
export const transformViewFilterWorkspaceValueToCoreValue = (
|
||||
value: string,
|
||||
|
||||
Reference in New Issue
Block a user