diff --git a/frontend/src/api/projects.js b/frontend/src/api/projects.js index dced0864b9..663ca61fda 100644 --- a/frontend/src/api/projects.js +++ b/frontend/src/api/projects.js @@ -5,6 +5,7 @@ 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); @@ -190,7 +191,7 @@ export const submitValidationTask = (projectId, payload, token, locale) => { export const useAvailableCountriesQuery = () => { const fetchGeojsonData = () => { - return axios.get(`https://underpass.live/availability.json`); + return axios.get(`${UNDERPASS_URL}/availability`); }; return useQuery({ diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index ba0ecd8d3b..7074b6e2cd 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -6,7 +6,7 @@ export const API_URL = process.env.REACT_APP_API_URL export const OHSOME_STATS_BASE_URL = process.env.REACT_APP_OHSOME_STATS_BASE_URL || 'https://stats.now.ohsome.org/api'; export const OHSOME_STATS_TOKEN = process.env.REACT_APP_OHSOME_STATS_TOKEN || ''; -export const UNDERPASS_URL = process.env.UNDERPASS_URL || 'https://underpass.hotosm.org'; +export const UNDERPASS_URL = process.env.REACT_APP_UNDERPASS_URL || 'https://underpass.hotosm.org'; // APPLICATION SETTINGS export const DEFAULT_LOCALE = process.env.REACT_APP_DEFAULT_LOCALE || 'en'; diff --git a/frontend/src/views/projectLiveMonitoring.js b/frontend/src/views/projectLiveMonitoring.js index 1b4931eff2..e0e7d588c8 100644 --- a/frontend/src/views/projectLiveMonitoring.js +++ b/frontend/src/views/projectLiveMonitoring.js @@ -9,6 +9,7 @@ import { UnderpassFeatureStats, UnderpassValidationStats, } from '@hotosm/underpass-ui'; +import { Link } from 'react-router-dom'; import { ProjectVisibilityBox } from '../components/projectDetail/visibilityBox'; import { ProjectStatusBox } from '../components/projectDetail/statusBox'; @@ -16,7 +17,7 @@ import { useSetTitleTag } from '../hooks/UseMetaTags'; import { useParams } from 'react-router-dom'; import { useFetch } from '../hooks/UseFetch'; import './projectLiveMonitoring.css'; -import { MAPBOX_TOKEN } from '../config'; +import { MAPBOX_TOKEN, UNDERPASS_URL } from '../config'; const availableImageryOptions = [ { label: 'OSM', value: 'osm' }, @@ -28,7 +29,7 @@ const availableImageryOptions = [ const availableImageryValues = availableImageryOptions.map((item) => item.value); const config = { - API_URL: `https://underpass.live:8000`, + API_URL: UNDERPASS_URL, MAPBOX_TOKEN: MAPBOX_TOKEN, // set default sources of Tasking Manager sources: { @@ -97,6 +98,7 @@ export function ProjectLiveMonitoring() { const [mapConfig, setMapConfig] = useState(config); const [realtimeList, setRealtimeList] = useState(false); const [realtimeMap, setRealtimeMap] = useState(false); + const [listAll, setListAll] = useState(false); // eslint-disable-next-line const [status, setStatus] = useState(statusList.UNSQUARED); // eslint-disable-next-line @@ -270,25 +272,39 @@ export function ProjectLiveMonitoring() { }} > {project && ( -