• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Code-4-Community / speak-for-the-trees-frontend / 8410875957

24 Mar 2024 05:10PM UTC coverage: 40.976% (+0.08%) from 40.899%
8410875957

push

github

web-flow
Revert "Merge pull request #327 from Code-4-Community/SK.add-map-to-tree-page" (#338)

This reverts commit 504ca7943, reversing
changes made to a9c31c362.

232 of 862 branches covered (26.91%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2 existing lines in 2 files now uncovered.

1078 of 2335 relevant lines covered (46.17%)

11.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/src/components/mapComponents/mapDisplays/selectorMapDisplay/index.tsx
1
import React from 'react';
2
import { Alert, Spin } from 'antd';
3
import styled from 'styled-components';
4
import {
5
  asyncRequestIsComplete,
6
  asyncRequestIsFailed,
7
  asyncRequestIsLoading,
8
} from '../../../../utils/asyncRequest';
9
import { MapGeoDataReducerState } from '../../ducks/types';
10
import SelectorMap from '../../maps/selectorMap';
11
import { SiteProps } from '../../../../containers/treePage/ducks/types';
12

13
const EmptyMapContainer = styled.div`
12✔
14
  text-align: center;
15
  padding: 20vh 5vw;
16
`;
17

18
interface SelectorMapDisplayProps {
19
  readonly neighborhoods: MapGeoDataReducerState['neighborhoodGeoData'];
20
  readonly sites: MapGeoDataReducerState['siteGeoData'];
21
  readonly onMove: (pos: google.maps.LatLng) => void;
22
  readonly site?: SiteProps;
23
  readonly setMarker: (marker: google.maps.Marker) => void;
24
}
25

26
const SelectorMapDisplay: React.FC<SelectorMapDisplayProps> = ({
12✔
27
  neighborhoods,
28
  sites,
29
  onMove,
30
  site,
31
  setMarker,
32
}) => (
UNCOV
33
  <>
×
34
    {asyncRequestIsComplete(neighborhoods) && asyncRequestIsComplete(sites) && (
×
35
      <SelectorMap
36
        neighborhoods={neighborhoods.result}
37
        sites={sites.result}
38
        onMove={onMove}
39
        site={site}
40
        setMarker={setMarker}
41
      />
42
    )}
43
    {(asyncRequestIsFailed(neighborhoods) || asyncRequestIsFailed(sites)) && (
×
44
      <EmptyMapContainer>
45
        <Alert
46
          message="Error"
47
          description="Map data failed to load"
48
          type="error"
49
          showIcon
50
        />
51
      </EmptyMapContainer>
52
    )}
53
    {(asyncRequestIsLoading(neighborhoods) || asyncRequestIsLoading(sites)) && (
×
54
      <EmptyMapContainer>
55
        <Spin size="large" />
56
      </EmptyMapContainer>
57
    )}
58
  </>
59
);
60

61
export default SelectorMapDisplay;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc