Skip to content

Commit

Permalink
Merge pull request #6306 from hotosm/revert-6299-feature/liveMonitori…
Browse files Browse the repository at this point in the history
…ngDQ

Revert "Live Monitoring View"
  • Loading branch information
ramyaragupathy committed Mar 26, 2024
2 parents ea0b579 + ffab133 commit 16a44f4
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 850 deletions.
2 changes: 0 additions & 2 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ TM_DEFAULT_LOCALE=en
# TM_SENTRY_BACKEND_DSN=https://foo.ingest.sentry.io/1234567
# TM_SENTRY_FRONTEND_DSN=https://bar.ingest.sentry.io/8901234

# Underpass API URL (for project live monitoring feature)
UNDERPASS_URL=https://underpass.hotosm.org

#EXPORT TOOL Integration with 0(Disable) and 1(Enable) and S3 URL for Export Tool
#EXPORT_TOOL_S3_URL=https://foorawdataapi.s3.amazonaws.com
Expand Down
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"@formatjs/intl-relativetimeformat": "^11.2.4",
"@formatjs/macro": "^0.2.8",
"@hotosm/id": "^2.21.1",
"@hotosm/underpass-ui": "^0.0.4",
"@hotosm/iso-countries-languages": "^1.1.2",
"@mapbox/mapbox-gl-draw": "^1.4.1",
"@mapbox/mapbox-gl-geocoder": "^5.0.1",
Expand Down
14 changes: 0 additions & 14 deletions frontend/src/api/projects.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import axios from 'axios';
import { subMonths, format } from 'date-fns';
import { useQuery } from '@tanstack/react-query';
import { useSelector } from 'react-redux';

import { remapParamsToAPI } from '../utils/remapParamsToAPI';
import api from './apiClient';
import { UNDERPASS_URL } from '../config';

export const useProjectsQuery = (fullProjectsQuery, action) => {
const token = useSelector((state) => state.auth.token);
Expand Down Expand Up @@ -189,18 +187,6 @@ export const submitValidationTask = (projectId, payload, token, locale) => {
);
};

export const useAvailableCountriesQuery = () => {
const fetchGeojsonData = () => {
return axios.get(`${UNDERPASS_URL}/availability`);
};

return useQuery({
queryKey: ['priority-geojson'],
queryFn: fetchGeojsonData,
select: (res) => res.data,
});
};

const backendToQueryConversion = {
difficulty: 'difficulty',
campaign: 'campaign',
Expand Down
25 changes: 1 addition & 24 deletions frontend/src/components/projectDetail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import { PermissionBox } from './permissionBox';
import { CustomButton } from '../button';
import { ProjectInfoPanel } from './infoPanel';
import { OSMChaButton } from './osmchaButton';
import { LiveViewButton } from './liveViewButton';
import { useSetProjectPageTitleTag } from '../../hooks/UseMetaTags';
import { useProjectContributionsQuery, useProjectTimelineQuery, useAvailableCountriesQuery } from '../../api/projects';
import { useProjectContributionsQuery, useProjectTimelineQuery } from '../../api/projects';
import { Alert } from '../alert';

import './styles.scss';
Expand Down Expand Up @@ -154,16 +153,6 @@ export const ProjectDetail = (props) => {
</Link>
);

const { data } = useAvailableCountriesQuery();

// check if the project has live monitoring feature enabled
// based on the country list provided by available.json
const hasLiveMonitoringFeature = !data
? false
: props.project.countryTag.some((country) =>
data.countries.some((item) => country.toLowerCase() === item.toLowerCase()),
);

return (
<div className={`${props.className || 'blue-dark'}`}>
<div className="db flex-l tasks-map-height">
Expand Down Expand Up @@ -357,18 +346,6 @@ export const ProjectDetail = (props) => {
project={props.project}
className="bg-white blue-dark ba b--grey-light pa3"
/>

{/*
show live view button only for published projects &
when the project has live monitoring feature
*/}
{props.project.status === 'PUBLISHED' && hasLiveMonitoringFeature && (
<LiveViewButton
projectId={props.project.projectId}
className="bg-white blue-dark ba b--grey-light pa3"
/>
)}

<DownloadAOIButton
projectId={props.project.projectId}
className="bg-white blue-dark ba b--grey-light pa3"
Expand Down
20 changes: 0 additions & 20 deletions frontend/src/components/projectDetail/liveViewButton.js

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/src/components/projectDetail/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,6 @@ export default defineMessages({
id: 'project.detail.sections.contributions.osmcha',
defaultMessage: 'Changesets in OSMCha',
},
live: {
id: 'project.detail.sections.contributions.live',
defaultMessage: 'Live',
},
liveMonitoring: {
id: 'project.detail.sections.contributions.liveMonitoring',
defaultMessage: 'Live monitoring',
},
changesets: {
id: 'project.detail.sections.contributions.changesets',
defaultMessage: 'Changesets',
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ export const MAP_STYLE = MAPBOX_TOKEN
export const MAPBOX_RTL_PLUGIN_URL =
'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js';

export const UNDERPASS_URL = process.env.REACT_APP_UNDERPASS_URL || 'https://underpass.hotosm.org';

export const DROPZONE_SETTINGS = {
accept: {
'image/*': ['.jpeg', '.jpg', '.png', '.webp', '.gif'],
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@ export const router = createBrowserRouter(
}}
ErrorBoundary={FallbackComponent}
/>
<Route
path="projects/:id/live"
lazy={async () => {
const { ProjectLiveMonitoring } = await import(
'./views/projectLiveMonitoring' /* webpackChunkName: "projectLiveMonitoring" */
);
return { Component: ProjectLiveMonitoring };
}}
ErrorBoundary={FallbackComponent}
/>
<Route
path="projects/:id/stats"
lazy={async () => {
Expand Down
37 changes: 0 additions & 37 deletions frontend/src/views/projectLiveMonitoring.css

This file was deleted.

0 comments on commit 16a44f4

Please sign in to comment.