Merge pull request #832 from rasika/geo-fencing

Hiding geo dashboard tools when GeoLocationConfiguration is Disabled
revert-70aa11f8
Rasika Perera 7 years ago committed by GitHub
commit 9db4ddd4df

@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlRootElement;
public class GeoLocationConfiguration { public class GeoLocationConfiguration {
private boolean publishLocationOperationResponse; private boolean publishLocationOperationResponse;
private boolean isEnabled;
public boolean getPublishLocationOperationResponse() { public boolean getPublishLocationOperationResponse() {
return publishLocationOperationResponse; return publishLocationOperationResponse;
@ -37,4 +38,13 @@ public class GeoLocationConfiguration {
public void setPublishLocationOperationResponse(boolean publishLocationOperationResponse) { public void setPublishLocationOperationResponse(boolean publishLocationOperationResponse) {
this.publishLocationOperationResponse = publishLocationOperationResponse; this.publishLocationOperationResponse = publishLocationOperationResponse;
} }
public boolean getIsEnabled() {
return isEnabled;
}
@XmlElement(name = "isEnabled", required = true)
public void setEnabled(boolean enabled) {
isEnabled = enabled;
}
} }

@ -56,6 +56,8 @@ var conf = function () {
} }
} }
); );
var DeviceConfigurationManager = Packages.org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
conf["serverConfig"] = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
application.put("CONF", conf); application.put("CONF", conf);
} }
return conf; return conf;

@ -52,6 +52,6 @@ function onRequest(context) {
} else { } else {
viewModel.lastLocation = stringify({}); viewModel.lastLocation = stringify({});
} }
viewModel.showGeoFencingTools = true; viewModel.showGeoFencingTools = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
return viewModel; return viewModel;
} }

@ -79,6 +79,7 @@
<ExpiryTime>600</ExpiryTime> <ExpiryTime>600</ExpiryTime>
</DeviceCacheConfiguration> </DeviceCacheConfiguration>
<GeoLocationConfiguration> <GeoLocationConfiguration>
<isEnabled>false</isEnabled>
<PublishLocationOperationResponse>false</PublishLocationOperationResponse> <PublishLocationOperationResponse>false</PublishLocationOperationResponse>
</GeoLocationConfiguration> </GeoLocationConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

Loading…
Cancel
Save