Skip to content

Commit

Permalink
fix sonarlint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
varun2948 committed Jan 4, 2024
1 parent bbb367b commit f83f0c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 9 additions & 0 deletions frontend/src/components/projectDetail/downloadOsmData.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
*
* @param {string} title - The title of the file.
* @param {string} fileFormat - The format of the file.
* @param {string} feature_type - The feature type of the ffile.
* @return {Promise<void>} Promise that resolves when the download is complete.
*/
const downloadS3File = async (title, fileFormat, feature_type) => {
Expand Down Expand Up @@ -192,13 +193,21 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
selectedCategoryFormat.title === type.title &&
type?.featuretype?.map((typ) => (
<span
key={`${typ}_${selectedCategoryFormat.title}`}
onClick={() =>
downloadS3File(
selectedCategoryFormat.title,
selectedCategoryFormat.format,
typ,
)
}
onKeyUp={() =>
downloadS3File(
selectedCategoryFormat.title,
selectedCategoryFormat.format,
typ,
)
}
className="flex flex-row items-center pointer link hover-red color-inherit"
style={{ gap: '10px' }}
>
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/components/projectDetail/fileFormatCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import PropTypes from 'prop-types';
/**
* Renders a list of file formats as clickable links.
*
* @param {string} props.title - The title of the card.
* @param {Object[]} fileFormats - An array of file format objects.
* @param {string} fileFormats[].format - The format of the file.
* @param {Object} isDownloadingState - The downloading state object.
* @param {function} setSelectedCategoryFormat - The function to set the selected category format.
* @param {Object} selectedCategoryFormat - The selected category format object.
* @return {JSX.Element} The rendered list of file formats.
*/

Expand Down Expand Up @@ -62,6 +65,10 @@ export default FileFormatCard;
FileFormatCard.propTypes = {
title: PropTypes.string,
fileFormats: PropTypes.arrayOf(PropTypes.object),
downloadS3Data: PropTypes.func,
isDownloadingState: PropTypes.bool,
setSelectedCategoryFormat: PropTypes.func,
selectedCategoryFormat: PropTypes.objectOf({
title: PropTypes.string,
format: PropTypes.PropTypes.string,
}),
};

0 comments on commit f83f0c5

Please sign in to comment.