Skip to content

Commit

Permalink
fix(openalex): Make datatable scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Nov 14, 2024
1 parent 40f6251 commit 5619849
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions client/src/pages/openalex-ror/openalexView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,37 +69,6 @@ export default function OpenalexView({
}
};

const paginatorLeft = () => (
<Row>
<Col xs="2">
<div className="before-toggle">Select all</div>
</Col>
<Col xs="3">
<Toggle
checked={selectionPageOnly}
label="Select page"
name="Select page only"
onChange={(e) => setSelectionPageOnly(e.target.checked)}
/>
</Col>
<Col xs="7">
<i className="fr-icon-search-line fr-mr-1w" />
Search in affiliations name
<input
className="fr-ml-1w"
onChange={(e) => setFilteredAffiliationName(e.target.value)}
style={{
border: '1px solid #ced4da',
borderRadius: '4px',
padding: '0.375rem 0.75rem',
width: '100%',
}}
value={filteredAffiliationName}
/>
</Col>
</Row>
);

return (
<>
<div className="wm-internal-actions">
Expand All @@ -114,13 +83,8 @@ export default function OpenalexView({
metaKeySelection
onRowEditComplete={onRowEditComplete}
onSelectionChange={(e) => setSelectedOpenAlex(e.value)}
paginator
paginatorLeft={paginatorLeft}
paginatorPosition="top bottom"
paginatorTemplate="RowsPerPageDropdown FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink"
rows={50}
rowsPerPageOptions={[50, 100, 200, 500]}
scrollable
scrollHeight="800px"
selection={selectedOpenAlex}
selectionPageOnly={selectionPageOnly}
size="small"
Expand All @@ -130,6 +94,7 @@ export default function OpenalexView({
style={{ fontSize: '14px', lineHeight: '13px' }}
tableStyle={{ minWidth: '50rem' }}
value={allAffiliations}
virtualScrollerOptions={{ itemSize: 46 }}
>
<Column selectionMode="multiple" />
<Column
Expand Down

0 comments on commit 5619849

Please sign in to comment.