Skip to content

Commit

Permalink
removing server provided pagination
Browse files Browse the repository at this point in the history
We need to replace pagination by a client driven mechanism (e.g. generate list of links from accessid and entity count or through a separate form page which has the accessid & allows selection of entity and limit/skip...).
  • Loading branch information
mbaudis committed Jun 5, 2024
1 parent 1dd973f commit f384306
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
47 changes: 26 additions & 21 deletions src/components/searchResults/DatasetResultBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,25 @@ export function DatasetResultBox({ data: responseSet, query }) {
tabComponent = (
<BiosamplesDataTable apiReply={biosamplesReply} datasetId={id} />
)
} else if (selectedTab === TABS.samplesMap) {
tabComponent = (
<div>
<h2 className="subtitle has-text-dark">Sample Origins</h2>
<p>
The map represents the origins of the matched samples, as derived from
the original publication or resource repository. In the majority of
cases this will correspond to the proxy information of the
corresponding author&apos;s institution. Additional information can be
found in the{" "}
<ExternalLink
href={`${SITE_DEFAULTS.MASTERDOCLINK}/geolocations.html`}
label="Geographic Coordinates documentation"
/>
{"."}
</p>
{/*<BiosamplesMap apiReply={biosamplesReply} datasetId={id} />*/}
</div>
)
// } else if (selectedTab === TABS.samplesMap) {
// tabComponent = (
// <div>
// <h2 className="subtitle has-text-dark">Sample Origins</h2>
// <p>
// The map represents the origins of the matched samples, as derived from
// the original publication or resource repository. In the majority of
// cases this will correspond to the proxy information of the
// corresponding author&apos;s institution. Additional information can be
// found in the{" "}
// <ExternalLink
// href={`${SITE_DEFAULTS.MASTERDOCLINK}/geolocations.html`}
// label="Geographic Coordinates documentation"
// />
// {"."}
// </p>
// {/*<BiosamplesMap apiReply={biosamplesReply} datasetId={id} />*/}
// </div>
// )
} else if (selectedTab === TABS.variants) {
tabComponent = (
<VariantsDataTable apiReply={variantsReply} datasetId={id} />
Expand Down Expand Up @@ -225,9 +225,13 @@ export function DatasetResultBox({ data: responseSet, query }) {
</div>
) : null}
{tabComponent ? <div>{tabComponent}</div> : null}
<hr/>
{/*
// TODO:Implement paginated downloads, e.g. on separate form
// page with hidden accessid ... parameters and fields for
// limit / skip ...
<hr/>
{biosamplesTableHandover?.pages && (
{biosamplesTableHandover?.pages && (
<div className="tabs">
<div>
<b>Download Sample Data (TSV)</b>
Expand Down Expand Up @@ -305,6 +309,7 @@ export function DatasetResultBox({ data: responseSet, query }) {
</div>
</div>
)}
*/}
</div>
)
}
Expand Down
1 change: 1 addition & 0 deletions src/hooks/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ export function useCollations({ datasetIds, method, filters }) {
}

export function useFiltersByType({ datasetIds, method, mode, collationTypes }) {
// TODO: construct URL w/o optional parameters if empty
const url = `${SITE_DEFAULTS.API_PATH}beacon/filtering_terms/?datasetIds=${datasetIds}&method=${method}&mode=${mode}&collationTypes=${collationTypes}`
return useProgenetixApi(url)
}
Expand Down

0 comments on commit f384306

Please sign in to comment.