Skip to content

Commit

Permalink
turn off ts checking for old javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong committed Dec 14, 2023
1 parent 8a14196 commit 3706784
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions src/components/modals/DacDatasetsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,44 @@ import React, {useEffect, useState} from 'react';
import {BaseModal} from '../BaseModal';
import {DataUseTranslation} from '../../libs/dataUseTranslation';

// @ts-ignore
const DacDatasetsModal = (props) => {

const {showModal, onCloseRequest, datasets, dac} = props;
const [translatedDatasetRestrictions, setTranslatedDatasetRestrictions] = useState([]);

useEffect(() => {
const init = async () => {
// @ts-ignore
let translationPromises = datasets.map((dataset) =>
DataUseTranslation.translateDataUseRestrictions(dataset.dataUse));
const datasetTranslations = await Promise.all(translationPromises);
// @ts-ignore
setTranslatedDatasetRestrictions(datasetTranslations);
};

init();
}, [datasets]);

// @ts-ignore
const getProperty = (properties, propName) => {
return find(properties, p => {
return p.propertyName.toLowerCase() === propName.toLowerCase();
});
};

// @ts-ignore
const getPropertyValue = (properties, propName, defaultValue) => {
const prop = getProperty(properties, propName);
const val = get(prop, 'propertyValue', '');
return isEmpty(val) ? <span className={'disabled'}>{defaultValue}</span> : val;
};

// @ts-ignore
const getDbGapLinkValue = (properties) => {
const href = getPropertyValue(properties, 'dbGAP', '');
return href.length > 0 ?
<a href={href} target={'_blank'} className={'enabled'} rel="noreferrer">Link</a> :
<span className={'disabled'}>---</span>;
};

// @ts-ignore
const getStructuredUseRestrictionLink = (index) => {
if (translatedDatasetRestrictions[index]) {
const translatedDataUse = translatedDatasetRestrictions[index]
// @ts-ignore
.map((translations) => translations.description)
.join('\n');
const shortenedDataUse = translatedDataUse.length >= 75 ?
Expand All @@ -63,7 +55,6 @@ const DacDatasetsModal = (props) => {
}
};

// @ts-ignore
return <BaseModal
key={'dac_datasets_modal'}
id={'dacDatasetsModal'}
Expand Down Expand Up @@ -94,7 +85,6 @@ const DacDatasetsModal = (props) => {
</thead>
<tbody key={'dac_datasets_table_body'}>
{
// @ts-ignore
datasets.map((dataset, index) => {
return <tr key={'dac_datasets_table_row_' + index + '_' + dataset.datasetIdentifier}>
<td key={'1_' + dataset.datasetIdentifier} className={'table-items cell-size'}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"checkJs": false,
"esModuleInterop": true,
"jsx": "react-jsx",
"module": "esnext",
Expand Down

0 comments on commit 3706784

Please sign in to comment.