Merge pull request #873 from rasika/fix-1623

Fixing loading geo map twice in android device overview page.
revert-dabc3590
Rasika Perera 7 years ago committed by GitHub
commit 16510f140f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -219,136 +219,6 @@
</div>
</div>
</div>
<div class="panel panel-default visible-xs-block" role="tabpanel"
id="policy_compliance_tab">
<div class="panel-heading visible-xs collapsed" id="policy_compliance">
<h4 class="panel-title">
<a role="button"
data-toggle="collapse" data-parent="#tabs" href="#collapseTwo"
aria-expanded="true" aria-controls="collapseTwo">
<i class="fw fw-policy fw-2x"></i>
Policy Compliance
<i class="caret-updown fw fw-down"></i>
</a>
</h4>
</div>
<div class="panel-heading display-none-xs">
Policy Compliance
<span>
<a href="javascript:void(0);" id="refresh-policy">
<i class="fw fw-refresh"></i>
</a>
</span>
</div>
<div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="policy_compliance">
<div class="panel-body ">
<span class="visible-xs add-padding-2x text-right">
<a href="javascript:void(0);" id="refresh-policy">
<i class="fw fw-refresh"></i>
</a>
</span>
<div id="policy-spinner"
class="wr-advance-operations-init add-padding-bottom-2x add-padding-bottom-4x hidden">
<i class="fw fw-settings fw-spin fw-2x"></i>Loading Policy
Compliance...
</div>
<div id="policy-list-container">
</div>
</div>
</div>
</div>
<div class="panel panel-default visible-xs-block" role="tabpanel"
id="device_location_tab">
<div class="panel-heading visible-xs collapsed" id="device_location">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#tabs"
href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
<i class="fw fw-map-location fw-2x"></i>
Device Location
<i class="caret-updown fw fw-down"></i>
</a>
</h4>
</div>
<div class="panel-heading display-none-xs">
Device Location
<span>
<a href="javascript:void(0);" id="refresh-location">
<i class="fw fw-refresh"></i>
</a>
</span>
<div id="map-spinner" class="wr-advance-operations-init hidden">
<i class="fw fw-settings fw-spin fw-2x"></i> Fetching the latest location...
</div>
</div>
<div id="collapseThree" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="device_location">
<div class="panel-body">
{{#if device.location}}
{{unit "cdmf.unit.geo-dashboard" device=device noGeoFencing=false hideSearch=true}}
{{else}}
<div id="map-error" class="message message-warning">
<h4 class="remove-margin">
<i class="icon fw fw-warning"></i>
Device location information is not available.
</h4>
</div>
<p class="add-padding-5x"></p>
<p class="add-padding-5x"></p>
<p class="add-padding-5x"></p>
{{/if}}
</div>
</div>
</div>
<div class="panel panel-default visible-xs-block" role="tabpanel"
id="installed_applications_tab">
<div class="panel-heading visible-xs collapsed" id="installed_applications">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#tabs"
href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
<i class="fw fw-application fw-2x"></i>
Installed Applications
<i class="caret-updown fw fw-down"></i>
</a>
</h4>
</div>
<div class="panel-heading display-none-xs">
Installed Applications
<span>
<a href="javascript:void(0);" id="refresh-apps">
<i class="fw fw-refresh"></i>
</a>
</span>
</div>
<div id="collapseFour" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="installed_applications">
<div class="panel-body">
<span class="visible-xs add-padding-2x text-right">
<a href="javascript:void(0);" id="refresh-apps">
<i class="fw fw-refresh"></i>
</a>
</span>
<div id="apps-spinner" class="wr-advance-operations-init hidden">
<i class="fw fw-settings fw-spin fw-2x"></i> Loading Applications
List...
</div>
<div id="applications-list-container">
<div class="message message-info">
<h4>
<i class="icon fw fw-info"></i>
No applications found.
</h4>
<p>Please try refreshing in a while.</p>
</div>
</div>
</div>
</div>
</div>
{{/zone}}
</div>

@ -76,9 +76,9 @@
</div>
<div id="operation-form">
<form action="{{params.0.uri}}" method="{{params.0.method}}"
<form id="form-{{operation}}" action="{{params.0.uri}}" method="{{params.0.method}}"
style="padding-bottom: 20px;"
data-payload="{{payload}}" id="form-{{operation}}"
data-payload="{{payload}}"
data-device-id="{{../device.deviceIdentifier}}"
data-content-type="{{params.0.contentType}}"
data-operation-code="{{operation}}">
@ -144,14 +144,14 @@
</div>
{{/equal}}
{{/each}}
<button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')"
class="btn btn-default">Send
<button type="button" onclick="submitForm('form-{{operation}}')"
class="btn btn-default btnSend">Send
to Device</button>
<label id="lblSending" class="wr-input-label hidden"><i
class="fw fw-lifecycle fw-spin fw-2x"></i> Sending..</label>
<label id="lblSent" class="wr-input-label hidden"><i
class="fw fw-check fw-2x"></i> Sent</label>
<i id="lbl-execution" class="fw fw-wso2-logo fw-pulse fw-2x hidden"> Executing Operation </i>
<label class="wr-input-label hidden"><i
class="fw fw-lifecycle fw-spin fw-2x lblSending"></i> Sending..</label>
<label class="wr-input-label hidden"><i
class="fw fw-check fw-2x lblSent"></i> Sent</label>
<i class="fw fw-wso2-logo fw-pulse fw-2x hidden lbl-execution"> Executing Operation </i>
</form>
</div>
</div>

@ -30,9 +30,9 @@ function operationSelect(selection) {
showPopup();
}
var resetLoader = function () {
$("#btnSend").removeClass("hidden");
$('#lbl-execution').addClass("hidden");
var resetLoader = function (formId) {
$('#' + formId + ' .btnSend').removeClass("hidden");
$('#' + formId + ' .lbl-execution').addClass("hidden");
};
/**
@ -111,8 +111,8 @@ function fillUserName() {
}
function submitForm(formId) {
$("#btnSend").addClass("hidden");
$("#lbl-execution").removeClass("hidden");
$('#' + formId + " .btnSend").addClass("hidden");
$('#' + formId + " .lbl-execution").removeClass("hidden");
var form = $("#" + formId);
var uri = form.attr("action");
var deviceId = form.data("device-id");
@ -172,7 +172,7 @@ function submitForm(formId) {
statusIcon.attr("class", defaultStatusClasses + " fw-check");
description.html(res);
// console.log("success!");
resetLoader();
resetLoader(formId);
$(modalPopupContent).html(content.html());
};
var errorCallBack = function (response) {
@ -187,7 +187,7 @@ function submitForm(formId) {
}
description.html(reason);
// console.log("Error!");
resetLoader();
resetLoader(formId);
$(modalPopupContent).html(content.html());
};
//executing http request
@ -205,11 +205,11 @@ function submitForm(formId) {
title.html("An Error Occurred!");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
description.html("This operation requires http method: " + httpMethod + " which is not supported yet!");
resetLoader();
resetLoader(formId);
$(modalPopupContent).html(content.html());
}
} else {
resetLoader();
resetLoader(formId);
$(".modal #operation-error-msg span").text(validaterString);
$(".modal #operation-error-msg").removeClass("hidden");
}
@ -222,13 +222,13 @@ $(document).on('submit', 'form', function (e) {
method: "post"
});
var btnSubmit = $('#btnSend', this);
var btnSubmit = $('.btnSend', this);
btnSubmit.addClass('hidden');
var lblSending = $('#lblSending', this);
var lblSending = $('.lblSending', this);
lblSending.removeClass('hidden');
var lblSent = $('#lblSent', this);
var lblSent = $('.lblSent', this);
postOperationRequest.done(function (data) {
lblSending.addClass('hidden');
lblSent.removeClass('hidden');

Loading…
Cancel
Save