From d5f505167684b4b82d99fc174dfd2150cb894c32 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Thu, 13 Jul 2023 14:59:56 -0400 Subject: [PATCH] Support showing data from subkeys in annotation lists. --- CHANGELOG.md | 1 + .../web_client/templates/annotationListWidget.pug | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85efb2c51..0c998fb57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Allow editing metadata in item lists ([#1235](../../pull/1235)) - Frame selector hotkeys for channel or bands ([#1233](../../pull/1233)) - More consistency in how local and remote image conversions are performed in Girder ([#1238](../../pull/1238)) +- Support showing data from subkeys in annotation lists ([#1241](../../pull/1241)) ## 1.23.1 diff --git a/girder_annotation/girder_large_image_annotation/web_client/templates/annotationListWidget.pug b/girder_annotation/girder_large_image_annotation/web_client/templates/annotationListWidget.pug index c1e79be94..3e5918e7d 100644 --- a/girder_annotation/girder_large_image_annotation/web_client/templates/annotationListWidget.pug +++ b/girder_annotation/girder_large_image_annotation/web_client/templates/annotationListWidget.pug @@ -56,12 +56,18 @@ if annotations.length for column in confList.columns || [] if column.type !== 'record' || column.value !== 'controls' - - var value = (column.type === 'record' ? annotation.get(column.value) || annotation.get('annotation')[column.value] : (column.type === 'metadata' ? ((annotation.get('annotation').attributes || {})[column.value] || '') : '')) || ''; + var value; if (column.type === 'record' && column.value === 'creator') { value = creator; - } - if (column.type === 'record' && column.value === 'updatedId') { + } else if (column.type === 'record' && column.value === 'updatedId') { value = updater; + } else if (column.type === 'metadata') { + value = annotation.get('annotation').attributes || {}; + column.value.split('.').forEach((part) => { + value = (value || {})[part]; + }); + } else { + value = column.type === 'record' ? annotation.get(column.value) || annotation.get('annotation')[column.value] : ''; } td.g-annotation-entry(title=value) if column.format === 'user'