refactor: remove "core" naming from views and eliminate converter layer (#18667)
## Summary
- **Remove all "core" prefixes** from the views system — the
metadata-based storage migration is complete, so `CoreView`,
`coreViewsSelector`, `getCoreViews`, etc. are now just `View`,
`viewsSelector`, `getViews`
- **Eliminate the entire converter layer** (15 files, ~850 lines
deleted) — `convertCoreViewToView` and all sub-converters were either
no-ops or trivially adding `__typename` / mapping identical enum values.
Local enums now re-export from generated GraphQL types directly (single
source of truth)
- **Unify `View` and `ViewWithRelations`** into one type —
`ViewWithRelations` is now a type alias for `View`, selectors return
data directly without conversion
### Backend
- Rename `@ObjectType('CoreView')` → `@ObjectType('View')` (and all
sub-entities)
- Rename resolver methods: `getCoreViews` → `getViews`, `createCoreView`
→ `createView`, etc.
- Rename `FIND_ALL_CORE_VIEWS_GRAPHQL_OPERATION` →
`FIND_ALL_VIEWS_GRAPHQL_OPERATION`
### Frontend
- Delete 15 converter files (`convertGqlView*ToView*`,
`convertView*ToGql`, `convertViewWithRelationsToView`)
- Re-export `ViewType`, `ViewKey`, `ViewFilterGroupLogicalOperator` from
generated enums (no more duplicate enum definitions with different
casing)
- Replace `ViewOpenRecordInType` with `ViewOpenRecordIn` from generated
- Remove `__typename` from all local view sub-types
- Remove unused `variant` from `ViewFilter`, make `displayValue` and
`definition` optional
- Rename ~45 GraphQL query/mutation files and all selectors to drop
"core" prefix
- Delete unused `viewsWithRelationsSelector`
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { type ViewFieldGroupOverrides } from 'src/engine/metadata-modules/view-field-group/entities/view-field-group.entity';
|
||||
import { ViewFieldDTO } from 'src/engine/metadata-modules/view-field/dtos/view-field.dto';
|
||||
|
||||
@ObjectType('CoreViewFieldGroup')
|
||||
@ObjectType('ViewFieldGroup')
|
||||
export class ViewFieldGroupDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
+7
-7
@@ -67,7 +67,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Query(() => [ViewFieldGroupDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFieldGroups(
|
||||
async getViewFieldGroups(
|
||||
@Args('viewId', { type: () => String }) viewId: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFieldGroupEntity[]> {
|
||||
@@ -76,7 +76,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Query(() => ViewFieldGroupDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFieldGroup(
|
||||
async getViewFieldGroup(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFieldGroupEntity | null> {
|
||||
@@ -85,7 +85,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Mutation(() => ViewFieldGroupDTO)
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async updateCoreViewFieldGroup(
|
||||
async updateViewFieldGroup(
|
||||
@Args('input') updateViewFieldGroupInput: UpdateViewFieldGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFieldGroupDTO> {
|
||||
@@ -97,7 +97,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Mutation(() => ViewFieldGroupDTO)
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async createCoreViewFieldGroup(
|
||||
async createViewFieldGroup(
|
||||
@Args('input')
|
||||
createViewFieldGroupInput: CreateViewFieldGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
@@ -110,7 +110,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Mutation(() => [ViewFieldGroupDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async createManyCoreViewFieldGroups(
|
||||
async createManyViewFieldGroups(
|
||||
@Args('inputs', { type: () => [CreateViewFieldGroupInput] })
|
||||
createViewFieldGroupInputs: CreateViewFieldGroupInput[],
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
@@ -123,7 +123,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Mutation(() => ViewFieldGroupDTO)
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async deleteCoreViewFieldGroup(
|
||||
async deleteViewFieldGroup(
|
||||
@Args('input') deleteViewFieldGroupInput: DeleteViewFieldGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFieldGroupDTO> {
|
||||
@@ -135,7 +135,7 @@ export class ViewFieldGroupResolver {
|
||||
|
||||
@Mutation(() => ViewFieldGroupDTO)
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async destroyCoreViewFieldGroup(
|
||||
async destroyViewFieldGroup(
|
||||
@Args('input')
|
||||
destroyViewFieldGroupInput: DestroyViewFieldGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import { type ViewFieldOverrides } from 'src/engine/metadata-modules/view-field/
|
||||
|
||||
registerEnumType(AggregateOperations, { name: 'AggregateOperations' });
|
||||
|
||||
@ObjectType('CoreViewField')
|
||||
@ObjectType('ViewField')
|
||||
export class ViewFieldDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
+7
-7
@@ -77,7 +77,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Query(() => [ViewFieldDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFields(
|
||||
async getViewFields(
|
||||
@Args('viewId', { type: () => String }) viewId: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFieldEntity[]> {
|
||||
@@ -86,7 +86,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Query(() => ViewFieldDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewField(
|
||||
async getViewField(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFieldEntity | null> {
|
||||
@@ -95,7 +95,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Mutation(() => ViewFieldDTO)
|
||||
@UseGuards(UpdateViewFieldPermissionGuard)
|
||||
async updateCoreViewField(
|
||||
async updateViewField(
|
||||
@Args('input') updateViewFieldInput: UpdateViewFieldInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFieldDTO> {
|
||||
@@ -107,7 +107,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Mutation(() => ViewFieldDTO)
|
||||
@UseGuards(CreateViewFieldPermissionGuard)
|
||||
async createCoreViewField(
|
||||
async createViewField(
|
||||
@Args('input') createViewFieldInput: CreateViewFieldInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFieldDTO> {
|
||||
@@ -119,7 +119,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Mutation(() => [ViewFieldDTO])
|
||||
@UseGuards(CreateViewFieldPermissionGuard)
|
||||
async createManyCoreViewFields(
|
||||
async createManyViewFields(
|
||||
@Args('inputs', { type: () => [CreateViewFieldInput] })
|
||||
createViewFieldInputs: CreateViewFieldInput[],
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
@@ -132,7 +132,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Mutation(() => ViewFieldDTO)
|
||||
@UseGuards(DeleteViewFieldPermissionGuard)
|
||||
async deleteCoreViewField(
|
||||
async deleteViewField(
|
||||
@Args('input') deleteViewFieldInput: DeleteViewFieldInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFieldDTO> {
|
||||
@@ -144,7 +144,7 @@ export class ViewFieldResolver {
|
||||
|
||||
@Mutation(() => ViewFieldDTO)
|
||||
@UseGuards(DestroyViewFieldPermissionGuard)
|
||||
async destroyCoreViewField(
|
||||
async destroyViewField(
|
||||
@Args('input') destroyViewFieldInput: DestroyViewFieldInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFieldDTO> {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ registerEnumType(ViewFilterGroupLogicalOperator, {
|
||||
name: 'ViewFilterGroupLogicalOperator',
|
||||
});
|
||||
|
||||
@ObjectType('CoreViewFilterGroup')
|
||||
@ObjectType('ViewFilterGroup')
|
||||
export class ViewFilterGroupDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
+6
-6
@@ -28,7 +28,7 @@ export class ViewFilterGroupResolver {
|
||||
|
||||
@Query(() => [ViewFilterGroupDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFilterGroups(
|
||||
async getViewFilterGroups(
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@Args('viewId', { type: () => String, nullable: true })
|
||||
viewId?: string,
|
||||
@@ -42,7 +42,7 @@ export class ViewFilterGroupResolver {
|
||||
|
||||
@Query(() => ViewFilterGroupDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFilterGroup(
|
||||
async getViewFilterGroup(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFilterGroupDTO | null> {
|
||||
@@ -51,7 +51,7 @@ export class ViewFilterGroupResolver {
|
||||
|
||||
@Mutation(() => ViewFilterGroupDTO)
|
||||
@UseGuards(CreateViewFilterGroupPermissionGuard)
|
||||
async createCoreViewFilterGroup(
|
||||
async createViewFilterGroup(
|
||||
@Args('input') input: CreateViewFilterGroupInput,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFilterGroupDTO> {
|
||||
@@ -63,7 +63,7 @@ export class ViewFilterGroupResolver {
|
||||
|
||||
@Mutation(() => ViewFilterGroupDTO)
|
||||
@UseGuards(UpdateViewFilterGroupPermissionGuard)
|
||||
async updateCoreViewFilterGroup(
|
||||
async updateViewFilterGroup(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@Args('input') input: UpdateViewFilterGroupInput,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@@ -77,7 +77,7 @@ export class ViewFilterGroupResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
@UseGuards(DeleteViewFilterGroupPermissionGuard)
|
||||
async deleteCoreViewFilterGroup(
|
||||
async deleteViewFilterGroup(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<boolean> {
|
||||
@@ -91,7 +91,7 @@ export class ViewFilterGroupResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
@UseGuards(DestroyViewFilterGroupPermissionGuard)
|
||||
async destroyCoreViewFilterGroup(
|
||||
async destroyViewFilterGroup(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<boolean> {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ registerEnumType(ViewFilterOperand, {
|
||||
name: 'ViewFilterOperand',
|
||||
});
|
||||
|
||||
@ObjectType('CoreViewFilter')
|
||||
@ObjectType('ViewFilter')
|
||||
export class ViewFilterDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
+6
-6
@@ -26,7 +26,7 @@ export class ViewFilterResolver {
|
||||
|
||||
@Query(() => [ViewFilterDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFilters(
|
||||
async getViewFilters(
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@Args('viewId', { type: () => String, nullable: true })
|
||||
viewId?: string,
|
||||
@@ -40,7 +40,7 @@ export class ViewFilterResolver {
|
||||
|
||||
@Query(() => ViewFilterDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewFilter(
|
||||
async getViewFilter(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewFilterDTO | null> {
|
||||
@@ -49,7 +49,7 @@ export class ViewFilterResolver {
|
||||
|
||||
@Mutation(() => ViewFilterDTO)
|
||||
@UseGuards(CreateViewFilterPermissionGuard)
|
||||
async createCoreViewFilter(
|
||||
async createViewFilter(
|
||||
@Args('input') createViewFilterInput: CreateViewFilterInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFilterDTO> {
|
||||
@@ -61,7 +61,7 @@ export class ViewFilterResolver {
|
||||
|
||||
@Mutation(() => ViewFilterDTO)
|
||||
@UseGuards(UpdateViewFilterPermissionGuard)
|
||||
async updateCoreViewFilter(
|
||||
async updateViewFilter(
|
||||
@Args('input') updateViewFilterInput: UpdateViewFilterInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFilterDTO> {
|
||||
@@ -73,7 +73,7 @@ export class ViewFilterResolver {
|
||||
|
||||
@Mutation(() => ViewFilterDTO)
|
||||
@UseGuards(DeleteViewFilterPermissionGuard)
|
||||
async deleteCoreViewFilter(
|
||||
async deleteViewFilter(
|
||||
@Args('input') deleteViewFilterInput: DeleteViewFilterInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFilterDTO> {
|
||||
@@ -85,7 +85,7 @@ export class ViewFilterResolver {
|
||||
|
||||
@Mutation(() => ViewFilterDTO)
|
||||
@UseGuards(DestroyViewFilterPermissionGuard)
|
||||
async destroyCoreViewFilter(
|
||||
async destroyViewFilter(
|
||||
@Args('input') destroyViewFilterInput: DestroyViewFilterInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewFilterDTO> {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('CoreViewGroup')
|
||||
@ObjectType('ViewGroup')
|
||||
export class ViewGroupDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
+7
-7
@@ -26,7 +26,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Query(() => [ViewGroupDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewGroups(
|
||||
async getViewGroups(
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@Args('viewId', { type: () => String, nullable: true })
|
||||
viewId?: string,
|
||||
@@ -40,7 +40,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Query(() => ViewGroupDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewGroup(
|
||||
async getViewGroup(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewGroupDTO | null> {
|
||||
@@ -49,7 +49,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Mutation(() => ViewGroupDTO)
|
||||
@UseGuards(CreateViewGroupPermissionGuard)
|
||||
async createCoreViewGroup(
|
||||
async createViewGroup(
|
||||
@Args('input') createViewGroupInput: CreateViewGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewGroupDTO> {
|
||||
@@ -61,7 +61,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Mutation(() => [ViewGroupDTO])
|
||||
@UseGuards(CreateViewGroupPermissionGuard)
|
||||
async createManyCoreViewGroups(
|
||||
async createManyViewGroups(
|
||||
@Args('inputs', { type: () => [CreateViewGroupInput] })
|
||||
createViewGroupInputs: CreateViewGroupInput[],
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
@@ -74,7 +74,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Mutation(() => ViewGroupDTO)
|
||||
@UseGuards(UpdateViewGroupPermissionGuard)
|
||||
async updateCoreViewGroup(
|
||||
async updateViewGroup(
|
||||
@Args('input') updateViewGroupInput: UpdateViewGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewGroupDTO> {
|
||||
@@ -86,7 +86,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Mutation(() => ViewGroupDTO)
|
||||
@UseGuards(DeleteViewGroupPermissionGuard)
|
||||
async deleteCoreViewGroup(
|
||||
async deleteViewGroup(
|
||||
@Args('input') deleteViewGroupInput: DeleteViewGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewGroupDTO> {
|
||||
@@ -98,7 +98,7 @@ export class ViewGroupResolver {
|
||||
|
||||
@Mutation(() => ViewGroupDTO)
|
||||
@UseGuards(DestroyViewGroupPermissionGuard)
|
||||
async destroyCoreViewGroup(
|
||||
async destroyViewGroup(
|
||||
@Args('input') destroyViewGroupInput: DestroyViewGroupInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewGroupDTO> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ViewSortDirection } from 'src/engine/metadata-modules/view-sort/enums/v
|
||||
|
||||
registerEnumType(ViewSortDirection, { name: 'ViewSortDirection' });
|
||||
|
||||
@ObjectType('CoreViewSort')
|
||||
@ObjectType('ViewSort')
|
||||
export class ViewSortDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
+6
-6
@@ -28,7 +28,7 @@ export class ViewSortResolver {
|
||||
|
||||
@Query(() => [ViewSortDTO])
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewSorts(
|
||||
async getViewSorts(
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@Args('viewId', { type: () => String, nullable: true })
|
||||
viewId?: string,
|
||||
@@ -42,7 +42,7 @@ export class ViewSortResolver {
|
||||
|
||||
@Query(() => ViewSortDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreViewSort(
|
||||
async getViewSort(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewSortDTO | null> {
|
||||
@@ -51,7 +51,7 @@ export class ViewSortResolver {
|
||||
|
||||
@Mutation(() => ViewSortDTO)
|
||||
@UseGuards(CreateViewSortPermissionGuard)
|
||||
async createCoreViewSort(
|
||||
async createViewSort(
|
||||
@Args('input') createViewSortInput: CreateViewSortInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewSortDTO> {
|
||||
@@ -63,7 +63,7 @@ export class ViewSortResolver {
|
||||
|
||||
@Mutation(() => ViewSortDTO)
|
||||
@UseGuards(UpdateViewSortPermissionGuard)
|
||||
async updateCoreViewSort(
|
||||
async updateViewSort(
|
||||
@Args('input') updateViewSortInput: UpdateViewSortInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<ViewSortDTO> {
|
||||
@@ -75,7 +75,7 @@ export class ViewSortResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
@UseGuards(DeleteViewSortPermissionGuard)
|
||||
async deleteCoreViewSort(
|
||||
async deleteViewSort(
|
||||
@Args('input') deleteViewSortInput: DeleteViewSortInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<boolean> {
|
||||
@@ -89,7 +89,7 @@ export class ViewSortResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
@UseGuards(DestroyViewSortPermissionGuard)
|
||||
async destroyCoreViewSort(
|
||||
async destroyViewSort(
|
||||
@Args('input') destroyViewSortInput: DestroyViewSortInput,
|
||||
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
|
||||
): Promise<boolean> {
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
export const FIND_ALL_CORE_VIEWS_GRAPHQL_OPERATION = 'FindAllCoreViews';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const FIND_ALL_VIEWS_GRAPHQL_OPERATION = 'FindAllViews';
|
||||
@@ -24,7 +24,7 @@ registerEnumType(ViewKey, { name: 'ViewKey' });
|
||||
registerEnumType(ViewCalendarLayout, { name: 'ViewCalendarLayout' });
|
||||
registerEnumType(ViewVisibility, { name: 'ViewVisibility' });
|
||||
|
||||
@ObjectType('CoreView')
|
||||
@ObjectType('View')
|
||||
export class ViewDTO {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@@ -94,7 +94,7 @@ export class ViewResolver {
|
||||
|
||||
@Query(() => [ViewDTO])
|
||||
@UseGuards(CustomPermissionGuard)
|
||||
async getCoreViews(
|
||||
async getViews(
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@AuthUserWorkspaceId() userWorkspaceId: string | undefined,
|
||||
@Args('objectMetadataId', { type: () => String, nullable: true })
|
||||
@@ -120,7 +120,7 @@ export class ViewResolver {
|
||||
|
||||
@Query(() => ViewDTO, { nullable: true })
|
||||
@UseGuards(NoPermissionGuard)
|
||||
async getCoreView(
|
||||
async getView(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<ViewDTO | null> {
|
||||
@@ -135,7 +135,7 @@ export class ViewResolver {
|
||||
|
||||
@Mutation(() => ViewDTO)
|
||||
@UseGuards(CreateViewPermissionGuard)
|
||||
async createCoreView(
|
||||
async createView(
|
||||
@Args('input') input: CreateViewInput,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@AuthUserWorkspaceId() userWorkspaceId: string | undefined,
|
||||
@@ -153,7 +153,7 @@ export class ViewResolver {
|
||||
|
||||
@Mutation(() => ViewDTO)
|
||||
@UseGuards(UpdateViewPermissionGuard)
|
||||
async updateCoreView(
|
||||
async updateView(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@Args('input') input: UpdateViewInput,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
@@ -168,7 +168,7 @@ export class ViewResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
@UseGuards(DeleteViewPermissionGuard)
|
||||
async deleteCoreView(
|
||||
async deleteView(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<boolean> {
|
||||
@@ -182,7 +182,7 @@ export class ViewResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
@UseGuards(DestroyViewPermissionGuard)
|
||||
async destroyCoreView(
|
||||
async destroyView(
|
||||
@Args('id', { type: () => String }) id: string,
|
||||
@AuthWorkspace() workspace: WorkspaceEntity,
|
||||
): Promise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user