-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
John conroy/collection dataset query HMP-257 (#3166)
* Make separate request for collections datasets * Use related entities table for collections datasets * Set max height for scroll in entities table * Add changelog * Add comment * Pull out shared cols to cols file * Refactor cols in hook * Reuse cols --------- Co-authored-by: John Conroy <[email protected]>
- Loading branch information
1 parent
2dd9a9e
commit 2b22914
Showing
7 changed files
with
70 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Get collection datasets from separate search-api query instead of the collection es document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
context/app/static/js/components/detailPage/CollectionDatasetsTable/hooks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useSearchHits } from 'js/hooks/useSearchData'; | ||
import { getIDsQuery } from 'js/helpers/queries'; | ||
import { | ||
lastModifiedTimestampCol, | ||
organCol, | ||
dataTypesCol, | ||
statusCol, | ||
} from 'js/components/detailPage/derivedEntities/columns'; | ||
|
||
const columns = [ | ||
organCol, | ||
dataTypesCol, | ||
lastModifiedTimestampCol, | ||
{ | ||
id: 'created_by_user_displayname', | ||
label: 'Contact', | ||
renderColumnCell: ({ created_by_user_displayname }) => created_by_user_displayname, | ||
}, | ||
statusCol, | ||
]; | ||
|
||
function useCollectionsDatasets({ ids }) { | ||
const query = { | ||
query: { | ||
...getIDsQuery(ids), | ||
}, | ||
_source: ['hubmap_id', 'entity_type', ...columns.map((c) => c.id)], | ||
size: 10000, | ||
}; | ||
|
||
const { searchHits: datasets } = useSearchHits(query); | ||
return { columns, datasets }; | ||
} | ||
|
||
export { useCollectionsDatasets }; |
8 changes: 0 additions & 8 deletions
8
context/app/static/js/components/detailPage/CollectionDatasetsTable/style.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters