This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/4.16 by this push:
     new 9b0a141  Provision to sort ISOs from UI, and Updated Templates/ISOs 
API response to return in the order of sortkey (#5800)
9b0a141 is described below

commit 9b0a1418ecbd69e1971210d4c6f4da1dee5884a0
Author: sureshanaparti <[email protected]>
AuthorDate: Fri Dec 24 12:44:50 2021 +0530

    Provision to sort ISOs from UI, and Updated Templates/ISOs API response to 
return in the order of sortkey (#5800)
---
 .../src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java | 7 +++++--
 ui/src/config/section/image.js                                     | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java 
b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
index 3eaaf53..fe00ef0 100644
--- a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
+++ b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
@@ -561,9 +561,12 @@ public class TemplateJoinDaoImpl extends 
GenericDaoBaseWithTagInformation<Templa
         if (ids == null || ids.length == 0) {
             return new ArrayList<TemplateJoinVO>();
         }
+
+        Filter searchFilter = new Filter(TemplateJoinVO.class, "sortKey", 
QueryService.SortKeyAscending.value(), null, null);
+        searchFilter.addOrderBy(TemplateJoinVO.class, "tempZonePair", true);
+
         SearchCriteria<TemplateJoinVO> sc = tmpltIdsSearch.create();
         sc.setParameters("idsIN", ids);
-        return searchIncludingRemoved(sc, null, null, false);
+        return searchIncludingRemoved(sc, searchFilter, null, false);
     }
-
 }
diff --git a/ui/src/config/section/image.js b/ui/src/config/section/image.js
index 13f4d0b..0a4667e 100644
--- a/ui/src/config/section/image.js
+++ b/ui/src/config/section/image.js
@@ -194,6 +194,9 @@ export default {
         if (['Admin', 
'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
           fields.push('account')
         }
+        if (['Admin'].includes(store.getters.userInfo.roletype)) {
+          fields.push('order')
+        }
         return fields
       },
       details: ['name', 'id', 'displaytext', 'checksum', 'ostypename', 'size', 
'bootable', 'isready', 'directdownload', 'isextractable', 'ispublic', 
'isfeatured', 'crosszones', 'account', 'domain', 'created'],

Reply via email to