From 1ae2dd65b825325878b2db321b5f6deafc58f2d9 Mon Sep 17 00:00:00 2001
From: Deepak Pradhan
Date: Mon, 29 Jan 2024 11:40:39 +0545
Subject: [PATCH] fix: add Not available text with text changes
---
.../projectDetail/downloadOsmData.js | 29 +++++++++----------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/frontend/src/components/projectDetail/downloadOsmData.js b/frontend/src/components/projectDetail/downloadOsmData.js
index b1b84b998d..60ae789f72 100644
--- a/frontend/src/components/projectDetail/downloadOsmData.js
+++ b/frontend/src/components/projectDetail/downloadOsmData.js
@@ -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'],
},
];
@@ -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
@@ -299,13 +292,17 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
{typ.type} {selectedCategoryFormat.format}
- {`(${
- typ.size ? formatBytes(typ.size) : '-'
+ {`(${
+ typ.size ? formatBytes(typ.size) : 'N/A'
})`}
- {`Last Generated: ${
- typ.lastmod ? typ.lastmod : '-'
- }`}
+
+ {`Last Generated:`}
+
+ {' '}
+ {typ.lastmod ? typ.lastmod : 'No data Available'}
+
+
))}