Introduce main identifier to power RelationFieldDisplay (#2577)
* Introduce main identifier to power RelationFieldDisplay, FilterDrodown, TableFirstColumn * Apply to RelationPicker
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
import { FieldMetadata } from '@/ui/object/field/types/FieldMetadata';
|
||||
import { isFieldRelation } from '@/ui/object/field/types/guards/isFieldRelation';
|
||||
import { ColumnDefinition } from '@/ui/object/record-table/types/ColumnDefinition';
|
||||
|
||||
export const filterAvailableTableColumns = (
|
||||
columnDefinition: ColumnDefinition<FieldMetadata>,
|
||||
): boolean => {
|
||||
if (
|
||||
columnDefinition.type === 'RELATION' &&
|
||||
columnDefinition.relationType !== 'TO_ONE_OBJECT'
|
||||
isFieldRelation(columnDefinition) &&
|
||||
columnDefinition.metadata?.relationType !== 'TO_ONE_OBJECT'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ export const mapPaginatedObjectsToObjects = <
|
||||
pagedObjects: ObjectTypeQuery | undefined;
|
||||
objectNamePlural: string;
|
||||
}) => {
|
||||
console.log(objectNamePlural);
|
||||
const formattedObjects: ObjectType[] =
|
||||
pagedObjects?.[objectNamePlural].edges.map((objectEdge: ObjectEdge) => ({
|
||||
...objectEdge.node,
|
||||
|
||||
Reference in New Issue
Block a user