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
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user