Removed NinjectConventions, we hadn't started to use it anyway.

pull/470/head
tidusjar 8 years ago
parent fea4dd6309
commit 152408571f

@ -61,6 +61,7 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -55,6 +55,7 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -65,6 +65,7 @@
<Compile Include="WebDriverSetup.cs" /> <Compile Include="WebDriverSetup.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -31,10 +31,6 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="MediatR, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediatR.2.1.0\lib\net45\MediatR.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Data.Sqlite"> <Reference Include="Mono.Data.Sqlite">
<HintPath>..\Assemblies\Mono.Data.Sqlite.dll</HintPath> <HintPath>..\Assemblies\Mono.Data.Sqlite.dll</HintPath>
</Reference> </Reference>

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="MediatR" version="2.1.0" targetFramework="net45" />
<package id="Nancy" version="1.4.3" targetFramework="net45" /> <package id="Nancy" version="1.4.3" targetFramework="net45" />
<package id="Nancy.Authentication.Forms" version="1.4.1" targetFramework="net45" /> <package id="Nancy.Authentication.Forms" version="1.4.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />

@ -1,52 +0,0 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: MediatRModule.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using MediatR;
using Ninject;
using Ninject.Extensions.Conventions;
using Ninject.Modules;
namespace PlexRequests.UI.NinjectModules
{
public class MediatRModule : NinjectModule
{
public override void Load()
{
Kernel.Bind(scan => scan.FromAssemblyContaining<IMediator>().SelectAllClasses().BindDefaultInterface());
Bind<SingleInstanceFactory>().ToMethod(ctx => t => ctx.Kernel.Get(t));
Bind<MultiInstanceFactory>().ToMethod(ctx => t => ctx.Kernel.GetAll(t));
Kernel.Bind(x => x.FromThisAssembly()
.SelectAllClasses()
.InheritedFromAny(typeof(IRequestHandler<,>), typeof(IAsyncRequestHandler<,>))
.BindDefaultInterfaces());
//kernel.Bind(scan => scan.FromAssemblyContaining<LandingPageCommand>().SelectAllInterfaces().BindAllInterfaces());
}
}
}

@ -53,10 +53,6 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="MediatR, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediatR.2.1.0\lib\net45\MediatR.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@ -93,10 +89,6 @@
<HintPath>..\packages\Ninject.Extensions.ChildKernel.3.2.0.0\lib\net45-full\Ninject.Extensions.ChildKernel.dll</HintPath> <HintPath>..\packages\Ninject.Extensions.ChildKernel.3.2.0.0\lib\net45-full\Ninject.Extensions.ChildKernel.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Ninject.Extensions.Conventions, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.Conventions.3.2.0.0\lib\net45-full\Ninject.Extensions.Conventions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.4\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.3.4\lib\net45\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@ -232,7 +224,6 @@
<Compile Include="NinjectModules\ApiModule.cs" /> <Compile Include="NinjectModules\ApiModule.cs" />
<Compile Include="NinjectModules\ConfigurationModule.cs" /> <Compile Include="NinjectModules\ConfigurationModule.cs" />
<Compile Include="NinjectModules\DependancyResolver.cs" /> <Compile Include="NinjectModules\DependancyResolver.cs" />
<Compile Include="NinjectModules\MediatRModule.cs" />
<Compile Include="NinjectModules\RepositoryModule.cs" /> <Compile Include="NinjectModules\RepositoryModule.cs" />
<Compile Include="NinjectModules\ServicesModule.cs" /> <Compile Include="NinjectModules\ServicesModule.cs" />
<Compile Include="NinjectModules\SettingServiceModule.cs" /> <Compile Include="NinjectModules\SettingServiceModule.cs" />

@ -1,174 +1,174 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("_Sidebar")
@{ @{
int port; int port;
if (Model.EmailPort == 0) if (Model.EmailPort == 0)
{ {
port = 25; port = 25;
} }
else else
{ {
port = Model.EmailPort; port = Model.EmailPort;
} }
} }
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">
<fieldset> <fieldset>
<legend>Email Notifications</legend> <legend>Email Notifications</legend>
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="checkbox">
@if (Model.Enabled) @if (Model.Enabled)
{ {
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label> <input type="checkbox" id="Enabled" name="Enabled" checked="checked"><label for="Enabled">Enabled</label>
} }
else else
{ {
<input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label> <input type="checkbox" id="Enabled" name="Enabled"><label for="Enabled">Enabled</label>
} }
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="checkbox">
@if (Model.EnableUserEmailNotifications) @if (Model.EnableUserEmailNotifications)
{ {
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications" checked="checked"><label for="EnableUserEmailNotifications">Enable user email notifications</label> <input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications" checked="checked"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
} }
else else
{ {
<input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications"><label for="EnableUserEmailNotifications">Enable user email notifications</label> <input type="checkbox" id="EnableUserEmailNotifications" name="EnableUserEmailNotifications"><label for="EnableUserEmailNotifications">Enable user email notifications</label>
} }
</div> </div>
</div> </div>
<small>Please note that if user notifications is enabled, the email will get sent with the SMTP set-up below.</small> <small>Please note that if user notifications is enabled, the email will get sent with the SMTP set-up below.</small>
<div class="form-group"> <div class="form-group">
<label for="EmailHost" class="control-label">SMTP Host name or IP</label> <label for="EmailHost" class="control-label">SMTP Host name or IP</label>
<div class=""> <div class="">
<input type="text" class="form-control form-control-custom " id="EmailHost" name="EmailHost" placeholder="localhost" value="@Model.EmailHost"> <input type="text" class="form-control form-control-custom " id="EmailHost" name="EmailHost" placeholder="localhost" value="@Model.EmailHost">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="EmailPort" class="control-label">SMTP Port</label> <label for="EmailPort" class="control-label">SMTP Port</label>
<div class=""> <div class="">
<input type="text" class="form-control form-control-custom " id="EmailPort" name="EmailPort" placeholder="Port Number" value="@port"> <input type="text" class="form-control form-control-custom " id="EmailPort" name="EmailPort" placeholder="Port Number" value="@port">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="EmailSender" class="control-label">Email Sender</label> <label for="EmailSender" class="control-label">Email Sender</label>
<div> <div>
<input type="text" class="form-control form-control-custom " id="EmailSender" name="EmailSender" value="@Model.EmailSender"> <input type="text" class="form-control form-control-custom " id="EmailSender" name="EmailSender" value="@Model.EmailSender">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="RecipientEmail" class="control-label">Email Recipient</label> <label for="RecipientEmail" class="control-label">Email Recipient</label>
<div> <div>
<input type="text" class="form-control form-control-custom " id="RecipientEmail" name="RecipientEmail" value="@Model.RecipientEmail"> <input type="text" class="form-control form-control-custom " id="RecipientEmail" name="RecipientEmail" value="@Model.RecipientEmail">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="EmailUsername" class="control-label">Username</label> <label for="EmailUsername" class="control-label">Username</label>
<div> <div>
<input type="text" class="form-control form-control-custom " id="EmailUsername" name="EmailUsername" value="@Model.EmailUsername"> <input type="text" class="form-control form-control-custom " id="EmailUsername" name="EmailUsername" value="@Model.EmailUsername">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="EmailPassword" class="control-label">Password</label> <label for="EmailPassword" class="control-label">Password</label>
<div> <div>
<input type="password" class="form-control form-control-custom " id="EmailPassword" name="EmailPassword" value="@Model.EmailPassword"> <input type="password" class="form-control form-control-custom " id="EmailPassword" name="EmailPassword" value="@Model.EmailPassword">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div> <div>
<button id="testEmail" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button> <button id="testEmail" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div> <div>
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button> <button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
</div> </div>
</div> </div>
</fieldset> </fieldset>
</form> </form>
</div> </div>
<script> <script>
$(function () { $(function () {
var base = '@Html.GetBaseUrl()'; var base = '@Html.GetBaseUrl()';
$('#save').click(function (e) { $('#save').click(function (e) {
e.preventDefault(); e.preventDefault();
var port = $('#EmailPort').val(); var port = $('#EmailPort').val();
if (isNaN(port)) { if (isNaN(port)) {
generateNotify("You must specify a valid Port.", "warning"); generateNotify("You must specify a valid Port.", "warning");
return; return;
} }
var $form = $("#mainForm"); var $form = $("#mainForm");
$.ajax({ $.ajax({
type: $form.prop("method"), type: $form.prop("method"),
data: $form.serialize(), data: $form.serialize(),
url: $form.prop("action"), url: $form.prop("action"),
dataType: "json", dataType: "json",
success: function (response) { success: function (response) {
if (response.result === true) { if (response.result === true) {
generateNotify(response.message, "success"); generateNotify(response.message, "success");
} else { } else {
generateNotify(response.message, "warning"); generateNotify(response.message, "warning");
} }
}, },
error: function (e) { error: function (e) {
console.log(e); console.log(e);
generateNotify("Something went wrong!", "danger"); generateNotify("Something went wrong!", "danger");
} }
}); });
}); });
$('#testEmail').click(function (e) { $('#testEmail').click(function (e) {
$('#spinner').attr("class", "fa fa-spinner fa-spin"); $('#spinner').attr("class", "fa fa-spinner fa-spin");
var url = createBaseUrl(base, '/admin/testemailnotification'); var url = createBaseUrl(base, '/admin/testemailnotification');
e.preventDefault(); e.preventDefault();
var port = $('#EmailPort').val(); var port = $('#EmailPort').val();
if (isNaN(port)) { if (isNaN(port)) {
generateNotify("You must specify a valid Port.", "warning"); generateNotify("You must specify a valid Port.", "warning");
return; return;
} }
var $form = $("#mainForm"); var $form = $("#mainForm");
$.ajax({ $.ajax({
type: $form.prop("method"), type: $form.prop("method"),
data: $form.serialize(), data: $form.serialize(),
url: url, url: url,
dataType: "json", dataType: "json",
success: function (response) { success: function (response) {
if (response.result === true) { if (response.result === true) {
$('#spinner').attr("class", "fa fa-check"); $('#spinner').attr("class", "fa fa-check");
generateNotify(response.message, "success"); generateNotify(response.message, "success");
} else { } else {
$('#spinner').attr("class", "fa fa-times"); $('#spinner').attr("class", "fa fa-times");
generateNotify(response.message, "warning"); generateNotify(response.message, "warning");
} }
}, },
error: function (e) { error: function (e) {
console.log(e); console.log(e);
$('#spinner').attr("class", "fa fa-times"); $('#spinner').attr("class", "fa fa-times");
generateNotify("Something went wrong!", "danger"); generateNotify("Something went wrong!", "danger");
} }
}); });
}); });
}); });
</script> </script>

@ -9,7 +9,6 @@
<package id="FluentValidation" version="6.2.1.0" targetFramework="net45" /> <package id="FluentValidation" version="6.2.1.0" targetFramework="net45" />
<package id="jQuery" version="1.9.1" targetFramework="net45" /> <package id="jQuery" version="1.9.1" targetFramework="net45" />
<package id="MarkdownSharp" version="1.13.0.0" targetFramework="net45" /> <package id="MarkdownSharp" version="1.13.0.0" targetFramework="net45" />
<package id="MediatR" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net45" />
@ -32,7 +31,6 @@
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="Ninject" version="3.2.0.0" targetFramework="net45" /> <package id="Ninject" version="3.2.0.0" targetFramework="net45" />
<package id="Ninject.Extensions.ChildKernel" version="3.2.0.0" targetFramework="net45" /> <package id="Ninject.Extensions.ChildKernel" version="3.2.0.0" targetFramework="net45" />
<package id="Ninject.Extensions.Conventions" version="3.2.0.0" targetFramework="net45" />
<package id="NLog" version="4.3.4" targetFramework="net45" /> <package id="NLog" version="4.3.4" targetFramework="net45" />
<package id="NLog.Config" version="4.2.3" targetFramework="net45" /> <package id="NLog.Config" version="4.2.3" targetFramework="net45" />
<package id="NLog.Schema" version="4.0.0" targetFramework="net45" /> <package id="NLog.Schema" version="4.0.0" targetFramework="net45" />

Loading…
Cancel
Save