fix: set sort_order for newly installed apps to avoid random positioning#12069
fix: set sort_order for newly installed apps to avoid random positioning#12069ssongliu merged 1 commit into1Panel-dev:dev-v2from
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What this PR does / why we need it?
Newly installed apps have
sort_orderdefaulting to 0, which causes them to appear at random positions among other apps that also havesort_order = 0. This fix assignssort_order = max(sort_order) + 1at install time so new apps always appear at the end of the non-favorite list.Summary of your change
agent/app/service/app.go, query the current maxsort_orderof non-favorite apps before creating the install record, and set the new app'ssort_ordertomax + 1.Please indicate you've done the following: