Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
checkOverlayComponentVisibility() {
const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
const contributing = lang.getObject('appState.app.contributing.active',false,this);
if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
} else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
AppActions.hideComponent(componentNames.SELECTED_SHARES);
}
if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
} else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
AppActions.hideComponent(componentNames.CONTRIBUTE);
}
}
checkOverlayComponentVisibility() {
const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
const contributing = lang.getObject('appState.app.contributing.active',false,this);
if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
} else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
AppActions.hideComponent(componentNames.SELECTED_SHARES);
}
if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
} else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
AppActions.hideComponent(componentNames.CONTRIBUTE);
}
}
render() {
const viewerClasses = Helper.classnames(['viewer'],{
contributing: this.props.contributing.active
});
const shareConfigWithAction = $.extend(true,{},this.props.sharing,{
shareLinkAction: this.props.showComponent.bind(this,componentNames.SHARE_LINK)
});
return (
<div>
<style></style>
{!this.props.contributing.active || !this.props.mode.isMobile ? (
<header>= 0}
participateAction={this.props.updateContributeState.bind(this,{active: true})}
{...this.props.components.header}
{...this.props.components.common}
sharing={shareConfigWithAction}
portal={this.props.portal}
loading={this.props.loading}>
</header>
) : null}
= 0}
saveActions={this.props.introSaveActions}
showLoader={this.props.loading.map}
showExploreActionButton={this.props.loading.map}</div>
removes.forEach((component) => {
switch (component) {
case componentNames.INTRO:
this.hideIntro(options);
if (this.visibleComponents.indexOf(componentNames.MAP) < 0 && this.visibleComponents.indexOf(componentNames.GALLERY) < 0 ) {
AppActions.showComponent(componentNames.MAP);
}
break;
}
});
}
adds.forEach((component) => {
switch (component) {
case componentNames.INTRO:
this.showIntro(options);
MapActions.selectFeature(false);
AppActions.hideComponent([componentNames.MAP,componentNames.GALLERY,componentNames.SELECTED_SHARES]);
break;
case componentNames.MAP:
this.showMap(options);
AppActions.hideComponent([componentNames.INTRO,componentNames.GALLERY]);
break;
case componentNames.GALLERY:
if (this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
this.showGallery(options);
AppActions.hideComponent([componentNames.INTRO,componentNames.MAP]);
} else {
AppActions.hideComponent(componentNames.GALLERY);
}
break;
adds.forEach((component) => {
switch (component) {
case componentNames.SIDE_PANEL_SETTINGS:
AppActions.hideComponent([componentNames.SIDE_PANEL_HELP]);
break;
case componentNames.SIDE_PANEL_HELP:
AppActions.hideComponent([componentNames.SIDE_PANEL_SETTINGS]);
break;
case componentNames.SIDE_PANEL_SETTINGS_STRING_MATCH + componentNames.SPS_INTRO_SPLASH:
if (this.visibleComponents.indexOf(componentNames.INTRO) < 0) {
AppActions.showComponent([componentNames.INTRO]);
}
break;
}
});