Skip to content

Commit

Permalink
handle delete markers in search results for files
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 committed Jan 12, 2021
1 parent ae8ff91 commit 918c61f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 5 additions & 1 deletion catalog/app/components/SearchResults/SearchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ function VersionInfo({ bucket, path, version, versions }) {
{' from '}
<Bold>{v.updated.toLocaleString()}</Bold>
{' | '}
<Bold>{readableBytes(v.size)}</Bold>
{v.deleteMarker ? (
<Bold>Delete Marker</Bold>
) : (
<Bold>{readableBytes(v.size)}</Bold>
)}
</M.Typography>
))}
</SmallerSection>
Expand Down
1 change: 1 addition & 0 deletions catalog/app/utils/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const extractObjData = ({ bucket, score, src }) => {
lastModified: parseDate(src.last_modified),
size: src.size,
meta: src.user_meta,
deleteMarker: src.delete_marker,
},
],
},
Expand Down
15 changes: 13 additions & 2 deletions lambdas/search/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,19 @@ def lambda_handler(request):
}
}
_source = user_source or [
'key', 'version_id', 'updated', 'last_modified', 'size', 'user_meta',
'comment', 'handle', 'hash', 'tags', 'metadata', 'pointer_file'
'key',
'version_id',
'updated',
'last_modified',
'size',
'user_meta',
'comment',
'handle',
'hash',
'tags',
'metadata',
'pointer_file',
'delete_marker',
]
size = DEFAULT_SIZE
elif action == 'stats':
Expand Down

0 comments on commit 918c61f

Please sign in to comment.