Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <tsmock@meta.com>
  • Loading branch information
tsmock committed May 13, 2024
1 parent 2271d78 commit fc33983
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
3 changes: 1 addition & 2 deletions frontend/src/network/genericJSONRequest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { handleErrors } from '../utils/promise';
import { API_URL } from '../config';


/**
* Fetch data from an external JSON API
* @param {string} url The url to fetch from
Expand All @@ -10,7 +9,7 @@ import { API_URL } from '../config';
*/
export function fetchExternalJSONAPI(url, init = {}): Promise<*> {
if (!init.headers) {
init.headers = {'Content-Type': 'application/json'};
init.headers = { 'Content-Type': 'application/json' };
}
init.headers['Content-Type'] = 'application/json';

Expand Down
60 changes: 35 additions & 25 deletions frontend/src/views/projectLiveMonitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function ProjectLiveMonitoring() {

const [areaOfInterest, setAreaOfInterest] = useState(null);
const [project, setProject] = useState(null);
const defaultComment = `${TM_DEFAULT_CHANGESET_COMMENT}-${id}`.replace("#","");
const defaultComment = `${TM_DEFAULT_CHANGESET_COMMENT}-${id}`.replace('#', '');

const hasLiveMonitoringFeature = useHasLiveMonitoringFeature();

Expand Down Expand Up @@ -270,45 +270,53 @@ export function ProjectLiveMonitoring() {
</>
)}
{project && areaOfInterest && (
<><div className="border-b-2 pb-5 space-y-3">
<UnderpassFeatureStats
tags={tags}
hashtag={defaultComment}
featureType={featureType}
apiUrl={underpassConfig.API_URL}
area={areaOfInterest} />
<UnderpassValidationStats
tags={tags}
hashtag={defaultComment}
featureType={featureType}
apiUrl={underpassConfig.API_URL}
status="badgeom"
area={areaOfInterest} />
</div><div className="border-b-2 py-5 mb-4">
<>
<div className="border-b-2 pb-5 space-y-3">
<UnderpassFeatureStats
tags={tags}
hashtag={defaultComment}
featureType={featureType}
apiUrl={underpassConfig.API_URL}
area={areaOfInterest}
/>
<UnderpassValidationStats
tags={tags}
hashtag={defaultComment}
featureType={featureType}
apiUrl={underpassConfig.API_URL}
status="badgeom"
area={areaOfInterest}
/>
</div>
<div className="border-b-2 py-5 mb-4">
<form className="space-x-2">
<input
onChange={() => {
setRealtimeList(!realtimeList);
} }
}}
name="liveListCheckbox"
type="checkbox" />
type="checkbox"
/>
<label target="liveListCheckbox">Live list</label>
<input
onChange={() => {
setRealtimeMap(!realtimeMap);
} }
}}
name="liveMapCheckbox"
type="checkbox" />
type="checkbox"
/>
<label target="liveMapCheckbox">Live map</label>
<input
onChange={() => {
setListAll(!listAll);
} }
}}
name="listAllCheckbox"
type="checkbox" />
type="checkbox"
/>
<label target="listAllCheckbox">List all</label>
</form>
</div><UnderpassFeatureList
</div>
<UnderpassFeatureList
style={{
display: 'flex',
flexFlow: 'column',
Expand All @@ -326,7 +334,7 @@ export function ProjectLiveMonitoring() {
const tags = JSON.stringify(feature.tags);
const status = feature.status;
setActiveFeature({ properties: { tags, status }, ...feature });
} }
}}
realtime={realtimeList}
config={underpassConfig}
status={listAll ? '' : status}
Expand All @@ -335,7 +343,9 @@ export function ProjectLiveMonitoring() {
if (mostRecentFeature) {
setCoords([mostRecentFeature.lat, mostRecentFeature.lon]);
}
} } /></>
}}
/>
</>
)}
</div>
</div>
Expand Down

0 comments on commit fc33983

Please sign in to comment.