Skip to content

Unable to order the ISO/templates in the UI  #7278

Closed

Description

@kiranchavala
ISSUE TYPE
  • Bug report
COMPONENT NAME
Componet:UI
Componet:api
CLOUDSTACK VERSION
4.18 nightly
4.17.2

SUMMARY

Unable to order the ISO/templates in the UI

Steps to reproduce the issue

  1. Login as admin user

  2. Navigate to Images> Iso

  3. Register a sample iso (as a admin user)

  4. Try to move the Order the registerd iso

Move to the top
Move to the bottom

Move up one row
Move down one row

Similarly for Images> Templates

  1. It works partially

Api calls

https://cloudstack.apache.org/api/apidocs-4.17/apis/updateIso.html

In the backend updateIso api call is executed with sorkey

It updates the database table vm_template.sort_key


MariaDB [cloud]> select name,sort_key from vm_template where format='iso' ;
+---------------------------------+----------+
| name                            | sort_key |
+---------------------------------+----------+
| vmware-tools.iso                |        5 |
| xs-tools.iso                    |        3 |
| v1.24.0-Kubernetes-Binaries-ISO |        6 |
| v1.23.3-Kubernetes-Binaries-ISO |        4 |
| v1.22.6-Kubernetes-Binaries-ISO |        2 |
| rocky                           |        7 |
+---------------------------------+----------+
6 rows in set (0.00 sec


EXPECTED RESULTS
Admin User should be able to order the iso's and template based on his requirement 

ACTUAL RESULTS
user is unable to order the iso's and template based on his requirement 

iso

Activity

  1. kiranchavala commented on Feb 22, 2023

    @kiranchavala
    MemberAuthor

    @borisstoyanov please add the tags for this issue

  2. borisstoyanov commented on Feb 23, 2023

    @borisstoyanov
    Contributor

    @kiranchavala are you sure this is an API issue, on first glance it seems like ui/display issue (might be wrong) ?

  3. kiranchavala commented on Feb 24, 2023

    @kiranchavala
    MemberAuthor

    @borisstoyanov it could be API issue as 2 templates/iso can have the same sort_key field in the database, which can lead into issues

  4. davidjumani commented on Mar 14, 2023

    @davidjumani
    Contributor

    Unrelated to the UI as the API call is correctly made but the results are not sorted

  5. yadvr commented on May 8, 2023

    @yadvr
    Member

    @shwstppr we need to check if it's the UI or API that's broken or re-test and close if we can't rperoduce. Certinaly works for me in 4.17.2.

  6. added this to the 4.18.1.0 milestone on Jun 22, 2023
  7. CharlesQueiroz commented on Aug 10, 2023

    @CharlesQueiroz
    Contributor

    Guys, I reproduced the problem, and the ordering is not being maintained. I discovered that the issue is due to using a Hashtable instead of a LinkedHashMap when returning the results to the front end.

    As Hashtable does not maintain the insertion order, it returns the list similarly. I've created a PR that solves this problem.

    Here: #7844

    If anyone could take a look, I'd appreciate it.

  8. weizhouapache commented on Aug 16, 2023

    @weizhouapache
    Member

    fixed via #7844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions