Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2685. Removed for of statements #2714

Merged
merged 4 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/client/api/GeoStoreDAO.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Api = {
},
updateResourcePermissions: function(resourceId, securityRules) {
let payload = "<SecurityRuleList>";
for (let rule of securityRules.SecurityRuleList.SecurityRule) {
(securityRules && securityRules.SecurityRuleList && _.castArray(securityRules.SecurityRuleList.SecurityRule) || []).forEach( rule => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use a reduce

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't want to change this part not covered by a test. going to externalize SecurityRule and test it

if (rule.canRead || rule.canWrite) {
if (rule.user) {
payload = payload + "<SecurityRule>";
Expand All @@ -182,7 +182,7 @@ const Api = {
// NOTE: if rule has no group or user, it is skipped
// NOTE: if rule is "no read and no write", it is skipped
}
}
});
payload = payload + "</SecurityRuleList>";
return axios.post(
"resources/resource/" + resourceId + "/permissions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,11 @@ function template(str, data) {
});
}
function getUrls(opt) {
let urls = [];
let url = opt.url;
if (opt.subdomains) {
for (let c of opt.subdomains) {
urls.push(template(url.replace("{s}", c), opt));
}
} else {
for (let c of 'abc') {
urls.push(template(url.replace("{s}", c), opt));
}
return opt.subdomains.map( c => template(url.replace("{s}", c), opt));
}
return urls;
return ['a', 'b', 'c'].map( c => template(url.replace("{s}", c), opt));
}
/*eslint-disable */
function lBoundsToOlExtent(bounds, destPrj){
Expand Down