diff options
| author | bob <bcz@cs.brown.edu> | 2019-10-01 10:12:50 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-10-01 10:12:50 -0400 |
| commit | faaff9fe8aab3bd5d116eab8bd85198a0756fe30 (patch) | |
| tree | bbfcaf95e462b298aa7645049443ad9932f780a8 /src/client/views/collections/CollectionSchemaView.tsx | |
| parent | 9e1234abe64d289927122ad641e3bcaf0b9eaf6e (diff) | |
fixed issues with pdf loading and layout.
Diffstat (limited to 'src/client/views/collections/CollectionSchemaView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaView.tsx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 59cce7386..853808335 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -303,21 +303,17 @@ export class SchemaTable extends React.Component<SchemaTableProps> { this.props.Document.textwrappedSchemaRows = new List<string>(textWrappedRows); } - @computed get resized(): { "id": string, "value": number }[] { + @computed get resized(): { id: string, value: number }[] { return this.columns.reduce((resized, shf) => { - if (shf.width > -1) { - resized.push({ "id": shf.heading, "value": shf.width }); - } + (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width }); return resized; - }, [] as { "id": string, "value": number }[]); + }, [] as { id: string, value: number }[]); } - @computed get sorted(): { id: string, desc: boolean }[] { + @computed get sorted(): { id: string, desc?: true }[] { return this.columns.reduce((sorted, shf) => { - if (shf.desc) { - sorted.push({ "id": shf.heading, "desc": shf.desc }); - } + shf.desc && sorted.push({ id: shf.heading, desc: shf.desc }); return sorted; - }, [] as { id: string, desc: boolean }[]); + }, [] as { id: string, desc?: true }[]); } @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); } |
