cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] branch master updated: ui: show complete domain for accounts (#2994) (#3256)
Date Wed, 10 Apr 2019 11:48:08 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 6bb8d97  ui: show complete domain for accounts (#2994) (#3256)
6bb8d97 is described below

commit 6bb8d977ac1146d96f1a66656df3cccc8f833379
Author: Abhishek Kumar <abhishek.mrt22@gmail.com>
AuthorDate: Wed Apr 10 17:18:01 2019 +0530

    ui: show complete domain for accounts (#2994) (#3256)
    
    This allows showing complete domain, ie, domain path for accounts list view and account
detail.
    Added a new key, domainpath, in AccountResponse.
    
    Fixes #2994
    
    Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
---
 api/src/main/java/org/apache/cloudstack/api/ApiConstants.java |  1 +
 .../org/apache/cloudstack/api/response/AccountResponse.java   | 11 +++++++++--
 .../main/java/com/cloud/api/query/dao/AccountJoinDaoImpl.java |  3 +++
 ui/scripts/accounts.js                                        |  4 ++--
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
index 0c1f2b1..71a201f 100644
--- a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
@@ -110,6 +110,7 @@ public class ApiConstants {
     public static final String IP6_DNS1 = "ip6dns1";
     public static final String IP6_DNS2 = "ip6dns2";
     public static final String DOMAIN = "domain";
+    public static final String DOMAIN_PATH = "domainpath";
     public static final String DOMAIN_ID = "domainid";
     public static final String DOMAIN__ID = "domainId";
     public static final String DURATION = "duration";
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java
index 18b11f1..e39aaca 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java
@@ -19,8 +19,6 @@ package org.apache.cloudstack.api.response;
 import java.util.List;
 import java.util.Map;
 
-import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
@@ -28,6 +26,7 @@ import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.serializer.Param;
 import com.cloud.user.Account;
+import com.google.gson.annotations.SerializedName;
 
 @EntityReference(value = Account.class)
 public class AccountResponse extends BaseResponse implements ResourceLimitAndCountResponse
{
@@ -63,6 +62,10 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
     @Param(description = "name of the Domain the account belongs too")
     private String domainName;
 
+    @SerializedName(ApiConstants.DOMAIN_PATH)
+    @Param(description = "name of the Domain the account belongs too", since = "4.13")
+    private String domainPath;
+
     @SerializedName(ApiConstants.DEFAULT_ZONE_ID)
     @Param(description = "the default zone of the account")
     private String defaultZoneId;
@@ -294,6 +297,10 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
         this.domainName = domainName;
     }
 
+    public void setDomainPath(String domainPath) {
+        this.domainPath = domainPath;
+    }
+
     public void setBytesReceived(Long bytesReceived) {
         this.bytesReceived = bytesReceived;
     }
diff --git a/server/src/main/java/com/cloud/api/query/dao/AccountJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/AccountJoinDaoImpl.java
index fdc3cfa..56cc7e3 100644
--- a/server/src/main/java/com/cloud/api/query/dao/AccountJoinDaoImpl.java
+++ b/server/src/main/java/com/cloud/api/query/dao/AccountJoinDaoImpl.java
@@ -64,6 +64,9 @@ public class AccountJoinDaoImpl extends GenericDaoBase<AccountJoinVO,
Long> impl
         accountResponse.setAccountType(account.getType());
         accountResponse.setDomainId(account.getDomainUuid());
         accountResponse.setDomainName(account.getDomainName());
+        StringBuilder domainPath = new StringBuilder("ROOT");
+        (domainPath.append(account.getDomainPath())).deleteCharAt(domainPath.length() - 1);
+        accountResponse.setDomainPath(domainPath.toString());
         accountResponse.setState(account.getState().toString());
         accountResponse.setNetworkDomain(account.getNetworkDomain());
         accountResponse.setDefaultZone(account.getDataCenterUuid());
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index d2d6c1c..436b8d1 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -45,7 +45,7 @@
                         roletype: {
                             label: 'label.roletype'
                         },
-                        domain: {
+                        domainpath: {
                             label: 'label.domain'
                         },
                         state: {
@@ -697,7 +697,7 @@
                                     roletype: {
                                         label: 'label.roletype'
                                     },
-                                    domain: {
+                                    domainpath: {
                                         label: 'label.domain'
                                     },
                                     state: {


Mime
View raw message