Merge pull request #901 from Kamidu/master

enabling billing status cache invalidation
revert-70aa11f8
Madawa Soysa 7 years ago committed by GitHub
commit 08b1bf7e5b

@ -33,8 +33,13 @@ var util = require("/app/modules/oauth/token-handler-utils.js")["utils"];
var responseProcessor = require("utils").response;
var result;
if (uriMatcher.match("/{context}/api/user/clearBilling")) {
if (uriMatcher.match("/{context}/api/user/authenticate")) {
carbonUser = session.get(constants.USER_SESSION_KEY);
session.put('BILLING_INFO_' + carbonUser.domain, null);
log.info("billing info cleared for " + carbonUser.domain);
} else if (uriMatcher.match("/{context}/api/user/authenticate")) {
var username = request.getParameter("username");
var password = request.getParameter("password");
//Check if a username and password is provided

@ -16,6 +16,33 @@
* under the License.
*/
$(document).ready(function () {
$("#expire-upgrade-now-link").click(function() {
$.get("api/user/clearBilling", function(data, status){
});
window.location.href = $("#expire-upgrade-now-link").data("url");
});
$("#expire-req-ext-link").click(function() {
$.get("api/user/clearBilling", function(data, status){
});
window.location.href = $("#expire-req-ext-link").data("url");
});
$(".expire-upgrade-now-link").parent().click(function(e) {
e.preventDefault();
$.get("api/user/clearBilling", function(data, status){
});
window.location.href = $(this).attr("href");
});
$(".expire-req-ext-link").parent().click(function(e) {
e.preventDefault();
$.get("api/user/clearBilling", function(data, status){
});
window.location.href = $(this).attr("href");
});
$('#cloud-menu-popover i.fw-tiles').popover({
html: true,
trigger: 'click',

@ -171,10 +171,10 @@
</div>
<div class="modal-footer">
<div class="buttons">
<a href="{{Main.Account.dropDown.[Upgrade Now].url}}" id="expire-upgrade-now-link" class="btn-operations">
<a data-url="{{Main.Account.dropDown.[Upgrade Now].url}}" id="expire-upgrade-now-link" class="btn-operations">
Upgrade Now
</a>
<a href="{{Main.Account.dropDown.[Request Extension].url}}" id="expire-req-ext-link" class="btn-operations">
<a data-url="{{Main.Account.dropDown.[Request Extension].url}}" id="expire-req-ext-link" class="btn-operations">
Request Extension
</a>
</div>

Loading…
Cancel
Save