diff --git a/backend/src/images/image.service.ts b/backend/src/images/image.service.ts index ac2ebcbe..aa23921a 100644 --- a/backend/src/images/image.service.ts +++ b/backend/src/images/image.service.ts @@ -19,10 +19,9 @@ export class ImageService { * @author Kerbourc'h */ formatImagePath(image: IImage) { - image.image_path = image.image_path.replace( - process.env.IMAGE_STORE_PATH, - '/cdn/', - ); + image.image_path = image.image_path + .replace(process.env.IMAGE_STORE_PATH, '/cdn/') + .replace('/home/fish/images/', '/cdn/'); return image; } diff --git a/frontend/src/Components/RoadDetails/ImageGallery.tsx b/frontend/src/Components/RoadDetails/ImageGallery.tsx index 508960bf..c2fa2548 100644 --- a/frontend/src/Components/RoadDetails/ImageGallery.tsx +++ b/frontend/src/Components/RoadDetails/ImageGallery.tsx @@ -41,15 +41,14 @@ const ImageGallery: React.FC = ({ rangeDashCamImages }) => { getImagesForASurvey(id, true, (images) => { setCameraImages( images.filter((image) => { - console.log('santi0', rangeDashCamImages); if (rangeDashCamImages === undefined || rangeDashCamImages === null) return true; return ( - image.distance_way >= + image.distance_survey >= (rangeDashCamImages.minRange - 5 > 0 ? rangeDashCamImages.minRange - 5 : 0) && - image.distance_way <= + image.distance_survey <= (rangeDashCamImages.maxRange + 5 < rangeDashCamImages.maxRangeSurvey ? rangeDashCamImages.maxRange + 5 @@ -57,7 +56,6 @@ const ImageGallery: React.FC = ({ rangeDashCamImages }) => { ); }), ); - console.log('santiVIVA', cameraImages); }); } else if (type === 'paths') { getImagesForWays(id.split(','), true, (images) => { diff --git a/frontend/src/Components/RoadDetails/MapArea.tsx b/frontend/src/Components/RoadDetails/MapArea.tsx index 7347261a..223c3524 100644 --- a/frontend/src/Components/RoadDetails/MapArea.tsx +++ b/frontend/src/Components/RoadDetails/MapArea.tsx @@ -14,6 +14,7 @@ interface Props { /** The distance from left to right displayed on surface images */ rangeDashCamImages?: IRangeForDashCam | null; } + /** * The map area op the road details(road inspect) page */ @@ -45,4 +46,8 @@ const MapArea: React.FC = ({ ); }; +// {rangeDashCamImages !== undefined && rangeDashCamImages !== null ? ( +// +// ) : null} should we put something like this? + export default MapArea; diff --git a/frontend/src/models/models.ts b/frontend/src/models/models.ts index 890a2d15..244002ba 100644 --- a/frontend/src/models/models.ts +++ b/frontend/src/models/models.ts @@ -42,9 +42,9 @@ export interface Conditions { } export interface IRangeForDashCam { - minRange: number; - maxRange: number; - maxRangeSurvey: number; + minRange: number; + maxRange: number; + maxRangeSurvey: number; } export interface Path { diff --git a/frontend/src/pages/Inspect.tsx b/frontend/src/pages/Inspect.tsx index 761d4f89..39de4c2f 100644 --- a/frontend/src/pages/Inspect.tsx +++ b/frontend/src/pages/Inspect.tsx @@ -128,8 +128,6 @@ const Inspect: FC = () => { }, [data]); useEffect(() => { - console.log('santi33', roadDistanceLeftToRight); - console.log('santi44', chartData); if ( gradientLineData === undefined || roadDistanceLeftToRight === null || @@ -142,7 +140,6 @@ const Inspect: FC = () => { maxRange: roadDistanceLeftToRight[1], maxRangeSurvey: Math.max(...chartData.map((item) => item.maxX)) + 1, }); - console.log('santi55 rangeForDashCamImages', rangeForDashCamImages); }, [roadDistanceLeftToRight]); useEffect(() => {