Interactive interface for browsing global, full-resolution satellite imagery
Add all label to all class toggle #2931
Ben King9ea8393c8dcd
diff --git a/web/css/switch.css b/web/css/switch.cssindex a69abc2dd..02c075dfc 100644--- a/web/css/switch.css+++ b/web/css/switch.css@@ -2,11 +2,18 @@display: flex;margin-bottom: 7px;}-.react-switch.header {- margin-bottom: 14px;- flex-direction: row-reverse;- .switch-label-text {- font-size: 14px;++.classification-switch-header {+ display: flex;+ justify-content: space-between;+ .react-switch {+ flex-direction: row-reverse;+ }+ .react-switch-case {+ width: 30px+ }+ .react-switch-label-case{+ width: 20px}}.react-switch .switch-col {diff --git a/web/js/components/layer/settings/classification-toggle.js b/web/js/components/layer/settings/classification-toggle.jsindex 18b3efc49..1f4a7f689 100644--- a/web/js/components/layer/settings/classification-toggle.js+++ b/web/js/components/layer/settings/classification-toggle.js@@ -18,18 +18,22 @@ export default function ClassificationToggle(props) {return (<div className="layer-classification-toggle settings-component">- <Switch- id="header-disable"- key="header-disable"- label="Disable/Enable"- containerClassAddition="header"- active={!isEnableAllSelected}- toggle={() => {- const arrayOfIndices = !isEnableAllSelected ? [...Array(switchLength).keys()] : [];- toggleAll(arrayOfIndices);- toggleEnableAll(!isEnableAllSelected);- }}- />+ <div className="classification-switch-header">+ <h2 className="wv-header">Disable/Enable</h2>+ <Switch+ id="header-disable"+ key="header-disable"+ label="All"+ active={!isEnableAllSelected}+ containerClassAddition="header"+ toggle={() => {+ const arrayOfIndices = !isEnableAllSelected ? [...Array(switchLength).keys()] : [];+ toggleAll(arrayOfIndices);+ toggleEnableAll(!isEnableAllSelected);+ }}+ />++ </div><Scrollbar style={{ maxHeight: `${height}px` }}>{legend.colors.map((color, index) => {const id = legend.id + index;diff --git a/web/js/components/layer/settings/settings.js b/web/js/components/layer/settings/settings.jsindex c1c348a62..9002748ef 100644--- a/web/js/components/layer/settings/settings.js+++ b/web/js/components/layer/settings/settings.js@@ -71,7 +71,7 @@ class LayerSettings extends React.Component {setThresholdRange,layer,toggleClassification,- toggleAllClassification,+ toggleAllClassifications,screenHeight,} = this.props;const { activeIndex } = this.state;@@ -103,7 +103,7 @@ class LayerSettings extends React.Component {palette={palette}toggle={(classIndex) => toggleClassification(layer.id, classIndex, i, groupName)}legend={legend}- toggleAll={(disabledArray) => { toggleAllClassification(layer.id, disabledArray, i, groupName); }}+ toggleAll={(disabledArray) => { toggleAllClassifications(layer.id, disabledArray, i, groupName); }}/></TabPane>);@@ -184,7 +184,7 @@ class LayerSettings extends React.Component {groupName,layer,toggleClassification,- toggleAllClassification,+ toggleAllClassifications,screenHeight,} = this.props;const paletteLegends = getPaletteLegends(layer.id);@@ -204,7 +204,7 @@ class LayerSettings extends React.Component {palette={palette}toggle={(classIndex) => toggleClassification(layer.id, classIndex, 0, groupName)}legend={legend}- toggleAll={(disabledArray) => { toggleAllClassification(layer.id, disabledArray, 0, groupName); }}+ toggleAll={(disabledArray) => { toggleAllClassifications(layer.id, disabledArray, 0, groupName); }}/>);}@@ -337,7 +337,7 @@ const mapDispatchToProps = (dispatch) => ({setToggledClassification(layerId, classIndex, index, groupName),);},- toggleAllClassification: (layerId, disabledArray, index, groupName) => {+ toggleAllClassifications: (layerId, disabledArray, index, groupName) => {dispatch(refreshDisabledClassification(layerId, disabledArray, index, groupName),);@@ -398,6 +398,6 @@ LayerSettings.propTypes = {setStyle: PropTypes.func,setThresholdRange: PropTypes.func,toggleClassification: PropTypes.func,- toggleAllClassification: PropTypes.func,+ toggleAllClassifications: PropTypes.func,vectorStyles: PropTypes.object,};