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