vishesh92 opened a new pull request, #10493: URL: https://github.com/apache/cloudstack/pull/10493
### Description This PR fixes #10347 <details><summary>Details</summary> <p> This pull request includes changes to the `UserVmManagerImpl` class and UI components to improve the handling of security groups for virtual machines. The most important changes include refactoring the security group update logic and adding UI support for security groups. ### Backend changes: * [`server/src/main/java/com/cloud/vm/UserVmManagerImpl.java`](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08L3108-L3143): Refactored the security group update logic by removing redundant code and encapsulating the update logic in a new `updateSecurityGroup` method. This improves code readability and maintainability. [[1]](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08L3108-L3143) [[2]](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08R3140-R3168) [[3]](diffhunk://#diff-865f710fe60b9b62ff8c2cbce8a8342e4f6fca658223119762285fd5f7857f08R3184-R3194) ### UI changes: * [`ui/src/views/compute/EditVM.vue`](diffhunk://#diff-d97ad918bcafbd002d2abfeb0e54bce71ce96c0338928fe7c287e92b7e0f96e6L209-R209): Modified the security group enablement check to fall back on a Vuex store getter if the zone response does not provide the information. This ensures that the UI correctly reflects the security group support status. * [`ui/src/views/compute/InstanceTab.vue`](diffhunk://#diff-bf8c6acc9fc55c107b5ddc946c3a479f15e6859f3b98bc263336ebd01d318f73R182): Added a new state variable `showUpdateSecurityGroupsModal` to manage the visibility of the security group update modal in the instance tab. This prepares the UI for future enhancements to support security group updates directly from the instance tab. </p> </details> <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] build/CI - [ ] test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ x] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org