Skip to content

Commit

Permalink
Update the ASP.NET Core on GCE warning message. (#1066)
Browse files Browse the repository at this point in the history
* Update the ASP.NET Core on GCE warning message.
  • Loading branch information
Jim Przybylinski authored Oct 12, 2018
1 parent e21761c commit 86bfaec
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
d:DesignHeight="247"
d:DesignWidth="476"
d:DataContext="{d:DesignInstance local:CoreGceWarningStepViewModel}">
<DockPanel VerticalAlignment="Stretch" Margin="36,0,36,0">
<DockPanel VerticalAlignment="Stretch" Margin="24,0,24,0">
<CheckBox DockPanel.Dock="Bottom"
IsChecked="{Binding Options.DoNotShowAspNetCoreGceWarning}"
HorizontalAlignment="Right"
Expand All @@ -45,18 +45,30 @@

<TextBlock TextWrapping="Wrap" VerticalAlignment="Center">
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine1}" />

<LineBreak/>
<LineBreak/>
<LineBreak />
<LineBreak />

<wpf:WhitespaceDiscardingSpan>
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine2BeforeLink}" />

<Hyperlink Command="{Binding BrowseAspNetMarketplaceImage}">
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine2MarketplaceLink}" />
</Hyperlink>

<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine2AfterLink}" />
</wpf:WhitespaceDiscardingSpan>

<LineBreak />
<LineBreak />

<wpf:WhitespaceDiscardingSpan>
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine3BeforeLink}" />

<Hyperlink Command="{Binding BrowseAspNetCoreIisDocs}">
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine2HyperLink}" />
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine3DocsLink}" />
</Hyperlink>

<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine2AfterLink}"/>
<Run Text="{x:Static ext:Resources.PublishGceWarningStepLine3AfterLink}" />
</wpf:WhitespaceDiscardingSpan>
</TextBlock>
</DockPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class CoreGceWarningStepViewModel : ValidatingViewModelBase, IPublishDial
{
public const string AspNetCoreIisDocsLink = "https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/";

public const string AspNetMarketplaceImageLink =
"https://console.cloud.google.com/marketplace/details/click-to-deploy-images/aspnet";

private readonly IPublishDialog _publishDialog;
private readonly GceStepContent _nextStepContent;
private readonly Lazy<IBrowserService> _browserService;
Expand Down Expand Up @@ -57,16 +60,22 @@ public class CoreGceWarningStepViewModel : ValidatingViewModelBase, IPublishDial
public ProtectedCommand BrowseAspNetCoreIisDocs { get; }
private IBrowserService BrowserService => _browserService.Value;

public ProtectedCommand BrowseAspNetMarketplaceImage { get; }

public CoreGceWarningStepViewModel(IPublishDialog publishDialog)
{
_publishDialog = publishDialog;
BrowseAspNetCoreIisDocs = new ProtectedCommand(OnBrowseAspNetCoreIisDocs);
BrowseAspNetMarketplaceImage = new ProtectedCommand(OnBrowseAspNeMarketplaceImage);
Title = string.Format(Resources.GcePublishStepTitle, publishDialog.Project.Name);
ActionCommand = new ProtectedCommand(OnNextCommand);
_nextStepContent = new GceStepContent(_publishDialog);
_browserService = GoogleCloudExtensionPackage.Instance.GetMefServiceLazy<IBrowserService>();
}

private void OnBrowseAspNeMarketplaceImage() =>
BrowserService.OpenBrowser(AspNetMarketplaceImageLink);

private void OnBrowseAspNetCoreIisDocs() =>
BrowserService.OpenBrowser(AspNetCoreIisDocsLink);

Expand Down
33 changes: 30 additions & 3 deletions GoogleCloudExtension/GoogleCloudExtension/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions GoogleCloudExtension/GoogleCloudExtension/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2489,14 +2489,26 @@ Delete corrupted file?</value>
<comment>The first line of the ASP.NET Core on GCE warning dialog.</comment>
</data>
<data name="PublishGceWarningStepLine2BeforeLink" xml:space="preserve">
<value>Hosting ASP.NET Core applications on Compute Engine requires </value>
<value>Hosting ASP.NET Core applications on Compute Engine should use the </value>
<comment>The first part of the second line of the ASP.NET Core on GCE warning dialog.</comment>
</data>
<data name="PublishGceWarningStepLine2HyperLink" xml:space="preserve">
<data name="PublishGceWarningStepLine2MarketplaceLink" xml:space="preserve">
<value>ASP.NET Framework Marketplace Image</value>
<comment>The text of the link to the ASP.NET Framework Marketplace </comment>
</data>
<data name="PublishGceWarningStepLine2AfterLink" xml:space="preserve">
<value>.</value>
<comment>The text after the link of the second line of the ASP.NET Core on GCE warning dialog.</comment>
</data>
<data name="PublishGceWarningStepLine3BeforeLink" xml:space="preserve">
<value>The default windows image will require </value>
<comment>The part between the links of the second line of the ASP.NET Core on GCE warning dialog.</comment>
</data>
<data name="PublishGceWarningStepLine3DocsLink" xml:space="preserve">
<value>manual configuration of IIS</value>
<comment>The text of the hyperlink on the ASP.NET Core on GCE Warning dialog.</comment>
</data>
<data name="PublishGceWarningStepLine2AfterLink" xml:space="preserve">
<data name="PublishGceWarningStepLine3AfterLink" xml:space="preserve">
<value>.</value>
<comment>The end part of the second line of the ASP.NET Core on GCE warning dialog.</comment>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,13 @@ public void TestBrowseAspNetCoreIisDocs_OpensBrowser()

_browserServiceMock.Verify(b => b.OpenBrowser(CoreGceWarningStepViewModel.AspNetCoreIisDocsLink));
}

[TestMethod]
public void TestBrowsAspNetMarketplaceImage_OpensBrowser()
{
_objectUnderTest.BrowseAspNetMarketplaceImage.Execute(null);

_browserServiceMock.Verify(b => b.OpenBrowser(CoreGceWarningStepViewModel.AspNetMarketplaceImageLink));
}
}
}

0 comments on commit 86bfaec

Please sign in to comment.