Skip to content

Commit

Permalink
SiteMap minor quality-life-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Frencil committed Aug 11, 2020
1 parent 20a069f commit 8a481c9
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 118 deletions.
28 changes: 21 additions & 7 deletions lib/components/SiteMap/SiteMapContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,10 @@ var SiteMapContainer = function SiteMapContainer(props) {
iconSvg = feature.iconSvg,
featureShape = feature.featureShape,
_feature$style = feature.style,
featureStyle = _feature$style === void 0 ? {} : _feature$style;
featureStyle = _feature$style === void 0 ? {} : _feature$style,
description = feature.description,
descriptionFromParentDataFeatureKey = feature.descriptionFromParentDataFeatureKey,
parentDataFeatureKey = feature.parentDataFeatureKey;

var handleChange = function handleChange(event) {
dispatch({
Expand Down Expand Up @@ -477,7 +480,15 @@ var SiteMapContainer = function SiteMapContainer(props) {
var indeterminate = false;
var collapsed = false;
var label = null;
var tooltip = feature.description || null;
var tooltip = null;

if (description) {
tooltip = description;
}

if (descriptionFromParentDataFeatureKey && parentDataFeatureKey && _SiteMapUtils.FEATURES[parentDataFeatureKey]) {
tooltip = _SiteMapUtils.FEATURES[parentDataFeatureKey].description || null;
}

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

}, formControl) : formControl, !allChildren.length || collapsed ? null : /*#__PURE__*/_react.default.createElement("div", {
}, formControl) : formControl, !allChildren.length ? null : /*#__PURE__*/_react.default.createElement("div", {
style: {
marginLeft: _Theme.default.spacing(3)
marginLeft: _Theme.default.spacing(3),
display: collapsed ? 'none' : 'block'
}
}, allChildren.filter(function (f) {
return state.filters.features.available[f];
Expand Down Expand Up @@ -604,16 +616,18 @@ var SiteMapContainer = function SiteMapContainer(props) {
/**
Render - Full Component
*/
// MuiButtonBase-root MuiIconButton-root makeStyles-resizeButton-201 MuiIconButton-colorPrimary


return /*#__PURE__*/_react.default.createElement("div", _extends({}, containerProps, {
"aria-describedby": progressId
}), state.filters.position === 'top' ? /*#__PURE__*/_react.default.createElement(_SiteMapFilters.default, null) : null, /*#__PURE__*/_react.default.createElement("div", _extends({
ref: contentDivRef
}, 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", {
}, 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", {
ref: featuresRef,
className: classes.featuresContainer
className: classes.featuresContainer,
style: {
display: state.filters.features.open ? 'flex' : 'none'
}
}, Object.keys(_SiteMapUtils.FEATURES).filter(function (f) {
return state.filters.features.available[f] && !_SiteMapUtils.FEATURES[f].parent;
}).map(renderFeatureOption))), renderProgress(), state.filters.position === 'bottom' ? /*#__PURE__*/_react.default.createElement(_SiteMapFilters.default, null) : null, /*#__PURE__*/_react.default.createElement("div", {
Expand Down
4 changes: 2 additions & 2 deletions lib/components/SiteMap/SiteMapFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ var SiteMapFilters = function SiteMapFilters() {
title: viewTooltips[key],
enterDelay: 500,
enterNextDelay: 200,
placement: filters.position === 'top' ? 'bottom-start' : 'top-start'
placement: filters.position === 'bottom' ? 'bottom-start' : 'top-start'
}, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, {
value: key,
selected: state.view.current === key,
Expand All @@ -185,7 +185,7 @@ var SiteMapFilters = function SiteMapFilters() {
enterDelay: 500,
enterNextDelay: 200,
title: "Toggle visibility of the list of features (the legend)",
placement: filters.position === 'top' ? 'bottom-end' : 'top-end'
placement: filters.position === 'bottom' ? 'bottom-end' : 'top-end'
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
color: "primary",
variant: filters.features.open ? 'contained' : 'outlined',
Expand Down
7 changes: 7 additions & 0 deletions lib/components/SiteMap/SiteMapLeaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,19 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
borderColor: _Theme.default.colors.LIGHT_BLUE[400]
}
},
'& div.leaflet-control-zoom': {
border: 'none'
},
'& div.leaflet-bar': {
borderRadius: '2px',
boxShadow: 'unset',
'& a': {
color: _Theme.default.colors.LIGHT_BLUE[500],
border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]),
width: '26px',
height: '26px',
lineHeight: '26px',
fontSize: '18px',
'&:hover, &:active': {
color: _Theme.default.colors.LIGHT_BLUE[400],
borderColor: _Theme.default.colors.LIGHT_BLUE[400]
Expand Down
34 changes: 5 additions & 29 deletions lib/components/SiteMap/SiteMapUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
hideByDefault: boolean;
dataSource: string;
primaryIdOnly: boolean;
Expand All @@ -160,7 +159,6 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
hideByDefault: boolean;
dataSource: string;
primaryIdOnly: boolean;
Expand All @@ -175,7 +173,6 @@ export namespace FEATURES {
type: string;
minZoom: number;
dataSource: string;
description: string;
featureShape: string;
style: {
color: string;
Expand All @@ -186,15 +183,13 @@ export namespace FEATURES {
name: string;
type: string;
minZoom: number;
description: string;
};
export const WATERSHED_BOUNDARIES: {
name: string;
nameSingular: string;
type: string;
minZoom: number;
dataSource: string;
description: string;
parent: string;
featureShape: string;
style: {
Expand All @@ -207,7 +202,6 @@ export namespace FEATURES {
type: string;
minZoom: number;
dataSource: string;
description: string;
parent: string;
featureShape: string;
style: {
Expand All @@ -220,7 +214,6 @@ export namespace FEATURES {
type: string;
minZoom: number;
dataSource: string;
description: string;
parent: string;
featureShape: string;
iconSvg: any;
Expand All @@ -246,7 +239,6 @@ export namespace FEATURES {
type: string;
minZoom: number;
dataSource: string;
description: string;
parent: string;
featureShape: string;
style: {
Expand All @@ -260,7 +252,6 @@ export namespace FEATURES {
type: string;
minZoom: number;
dataSource: string;
description: string;
parent: string;
featureShape: string;
style: {
Expand All @@ -272,7 +263,6 @@ export namespace FEATURES {
name: string;
type: string;
minZoom: number;
description: string;
fetchingForFeatures: string[];
};
export const TOWERS: {
Expand All @@ -282,7 +272,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand All @@ -297,7 +286,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand All @@ -312,7 +300,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand Down Expand Up @@ -466,7 +453,7 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
descriptionFromParentDataFeatureKey: boolean;
parent: string;
parentDataFeatureKey: string;
dataSource: string;
Expand All @@ -484,7 +471,7 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
descriptionFromParentDataFeatureKey: boolean;
parent: string;
parentDataFeatureKey: string;
minZoom: number;
Expand All @@ -498,7 +485,7 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
descriptionFromParentDataFeatureKey: boolean;
parent: string;
parentDataFeatureKey: string;
dataSource: string;
Expand All @@ -516,7 +503,7 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
descriptionFromParentDataFeatureKey: boolean;
parent: string;
parentDataFeatureKey: string;
dataSource: string;
Expand All @@ -534,7 +521,7 @@ export namespace FEATURES {
name: string;
nameSingular: string;
type: string;
description: string;
descriptionFromParentDataFeatureKey: boolean;
parent: string;
parentDataFeatureKey: string;
dataSource: string;
Expand All @@ -552,7 +539,6 @@ export namespace FEATURES {
name: string;
type: string;
minZoom: number;
description: string;
};
export const AQUATIC_BENCHMARKS: {
name: string;
Expand All @@ -561,7 +547,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand All @@ -573,14 +558,12 @@ export namespace FEATURES {
name: string;
type: string;
minZoom: number;
description: string;
parent: string;
};
export const AQUATIC_OBSERVATIONAL_SAMPLING: {
name: string;
type: string;
minZoom: number;
description: string;
parent: string;
};
export const AQUATIC_RIPARIAN_ASSESSMENTS: {
Expand All @@ -604,7 +587,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand Down Expand Up @@ -649,7 +631,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconSvg: any;
Expand All @@ -663,7 +644,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconSvg: any;
Expand All @@ -677,7 +657,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand All @@ -692,7 +671,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconSvg: any;
Expand Down Expand Up @@ -735,7 +713,6 @@ export namespace FEATURES {
minZoom: number;
dataSource: string;
matchLocationType: string;
description: string;
parent: string;
featureShape: string;
iconScale: number;
Expand All @@ -746,7 +723,6 @@ export namespace FEATURES {
export const SITE_MARKERS: {
name: string;
type: string;
description: string;
maxZoom: number;
};
export const TERRESTRIAL_CORE_SITES: {
Expand Down
Loading

0 comments on commit 8a481c9

Please sign in to comment.