From 24c8dff501d95b2c45ad681a570412e49887774d Mon Sep 17 00:00:00 2001 From: Philippe El Asmar Date: Fri, 8 Oct 2021 14:48:14 -0400 Subject: [PATCH] fix: option setting updatable flag causes issues in toolkit --- .../ServerMode/Controllers/DeploymentController.cs | 5 +++-- .../ServerMode/Models/OptionSettingItemSummary.cs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs b/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs index e79d42727..4905a3cab 100644 --- a/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs +++ b/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs @@ -185,7 +185,8 @@ private List ListOptionSettingSummary(Recommendation r TypeHint = setting.TypeHint?.ToString(), Value = recommendation.GetOptionSettingValue(setting), Advanced = setting.AdvancedSetting, - Updatable = (!recommendation.IsExistingCloudApplication || setting.Updatable) && recommendation.IsOptionSettingDisplayable(setting), + ReadOnly = recommendation.IsExistingCloudApplication && !setting.Updatable, + Visible = recommendation.IsOptionSettingDisplayable(setting), AllowedValues = setting.AllowedValues, ValueMapping = setting.ValueMapping, ChildOptionSettings = ListOptionSettingSummary(recommendation, setting.ChildOptionSettings) @@ -263,7 +264,7 @@ public async Task GetExistingDeployments(string sessionId) var deployedApplicationQueryer = serviceProvider.GetRequiredService(); var session = CreateOrchestratorSession(state); - + //ExistingDeployments is set during StartDeploymentSession API. It is only updated here if ExistingDeployments was null. state.ExistingDeployments ??= await deployedApplicationQueryer.GetCompatibleApplications(state.NewRecommendations.ToList(), session: session); diff --git a/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs b/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs index efc974fff..240a5ac58 100644 --- a/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs +++ b/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs @@ -22,7 +22,9 @@ public class OptionSettingItemSummary public bool Advanced { get; set; } - public bool Updatable { get; set; } + public bool ReadOnly { get; set; } + + public bool Visible { get; set; } public IList AllowedValues { get; set; } = new List();