Skip to content

Commit aa81823

Browse files
author
Jessica Wang
committed
CLOUDSTACK-7462: UI > Network > VPC > Router > Network ACL Lists > click an entry from list > Details tab > ACL List Rules tab > click Edit icon on any existing rule > fix the JavaScript error "args.jsonObj is undefined".
1 parent f7d9ea2 commit aa81823

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

ui/scripts/sharedFunctions.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,42 +2089,42 @@ cloudStack.api = {
20892089
}
20902090
},
20912091
dataProvider: function(args) {
2092-
args.response.success({
2093-
data: args.jsonObj.tags
2094-
});
2095-
2096-
/*
2097-
var resourceId = args.context[contextId][0].id;
2098-
var data = {
2099-
resourceId: resourceId,
2100-
resourceType: resourceType
2101-
};
2102-
2103-
if (isAdmin() || isDomainAdmin()) {
2104-
data.listAll = true;
2105-
}
2106-
2107-
if (args.context.projects) {
2108-
data.projectid = args.context.projects[0].id;
2109-
}
2092+
if (args.jsonObj != undefined) {
2093+
args.response.success({
2094+
data: args.jsonObj.tags
2095+
});
2096+
} else {
2097+
var resourceId = args.context[contextId][0].id;
2098+
var data = {
2099+
resourceId: resourceId,
2100+
resourceType: resourceType
2101+
};
2102+
2103+
if (isAdmin() || isDomainAdmin()) {
2104+
data.listAll = true;
2105+
}
21102106

2111-
if (args.jsonObj != null && args.jsonObj.projectid != null && data.projectid == null) {
2112-
data.projectid = args.jsonObj.projectid;
2113-
}
2107+
if (args.context.projects) {
2108+
data.projectid = args.context.projects[0].id;
2109+
}
21142110

2115-
$.ajax({
2116-
url: createURL('listTags'),
2117-
data: data,
2118-
success: function(json) {
2119-
args.response.success({
2120-
data: json.listtagsresponse ? json.listtagsresponse.tag : []
2121-
});
2122-
},
2123-
error: function(json) {
2124-
args.response.error(parseXMLHttpResponse(json));
2111+
if (args.jsonObj != null && args.jsonObj.projectid != null && data.projectid == null) {
2112+
data.projectid = args.jsonObj.projectid;
21252113
}
2126-
});
2127-
*/
2114+
2115+
$.ajax({
2116+
url: createURL('listTags'),
2117+
data: data,
2118+
success: function(json) {
2119+
args.response.success({
2120+
data: json.listtagsresponse ? json.listtagsresponse.tag : []
2121+
});
2122+
},
2123+
error: function(json) {
2124+
args.response.error(parseXMLHttpResponse(json));
2125+
}
2126+
});
2127+
}
21282128
}
21292129
};
21302130
}

0 commit comments

Comments
 (0)