Update environments to show supported operations dynamically based the state change events. #2732
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the pull request
This PR aims to allow the compute system operations that appear in the horizontal dots menu flyout and the launch split button menu flyout to be dynamically updated based on the state of the compute system. For background, each compute system view model contains an observable collection with view models for both of the flyouts. Each item in the collection is a view model that contains a relay command.
Changes:
3.Upon a state change, we call the InitializeOperationDataAsync to clear and add the supported operations for the compute system
devhome/tools/Environments/DevHome.Environments/ViewModels/ComputeSystemViewModel.cs
Line 298 in 356fc88
Video of flow: (takes 20 - 40 minutes to create a Dev Box in the cloud so paused and unpaused video when I received the creation email). Key parts to take note of is, the launch button no longer appearing during creation, and after creation the dot and launch operations now appear based on the supported operations of the compute system.
dev.box.creation.now.with.dynamic.operation.support.mp4
References and relevant issues
Also updated dev box in azure extension to show correct state immediately after creation: microsoft/DevHomeAzureExtension#163
Detailed description of the pull request / Additional comments
Validation steps performed
Tested and confirmed it is now working as expected with change:
PR checklist