Skip to content

Commit

Permalink
Merge pull request #1250 from girder/hidden-metadata
Browse files Browse the repository at this point in the history
Allow hiding metadata on item pages
  • Loading branch information
manthey authored Jul 31, 2023
2 parents 63e62c7 + f30ea64 commit 5ebc21a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Improvements
- Frame selection presets ([#1237](../../pull/1237))
- Adjust the bounds on non geospatial leaflet maps ([#1249](../../pull/1249))
- Allow hiding metadata on item pages ([#1250](../../pull/1250))

### Bug Fixes
- Guard against ICC profiles that won't parse ([#1245](../../pull/1245))
Expand Down
6 changes: 6 additions & 0 deletions docs/girder_config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ By default, item metadata can contain any keys and values. These can be given b
# Exclusive values can be specified instead
# exclusiveMinimum: 0
# exclusiveMaximum: 10
# Your can hide specific metadata keys by adding the hidden: true flag.
# These keys will not be shown in the list of metadata, even if they
# exist.
-
value: internalProperty
hidden: true

Editing Configuration Files
---------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (accessLevel >= AccessType.WRITE)
ul.dropdown-menu.pull-right(role="menu")
if limetadata
for entry in limetadata
if entry && entry.value
if entry && entry.value && !entry.hidden
li.li-metadata-menuitem(role="presentation")
a.li-add-metadata(metadata-key=entry.value)
= entry.title || entry.value
Expand Down
3 changes: 3 additions & 0 deletions girder/girder_large_image/web_client/views/metadataWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ wrap(MetadataWidget, 'render', function (render) {

// Append each metadatum
_.each(metaKeys, function (metaKey) {
if ((liMetadataKeyEntry(this._limetadata, metaKey) || {}).hidden) {
return;
}
this.$el.find('.g-widget-metadata-container').append(new MetadatumWidget({
mode: this.getModeFromValue(metaDict[metaKey], metaKey),
key: metaKey,
Expand Down

0 comments on commit 5ebc21a

Please sign in to comment.