Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
bde29a5
modernization of nav hero components
Apr 30, 2025
2ffcfb7
fix lint errors, configuration tsx environment, rename file extention…
May 6, 2025
7024f14
renaming file and send it again
May 6, 2025
4eec82f
resolved the rendring issue
May 7, 2025
0d03782
disclaimer issue fixed
May 9, 2025
f23f315
resolved typescripts vaidation errors
May 9, 2025
03cef3d
fix and update query explorer component and filed harmonization
May 14, 2025
1d37852
updaed the sidebar component, menu components, table, chartline, apiu…
May 20, 2025
c989505
modernize the apikey, api status, blogroll, breadcrumbs, chartbar, ch…
May 23, 2025
fe8e7d1
modernization of data dictionary , file explor, infographarmonize, qu…
May 28, 2025
678248a
modernization of components to tsx
Jun 3, 2025
165180d
resolved merge conflicts
priyanka59009 Jun 5, 2025
b150c9e
fixed line chart and donut chart
Jun 6, 2025
51491a4
refactor and fixed issue for apis and disclamer
priyanka59009 Jun 9, 2025
9e61527
fixed rendring issue
Jun 9, 2025
7792e5c
Upgraded Cypress base image to 18.20.3.
dkrylovsb Jun 10, 2025
36973d4
Trying http://127.0.0.1:3000 in Cypress.
dkrylovsb Jun 10, 2025
b861323
Added "DEBUG=start-server-and-test"
dkrylovsb Jun 10, 2025
2f74fd0
Added "DEBUG=start-server-and-test"
dkrylovsb Jun 10, 2025
a7f98c4
Trying http-get
dkrylovsb Jun 10, 2025
5c03cef
Using 127.0.0.1.
dkrylovsb Jun 10, 2025
1895874
Downgraded Cypress and set http://172.17.0.2:3000 in CI.
dkrylovsb Jun 10, 2025
caf0a99
Fixed chart size,missing chart, paging, missing scroll and the discla…
Jun 12, 2025
2c69857
Added "gatsby serve"
dkrylovsb Jun 12, 2025
6553a4d
Merge remote-tracking branch 'origin/modernization-openFDA' into mode…
dkrylovsb Jun 12, 2025
327f033
package-lock.json update.
dkrylovsb Jun 12, 2025
4db8434
Using http-get://127.0.0.1:300
dkrylovsb Jun 12, 2025
154012e
Fixed searchableFields test case.
dkrylovsb Jun 12, 2025
c122153
Upgraded Cypress and e2e tests.
dkrylovsb Jun 13, 2025
e4e008e
Added Cypress fixtures and plugins to git
dkrylovsb Jun 17, 2025
ea4bbc2
fixed single clicked in table links
Jun 18, 2025
25ce9b2
Merge branch 'master' of https://github.com/FDA/open.fda.gov into mod…
Jun 18, 2025
ca57ceb
Merge remote-tracking branch 'origin/modernization-openFDA' into mode…
dkrylovsb Jun 20, 2025
ae0bf5a
fixed product labeling overview dropdown
Jun 26, 2025
b056535
Merge branch 'modernization-openFDA' of https://github.com/FDA/open.f…
Jun 26, 2025
662513a
fixed apis drug event explore-the-api-with-an-interactive-chart
Jun 26, 2025
e5c7f54
fixed gatsby issue while going back
Jun 26, 2025
7e7dcd9
Fixed gatsby-source-filesystem path to resolve MarkdownRemark html qu…
Jul 7, 2025
87832ef
Merge branch 'modernization-openFDA' of https://github.com/FDA/open.f…
Jul 7, 2025
ed88a86
resolved build errors
Jul 7, 2025
5c9a9a1
Merge branch 'master' of https://github.com/FDA/open.fda.gov into mod…
Jul 7, 2025
03b163e
Get API Key issue fixed
Jul 8, 2025
7e854a1
Updated author information in package.json
dkrylovsb Jul 11, 2025
ed09fa2
resolved merge conflict
Jul 11, 2025
ec0870d
Merge branch 'modernization-openFDA' of https://github.com/FDA/open.f…
Jul 11, 2025
197ffc0
Merge branch 'master' of https://github.com/FDA/open.fda.gov into mod…
Jul 16, 2025
6a03e9b
fixed donut color issue, fixed custom search
Jul 18, 2025
6cf128b
fixed table scroll on pagination
Jul 25, 2025
e3f5301
Merge branch 'master' of https://github.com/FDA/open.fda.gov into nav…
Jul 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions src/components/DataDictionary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ interface DataDictionaryState {
}

class DataDictionary extends React.Component<{}, DataDictionaryState> {
tableBodyRef: React.RefObject<HTMLDivElement>;
constructor (props: Object) {
super(props)

this.tableBodyRef = React.createRef() as React.RefObject<HTMLDivElement>

const nounList: { [key: string]: string } = {
'animalandveterinary': 'Animal & Veterinary',
'drug': 'Human Drug',
Expand Down Expand Up @@ -230,6 +233,13 @@ class DataDictionary extends React.Component<{}, DataDictionaryState> {
})
}

handleChange() {
const body = document.querySelector('.ReactTable .rt-tbody') as HTMLDivElement;
if (body) {
body.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
}
}

handleEndpointChange (val: any) {
this.setState({
selectedEndpoint: val
Expand Down Expand Up @@ -552,6 +562,7 @@ const data_array: {
</a>
</div>
</div>
<div ref={this.tableBodyRef}>
<ReactTable
data={data}
getTrProps={(state: any, rowInfo: any, column: any, instance: any) => {
Expand All @@ -570,18 +581,32 @@ const data_array: {
className='table -striped -highlight'
filtered={this.state.filtered}
resized={this.state.resized}
onSortedChange={(sorted: any) => this.setState({ sorted })}
onPageChange={(page: any) => this.setState({ page })}
onSortedChange={(sorted: any) =>{
this.setState({ sorted })
this.handleChange()
}}
onPageChange={(page: any) =>{
this.handleChange()
this.setState({ page })

}}
onPageSizeChange={(pageSize: any, page: any) =>
this.setState({ page, pageSize })}
onResizedChange={(resized: any) => this.setState({ resized })}
onFilteredChange={(filtered: any) => this.setState({ filtered })}
onResizedChange={(resized: any) => {
this.setState({ resized })
this.handleChange()
}}
onFilteredChange={(filtered: any) => {
this.setState({ filtered })
this.handleChange()
}}
style={{
width: '100%',
height: '494px',
position: 'relative'
}}
/>
</div>
</section>
)
}
Expand Down
12 changes: 10 additions & 2 deletions src/components/FieldsHarmonization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ type State = {
}

class FieldsHarmonization extends React.Component<PROPS, State> {
tableBodyRef: React.RefObject<HTMLDivElement>;

constructor (props: PROPS) {
super(props)

this.tableBodyRef = React.createRef() as React.RefObject<HTMLDivElement>
const master_harmonization: Record<string, any> = props.master_harmonization

const nouns: string[] = []
Expand Down Expand Up @@ -319,6 +320,13 @@ class FieldsHarmonization extends React.Component<PROPS, State> {
}
}

handleChange() {
const body = document.querySelector('.ReactTable .rt-tbody') as HTMLDivElement;
if (body) {
body.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
}
}

render (): any {

if (Object.keys(this.state.data as any).length === 0 && (this.state.data as any).constructor === Object) {
Expand All @@ -339,7 +347,7 @@ class FieldsHarmonization extends React.Component<PROPS, State> {
})

return (
<section id='fields-harmonization'>
<section id='fields-harmonization' ref={this.tableBodyRef}>
<div className='noun-buttons' id='noun-buttons'>
{
noun_buttons
Expand Down
78 changes: 51 additions & 27 deletions src/components/Panels/PositionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ type PositionsPanelState = {
}

class PositionsPanel extends React.Component<{}, PositionsPanelState> {
constructor (props: Object) {
tableBodyRef: React.RefObject<HTMLDivElement>;
constructor(props: Object) {
super(props)

this.tableBodyRef = React.createRef() as React.RefObject<HTMLDivElement>
this.state = {
columns: [
{
Expand All @@ -41,7 +42,7 @@ class PositionsPanel extends React.Component<{}, PositionsPanelState> {
}}>
{/* <li>{row.value}</li>*/}
{row.value.map((v: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined, idx: any) =>
<li key={`key-${idx}`} style={{whiteSpace: "initial"}}>• {v}</li>
<li key={`key-${idx}`} style={{ whiteSpace: "initial" }}>• {v}</li>
)}
</ol>
)
Expand All @@ -53,12 +54,18 @@ class PositionsPanel extends React.Component<{}, PositionsPanelState> {
this.getData = this.getData.bind(this)
}

handleChange() {
const body = document.querySelector('.ReactTable .rt-tbody') as HTMLDivElement;
if (body) {
body.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
}
}

componentDidMount () {
componentDidMount() {
this.getData()
}

getData () {
getData() {
fetch(API_LINK + '/other/historicaldocumentanalytics.json?limit=1000')
.then(res => res.json())
.then((json => {
Expand All @@ -82,29 +89,46 @@ class PositionsPanel extends React.Component<{}, PositionsPanelState> {
}


render () {
render() {
return (
<ReactTable
data={this.state.data}
columns={this.state.columns}
pageSize={this.state.pageSize}
pageSizeOptions={[10, 25, 50, 100, 200, 250, 500, 1000]}
showPagination
minRows={10}
className='table -striped -highlight'
filtered={this.state.filtered}
resized={this.state.resized}
onSortedChange={(sorted: any) => this.setState({ sorted })}
onPageChange={(page: any) => this.setState({ page })}
onPageSizeChange={(pageSize: any, page: any) => this.setState({ page, pageSize })}
onResizedChange={(resized: any) => this.setState({ resized })}
onFilteredChange={(filtered: any) => this.setState({ filtered })}
style={{
width: '100%',
height: '494px',
position: 'relative'
}}
/>
<div ref={this.tableBodyRef}>
<ReactTable
data={this.state.data}
columns={this.state.columns}
pageSize={this.state.pageSize}
pageSizeOptions={[10, 25, 50, 100, 200, 250, 500, 1000]}
showPagination
minRows={10}
className='table -striped -highlight'
filtered={this.state.filtered}
resized={this.state.resized}
onSortedChange={(sorted: any) => {
this.setState({ sorted })
this.handleChange()
}}
onPageChange={(page: any) => {
this.setState({ page })
this.handleChange()
}}
onPageSizeChange={(pageSize: any, page: any) => {
this.setState({ page, pageSize })
this.handleChange()
}}
onResizedChange={(resized: any) => {
this.setState({ resized })
this.handleChange()
}}
onFilteredChange={(filtered: any) => {
this.setState({ filtered })
this.handleChange()
}}
style={{
width: '100%',
height: '494px',
position: 'relative'
}}
/>
</div>
)
}
}
Expand Down
20 changes: 16 additions & 4 deletions src/components/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, {useRef} from 'react';
import PropTypes from 'prop-types';

type tPROPS = {
Expand All @@ -15,14 +15,22 @@ const Table = (props:tPROPS) => {
cols: string[];
labels: any;
formatters: { [key: string]: (cell: any, row: any) => any };
containerRef: React.RefObject<HTMLTableSectionElement | null>;

constructor(props:tPROPS) {
super(props);
this.rows = props.rows;
this.cols = props.cols;
this.labels = (props as any).labels ? (props as any).labels : props.cols;
this.formatters = (props as any).formatters || {};
this.containerRef = React.createRef<HTMLTableSectionElement>();
}

componentDidMount(): void {
// window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
this.containerRef.current?.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
}

format(cell: any, row: any, col: string | number, rowIndex: any, colIndex: any) {
let formatter = this.formatters[col];
if(formatter) {
Expand Down Expand Up @@ -51,14 +59,18 @@ const Table = (props:tPROPS) => {
);
});

return (<table className="table">
return (
<div ref={this.containerRef} className="table-responsive">
<table className="table">
<thead>
{head}
</thead>
<tbody>
<tbody ref={this.containerRef}>
{body}
</tbody>
</table>);
</table>
</div>
);
}
}

Expand Down