Hiding geo dashboard tools when GeoLocationConfiguration is Disabled

merge-requests/1/head
Rasika Perera 7 years ago
parent ab606238d9
commit 83d0793a35

@ -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