Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add Not available text with text changes #52

Merged
Merged
Changes from all commits
Commits
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
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
Loading