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 +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