From e2c60eaad49da3d0485b6f5f236fb0aabb84bef0 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Tue, 16 Jun 2020 00:23:29 -0500 Subject: fixing parts of dropdown --- .../views/collections/CollectionSchemaCells.tsx | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 92f6d1a02..e27de4c96 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -29,6 +29,7 @@ import { KeysDropdown } from "./CollectionSchemaHeaders"; import { listSpec } from "../../../fields/Schema"; import { ObjectField } from "../../../fields/ObjectField"; import { List } from "../../../fields/List"; +import { Link } from "@react-pdf/renderer"; const path = require('path'); library.add(faExpand); @@ -466,16 +467,21 @@ export class CollectionSchemaListCell extends CollectionSchemaCell { if (typeof field === "object") { - const optionsList = Cast(field, List); + const optionsList = field as List; - // if (optionsList){ - // const options = optionsList.map(() =>{ - - // }) - // } + const options = optionsList.map((element, index) => { + if (element instanceof Doc) { + const title = element.title; + return
{title}
; + } else if (element instanceof Link) { + return
link
; + } else { + return
{element}
; + } + }); @@ -495,10 +501,7 @@ export class CollectionSchemaListCell extends CollectionSchemaCell { {this._opened ?
-
Option 1
-
Option 2
-
Option 3
-
Option 4
+ {options}
: null} -- cgit v1.2.3-70-g09d2