Simplify enriched column
This commit is contained in:
parent
f0d52f2ea0
commit
e191c90385
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
BBReferenceFieldSubType,
|
||||
CalculationType,
|
||||
canGroupBy,
|
||||
FeatureFlag,
|
||||
|
@ -7,6 +8,7 @@ import {
|
|||
PermissionLevel,
|
||||
RelationSchemaField,
|
||||
RenameColumn,
|
||||
RequiredKeys,
|
||||
Table,
|
||||
TableSchema,
|
||||
View,
|
||||
|
@ -325,13 +327,18 @@ export async function enrichSchema(
|
|||
const viewFieldSchema = viewFields[relTableFieldName]
|
||||
const isVisible = !!viewFieldSchema?.visible
|
||||
const isReadonly = !!viewFieldSchema?.readonly
|
||||
result[relTableFieldName] = {
|
||||
...relTableField,
|
||||
...viewFieldSchema,
|
||||
name: relTableField.name,
|
||||
const enrichedFieldSchema: RequiredKeys<ViewV2ColumnEnriched> = {
|
||||
visible: isVisible,
|
||||
readonly: isReadonly,
|
||||
order: viewFieldSchema?.order,
|
||||
width: viewFieldSchema?.width,
|
||||
|
||||
icon: relTableField.icon,
|
||||
type: relTableField.type,
|
||||
subtype: relTableField.subtype,
|
||||
}
|
||||
}
|
||||
result[relTableFieldName] = enrichedFieldSchema
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import { FieldSchema, RelationSchemaField, ViewV2 } from "../documents"
|
||||
import {
|
||||
FieldSchema,
|
||||
FieldSubType,
|
||||
FieldType,
|
||||
RelationSchemaField,
|
||||
ViewV2,
|
||||
} from "../documents"
|
||||
|
||||
export interface ViewV2Enriched extends ViewV2 {
|
||||
schema?: {
|
||||
|
@ -8,4 +14,7 @@ export interface ViewV2Enriched extends ViewV2 {
|
|||
}
|
||||
}
|
||||
|
||||
export type ViewV2ColumnEnriched = RelationSchemaField & FieldSchema
|
||||
export interface ViewV2ColumnEnriched extends RelationSchemaField {
|
||||
type: FieldType
|
||||
subtype?: FieldSubType
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue