Skip to content

Commit 2a4b380

Browse files
authored
Remove Usabilla (#8417)
* Revert "Don't show Usabilla button if it's blocked (#8208)" This reverts commit cafe6a9. * Revert "Add support for a Usabilla button on all packages (#7768)" This reverts commit 705020b. * Apply conflict
1 parent 386cdf5 commit 2a4b380

17 files changed

Lines changed: 0 additions & 169 deletions

File tree

src/AccountDeleter/Configuration/GalleryConfiguration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public string SiteRoot
108108
public string EmbeddedIconUrlTemplate { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
109109
public bool SelfServiceAccountDeleteEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
110110
public string DeploymentLabel { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
111-
public string UsabillaFeedbackButtonId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
112111
public int? MinWorkerThreads { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
113112
public int? MaxWorkerThreads { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
114113
public int? MinIoThreads { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

src/Bootstrap/dist/css/bootstrap-theme.css

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/dist/css/bootstrap.css

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/less/responsive-utilities.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
width: device-width;
2525
}
2626

27-
// See: https://stackoverflow.com/a/19706857
28-
body {
29-
-ms-overflow-style: scrollbar;
30-
}
3127

3228
// Visibility utilities
3329
// Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0

src/Bootstrap/less/theme/base.less

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -417,17 +417,6 @@ img.reserved-indicator-icon {
417417
}
418418
}
419419

420-
.usabilla-button {
421-
top: auto !important;
422-
margin-top: -65px;
423-
bottom: 20%;
424-
width: 40px;
425-
height: 130px;
426-
position: fixed;
427-
z-index: 99999;
428-
right: 0;
429-
}
430-
431420
.sortable {
432421
cursor: pointer;
433422
}

src/NuGetGallery.Services/Configuration/AppConfiguration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,6 @@ public string ExternalBrandingMessage
406406
[DefaultValue(null)]
407407
public string DeploymentLabel { get; set; }
408408

409-
public string UsabillaFeedbackButtonId { get; set; }
410-
411409
[DefaultValue(null)]
412410
public int? MinWorkerThreads { get; set; }
413411
[DefaultValue(null)]

src/NuGetGallery.Services/Configuration/FeatureFlagService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public class FeatureFlagService : IFeatureFlagService
3939
private const string ODataCacheDurationsFeatureName = GalleryPrefix + "ODataCacheDurations";
4040
private const string ShowEnable2FADialog = GalleryPrefix + "ShowEnable2FADialog";
4141
private const string Get2FADismissFeedback = GalleryPrefix + "Get2FADismissFeedback";
42-
private const string UsabillaOnEveryPageFeatureName = GalleryPrefix + "UsabillaEveryPage";
4342
private const string PackageRenamesFeatureName = GalleryPrefix + "PackageRenames";
4443
private const string EmbeddedReadmeFlightName = GalleryPrefix + "EmbeddedReadmes";
4544
private const string LicenseMdRenderingFlightName = GalleryPrefix + "LicenseMdRendering";
@@ -215,11 +214,6 @@ public bool IsGet2FADismissFeedbackEnabled()
215214
return _client.IsEnabled(Get2FADismissFeedback, defaultValue: false);
216215
}
217216

218-
public bool IsUsabillaButtonEnabledOnEveryPage()
219-
{
220-
return _client.IsEnabled(UsabillaOnEveryPageFeatureName, defaultValue: false);
221-
}
222-
223217
public bool IsPackageRenamesEnabled(User user)
224218
{
225219
return _client.IsEnabled(PackageRenamesFeatureName, user, defaultValue: false);

src/NuGetGallery.Services/Configuration/IAppConfiguration.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,6 @@ public interface IAppConfiguration : IMessageServiceConfiguration
461461
/// </summary>
462462
string DeploymentLabel { get; set; }
463463

464-
/// <summary>
465-
/// The Usabilla feedback button ID embedded in the JavaScript snippet obtained from Usabilla. The ID can found
466-
/// in your button's JavaScript code. Look for "//w.usabilla.com/{button ID}.js".
467-
/// </summary>
468-
string UsabillaFeedbackButtonId { get; set; }
469-
470464
/// <summary>
471465
/// Allows to override the default (or externally configured) minWorkerThreads setting. Must be specified with <see cref="MinIoThreads"/>.
472466
/// This is a global (not per CPU core) limit.

src/NuGetGallery.Services/Configuration/IFeatureFlagService.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,6 @@ public interface IFeatureFlagService
153153
/// </summary>
154154
bool IsGet2FADismissFeedbackEnabled();
155155

156-
/// <summary>
157-
/// Whether we should enable the Usabilla feedback button on every page.
158-
/// </summary>
159-
bool IsUsabillaButtonEnabledOnEveryPage();
160-
161156
/// <summary>
162157
/// Whether the user is able to see or manage the package renames information.
163158
/// </summary>

src/NuGetGallery/App_Code/ViewHelpers.cshtml

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -348,37 +348,6 @@
348348
}
349349
}
350350

351-
@helper UsabillaButton(UrlHelper url, dynamic viewBag)
352-
{
353-
if (GetUsabillaButtonIdOrNull(viewBag) != null)
354-
{
355-
<div class="usabilla-button" id="usabilla-button" style="display: none">
356-
<a tabindex="0" id="usbl-integrated-button" href="#" role="button">
357-
<img width="40" height="130" src="~/Content/gallery/img/feedback.svg" alt="Usabilla Feedback"
358-
@ViewHelpers.ImageFallback(url.Absolute("~/Content/gallery/img/feedback-40x130.png")) />
359-
</a>
360-
</div>
361-
}
362-
}
363-
364-
@helper UsabillaScript(dynamic viewBag)
365-
{
366-
var buttonId = GetUsabillaButtonIdOrNull(viewBag);
367-
if (buttonId != null)
368-
{
369-
var obfuscatedPath = ObfuscationHelper.ObfuscateRequestUrl(new HttpContextWrapper(HttpContext.Current), RouteTable.Routes);
370-
<!-- begin usabilla live embed code -->
371-
<script type="text/javascript">
372-
/*{literal}<![CDATA[*/window.lightningjs||function(c){function g(b,d){d&&(d+=(/\?/.test(d)?"&":"?")+"lv=1");c[b]||function(){var i=window,h=document,j=b,g=h.location.protocol,l="load",k=0;(function(){function b(){a.P(l);a.w=1;c[j]("_load")}c[j]=function(){function m(){m.id=e;return c[j].apply(m,arguments)}var b,e=++k;b=this&&this!=i?this.id||0:0;(a.s=a.s||[]).push([e,b,arguments]);m.then=function(b,c,h){var d=a.fh[e]=a.fh[e]||[],j=a.eh[e]=a.eh[e]||[],f=a.ph[e]=a.ph[e]||[];b&&d.push(b);c&&j.push(c);h&&f.push(h);return m};return m};var a=c[j]._={};a.fh={};a.eh={};a.ph={};a.l=d?d.replace(/^\/\//,(g=="https:"?g:"http:")+"//"):d;a.p={0:+new Date};a.P=function(b){a.p[b]=new Date-a.p[0]};a.w&&b();i.addEventListener?i.addEventListener(l,b,!1):i.attachEvent("on"+l,b);var q=function(){function b(){return["<head></head><",c,' onload="var d=',n,";d.getElementsByTagName('head')[0].",d,"(d.",g,"('script')).",i,"='",a.l,"'\"></",c,">"].join("")}var c="body",e=h[c];if(!e)return setTimeout(q,100);a.P(1);var d="appendChild",g="createElement",i="src",k=h[g]("div"),l=k[d](h[g]("div")),f=h[g]("iframe"),n="document",p;k.style.display="none";e.insertBefore(k,e.firstChild).id=o+"-"+j;f.frameBorder="0";f.id=o+"-frame-"+j;/MSIE[ ]+6/.test(navigator.userAgent)&&(f[i]="javascript:false");f.allowTransparency="true";l[d](f);try{f.contentWindow[n].open()}catch(s){a.domain=h.domain,p="javascript:var d="+n+".open();d.domain='"+h.domain+"';",f[i]=p+"void(0);"}try{var r=f.contentWindow[n];r.write(b());r.close()}catch(t){f[i]=p+'d.write("'+b().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};a.l&&setTimeout(q,0)})()}();c[b].lv="1";return c[b]}var o="lightningjs",k=window[o]=g(o);k.require=g;k.modules=c}({});
373-
window.usabilla_live = lightningjs.require("usabilla_live", "//w.usabilla.com/@(buttonId).js");
374-
/*]]>{/literal}*/</script>
375-
<!-- end usabilla live embed code -->
376-
<script type="text/javascript">
377-
window.nuget.enableUsabilla('@obfuscatedPath');
378-
</script>
379-
}
380-
}
381-
382351
@helper AccordionBar(
383352
string groupName,
384353
WebViewPage page,
@@ -728,29 +697,6 @@ var hlp = new AccordionHelper(name, formModelStatePrefix, expanded, page);
728697

729698
@functions
730699
{
731-
public static string GetUsabillaButtonIdOrNull(dynamic viewBag)
732-
{
733-
var config = DependencyResolver.Current.GetService<IGalleryConfigurationService>();
734-
if (config != null)
735-
{
736-
var buttonId = config.Current.UsabillaFeedbackButtonId;
737-
if (!string.IsNullOrWhiteSpace(buttonId))
738-
{
739-
var featureFlagService = DependencyResolver.Current.GetService<IFeatureFlagService>();
740-
if (featureFlagService.IsUsabillaButtonEnabledOnEveryPage())
741-
{
742-
bool canWriteAnalyticsCookies = viewBag.CanWriteAnalyticsCookies ?? false;
743-
if (canWriteAnalyticsCookies)
744-
{
745-
return buttonId;
746-
}
747-
}
748-
}
749-
}
750-
751-
return null;
752-
}
753-
754700
public static bool IsLicenseOrException(CompositeLicenseExpressionSegment segment)
755701
{
756702
return segment.Type == CompositeLicenseExpressionSegmentType.LicenseIdentifier || segment.Type == CompositeLicenseExpressionSegmentType.ExceptionIdentifier;

0 commit comments

Comments
 (0)