Skip to content

Commit 8a481c9

Browse files
committed
SiteMap minor quality-life-tweaks
1 parent 20a069f commit 8a481c9

File tree

11 files changed

+98
-118
lines changed

11 files changed

+98
-118
lines changed

lib/components/SiteMap/SiteMapContainer.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ var SiteMapContainer = function SiteMapContainer(props) {
399399
iconSvg = feature.iconSvg,
400400
featureShape = feature.featureShape,
401401
_feature$style = feature.style,
402-
featureStyle = _feature$style === void 0 ? {} : _feature$style;
402+
featureStyle = _feature$style === void 0 ? {} : _feature$style,
403+
description = feature.description,
404+
descriptionFromParentDataFeatureKey = feature.descriptionFromParentDataFeatureKey,
405+
parentDataFeatureKey = feature.parentDataFeatureKey;
403406

404407
var handleChange = function handleChange(event) {
405408
dispatch({
@@ -477,7 +480,15 @@ var SiteMapContainer = function SiteMapContainer(props) {
477480
var indeterminate = false;
478481
var collapsed = false;
479482
var label = null;
480-
var tooltip = feature.description || null;
483+
var tooltip = null;
484+
485+
if (description) {
486+
tooltip = description;
487+
}
488+
489+
if (descriptionFromParentDataFeatureKey && parentDataFeatureKey && _SiteMapUtils.FEATURES[parentDataFeatureKey]) {
490+
tooltip = _SiteMapUtils.FEATURES[parentDataFeatureKey].description || null;
491+
}
481492

482493
if (feature.type === _SiteMapUtils.FEATURE_TYPES.GROUP) {
483494
collapsed = state.filters.features.collapsed.has(key);
@@ -570,9 +581,10 @@ var SiteMapContainer = function SiteMapContainer(props) {
570581
return children;
571582
} // set no transition by mock component
572583

573-
}, formControl) : formControl, !allChildren.length || collapsed ? null : /*#__PURE__*/_react.default.createElement("div", {
584+
}, formControl) : formControl, !allChildren.length ? null : /*#__PURE__*/_react.default.createElement("div", {
574585
style: {
575-
marginLeft: _Theme.default.spacing(3)
586+
marginLeft: _Theme.default.spacing(3),
587+
display: collapsed ? 'none' : 'block'
576588
}
577589
}, allChildren.filter(function (f) {
578590
return state.filters.features.available[f];
@@ -604,16 +616,18 @@ var SiteMapContainer = function SiteMapContainer(props) {
604616
/**
605617
Render - Full Component
606618
*/
607-
// MuiButtonBase-root MuiIconButton-root makeStyles-resizeButton-201 MuiIconButton-colorPrimary
608619

609620

610621
return /*#__PURE__*/_react.default.createElement("div", _extends({}, containerProps, {
611622
"aria-describedby": progressId
612623
}), state.filters.position === 'top' ? /*#__PURE__*/_react.default.createElement(_SiteMapFilters.default, null) : null, /*#__PURE__*/_react.default.createElement("div", _extends({
613624
ref: contentDivRef
614-
}, contentDivProps), view === _SiteMapUtils.VIEWS.MAP ? /*#__PURE__*/_react.default.createElement(_SiteMapLeaflet.default, null) : null, view === _SiteMapUtils.VIEWS.TABLE ? /*#__PURE__*/_react.default.createElement(_SiteMapTable.default, null) : null, renderVerticalResizeButton(), !state.filters.features.open ? null : /*#__PURE__*/_react.default.createElement("div", {
625+
}, contentDivProps), view === _SiteMapUtils.VIEWS.MAP ? /*#__PURE__*/_react.default.createElement(_SiteMapLeaflet.default, null) : null, view === _SiteMapUtils.VIEWS.TABLE ? /*#__PURE__*/_react.default.createElement(_SiteMapTable.default, null) : null, renderVerticalResizeButton(), /*#__PURE__*/_react.default.createElement("div", {
615626
ref: featuresRef,
616-
className: classes.featuresContainer
627+
className: classes.featuresContainer,
628+
style: {
629+
display: state.filters.features.open ? 'flex' : 'none'
630+
}
617631
}, Object.keys(_SiteMapUtils.FEATURES).filter(function (f) {
618632
return state.filters.features.available[f] && !_SiteMapUtils.FEATURES[f].parent;
619633
}).map(renderFeatureOption))), renderProgress(), state.filters.position === 'bottom' ? /*#__PURE__*/_react.default.createElement(_SiteMapFilters.default, null) : null, /*#__PURE__*/_react.default.createElement("div", {

lib/components/SiteMap/SiteMapFilters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ var SiteMapFilters = function SiteMapFilters() {
175175
title: viewTooltips[key],
176176
enterDelay: 500,
177177
enterNextDelay: 200,
178-
placement: filters.position === 'top' ? 'bottom-start' : 'top-start'
178+
placement: filters.position === 'bottom' ? 'bottom-start' : 'top-start'
179179
}, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, {
180180
value: key,
181181
selected: state.view.current === key,
@@ -185,7 +185,7 @@ var SiteMapFilters = function SiteMapFilters() {
185185
enterDelay: 500,
186186
enterNextDelay: 200,
187187
title: "Toggle visibility of the list of features (the legend)",
188-
placement: filters.position === 'top' ? 'bottom-end' : 'top-end'
188+
placement: filters.position === 'bottom' ? 'bottom-end' : 'top-end'
189189
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
190190
color: "primary",
191191
variant: filters.features.open ? 'contained' : 'outlined',

lib/components/SiteMap/SiteMapLeaflet.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,19 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
7373
borderColor: _Theme.default.colors.LIGHT_BLUE[400]
7474
}
7575
},
76+
'& div.leaflet-control-zoom': {
77+
border: 'none'
78+
},
7679
'& div.leaflet-bar': {
7780
borderRadius: '2px',
7881
boxShadow: 'unset',
7982
'& a': {
8083
color: _Theme.default.colors.LIGHT_BLUE[500],
8184
border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]),
85+
width: '26px',
86+
height: '26px',
87+
lineHeight: '26px',
88+
fontSize: '18px',
8289
'&:hover, &:active': {
8390
color: _Theme.default.colors.LIGHT_BLUE[400],
8491
borderColor: _Theme.default.colors.LIGHT_BLUE[400]

lib/components/SiteMap/SiteMapUtils.d.ts

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export namespace FEATURES {
147147
name: string;
148148
nameSingular: string;
149149
type: string;
150-
description: string;
151150
hideByDefault: boolean;
152151
dataSource: string;
153152
primaryIdOnly: boolean;
@@ -160,7 +159,6 @@ export namespace FEATURES {
160159
name: string;
161160
nameSingular: string;
162161
type: string;
163-
description: string;
164162
hideByDefault: boolean;
165163
dataSource: string;
166164
primaryIdOnly: boolean;
@@ -175,7 +173,6 @@ export namespace FEATURES {
175173
type: string;
176174
minZoom: number;
177175
dataSource: string;
178-
description: string;
179176
featureShape: string;
180177
style: {
181178
color: string;
@@ -186,15 +183,13 @@ export namespace FEATURES {
186183
name: string;
187184
type: string;
188185
minZoom: number;
189-
description: string;
190186
};
191187
export const WATERSHED_BOUNDARIES: {
192188
name: string;
193189
nameSingular: string;
194190
type: string;
195191
minZoom: number;
196192
dataSource: string;
197-
description: string;
198193
parent: string;
199194
featureShape: string;
200195
style: {
@@ -207,7 +202,6 @@ export namespace FEATURES {
207202
type: string;
208203
minZoom: number;
209204
dataSource: string;
210-
description: string;
211205
parent: string;
212206
featureShape: string;
213207
style: {
@@ -220,7 +214,6 @@ export namespace FEATURES {
220214
type: string;
221215
minZoom: number;
222216
dataSource: string;
223-
description: string;
224217
parent: string;
225218
featureShape: string;
226219
iconSvg: any;
@@ -246,7 +239,6 @@ export namespace FEATURES {
246239
type: string;
247240
minZoom: number;
248241
dataSource: string;
249-
description: string;
250242
parent: string;
251243
featureShape: string;
252244
style: {
@@ -260,7 +252,6 @@ export namespace FEATURES {
260252
type: string;
261253
minZoom: number;
262254
dataSource: string;
263-
description: string;
264255
parent: string;
265256
featureShape: string;
266257
style: {
@@ -272,7 +263,6 @@ export namespace FEATURES {
272263
name: string;
273264
type: string;
274265
minZoom: number;
275-
description: string;
276266
fetchingForFeatures: string[];
277267
};
278268
export const TOWERS: {
@@ -282,7 +272,6 @@ export namespace FEATURES {
282272
minZoom: number;
283273
dataSource: string;
284274
matchLocationType: string;
285-
description: string;
286275
parent: string;
287276
featureShape: string;
288277
iconScale: number;
@@ -297,7 +286,6 @@ export namespace FEATURES {
297286
minZoom: number;
298287
dataSource: string;
299288
matchLocationType: string;
300-
description: string;
301289
parent: string;
302290
featureShape: string;
303291
iconScale: number;
@@ -312,7 +300,6 @@ export namespace FEATURES {
312300
minZoom: number;
313301
dataSource: string;
314302
matchLocationType: string;
315-
description: string;
316303
parent: string;
317304
featureShape: string;
318305
iconScale: number;
@@ -466,7 +453,7 @@ export namespace FEATURES {
466453
name: string;
467454
nameSingular: string;
468455
type: string;
469-
description: string;
456+
descriptionFromParentDataFeatureKey: boolean;
470457
parent: string;
471458
parentDataFeatureKey: string;
472459
dataSource: string;
@@ -484,7 +471,7 @@ export namespace FEATURES {
484471
name: string;
485472
nameSingular: string;
486473
type: string;
487-
description: string;
474+
descriptionFromParentDataFeatureKey: boolean;
488475
parent: string;
489476
parentDataFeatureKey: string;
490477
minZoom: number;
@@ -498,7 +485,7 @@ export namespace FEATURES {
498485
name: string;
499486
nameSingular: string;
500487
type: string;
501-
description: string;
488+
descriptionFromParentDataFeatureKey: boolean;
502489
parent: string;
503490
parentDataFeatureKey: string;
504491
dataSource: string;
@@ -516,7 +503,7 @@ export namespace FEATURES {
516503
name: string;
517504
nameSingular: string;
518505
type: string;
519-
description: string;
506+
descriptionFromParentDataFeatureKey: boolean;
520507
parent: string;
521508
parentDataFeatureKey: string;
522509
dataSource: string;
@@ -534,7 +521,7 @@ export namespace FEATURES {
534521
name: string;
535522
nameSingular: string;
536523
type: string;
537-
description: string;
524+
descriptionFromParentDataFeatureKey: boolean;
538525
parent: string;
539526
parentDataFeatureKey: string;
540527
dataSource: string;
@@ -552,7 +539,6 @@ export namespace FEATURES {
552539
name: string;
553540
type: string;
554541
minZoom: number;
555-
description: string;
556542
};
557543
export const AQUATIC_BENCHMARKS: {
558544
name: string;
@@ -561,7 +547,6 @@ export namespace FEATURES {
561547
minZoom: number;
562548
dataSource: string;
563549
matchLocationType: string;
564-
description: string;
565550
parent: string;
566551
featureShape: string;
567552
iconScale: number;
@@ -573,14 +558,12 @@ export namespace FEATURES {
573558
name: string;
574559
type: string;
575560
minZoom: number;
576-
description: string;
577561
parent: string;
578562
};
579563
export const AQUATIC_OBSERVATIONAL_SAMPLING: {
580564
name: string;
581565
type: string;
582566
minZoom: number;
583-
description: string;
584567
parent: string;
585568
};
586569
export const AQUATIC_RIPARIAN_ASSESSMENTS: {
@@ -604,7 +587,6 @@ export namespace FEATURES {
604587
minZoom: number;
605588
dataSource: string;
606589
matchLocationType: string;
607-
description: string;
608590
parent: string;
609591
featureShape: string;
610592
iconScale: number;
@@ -649,7 +631,6 @@ export namespace FEATURES {
649631
minZoom: number;
650632
dataSource: string;
651633
matchLocationType: string;
652-
description: string;
653634
parent: string;
654635
featureShape: string;
655636
iconSvg: any;
@@ -663,7 +644,6 @@ export namespace FEATURES {
663644
minZoom: number;
664645
dataSource: string;
665646
matchLocationType: string;
666-
description: string;
667647
parent: string;
668648
featureShape: string;
669649
iconSvg: any;
@@ -677,7 +657,6 @@ export namespace FEATURES {
677657
minZoom: number;
678658
dataSource: string;
679659
matchLocationType: string;
680-
description: string;
681660
parent: string;
682661
featureShape: string;
683662
iconScale: number;
@@ -692,7 +671,6 @@ export namespace FEATURES {
692671
minZoom: number;
693672
dataSource: string;
694673
matchLocationType: string;
695-
description: string;
696674
parent: string;
697675
featureShape: string;
698676
iconSvg: any;
@@ -735,7 +713,6 @@ export namespace FEATURES {
735713
minZoom: number;
736714
dataSource: string;
737715
matchLocationType: string;
738-
description: string;
739716
parent: string;
740717
featureShape: string;
741718
iconScale: number;
@@ -746,7 +723,6 @@ export namespace FEATURES {
746723
export const SITE_MARKERS: {
747724
name: string;
748725
type: string;
749-
description: string;
750726
maxZoom: number;
751727
};
752728
export const TERRESTRIAL_CORE_SITES: {

0 commit comments

Comments
 (0)