qol: fix System.Net.Http dependencies
This commit is contained in:
@@ -53,7 +53,6 @@
|
|||||||
<Reference Include="System.DirectoryServices" />
|
<Reference Include="System.DirectoryServices" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@@ -62,7 +61,6 @@
|
|||||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net.Http.WebRequest" />
|
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
|
|||||||
@@ -65,16 +65,14 @@ namespace Disco.Models.Repository
|
|||||||
public AttachmentTypes HasAttachmentType { get { return AttachmentTypes.User; } }
|
public AttachmentTypes HasAttachmentType { get { return AttachmentTypes.User; } }
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
=> $"{DisplayName} ({UserId})";
|
||||||
return string.Format("{0} ({1})", this.DisplayName, this.UserId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool UpdateSelf(User u)
|
public bool UpdateSelf(User u)
|
||||||
{
|
{
|
||||||
var changed = false;
|
var changed = false;
|
||||||
|
|
||||||
if (!this.UserId.Equals(u.UserId, StringComparison.OrdinalIgnoreCase))
|
if (!this.UserId.Equals(u.UserId, StringComparison.OrdinalIgnoreCase))
|
||||||
throw new ArgumentException("User Id's do not match", "u");
|
throw new ArgumentException("User Id's do not match", nameof(u));
|
||||||
|
|
||||||
if (this.Surname != u.Surname)
|
if (this.Surname != u.Surname)
|
||||||
{
|
{
|
||||||
|
|||||||
-10
@@ -37,20 +37,10 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Net.Http.WebRequest" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -144,11 +144,28 @@ namespace Disco.Services.Plugins
|
|||||||
{
|
{
|
||||||
this.controllerDescription = controllerDescription;
|
this.controllerDescription = controllerDescription;
|
||||||
this.methodInfo = methodInfo;
|
this.methodInfo = methodInfo;
|
||||||
UniqueId = $"{ControllerDescriptor.UniqueId}_{methodName}";
|
|
||||||
ActionName = methodName;
|
|
||||||
authorizationFilters = DiscoverAuthorizationFilters();
|
authorizationFilters = DiscoverAuthorizationFilters();
|
||||||
methodSelector = DiscoverMethodSelector();
|
methodSelector = DiscoverMethodSelector();
|
||||||
parameterDescriptors = DiscoverParameters();
|
parameterDescriptors = DiscoverParameters();
|
||||||
|
|
||||||
|
switch (methodSelector)
|
||||||
|
{
|
||||||
|
case HttpPostAttribute _:
|
||||||
|
methodName += ":POST";
|
||||||
|
break;
|
||||||
|
case HttpGetAttribute _:
|
||||||
|
methodName += ":GET";
|
||||||
|
break;
|
||||||
|
case HttpPutAttribute _:
|
||||||
|
methodName += ":PUT";
|
||||||
|
break;
|
||||||
|
case HttpDeleteAttribute _:
|
||||||
|
methodName += ":DELETE";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionName = methodName;
|
||||||
|
UniqueId = $"{ControllerDescriptor.UniqueId}_{methodName}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private IAuthorizationFilter[] DiscoverAuthorizationFilters()
|
private IAuthorizationFilter[] DiscoverAuthorizationFilters()
|
||||||
@@ -311,14 +328,19 @@ namespace Disco.Services.Plugins
|
|||||||
var methods = Array.FindAll(ControllerType.GetMethods(BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), mi => { return !mi.IsSpecialName && typeof(ActionResult).IsAssignableFrom(mi.ReturnType); });
|
var methods = Array.FindAll(ControllerType.GetMethods(BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), mi => { return !mi.IsSpecialName && typeof(ActionResult).IsAssignableFrom(mi.ReturnType); });
|
||||||
foreach (var method in methods)
|
foreach (var method in methods)
|
||||||
{
|
{
|
||||||
actions.Add(method.Name, new PluginActionDescriptor(this, method.Name, method));
|
var descriptor = new PluginActionDescriptor(this, method.Name, method);
|
||||||
|
actions.Add(descriptor.ActionName, descriptor);
|
||||||
}
|
}
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ActionDescriptor FindAction(ControllerContext controllerContext, string actionName)
|
public override ActionDescriptor FindAction(ControllerContext controllerContext, string actionName)
|
||||||
{
|
{
|
||||||
if (actions.TryGetValue(actionName, out var action))
|
var method = controllerContext.HttpContext.Request.HttpMethod.ToUpperInvariant();
|
||||||
|
|
||||||
|
if (actions.TryGetValue($"{actionName}:{method}", out var action))
|
||||||
|
return action;
|
||||||
|
if (actions.TryGetValue(actionName, out action))
|
||||||
return action;
|
return action;
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -50,14 +50,12 @@
|
|||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Data.Entity" />
|
<Reference Include="System.Data.Entity" />
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Net.Http.Extensions">
|
<Reference Include="System.Net.Http.Extensions">
|
||||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net.Http.Primitives">
|
<Reference Include="System.Net.Http.Primitives">
|
||||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net.Http.WebRequest" />
|
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
@* Generator: WebPagesHelper *@
|
@* Generator: WebPagesHelper *@
|
||||||
@using Disco;
|
@using Disco;
|
||||||
@using Disco.BI.Extensions;
|
|
||||||
@using Disco.Models.Repository;
|
@using Disco.Models.Repository;
|
||||||
@using Disco.Services;
|
@using Disco.Services;
|
||||||
@using Disco.Services.Web;
|
@using Disco.Services.Web;
|
||||||
@@ -9,9 +8,9 @@
|
|||||||
@using System.Web.Mvc.Html;
|
@using System.Web.Mvc.Html;
|
||||||
|
|
||||||
@helper FriendlyDate(DateTime d, string ElementId = null, bool WithoutSuffix = false)
|
@helper FriendlyDate(DateTime d, string ElementId = null, bool WithoutSuffix = false)
|
||||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-livestamp="@d.ToUnixEpoc()" data-isodate="@d.ToISO8601()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime()</span>}
|
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId))) title="@d.ToFullDateTime()" data-livestamp="@d.ToUnixEpoc()" data-isodate="@d.ToISO8601()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime()</span>}
|
||||||
@helper FriendlyDate(DateTime? d, string NullValue = "n/a", string ElementId = null, bool WithoutSuffix = false)
|
@helper FriendlyDate(DateTime? d, string NullValue = "n/a", string ElementId = null, bool WithoutSuffix = false)
|
||||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-livestamp="@d.ToUnixEpoc()" data-isodate="@d.ToISO8601()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime(NullValue)</span>}
|
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId))) title="@d.ToFullDateTime(NullValue)" data-livestamp="@d.ToUnixEpoc()" data-isodate="@d.ToISO8601()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime(NullValue)</span>}
|
||||||
@helper FriendlyDateAndUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
@helper FriendlyDateAndUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||||
{
|
{
|
||||||
@FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix);
|
@FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix);
|
||||||
@@ -44,22 +43,22 @@
|
|||||||
{
|
{
|
||||||
if (u != null)
|
if (u != null)
|
||||||
{
|
{
|
||||||
@prepend <span title="@u">@u.FriendlyId()</span>
|
@prepend <span title="@u">@u.FriendlyId()</span>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<span>@nullValue</span>
|
<span>@nullValue</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@helper FriendlyUser(string UserId, string nullValue = null, string prepend = null)
|
@helper FriendlyUser(string UserId, string nullValue = null, string prepend = null)
|
||||||
{
|
{
|
||||||
if (UserId != null)
|
if (UserId != null)
|
||||||
{
|
{
|
||||||
@prepend <span>@Disco.Services.Interop.ActiveDirectory.ActiveDirectory.FriendlyAccountId(UserId)</span>
|
@prepend <span>@Disco.Services.Interop.ActiveDirectory.ActiveDirectory.FriendlyAccountId(UserId)</span>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<span>@nullValue</span>
|
<span>@nullValue</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,21 +101,24 @@
|
|||||||
<tr>
|
<tr>
|
||||||
@for (int i = 0; i < columns; i++)
|
@for (int i = 0; i < columns; i++)
|
||||||
{
|
{
|
||||||
<td@(alignEven ? new HtmlString(string.Format(" style=\"width: {0}%\"", columnWidth)) : new HtmlString(string.Empty))>
|
<td @(alignEven ? new HtmlString(string.Format(" style=\"width: {0}%\"", columnWidth)) : new HtmlString(string.Empty))>
|
||||||
<ul class="none">
|
<ul class="none">
|
||||||
@{
|
@{
|
||||||
int itemsForThisColumn = itemsPerColumn + (items.Count % columns > i ? 1 : 0);
|
int itemsForThisColumn = itemsPerColumn + (items.Count % columns > i ? 1 : 0);
|
||||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < items.Count; i2++)
|
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < items.Count; i2++)
|
||||||
{
|
{
|
||||||
var item = items[itemNextId];
|
var item = items[itemNextId];
|
||||||
itemNextId++;
|
itemNextId++;
|
||||||
var itemId = forceUniqueIds.HasValue ? string.Format("{0}_{1}_{2}", id, item.Value, forceUniqueIds++) : string.Format("{0}_{1}", id, item.Value);
|
var itemId = forceUniqueIds.HasValue ? string.Format("{0}_{1}_{2}", id, item.Value, forceUniqueIds++) : string.Format("{0}_{1}", id, item.Value);
|
||||||
<li>
|
<li>
|
||||||
<input id="@itemId" name="@id" value="@item.Value" type="@inputType" @(item.Selected ? new HtmlString("checked=\"checked\" ") : null)/><label for="@itemId">@if (htmlEncodeText)
|
<input id="@itemId" name="@id" value="@item.Value" type="@inputType" @(item.Selected ? new HtmlString("checked=\"checked\" ") : null) /><label for="@itemId">
|
||||||
{ @item.Text }
|
@if (htmlEncodeText)
|
||||||
else
|
{@item.Text }
|
||||||
{ @(new HtmlString(item.Text)) }</label></li>
|
else
|
||||||
}
|
{ @(new HtmlString(item.Text))}
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
@@ -133,15 +135,15 @@
|
|||||||
var breadCrumb = BreadCrumbs[index];
|
var breadCrumb = BreadCrumbs[index];
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
{
|
{
|
||||||
<span>></span>
|
<span>></span>
|
||||||
}
|
}
|
||||||
if (breadCrumb.Item2 == null)
|
if (breadCrumb.Item2 == null)
|
||||||
{
|
{
|
||||||
@breadCrumb.Item1
|
<span title="@breadCrumb.Item1">@breadCrumb.Item1</span>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@Html.GetPageHelper().ActionLink(breadCrumb.Item1, breadCrumb.Item2)
|
@Html.GetPageHelper().ActionLink(breadCrumb.Item1, breadCrumb.Item2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,9 +158,9 @@
|
|||||||
var breadCrumb = BreadCrumbs[index];
|
var breadCrumb = BreadCrumbs[index];
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
{
|
{
|
||||||
@(new HtmlString(" > "))
|
@(new HtmlString(" > "))
|
||||||
}
|
}
|
||||||
@breadCrumb.Item1
|
@breadCrumb.Item1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@helper BreadcrumbsTitle(string Title)
|
@helper BreadcrumbsTitle(string Title)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -183,10 +183,6 @@
|
|||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net.Http">
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Net.Http.WebRequest">
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="T4MVCExtensions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
|
<Reference Include="T4MVCExtensions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\T4MVCExtensions.3.17.5\lib\net40\T4MVCExtensions.dll</HintPath>
|
<HintPath>..\packages\T4MVCExtensions.3.17.5\lib\net40\T4MVCExtensions.dll</HintPath>
|
||||||
|
|||||||
Reference in New Issue
Block a user