Skip to content

Commit

Permalink
Merge pull request #52 from varun2948/feat-osm-download
Browse files Browse the repository at this point in the history
fix: add Not available text with text changes
  • Loading branch information
varun2948 authored Jan 29, 2024
2 parents 26f3c76 + 1ae2dd6 commit e9b5a33
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions frontend/src/components/projectDetail/downloadOsmData.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ export const TITLED_ICONS = [
title: 'roads',
value: 'ROADS',
featuretype: [{ type: 'lines' }],
formats: ['geojson', 'shp', 'kml'],
formats: ['GeoJSON', 'shp', 'kml'],
},
{
Icon: HomeIcon,
title: 'buildings',
value: 'BUILDINGS',
featuretype: [{ type: 'polygons' }],
formats: ['geojson', 'shp', 'kml'],
formats: ['GeoJSON', 'shp', 'kml'],
},
{
Icon: WavesIcon,
title: 'waterways',
value: 'WATERWAYS',
featuretype: [{ type: 'polygons' }, { type: 'lines' }],
formats: ['geojson', 'shp', 'kml'],
formats: ['GeoJSON', 'shp', 'kml'],
},
{
Icon: TaskIcon,
title: 'landuse',
value: 'LAND_USE',
featuretype: [{ type: 'points' }, { type: 'polygons' }],
formats: ['geojson', 'shp', 'kml'],
formats: ['GeoJSON', 'shp', 'kml'],
},
];

Expand Down Expand Up @@ -79,13 +79,6 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
try {
// Fetch the file from the S3 URL
const responsehead = await fetch(downloadUrl, { method: 'HEAD' });
// console.log(responsehead, 'responsehead');
// const lastMod = responsehead.headers.get('Last-Modified');
// console.log(lastMod, 'lastMod');
// console.log(
// responsehead.headers.get('Content-Length'),
// 'responsehead.headers.get(Last-Modified)',
// );
window.location.href = downloadUrl;

// Check if the request was successful
Expand Down Expand Up @@ -299,13 +292,17 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
<span className="ml2">
{typ.type} {selectedCategoryFormat.format}
</span>
<span className="ml1 f7 mid-gray">{`(${
typ.size ? formatBytes(typ.size) : '-'
<span className="ml1 f7 black">{`(${
typ.size ? formatBytes(typ.size) : 'N/A'
})`}</span>
</p>
<span className="f7 mid-gray">{`Last Generated: ${
typ.lastmod ? typ.lastmod : '-'
}`}</span>
<span className="f7 mid-gray">
{`Last Generated:`}
<span className="black">
{' '}
{typ.lastmod ? typ.lastmod : 'No data Available'}
</span>
</span>
</div>
</span>
))}
Expand Down

0 comments on commit e9b5a33

Please sign in to comment.