Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #4348 from NuGet/dev
[ReleasePrep][2017.07.12]FI of dev into master for NuGetGallery
  • Loading branch information
skofman1 committed Jul 7, 2017
2 parents c45a04d + 51c7e35 commit c60708d
Show file tree
Hide file tree
Showing 34 changed files with 9,238 additions and 43 deletions.
3 changes: 2 additions & 1 deletion src/NuGetGallery/App_Start/AppActivator.cs
Expand Up @@ -142,7 +142,8 @@ private static void BundlingPostStart()
foreach (string filename in new[] {
"Site.css",
"Layout.css",
"PageStylings.css"
"PageStylings.css",
"fabric.css",
})
{
stylesBundle
Expand Down
5 changes: 2 additions & 3 deletions src/NuGetGallery/App_Start/OwinStartup.cs
Expand Up @@ -21,7 +21,6 @@
using NuGetGallery.Authentication.Providers;
using NuGetGallery.Authentication.Providers.Cookie;
using NuGetGallery.Configuration;
using NuGetGallery.Helpers;
using NuGetGallery.Infrastructure;
using Owin;

Expand Down Expand Up @@ -100,13 +99,13 @@ public static void Configuration(IAppBuilder app)
if (config.Current.RequireSSL)
{
// Put a middleware at the top of the stack to force the user over to SSL
if (string.IsNullOrWhiteSpace(config.Current.ForceSslExclusion))
if (config.Current.ForceSslExclusion == null)
{
app.UseForceSsl(config.Current.SSLPort);
}
else
{
app.UseForceSsl(config.Current.SSLPort, new[] { config.Current.ForceSslExclusion });
app.UseForceSsl(config.Current.SSLPort, config.Current.ForceSslExclusion);
}
}

Expand Down
12 changes: 8 additions & 4 deletions src/NuGetGallery/Configuration/AppConfiguration.cs
Expand Up @@ -16,6 +16,9 @@ public class AppConfiguration : IAppConfiguration
[DefaultValue("")]
public string WarningBanner { get; set; }

[DefaultValue("")]
public string RedesignBanner { get; set; }

/// <summary>
/// Gets a setting indicating if SSL is required for all operations once logged in.
/// </summary>
Expand All @@ -29,11 +32,12 @@ public class AppConfiguration : IAppConfiguration
public int SSLPort { get; set; }

/// <summary>
/// A string containing a path exluded from
/// forcing the HTTP to HTTPS redirection.
/// A string containing a path exluded from forcing the HTTP to HTTPS redirection.
/// To provide multiple paths separate them with ;
/// </summary>
[DefaultValue("")]
public string ForceSslExclusion { get; set; }
[DefaultValue(null)]
[TypeConverter(typeof(StringArrayConverter))]
public string[] ForceSslExclusion { get; set; }

/// <summary>
/// Gets the connection string to use when connecting to azure storage
Expand Down
11 changes: 8 additions & 3 deletions src/NuGetGallery/Configuration/IAppConfiguration.cs
Expand Up @@ -23,6 +23,11 @@ public interface IAppConfiguration
/// </summary>
string WarningBanner { get; set; }

/// <summary>
/// Gets the warning banner text
/// </summary>
string RedesignBanner { get; set; }

/// <summary>
/// Gets a setting indicating if SSL is required for all operations once logged in.
/// </summary>
Expand All @@ -34,11 +39,11 @@ public interface IAppConfiguration
int SSLPort { get; set; }

/// <summary>
/// A string containing a path exluded from
/// forcing the HTTP to HTTPS redirection.
/// A string containing a path exluded from forcing the HTTP to HTTPS redirection.
/// To provide multiple paths separate them with ;
/// </summary>
/// <example>/api/health-probe</example>
string ForceSslExclusion { get; set; }
string[] ForceSslExclusion { get; set; }

/// <summary>
/// Gets the connection string to use when connecting to azure storage
Expand Down
34 changes: 34 additions & 0 deletions src/NuGetGallery/Configuration/StringArrayConverter.cs
@@ -0,0 +1,34 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.ComponentModel;
using System.Globalization;

namespace NuGetGallery.Configuration
{
public class StringArrayConverter : ArrayConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}

return base.CanConvertFrom(context, sourceType);
}

public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
string s = value as string;

if (!string.IsNullOrEmpty(s))
{
return ((string)value).Split(';');
}

return base.ConvertFrom(context, culture, value);
}
}
}
21 changes: 21 additions & 0 deletions src/NuGetGallery/Content/Layout.css
Expand Up @@ -51,6 +51,27 @@ ul.share-buttons i {
text-decoration: underline;
}

.banner-redesign {
padding: 0.25em;
text-align: center;
color: #FFFFFF;
background-color: #004880;
font-family: "Segoe UI";
font-size: 1.75em;
font-weight: 100;
line-height: 40px;
}

.banner-redesign .ms-Icon {
position: relative;
top: .1em;
font-size: 0.8em;
}

.banner-redesign a {
color: white;
text-decoration: underline;
}
/* Header */

header.main {
Expand Down

0 comments on commit c60708d

Please sign in to comment.