-
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/publication related data (#3046)
* Make derived entities tabs more flexible to entities * Change derived entities section header for reuse with publications data * Make derived entities tabs accept warning message fn as prop * Pass aria label as props to tabs * Rename derived entities tabs to related entities tabs * Rename derived entities section wrapper * Add related entities table component * Add shared columns file * Add entity type to derived entity hooks * Update entities table to take header and body rows as props * Use related entities table in derived table components * Fix import * Add hook to fetch ancestors * Add publication entities tabs * Pass columns to tabs * Add donors and define columns for publication entities * Consolidate hooks * Consolidate derived entities hooks * Move hooks from page inside derived datasets * Update prop name * Update entities table story * Use tabs in derived datasets section and remove unused table components * Move hooks for derived inside component * Fix formatting issues * Add changelog --------- Co-authored-by: John Conroy <[email protected]>
- Loading branch information
1 parent
576a066
commit 355fc92
Showing
35 changed files
with
482 additions
and
289 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 @@ | ||
- Add data section to publication page. |
30 changes: 20 additions & 10 deletions
30
...s/components/detailPage/derivedEntities/DerivedDatasetsSection/DerivedDatasetsSection.jsx
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
19 changes: 19 additions & 0 deletions
19
context/app/static/js/components/detailPage/derivedEntities/DerivedDatasetsSection/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,19 @@ | ||
import { useDerivedDatasetSearchHits } from 'js/hooks/useDerivedEntitySearchHits'; | ||
import { derivedDatasetsColumns } from 'js/components/detailPage/derivedEntities/columns'; | ||
|
||
function useDerivedDatasetsSection(uuid) { | ||
const { searchHits: datasets, isLoading } = useDerivedDatasetSearchHits(uuid); | ||
|
||
const entities = [ | ||
{ | ||
entityType: 'Dataset', | ||
tabLabel: 'Datasets', | ||
data: datasets, | ||
columns: derivedDatasetsColumns, | ||
}, | ||
]; | ||
|
||
return { entities, isLoading }; | ||
} | ||
|
||
export { useDerivedDatasetsSection }; |
49 changes: 0 additions & 49 deletions
49
...ic/js/components/detailPage/derivedEntities/DerivedDatasetsTable/DerivedDatasetsTable.jsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
context/app/static/js/components/detailPage/derivedEntities/DerivedDatasetsTable/index.js
This file was deleted.
Oops, something went wrong.
41 changes: 17 additions & 24 deletions
41
...s/components/detailPage/derivedEntities/DerivedEntitiesSection/DerivedEntitiesSection.jsx
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
28 changes: 28 additions & 0 deletions
28
context/app/static/js/components/detailPage/derivedEntities/DerivedEntitiesSection/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,28 @@ | ||
import { useDerivedDatasetSearchHits, useDerivedSampleSearchHits } from 'js/hooks/useDerivedEntitySearchHits'; | ||
import { derivedDatasetsColumns, derivedSamplesColumns } from 'js/components/detailPage/derivedEntities/columns'; | ||
|
||
function useDerivedEntitiesSection(uuid) { | ||
const { searchHits: datasets, isLoading: derivedDatasetsAreLoading } = useDerivedDatasetSearchHits(uuid); | ||
const { searchHits: samples, isLoading: derivedSamplesAreLoading } = useDerivedSampleSearchHits(uuid); | ||
|
||
const isLoading = derivedDatasetsAreLoading || derivedSamplesAreLoading; | ||
|
||
const entities = [ | ||
{ | ||
entityType: 'Sample', | ||
tabLabel: 'Samples', | ||
data: samples, | ||
columns: derivedSamplesColumns, | ||
}, | ||
{ | ||
entityType: 'Dataset', | ||
tabLabel: 'Datasets', | ||
data: datasets, | ||
columns: derivedDatasetsColumns, | ||
}, | ||
]; | ||
|
||
return { entities, isLoading }; | ||
} | ||
|
||
export { useDerivedEntitiesSection }; |
32 changes: 0 additions & 32 deletions
32
.../detailPage/derivedEntities/DerivedEntitiesSectionHeader/DerivedEntitiesSectionHeader.jsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...app/static/js/components/detailPage/derivedEntities/DerivedEntitiesSectionHeader/index.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...pp/static/js/components/detailPage/derivedEntities/DerivedEntitiesSectionWrapper/index.js
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...atic/js/components/detailPage/derivedEntities/DerivedEntitiesTabs/DerivedEntitiesTabs.jsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
context/app/static/js/components/detailPage/derivedEntities/DerivedEntitiesTabs/index.js
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
...atic/js/components/detailPage/derivedEntities/DerivedSamplesTable/DerivedSamplesTable.jsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
context/app/static/js/components/detailPage/derivedEntities/DerivedSamplesTable/index.js
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
context/app/static/js/components/detailPage/derivedEntities/columns.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,37 @@ | ||
import format from 'date-fns/format'; | ||
|
||
const descendantCountsCol = { | ||
id: 'descendant_counts.entity_type.Dataset', | ||
label: 'Derived Dataset Count', | ||
renderColumnCell: ({ descendant_counts }) => descendant_counts?.entity_type?.Dataset || 0, | ||
}; | ||
|
||
const lastModifiedTimestampCol = { | ||
id: 'last_modified_timestamp', | ||
label: 'Last Modified', | ||
renderColumnCell: ({ last_modified_timestamp }) => format(last_modified_timestamp, 'yyyy-MM-dd'), | ||
}; | ||
|
||
const derivedSamplesColumns = [ | ||
{ | ||
id: 'origin_samples_unique_mapped_organs', | ||
label: 'Organ', | ||
renderColumnCell: ({ origin_samples_unique_mapped_organs }) => origin_samples_unique_mapped_organs.join(', '), | ||
}, | ||
{ id: 'sample_category', label: 'Sample Category', renderColumnCell: ({ sample_category }) => sample_category }, | ||
descendantCountsCol, | ||
lastModifiedTimestampCol, | ||
]; | ||
|
||
const derivedDatasetsColumns = [ | ||
{ | ||
id: 'mapped_data_types', | ||
label: 'Data Types', | ||
renderColumnCell: ({ mapped_data_types }) => mapped_data_types.join(', '), | ||
}, | ||
{ id: 'status', label: 'Status', renderColumnCell: ({ status }) => status }, | ||
descendantCountsCol, | ||
lastModifiedTimestampCol, | ||
]; | ||
|
||
export { derivedSamplesColumns, derivedDatasetsColumns, lastModifiedTimestampCol }; |
Oops, something went wrong.