You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2019/06/04 12:11:10 UTC
[ranger] branch master updated: RANGER-2455 : When service created
inside a zone landing page that service gets created in unzonned landing
page.
This is an automated email from the ASF dual-hosted git repository.
ni3galave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push:
new df1d5f9 RANGER-2455 : When service created inside a zone landing page that service gets created in unzonned landing page.
df1d5f9 is described below
commit df1d5f93c5e5abda6aacca4a11b45ff752a565ec
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Fri May 31 17:22:55 2019 +0530
RANGER-2455 : When service created inside a zone landing page that service gets created in unzonned landing page.
---
.../main/webapp/scripts/views/policies/RangerPolicyForm.js | 3 +--
.../main/webapp/scripts/views/policymanager/ServiceLayout.js | 1 +
security-admin/src/main/webapp/styles/xa.css | 12 ++++++++++++
.../webapp/templates/common/ServiceManagerLayout_tmpl.html | 7 +++++--
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
index 5a184df..b82654e 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
@@ -562,8 +562,7 @@ define(function(require){
}
});
if(this.model.has('policyLabels')){
- var policyLabel =[];
- policyLabel= this.model.get('policyLabels').split(',');
+ var policyLabel = _.isEmpty(this.model.get('policyLabels')) ? [] : this.model.get('policyLabels').split(',');
this.model.set('policyLabels', policyLabel);
}
if(!_.isUndefined(App.vZone) && App.vZone.vZoneName){
diff --git a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
index b6851ed..1d95ff3 100644
--- a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
@@ -49,6 +49,7 @@ define(function(require){
services : this.componentServicesModels(App.vZone.vZoneName),
showImportExportBtn : (SessionMgr.isUser() || XAUtil.isAuditorOrKMSAuditor(SessionMgr)) ? false : true,
isZoneAdministration : (SessionMgr.isSystemAdmin()|| SessionMgr.isUser() || SessionMgr.isAuditor()) ? true : false,
+ isServiceManager : (App.vZone && _.isEmpty(App.vZone.vZoneName)) ? true : false,
};
},
diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css
index b615bfb..e8238ca 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -2670,6 +2670,9 @@ textarea:read-only{
.select2-container.select2-container-disabled .select2-choice {
cursor: not-allowed;
}
+.disabled {
+ cursor: not-allowed;
+}
.modal-policy-conditions{
width: 500px;
}
@@ -2796,3 +2799,12 @@ div#zoneServiceAccordion table thead {
.fixed-headertable th:first-child{
width: calc(100% - 200px);
}*/
+
+.policy-manager table thead tr th:first-child a:focus {
+ text-decoration: none;
+}
+
+.add-service {
+ margin-right: 2px;
+ opacity: 0.7;
+}
diff --git a/security-admin/src/main/webapp/templates/common/ServiceManagerLayout_tmpl.html b/security-admin/src/main/webapp/templates/common/ServiceManagerLayout_tmpl.html
index 1f5bc98..08082bd 100644
--- a/security-admin/src/main/webapp/templates/common/ServiceManagerLayout_tmpl.html
+++ b/security-admin/src/main/webapp/templates/common/ServiceManagerLayout_tmpl.html
@@ -68,8 +68,11 @@
<a href="javascript:void(0)" title="Import" data-id="uploadBtnOnServices" data-servicetype="{{./this.attributes.name}}" class=" btn-right importbtn text-decoration">
<i class="icon-rotate-180 icon-external-link-sign"> </i>
</a>
-
- <a href="#!/service/{{./this.id}}/create" class="pull-right text-decoration" title="Add New Service" style="margin-right: 2px;"> <i class="icon-plus"></i></a>
+ {{#if ../../isServiceManager}}
+ <a href="#!/service/{{./this.id}}/create" class="pull-right text-decoration" title="Add New Service" style="margin-right: 2px;"> <i class="icon-plus"></i></a>
+ {{else}}
+ <a href="javascript:void(0)" class="pull-right text-decoration disabled add-service" title="Services cannot be added while filtering Security Zones"> <i class="icon-plus"></i></a>
+ {{/if}}
</span>
{{/if}}