RANGER-4611 : Security zone form not populate resources value properly while creating and editing zone.
Signed-off-by: Dineshkumar Yadav <dineshkumar.yadav@outlook.com>
diff --git a/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js b/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js
index 9f6f390..170be91 100644
--- a/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js
+++ b/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js
@@ -41,9 +41,6 @@
this.modelName = 'RangerZone';
this.modelAttrName = 'securityZones';
this.bindErrorEvents();
- },
- comparator: function(def) {
- return def.get('name');
}
},{
// static class members
diff --git a/security-admin/src/main/webapp/scripts/controllers/Controller.js b/security-admin/src/main/webapp/scripts/controllers/Controller.js
index 3ceb89c..abfa818 100755
--- a/security-admin/src/main/webapp/scripts/controllers/Controller.js
+++ b/security-admin/src/main/webapp/scripts/controllers/Controller.js
@@ -574,6 +574,9 @@
cache: false,
async: false,
});
+ rangerZoneList.models = rangerZoneList.sortBy(function(model) {
+ return model.get('name').toLowerCase();
+ });
App.rContent.show(new vSecurityZone({
rangerService: rangerServiceList,
collection: rangerZoneList,
diff --git a/security-admin/src/main/webapp/scripts/controllers/NController.js b/security-admin/src/main/webapp/scripts/controllers/NController.js
index 6f97a31..38d7735 100644
--- a/security-admin/src/main/webapp/scripts/controllers/NController.js
+++ b/security-admin/src/main/webapp/scripts/controllers/NController.js
@@ -552,6 +552,9 @@
cache: false,
async: false,
});
+ rangerZoneList.models = rangerZoneList.sortBy(function(model) {
+ return model.get('name').toLowerCase();
+ });
if (App.rSideBar.currentView) {
this.rSidebarContentHideAndShow('SecurityZone');
if (!_.isNaN(parseInt(listId))) {