From 1c7cc62af49e0426673062c977dd70223c26f3d6 Mon Sep 17 00:00:00 2001 From: gauffininteractive Date: Mon, 27 Feb 2017 20:08:32 +0100 Subject: [PATCH] * Added .gitattributes to enforce line endings on .NET files. * (Gitattribute generated changes) * installation area is now completety disabled once OTE is installed --- .gitattributes | 22 + .../Controllers/SetupController.cs | 308 +- .../Installation/Views/Setup/Completed.cshtml | 48 +- .../Controllers/HomeController.cs | 60 +- .../OneTrueError.Web/OneTrueError.Web.csproj | 1421 ++++---- .../OneTrueError.Web/Scripts/CqsClient.js | 132 +- .../Scripts/Griffin.Editor.js | 1316 +++---- .../OneTrueError.Web/Scripts/Griffin.Net.js | 472 +-- .../Scripts/Griffin.WebApp.js | 730 ++-- .../Scripts/Models/AllModels.js | 3210 ++++++++--------- .../OneTrueError.Web/Scripts/Promise.js | 658 ++-- .../ViewModels/Account/AcceptedViewModel.js | 34 +- .../ViewModels/Account/SettingsViewModel.js | 112 +- .../ViewModels/Account/WelcomeViewModel.js | 34 +- .../Application/DetailsViewModel.js | 598 +-- .../Application/InstallationViewModel.js | 52 +- .../ViewModels/Application/TeamViewModel.js | 132 +- .../ViewModels/ChartViewModel.js | 336 +- .../Feedback/ApplicationViewModel.js | 150 +- .../ViewModels/Feedback/IncidentViewModel.js | 128 +- .../ViewModels/Feedback/OverviewViewModel.js | 140 +- .../ViewModels/Home/WelcomeViewModel.js | 34 +- .../ViewModels/Incident/CloseViewModel.js | 144 +- .../ViewModels/Incident/IgnoreViewModel.js | 96 +- .../ViewModels/Incident/IncidentViewModel.js | 330 +- .../ViewModels/Incident/IndexViewModel.js | 328 +- .../ViewModels/Incident/OriginsViewModel.js | 132 +- .../Incident/SimilaritiesViewModel.js | 226 +- .../ViewModels/Overview/OverviewViewModel.js | 508 +-- .../ViewModels/Report/ReportViewModel.js | 190 +- .../ViewModels/User/NotificationsViewModel.js | 86 +- .../ViewModels/User/SettingsViewModel.js | 130 +- .../OneTrueError.Web/app/Application.js | 70 +- 33 files changed, 6198 insertions(+), 6169 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ceba70d8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +#*.c text +#*.h text + +# Declare files that will always have CRLF line endings on checkout. +*.sln text eol=crlf +*.csproj text filter=csprojarrange +*.cs text eol=crlf +*.cshtml text eol=crlf +*.ts text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.gif binary +*.obj binary +*.exe binary +*.dll binary diff --git a/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs b/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs index 0e0ee875..9d864298 100644 --- a/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs +++ b/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs @@ -1,155 +1,155 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Net.Http; -using System.Threading.Tasks; -using System.Web.Mvc; -using OneTrueError.App.Configuration; -using OneTrueError.Infrastructure; -using OneTrueError.Infrastructure.Configuration; -using OneTrueError.Web.Areas.Installation.Models; - -namespace OneTrueError.Web.Areas.Installation.Controllers -{ - public class SetupController : Controller - { - [HttpPost, AllowAnonymous] - public ActionResult Activate() - { - ConfigurationManager.RefreshSection("appSettings"); - if (ConfigurationManager.AppSettings["Configured"] != "true") - { - return RedirectToAction("Completed", new - { - displayError = 1 - }); - } - return Redirect("~/?#/welcome"); - } - - public ActionResult Support() - { - return View(new SupportViewModel()); - } - - [HttpPost] - public async Task Support(SupportViewModel model) - { - if (!ModelState.IsValid) - return View(model); - - try - { - var client = new HttpClient(); - var content = - new FormUrlEncodedContent(new [] - { - new KeyValuePair("EmailAddress", model.Email), - new KeyValuePair("CompanyName", model.CompanyName) - }); - await client.PostAsync("https://onetrueerror.com/support/register/", content); - return Redirect(Url.GetNextWizardStep()); - } - catch (Exception ex) - { - ModelState.AddModelError("", ex.Message); - return View(model); - } - } - - public ActionResult Basics() - { - var model = new BasicsViewModel(); - var config = ConfigurationStore.Instance.Load(); - if (config != null) - { - model.BaseUrl = config.BaseUrl.ToString(); - model.SupportEmail = config.SupportEmail; - } - else - { - model.BaseUrl = Request.Url.ToString().Replace("installation/setup/basics/", "").Replace("localhost", "yourServerName"); - ViewBag.NextLink = ""; - } - - - return View(model); - } - - [HttpPost] - public ActionResult Basics(BasicsViewModel model) - { - var settings = new BaseConfiguration(); - if (!model.BaseUrl.EndsWith("/")) - model.BaseUrl += "/"; - - if (model.BaseUrl.IndexOf("localhost", StringComparison.OrdinalIgnoreCase) != -1) - { - ModelState.AddModelError("BaseUrl", "Use the servers real DNS name instead of 'localhost'. If you don't the Ajax request wont work as CORS would be enforced by IIS."); - return View(model); - } - settings.BaseUrl = new Uri(model.BaseUrl); - settings.SupportEmail = model.SupportEmail; - ConfigurationStore.Instance.Store(settings); - return Redirect(Url.GetNextWizardStep()); - } - - - public ActionResult Completed(string displayError = null) - { - ViewBag.DisplayError = displayError == "1"; - return View(); - } - - public ActionResult Errors() - { - var model = new ErrorTrackingViewModel(); - var config = ConfigurationStore.Instance.Load(); - if (config != null) - { - model.ActivateTracking = config.ActivateTracking; - model.ContactEmail = config.ContactEmail; - model.InstallationId = config.InstallationId; - } - else - ViewBag.NextLink = ""; - - return View("ErrorTracking", model); - } - - [HttpPost] - public ActionResult Errors(ErrorTrackingViewModel model) - { - if (!ModelState.IsValid) - return View("ErrorTracking", model); - - var settings = new OneTrueErrorConfigSection(); - settings.ActivateTracking = model.ActivateTracking; - settings.ContactEmail = model.ContactEmail; - settings.InstallationId = model.InstallationId; - ConfigurationStore.Instance.Store(settings); - return Redirect(Url.GetNextWizardStep()); - } - - // GET: Installation/Home - public ActionResult Index() - { - try - { - ConnectionFactory.Create(); - } - catch - { - ViewBag.Ready = false; - } - return View(); - } - - protected override void OnActionExecuting(ActionExecutingContext filterContext) - { - ViewBag.PrevLink = Url.GetPreviousWizardStepLink(); - ViewBag.NextLink = Url.GetNextWizardStepLink(); - base.OnActionExecuting(filterContext); - } - } +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Net.Http; +using System.Threading.Tasks; +using System.Web.Mvc; +using OneTrueError.App.Configuration; +using OneTrueError.Infrastructure; +using OneTrueError.Infrastructure.Configuration; +using OneTrueError.Web.Areas.Installation.Models; + +namespace OneTrueError.Web.Areas.Installation.Controllers +{ + public class SetupController : Controller + { + [HttpPost, AllowAnonymous] + public ActionResult Activate() + { + ConfigurationManager.RefreshSection("appSettings"); + if (ConfigurationManager.AppSettings["Configured"] != "true") + { + return RedirectToAction("Completed", new + { + displayError = 1 + }); + } + return Redirect("~/?#/welcome"); + } + + public ActionResult Support() + { + return View(new SupportViewModel()); + } + + [HttpPost] + public async Task Support(SupportViewModel model) + { + if (!ModelState.IsValid) + return View(model); + + try + { + var client = new HttpClient(); + var content = + new FormUrlEncodedContent(new [] + { + new KeyValuePair("EmailAddress", model.Email), + new KeyValuePair("CompanyName", model.CompanyName) + }); + await client.PostAsync("https://onetrueerror.com/support/register/", content); + return Redirect(Url.GetNextWizardStep()); + } + catch (Exception ex) + { + ModelState.AddModelError("", ex.Message); + return View(model); + } + } + + public ActionResult Basics() + { + var model = new BasicsViewModel(); + var config = ConfigurationStore.Instance.Load(); + if (config != null) + { + model.BaseUrl = config.BaseUrl.ToString(); + model.SupportEmail = config.SupportEmail; + } + else + { + model.BaseUrl = Request.Url.ToString().Replace("installation/setup/basics/", "").Replace("localhost", "yourServerName"); + ViewBag.NextLink = ""; + } + + + return View(model); + } + + [HttpPost] + public ActionResult Basics(BasicsViewModel model) + { + var settings = new BaseConfiguration(); + if (!model.BaseUrl.EndsWith("/")) + model.BaseUrl += "/"; + + if (model.BaseUrl.IndexOf("localhost", StringComparison.OrdinalIgnoreCase) != -1) + { + ModelState.AddModelError("BaseUrl", "Use the servers real DNS name instead of 'localhost'. If you don't the Ajax request wont work as CORS would be enforced by IIS."); + return View(model); + } + settings.BaseUrl = new Uri(model.BaseUrl); + settings.SupportEmail = model.SupportEmail; + ConfigurationStore.Instance.Store(settings); + return Redirect(Url.GetNextWizardStep()); + } + + + public ActionResult Completed(string displayError = null) + { + ViewBag.DisplayError = displayError == "1"; + return View(); + } + + public ActionResult Errors() + { + var model = new ErrorTrackingViewModel(); + var config = ConfigurationStore.Instance.Load(); + if (config != null) + { + model.ActivateTracking = config.ActivateTracking; + model.ContactEmail = config.ContactEmail; + model.InstallationId = config.InstallationId; + } + else + ViewBag.NextLink = ""; + + return View("ErrorTracking", model); + } + + [HttpPost] + public ActionResult Errors(ErrorTrackingViewModel model) + { + if (!ModelState.IsValid) + return View("ErrorTracking", model); + + var settings = new OneTrueErrorConfigSection(); + settings.ActivateTracking = model.ActivateTracking; + settings.ContactEmail = model.ContactEmail; + settings.InstallationId = model.InstallationId; + ConfigurationStore.Instance.Store(settings); + return Redirect(Url.GetNextWizardStep()); + } + + // GET: Installation/Home + public ActionResult Index() + { + try + { + ConnectionFactory.Create(); + } + catch + { + ViewBag.Ready = false; + } + return View(); + } + + protected override void OnActionExecuting(ActionExecutingContext filterContext) + { + ViewBag.PrevLink = Url.GetPreviousWizardStepLink(); + ViewBag.NextLink = Url.GetNextWizardStepLink(); + base.OnActionExecuting(filterContext); + } + } } \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Areas/Installation/Views/Setup/Completed.cshtml b/src/Server/OneTrueError.Web/Areas/Installation/Views/Setup/Completed.cshtml index aece07c8..f9cf10fb 100644 --- a/src/Server/OneTrueError.Web/Areas/Installation/Views/Setup/Completed.cshtml +++ b/src/Server/OneTrueError.Web/Areas/Installation/Views/Setup/Completed.cshtml @@ -1,25 +1,25 @@ -@{ - ViewBag.Title = "Installation - Completed"; -} -
-
- -

Congratulations!

- -

The setup is now completed. You need to deactive this configuration part of OneTrueError for security reasons..

-

- Change the Configured appKey to "true" in your web.config. Then click "Complete" to start OneTrueError -

- @if (ViewBag.DisplayError) - { -

Error!

-
- Change the key in your web.config to this: <add key="Configured" value="true" />. OneTrueError won't start otherwise. -
- } -
- -
- @Html.Raw(ViewBag.PrevStep) -
+@{ + ViewBag.Title = "Installation - Completed"; +} +
+
+ +

Congratulations!

+ +

The setup is now completed. You need to deactive this configuration part of OneTrueError for security reasons..

+

+ Change the Configured appKey to "true" in your web.config. Then click "Complete" to start OneTrueError +

+ @if (ViewBag.DisplayError) + { +

Error!

+
+ Change the key in your web.config to this: <add key="Configured" value="true" />. OneTrueError won't start otherwise. +
+ } +
+ +
+ @Html.Raw(ViewBag.PrevStep) +
\ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Controllers/HomeController.cs b/src/Server/OneTrueError.Web/Controllers/HomeController.cs index 42ab10a7..bf83a4ae 100644 --- a/src/Server/OneTrueError.Web/Controllers/HomeController.cs +++ b/src/Server/OneTrueError.Web/Controllers/HomeController.cs @@ -1,28 +1,34 @@ -using System.Web.Mvc; -using OneTrueError.Api.Core.Applications; -using OneTrueError.Api.Core.Applications.Commands; - -namespace OneTrueError.Web.Controllers -{ - [Authorize] - public class HomeController : Controller - { - public ActionResult Index() - { - return View(); - } - - [AllowAnonymous, Route("installation/{*url}")] - public ActionResult NoInstallation() - { - return View(); - } - - [AllowAnonymous] - public ActionResult ToInstall() - { - return RedirectToRoute(new {Controller = "Setup", Area = "Installation"}); - } - - } +using System; +using System.Configuration; +using System.Web.Mvc; +using OneTrueError.Api.Core.Applications; +using OneTrueError.Api.Core.Applications.Commands; + +namespace OneTrueError.Web.Controllers +{ + [Authorize] + public class HomeController : Controller + { + public ActionResult Index() + { + return View(); + } + + [AllowAnonymous, Route("installation/{*url}")] + public ActionResult NoInstallation() + { + if (Request.Url.AbsolutePath.EndsWith("/setup/activate", StringComparison.OrdinalIgnoreCase)) + return Redirect("~/?#/welcome"); + return View(); + } + + [AllowAnonymous] + public ActionResult ToInstall() + { + return RedirectToRoute(new {Controller = "Setup", Area = "Installation"}); + } + + + + } } \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/OneTrueError.Web.csproj b/src/Server/OneTrueError.Web/OneTrueError.Web.csproj index df452148..b4f64bea 100644 --- a/src/Server/OneTrueError.Web/OneTrueError.Web.csproj +++ b/src/Server/OneTrueError.Web/OneTrueError.Web.csproj @@ -1,711 +1,712 @@ - - - - Debug - AnyCPU - Properties - OneTrueError.Web - - - - - false - - Library - - {0476895C-6A61-4DE1-B06B-E8BF496FB651} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - OneTrueError.Web - 2.0 - v4.5.2 - 1.8 - - true - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - full - DEBUG;TRACE - prompt - false - bin\ - false - True - False - None - - None - True - False - - - False - True - - ES5 - 4 - - - pdbonly - TRACE - prompt - true - bin\ - True - False - None - - CommonJS - True - False - - - False - True - - ES5 - 4 - - - - OneTrueError.Api.Client - {017F8863-3DE0-4AD2-9ED3-5ACB87BBBCD0} - - - OneTrueError.Api - {FC331A95-FCA4-4764-8004-0884665DD01F} - - - OneTrueError.App - {5EF42A74-9323-49FA-A1F6-974D6DE77202} - - - OneTrueError.Infrastructure - {A78A50DA-C9D7-47F2-8528-D7EE39D91924} - - - OneTrueError.ReportAnalyzer - {29FBF805-CAFD-426A-A576-9756D375BF18} - - - OneTrueError.SqlServer - {B967BEEA-CDDD-4A83-A4F2-1C946099ED51} - - - - - ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - True - - - ..\packages\DotNetCqs.1.0.0\lib\net45\DotNetCqs.dll - True - - - ..\packages\Griffin.Container.1.1.2\lib\net40\Griffin.Container.dll - True - - - ..\packages\Griffin.Container.Mvc5.1.0.2\lib\net40\Griffin.Container.Mvc5.dll - True - - - ..\packages\Griffin.Framework.1.0.39\lib\net45\Griffin.Core.dll - True - - - ..\packages\Griffin.Framework.Cqs.1.0.11\lib\net45\Griffin.Cqs.dll - True - - - ..\packages\log4net.2.0.5\lib\net45-full\log4net.dll - True - - - ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll - - - ..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll - - - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - True - - - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - - - ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll - - - ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll - - - ..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll - - - ..\packages\Microsoft.Owin.Security.Facebook.3.0.1\lib\net45\Microsoft.Owin.Security.Facebook.dll - - - ..\packages\Microsoft.Owin.Security.Google.3.0.1\lib\net45\Microsoft.Owin.Security.Google.dll - - - ..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.1\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll - - - ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll - - - ..\packages\Microsoft.Owin.Security.Twitter.3.0.1\lib\net45\Microsoft.Owin.Security.Twitter.dll - - - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - True - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\OneTrueError.Client.1.0.0\lib\net40\OneTrueError.Client.dll - True - - - ..\packages\OneTrueError.Client.AspNet.Mvc5.1.0.0\lib\net45\OneTrueError.Client.AspNet.Mvc5.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - - - - - - - - - - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - - - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - - - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - - - ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll - True - - - ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll - - - ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll - True - - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - True - - - - - ..\packages\WebGrease.1.6.0\lib\WebGrease.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ote_bootstrap.less - - - - ote_bootstrap.css - - - ote_bootstrap_variables.less - - - - ote_bootstrap_variables.css - - - Site.less - - - - Site.less - - - - - - - - - - - PreserveNewest - - - - - - - - - - - Griffin.Yo.js - - - Griffin.Yo.es5.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - Web.config - - - Web.config - - - - - - compilerconfig.json - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - - - - - - True - - 50473 - / - http://localhost:50473/ - False - False - False - False - - - - - + + + + Debug + AnyCPU + Properties + OneTrueError.Web + + + + + false + + Library + + {0476895C-6A61-4DE1-B06B-E8BF496FB651} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + OneTrueError.Web + 2.0 + v4.5.2 + 1.8 + + true + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + full + DEBUG;TRACE + prompt + false + bin\ + false + True + False + None + + None + True + False + + + False + True + + ES5 + 4 + + + pdbonly + TRACE + prompt + true + bin\ + True + False + None + + CommonJS + True + False + + + False + True + + ES5 + 4 + + + + OneTrueError.Api.Client + {017F8863-3DE0-4AD2-9ED3-5ACB87BBBCD0} + + + OneTrueError.Api + {FC331A95-FCA4-4764-8004-0884665DD01F} + + + OneTrueError.App + {5EF42A74-9323-49FA-A1F6-974D6DE77202} + + + OneTrueError.Infrastructure + {A78A50DA-C9D7-47F2-8528-D7EE39D91924} + + + OneTrueError.ReportAnalyzer + {29FBF805-CAFD-426A-A576-9756D375BF18} + + + OneTrueError.SqlServer + {B967BEEA-CDDD-4A83-A4F2-1C946099ED51} + + + + + ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll + True + + + ..\packages\DotNetCqs.1.0.0\lib\net45\DotNetCqs.dll + True + + + ..\packages\Griffin.Container.1.1.2\lib\net40\Griffin.Container.dll + True + + + ..\packages\Griffin.Container.Mvc5.1.0.2\lib\net40\Griffin.Container.Mvc5.dll + True + + + ..\packages\Griffin.Framework.1.0.39\lib\net45\Griffin.Core.dll + True + + + ..\packages\Griffin.Framework.Cqs.1.0.11\lib\net45\Griffin.Cqs.dll + True + + + ..\packages\log4net.2.0.5\lib\net45-full\log4net.dll + True + + + ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll + + + ..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + True + + + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + + + ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll + + + ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll + + + ..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll + + + ..\packages\Microsoft.Owin.Security.Facebook.3.0.1\lib\net45\Microsoft.Owin.Security.Facebook.dll + + + ..\packages\Microsoft.Owin.Security.Google.3.0.1\lib\net45\Microsoft.Owin.Security.Google.dll + + + ..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.1\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll + + + ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll + + + ..\packages\Microsoft.Owin.Security.Twitter.3.0.1\lib\net45\Microsoft.Owin.Security.Twitter.dll + + + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\OneTrueError.Client.1.0.0\lib\net40\OneTrueError.Client.dll + True + + + ..\packages\OneTrueError.Client.AspNet.Mvc5.1.0.0\lib\net45\OneTrueError.Client.AspNet.Mvc5.dll + True + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + + + + + + + + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + + + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + + + ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll + + + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + + + + + ..\packages\WebGrease.1.6.0\lib\WebGrease.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ote_bootstrap.less + + + + ote_bootstrap.css + + + ote_bootstrap_variables.less + + + + ote_bootstrap_variables.css + + + Site.less + + + + Site.less + + + + + + + + + + + PreserveNewest + + + + + + + + + + + Griffin.Yo.js + + + Griffin.Yo.es5.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + Web.config + + + Web.config + + + + + + + compilerconfig.json + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + + + + + False + True + 50473 + / + http://localhost:50473/ + False + False + + + False + + + + + \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Scripts/CqsClient.js b/src/Server/OneTrueError.Web/Scripts/CqsClient.js index 33ca6f8c..996093c1 100644 --- a/src/Server/OneTrueError.Web/Scripts/CqsClient.js +++ b/src/Server/OneTrueError.Web/Scripts/CqsClient.js @@ -1,67 +1,67 @@ -/// -/// -var Griffin; -(function (Griffin) { - var Cqs; - (function (Cqs) { - var CqsClient = (function () { - function CqsClient() { - } - CqsClient.query = function (query) { - var d = P.defer(); - var client = new Griffin.Net.HttpClient(); - client.post(window["API_URL"] + "/api/cqs/?query=" + query.constructor.TYPE_NAME, query, "application/json", null, { 'X-Cqs-Name': query.constructor.TYPE_NAME }) - .done(function (response) { - d.resolve(response.body); - }) - .fail(function (rejection) { - humane.log("ERROR: " + rejection.message); - d.reject(rejection); - }); - return d.promise(); - }; - CqsClient.request = function (query) { - var d = P.defer(); - var client = new Griffin.Net.HttpClient(); - client.post(window["API_URL"] + "/api/cqs/?query=" + query.constructor.TYPE_NAME, query, "application/json", null, { 'X-Cqs-Name': query.constructor.TYPE_NAME }) - .done(function (response) { - d.resolve(response.body); - }) - .fail(function (rejection) { - humane.log("ERROR: " + rejection.message); - d.reject(rejection); - }); - return d.promise(); - }; - CqsClient.event = function (query) { - var d = P.defer(); - var client = new Griffin.Net.HttpClient(); - client.post(window["API_URL"] + "/api/cqs/", query) - .done(function (response) { - d.resolve(response.body); - }) - .fail(function (rejection) { - d.reject(rejection); - }); - return d.promise(); - }; - CqsClient.command = function (cmd) { - var d = P.defer(); - var client = new Griffin.Net.HttpClient(); - client.post(window["API_URL"] + "/api/cqs/", cmd, "application/json", null, { 'X-Cqs-Name': cmd.constructor.TYPE_NAME }) - .done(function (response) { - d.resolve(response.body); - }) - .fail(function (rejection) { - humane.log("ERROR: " + rejection.message); - console.log(rejection); - d.reject(rejection); - }); - return d.promise(); - }; - return CqsClient; - }()); - Cqs.CqsClient = CqsClient; - })(Cqs = Griffin.Cqs || (Griffin.Cqs = {})); -})(Griffin || (Griffin = {})); +/// +/// +var Griffin; +(function (Griffin) { + var Cqs; + (function (Cqs) { + var CqsClient = (function () { + function CqsClient() { + } + CqsClient.query = function (query) { + var d = P.defer(); + var client = new Griffin.Net.HttpClient(); + client.post(window["API_URL"] + "/api/cqs/?query=" + query.constructor.TYPE_NAME, query, "application/json", null, { 'X-Cqs-Name': query.constructor.TYPE_NAME }) + .done(function (response) { + d.resolve(response.body); + }) + .fail(function (rejection) { + humane.log("ERROR: " + rejection.message); + d.reject(rejection); + }); + return d.promise(); + }; + CqsClient.request = function (query) { + var d = P.defer(); + var client = new Griffin.Net.HttpClient(); + client.post(window["API_URL"] + "/api/cqs/?query=" + query.constructor.TYPE_NAME, query, "application/json", null, { 'X-Cqs-Name': query.constructor.TYPE_NAME }) + .done(function (response) { + d.resolve(response.body); + }) + .fail(function (rejection) { + humane.log("ERROR: " + rejection.message); + d.reject(rejection); + }); + return d.promise(); + }; + CqsClient.event = function (query) { + var d = P.defer(); + var client = new Griffin.Net.HttpClient(); + client.post(window["API_URL"] + "/api/cqs/", query) + .done(function (response) { + d.resolve(response.body); + }) + .fail(function (rejection) { + d.reject(rejection); + }); + return d.promise(); + }; + CqsClient.command = function (cmd) { + var d = P.defer(); + var client = new Griffin.Net.HttpClient(); + client.post(window["API_URL"] + "/api/cqs/", cmd, "application/json", null, { 'X-Cqs-Name': cmd.constructor.TYPE_NAME }) + .done(function (response) { + d.resolve(response.body); + }) + .fail(function (rejection) { + humane.log("ERROR: " + rejection.message); + console.log(rejection); + d.reject(rejection); + }); + return d.promise(); + }; + return CqsClient; + }()); + Cqs.CqsClient = CqsClient; + })(Cqs = Griffin.Cqs || (Griffin.Cqs = {})); +})(Griffin || (Griffin = {})); //# sourceMappingURL=CqsClient.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Scripts/Griffin.Editor.js b/src/Server/OneTrueError.Web/Scripts/Griffin.Editor.js index ce8102e4..bc595f93 100644 --- a/src/Server/OneTrueError.Web/Scripts/Griffin.Editor.js +++ b/src/Server/OneTrueError.Web/Scripts/Griffin.Editor.js @@ -1,659 +1,659 @@ -var Griffin; -(function (Griffin) { - /** - * The main mother of all editors. - */ - var Editor = (function () { - /** - * Create a new editor - * @param elementOrId either an HTML id (without hash) or a HTMLTextAreaElement. - * @param parser Used to transform markdown to HTML (or another language). - */ - function Editor(elementOrId, parser) { - this.keyMap = {}; - if (typeof elementOrId === "string") { - this.containerElement = document.getElementById(elementOrId); - } - else { - this.containerElement = elementOrId; - } - this.id = this.containerElement.id; - var id = this.containerElement.id; - this.element = (this.containerElement.getElementsByTagName("textarea")[0]); - this.previewElement = document.getElementById(id + "-preview"); - this.toolbarElement = this.containerElement.getElementsByClassName("toolbar")[0]; - this.textSelector = new TextSelector(this.element); - this.toolbarHandler = new MarkdownToolbar(parser); - this.assignAccessKeys(); - if (typeof $().modal == "function") { - this.dialogProvider = new BoostrapDialogs(); - } - else { - this.dialogProvider = new ConfirmDialogs(); - document.getElementById(id + "-imageDialog").style.display = "none"; - document.getElementById(id + "-linkDialog").style.display = "none"; - } - this.bindEvents(); - } - Editor.prototype.trimSpaceInSelection = function () { - var selectedText = this.textSelector.text(); - var pos = this.textSelector.get(); - if (selectedText.substr(selectedText.length - 1, 1) === " ") { - this.textSelector.select(pos.start, pos.end - 1); - } - }; - Editor.prototype.getActionNameFromClass = function (classString) { - var classNames = classString.split(/\s+/); - for (var i = 0; i < classNames.length; i++) { - if (classNames[i].substr(0, 7) === "button-") { - return classNames[i].substr(7); - } - } - return null; - }; - Editor.prototype.assignAccessKeys = function () { - var self = this; - var spans = this.toolbarElement.getElementsByTagName("span"); - var len = spans.length; - for (var i = 0; i < len; i++) { - if (!spans[i].getAttribute("accesskey")) - continue; - var button = spans[i]; - var title = button.getAttribute("title"); - var key = button.getAttribute("accesskey").toUpperCase(); - var actionName = self.getActionNameFromClass(button.className); - button.setAttribute("title", title + " [CTRL+" + key + "]"); - this.keyMap[key] = actionName; - } - }; - Editor.prototype.invokeAutoSize = function () { - if (!this.autoSize) { - return; - } - var twin = $(this).data("twin-area"); - if (typeof twin === "undefined") { - twin = $(''); - twin.appendTo("body"); - //div.appendTo('body'); - $(this).data("twin-area", twin); - $(this) - .data("originalSize", { - width: this.element.clientWidth, - height: this.element.clientHeight, - //position: data.editor.css('position'), - top: this.getTopPos(this.element), - left: this.getLeftPos(this.element) - }); - } - twin.css("height", this.element.clientHeight); - twin.css("width", this.element.clientWidth); - twin.html(this.element.getAttribute("value") + "some\r\nmore\r\n"); - if (twin[0].clientHeight < twin[0].scrollHeight) { - var style = { - height: (this.element.clientHeight + 100) + "px", - width: this.element.clientWidth, - //position: 'absolute', - top: this.getTopPos(this.element), - left: this.getLeftPos(this.element) - }; - $(this.element).css(style); - $(this).data("expandedSize", style); - } - }; - Editor.prototype.bindEvents = function () { - this.bindToolbarEvents(); - this.bindAccessors(); - this.bindEditorEvents(); - }; - Editor.prototype.bindEditorEvents = function () { - var self = this; - this.element.addEventListener("focus", function (e) { - //grow editor - }); - this.element.addEventListener("blur", function (e) { - //shrink editor - }); - this.element.addEventListener("keyup", function (e) { - self.preview(); - //self.invokeAutoSize(); - }); - this.element.addEventListener("paste", function (e) { - setTimeout(function () { - self.preview(); - }, 100); - }); - }; - Editor.prototype.bindToolbarEvents = function () { - var _this = this; - var spans = this.toolbarElement.getElementsByTagName("span"); - var len = spans.length; - var self = this; - for (var i = 0; i < len; i++) { - if (spans[i].className.indexOf("button") === -1) - continue; - var button = spans[i]; - button.addEventListener("click", function (e) { - var btn = e.target; - if (btn.tagName != "span") { - btn = e.target.parentElement; - } - var actionName = self.getActionNameFromClass(btn.className); - self.invokeAction(actionName); - self.preview(); - return _this; - }); - } - }; - Editor.prototype.bindAccessors = function () { - var _this = this; - var self = this; - //required to override browser keys - document.addEventListener("keydown", function (e) { - if (!e.ctrlKey) - return; - var key = String.fromCharCode(e.which); - if (!key || key.length === 0) - return; - if (e.target !== self.element) - return; - var actionName = _this.keyMap[key]; - if (actionName) { - e.cancelBubble = true; - e.stopPropagation(); - e.preventDefault(); - } - }); - this.element.addEventListener("keyup", function (e) { - if (!e.ctrlKey) - return; - var key = String.fromCharCode(e.which); - if (!key || key.length === 0) - return; - var actionName = _this.keyMap[key]; - if (actionName) { - _this.invokeAction(actionName); - self.preview(); - } - }); - }; - /** - * Invoke a toolbar action - * @param actionName "H1", "B" or similar - */ - Editor.prototype.invokeAction = function (actionName) { - if (!actionName || actionName.length === 0) - throw new Error("ActionName cannot be empty"); - this.trimSpaceInSelection(); - this.toolbarHandler.invokeAction({ - editorElement: this.element, - editor: this, - actionName: actionName, - selection: this.textSelector - }); - }; - Editor.prototype.getTopPos = function (element) { - return element.getBoundingClientRect().top + - window.pageYOffset - - element.ownerDocument.documentElement.clientTop; - }; - Editor.prototype.getLeftPos = function (element) { - return element.getBoundingClientRect().left + - window.pageXOffset - - element.ownerDocument.documentElement.clientLeft; - }; - /** - * Update the preview window - */ - Editor.prototype.preview = function () { - var _this = this; - if (this.previewElement == null) { - return; - } - this.toolbarHandler.preview(this, this.previewElement, this.element.value); - if (this.editorTimer) { - clearTimeout(this.editorTimer); - } - if (this.syntaxHighlighter) { - this.editorTimer = setTimeout(function () { - var tags = _this.previewElement.getElementsByTagName("code"); - var inlineBlocks = []; - var codeBlocks = []; - for (var i = 0; i < tags.length; i++) { - var elem = tags[i]; - if (elem.parentElement.tagName === "PRE") { - codeBlocks.push(elem); - } - else { - inlineBlocks.push(elem); - } - } - _this.syntaxHighlighter.highlight(inlineBlocks, codeBlocks); - }, 1000); - } - }; - return Editor; - }()); - Griffin.Editor = Editor; - var ConfirmDialogs = (function () { - function ConfirmDialogs() { - } - ConfirmDialogs.prototype.image = function (context, callback) { - var url = prompt("Enter image URL", context.selection.text()); - setTimeout(function () { - callback({ - href: url, - title: "Enter title here" - }); - }); - }; - ConfirmDialogs.prototype.link = function (context, callback) { - var url = prompt("Enter URL", context.selection.text()); - setTimeout(function () { - callback({ - url: url, - text: "Enter title here" - }); - }); - }; - return ConfirmDialogs; - }()); - Griffin.ConfirmDialogs = ConfirmDialogs; - var BoostrapDialogs = (function () { - function BoostrapDialogs() { - } - BoostrapDialogs.prototype.image = function (context, callback) { - var dialog = $("#" + context.editor.id + "-imageDialog"); - if (!dialog.data("griffin-imageDialog-inited")) { - dialog.data("griffin-imageDialog-inited", true); - $("[data-success]", dialog) - .click(function () { - dialog.modal("hide"); - callback({ - href: $('[name="imageUrl"]', dialog).val(), - title: $('[name="imageCaption"]', dialog).val() - }); - context.editorElement.focus(); - }); - } - if (context.selection.isSelected()) { - $('[name="imageCaption"]', dialog).val(context.selection.text()); - } - dialog.on("shown.bs.modal", function () { - $('[name="imageUrl"]', dialog).focus(); - }); - dialog.modal({ - show: true - }); - }; - BoostrapDialogs.prototype.link = function (context, callback) { - var dialog = $("#" + context.editor.id + "-linkDialog"); - if (!dialog.data("griffin-linkDialog-inited")) { - dialog.data("griffin-linkDialog-inited", true); - $("[data-success]", dialog) - .click(function () { - dialog.modal("hide"); - callback({ - url: $('[name="linkUrl"]', dialog).val(), - text: $('[name="linkText"]', dialog).val() - }); - context.editorElement.focus(); - }); - dialog.on("shown.bs.modal", function () { - $('[name="linkUrl"]', dialog).focus(); - }); - dialog.on("hidden.bs.modal", function () { - context.editorElement.focus(); - }); - } - if (context.selection.isSelected()) { - $('[name="linkText"]', dialog).val(context.selection.text()); - } - dialog.modal({ - show: true - }); - }; - return BoostrapDialogs; - }()); - Griffin.BoostrapDialogs = BoostrapDialogs; - var MarkdownToolbar = (function () { - function MarkdownToolbar(parser) { - this.parser = parser; - } - MarkdownToolbar.prototype.invokeAction = function (context) { - // console.log(griffinEditor); - var method = "action" + context.actionName.substr(0, 1).toUpperCase() + context.actionName.substr(1); - if (this[method]) { - var args = []; - args[0] = context.selection; - args[1] = context; - return this[method].apply(this, args); - } - else { - if (typeof alert !== "undefined") { - alert("Missing " + method + " in the active textHandler (griffinEditorExtension)"); - } - } - return this; - }; - MarkdownToolbar.prototype.preview = function (editor, preview, contents) { - if (contents === null || typeof contents === "undefined") { - throw new Error("May not be called without actual content."); - } - preview.innerHTML = this.parser.parse(contents); - }; - MarkdownToolbar.prototype.removeWrapping = function (selection, wrapperString) { - var wrapperLength = wrapperString.length; - var editor = selection.element; - var pos = selection.get(); - // expand double click - if (pos.start !== 0 && editor.value.substr(pos.start - wrapperLength, wrapperLength) === wrapperString) { - selection.select(pos.start - wrapperLength, pos.end + wrapperLength); - pos = selection.get(); - } - // remove - if (selection.text().substr(0, wrapperLength) === wrapperString) { - var text = selection.text().substr(wrapperLength, selection.text().length - (wrapperLength * 2)); - selection.replace(text); - selection.select(pos.start, pos.end - (wrapperLength * 2)); - return true; - } - return false; - }; - MarkdownToolbar.prototype.actionBold = function (selection) { - var isSelected = selection.isSelected(); - var pos = selection.get(); - if (this.removeWrapping(selection, "**")) { - return this; - } - selection.replace("**" + selection.text() + "**"); - if (isSelected) { - selection.select(pos.start, pos.end + 4); - } - else { - selection.select(pos.start + 2, pos.start + 2); - } - return this; - }; - MarkdownToolbar.prototype.actionItalic = function (selection) { - var isSelected = selection.isSelected(); - var pos = selection.get(); - if (this.removeWrapping(selection, "_")) { - return this; - } - selection.replace("_" + selection.text() + "_"); - if (isSelected) { - selection.select(pos.start, pos.end + 2); - } - else { - selection.select(pos.start + 1, pos.start + 1); - } - return this; - }; - MarkdownToolbar.prototype.addTextToBeginningOfLine = function (selection, textToAdd) { - var isSelected = selection.isSelected(); - if (!isSelected) { - var text = selection.element.value; - var orgPos = selection.get().start; - ; - var xStart = selection.get().start; - var found = false; - //find beginning of line so that we can check - //if the text already exists. - while (xStart > 0) { - var ch = text.substr(xStart, 1); - if (ch === "\r" || ch === "\n") { - if (text.substr(xStart + 1, textToAdd.length) === textToAdd) { - selection.select(xStart + 1, textToAdd.length); - selection.replace(""); - } - else { - selection.replace(textToAdd); - } - found = true; - break; - } - xStart = xStart - 1; - } - if (!found) { - if (text.substr(0, textToAdd.length) === textToAdd) { - selection.select(0, textToAdd.length); - selection.replace(""); - } - else { - selection.select(0, 0); - selection.replace(textToAdd); - } - } - selection.moveCursor(orgPos + textToAdd.length); - //selection.select(orgPos, 1); - return; - } - var pos = selection.get(); - selection.replace(textToAdd + selection.text()); - selection.select(pos.end + textToAdd.length, pos.end + textToAdd.length); - }; - MarkdownToolbar.prototype.actionH1 = function (selection) { - this.addTextToBeginningOfLine(selection, "# "); - }; - MarkdownToolbar.prototype.actionH2 = function (selection) { - this.addTextToBeginningOfLine(selection, "## "); - }; - MarkdownToolbar.prototype.actionH3 = function (selection) { - this.addTextToBeginningOfLine(selection, "### "); - }; - MarkdownToolbar.prototype.actionBullets = function (selection) { - var pos = selection.get(); - selection.replace("* " + selection.text()); - selection.select(pos.end + 2, pos.end + 2); - }; - MarkdownToolbar.prototype.actionNumbers = function (selection) { - this.addTextToBeginningOfLine(selection, "1. "); - }; - MarkdownToolbar.prototype.actionSourcecode = function (selection) { - var pos = selection.get(); - if (!selection.isSelected()) { - selection.replace("> "); - selection.select(pos.start + 2, pos.start + 2); - return; - } - if (selection.text().indexOf("\n") === -1) { - selection.replace("`" + selection.text() + "`"); - selection.select(pos.end + 2, pos.end + 2); - return; - } - var text = " " + selection.text().replace(/\n/g, "\n "); - if (text.substr(text.length - 3, 1) === " " && text.substr(text.length - 1, 1) === " ") { - text = text.substr(0, text.length - 4); - } - selection.replace(text); - selection.select(pos.start + text.length, pos.start + text.length); - }; - MarkdownToolbar.prototype.actionQuote = function (selection) { - var pos = selection.get(); - if (!selection.isSelected()) { - selection.replace("> "); - selection.select(pos.start + 2, pos.start + 2); - return; - } - var text = "> " + selection.text().replace(/\n/g, "\n> "); - if (text.substr(text.length - 3, 1) === " ") { - text = text.substr(0, text.length - 4); - } - selection.replace(text); - selection.select(pos.start + text.length, pos.start + text.length); - }; - //context: { url: 'urlToImage' } - MarkdownToolbar.prototype.actionImage = function (selection, context) { - var pos = selection.get(); - var text = selection.text(); - selection.store(); - var options = { - editor: context.editor, - editorElement: context.editorElement, - selection: selection, - href: "", - title: "" - }; - if (!selection.isSelected()) { - options.href = ""; - options.title = ""; - } - else if (text - .substr(-4, 4) === - ".png" || - text.substr(-4, 4) === ".gif" || - text.substr(-4, 4) === ".jpg") { - options.href = text; - } - else { - options.title = text; - } - context.editor.dialogProvider.image(options, function (result) { - var newText = "![" + result.title + "](" + result.href + ")"; - selection.load(); - selection.replace(newText); - selection.select(pos.start + newText.length, pos.start + newText.length); - context.editor.preview(); - }); - }; - MarkdownToolbar.prototype.actionLink = function (selection, context) { - var pos = selection.get(); - var text = selection.text(); - selection.store(); - var options = { - editor: context.editor, - editorElement: context.editorElement, - selection: selection, - url: "", - text: "" - }; - if (selection.isSelected()) { - if (text.substr(0, 4) === "http" || text.substr(0, 3) === "www") { - options.url = text; - } - else { - options.text = text; - } - } - context.editor.dialogProvider.link(options, function (result) { - selection.load(); - var newText = "[" + result.text + "](" + result.url + ")"; - selection.replace(newText); - selection.select(pos.start + newText.length, pos.start + newText.length); - context.editor.preview(); - }); - }; - return MarkdownToolbar; - }()); - Griffin.MarkdownToolbar = MarkdownToolbar; - var TextSelector = (function () { - function TextSelector(elementOrId) { - if (typeof elementOrId === "string") { - this.element = document.getElementById(elementOrId); - } - else { - this.element = elementOrId; - } - } - /** @returns object {start: X, end: Y, length: Z} - * x = start character - * y = end character - * length: number of selected characters - */ - TextSelector.prototype.get = function () { - if (typeof this.element.selectionStart !== "undefined") { - return { - start: this.element.selectionStart, - end: this.element.selectionEnd, - length: this.element.selectionEnd - this.element.selectionStart - }; - } - var doc = document; - var range = doc.selection.createRange(); - var storedRange = range.duplicate(); - storedRange.moveToElementText(this.element); - storedRange.setEndPoint("EndToEnd", range); - var start = storedRange.text.length - range.text.length; - var end = start + range.text.length; - return { start: start, end: end, length: range.text.length }; - }; - /** Replace selected text with the specified one */ - TextSelector.prototype.replace = function (newText) { - if (typeof this.element.selectionStart !== "undefined") { - this.element.value = this.element.value.substr(0, this.element.selectionStart) + - newText + - this.element.value.substr(this.element.selectionEnd); - return this; - } - this.element.focus(); - document["selection"].createRange().text = newText; - return this; - }; - /** Store current selection */ - TextSelector.prototype.store = function () { - this.stored = this.get(); - }; - /** load last selection */ - TextSelector.prototype.load = function () { - this.select(this.stored); - }; - /** Selected the specified range - * @param start Start character - * @param end End character - */ - TextSelector.prototype.select = function (startOrSelection, end) { - var start = startOrSelection; - if (typeof startOrSelection.start !== "undefined") { - end = startOrSelection.end; - start = startOrSelection.start; - } - if (typeof this.element.selectionStart == "number") { - this.element.selectionStart = start; - this.element.selectionEnd = end; - } - else if (typeof this.element.setSelectionRange !== "undefined") { - this.element.focus(); - this.element.setSelectionRange(start, end); - } - else if (typeof this.element.createTextRange !== "undefined") { - var range = this.element.createTextRange(); - range.collapse(true); - range.moveEnd("character", end); - range.moveStart("character", start); - range.select(); - } - return this; - }; - /** @returns if anything is selected */ - TextSelector.prototype.isSelected = function () { - return this.get().length !== 0; - }; - /** @returns selected text */ - TextSelector.prototype.text = function () { - if (typeof document["selection"] !== "undefined") { - //elem.focus(); - //console.log(document.selection.createRange().text); - return document["selection"].createRange().text; - } - return this.element.value.substr(this.element.selectionStart, this.element.selectionEnd - this.element.selectionStart); - }; - TextSelector.prototype.moveCursor = function (position) { - if (typeof this.element.selectionStart == "number") { - this.element.selectionStart = position; - } - else if (typeof this.element.setSelectionRange !== "undefined") { - this.element.focus(); - this.element.setSelectionRange(position, 0); - } - else if (typeof this.element.createTextRange !== "undefined") { - var range = this.element.createTextRange(); - range.collapse(true); - range.moveStart("character", position); - range.select(); - } - }; - return TextSelector; - }()); - Griffin.TextSelector = TextSelector; -})(Griffin || (Griffin = {})); +var Griffin; +(function (Griffin) { + /** + * The main mother of all editors. + */ + var Editor = (function () { + /** + * Create a new editor + * @param elementOrId either an HTML id (without hash) or a HTMLTextAreaElement. + * @param parser Used to transform markdown to HTML (or another language). + */ + function Editor(elementOrId, parser) { + this.keyMap = {}; + if (typeof elementOrId === "string") { + this.containerElement = document.getElementById(elementOrId); + } + else { + this.containerElement = elementOrId; + } + this.id = this.containerElement.id; + var id = this.containerElement.id; + this.element = (this.containerElement.getElementsByTagName("textarea")[0]); + this.previewElement = document.getElementById(id + "-preview"); + this.toolbarElement = this.containerElement.getElementsByClassName("toolbar")[0]; + this.textSelector = new TextSelector(this.element); + this.toolbarHandler = new MarkdownToolbar(parser); + this.assignAccessKeys(); + if (typeof $().modal == "function") { + this.dialogProvider = new BoostrapDialogs(); + } + else { + this.dialogProvider = new ConfirmDialogs(); + document.getElementById(id + "-imageDialog").style.display = "none"; + document.getElementById(id + "-linkDialog").style.display = "none"; + } + this.bindEvents(); + } + Editor.prototype.trimSpaceInSelection = function () { + var selectedText = this.textSelector.text(); + var pos = this.textSelector.get(); + if (selectedText.substr(selectedText.length - 1, 1) === " ") { + this.textSelector.select(pos.start, pos.end - 1); + } + }; + Editor.prototype.getActionNameFromClass = function (classString) { + var classNames = classString.split(/\s+/); + for (var i = 0; i < classNames.length; i++) { + if (classNames[i].substr(0, 7) === "button-") { + return classNames[i].substr(7); + } + } + return null; + }; + Editor.prototype.assignAccessKeys = function () { + var self = this; + var spans = this.toolbarElement.getElementsByTagName("span"); + var len = spans.length; + for (var i = 0; i < len; i++) { + if (!spans[i].getAttribute("accesskey")) + continue; + var button = spans[i]; + var title = button.getAttribute("title"); + var key = button.getAttribute("accesskey").toUpperCase(); + var actionName = self.getActionNameFromClass(button.className); + button.setAttribute("title", title + " [CTRL+" + key + "]"); + this.keyMap[key] = actionName; + } + }; + Editor.prototype.invokeAutoSize = function () { + if (!this.autoSize) { + return; + } + var twin = $(this).data("twin-area"); + if (typeof twin === "undefined") { + twin = $(''); + twin.appendTo("body"); + //div.appendTo('body'); + $(this).data("twin-area", twin); + $(this) + .data("originalSize", { + width: this.element.clientWidth, + height: this.element.clientHeight, + //position: data.editor.css('position'), + top: this.getTopPos(this.element), + left: this.getLeftPos(this.element) + }); + } + twin.css("height", this.element.clientHeight); + twin.css("width", this.element.clientWidth); + twin.html(this.element.getAttribute("value") + "some\r\nmore\r\n"); + if (twin[0].clientHeight < twin[0].scrollHeight) { + var style = { + height: (this.element.clientHeight + 100) + "px", + width: this.element.clientWidth, + //position: 'absolute', + top: this.getTopPos(this.element), + left: this.getLeftPos(this.element) + }; + $(this.element).css(style); + $(this).data("expandedSize", style); + } + }; + Editor.prototype.bindEvents = function () { + this.bindToolbarEvents(); + this.bindAccessors(); + this.bindEditorEvents(); + }; + Editor.prototype.bindEditorEvents = function () { + var self = this; + this.element.addEventListener("focus", function (e) { + //grow editor + }); + this.element.addEventListener("blur", function (e) { + //shrink editor + }); + this.element.addEventListener("keyup", function (e) { + self.preview(); + //self.invokeAutoSize(); + }); + this.element.addEventListener("paste", function (e) { + setTimeout(function () { + self.preview(); + }, 100); + }); + }; + Editor.prototype.bindToolbarEvents = function () { + var _this = this; + var spans = this.toolbarElement.getElementsByTagName("span"); + var len = spans.length; + var self = this; + for (var i = 0; i < len; i++) { + if (spans[i].className.indexOf("button") === -1) + continue; + var button = spans[i]; + button.addEventListener("click", function (e) { + var btn = e.target; + if (btn.tagName != "span") { + btn = e.target.parentElement; + } + var actionName = self.getActionNameFromClass(btn.className); + self.invokeAction(actionName); + self.preview(); + return _this; + }); + } + }; + Editor.prototype.bindAccessors = function () { + var _this = this; + var self = this; + //required to override browser keys + document.addEventListener("keydown", function (e) { + if (!e.ctrlKey) + return; + var key = String.fromCharCode(e.which); + if (!key || key.length === 0) + return; + if (e.target !== self.element) + return; + var actionName = _this.keyMap[key]; + if (actionName) { + e.cancelBubble = true; + e.stopPropagation(); + e.preventDefault(); + } + }); + this.element.addEventListener("keyup", function (e) { + if (!e.ctrlKey) + return; + var key = String.fromCharCode(e.which); + if (!key || key.length === 0) + return; + var actionName = _this.keyMap[key]; + if (actionName) { + _this.invokeAction(actionName); + self.preview(); + } + }); + }; + /** + * Invoke a toolbar action + * @param actionName "H1", "B" or similar + */ + Editor.prototype.invokeAction = function (actionName) { + if (!actionName || actionName.length === 0) + throw new Error("ActionName cannot be empty"); + this.trimSpaceInSelection(); + this.toolbarHandler.invokeAction({ + editorElement: this.element, + editor: this, + actionName: actionName, + selection: this.textSelector + }); + }; + Editor.prototype.getTopPos = function (element) { + return element.getBoundingClientRect().top + + window.pageYOffset - + element.ownerDocument.documentElement.clientTop; + }; + Editor.prototype.getLeftPos = function (element) { + return element.getBoundingClientRect().left + + window.pageXOffset - + element.ownerDocument.documentElement.clientLeft; + }; + /** + * Update the preview window + */ + Editor.prototype.preview = function () { + var _this = this; + if (this.previewElement == null) { + return; + } + this.toolbarHandler.preview(this, this.previewElement, this.element.value); + if (this.editorTimer) { + clearTimeout(this.editorTimer); + } + if (this.syntaxHighlighter) { + this.editorTimer = setTimeout(function () { + var tags = _this.previewElement.getElementsByTagName("code"); + var inlineBlocks = []; + var codeBlocks = []; + for (var i = 0; i < tags.length; i++) { + var elem = tags[i]; + if (elem.parentElement.tagName === "PRE") { + codeBlocks.push(elem); + } + else { + inlineBlocks.push(elem); + } + } + _this.syntaxHighlighter.highlight(inlineBlocks, codeBlocks); + }, 1000); + } + }; + return Editor; + }()); + Griffin.Editor = Editor; + var ConfirmDialogs = (function () { + function ConfirmDialogs() { + } + ConfirmDialogs.prototype.image = function (context, callback) { + var url = prompt("Enter image URL", context.selection.text()); + setTimeout(function () { + callback({ + href: url, + title: "Enter title here" + }); + }); + }; + ConfirmDialogs.prototype.link = function (context, callback) { + var url = prompt("Enter URL", context.selection.text()); + setTimeout(function () { + callback({ + url: url, + text: "Enter title here" + }); + }); + }; + return ConfirmDialogs; + }()); + Griffin.ConfirmDialogs = ConfirmDialogs; + var BoostrapDialogs = (function () { + function BoostrapDialogs() { + } + BoostrapDialogs.prototype.image = function (context, callback) { + var dialog = $("#" + context.editor.id + "-imageDialog"); + if (!dialog.data("griffin-imageDialog-inited")) { + dialog.data("griffin-imageDialog-inited", true); + $("[data-success]", dialog) + .click(function () { + dialog.modal("hide"); + callback({ + href: $('[name="imageUrl"]', dialog).val(), + title: $('[name="imageCaption"]', dialog).val() + }); + context.editorElement.focus(); + }); + } + if (context.selection.isSelected()) { + $('[name="imageCaption"]', dialog).val(context.selection.text()); + } + dialog.on("shown.bs.modal", function () { + $('[name="imageUrl"]', dialog).focus(); + }); + dialog.modal({ + show: true + }); + }; + BoostrapDialogs.prototype.link = function (context, callback) { + var dialog = $("#" + context.editor.id + "-linkDialog"); + if (!dialog.data("griffin-linkDialog-inited")) { + dialog.data("griffin-linkDialog-inited", true); + $("[data-success]", dialog) + .click(function () { + dialog.modal("hide"); + callback({ + url: $('[name="linkUrl"]', dialog).val(), + text: $('[name="linkText"]', dialog).val() + }); + context.editorElement.focus(); + }); + dialog.on("shown.bs.modal", function () { + $('[name="linkUrl"]', dialog).focus(); + }); + dialog.on("hidden.bs.modal", function () { + context.editorElement.focus(); + }); + } + if (context.selection.isSelected()) { + $('[name="linkText"]', dialog).val(context.selection.text()); + } + dialog.modal({ + show: true + }); + }; + return BoostrapDialogs; + }()); + Griffin.BoostrapDialogs = BoostrapDialogs; + var MarkdownToolbar = (function () { + function MarkdownToolbar(parser) { + this.parser = parser; + } + MarkdownToolbar.prototype.invokeAction = function (context) { + // console.log(griffinEditor); + var method = "action" + context.actionName.substr(0, 1).toUpperCase() + context.actionName.substr(1); + if (this[method]) { + var args = []; + args[0] = context.selection; + args[1] = context; + return this[method].apply(this, args); + } + else { + if (typeof alert !== "undefined") { + alert("Missing " + method + " in the active textHandler (griffinEditorExtension)"); + } + } + return this; + }; + MarkdownToolbar.prototype.preview = function (editor, preview, contents) { + if (contents === null || typeof contents === "undefined") { + throw new Error("May not be called without actual content."); + } + preview.innerHTML = this.parser.parse(contents); + }; + MarkdownToolbar.prototype.removeWrapping = function (selection, wrapperString) { + var wrapperLength = wrapperString.length; + var editor = selection.element; + var pos = selection.get(); + // expand double click + if (pos.start !== 0 && editor.value.substr(pos.start - wrapperLength, wrapperLength) === wrapperString) { + selection.select(pos.start - wrapperLength, pos.end + wrapperLength); + pos = selection.get(); + } + // remove + if (selection.text().substr(0, wrapperLength) === wrapperString) { + var text = selection.text().substr(wrapperLength, selection.text().length - (wrapperLength * 2)); + selection.replace(text); + selection.select(pos.start, pos.end - (wrapperLength * 2)); + return true; + } + return false; + }; + MarkdownToolbar.prototype.actionBold = function (selection) { + var isSelected = selection.isSelected(); + var pos = selection.get(); + if (this.removeWrapping(selection, "**")) { + return this; + } + selection.replace("**" + selection.text() + "**"); + if (isSelected) { + selection.select(pos.start, pos.end + 4); + } + else { + selection.select(pos.start + 2, pos.start + 2); + } + return this; + }; + MarkdownToolbar.prototype.actionItalic = function (selection) { + var isSelected = selection.isSelected(); + var pos = selection.get(); + if (this.removeWrapping(selection, "_")) { + return this; + } + selection.replace("_" + selection.text() + "_"); + if (isSelected) { + selection.select(pos.start, pos.end + 2); + } + else { + selection.select(pos.start + 1, pos.start + 1); + } + return this; + }; + MarkdownToolbar.prototype.addTextToBeginningOfLine = function (selection, textToAdd) { + var isSelected = selection.isSelected(); + if (!isSelected) { + var text = selection.element.value; + var orgPos = selection.get().start; + ; + var xStart = selection.get().start; + var found = false; + //find beginning of line so that we can check + //if the text already exists. + while (xStart > 0) { + var ch = text.substr(xStart, 1); + if (ch === "\r" || ch === "\n") { + if (text.substr(xStart + 1, textToAdd.length) === textToAdd) { + selection.select(xStart + 1, textToAdd.length); + selection.replace(""); + } + else { + selection.replace(textToAdd); + } + found = true; + break; + } + xStart = xStart - 1; + } + if (!found) { + if (text.substr(0, textToAdd.length) === textToAdd) { + selection.select(0, textToAdd.length); + selection.replace(""); + } + else { + selection.select(0, 0); + selection.replace(textToAdd); + } + } + selection.moveCursor(orgPos + textToAdd.length); + //selection.select(orgPos, 1); + return; + } + var pos = selection.get(); + selection.replace(textToAdd + selection.text()); + selection.select(pos.end + textToAdd.length, pos.end + textToAdd.length); + }; + MarkdownToolbar.prototype.actionH1 = function (selection) { + this.addTextToBeginningOfLine(selection, "# "); + }; + MarkdownToolbar.prototype.actionH2 = function (selection) { + this.addTextToBeginningOfLine(selection, "## "); + }; + MarkdownToolbar.prototype.actionH3 = function (selection) { + this.addTextToBeginningOfLine(selection, "### "); + }; + MarkdownToolbar.prototype.actionBullets = function (selection) { + var pos = selection.get(); + selection.replace("* " + selection.text()); + selection.select(pos.end + 2, pos.end + 2); + }; + MarkdownToolbar.prototype.actionNumbers = function (selection) { + this.addTextToBeginningOfLine(selection, "1. "); + }; + MarkdownToolbar.prototype.actionSourcecode = function (selection) { + var pos = selection.get(); + if (!selection.isSelected()) { + selection.replace("> "); + selection.select(pos.start + 2, pos.start + 2); + return; + } + if (selection.text().indexOf("\n") === -1) { + selection.replace("`" + selection.text() + "`"); + selection.select(pos.end + 2, pos.end + 2); + return; + } + var text = " " + selection.text().replace(/\n/g, "\n "); + if (text.substr(text.length - 3, 1) === " " && text.substr(text.length - 1, 1) === " ") { + text = text.substr(0, text.length - 4); + } + selection.replace(text); + selection.select(pos.start + text.length, pos.start + text.length); + }; + MarkdownToolbar.prototype.actionQuote = function (selection) { + var pos = selection.get(); + if (!selection.isSelected()) { + selection.replace("> "); + selection.select(pos.start + 2, pos.start + 2); + return; + } + var text = "> " + selection.text().replace(/\n/g, "\n> "); + if (text.substr(text.length - 3, 1) === " ") { + text = text.substr(0, text.length - 4); + } + selection.replace(text); + selection.select(pos.start + text.length, pos.start + text.length); + }; + //context: { url: 'urlToImage' } + MarkdownToolbar.prototype.actionImage = function (selection, context) { + var pos = selection.get(); + var text = selection.text(); + selection.store(); + var options = { + editor: context.editor, + editorElement: context.editorElement, + selection: selection, + href: "", + title: "" + }; + if (!selection.isSelected()) { + options.href = ""; + options.title = ""; + } + else if (text + .substr(-4, 4) === + ".png" || + text.substr(-4, 4) === ".gif" || + text.substr(-4, 4) === ".jpg") { + options.href = text; + } + else { + options.title = text; + } + context.editor.dialogProvider.image(options, function (result) { + var newText = "![" + result.title + "](" + result.href + ")"; + selection.load(); + selection.replace(newText); + selection.select(pos.start + newText.length, pos.start + newText.length); + context.editor.preview(); + }); + }; + MarkdownToolbar.prototype.actionLink = function (selection, context) { + var pos = selection.get(); + var text = selection.text(); + selection.store(); + var options = { + editor: context.editor, + editorElement: context.editorElement, + selection: selection, + url: "", + text: "" + }; + if (selection.isSelected()) { + if (text.substr(0, 4) === "http" || text.substr(0, 3) === "www") { + options.url = text; + } + else { + options.text = text; + } + } + context.editor.dialogProvider.link(options, function (result) { + selection.load(); + var newText = "[" + result.text + "](" + result.url + ")"; + selection.replace(newText); + selection.select(pos.start + newText.length, pos.start + newText.length); + context.editor.preview(); + }); + }; + return MarkdownToolbar; + }()); + Griffin.MarkdownToolbar = MarkdownToolbar; + var TextSelector = (function () { + function TextSelector(elementOrId) { + if (typeof elementOrId === "string") { + this.element = document.getElementById(elementOrId); + } + else { + this.element = elementOrId; + } + } + /** @returns object {start: X, end: Y, length: Z} + * x = start character + * y = end character + * length: number of selected characters + */ + TextSelector.prototype.get = function () { + if (typeof this.element.selectionStart !== "undefined") { + return { + start: this.element.selectionStart, + end: this.element.selectionEnd, + length: this.element.selectionEnd - this.element.selectionStart + }; + } + var doc = document; + var range = doc.selection.createRange(); + var storedRange = range.duplicate(); + storedRange.moveToElementText(this.element); + storedRange.setEndPoint("EndToEnd", range); + var start = storedRange.text.length - range.text.length; + var end = start + range.text.length; + return { start: start, end: end, length: range.text.length }; + }; + /** Replace selected text with the specified one */ + TextSelector.prototype.replace = function (newText) { + if (typeof this.element.selectionStart !== "undefined") { + this.element.value = this.element.value.substr(0, this.element.selectionStart) + + newText + + this.element.value.substr(this.element.selectionEnd); + return this; + } + this.element.focus(); + document["selection"].createRange().text = newText; + return this; + }; + /** Store current selection */ + TextSelector.prototype.store = function () { + this.stored = this.get(); + }; + /** load last selection */ + TextSelector.prototype.load = function () { + this.select(this.stored); + }; + /** Selected the specified range + * @param start Start character + * @param end End character + */ + TextSelector.prototype.select = function (startOrSelection, end) { + var start = startOrSelection; + if (typeof startOrSelection.start !== "undefined") { + end = startOrSelection.end; + start = startOrSelection.start; + } + if (typeof this.element.selectionStart == "number") { + this.element.selectionStart = start; + this.element.selectionEnd = end; + } + else if (typeof this.element.setSelectionRange !== "undefined") { + this.element.focus(); + this.element.setSelectionRange(start, end); + } + else if (typeof this.element.createTextRange !== "undefined") { + var range = this.element.createTextRange(); + range.collapse(true); + range.moveEnd("character", end); + range.moveStart("character", start); + range.select(); + } + return this; + }; + /** @returns if anything is selected */ + TextSelector.prototype.isSelected = function () { + return this.get().length !== 0; + }; + /** @returns selected text */ + TextSelector.prototype.text = function () { + if (typeof document["selection"] !== "undefined") { + //elem.focus(); + //console.log(document.selection.createRange().text); + return document["selection"].createRange().text; + } + return this.element.value.substr(this.element.selectionStart, this.element.selectionEnd - this.element.selectionStart); + }; + TextSelector.prototype.moveCursor = function (position) { + if (typeof this.element.selectionStart == "number") { + this.element.selectionStart = position; + } + else if (typeof this.element.setSelectionRange !== "undefined") { + this.element.focus(); + this.element.setSelectionRange(position, 0); + } + else if (typeof this.element.createTextRange !== "undefined") { + var range = this.element.createTextRange(); + range.collapse(true); + range.moveStart("character", position); + range.select(); + } + }; + return TextSelector; + }()); + Griffin.TextSelector = TextSelector; +})(Griffin || (Griffin = {})); //# sourceMappingURL=Griffin.Editor.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Scripts/Griffin.Net.js b/src/Server/OneTrueError.Web/Scripts/Griffin.Net.js index 5486771d..24cbbb08 100644 --- a/src/Server/OneTrueError.Web/Scripts/Griffin.Net.js +++ b/src/Server/OneTrueError.Web/Scripts/Griffin.Net.js @@ -1,237 +1,237 @@ -/// -var Griffin; -(function (Griffin) { - var Net; - (function (Net) { - ; - var HttpRequest = (function () { - function HttpRequest(httpMethod, url) { - this.url = url; - this.httpMethod = httpMethod; - this.isAsync = true; - } - return HttpRequest; - }()); - Net.HttpRequest = HttpRequest; - ; - var CorsRequest = (function () { - function CorsRequest() { - } - return CorsRequest; - }()); - Net.CorsRequest = CorsRequest; - var HttpResponse = (function () { - function HttpResponse() { - } - return HttpResponse; - }()); - Net.HttpResponse = HttpResponse; - ; - var HttpRejection = (function () { - function HttpRejection(response) { - this.message = response.statusReason; - this.Reponse = response; - } - return HttpRejection; - }()); - Net.HttpRejection = HttpRejection; - var QueryString = (function () { - function QueryString() { - } - QueryString.parse = function (str) { - str = str.trim().replace(/^(\?|#)/, ""); - if (!str) { - return null; - } - var data = str.trim() - .split("&") - .reduce(function (ret, param) { - var parts = param.replace(/\+/g, " ").split("="); - var key = parts[0]; - var val = parts[1]; - key = decodeURIComponent(key); - val = val === undefined ? null : decodeURIComponent(val); - if (!ret.hasOwnProperty(key)) { - ret[key] = val; - } - else if (Array.isArray(ret[key])) { - ret[key].push(val); - } - else { - ret[key] = [ret[key], val]; - } - return ret; - }, {}); - return data; - }; - QueryString.stringify = function (data) { - return data - ? Object.keys(data) - .map(function (key) { - var val = data[key]; - if (Array.isArray(val)) { - return val.map(function (val2) { return (encodeURIComponent(key) + "=" + encodeURIComponent(val2)); }) - .join("&"); - } - return encodeURIComponent(key) + "=" + encodeURIComponent(val); - }) - .join("&") - : ""; - }; - return QueryString; - }()); - Net.QueryString = QueryString; - var HttpClient = (function () { - function HttpClient() { - } - HttpClient.prototype.get = function (url, queryString, headers) { - if (queryString === void 0) { queryString = null; } - if (headers === void 0) { headers = null; } - var request = new HttpRequest("GET", url); - if (queryString != null) - request.queryString = queryString; - if (headers != null) { - request.headers = headers; - } - return this.invokeRequest(request); - }; - HttpClient.prototype.post = function (url, body, contentType, queryString, headers) { - if (body === void 0) { body = null; } - if (contentType === void 0) { contentType = "application/x-www-form-urlencoded"; } - if (queryString === void 0) { queryString = null; } - if (headers === void 0) { headers = null; } - var request = new HttpRequest("POST", url); - if (queryString != null) - request.queryString = queryString; - if (body != null) { - request.body = body; - request.contentType = contentType; - } - if (headers != null) { - request.headers = headers; - } - return this.invokeRequest(request); - }; - HttpClient.prototype.invokeRequest = function (request) { - var _this = this; - var d = P.defer(); - var uri; - if (request.queryString) - if (request.url.indexOf("?") > -1) { - uri = request.url + "&" + QueryString.stringify(request.queryString); - } - else { - uri = request.url + "?" + QueryString.stringify(request.queryString); - } - else - uri = request.url; - var xhr = new XMLHttpRequest(); - xhr.open(request.httpMethod, uri, request.isAsync); - if (request.credentials != null) { - var credentials = Base64.encode(request.credentials.username + ":" + request.credentials.password); - xhr.setRequestHeader("Authorization", "Basic " + credentials); - } - if (request.headers) { - for (var header in request.headers) { - if (header === "Content-Type") - throw "You may not specify 'Content-Type' as a header, use the specific property."; - //if (request.hasOwnProperty(header)) { - xhr.setRequestHeader(header, request.headers[header]); - } - } - if (!request.contentType || request.contentType === "") - request.contentType = "application/x-www-form-urlencoded"; - if (request.body) { - if (request.contentType === "application/x-www-form-urlencoded") { - if (typeof request.body !== "string") { - request.body = this.urlEncodeObject(request.body); - } - } - else if (request.contentType === "application/json") { - if (typeof request.body !== "string") { - request.body = JSON.stringify(request.body); - } - } - xhr.setRequestHeader("Content-Type", request.contentType); - } - //xhr.onload = () => { - // var response = this.buildResponse(xhr); - // if (xhr.status >= 200 && xhr.status < 300) { - // d.resolve(response); - // } else { - // d.reject(new HttpRejection(response)); - // } - //}; - xhr.onreadystatechange = function () { - if (xhr.readyState === XMLHttpRequest.DONE) { - var response = _this.buildResponse(xhr); - if (xhr.status >= 200 && xhr.status < 300) { - d.resolve(response); - } - else { - if (xhr.status === 401 && HttpClient.REDIRECT_401_TO) { - window.location.assign(HttpClient.REDIRECT_401_TO + - "?ReturnTo=" + - encodeURIComponent(window.location.href.replace("#", "&hash="))); - } - d.reject(new HttpRejection(response)); - } - } - }; - xhr.send(request.body); - return d.promise(); - }; - HttpClient.prototype.urlEncodeObject = function (obj, prefix) { - if (prefix === void 0) { prefix = null; } - var str = []; - for (var p in obj) { - if (obj.hasOwnProperty(p)) { - var k = prefix ? prefix + "." + p : p; - var v = obj[p]; - if (v instanceof Array) { - } - str.push(typeof v == "object" - ? this.urlEncodeObject(v, k) - : encodeURIComponent(k) + "=" + encodeURIComponent(v)); - } - } - return str.join("&"); - }; - HttpClient.prototype.buildResponse = function (xhr) { - var response = new HttpResponse(); - response.statusCode = xhr.status; - response.statusReason = xhr.statusText; - if (xhr.responseBody) { - response.body = xhr.responseBody; - } - else if (xhr.responseXML) { - response.body = xhr.responseXML; - } - else { - response.body = xhr.responseText; - } - response.contentType = xhr.getResponseHeader("content-type"); - if (response.contentType !== null && response.body !== null) { - var pos = response.contentType.indexOf(";"); - if (pos > -1) { - response.charset = response.contentType.substr(pos + 1); - response.contentType = response.contentType.substr(0, pos); - } - if (response.contentType === "application/json") { - try { - response.body = JSON.parse(response.body); - } - catch (error) { - throw "Failed to parse '" + response.body + ". got: " + error; - } - } - } - return response; - }; - HttpClient.REDIRECT_401_TO = "/account/login"; - return HttpClient; - }()); - Net.HttpClient = HttpClient; - })(Net = Griffin.Net || (Griffin.Net = {})); -})(Griffin || (Griffin = {})); // ReSharper restore InconsistentNaming +/// +var Griffin; +(function (Griffin) { + var Net; + (function (Net) { + ; + var HttpRequest = (function () { + function HttpRequest(httpMethod, url) { + this.url = url; + this.httpMethod = httpMethod; + this.isAsync = true; + } + return HttpRequest; + }()); + Net.HttpRequest = HttpRequest; + ; + var CorsRequest = (function () { + function CorsRequest() { + } + return CorsRequest; + }()); + Net.CorsRequest = CorsRequest; + var HttpResponse = (function () { + function HttpResponse() { + } + return HttpResponse; + }()); + Net.HttpResponse = HttpResponse; + ; + var HttpRejection = (function () { + function HttpRejection(response) { + this.message = response.statusReason; + this.Reponse = response; + } + return HttpRejection; + }()); + Net.HttpRejection = HttpRejection; + var QueryString = (function () { + function QueryString() { + } + QueryString.parse = function (str) { + str = str.trim().replace(/^(\?|#)/, ""); + if (!str) { + return null; + } + var data = str.trim() + .split("&") + .reduce(function (ret, param) { + var parts = param.replace(/\+/g, " ").split("="); + var key = parts[0]; + var val = parts[1]; + key = decodeURIComponent(key); + val = val === undefined ? null : decodeURIComponent(val); + if (!ret.hasOwnProperty(key)) { + ret[key] = val; + } + else if (Array.isArray(ret[key])) { + ret[key].push(val); + } + else { + ret[key] = [ret[key], val]; + } + return ret; + }, {}); + return data; + }; + QueryString.stringify = function (data) { + return data + ? Object.keys(data) + .map(function (key) { + var val = data[key]; + if (Array.isArray(val)) { + return val.map(function (val2) { return (encodeURIComponent(key) + "=" + encodeURIComponent(val2)); }) + .join("&"); + } + return encodeURIComponent(key) + "=" + encodeURIComponent(val); + }) + .join("&") + : ""; + }; + return QueryString; + }()); + Net.QueryString = QueryString; + var HttpClient = (function () { + function HttpClient() { + } + HttpClient.prototype.get = function (url, queryString, headers) { + if (queryString === void 0) { queryString = null; } + if (headers === void 0) { headers = null; } + var request = new HttpRequest("GET", url); + if (queryString != null) + request.queryString = queryString; + if (headers != null) { + request.headers = headers; + } + return this.invokeRequest(request); + }; + HttpClient.prototype.post = function (url, body, contentType, queryString, headers) { + if (body === void 0) { body = null; } + if (contentType === void 0) { contentType = "application/x-www-form-urlencoded"; } + if (queryString === void 0) { queryString = null; } + if (headers === void 0) { headers = null; } + var request = new HttpRequest("POST", url); + if (queryString != null) + request.queryString = queryString; + if (body != null) { + request.body = body; + request.contentType = contentType; + } + if (headers != null) { + request.headers = headers; + } + return this.invokeRequest(request); + }; + HttpClient.prototype.invokeRequest = function (request) { + var _this = this; + var d = P.defer(); + var uri; + if (request.queryString) + if (request.url.indexOf("?") > -1) { + uri = request.url + "&" + QueryString.stringify(request.queryString); + } + else { + uri = request.url + "?" + QueryString.stringify(request.queryString); + } + else + uri = request.url; + var xhr = new XMLHttpRequest(); + xhr.open(request.httpMethod, uri, request.isAsync); + if (request.credentials != null) { + var credentials = Base64.encode(request.credentials.username + ":" + request.credentials.password); + xhr.setRequestHeader("Authorization", "Basic " + credentials); + } + if (request.headers) { + for (var header in request.headers) { + if (header === "Content-Type") + throw "You may not specify 'Content-Type' as a header, use the specific property."; + //if (request.hasOwnProperty(header)) { + xhr.setRequestHeader(header, request.headers[header]); + } + } + if (!request.contentType || request.contentType === "") + request.contentType = "application/x-www-form-urlencoded"; + if (request.body) { + if (request.contentType === "application/x-www-form-urlencoded") { + if (typeof request.body !== "string") { + request.body = this.urlEncodeObject(request.body); + } + } + else if (request.contentType === "application/json") { + if (typeof request.body !== "string") { + request.body = JSON.stringify(request.body); + } + } + xhr.setRequestHeader("Content-Type", request.contentType); + } + //xhr.onload = () => { + // var response = this.buildResponse(xhr); + // if (xhr.status >= 200 && xhr.status < 300) { + // d.resolve(response); + // } else { + // d.reject(new HttpRejection(response)); + // } + //}; + xhr.onreadystatechange = function () { + if (xhr.readyState === XMLHttpRequest.DONE) { + var response = _this.buildResponse(xhr); + if (xhr.status >= 200 && xhr.status < 300) { + d.resolve(response); + } + else { + if (xhr.status === 401 && HttpClient.REDIRECT_401_TO) { + window.location.assign(HttpClient.REDIRECT_401_TO + + "?ReturnTo=" + + encodeURIComponent(window.location.href.replace("#", "&hash="))); + } + d.reject(new HttpRejection(response)); + } + } + }; + xhr.send(request.body); + return d.promise(); + }; + HttpClient.prototype.urlEncodeObject = function (obj, prefix) { + if (prefix === void 0) { prefix = null; } + var str = []; + for (var p in obj) { + if (obj.hasOwnProperty(p)) { + var k = prefix ? prefix + "." + p : p; + var v = obj[p]; + if (v instanceof Array) { + } + str.push(typeof v == "object" + ? this.urlEncodeObject(v, k) + : encodeURIComponent(k) + "=" + encodeURIComponent(v)); + } + } + return str.join("&"); + }; + HttpClient.prototype.buildResponse = function (xhr) { + var response = new HttpResponse(); + response.statusCode = xhr.status; + response.statusReason = xhr.statusText; + if (xhr.responseBody) { + response.body = xhr.responseBody; + } + else if (xhr.responseXML) { + response.body = xhr.responseXML; + } + else { + response.body = xhr.responseText; + } + response.contentType = xhr.getResponseHeader("content-type"); + if (response.contentType !== null && response.body !== null) { + var pos = response.contentType.indexOf(";"); + if (pos > -1) { + response.charset = response.contentType.substr(pos + 1); + response.contentType = response.contentType.substr(0, pos); + } + if (response.contentType === "application/json") { + try { + response.body = JSON.parse(response.body); + } + catch (error) { + throw "Failed to parse '" + response.body + ". got: " + error; + } + } + } + return response; + }; + HttpClient.REDIRECT_401_TO = "/account/login"; + return HttpClient; + }()); + Net.HttpClient = HttpClient; + })(Net = Griffin.Net || (Griffin.Net = {})); +})(Griffin || (Griffin = {})); // ReSharper restore InconsistentNaming //# sourceMappingURL=Griffin.Net.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Scripts/Griffin.WebApp.js b/src/Server/OneTrueError.Web/Scripts/Griffin.WebApp.js index 856ac990..38a950f3 100644 --- a/src/Server/OneTrueError.Web/Scripts/Griffin.WebApp.js +++ b/src/Server/OneTrueError.Web/Scripts/Griffin.WebApp.js @@ -1,366 +1,366 @@ -/// -/// -var Griffin; -(function (Griffin) { - var WebApp; - (function (WebApp) { - var ChangedEventArgs = (function () { - function ChangedEventArgs(model, field, newValue) { - this.model = model; - this.field = field; - this.newValue = newValue; - this.isHandled = true; - } - return ChangedEventArgs; - }()); - WebApp.ChangedEventArgs = ChangedEventArgs; - var ClickEventArgs = (function () { - function ClickEventArgs(model, field, newValue) { - this.model = model; - this.field = field; - this.newValue = newValue; - this.isHandled = true; - } - return ClickEventArgs; - }()); - WebApp.ClickEventArgs = ClickEventArgs; - var FieldModel = (function () { - function FieldModel(propertyName) { - this.propertyName = propertyName; - } - FieldModel.prototype.equalsName = function (name) { - return this.propertyName.toLocaleLowerCase() === name.toLocaleLowerCase(); - }; - FieldModel.prototype.setContent = function (value) { - var elm = this.elem; - if (elm.value === "undefined") { - elm.value = value; - } - else { - this.elem.innerHTML = value; - } - }; - return FieldModel; - }()); - var ViewModel = (function () { - function ViewModel(modelId, viewModel) { - this.jqueryMappings = new Array(); - this.instance = null; - this.id = modelId; - this.instance = viewModel; - for (var fieldName in viewModel) { - var underscorePos = fieldName.indexOf("_"); - if (underscorePos > 0 && typeof viewModel[fieldName] === "function") { - var propertyName = fieldName.substr(0, underscorePos); - var eventName = fieldName.substr(underscorePos + 1); - if (typeof this.jqueryMappings[propertyName] == "undefined") { - this.jqueryMappings[propertyName] = new FieldModel(propertyName); - var elem = this.elem(propertyName, this.id); - if (elem.length === 0) { - if (ViewModel.ENFORCE_MAPPINGS) { - throw "Failed to find child element \"" + propertyName + "\" in model \"" + this.id + "\""; - } - } - else { - this.jqueryMappings[propertyName].elem = elem[0]; - } - } - this.jqueryMappings[propertyName][eventName] = viewModel[fieldName]; - this.mapEvent(propertyName, eventName, fieldName); - } - else if (typeof viewModel[fieldName] !== "function") { - if (fieldName[0] === "_") { - continue; - } - var elem = this.elem(fieldName, this.id); - if (elem.length === 0) { - if (ViewModel.ENFORCE_MAPPINGS) { - throw "Failed to find child element \"" + fieldName + "\" in model \"" + this.id + "\""; - } - continue; - } - if (typeof this.jqueryMappings[fieldName] == "undefined") - this.jqueryMappings[fieldName] = new FieldModel(fieldName); - this.jqueryMappings[fieldName].elem = elem[0]; - } - } - } - ViewModel.prototype.mapChanged = function (elementNameOrId) { - var p = P.defer(); - var elem = this.elem(elementNameOrId, this.id); - if (elem.length === 0) - throw "Failed to find child element \"" + elementNameOrId + "\" in model \"" + this.id + "\""; - var model = this; - elem.on("changed", function () { - p.resolve(new ChangedEventArgs(model, this, $(this).val())); - }); - return p.promise(); - }; - ViewModel.prototype.bind = function () { - }; - ViewModel.prototype.getField = function (name) { - for (var fieldName in this.jqueryMappings) { - var field = this.jqueryMappings[fieldName]; - if (field.equalsName(name)) - return field; - } - return null; - }; - ViewModel.prototype.update = function (json) { - var model = this; - for (var fieldName in json) { - var field = this.getField(fieldName); - if (field !== null) { - field.setContent(json[fieldName]); - } - } - }; - ViewModel.prototype.elem = function (name, parent) { - if (parent === void 0) { parent = null; } - var searchString = "#" + name + ",[data-name=\"" + name + "\"],[name=\"" + name + "\"]"; - if (parent == null) - return $(searchString); - if (typeof parent === "string") { - return $(searchString, $("#" + parent)); - } - return $(searchString, parent); - }; - ViewModel.prototype.mapEvent = function (propertyName, eventName, fieldName) { - var elem = this.elem(propertyName, this.id); - if (elem.length === 0) - throw "Failed to find child element \"" + propertyName + "\" in model \"" + this.id + "\" for event \"" + eventName + "'."; - var binder = this; - if (eventName === "change" || eventName === "changed") { - elem.on("change", function (e) { - var args = new ChangedEventArgs(binder.instance, this, $(this).val()); - binder.jqueryMappings[propertyName][eventName].apply(binder.instance, [args]); - if (args.isHandled) { - e.preventDefault(); - } - }); - } - else if (eventName === "click" || eventName === "clicked") { - elem.on("click", function (e) { - var value = ""; - if (this.tagName == "A") { - value = this.getAttribute("href"); - } - else { - value = $(this).val(); - } - var args = new ClickEventArgs(binder.instance, this, value); - binder.jqueryMappings[propertyName][eventName].apply(binder.instance, [args]); - if (args.isHandled) { - e.preventDefault(); - } - }); - } - }; - ViewModel.ENFORCE_MAPPINGS = false; - return ViewModel; - }()); - WebApp.ViewModel = ViewModel; - var Carburator = (function () { - function Carburator() { - } - Carburator.mapRoute = function (elementNameOrId, viewModel) { - return new ViewModel(elementNameOrId, viewModel); - }; - return Carburator; - }()); - WebApp.Carburator = Carburator; - var PagerPage = (function () { - function PagerPage(pageNumber, selected) { - this.pageNumber = pageNumber; - this.selected = selected; - } - PagerPage.prototype.select = function () { - this.listItem.firstElementChild.setAttribute("class", "number " + Pager.BTN_ACTIVE_CLASS); - this.selected = true; - }; - PagerPage.prototype.deselect = function () { - this.listItem.firstElementChild.setAttribute("class", "number " + Pager.BTN_CLASS); - this.selected = true; - }; - return PagerPage; - }()); - WebApp.PagerPage = PagerPage; - var Pager = (function () { - function Pager(currentPage, pageSize, totalNumberOfItems) { - this.currentPage = currentPage; - this.pageSize = pageSize; - this.totalNumberOfItems = totalNumberOfItems; - this.pageCount = 0; - this.pages = new Array(); - this._subscribers = new Array(); - this.update(currentPage, pageSize, totalNumberOfItems); - } - Pager.prototype.update = function (currentPage, pageSize, totalNumberOfItems) { - if (totalNumberOfItems < pageSize || pageSize === 0 || totalNumberOfItems === 0) { - this.pageCount = 0; - this.pages = []; - if (this.parent) { - this.draw(this.parent); - } - return; - } - var isFirstUpdate = this.totalNumberOfItems === 0; - this.pageCount = Math.ceil(totalNumberOfItems / pageSize); - this.currentPage = currentPage; - this.totalNumberOfItems = totalNumberOfItems; - this.pageSize = pageSize; - var i = 1; - this.pages = new Array(); - for (i = 1; i <= this.pageCount; i++) - this.pages.push(new PagerPage(i, i === currentPage)); - if (this.parent) { - this.draw(this.parent); - } - if (!isFirstUpdate) { - this.notify(); - } - }; - Pager.prototype.subscribe = function (subscriber) { - this._subscribers.push(subscriber); - }; - Pager.prototype.moveNext = function () { - if (this.currentPage < this.pageCount) { - this.pages[this.currentPage - 1].deselect(); - this.currentPage += 1; - this.pages[this.currentPage - 1].select(); - if (this.currentPage === this.pageCount) { - this.nextItem.style.display = "none"; - } - this.prevItem.style.display = ""; - this.notify(); - } - }; - Pager.prototype.movePrevious = function () { - if (this.currentPage > 1) { - this.pages[this.currentPage - 1].deselect(); - this.currentPage -= 1; - this.pages[this.currentPage - 1].select(); - if (this.currentPage === 1) { - this.prevItem.style.display = "none"; - } - else { - } - this.nextItem.style.display = ""; - this.notify(); - } - }; - Pager.prototype.goto = function (pageNumber) { - this.pages[this.currentPage - 1].deselect(); - this.currentPage = pageNumber; - this.pages[this.currentPage - 1].select(); - if (this.currentPage === 1 || this.pageCount === 1) { - this.prevItem.style.display = "none"; - } - else { - this.prevItem.style.display = ""; - } - if (this.currentPage === this.pageCount || this.pageCount === 1) { - this.nextItem.style.display = "none"; - } - else { - this.nextItem.style.display = ""; - } - this.notify(); - }; - Pager.prototype.createListItem = function (title, callback) { - var btn = document.createElement("button"); - btn.innerHTML = title; - btn.className = Pager.BTN_CLASS; - btn.addEventListener("click", function (e) { - e.preventDefault(); - callback(); - }); - var li = document.createElement("li"); - li.appendChild(btn); - return li; - }; - Pager.prototype.deactivateAll = function () { - this.prevItem.firstElementChild.setAttribute("class", Pager.BTN_CLASS); - this.nextItem.firstElementChild.setAttribute("class", Pager.BTN_CLASS); - this.pages.forEach(function (item) { - item.selected = false; - item.listItem.firstElementChild.setAttribute("class", Pager.BTN_CLASS); - }); - }; - Pager.prototype.draw = function (containerIdOrElement) { - var _this = this; - if (typeof containerIdOrElement === "string") { - this.parent = document.getElementById(containerIdOrElement); - if (!this.parent) - throw new Error("Failed to find '" + containerIdOrElement + "'"); - } - else { - if (!containerIdOrElement) - throw new Error("No element was specified"); - this.parent = containerIdOrElement; - } - var self = this; - var ul = document.createElement("ul"); - //prev - var li = this.createListItem("<< Previous", function () { - self.movePrevious(); - }); - ul.appendChild(li); - this.prevItem = li; - if (this.currentPage <= 1 || this.pageCount <= 1) { - this.prevItem.style.display = "none"; - } - else { - this.prevItem.style.display = ""; - } - //pages - this.pages.forEach(function (item) { - var li = _this.createListItem(item.pageNumber.toString(), function () { - self.goto(item.pageNumber); - }); - item.listItem = li; - ul.appendChild(li); - if (item.selected) { - li.className = "active"; - li.firstElementChild.setAttribute("class", "number " + Pager.BTN_ACTIVE_CLASS); - } - }); - //next - var li = this.createListItem("Next >>", function () { - self.moveNext(); - }); - ul.appendChild(li); - this.nextItem = li; - if (this.currentPage >= this.pageCount || this.pageCount <= 1) { - this.nextItem.style.display = "none"; - } - else { - this.nextItem.style.display = ""; - } - ul.className = "pager"; - while (this.parent.firstChild) { - this.parent.removeChild(this.parent.firstChild); - } - this.parent.appendChild(ul); - }; - Pager.prototype.notify = function () { - var self = this; - this._subscribers.forEach(function (item) { - item.onPager.apply(item, [self]); - }); - }; - Pager.prototype.reset = function () { - this.pageCount = 0; - this.pages = []; - if (this.parent) { - this.draw(this.parent); - } - }; - Pager.BTN_ACTIVE_CLASS = "btn btn-success"; - Pager.BTN_CLASS = "btn"; - return Pager; - }()); - WebApp.Pager = Pager; - })(WebApp = Griffin.WebApp || (Griffin.WebApp = {})); -})(Griffin || (Griffin = {})); +/// +/// +var Griffin; +(function (Griffin) { + var WebApp; + (function (WebApp) { + var ChangedEventArgs = (function () { + function ChangedEventArgs(model, field, newValue) { + this.model = model; + this.field = field; + this.newValue = newValue; + this.isHandled = true; + } + return ChangedEventArgs; + }()); + WebApp.ChangedEventArgs = ChangedEventArgs; + var ClickEventArgs = (function () { + function ClickEventArgs(model, field, newValue) { + this.model = model; + this.field = field; + this.newValue = newValue; + this.isHandled = true; + } + return ClickEventArgs; + }()); + WebApp.ClickEventArgs = ClickEventArgs; + var FieldModel = (function () { + function FieldModel(propertyName) { + this.propertyName = propertyName; + } + FieldModel.prototype.equalsName = function (name) { + return this.propertyName.toLocaleLowerCase() === name.toLocaleLowerCase(); + }; + FieldModel.prototype.setContent = function (value) { + var elm = this.elem; + if (elm.value === "undefined") { + elm.value = value; + } + else { + this.elem.innerHTML = value; + } + }; + return FieldModel; + }()); + var ViewModel = (function () { + function ViewModel(modelId, viewModel) { + this.jqueryMappings = new Array(); + this.instance = null; + this.id = modelId; + this.instance = viewModel; + for (var fieldName in viewModel) { + var underscorePos = fieldName.indexOf("_"); + if (underscorePos > 0 && typeof viewModel[fieldName] === "function") { + var propertyName = fieldName.substr(0, underscorePos); + var eventName = fieldName.substr(underscorePos + 1); + if (typeof this.jqueryMappings[propertyName] == "undefined") { + this.jqueryMappings[propertyName] = new FieldModel(propertyName); + var elem = this.elem(propertyName, this.id); + if (elem.length === 0) { + if (ViewModel.ENFORCE_MAPPINGS) { + throw "Failed to find child element \"" + propertyName + "\" in model \"" + this.id + "\""; + } + } + else { + this.jqueryMappings[propertyName].elem = elem[0]; + } + } + this.jqueryMappings[propertyName][eventName] = viewModel[fieldName]; + this.mapEvent(propertyName, eventName, fieldName); + } + else if (typeof viewModel[fieldName] !== "function") { + if (fieldName[0] === "_") { + continue; + } + var elem = this.elem(fieldName, this.id); + if (elem.length === 0) { + if (ViewModel.ENFORCE_MAPPINGS) { + throw "Failed to find child element \"" + fieldName + "\" in model \"" + this.id + "\""; + } + continue; + } + if (typeof this.jqueryMappings[fieldName] == "undefined") + this.jqueryMappings[fieldName] = new FieldModel(fieldName); + this.jqueryMappings[fieldName].elem = elem[0]; + } + } + } + ViewModel.prototype.mapChanged = function (elementNameOrId) { + var p = P.defer(); + var elem = this.elem(elementNameOrId, this.id); + if (elem.length === 0) + throw "Failed to find child element \"" + elementNameOrId + "\" in model \"" + this.id + "\""; + var model = this; + elem.on("changed", function () { + p.resolve(new ChangedEventArgs(model, this, $(this).val())); + }); + return p.promise(); + }; + ViewModel.prototype.bind = function () { + }; + ViewModel.prototype.getField = function (name) { + for (var fieldName in this.jqueryMappings) { + var field = this.jqueryMappings[fieldName]; + if (field.equalsName(name)) + return field; + } + return null; + }; + ViewModel.prototype.update = function (json) { + var model = this; + for (var fieldName in json) { + var field = this.getField(fieldName); + if (field !== null) { + field.setContent(json[fieldName]); + } + } + }; + ViewModel.prototype.elem = function (name, parent) { + if (parent === void 0) { parent = null; } + var searchString = "#" + name + ",[data-name=\"" + name + "\"],[name=\"" + name + "\"]"; + if (parent == null) + return $(searchString); + if (typeof parent === "string") { + return $(searchString, $("#" + parent)); + } + return $(searchString, parent); + }; + ViewModel.prototype.mapEvent = function (propertyName, eventName, fieldName) { + var elem = this.elem(propertyName, this.id); + if (elem.length === 0) + throw "Failed to find child element \"" + propertyName + "\" in model \"" + this.id + "\" for event \"" + eventName + "'."; + var binder = this; + if (eventName === "change" || eventName === "changed") { + elem.on("change", function (e) { + var args = new ChangedEventArgs(binder.instance, this, $(this).val()); + binder.jqueryMappings[propertyName][eventName].apply(binder.instance, [args]); + if (args.isHandled) { + e.preventDefault(); + } + }); + } + else if (eventName === "click" || eventName === "clicked") { + elem.on("click", function (e) { + var value = ""; + if (this.tagName == "A") { + value = this.getAttribute("href"); + } + else { + value = $(this).val(); + } + var args = new ClickEventArgs(binder.instance, this, value); + binder.jqueryMappings[propertyName][eventName].apply(binder.instance, [args]); + if (args.isHandled) { + e.preventDefault(); + } + }); + } + }; + ViewModel.ENFORCE_MAPPINGS = false; + return ViewModel; + }()); + WebApp.ViewModel = ViewModel; + var Carburator = (function () { + function Carburator() { + } + Carburator.mapRoute = function (elementNameOrId, viewModel) { + return new ViewModel(elementNameOrId, viewModel); + }; + return Carburator; + }()); + WebApp.Carburator = Carburator; + var PagerPage = (function () { + function PagerPage(pageNumber, selected) { + this.pageNumber = pageNumber; + this.selected = selected; + } + PagerPage.prototype.select = function () { + this.listItem.firstElementChild.setAttribute("class", "number " + Pager.BTN_ACTIVE_CLASS); + this.selected = true; + }; + PagerPage.prototype.deselect = function () { + this.listItem.firstElementChild.setAttribute("class", "number " + Pager.BTN_CLASS); + this.selected = true; + }; + return PagerPage; + }()); + WebApp.PagerPage = PagerPage; + var Pager = (function () { + function Pager(currentPage, pageSize, totalNumberOfItems) { + this.currentPage = currentPage; + this.pageSize = pageSize; + this.totalNumberOfItems = totalNumberOfItems; + this.pageCount = 0; + this.pages = new Array(); + this._subscribers = new Array(); + this.update(currentPage, pageSize, totalNumberOfItems); + } + Pager.prototype.update = function (currentPage, pageSize, totalNumberOfItems) { + if (totalNumberOfItems < pageSize || pageSize === 0 || totalNumberOfItems === 0) { + this.pageCount = 0; + this.pages = []; + if (this.parent) { + this.draw(this.parent); + } + return; + } + var isFirstUpdate = this.totalNumberOfItems === 0; + this.pageCount = Math.ceil(totalNumberOfItems / pageSize); + this.currentPage = currentPage; + this.totalNumberOfItems = totalNumberOfItems; + this.pageSize = pageSize; + var i = 1; + this.pages = new Array(); + for (i = 1; i <= this.pageCount; i++) + this.pages.push(new PagerPage(i, i === currentPage)); + if (this.parent) { + this.draw(this.parent); + } + if (!isFirstUpdate) { + this.notify(); + } + }; + Pager.prototype.subscribe = function (subscriber) { + this._subscribers.push(subscriber); + }; + Pager.prototype.moveNext = function () { + if (this.currentPage < this.pageCount) { + this.pages[this.currentPage - 1].deselect(); + this.currentPage += 1; + this.pages[this.currentPage - 1].select(); + if (this.currentPage === this.pageCount) { + this.nextItem.style.display = "none"; + } + this.prevItem.style.display = ""; + this.notify(); + } + }; + Pager.prototype.movePrevious = function () { + if (this.currentPage > 1) { + this.pages[this.currentPage - 1].deselect(); + this.currentPage -= 1; + this.pages[this.currentPage - 1].select(); + if (this.currentPage === 1) { + this.prevItem.style.display = "none"; + } + else { + } + this.nextItem.style.display = ""; + this.notify(); + } + }; + Pager.prototype.goto = function (pageNumber) { + this.pages[this.currentPage - 1].deselect(); + this.currentPage = pageNumber; + this.pages[this.currentPage - 1].select(); + if (this.currentPage === 1 || this.pageCount === 1) { + this.prevItem.style.display = "none"; + } + else { + this.prevItem.style.display = ""; + } + if (this.currentPage === this.pageCount || this.pageCount === 1) { + this.nextItem.style.display = "none"; + } + else { + this.nextItem.style.display = ""; + } + this.notify(); + }; + Pager.prototype.createListItem = function (title, callback) { + var btn = document.createElement("button"); + btn.innerHTML = title; + btn.className = Pager.BTN_CLASS; + btn.addEventListener("click", function (e) { + e.preventDefault(); + callback(); + }); + var li = document.createElement("li"); + li.appendChild(btn); + return li; + }; + Pager.prototype.deactivateAll = function () { + this.prevItem.firstElementChild.setAttribute("class", Pager.BTN_CLASS); + this.nextItem.firstElementChild.setAttribute("class", Pager.BTN_CLASS); + this.pages.forEach(function (item) { + item.selected = false; + item.listItem.firstElementChild.setAttribute("class", Pager.BTN_CLASS); + }); + }; + Pager.prototype.draw = function (containerIdOrElement) { + var _this = this; + if (typeof containerIdOrElement === "string") { + this.parent = document.getElementById(containerIdOrElement); + if (!this.parent) + throw new Error("Failed to find '" + containerIdOrElement + "'"); + } + else { + if (!containerIdOrElement) + throw new Error("No element was specified"); + this.parent = containerIdOrElement; + } + var self = this; + var ul = document.createElement("ul"); + //prev + var li = this.createListItem("<< Previous", function () { + self.movePrevious(); + }); + ul.appendChild(li); + this.prevItem = li; + if (this.currentPage <= 1 || this.pageCount <= 1) { + this.prevItem.style.display = "none"; + } + else { + this.prevItem.style.display = ""; + } + //pages + this.pages.forEach(function (item) { + var li = _this.createListItem(item.pageNumber.toString(), function () { + self.goto(item.pageNumber); + }); + item.listItem = li; + ul.appendChild(li); + if (item.selected) { + li.className = "active"; + li.firstElementChild.setAttribute("class", "number " + Pager.BTN_ACTIVE_CLASS); + } + }); + //next + var li = this.createListItem("Next >>", function () { + self.moveNext(); + }); + ul.appendChild(li); + this.nextItem = li; + if (this.currentPage >= this.pageCount || this.pageCount <= 1) { + this.nextItem.style.display = "none"; + } + else { + this.nextItem.style.display = ""; + } + ul.className = "pager"; + while (this.parent.firstChild) { + this.parent.removeChild(this.parent.firstChild); + } + this.parent.appendChild(ul); + }; + Pager.prototype.notify = function () { + var self = this; + this._subscribers.forEach(function (item) { + item.onPager.apply(item, [self]); + }); + }; + Pager.prototype.reset = function () { + this.pageCount = 0; + this.pages = []; + if (this.parent) { + this.draw(this.parent); + } + }; + Pager.BTN_ACTIVE_CLASS = "btn btn-success"; + Pager.BTN_CLASS = "btn"; + return Pager; + }()); + WebApp.Pager = Pager; + })(WebApp = Griffin.WebApp || (Griffin.WebApp = {})); +})(Griffin || (Griffin = {})); //# sourceMappingURL=Griffin.WebApp.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Scripts/Models/AllModels.js b/src/Server/OneTrueError.Web/Scripts/Models/AllModels.js index fb66b1f1..782194fc 100644 --- a/src/Server/OneTrueError.Web/Scripts/Models/AllModels.js +++ b/src/Server/OneTrueError.Web/Scripts/Models/AllModels.js @@ -1,1606 +1,1606 @@ -var OneTrueError; -(function (OneTrueError) { - var Web; - (function (Web) { - var Overview; - (function (Overview) { - var Queries; - (function (Queries) { - var GetOverview = (function () { - function GetOverview() { - } - GetOverview.TYPE_NAME = 'GetOverview'; - return GetOverview; - }()); - Queries.GetOverview = GetOverview; - var GetOverviewApplicationResult = (function () { - function GetOverviewApplicationResult(label, startDate, days) { - this.Label = label; - } - GetOverviewApplicationResult.TYPE_NAME = 'GetOverviewApplicationResult'; - return GetOverviewApplicationResult; - }()); - Queries.GetOverviewApplicationResult = GetOverviewApplicationResult; - var GetOverviewResult = (function () { - function GetOverviewResult() { - } - GetOverviewResult.TYPE_NAME = 'GetOverviewResult'; - return GetOverviewResult; - }()); - Queries.GetOverviewResult = GetOverviewResult; - var OverviewStatSummary = (function () { - function OverviewStatSummary() { - } - OverviewStatSummary.TYPE_NAME = 'OverviewStatSummary'; - return OverviewStatSummary; - }()); - Queries.OverviewStatSummary = OverviewStatSummary; - })(Queries = Overview.Queries || (Overview.Queries = {})); - })(Overview = Web.Overview || (Web.Overview = {})); - })(Web = OneTrueError.Web || (OneTrueError.Web = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Web; - (function (Web) { - var Feedback; - (function (Feedback) { - var Queries; - (function (Queries) { - var GetFeedbackForApplicationPage = (function () { - function GetFeedbackForApplicationPage(applicationId) { - this.ApplicationId = applicationId; - } - GetFeedbackForApplicationPage.TYPE_NAME = 'GetFeedbackForApplicationPage'; - return GetFeedbackForApplicationPage; - }()); - Queries.GetFeedbackForApplicationPage = GetFeedbackForApplicationPage; - var GetFeedbackForApplicationPageResult = (function () { - function GetFeedbackForApplicationPageResult() { - } - GetFeedbackForApplicationPageResult.TYPE_NAME = 'GetFeedbackForApplicationPageResult'; - return GetFeedbackForApplicationPageResult; - }()); - Queries.GetFeedbackForApplicationPageResult = GetFeedbackForApplicationPageResult; - var GetFeedbackForApplicationPageResultItem = (function () { - function GetFeedbackForApplicationPageResultItem() { - } - GetFeedbackForApplicationPageResultItem.TYPE_NAME = 'GetFeedbackForApplicationPageResultItem'; - return GetFeedbackForApplicationPageResultItem; - }()); - Queries.GetFeedbackForApplicationPageResultItem = GetFeedbackForApplicationPageResultItem; - var GetIncidentFeedback = (function () { - function GetIncidentFeedback(incidentId) { - this.IncidentId = incidentId; - } - GetIncidentFeedback.TYPE_NAME = 'GetIncidentFeedback'; - return GetIncidentFeedback; - }()); - Queries.GetIncidentFeedback = GetIncidentFeedback; - var GetIncidentFeedbackResult = (function () { - function GetIncidentFeedbackResult(items, emails) { - this.Items = items; - this.Emails = emails; - } - GetIncidentFeedbackResult.TYPE_NAME = 'GetIncidentFeedbackResult'; - return GetIncidentFeedbackResult; - }()); - Queries.GetIncidentFeedbackResult = GetIncidentFeedbackResult; - var GetIncidentFeedbackResultItem = (function () { - function GetIncidentFeedbackResultItem() { - } - GetIncidentFeedbackResultItem.TYPE_NAME = 'GetIncidentFeedbackResultItem'; - return GetIncidentFeedbackResultItem; - }()); - Queries.GetIncidentFeedbackResultItem = GetIncidentFeedbackResultItem; - var GetFeedbackForDashboardPage = (function () { - function GetFeedbackForDashboardPage() { - } - GetFeedbackForDashboardPage.TYPE_NAME = 'GetFeedbackForDashboardPage'; - return GetFeedbackForDashboardPage; - }()); - Queries.GetFeedbackForDashboardPage = GetFeedbackForDashboardPage; - var GetFeedbackForDashboardPageResult = (function () { - function GetFeedbackForDashboardPageResult() { - } - GetFeedbackForDashboardPageResult.TYPE_NAME = 'GetFeedbackForDashboardPageResult'; - return GetFeedbackForDashboardPageResult; - }()); - Queries.GetFeedbackForDashboardPageResult = GetFeedbackForDashboardPageResult; - var GetFeedbackForDashboardPageResultItem = (function () { - function GetFeedbackForDashboardPageResultItem() { - } - GetFeedbackForDashboardPageResultItem.TYPE_NAME = 'GetFeedbackForDashboardPageResultItem'; - return GetFeedbackForDashboardPageResultItem; - }()); - Queries.GetFeedbackForDashboardPageResultItem = GetFeedbackForDashboardPageResultItem; - })(Queries = Feedback.Queries || (Feedback.Queries = {})); - })(Feedback = Web.Feedback || (Web.Feedback = {})); - })(Web = OneTrueError.Web || (OneTrueError.Web = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var Triggers; - (function (Triggers) { - (function (LastTriggerActionDTO) { - LastTriggerActionDTO[LastTriggerActionDTO["ExecuteActions"] = 0] = "ExecuteActions"; - LastTriggerActionDTO[LastTriggerActionDTO["AbortTrigger"] = 1] = "AbortTrigger"; - })(Triggers.LastTriggerActionDTO || (Triggers.LastTriggerActionDTO = {})); - var LastTriggerActionDTO = Triggers.LastTriggerActionDTO; - var TriggerActionDataDTO = (function () { - function TriggerActionDataDTO() { - } - TriggerActionDataDTO.TYPE_NAME = 'TriggerActionDataDTO'; - return TriggerActionDataDTO; - }()); - Triggers.TriggerActionDataDTO = TriggerActionDataDTO; - var TriggerContextRule = (function () { - function TriggerContextRule() { - } - TriggerContextRule.TYPE_NAME = 'TriggerContextRule'; - return TriggerContextRule; - }()); - Triggers.TriggerContextRule = TriggerContextRule; - var TriggerExceptionRule = (function () { - function TriggerExceptionRule() { - } - TriggerExceptionRule.TYPE_NAME = 'TriggerExceptionRule'; - return TriggerExceptionRule; - }()); - Triggers.TriggerExceptionRule = TriggerExceptionRule; - (function (TriggerFilterCondition) { - TriggerFilterCondition[TriggerFilterCondition["StartsWith"] = 0] = "StartsWith"; - TriggerFilterCondition[TriggerFilterCondition["EndsWith"] = 1] = "EndsWith"; - TriggerFilterCondition[TriggerFilterCondition["Contains"] = 2] = "Contains"; - TriggerFilterCondition[TriggerFilterCondition["DoNotContain"] = 3] = "DoNotContain"; - TriggerFilterCondition[TriggerFilterCondition["Equals"] = 4] = "Equals"; - })(Triggers.TriggerFilterCondition || (Triggers.TriggerFilterCondition = {})); - var TriggerFilterCondition = Triggers.TriggerFilterCondition; - var TriggerDTO = (function () { - function TriggerDTO() { - } - TriggerDTO.TYPE_NAME = 'TriggerDTO'; - return TriggerDTO; - }()); - Triggers.TriggerDTO = TriggerDTO; - (function (TriggerRuleAction) { - TriggerRuleAction[TriggerRuleAction["AbortTrigger"] = 0] = "AbortTrigger"; - TriggerRuleAction[TriggerRuleAction["ContinueWithNextRule"] = 1] = "ContinueWithNextRule"; - TriggerRuleAction[TriggerRuleAction["ExecuteActions"] = 2] = "ExecuteActions"; - })(Triggers.TriggerRuleAction || (Triggers.TriggerRuleAction = {})); - var TriggerRuleAction = Triggers.TriggerRuleAction; - var TriggerRuleBase = (function () { - function TriggerRuleBase() { - } - TriggerRuleBase.TYPE_NAME = 'TriggerRuleBase'; - return TriggerRuleBase; - }()); - Triggers.TriggerRuleBase = TriggerRuleBase; - })(Triggers = Modules.Triggers || (Modules.Triggers = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var Triggers; - (function (Triggers) { - var Queries; - (function (Queries) { - var GetContextCollectionMetadata = (function () { - function GetContextCollectionMetadata(applicationId) { - this.ApplicationId = applicationId; - } - GetContextCollectionMetadata.TYPE_NAME = 'GetContextCollectionMetadata'; - return GetContextCollectionMetadata; - }()); - Queries.GetContextCollectionMetadata = GetContextCollectionMetadata; - var GetContextCollectionMetadataItem = (function () { - function GetContextCollectionMetadataItem() { - } - GetContextCollectionMetadataItem.TYPE_NAME = 'GetContextCollectionMetadataItem'; - return GetContextCollectionMetadataItem; - }()); - Queries.GetContextCollectionMetadataItem = GetContextCollectionMetadataItem; - var GetTrigger = (function () { - function GetTrigger(id) { - this.Id = id; - } - GetTrigger.TYPE_NAME = 'GetTrigger'; - return GetTrigger; - }()); - Queries.GetTrigger = GetTrigger; - var GetTriggerDTO = (function () { - function GetTriggerDTO() { - } - GetTriggerDTO.TYPE_NAME = 'GetTriggerDTO'; - return GetTriggerDTO; - }()); - Queries.GetTriggerDTO = GetTriggerDTO; - var GetTriggersForApplication = (function () { - function GetTriggersForApplication(applicationId) { - this.ApplicationId = applicationId; - } - GetTriggersForApplication.TYPE_NAME = 'GetTriggersForApplication'; - return GetTriggersForApplication; - }()); - Queries.GetTriggersForApplication = GetTriggersForApplication; - })(Queries = Triggers.Queries || (Triggers.Queries = {})); - })(Triggers = Modules.Triggers || (Modules.Triggers = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var Triggers; - (function (Triggers) { - var Commands; - (function (Commands) { - var CreateTrigger = (function () { - function CreateTrigger(applicationId, name) { - this.ApplicationId = applicationId; - this.Name = name; - } - CreateTrigger.TYPE_NAME = 'CreateTrigger'; - return CreateTrigger; - }()); - Commands.CreateTrigger = CreateTrigger; - var DeleteTrigger = (function () { - function DeleteTrigger(id) { - this.Id = id; - } - DeleteTrigger.TYPE_NAME = 'DeleteTrigger'; - return DeleteTrigger; - }()); - Commands.DeleteTrigger = DeleteTrigger; - var UpdateTrigger = (function () { - function UpdateTrigger(id, name) { - this.Id = id; - this.Name = name; - } - UpdateTrigger.TYPE_NAME = 'UpdateTrigger'; - return UpdateTrigger; - }()); - Commands.UpdateTrigger = UpdateTrigger; - })(Commands = Triggers.Commands || (Triggers.Commands = {})); - })(Triggers = Modules.Triggers || (Modules.Triggers = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var Tagging; - (function (Tagging) { - var TagDTO = (function () { - function TagDTO() { - } - TagDTO.TYPE_NAME = 'TagDTO'; - return TagDTO; - }()); - Tagging.TagDTO = TagDTO; - })(Tagging = Modules.Tagging || (Modules.Tagging = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var Tagging; - (function (Tagging) { - var Queries; - (function (Queries) { - var GetTagsForIncident = (function () { - function GetTagsForIncident(incidentId) { - this.IncidentId = incidentId; - } - GetTagsForIncident.TYPE_NAME = 'GetTagsForIncident'; - return GetTagsForIncident; - }()); - Queries.GetTagsForIncident = GetTagsForIncident; - })(Queries = Tagging.Queries || (Tagging.Queries = {})); - })(Tagging = Modules.Tagging || (Modules.Tagging = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var Tagging; - (function (Tagging) { - var Events; - (function (Events) { - var TagAttachedToIncident = (function () { - function TagAttachedToIncident(incidentId, tags) { - this.IncidentId = incidentId; - this.Tags = tags; - } - TagAttachedToIncident.TYPE_NAME = 'TagAttachedToIncident'; - return TagAttachedToIncident; - }()); - Events.TagAttachedToIncident = TagAttachedToIncident; - })(Events = Tagging.Events || (Tagging.Events = {})); - })(Tagging = Modules.Tagging || (Modules.Tagging = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var ContextData; - (function (ContextData) { - var Queries; - (function (Queries) { - var GetSimilarities = (function () { - function GetSimilarities(incidentId) { - this.IncidentId = incidentId; - } - GetSimilarities.TYPE_NAME = 'GetSimilarities'; - return GetSimilarities; - }()); - Queries.GetSimilarities = GetSimilarities; - var GetSimilaritiesCollection = (function () { - function GetSimilaritiesCollection() { - } - GetSimilaritiesCollection.TYPE_NAME = 'GetSimilaritiesCollection'; - return GetSimilaritiesCollection; - }()); - Queries.GetSimilaritiesCollection = GetSimilaritiesCollection; - var GetSimilaritiesResult = (function () { - function GetSimilaritiesResult() { - } - GetSimilaritiesResult.TYPE_NAME = 'GetSimilaritiesResult'; - return GetSimilaritiesResult; - }()); - Queries.GetSimilaritiesResult = GetSimilaritiesResult; - var GetSimilaritiesSimilarity = (function () { - function GetSimilaritiesSimilarity(name) { - this.Name = name; - } - GetSimilaritiesSimilarity.TYPE_NAME = 'GetSimilaritiesSimilarity'; - return GetSimilaritiesSimilarity; - }()); - Queries.GetSimilaritiesSimilarity = GetSimilaritiesSimilarity; - var GetSimilaritiesValue = (function () { - function GetSimilaritiesValue(value, percentage, count) { - this.Value = value; - this.Percentage = percentage; - this.Count = count; - } - GetSimilaritiesValue.TYPE_NAME = 'GetSimilaritiesValue'; - return GetSimilaritiesValue; - }()); - Queries.GetSimilaritiesValue = GetSimilaritiesValue; - })(Queries = ContextData.Queries || (ContextData.Queries = {})); - })(ContextData = Modules.ContextData || (Modules.ContextData = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Modules; - (function (Modules) { - var ErrorOrigins; - (function (ErrorOrigins) { - var Queries; - (function (Queries) { - var GetOriginsForIncident = (function () { - function GetOriginsForIncident(incidentId) { - this.IncidentId = incidentId; - } - GetOriginsForIncident.TYPE_NAME = 'GetOriginsForIncident'; - return GetOriginsForIncident; - }()); - Queries.GetOriginsForIncident = GetOriginsForIncident; - var GetOriginsForIncidentResult = (function () { - function GetOriginsForIncidentResult() { - } - GetOriginsForIncidentResult.TYPE_NAME = 'GetOriginsForIncidentResult'; - return GetOriginsForIncidentResult; - }()); - Queries.GetOriginsForIncidentResult = GetOriginsForIncidentResult; - var GetOriginsForIncidentResultItem = (function () { - function GetOriginsForIncidentResultItem() { - } - GetOriginsForIncidentResultItem.TYPE_NAME = 'GetOriginsForIncidentResultItem'; - return GetOriginsForIncidentResultItem; - }()); - Queries.GetOriginsForIncidentResultItem = GetOriginsForIncidentResultItem; - })(Queries = ErrorOrigins.Queries || (ErrorOrigins.Queries = {})); - })(ErrorOrigins = Modules.ErrorOrigins || (Modules.ErrorOrigins = {})); - })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var IgnoreFieldAttribute = (function () { - function IgnoreFieldAttribute() { - } - IgnoreFieldAttribute.TYPE_NAME = 'IgnoreFieldAttribute'; - return IgnoreFieldAttribute; - }()); - Core.IgnoreFieldAttribute = IgnoreFieldAttribute; - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Users; - (function (Users) { - var NotificationSettings = (function () { - function NotificationSettings() { - } - NotificationSettings.TYPE_NAME = 'NotificationSettings'; - return NotificationSettings; - }()); - Users.NotificationSettings = NotificationSettings; - (function (NotificationState) { - NotificationState[NotificationState["UseGlobalSetting"] = 0] = "UseGlobalSetting"; - NotificationState[NotificationState["Disabled"] = 1] = "Disabled"; - NotificationState[NotificationState["Cellphone"] = 2] = "Cellphone"; - NotificationState[NotificationState["Email"] = 3] = "Email"; - })(Users.NotificationState || (Users.NotificationState = {})); - var NotificationState = Users.NotificationState; - })(Users = Core.Users || (Core.Users = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Users; - (function (Users) { - var Queries; - (function (Queries) { - var GetUserSettings = (function () { - function GetUserSettings() { - } - GetUserSettings.TYPE_NAME = 'GetUserSettings'; - return GetUserSettings; - }()); - Queries.GetUserSettings = GetUserSettings; - var GetUserSettingsResult = (function () { - function GetUserSettingsResult() { - } - GetUserSettingsResult.TYPE_NAME = 'GetUserSettingsResult'; - return GetUserSettingsResult; - }()); - Queries.GetUserSettingsResult = GetUserSettingsResult; - })(Queries = Users.Queries || (Users.Queries = {})); - })(Users = Core.Users || (Core.Users = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Users; - (function (Users) { - var Commands; - (function (Commands) { - var UpdateNotifications = (function () { - function UpdateNotifications() { - } - UpdateNotifications.TYPE_NAME = 'UpdateNotifications'; - return UpdateNotifications; - }()); - Commands.UpdateNotifications = UpdateNotifications; - var UpdatePersonalSettings = (function () { - function UpdatePersonalSettings() { - } - UpdatePersonalSettings.TYPE_NAME = 'UpdatePersonalSettings'; - return UpdatePersonalSettings; - }()); - Commands.UpdatePersonalSettings = UpdatePersonalSettings; - })(Commands = Users.Commands || (Users.Commands = {})); - })(Users = Core.Users || (Core.Users = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Support; - (function (Support) { - var SendSupportRequest = (function () { - function SendSupportRequest() { - } - SendSupportRequest.TYPE_NAME = 'SendSupportRequest'; - return SendSupportRequest; - }()); - Support.SendSupportRequest = SendSupportRequest; - })(Support = Core.Support || (Core.Support = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Reports; - (function (Reports) { - var ContextCollectionDTO = (function () { - function ContextCollectionDTO(name, items) { - this.Name = name; - } - ContextCollectionDTO.TYPE_NAME = 'ContextCollectionDTO'; - return ContextCollectionDTO; - }()); - Reports.ContextCollectionDTO = ContextCollectionDTO; - var ReportDTO = (function () { - function ReportDTO() { - } - ReportDTO.TYPE_NAME = 'ReportDTO'; - return ReportDTO; - }()); - Reports.ReportDTO = ReportDTO; - var ReportExeptionDTO = (function () { - function ReportExeptionDTO() { - } - ReportExeptionDTO.TYPE_NAME = 'ReportExeptionDTO'; - return ReportExeptionDTO; - }()); - Reports.ReportExeptionDTO = ReportExeptionDTO; - })(Reports = Core.Reports || (Core.Reports = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Reports; - (function (Reports) { - var Queries; - (function (Queries) { - var GetReport = (function () { - function GetReport(reportId) { - this.ReportId = reportId; - } - GetReport.TYPE_NAME = 'GetReport'; - return GetReport; - }()); - Queries.GetReport = GetReport; - var GetReportException = (function () { - function GetReportException() { - } - GetReportException.TYPE_NAME = 'GetReportException'; - return GetReportException; - }()); - Queries.GetReportException = GetReportException; - var GetReportList = (function () { - function GetReportList(incidentId) { - this.IncidentId = incidentId; - } - GetReportList.TYPE_NAME = 'GetReportList'; - return GetReportList; - }()); - Queries.GetReportList = GetReportList; - var GetReportListResult = (function () { - function GetReportListResult(items) { - this.Items = items; - } - GetReportListResult.TYPE_NAME = 'GetReportListResult'; - return GetReportListResult; - }()); - Queries.GetReportListResult = GetReportListResult; - var GetReportListResultItem = (function () { - function GetReportListResultItem() { - } - GetReportListResultItem.TYPE_NAME = 'GetReportListResultItem'; - return GetReportListResultItem; - }()); - Queries.GetReportListResultItem = GetReportListResultItem; - var GetReportResult = (function () { - function GetReportResult() { - } - GetReportResult.TYPE_NAME = 'GetReportResult'; - return GetReportResult; - }()); - Queries.GetReportResult = GetReportResult; - var GetReportResultContextCollection = (function () { - function GetReportResultContextCollection(name, properties) { - this.Name = name; - this.Properties = properties; - } - GetReportResultContextCollection.TYPE_NAME = 'GetReportResultContextCollection'; - return GetReportResultContextCollection; - }()); - Queries.GetReportResultContextCollection = GetReportResultContextCollection; - var KeyValuePair = (function () { - function KeyValuePair(key, value) { - this.Key = key; - this.Value = value; - } - KeyValuePair.TYPE_NAME = 'KeyValuePair'; - return KeyValuePair; - }()); - Queries.KeyValuePair = KeyValuePair; - })(Queries = Reports.Queries || (Reports.Queries = {})); - })(Reports = Core.Reports || (Core.Reports = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Messaging; - (function (Messaging) { - var EmailAddress = (function () { - function EmailAddress(address) { - this.Address = address; - } - EmailAddress.TYPE_NAME = 'EmailAddress'; - return EmailAddress; - }()); - Messaging.EmailAddress = EmailAddress; - var EmailMessage = (function () { - function EmailMessage() { - } - EmailMessage.TYPE_NAME = 'EmailMessage'; - return EmailMessage; - }()); - Messaging.EmailMessage = EmailMessage; - var EmailResource = (function () { - function EmailResource(name, content) { - this.Name = name; - this.Content = content; - } - EmailResource.TYPE_NAME = 'EmailResource'; - return EmailResource; - }()); - Messaging.EmailResource = EmailResource; - })(Messaging = Core.Messaging || (Core.Messaging = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Messaging; - (function (Messaging) { - var Commands; - (function (Commands) { - var SendSms = (function () { - function SendSms(phoneNumber, message) { - this.PhoneNumber = phoneNumber; - this.Message = message; - } - SendSms.TYPE_NAME = 'SendSms'; - return SendSms; - }()); - Commands.SendSms = SendSms; - var SendEmail = (function () { - function SendEmail() { - } - SendEmail.TYPE_NAME = 'SendEmail'; - return SendEmail; - }()); - Commands.SendEmail = SendEmail; - var SendTemplateEmail = (function () { - function SendTemplateEmail(mailTitle, templateName) { - this.MailTitle = mailTitle; - this.TemplateName = templateName; - } - SendTemplateEmail.TYPE_NAME = 'SendTemplateEmail'; - return SendTemplateEmail; - }()); - Commands.SendTemplateEmail = SendTemplateEmail; - })(Commands = Messaging.Commands || (Messaging.Commands = {})); - })(Messaging = Core.Messaging || (Core.Messaging = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Invitations; - (function (Invitations) { - var Queries; - (function (Queries) { - var GetInvitationByKey = (function () { - function GetInvitationByKey(invitationKey) { - this.InvitationKey = invitationKey; - } - GetInvitationByKey.TYPE_NAME = 'GetInvitationByKey'; - return GetInvitationByKey; - }()); - Queries.GetInvitationByKey = GetInvitationByKey; - var GetInvitationByKeyResult = (function () { - function GetInvitationByKeyResult() { - } - GetInvitationByKeyResult.TYPE_NAME = 'GetInvitationByKeyResult'; - return GetInvitationByKeyResult; - }()); - Queries.GetInvitationByKeyResult = GetInvitationByKeyResult; - })(Queries = Invitations.Queries || (Invitations.Queries = {})); - })(Invitations = Core.Invitations || (Core.Invitations = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Invitations; - (function (Invitations) { - var Commands; - (function (Commands) { - var InviteUser = (function () { - function InviteUser(applicationId, emailAddress) { - this.ApplicationId = applicationId; - this.EmailAddress = emailAddress; - } - InviteUser.TYPE_NAME = 'InviteUser'; - return InviteUser; - }()); - Commands.InviteUser = InviteUser; - })(Commands = Invitations.Commands || (Invitations.Commands = {})); - })(Invitations = Core.Invitations || (Core.Invitations = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Incidents; - (function (Incidents) { - (function (IncidentOrder) { - IncidentOrder[IncidentOrder["Newest"] = 0] = "Newest"; - IncidentOrder[IncidentOrder["MostReports"] = 1] = "MostReports"; - IncidentOrder[IncidentOrder["MostFeedback"] = 2] = "MostFeedback"; - })(Incidents.IncidentOrder || (Incidents.IncidentOrder = {})); - var IncidentOrder = Incidents.IncidentOrder; - var IncidentSummaryDTO = (function () { - function IncidentSummaryDTO(id, name) { - this.Id = id; - this.Name = name; - } - IncidentSummaryDTO.TYPE_NAME = 'IncidentSummaryDTO'; - return IncidentSummaryDTO; - }()); - Incidents.IncidentSummaryDTO = IncidentSummaryDTO; - })(Incidents = Core.Incidents || (Core.Incidents = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Incidents; - (function (Incidents) { - var Queries; - (function (Queries) { - var FindIncidentResult = (function () { - function FindIncidentResult() { - } - FindIncidentResult.TYPE_NAME = 'FindIncidentResult'; - return FindIncidentResult; - }()); - Queries.FindIncidentResult = FindIncidentResult; - var FindIncidentResultItem = (function () { - function FindIncidentResultItem(id, name) { - this.Id = id; - this.Name = name; - } - FindIncidentResultItem.TYPE_NAME = 'FindIncidentResultItem'; - return FindIncidentResultItem; - }()); - Queries.FindIncidentResultItem = FindIncidentResultItem; - var FindIncidents = (function () { - function FindIncidents() { - } - FindIncidents.TYPE_NAME = 'FindIncidents'; - return FindIncidents; - }()); - Queries.FindIncidents = FindIncidents; - var GetIncident = (function () { - function GetIncident(incidentId) { - this.IncidentId = incidentId; - } - GetIncident.TYPE_NAME = 'GetIncident'; - return GetIncident; - }()); - Queries.GetIncident = GetIncident; - var GetIncidentForClosePage = (function () { - function GetIncidentForClosePage(incidentId) { - this.IncidentId = incidentId; - } - GetIncidentForClosePage.TYPE_NAME = 'GetIncidentForClosePage'; - return GetIncidentForClosePage; - }()); - Queries.GetIncidentForClosePage = GetIncidentForClosePage; - var GetIncidentForClosePageResult = (function () { - function GetIncidentForClosePageResult() { - } - GetIncidentForClosePageResult.TYPE_NAME = 'GetIncidentForClosePageResult'; - return GetIncidentForClosePageResult; - }()); - Queries.GetIncidentForClosePageResult = GetIncidentForClosePageResult; - var GetIncidentResult = (function () { - function GetIncidentResult() { - } - GetIncidentResult.TYPE_NAME = 'GetIncidentResult'; - return GetIncidentResult; - }()); - Queries.GetIncidentResult = GetIncidentResult; - var GetIncidentStatistics = (function () { - function GetIncidentStatistics() { - } - GetIncidentStatistics.TYPE_NAME = 'GetIncidentStatistics'; - return GetIncidentStatistics; - }()); - Queries.GetIncidentStatistics = GetIncidentStatistics; - var GetIncidentStatisticsResult = (function () { - function GetIncidentStatisticsResult() { - } - GetIncidentStatisticsResult.TYPE_NAME = 'GetIncidentStatisticsResult'; - return GetIncidentStatisticsResult; - }()); - Queries.GetIncidentStatisticsResult = GetIncidentStatisticsResult; - var ReportDay = (function () { - function ReportDay() { - } - ReportDay.TYPE_NAME = 'ReportDay'; - return ReportDay; - }()); - Queries.ReportDay = ReportDay; - })(Queries = Incidents.Queries || (Incidents.Queries = {})); - })(Incidents = Core.Incidents || (Core.Incidents = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Incidents; - (function (Incidents) { - var Events; - (function (Events) { - var IncidentIgnored = (function () { - function IncidentIgnored(incidentId, accountId, userName) { - this.IncidentId = incidentId; - this.AccountId = accountId; - this.UserName = userName; - } - IncidentIgnored.TYPE_NAME = 'IncidentIgnored'; - return IncidentIgnored; - }()); - Events.IncidentIgnored = IncidentIgnored; - var IncidentReOpened = (function () { - function IncidentReOpened(applicationId, incidentId, createdAtUtc) { - this.ApplicationId = applicationId; - this.IncidentId = incidentId; - this.CreatedAtUtc = createdAtUtc; - } - IncidentReOpened.TYPE_NAME = 'IncidentReOpened'; - return IncidentReOpened; - }()); - Events.IncidentReOpened = IncidentReOpened; - var ReportAddedToIncident = (function () { - function ReportAddedToIncident(incident, report, isReOpened) { - this.Incident = incident; - this.Report = report; - this.IsReOpened = isReOpened; - } - ReportAddedToIncident.TYPE_NAME = 'ReportAddedToIncident'; - return ReportAddedToIncident; - }()); - Events.ReportAddedToIncident = ReportAddedToIncident; - })(Events = Incidents.Events || (Incidents.Events = {})); - })(Incidents = Core.Incidents || (Core.Incidents = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Incidents; - (function (Incidents) { - var Commands; - (function (Commands) { - var CloseIncident = (function () { - function CloseIncident(solution, incidentId) { - this.Solution = solution; - this.IncidentId = incidentId; - } - CloseIncident.TYPE_NAME = 'CloseIncident'; - return CloseIncident; - }()); - Commands.CloseIncident = CloseIncident; - var IgnoreIncident = (function () { - function IgnoreIncident(incidentId) { - this.IncidentId = incidentId; - } - IgnoreIncident.TYPE_NAME = 'IgnoreIncident'; - return IgnoreIncident; - }()); - Commands.IgnoreIncident = IgnoreIncident; - })(Commands = Incidents.Commands || (Incidents.Commands = {})); - })(Incidents = Core.Incidents || (Core.Incidents = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Feedback; - (function (Feedback) { - var Commands; - (function (Commands) { - var SubmitFeedback = (function () { - function SubmitFeedback(errorId, remoteAddress) { - this.ErrorId = errorId; - this.RemoteAddress = remoteAddress; - } - SubmitFeedback.TYPE_NAME = 'SubmitFeedback'; - return SubmitFeedback; - }()); - Commands.SubmitFeedback = SubmitFeedback; - })(Commands = Feedback.Commands || (Feedback.Commands = {})); - })(Feedback = Core.Feedback || (Core.Feedback = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Feedback; - (function (Feedback) { - var Events; - (function (Events) { - var FeedbackAttachedToIncident = (function () { - function FeedbackAttachedToIncident() { - } - FeedbackAttachedToIncident.TYPE_NAME = 'FeedbackAttachedToIncident'; - return FeedbackAttachedToIncident; - }()); - Events.FeedbackAttachedToIncident = FeedbackAttachedToIncident; - })(Events = Feedback.Events || (Feedback.Events = {})); - })(Feedback = Core.Feedback || (Core.Feedback = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var ApiKeys; - (function (ApiKeys) { - var Queries; - (function (Queries) { - var GetApiKey = (function () { - function GetApiKey(id) { - this.Id = id; - } - GetApiKey.TYPE_NAME = 'GetApiKey'; - return GetApiKey; - }()); - Queries.GetApiKey = GetApiKey; - var GetApiKeyResult = (function () { - function GetApiKeyResult() { - } - GetApiKeyResult.TYPE_NAME = 'GetApiKeyResult'; - return GetApiKeyResult; - }()); - Queries.GetApiKeyResult = GetApiKeyResult; - var GetApiKeyResultApplication = (function () { - function GetApiKeyResultApplication() { - } - GetApiKeyResultApplication.TYPE_NAME = 'GetApiKeyResultApplication'; - return GetApiKeyResultApplication; - }()); - Queries.GetApiKeyResultApplication = GetApiKeyResultApplication; - var ListApiKeys = (function () { - function ListApiKeys() { - } - ListApiKeys.TYPE_NAME = 'ListApiKeys'; - return ListApiKeys; - }()); - Queries.ListApiKeys = ListApiKeys; - var ListApiKeysResult = (function () { - function ListApiKeysResult() { - } - ListApiKeysResult.TYPE_NAME = 'ListApiKeysResult'; - return ListApiKeysResult; - }()); - Queries.ListApiKeysResult = ListApiKeysResult; - var ListApiKeysResultItem = (function () { - function ListApiKeysResultItem() { - } - ListApiKeysResultItem.TYPE_NAME = 'ListApiKeysResultItem'; - return ListApiKeysResultItem; - }()); - Queries.ListApiKeysResultItem = ListApiKeysResultItem; - })(Queries = ApiKeys.Queries || (ApiKeys.Queries = {})); - })(ApiKeys = Core.ApiKeys || (Core.ApiKeys = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var ApiKeys; - (function (ApiKeys) { - var Events; - (function (Events) { - var ApiKeyCreated = (function () { - function ApiKeyCreated(applicationNameForTheAppUsingTheKey, apiKey, sharedSecret, applicationIds, createdById) { - this.ApplicationNameForTheAppUsingTheKey = applicationNameForTheAppUsingTheKey; - this.ApiKey = apiKey; - this.SharedSecret = sharedSecret; - this.ApplicationIds = applicationIds; - this.CreatedById = createdById; - } - ApiKeyCreated.TYPE_NAME = 'ApiKeyCreated'; - return ApiKeyCreated; - }()); - Events.ApiKeyCreated = ApiKeyCreated; - })(Events = ApiKeys.Events || (ApiKeys.Events = {})); - })(ApiKeys = Core.ApiKeys || (Core.ApiKeys = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var ApiKeys; - (function (ApiKeys) { - var Commands; - (function (Commands) { - var CreateApiKey = (function () { - function CreateApiKey(applicationName, apiKey, sharedSecret, applicationIds) { - this.ApplicationName = applicationName; - this.ApiKey = apiKey; - this.SharedSecret = sharedSecret; - this.ApplicationIds = applicationIds; - } - CreateApiKey.TYPE_NAME = 'CreateApiKey'; - return CreateApiKey; - }()); - Commands.CreateApiKey = CreateApiKey; - var DeleteApiKey = (function () { - function DeleteApiKey(id) { - this.Id = id; - } - DeleteApiKey.TYPE_NAME = 'DeleteApiKey'; - return DeleteApiKey; - }()); - Commands.DeleteApiKey = DeleteApiKey; - })(Commands = ApiKeys.Commands || (ApiKeys.Commands = {})); - })(ApiKeys = Core.ApiKeys || (Core.ApiKeys = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Applications; - (function (Applications) { - var ApplicationListItem = (function () { - function ApplicationListItem(id, name) { - this.Id = id; - this.Name = name; - } - ApplicationListItem.TYPE_NAME = 'ApplicationListItem'; - return ApplicationListItem; - }()); - Applications.ApplicationListItem = ApplicationListItem; - (function (TypeOfApplication) { - TypeOfApplication[TypeOfApplication["Mobile"] = 0] = "Mobile"; - TypeOfApplication[TypeOfApplication["DesktopApplication"] = 1] = "DesktopApplication"; - TypeOfApplication[TypeOfApplication["Server"] = 2] = "Server"; - })(Applications.TypeOfApplication || (Applications.TypeOfApplication = {})); - var TypeOfApplication = Applications.TypeOfApplication; - })(Applications = Core.Applications || (Core.Applications = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Applications; - (function (Applications) { - var Queries; - (function (Queries) { - var GetApplicationTeamResult = (function () { - function GetApplicationTeamResult() { - } - GetApplicationTeamResult.TYPE_NAME = 'GetApplicationTeamResult'; - return GetApplicationTeamResult; - }()); - Queries.GetApplicationTeamResult = GetApplicationTeamResult; - var OverviewStatSummary = (function () { - function OverviewStatSummary() { - } - OverviewStatSummary.TYPE_NAME = 'OverviewStatSummary'; - return OverviewStatSummary; - }()); - Queries.OverviewStatSummary = OverviewStatSummary; - var GetApplicationIdByKey = (function () { - function GetApplicationIdByKey(applicationKey) { - this.ApplicationKey = applicationKey; - } - GetApplicationIdByKey.TYPE_NAME = 'GetApplicationIdByKey'; - return GetApplicationIdByKey; - }()); - Queries.GetApplicationIdByKey = GetApplicationIdByKey; - var GetApplicationIdByKeyResult = (function () { - function GetApplicationIdByKeyResult() { - } - GetApplicationIdByKeyResult.TYPE_NAME = 'GetApplicationIdByKeyResult'; - return GetApplicationIdByKeyResult; - }()); - Queries.GetApplicationIdByKeyResult = GetApplicationIdByKeyResult; - var GetApplicationInfo = (function () { - function GetApplicationInfo() { - } - GetApplicationInfo.TYPE_NAME = 'GetApplicationInfo'; - return GetApplicationInfo; - }()); - Queries.GetApplicationInfo = GetApplicationInfo; - var GetApplicationInfoResult = (function () { - function GetApplicationInfoResult() { - } - GetApplicationInfoResult.TYPE_NAME = 'GetApplicationInfoResult'; - return GetApplicationInfoResult; - }()); - Queries.GetApplicationInfoResult = GetApplicationInfoResult; - var GetApplicationList = (function () { - function GetApplicationList() { - } - GetApplicationList.TYPE_NAME = 'GetApplicationList'; - return GetApplicationList; - }()); - Queries.GetApplicationList = GetApplicationList; - var GetApplicationOverviewResult = (function () { - function GetApplicationOverviewResult() { - } - GetApplicationOverviewResult.TYPE_NAME = 'GetApplicationOverviewResult'; - return GetApplicationOverviewResult; - }()); - Queries.GetApplicationOverviewResult = GetApplicationOverviewResult; - var GetApplicationTeam = (function () { - function GetApplicationTeam(applicationId) { - this.ApplicationId = applicationId; - } - GetApplicationTeam.TYPE_NAME = 'GetApplicationTeam'; - return GetApplicationTeam; - }()); - Queries.GetApplicationTeam = GetApplicationTeam; - var GetApplicationTeamMember = (function () { - function GetApplicationTeamMember() { - } - GetApplicationTeamMember.TYPE_NAME = 'GetApplicationTeamMember'; - return GetApplicationTeamMember; - }()); - Queries.GetApplicationTeamMember = GetApplicationTeamMember; - var GetApplicationTeamResultInvitation = (function () { - function GetApplicationTeamResultInvitation() { - } - GetApplicationTeamResultInvitation.TYPE_NAME = 'GetApplicationTeamResultInvitation'; - return GetApplicationTeamResultInvitation; - }()); - Queries.GetApplicationTeamResultInvitation = GetApplicationTeamResultInvitation; - var GetApplicationOverview = (function () { - function GetApplicationOverview(applicationId) { - this.ApplicationId = applicationId; - } - GetApplicationOverview.TYPE_NAME = 'GetApplicationOverview'; - return GetApplicationOverview; - }()); - Queries.GetApplicationOverview = GetApplicationOverview; - })(Queries = Applications.Queries || (Applications.Queries = {})); - })(Applications = Core.Applications || (Core.Applications = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Applications; - (function (Applications) { - var Events; - (function (Events) { - var ApplicationDeleted = (function () { - function ApplicationDeleted() { - } - ApplicationDeleted.TYPE_NAME = 'ApplicationDeleted'; - return ApplicationDeleted; - }()); - Events.ApplicationDeleted = ApplicationDeleted; - var ApplicationCreated = (function () { - function ApplicationCreated(id, name, createdById, appKey, sharedSecret) { - this.CreatedById = createdById; - this.AppKey = appKey; - this.SharedSecret = sharedSecret; - } - ApplicationCreated.TYPE_NAME = 'ApplicationCreated'; - return ApplicationCreated; - }()); - Events.ApplicationCreated = ApplicationCreated; - var UserInvitedToApplication = (function () { - function UserInvitedToApplication(invitationKey, applicationId, applicationName, emailAddress, invitedBy) { - this.InvitationKey = invitationKey; - this.ApplicationId = applicationId; - this.ApplicationName = applicationName; - this.EmailAddress = emailAddress; - this.InvitedBy = invitedBy; - } - UserInvitedToApplication.TYPE_NAME = 'UserInvitedToApplication'; - return UserInvitedToApplication; - }()); - Events.UserInvitedToApplication = UserInvitedToApplication; - })(Events = Applications.Events || (Applications.Events = {})); - })(Applications = Core.Applications || (Core.Applications = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError_1) { - var Core; - (function (Core_1) { - var Applications; - (function (Applications) { - var Events; - (function (Events_1) { - var OneTrueError; - (function (OneTrueError) { - var Api; - (function (Api) { - var Core; - (function (Core) { - var Accounts; - (function (Accounts) { - var Events; - (function (Events) { - var UserAddedToApplication = (function () { - function UserAddedToApplication(applicationId, accountId) { - this.ApplicationId = applicationId; - this.AccountId = accountId; - } - UserAddedToApplication.TYPE_NAME = 'UserAddedToApplication'; - return UserAddedToApplication; - }()); - Events.UserAddedToApplication = UserAddedToApplication; - })(Events = Accounts.Events || (Accounts.Events = {})); - })(Accounts = Core.Accounts || (Core.Accounts = {})); - })(Core = Api.Core || (Api.Core = {})); - })(Api = OneTrueError.Api || (OneTrueError.Api = {})); - })(OneTrueError = Events_1.OneTrueError || (Events_1.OneTrueError = {})); - })(Events = Applications.Events || (Applications.Events = {})); - })(Applications = Core_1.Applications || (Core_1.Applications = {})); - })(Core = OneTrueError_1.Core || (OneTrueError_1.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Applications; - (function (Applications) { - var Commands; - (function (Commands) { - var RemoveTeamMember = (function () { - function RemoveTeamMember(applicationId, userToRemove) { - this.ApplicationId = applicationId; - this.UserToRemove = userToRemove; - } - RemoveTeamMember.TYPE_NAME = 'RemoveTeamMember'; - return RemoveTeamMember; - }()); - Commands.RemoveTeamMember = RemoveTeamMember; - var UpdateApplication = (function () { - function UpdateApplication(applicationId, name) { - this.ApplicationId = applicationId; - this.Name = name; - } - UpdateApplication.TYPE_NAME = 'UpdateApplication'; - return UpdateApplication; - }()); - Commands.UpdateApplication = UpdateApplication; - var CreateApplication = (function () { - function CreateApplication(name, typeOfApplication) { - this.Name = name; - this.TypeOfApplication = typeOfApplication; - } - CreateApplication.TYPE_NAME = 'CreateApplication'; - return CreateApplication; - }()); - Commands.CreateApplication = CreateApplication; - var DeleteApplication = (function () { - function DeleteApplication(id) { - this.Id = id; - } - DeleteApplication.TYPE_NAME = 'DeleteApplication'; - return DeleteApplication; - }()); - Commands.DeleteApplication = DeleteApplication; - })(Commands = Applications.Commands || (Applications.Commands = {})); - })(Applications = Core.Applications || (Core.Applications = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Accounts; - (function (Accounts) { - var RegisterSimple = (function () { - function RegisterSimple(emailAddress) { - this.EmailAddress = emailAddress; - } - RegisterSimple.TYPE_NAME = 'RegisterSimple'; - return RegisterSimple; - }()); - Accounts.RegisterSimple = RegisterSimple; - })(Accounts = Core.Accounts || (Core.Accounts = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Accounts; - (function (Accounts) { - var Requests; - (function (Requests) { - var AcceptInvitation = (function () { - function AcceptInvitation(userName, password, invitationKey) { - this.UserName = userName; - this.Password = password; - this.InvitationKey = invitationKey; - } - AcceptInvitation.TYPE_NAME = 'AcceptInvitation'; - return AcceptInvitation; - }()); - Requests.AcceptInvitation = AcceptInvitation; - var AcceptInvitationReply = (function () { - function AcceptInvitationReply(accountId, userName) { - this.AccountId = accountId; - this.UserName = userName; - } - AcceptInvitationReply.TYPE_NAME = 'AcceptInvitationReply'; - return AcceptInvitationReply; - }()); - Requests.AcceptInvitationReply = AcceptInvitationReply; - var ActivateAccount = (function () { - function ActivateAccount(activationKey) { - this.ActivationKey = activationKey; - } - ActivateAccount.TYPE_NAME = 'ActivateAccount'; - return ActivateAccount; - }()); - Requests.ActivateAccount = ActivateAccount; - var ActivateAccountReply = (function () { - function ActivateAccountReply(accountId, userName) { - this.AccountId = accountId; - this.UserName = userName; - } - ActivateAccountReply.TYPE_NAME = 'ActivateAccountReply'; - return ActivateAccountReply; - }()); - Requests.ActivateAccountReply = ActivateAccountReply; - var ChangePassword = (function () { - function ChangePassword(currentPassword, newPassword) { - this.CurrentPassword = currentPassword; - this.NewPassword = newPassword; - } - ChangePassword.TYPE_NAME = 'ChangePassword'; - return ChangePassword; - }()); - Requests.ChangePassword = ChangePassword; - var ChangePasswordReply = (function () { - function ChangePasswordReply() { - } - ChangePasswordReply.TYPE_NAME = 'ChangePasswordReply'; - return ChangePasswordReply; - }()); - Requests.ChangePasswordReply = ChangePasswordReply; - var IgnoreFieldAttribute = (function () { - function IgnoreFieldAttribute() { - } - IgnoreFieldAttribute.TYPE_NAME = 'IgnoreFieldAttribute'; - return IgnoreFieldAttribute; - }()); - Requests.IgnoreFieldAttribute = IgnoreFieldAttribute; - var Login = (function () { - function Login(userName, password) { - this.UserName = userName; - this.Password = password; - } - Login.TYPE_NAME = 'Login'; - return Login; - }()); - Requests.Login = Login; - var LoginReply = (function () { - function LoginReply() { - } - LoginReply.TYPE_NAME = 'LoginReply'; - return LoginReply; - }()); - Requests.LoginReply = LoginReply; - (function (LoginResult) { - LoginResult[LoginResult["Locked"] = 0] = "Locked"; - LoginResult[LoginResult["IncorrectLogin"] = 1] = "IncorrectLogin"; - LoginResult[LoginResult["Successful"] = 2] = "Successful"; - })(Requests.LoginResult || (Requests.LoginResult = {})); - var LoginResult = Requests.LoginResult; - var ResetPassword = (function () { - function ResetPassword(activationKey, newPassword) { - this.ActivationKey = activationKey; - this.NewPassword = newPassword; - } - ResetPassword.TYPE_NAME = 'ResetPassword'; - return ResetPassword; - }()); - Requests.ResetPassword = ResetPassword; - var ResetPasswordReply = (function () { - function ResetPasswordReply() { - } - ResetPasswordReply.TYPE_NAME = 'ResetPasswordReply'; - return ResetPasswordReply; - }()); - Requests.ResetPasswordReply = ResetPasswordReply; - var ValidateNewLogin = (function () { - function ValidateNewLogin() { - } - ValidateNewLogin.TYPE_NAME = 'ValidateNewLogin'; - return ValidateNewLogin; - }()); - Requests.ValidateNewLogin = ValidateNewLogin; - var ValidateNewLoginReply = (function () { - function ValidateNewLoginReply() { - } - ValidateNewLoginReply.TYPE_NAME = 'ValidateNewLoginReply'; - return ValidateNewLoginReply; - }()); - Requests.ValidateNewLoginReply = ValidateNewLoginReply; - })(Requests = Accounts.Requests || (Accounts.Requests = {})); - })(Accounts = Core.Accounts || (Core.Accounts = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Accounts; - (function (Accounts) { - var Queries; - (function (Queries) { - var AccountDTO = (function () { - function AccountDTO() { - } - AccountDTO.TYPE_NAME = 'AccountDTO'; - return AccountDTO; - }()); - Queries.AccountDTO = AccountDTO; - (function (AccountState) { - AccountState[AccountState["VerificationRequired"] = 0] = "VerificationRequired"; - AccountState[AccountState["Active"] = 1] = "Active"; - AccountState[AccountState["Locked"] = 2] = "Locked"; - AccountState[AccountState["ResetPassword"] = 3] = "ResetPassword"; - })(Queries.AccountState || (Queries.AccountState = {})); - var AccountState = Queries.AccountState; - var FindAccountByUserName = (function () { - function FindAccountByUserName(userName) { - this.UserName = userName; - } - FindAccountByUserName.TYPE_NAME = 'FindAccountByUserName'; - return FindAccountByUserName; - }()); - Queries.FindAccountByUserName = FindAccountByUserName; - var GetAccountById = (function () { - function GetAccountById(accountId) { - this.AccountId = accountId; - } - GetAccountById.TYPE_NAME = 'GetAccountById'; - return GetAccountById; - }()); - Queries.GetAccountById = GetAccountById; - var GetAccountEmailById = (function () { - function GetAccountEmailById(accountId) { - this.AccountId = accountId; - } - GetAccountEmailById.TYPE_NAME = 'GetAccountEmailById'; - return GetAccountEmailById; - }()); - Queries.GetAccountEmailById = GetAccountEmailById; - var FindAccountByUserNameResult = (function () { - function FindAccountByUserNameResult(accountId, displayName) { - this.AccountId = accountId; - this.DisplayName = displayName; - } - FindAccountByUserNameResult.TYPE_NAME = 'FindAccountByUserNameResult'; - return FindAccountByUserNameResult; - }()); - Queries.FindAccountByUserNameResult = FindAccountByUserNameResult; - })(Queries = Accounts.Queries || (Accounts.Queries = {})); - })(Accounts = Core.Accounts || (Core.Accounts = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Accounts; - (function (Accounts) { - var Events; - (function (Events) { - var AccountActivated = (function () { - function AccountActivated(accountId, userName) { - this.AccountId = accountId; - this.UserName = userName; - } - AccountActivated.TYPE_NAME = 'AccountActivated'; - return AccountActivated; - }()); - Events.AccountActivated = AccountActivated; - var AccountRegistered = (function () { - function AccountRegistered(accountId, userName) { - this.AccountId = accountId; - this.UserName = userName; - } - AccountRegistered.TYPE_NAME = 'AccountRegistered'; - return AccountRegistered; - }()); - Events.AccountRegistered = AccountRegistered; - var InvitationAccepted = (function () { - function InvitationAccepted(accountId, invitedByUserName, userName) { - this.AccountId = accountId; - this.InvitedByUserName = invitedByUserName; - this.UserName = userName; - } - InvitationAccepted.TYPE_NAME = 'InvitationAccepted'; - return InvitationAccepted; - }()); - Events.InvitationAccepted = InvitationAccepted; - var LoginFailed = (function () { - function LoginFailed(userName) { - this.UserName = userName; - } - LoginFailed.TYPE_NAME = 'LoginFailed'; - return LoginFailed; - }()); - Events.LoginFailed = LoginFailed; - })(Events = Accounts.Events || (Accounts.Events = {})); - })(Accounts = Core.Accounts || (Core.Accounts = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); -var OneTrueError; -(function (OneTrueError) { - var Core; - (function (Core) { - var Accounts; - (function (Accounts) { - var Commands; - (function (Commands) { - var DeclineInvitation = (function () { - function DeclineInvitation(invitationId) { - this.InvitationId = invitationId; - } - DeclineInvitation.TYPE_NAME = 'DeclineInvitation'; - return DeclineInvitation; - }()); - Commands.DeclineInvitation = DeclineInvitation; - var RegisterAccount = (function () { - function RegisterAccount(userName, password, email) { - this.UserName = userName; - this.Password = password; - this.Email = email; - } - RegisterAccount.TYPE_NAME = 'RegisterAccount'; - return RegisterAccount; - }()); - Commands.RegisterAccount = RegisterAccount; - var RequestPasswordReset = (function () { - function RequestPasswordReset(emailAddress) { - this.EmailAddress = emailAddress; - } - RequestPasswordReset.TYPE_NAME = 'RequestPasswordReset'; - return RequestPasswordReset; - }()); - Commands.RequestPasswordReset = RequestPasswordReset; - })(Commands = Accounts.Commands || (Accounts.Commands = {})); - })(Accounts = Core.Accounts || (Core.Accounts = {})); - })(Core = OneTrueError.Core || (OneTrueError.Core = {})); -})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Web; + (function (Web) { + var Overview; + (function (Overview) { + var Queries; + (function (Queries) { + var GetOverview = (function () { + function GetOverview() { + } + GetOverview.TYPE_NAME = 'GetOverview'; + return GetOverview; + }()); + Queries.GetOverview = GetOverview; + var GetOverviewApplicationResult = (function () { + function GetOverviewApplicationResult(label, startDate, days) { + this.Label = label; + } + GetOverviewApplicationResult.TYPE_NAME = 'GetOverviewApplicationResult'; + return GetOverviewApplicationResult; + }()); + Queries.GetOverviewApplicationResult = GetOverviewApplicationResult; + var GetOverviewResult = (function () { + function GetOverviewResult() { + } + GetOverviewResult.TYPE_NAME = 'GetOverviewResult'; + return GetOverviewResult; + }()); + Queries.GetOverviewResult = GetOverviewResult; + var OverviewStatSummary = (function () { + function OverviewStatSummary() { + } + OverviewStatSummary.TYPE_NAME = 'OverviewStatSummary'; + return OverviewStatSummary; + }()); + Queries.OverviewStatSummary = OverviewStatSummary; + })(Queries = Overview.Queries || (Overview.Queries = {})); + })(Overview = Web.Overview || (Web.Overview = {})); + })(Web = OneTrueError.Web || (OneTrueError.Web = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Web; + (function (Web) { + var Feedback; + (function (Feedback) { + var Queries; + (function (Queries) { + var GetFeedbackForApplicationPage = (function () { + function GetFeedbackForApplicationPage(applicationId) { + this.ApplicationId = applicationId; + } + GetFeedbackForApplicationPage.TYPE_NAME = 'GetFeedbackForApplicationPage'; + return GetFeedbackForApplicationPage; + }()); + Queries.GetFeedbackForApplicationPage = GetFeedbackForApplicationPage; + var GetFeedbackForApplicationPageResult = (function () { + function GetFeedbackForApplicationPageResult() { + } + GetFeedbackForApplicationPageResult.TYPE_NAME = 'GetFeedbackForApplicationPageResult'; + return GetFeedbackForApplicationPageResult; + }()); + Queries.GetFeedbackForApplicationPageResult = GetFeedbackForApplicationPageResult; + var GetFeedbackForApplicationPageResultItem = (function () { + function GetFeedbackForApplicationPageResultItem() { + } + GetFeedbackForApplicationPageResultItem.TYPE_NAME = 'GetFeedbackForApplicationPageResultItem'; + return GetFeedbackForApplicationPageResultItem; + }()); + Queries.GetFeedbackForApplicationPageResultItem = GetFeedbackForApplicationPageResultItem; + var GetIncidentFeedback = (function () { + function GetIncidentFeedback(incidentId) { + this.IncidentId = incidentId; + } + GetIncidentFeedback.TYPE_NAME = 'GetIncidentFeedback'; + return GetIncidentFeedback; + }()); + Queries.GetIncidentFeedback = GetIncidentFeedback; + var GetIncidentFeedbackResult = (function () { + function GetIncidentFeedbackResult(items, emails) { + this.Items = items; + this.Emails = emails; + } + GetIncidentFeedbackResult.TYPE_NAME = 'GetIncidentFeedbackResult'; + return GetIncidentFeedbackResult; + }()); + Queries.GetIncidentFeedbackResult = GetIncidentFeedbackResult; + var GetIncidentFeedbackResultItem = (function () { + function GetIncidentFeedbackResultItem() { + } + GetIncidentFeedbackResultItem.TYPE_NAME = 'GetIncidentFeedbackResultItem'; + return GetIncidentFeedbackResultItem; + }()); + Queries.GetIncidentFeedbackResultItem = GetIncidentFeedbackResultItem; + var GetFeedbackForDashboardPage = (function () { + function GetFeedbackForDashboardPage() { + } + GetFeedbackForDashboardPage.TYPE_NAME = 'GetFeedbackForDashboardPage'; + return GetFeedbackForDashboardPage; + }()); + Queries.GetFeedbackForDashboardPage = GetFeedbackForDashboardPage; + var GetFeedbackForDashboardPageResult = (function () { + function GetFeedbackForDashboardPageResult() { + } + GetFeedbackForDashboardPageResult.TYPE_NAME = 'GetFeedbackForDashboardPageResult'; + return GetFeedbackForDashboardPageResult; + }()); + Queries.GetFeedbackForDashboardPageResult = GetFeedbackForDashboardPageResult; + var GetFeedbackForDashboardPageResultItem = (function () { + function GetFeedbackForDashboardPageResultItem() { + } + GetFeedbackForDashboardPageResultItem.TYPE_NAME = 'GetFeedbackForDashboardPageResultItem'; + return GetFeedbackForDashboardPageResultItem; + }()); + Queries.GetFeedbackForDashboardPageResultItem = GetFeedbackForDashboardPageResultItem; + })(Queries = Feedback.Queries || (Feedback.Queries = {})); + })(Feedback = Web.Feedback || (Web.Feedback = {})); + })(Web = OneTrueError.Web || (OneTrueError.Web = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var Triggers; + (function (Triggers) { + (function (LastTriggerActionDTO) { + LastTriggerActionDTO[LastTriggerActionDTO["ExecuteActions"] = 0] = "ExecuteActions"; + LastTriggerActionDTO[LastTriggerActionDTO["AbortTrigger"] = 1] = "AbortTrigger"; + })(Triggers.LastTriggerActionDTO || (Triggers.LastTriggerActionDTO = {})); + var LastTriggerActionDTO = Triggers.LastTriggerActionDTO; + var TriggerActionDataDTO = (function () { + function TriggerActionDataDTO() { + } + TriggerActionDataDTO.TYPE_NAME = 'TriggerActionDataDTO'; + return TriggerActionDataDTO; + }()); + Triggers.TriggerActionDataDTO = TriggerActionDataDTO; + var TriggerContextRule = (function () { + function TriggerContextRule() { + } + TriggerContextRule.TYPE_NAME = 'TriggerContextRule'; + return TriggerContextRule; + }()); + Triggers.TriggerContextRule = TriggerContextRule; + var TriggerExceptionRule = (function () { + function TriggerExceptionRule() { + } + TriggerExceptionRule.TYPE_NAME = 'TriggerExceptionRule'; + return TriggerExceptionRule; + }()); + Triggers.TriggerExceptionRule = TriggerExceptionRule; + (function (TriggerFilterCondition) { + TriggerFilterCondition[TriggerFilterCondition["StartsWith"] = 0] = "StartsWith"; + TriggerFilterCondition[TriggerFilterCondition["EndsWith"] = 1] = "EndsWith"; + TriggerFilterCondition[TriggerFilterCondition["Contains"] = 2] = "Contains"; + TriggerFilterCondition[TriggerFilterCondition["DoNotContain"] = 3] = "DoNotContain"; + TriggerFilterCondition[TriggerFilterCondition["Equals"] = 4] = "Equals"; + })(Triggers.TriggerFilterCondition || (Triggers.TriggerFilterCondition = {})); + var TriggerFilterCondition = Triggers.TriggerFilterCondition; + var TriggerDTO = (function () { + function TriggerDTO() { + } + TriggerDTO.TYPE_NAME = 'TriggerDTO'; + return TriggerDTO; + }()); + Triggers.TriggerDTO = TriggerDTO; + (function (TriggerRuleAction) { + TriggerRuleAction[TriggerRuleAction["AbortTrigger"] = 0] = "AbortTrigger"; + TriggerRuleAction[TriggerRuleAction["ContinueWithNextRule"] = 1] = "ContinueWithNextRule"; + TriggerRuleAction[TriggerRuleAction["ExecuteActions"] = 2] = "ExecuteActions"; + })(Triggers.TriggerRuleAction || (Triggers.TriggerRuleAction = {})); + var TriggerRuleAction = Triggers.TriggerRuleAction; + var TriggerRuleBase = (function () { + function TriggerRuleBase() { + } + TriggerRuleBase.TYPE_NAME = 'TriggerRuleBase'; + return TriggerRuleBase; + }()); + Triggers.TriggerRuleBase = TriggerRuleBase; + })(Triggers = Modules.Triggers || (Modules.Triggers = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var Triggers; + (function (Triggers) { + var Queries; + (function (Queries) { + var GetContextCollectionMetadata = (function () { + function GetContextCollectionMetadata(applicationId) { + this.ApplicationId = applicationId; + } + GetContextCollectionMetadata.TYPE_NAME = 'GetContextCollectionMetadata'; + return GetContextCollectionMetadata; + }()); + Queries.GetContextCollectionMetadata = GetContextCollectionMetadata; + var GetContextCollectionMetadataItem = (function () { + function GetContextCollectionMetadataItem() { + } + GetContextCollectionMetadataItem.TYPE_NAME = 'GetContextCollectionMetadataItem'; + return GetContextCollectionMetadataItem; + }()); + Queries.GetContextCollectionMetadataItem = GetContextCollectionMetadataItem; + var GetTrigger = (function () { + function GetTrigger(id) { + this.Id = id; + } + GetTrigger.TYPE_NAME = 'GetTrigger'; + return GetTrigger; + }()); + Queries.GetTrigger = GetTrigger; + var GetTriggerDTO = (function () { + function GetTriggerDTO() { + } + GetTriggerDTO.TYPE_NAME = 'GetTriggerDTO'; + return GetTriggerDTO; + }()); + Queries.GetTriggerDTO = GetTriggerDTO; + var GetTriggersForApplication = (function () { + function GetTriggersForApplication(applicationId) { + this.ApplicationId = applicationId; + } + GetTriggersForApplication.TYPE_NAME = 'GetTriggersForApplication'; + return GetTriggersForApplication; + }()); + Queries.GetTriggersForApplication = GetTriggersForApplication; + })(Queries = Triggers.Queries || (Triggers.Queries = {})); + })(Triggers = Modules.Triggers || (Modules.Triggers = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var Triggers; + (function (Triggers) { + var Commands; + (function (Commands) { + var CreateTrigger = (function () { + function CreateTrigger(applicationId, name) { + this.ApplicationId = applicationId; + this.Name = name; + } + CreateTrigger.TYPE_NAME = 'CreateTrigger'; + return CreateTrigger; + }()); + Commands.CreateTrigger = CreateTrigger; + var DeleteTrigger = (function () { + function DeleteTrigger(id) { + this.Id = id; + } + DeleteTrigger.TYPE_NAME = 'DeleteTrigger'; + return DeleteTrigger; + }()); + Commands.DeleteTrigger = DeleteTrigger; + var UpdateTrigger = (function () { + function UpdateTrigger(id, name) { + this.Id = id; + this.Name = name; + } + UpdateTrigger.TYPE_NAME = 'UpdateTrigger'; + return UpdateTrigger; + }()); + Commands.UpdateTrigger = UpdateTrigger; + })(Commands = Triggers.Commands || (Triggers.Commands = {})); + })(Triggers = Modules.Triggers || (Modules.Triggers = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var Tagging; + (function (Tagging) { + var TagDTO = (function () { + function TagDTO() { + } + TagDTO.TYPE_NAME = 'TagDTO'; + return TagDTO; + }()); + Tagging.TagDTO = TagDTO; + })(Tagging = Modules.Tagging || (Modules.Tagging = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var Tagging; + (function (Tagging) { + var Queries; + (function (Queries) { + var GetTagsForIncident = (function () { + function GetTagsForIncident(incidentId) { + this.IncidentId = incidentId; + } + GetTagsForIncident.TYPE_NAME = 'GetTagsForIncident'; + return GetTagsForIncident; + }()); + Queries.GetTagsForIncident = GetTagsForIncident; + })(Queries = Tagging.Queries || (Tagging.Queries = {})); + })(Tagging = Modules.Tagging || (Modules.Tagging = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var Tagging; + (function (Tagging) { + var Events; + (function (Events) { + var TagAttachedToIncident = (function () { + function TagAttachedToIncident(incidentId, tags) { + this.IncidentId = incidentId; + this.Tags = tags; + } + TagAttachedToIncident.TYPE_NAME = 'TagAttachedToIncident'; + return TagAttachedToIncident; + }()); + Events.TagAttachedToIncident = TagAttachedToIncident; + })(Events = Tagging.Events || (Tagging.Events = {})); + })(Tagging = Modules.Tagging || (Modules.Tagging = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var ContextData; + (function (ContextData) { + var Queries; + (function (Queries) { + var GetSimilarities = (function () { + function GetSimilarities(incidentId) { + this.IncidentId = incidentId; + } + GetSimilarities.TYPE_NAME = 'GetSimilarities'; + return GetSimilarities; + }()); + Queries.GetSimilarities = GetSimilarities; + var GetSimilaritiesCollection = (function () { + function GetSimilaritiesCollection() { + } + GetSimilaritiesCollection.TYPE_NAME = 'GetSimilaritiesCollection'; + return GetSimilaritiesCollection; + }()); + Queries.GetSimilaritiesCollection = GetSimilaritiesCollection; + var GetSimilaritiesResult = (function () { + function GetSimilaritiesResult() { + } + GetSimilaritiesResult.TYPE_NAME = 'GetSimilaritiesResult'; + return GetSimilaritiesResult; + }()); + Queries.GetSimilaritiesResult = GetSimilaritiesResult; + var GetSimilaritiesSimilarity = (function () { + function GetSimilaritiesSimilarity(name) { + this.Name = name; + } + GetSimilaritiesSimilarity.TYPE_NAME = 'GetSimilaritiesSimilarity'; + return GetSimilaritiesSimilarity; + }()); + Queries.GetSimilaritiesSimilarity = GetSimilaritiesSimilarity; + var GetSimilaritiesValue = (function () { + function GetSimilaritiesValue(value, percentage, count) { + this.Value = value; + this.Percentage = percentage; + this.Count = count; + } + GetSimilaritiesValue.TYPE_NAME = 'GetSimilaritiesValue'; + return GetSimilaritiesValue; + }()); + Queries.GetSimilaritiesValue = GetSimilaritiesValue; + })(Queries = ContextData.Queries || (ContextData.Queries = {})); + })(ContextData = Modules.ContextData || (Modules.ContextData = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Modules; + (function (Modules) { + var ErrorOrigins; + (function (ErrorOrigins) { + var Queries; + (function (Queries) { + var GetOriginsForIncident = (function () { + function GetOriginsForIncident(incidentId) { + this.IncidentId = incidentId; + } + GetOriginsForIncident.TYPE_NAME = 'GetOriginsForIncident'; + return GetOriginsForIncident; + }()); + Queries.GetOriginsForIncident = GetOriginsForIncident; + var GetOriginsForIncidentResult = (function () { + function GetOriginsForIncidentResult() { + } + GetOriginsForIncidentResult.TYPE_NAME = 'GetOriginsForIncidentResult'; + return GetOriginsForIncidentResult; + }()); + Queries.GetOriginsForIncidentResult = GetOriginsForIncidentResult; + var GetOriginsForIncidentResultItem = (function () { + function GetOriginsForIncidentResultItem() { + } + GetOriginsForIncidentResultItem.TYPE_NAME = 'GetOriginsForIncidentResultItem'; + return GetOriginsForIncidentResultItem; + }()); + Queries.GetOriginsForIncidentResultItem = GetOriginsForIncidentResultItem; + })(Queries = ErrorOrigins.Queries || (ErrorOrigins.Queries = {})); + })(ErrorOrigins = Modules.ErrorOrigins || (Modules.ErrorOrigins = {})); + })(Modules = OneTrueError.Modules || (OneTrueError.Modules = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var IgnoreFieldAttribute = (function () { + function IgnoreFieldAttribute() { + } + IgnoreFieldAttribute.TYPE_NAME = 'IgnoreFieldAttribute'; + return IgnoreFieldAttribute; + }()); + Core.IgnoreFieldAttribute = IgnoreFieldAttribute; + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Users; + (function (Users) { + var NotificationSettings = (function () { + function NotificationSettings() { + } + NotificationSettings.TYPE_NAME = 'NotificationSettings'; + return NotificationSettings; + }()); + Users.NotificationSettings = NotificationSettings; + (function (NotificationState) { + NotificationState[NotificationState["UseGlobalSetting"] = 0] = "UseGlobalSetting"; + NotificationState[NotificationState["Disabled"] = 1] = "Disabled"; + NotificationState[NotificationState["Cellphone"] = 2] = "Cellphone"; + NotificationState[NotificationState["Email"] = 3] = "Email"; + })(Users.NotificationState || (Users.NotificationState = {})); + var NotificationState = Users.NotificationState; + })(Users = Core.Users || (Core.Users = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Users; + (function (Users) { + var Queries; + (function (Queries) { + var GetUserSettings = (function () { + function GetUserSettings() { + } + GetUserSettings.TYPE_NAME = 'GetUserSettings'; + return GetUserSettings; + }()); + Queries.GetUserSettings = GetUserSettings; + var GetUserSettingsResult = (function () { + function GetUserSettingsResult() { + } + GetUserSettingsResult.TYPE_NAME = 'GetUserSettingsResult'; + return GetUserSettingsResult; + }()); + Queries.GetUserSettingsResult = GetUserSettingsResult; + })(Queries = Users.Queries || (Users.Queries = {})); + })(Users = Core.Users || (Core.Users = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Users; + (function (Users) { + var Commands; + (function (Commands) { + var UpdateNotifications = (function () { + function UpdateNotifications() { + } + UpdateNotifications.TYPE_NAME = 'UpdateNotifications'; + return UpdateNotifications; + }()); + Commands.UpdateNotifications = UpdateNotifications; + var UpdatePersonalSettings = (function () { + function UpdatePersonalSettings() { + } + UpdatePersonalSettings.TYPE_NAME = 'UpdatePersonalSettings'; + return UpdatePersonalSettings; + }()); + Commands.UpdatePersonalSettings = UpdatePersonalSettings; + })(Commands = Users.Commands || (Users.Commands = {})); + })(Users = Core.Users || (Core.Users = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Support; + (function (Support) { + var SendSupportRequest = (function () { + function SendSupportRequest() { + } + SendSupportRequest.TYPE_NAME = 'SendSupportRequest'; + return SendSupportRequest; + }()); + Support.SendSupportRequest = SendSupportRequest; + })(Support = Core.Support || (Core.Support = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Reports; + (function (Reports) { + var ContextCollectionDTO = (function () { + function ContextCollectionDTO(name, items) { + this.Name = name; + } + ContextCollectionDTO.TYPE_NAME = 'ContextCollectionDTO'; + return ContextCollectionDTO; + }()); + Reports.ContextCollectionDTO = ContextCollectionDTO; + var ReportDTO = (function () { + function ReportDTO() { + } + ReportDTO.TYPE_NAME = 'ReportDTO'; + return ReportDTO; + }()); + Reports.ReportDTO = ReportDTO; + var ReportExeptionDTO = (function () { + function ReportExeptionDTO() { + } + ReportExeptionDTO.TYPE_NAME = 'ReportExeptionDTO'; + return ReportExeptionDTO; + }()); + Reports.ReportExeptionDTO = ReportExeptionDTO; + })(Reports = Core.Reports || (Core.Reports = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Reports; + (function (Reports) { + var Queries; + (function (Queries) { + var GetReport = (function () { + function GetReport(reportId) { + this.ReportId = reportId; + } + GetReport.TYPE_NAME = 'GetReport'; + return GetReport; + }()); + Queries.GetReport = GetReport; + var GetReportException = (function () { + function GetReportException() { + } + GetReportException.TYPE_NAME = 'GetReportException'; + return GetReportException; + }()); + Queries.GetReportException = GetReportException; + var GetReportList = (function () { + function GetReportList(incidentId) { + this.IncidentId = incidentId; + } + GetReportList.TYPE_NAME = 'GetReportList'; + return GetReportList; + }()); + Queries.GetReportList = GetReportList; + var GetReportListResult = (function () { + function GetReportListResult(items) { + this.Items = items; + } + GetReportListResult.TYPE_NAME = 'GetReportListResult'; + return GetReportListResult; + }()); + Queries.GetReportListResult = GetReportListResult; + var GetReportListResultItem = (function () { + function GetReportListResultItem() { + } + GetReportListResultItem.TYPE_NAME = 'GetReportListResultItem'; + return GetReportListResultItem; + }()); + Queries.GetReportListResultItem = GetReportListResultItem; + var GetReportResult = (function () { + function GetReportResult() { + } + GetReportResult.TYPE_NAME = 'GetReportResult'; + return GetReportResult; + }()); + Queries.GetReportResult = GetReportResult; + var GetReportResultContextCollection = (function () { + function GetReportResultContextCollection(name, properties) { + this.Name = name; + this.Properties = properties; + } + GetReportResultContextCollection.TYPE_NAME = 'GetReportResultContextCollection'; + return GetReportResultContextCollection; + }()); + Queries.GetReportResultContextCollection = GetReportResultContextCollection; + var KeyValuePair = (function () { + function KeyValuePair(key, value) { + this.Key = key; + this.Value = value; + } + KeyValuePair.TYPE_NAME = 'KeyValuePair'; + return KeyValuePair; + }()); + Queries.KeyValuePair = KeyValuePair; + })(Queries = Reports.Queries || (Reports.Queries = {})); + })(Reports = Core.Reports || (Core.Reports = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Messaging; + (function (Messaging) { + var EmailAddress = (function () { + function EmailAddress(address) { + this.Address = address; + } + EmailAddress.TYPE_NAME = 'EmailAddress'; + return EmailAddress; + }()); + Messaging.EmailAddress = EmailAddress; + var EmailMessage = (function () { + function EmailMessage() { + } + EmailMessage.TYPE_NAME = 'EmailMessage'; + return EmailMessage; + }()); + Messaging.EmailMessage = EmailMessage; + var EmailResource = (function () { + function EmailResource(name, content) { + this.Name = name; + this.Content = content; + } + EmailResource.TYPE_NAME = 'EmailResource'; + return EmailResource; + }()); + Messaging.EmailResource = EmailResource; + })(Messaging = Core.Messaging || (Core.Messaging = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Messaging; + (function (Messaging) { + var Commands; + (function (Commands) { + var SendSms = (function () { + function SendSms(phoneNumber, message) { + this.PhoneNumber = phoneNumber; + this.Message = message; + } + SendSms.TYPE_NAME = 'SendSms'; + return SendSms; + }()); + Commands.SendSms = SendSms; + var SendEmail = (function () { + function SendEmail() { + } + SendEmail.TYPE_NAME = 'SendEmail'; + return SendEmail; + }()); + Commands.SendEmail = SendEmail; + var SendTemplateEmail = (function () { + function SendTemplateEmail(mailTitle, templateName) { + this.MailTitle = mailTitle; + this.TemplateName = templateName; + } + SendTemplateEmail.TYPE_NAME = 'SendTemplateEmail'; + return SendTemplateEmail; + }()); + Commands.SendTemplateEmail = SendTemplateEmail; + })(Commands = Messaging.Commands || (Messaging.Commands = {})); + })(Messaging = Core.Messaging || (Core.Messaging = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Invitations; + (function (Invitations) { + var Queries; + (function (Queries) { + var GetInvitationByKey = (function () { + function GetInvitationByKey(invitationKey) { + this.InvitationKey = invitationKey; + } + GetInvitationByKey.TYPE_NAME = 'GetInvitationByKey'; + return GetInvitationByKey; + }()); + Queries.GetInvitationByKey = GetInvitationByKey; + var GetInvitationByKeyResult = (function () { + function GetInvitationByKeyResult() { + } + GetInvitationByKeyResult.TYPE_NAME = 'GetInvitationByKeyResult'; + return GetInvitationByKeyResult; + }()); + Queries.GetInvitationByKeyResult = GetInvitationByKeyResult; + })(Queries = Invitations.Queries || (Invitations.Queries = {})); + })(Invitations = Core.Invitations || (Core.Invitations = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Invitations; + (function (Invitations) { + var Commands; + (function (Commands) { + var InviteUser = (function () { + function InviteUser(applicationId, emailAddress) { + this.ApplicationId = applicationId; + this.EmailAddress = emailAddress; + } + InviteUser.TYPE_NAME = 'InviteUser'; + return InviteUser; + }()); + Commands.InviteUser = InviteUser; + })(Commands = Invitations.Commands || (Invitations.Commands = {})); + })(Invitations = Core.Invitations || (Core.Invitations = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Incidents; + (function (Incidents) { + (function (IncidentOrder) { + IncidentOrder[IncidentOrder["Newest"] = 0] = "Newest"; + IncidentOrder[IncidentOrder["MostReports"] = 1] = "MostReports"; + IncidentOrder[IncidentOrder["MostFeedback"] = 2] = "MostFeedback"; + })(Incidents.IncidentOrder || (Incidents.IncidentOrder = {})); + var IncidentOrder = Incidents.IncidentOrder; + var IncidentSummaryDTO = (function () { + function IncidentSummaryDTO(id, name) { + this.Id = id; + this.Name = name; + } + IncidentSummaryDTO.TYPE_NAME = 'IncidentSummaryDTO'; + return IncidentSummaryDTO; + }()); + Incidents.IncidentSummaryDTO = IncidentSummaryDTO; + })(Incidents = Core.Incidents || (Core.Incidents = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Incidents; + (function (Incidents) { + var Queries; + (function (Queries) { + var FindIncidentResult = (function () { + function FindIncidentResult() { + } + FindIncidentResult.TYPE_NAME = 'FindIncidentResult'; + return FindIncidentResult; + }()); + Queries.FindIncidentResult = FindIncidentResult; + var FindIncidentResultItem = (function () { + function FindIncidentResultItem(id, name) { + this.Id = id; + this.Name = name; + } + FindIncidentResultItem.TYPE_NAME = 'FindIncidentResultItem'; + return FindIncidentResultItem; + }()); + Queries.FindIncidentResultItem = FindIncidentResultItem; + var FindIncidents = (function () { + function FindIncidents() { + } + FindIncidents.TYPE_NAME = 'FindIncidents'; + return FindIncidents; + }()); + Queries.FindIncidents = FindIncidents; + var GetIncident = (function () { + function GetIncident(incidentId) { + this.IncidentId = incidentId; + } + GetIncident.TYPE_NAME = 'GetIncident'; + return GetIncident; + }()); + Queries.GetIncident = GetIncident; + var GetIncidentForClosePage = (function () { + function GetIncidentForClosePage(incidentId) { + this.IncidentId = incidentId; + } + GetIncidentForClosePage.TYPE_NAME = 'GetIncidentForClosePage'; + return GetIncidentForClosePage; + }()); + Queries.GetIncidentForClosePage = GetIncidentForClosePage; + var GetIncidentForClosePageResult = (function () { + function GetIncidentForClosePageResult() { + } + GetIncidentForClosePageResult.TYPE_NAME = 'GetIncidentForClosePageResult'; + return GetIncidentForClosePageResult; + }()); + Queries.GetIncidentForClosePageResult = GetIncidentForClosePageResult; + var GetIncidentResult = (function () { + function GetIncidentResult() { + } + GetIncidentResult.TYPE_NAME = 'GetIncidentResult'; + return GetIncidentResult; + }()); + Queries.GetIncidentResult = GetIncidentResult; + var GetIncidentStatistics = (function () { + function GetIncidentStatistics() { + } + GetIncidentStatistics.TYPE_NAME = 'GetIncidentStatistics'; + return GetIncidentStatistics; + }()); + Queries.GetIncidentStatistics = GetIncidentStatistics; + var GetIncidentStatisticsResult = (function () { + function GetIncidentStatisticsResult() { + } + GetIncidentStatisticsResult.TYPE_NAME = 'GetIncidentStatisticsResult'; + return GetIncidentStatisticsResult; + }()); + Queries.GetIncidentStatisticsResult = GetIncidentStatisticsResult; + var ReportDay = (function () { + function ReportDay() { + } + ReportDay.TYPE_NAME = 'ReportDay'; + return ReportDay; + }()); + Queries.ReportDay = ReportDay; + })(Queries = Incidents.Queries || (Incidents.Queries = {})); + })(Incidents = Core.Incidents || (Core.Incidents = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Incidents; + (function (Incidents) { + var Events; + (function (Events) { + var IncidentIgnored = (function () { + function IncidentIgnored(incidentId, accountId, userName) { + this.IncidentId = incidentId; + this.AccountId = accountId; + this.UserName = userName; + } + IncidentIgnored.TYPE_NAME = 'IncidentIgnored'; + return IncidentIgnored; + }()); + Events.IncidentIgnored = IncidentIgnored; + var IncidentReOpened = (function () { + function IncidentReOpened(applicationId, incidentId, createdAtUtc) { + this.ApplicationId = applicationId; + this.IncidentId = incidentId; + this.CreatedAtUtc = createdAtUtc; + } + IncidentReOpened.TYPE_NAME = 'IncidentReOpened'; + return IncidentReOpened; + }()); + Events.IncidentReOpened = IncidentReOpened; + var ReportAddedToIncident = (function () { + function ReportAddedToIncident(incident, report, isReOpened) { + this.Incident = incident; + this.Report = report; + this.IsReOpened = isReOpened; + } + ReportAddedToIncident.TYPE_NAME = 'ReportAddedToIncident'; + return ReportAddedToIncident; + }()); + Events.ReportAddedToIncident = ReportAddedToIncident; + })(Events = Incidents.Events || (Incidents.Events = {})); + })(Incidents = Core.Incidents || (Core.Incidents = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Incidents; + (function (Incidents) { + var Commands; + (function (Commands) { + var CloseIncident = (function () { + function CloseIncident(solution, incidentId) { + this.Solution = solution; + this.IncidentId = incidentId; + } + CloseIncident.TYPE_NAME = 'CloseIncident'; + return CloseIncident; + }()); + Commands.CloseIncident = CloseIncident; + var IgnoreIncident = (function () { + function IgnoreIncident(incidentId) { + this.IncidentId = incidentId; + } + IgnoreIncident.TYPE_NAME = 'IgnoreIncident'; + return IgnoreIncident; + }()); + Commands.IgnoreIncident = IgnoreIncident; + })(Commands = Incidents.Commands || (Incidents.Commands = {})); + })(Incidents = Core.Incidents || (Core.Incidents = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Feedback; + (function (Feedback) { + var Commands; + (function (Commands) { + var SubmitFeedback = (function () { + function SubmitFeedback(errorId, remoteAddress) { + this.ErrorId = errorId; + this.RemoteAddress = remoteAddress; + } + SubmitFeedback.TYPE_NAME = 'SubmitFeedback'; + return SubmitFeedback; + }()); + Commands.SubmitFeedback = SubmitFeedback; + })(Commands = Feedback.Commands || (Feedback.Commands = {})); + })(Feedback = Core.Feedback || (Core.Feedback = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Feedback; + (function (Feedback) { + var Events; + (function (Events) { + var FeedbackAttachedToIncident = (function () { + function FeedbackAttachedToIncident() { + } + FeedbackAttachedToIncident.TYPE_NAME = 'FeedbackAttachedToIncident'; + return FeedbackAttachedToIncident; + }()); + Events.FeedbackAttachedToIncident = FeedbackAttachedToIncident; + })(Events = Feedback.Events || (Feedback.Events = {})); + })(Feedback = Core.Feedback || (Core.Feedback = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var ApiKeys; + (function (ApiKeys) { + var Queries; + (function (Queries) { + var GetApiKey = (function () { + function GetApiKey(id) { + this.Id = id; + } + GetApiKey.TYPE_NAME = 'GetApiKey'; + return GetApiKey; + }()); + Queries.GetApiKey = GetApiKey; + var GetApiKeyResult = (function () { + function GetApiKeyResult() { + } + GetApiKeyResult.TYPE_NAME = 'GetApiKeyResult'; + return GetApiKeyResult; + }()); + Queries.GetApiKeyResult = GetApiKeyResult; + var GetApiKeyResultApplication = (function () { + function GetApiKeyResultApplication() { + } + GetApiKeyResultApplication.TYPE_NAME = 'GetApiKeyResultApplication'; + return GetApiKeyResultApplication; + }()); + Queries.GetApiKeyResultApplication = GetApiKeyResultApplication; + var ListApiKeys = (function () { + function ListApiKeys() { + } + ListApiKeys.TYPE_NAME = 'ListApiKeys'; + return ListApiKeys; + }()); + Queries.ListApiKeys = ListApiKeys; + var ListApiKeysResult = (function () { + function ListApiKeysResult() { + } + ListApiKeysResult.TYPE_NAME = 'ListApiKeysResult'; + return ListApiKeysResult; + }()); + Queries.ListApiKeysResult = ListApiKeysResult; + var ListApiKeysResultItem = (function () { + function ListApiKeysResultItem() { + } + ListApiKeysResultItem.TYPE_NAME = 'ListApiKeysResultItem'; + return ListApiKeysResultItem; + }()); + Queries.ListApiKeysResultItem = ListApiKeysResultItem; + })(Queries = ApiKeys.Queries || (ApiKeys.Queries = {})); + })(ApiKeys = Core.ApiKeys || (Core.ApiKeys = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var ApiKeys; + (function (ApiKeys) { + var Events; + (function (Events) { + var ApiKeyCreated = (function () { + function ApiKeyCreated(applicationNameForTheAppUsingTheKey, apiKey, sharedSecret, applicationIds, createdById) { + this.ApplicationNameForTheAppUsingTheKey = applicationNameForTheAppUsingTheKey; + this.ApiKey = apiKey; + this.SharedSecret = sharedSecret; + this.ApplicationIds = applicationIds; + this.CreatedById = createdById; + } + ApiKeyCreated.TYPE_NAME = 'ApiKeyCreated'; + return ApiKeyCreated; + }()); + Events.ApiKeyCreated = ApiKeyCreated; + })(Events = ApiKeys.Events || (ApiKeys.Events = {})); + })(ApiKeys = Core.ApiKeys || (Core.ApiKeys = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var ApiKeys; + (function (ApiKeys) { + var Commands; + (function (Commands) { + var CreateApiKey = (function () { + function CreateApiKey(applicationName, apiKey, sharedSecret, applicationIds) { + this.ApplicationName = applicationName; + this.ApiKey = apiKey; + this.SharedSecret = sharedSecret; + this.ApplicationIds = applicationIds; + } + CreateApiKey.TYPE_NAME = 'CreateApiKey'; + return CreateApiKey; + }()); + Commands.CreateApiKey = CreateApiKey; + var DeleteApiKey = (function () { + function DeleteApiKey(id) { + this.Id = id; + } + DeleteApiKey.TYPE_NAME = 'DeleteApiKey'; + return DeleteApiKey; + }()); + Commands.DeleteApiKey = DeleteApiKey; + })(Commands = ApiKeys.Commands || (ApiKeys.Commands = {})); + })(ApiKeys = Core.ApiKeys || (Core.ApiKeys = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Applications; + (function (Applications) { + var ApplicationListItem = (function () { + function ApplicationListItem(id, name) { + this.Id = id; + this.Name = name; + } + ApplicationListItem.TYPE_NAME = 'ApplicationListItem'; + return ApplicationListItem; + }()); + Applications.ApplicationListItem = ApplicationListItem; + (function (TypeOfApplication) { + TypeOfApplication[TypeOfApplication["Mobile"] = 0] = "Mobile"; + TypeOfApplication[TypeOfApplication["DesktopApplication"] = 1] = "DesktopApplication"; + TypeOfApplication[TypeOfApplication["Server"] = 2] = "Server"; + })(Applications.TypeOfApplication || (Applications.TypeOfApplication = {})); + var TypeOfApplication = Applications.TypeOfApplication; + })(Applications = Core.Applications || (Core.Applications = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Applications; + (function (Applications) { + var Queries; + (function (Queries) { + var GetApplicationTeamResult = (function () { + function GetApplicationTeamResult() { + } + GetApplicationTeamResult.TYPE_NAME = 'GetApplicationTeamResult'; + return GetApplicationTeamResult; + }()); + Queries.GetApplicationTeamResult = GetApplicationTeamResult; + var OverviewStatSummary = (function () { + function OverviewStatSummary() { + } + OverviewStatSummary.TYPE_NAME = 'OverviewStatSummary'; + return OverviewStatSummary; + }()); + Queries.OverviewStatSummary = OverviewStatSummary; + var GetApplicationIdByKey = (function () { + function GetApplicationIdByKey(applicationKey) { + this.ApplicationKey = applicationKey; + } + GetApplicationIdByKey.TYPE_NAME = 'GetApplicationIdByKey'; + return GetApplicationIdByKey; + }()); + Queries.GetApplicationIdByKey = GetApplicationIdByKey; + var GetApplicationIdByKeyResult = (function () { + function GetApplicationIdByKeyResult() { + } + GetApplicationIdByKeyResult.TYPE_NAME = 'GetApplicationIdByKeyResult'; + return GetApplicationIdByKeyResult; + }()); + Queries.GetApplicationIdByKeyResult = GetApplicationIdByKeyResult; + var GetApplicationInfo = (function () { + function GetApplicationInfo() { + } + GetApplicationInfo.TYPE_NAME = 'GetApplicationInfo'; + return GetApplicationInfo; + }()); + Queries.GetApplicationInfo = GetApplicationInfo; + var GetApplicationInfoResult = (function () { + function GetApplicationInfoResult() { + } + GetApplicationInfoResult.TYPE_NAME = 'GetApplicationInfoResult'; + return GetApplicationInfoResult; + }()); + Queries.GetApplicationInfoResult = GetApplicationInfoResult; + var GetApplicationList = (function () { + function GetApplicationList() { + } + GetApplicationList.TYPE_NAME = 'GetApplicationList'; + return GetApplicationList; + }()); + Queries.GetApplicationList = GetApplicationList; + var GetApplicationOverviewResult = (function () { + function GetApplicationOverviewResult() { + } + GetApplicationOverviewResult.TYPE_NAME = 'GetApplicationOverviewResult'; + return GetApplicationOverviewResult; + }()); + Queries.GetApplicationOverviewResult = GetApplicationOverviewResult; + var GetApplicationTeam = (function () { + function GetApplicationTeam(applicationId) { + this.ApplicationId = applicationId; + } + GetApplicationTeam.TYPE_NAME = 'GetApplicationTeam'; + return GetApplicationTeam; + }()); + Queries.GetApplicationTeam = GetApplicationTeam; + var GetApplicationTeamMember = (function () { + function GetApplicationTeamMember() { + } + GetApplicationTeamMember.TYPE_NAME = 'GetApplicationTeamMember'; + return GetApplicationTeamMember; + }()); + Queries.GetApplicationTeamMember = GetApplicationTeamMember; + var GetApplicationTeamResultInvitation = (function () { + function GetApplicationTeamResultInvitation() { + } + GetApplicationTeamResultInvitation.TYPE_NAME = 'GetApplicationTeamResultInvitation'; + return GetApplicationTeamResultInvitation; + }()); + Queries.GetApplicationTeamResultInvitation = GetApplicationTeamResultInvitation; + var GetApplicationOverview = (function () { + function GetApplicationOverview(applicationId) { + this.ApplicationId = applicationId; + } + GetApplicationOverview.TYPE_NAME = 'GetApplicationOverview'; + return GetApplicationOverview; + }()); + Queries.GetApplicationOverview = GetApplicationOverview; + })(Queries = Applications.Queries || (Applications.Queries = {})); + })(Applications = Core.Applications || (Core.Applications = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Applications; + (function (Applications) { + var Events; + (function (Events) { + var ApplicationDeleted = (function () { + function ApplicationDeleted() { + } + ApplicationDeleted.TYPE_NAME = 'ApplicationDeleted'; + return ApplicationDeleted; + }()); + Events.ApplicationDeleted = ApplicationDeleted; + var ApplicationCreated = (function () { + function ApplicationCreated(id, name, createdById, appKey, sharedSecret) { + this.CreatedById = createdById; + this.AppKey = appKey; + this.SharedSecret = sharedSecret; + } + ApplicationCreated.TYPE_NAME = 'ApplicationCreated'; + return ApplicationCreated; + }()); + Events.ApplicationCreated = ApplicationCreated; + var UserInvitedToApplication = (function () { + function UserInvitedToApplication(invitationKey, applicationId, applicationName, emailAddress, invitedBy) { + this.InvitationKey = invitationKey; + this.ApplicationId = applicationId; + this.ApplicationName = applicationName; + this.EmailAddress = emailAddress; + this.InvitedBy = invitedBy; + } + UserInvitedToApplication.TYPE_NAME = 'UserInvitedToApplication'; + return UserInvitedToApplication; + }()); + Events.UserInvitedToApplication = UserInvitedToApplication; + })(Events = Applications.Events || (Applications.Events = {})); + })(Applications = Core.Applications || (Core.Applications = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError_1) { + var Core; + (function (Core_1) { + var Applications; + (function (Applications) { + var Events; + (function (Events_1) { + var OneTrueError; + (function (OneTrueError) { + var Api; + (function (Api) { + var Core; + (function (Core) { + var Accounts; + (function (Accounts) { + var Events; + (function (Events) { + var UserAddedToApplication = (function () { + function UserAddedToApplication(applicationId, accountId) { + this.ApplicationId = applicationId; + this.AccountId = accountId; + } + UserAddedToApplication.TYPE_NAME = 'UserAddedToApplication'; + return UserAddedToApplication; + }()); + Events.UserAddedToApplication = UserAddedToApplication; + })(Events = Accounts.Events || (Accounts.Events = {})); + })(Accounts = Core.Accounts || (Core.Accounts = {})); + })(Core = Api.Core || (Api.Core = {})); + })(Api = OneTrueError.Api || (OneTrueError.Api = {})); + })(OneTrueError = Events_1.OneTrueError || (Events_1.OneTrueError = {})); + })(Events = Applications.Events || (Applications.Events = {})); + })(Applications = Core_1.Applications || (Core_1.Applications = {})); + })(Core = OneTrueError_1.Core || (OneTrueError_1.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Applications; + (function (Applications) { + var Commands; + (function (Commands) { + var RemoveTeamMember = (function () { + function RemoveTeamMember(applicationId, userToRemove) { + this.ApplicationId = applicationId; + this.UserToRemove = userToRemove; + } + RemoveTeamMember.TYPE_NAME = 'RemoveTeamMember'; + return RemoveTeamMember; + }()); + Commands.RemoveTeamMember = RemoveTeamMember; + var UpdateApplication = (function () { + function UpdateApplication(applicationId, name) { + this.ApplicationId = applicationId; + this.Name = name; + } + UpdateApplication.TYPE_NAME = 'UpdateApplication'; + return UpdateApplication; + }()); + Commands.UpdateApplication = UpdateApplication; + var CreateApplication = (function () { + function CreateApplication(name, typeOfApplication) { + this.Name = name; + this.TypeOfApplication = typeOfApplication; + } + CreateApplication.TYPE_NAME = 'CreateApplication'; + return CreateApplication; + }()); + Commands.CreateApplication = CreateApplication; + var DeleteApplication = (function () { + function DeleteApplication(id) { + this.Id = id; + } + DeleteApplication.TYPE_NAME = 'DeleteApplication'; + return DeleteApplication; + }()); + Commands.DeleteApplication = DeleteApplication; + })(Commands = Applications.Commands || (Applications.Commands = {})); + })(Applications = Core.Applications || (Core.Applications = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Accounts; + (function (Accounts) { + var RegisterSimple = (function () { + function RegisterSimple(emailAddress) { + this.EmailAddress = emailAddress; + } + RegisterSimple.TYPE_NAME = 'RegisterSimple'; + return RegisterSimple; + }()); + Accounts.RegisterSimple = RegisterSimple; + })(Accounts = Core.Accounts || (Core.Accounts = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Accounts; + (function (Accounts) { + var Requests; + (function (Requests) { + var AcceptInvitation = (function () { + function AcceptInvitation(userName, password, invitationKey) { + this.UserName = userName; + this.Password = password; + this.InvitationKey = invitationKey; + } + AcceptInvitation.TYPE_NAME = 'AcceptInvitation'; + return AcceptInvitation; + }()); + Requests.AcceptInvitation = AcceptInvitation; + var AcceptInvitationReply = (function () { + function AcceptInvitationReply(accountId, userName) { + this.AccountId = accountId; + this.UserName = userName; + } + AcceptInvitationReply.TYPE_NAME = 'AcceptInvitationReply'; + return AcceptInvitationReply; + }()); + Requests.AcceptInvitationReply = AcceptInvitationReply; + var ActivateAccount = (function () { + function ActivateAccount(activationKey) { + this.ActivationKey = activationKey; + } + ActivateAccount.TYPE_NAME = 'ActivateAccount'; + return ActivateAccount; + }()); + Requests.ActivateAccount = ActivateAccount; + var ActivateAccountReply = (function () { + function ActivateAccountReply(accountId, userName) { + this.AccountId = accountId; + this.UserName = userName; + } + ActivateAccountReply.TYPE_NAME = 'ActivateAccountReply'; + return ActivateAccountReply; + }()); + Requests.ActivateAccountReply = ActivateAccountReply; + var ChangePassword = (function () { + function ChangePassword(currentPassword, newPassword) { + this.CurrentPassword = currentPassword; + this.NewPassword = newPassword; + } + ChangePassword.TYPE_NAME = 'ChangePassword'; + return ChangePassword; + }()); + Requests.ChangePassword = ChangePassword; + var ChangePasswordReply = (function () { + function ChangePasswordReply() { + } + ChangePasswordReply.TYPE_NAME = 'ChangePasswordReply'; + return ChangePasswordReply; + }()); + Requests.ChangePasswordReply = ChangePasswordReply; + var IgnoreFieldAttribute = (function () { + function IgnoreFieldAttribute() { + } + IgnoreFieldAttribute.TYPE_NAME = 'IgnoreFieldAttribute'; + return IgnoreFieldAttribute; + }()); + Requests.IgnoreFieldAttribute = IgnoreFieldAttribute; + var Login = (function () { + function Login(userName, password) { + this.UserName = userName; + this.Password = password; + } + Login.TYPE_NAME = 'Login'; + return Login; + }()); + Requests.Login = Login; + var LoginReply = (function () { + function LoginReply() { + } + LoginReply.TYPE_NAME = 'LoginReply'; + return LoginReply; + }()); + Requests.LoginReply = LoginReply; + (function (LoginResult) { + LoginResult[LoginResult["Locked"] = 0] = "Locked"; + LoginResult[LoginResult["IncorrectLogin"] = 1] = "IncorrectLogin"; + LoginResult[LoginResult["Successful"] = 2] = "Successful"; + })(Requests.LoginResult || (Requests.LoginResult = {})); + var LoginResult = Requests.LoginResult; + var ResetPassword = (function () { + function ResetPassword(activationKey, newPassword) { + this.ActivationKey = activationKey; + this.NewPassword = newPassword; + } + ResetPassword.TYPE_NAME = 'ResetPassword'; + return ResetPassword; + }()); + Requests.ResetPassword = ResetPassword; + var ResetPasswordReply = (function () { + function ResetPasswordReply() { + } + ResetPasswordReply.TYPE_NAME = 'ResetPasswordReply'; + return ResetPasswordReply; + }()); + Requests.ResetPasswordReply = ResetPasswordReply; + var ValidateNewLogin = (function () { + function ValidateNewLogin() { + } + ValidateNewLogin.TYPE_NAME = 'ValidateNewLogin'; + return ValidateNewLogin; + }()); + Requests.ValidateNewLogin = ValidateNewLogin; + var ValidateNewLoginReply = (function () { + function ValidateNewLoginReply() { + } + ValidateNewLoginReply.TYPE_NAME = 'ValidateNewLoginReply'; + return ValidateNewLoginReply; + }()); + Requests.ValidateNewLoginReply = ValidateNewLoginReply; + })(Requests = Accounts.Requests || (Accounts.Requests = {})); + })(Accounts = Core.Accounts || (Core.Accounts = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Accounts; + (function (Accounts) { + var Queries; + (function (Queries) { + var AccountDTO = (function () { + function AccountDTO() { + } + AccountDTO.TYPE_NAME = 'AccountDTO'; + return AccountDTO; + }()); + Queries.AccountDTO = AccountDTO; + (function (AccountState) { + AccountState[AccountState["VerificationRequired"] = 0] = "VerificationRequired"; + AccountState[AccountState["Active"] = 1] = "Active"; + AccountState[AccountState["Locked"] = 2] = "Locked"; + AccountState[AccountState["ResetPassword"] = 3] = "ResetPassword"; + })(Queries.AccountState || (Queries.AccountState = {})); + var AccountState = Queries.AccountState; + var FindAccountByUserName = (function () { + function FindAccountByUserName(userName) { + this.UserName = userName; + } + FindAccountByUserName.TYPE_NAME = 'FindAccountByUserName'; + return FindAccountByUserName; + }()); + Queries.FindAccountByUserName = FindAccountByUserName; + var GetAccountById = (function () { + function GetAccountById(accountId) { + this.AccountId = accountId; + } + GetAccountById.TYPE_NAME = 'GetAccountById'; + return GetAccountById; + }()); + Queries.GetAccountById = GetAccountById; + var GetAccountEmailById = (function () { + function GetAccountEmailById(accountId) { + this.AccountId = accountId; + } + GetAccountEmailById.TYPE_NAME = 'GetAccountEmailById'; + return GetAccountEmailById; + }()); + Queries.GetAccountEmailById = GetAccountEmailById; + var FindAccountByUserNameResult = (function () { + function FindAccountByUserNameResult(accountId, displayName) { + this.AccountId = accountId; + this.DisplayName = displayName; + } + FindAccountByUserNameResult.TYPE_NAME = 'FindAccountByUserNameResult'; + return FindAccountByUserNameResult; + }()); + Queries.FindAccountByUserNameResult = FindAccountByUserNameResult; + })(Queries = Accounts.Queries || (Accounts.Queries = {})); + })(Accounts = Core.Accounts || (Core.Accounts = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Accounts; + (function (Accounts) { + var Events; + (function (Events) { + var AccountActivated = (function () { + function AccountActivated(accountId, userName) { + this.AccountId = accountId; + this.UserName = userName; + } + AccountActivated.TYPE_NAME = 'AccountActivated'; + return AccountActivated; + }()); + Events.AccountActivated = AccountActivated; + var AccountRegistered = (function () { + function AccountRegistered(accountId, userName) { + this.AccountId = accountId; + this.UserName = userName; + } + AccountRegistered.TYPE_NAME = 'AccountRegistered'; + return AccountRegistered; + }()); + Events.AccountRegistered = AccountRegistered; + var InvitationAccepted = (function () { + function InvitationAccepted(accountId, invitedByUserName, userName) { + this.AccountId = accountId; + this.InvitedByUserName = invitedByUserName; + this.UserName = userName; + } + InvitationAccepted.TYPE_NAME = 'InvitationAccepted'; + return InvitationAccepted; + }()); + Events.InvitationAccepted = InvitationAccepted; + var LoginFailed = (function () { + function LoginFailed(userName) { + this.UserName = userName; + } + LoginFailed.TYPE_NAME = 'LoginFailed'; + return LoginFailed; + }()); + Events.LoginFailed = LoginFailed; + })(Events = Accounts.Events || (Accounts.Events = {})); + })(Accounts = Core.Accounts || (Core.Accounts = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Core; + (function (Core) { + var Accounts; + (function (Accounts) { + var Commands; + (function (Commands) { + var DeclineInvitation = (function () { + function DeclineInvitation(invitationId) { + this.InvitationId = invitationId; + } + DeclineInvitation.TYPE_NAME = 'DeclineInvitation'; + return DeclineInvitation; + }()); + Commands.DeclineInvitation = DeclineInvitation; + var RegisterAccount = (function () { + function RegisterAccount(userName, password, email) { + this.UserName = userName; + this.Password = password; + this.Email = email; + } + RegisterAccount.TYPE_NAME = 'RegisterAccount'; + return RegisterAccount; + }()); + Commands.RegisterAccount = RegisterAccount; + var RequestPasswordReset = (function () { + function RequestPasswordReset(emailAddress) { + this.EmailAddress = emailAddress; + } + RequestPasswordReset.TYPE_NAME = 'RequestPasswordReset'; + return RequestPasswordReset; + }()); + Commands.RequestPasswordReset = RequestPasswordReset; + })(Commands = Accounts.Commands || (Accounts.Commands = {})); + })(Accounts = Core.Accounts || (Core.Accounts = {})); + })(Core = OneTrueError.Core || (OneTrueError.Core = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=AllModels.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/Scripts/Promise.js b/src/Server/OneTrueError.Web/Scripts/Promise.js index eccab8dc..139bdd85 100644 --- a/src/Server/OneTrueError.Web/Scripts/Promise.js +++ b/src/Server/OneTrueError.Web/Scripts/Promise.js @@ -1,330 +1,330 @@ -/** - Module P: Generic Promises for TypeScript - - Project, documentation, and license: https://github.com/pragmatrix/Promise -*/ -var P; -(function (P) { - /** - Returns a new "Deferred" value that may be resolved or rejected. - */ - function defer() { - return new DeferredI(); - } - P.defer = defer; - /** - Converts a value to a resolved promise. - */ - function resolve(v) { - return defer().resolve(v).promise(); - } - P.resolve = resolve; - /** - Returns a rejected promise. - */ - function reject(err) { - return defer().reject(err).promise(); - } - P.reject = reject; - /** - http://en.wikipedia.org/wiki/Anamorphism - - Given a seed value, unfold calls the unspool function, waits for the returned promise to be resolved, and then - calls it again if a next seed value was returned. - - All the values of all promise results are collected into the resulting promise which is resolved as soon - the last generated element value is resolved. - */ - function unfold(unspool, seed) { - var d = defer(); - var elements = new Array(); - unfoldCore(elements, d, unspool, seed); - return d.promise(); - } - P.unfold = unfold; - function unfoldCore(elements, deferred, unspool, seed) { - var result = unspool(seed); - if (!result) { - deferred.resolve(elements); - return; - } - // fastpath: don't waste stack space if promise resolves immediately. - while (result.next && result.promise.status == Status.Resolved) { - elements.push(result.promise.result); - result = unspool(result.next); - if (!result) { - deferred.resolve(elements); - return; - } - } - result.promise - .done(function (v) { - elements.push(v); - if (!result.next) - deferred.resolve(elements); - else - unfoldCore(elements, deferred, unspool, result.next); - }) - .fail(function (e) { - deferred.reject(e); - }); - } - /** - The status of a Promise. Initially a Promise is Unfulfilled and may - change to Rejected or Resolved. - - Once a promise is either Rejected or Resolved, it can not change its - status anymore. - */ - (function (Status) { - Status[Status["Unfulfilled"] = 0] = "Unfulfilled"; - Status[Status["Rejected"] = 1] = "Rejected"; - Status[Status["Resolved"] = 2] = "Resolved"; - })(P.Status || (P.Status = {})); - var Status = P.Status; - /** - Creates a promise that gets resolved when all the promises in the argument list get resolved. - As soon one of the arguments gets rejected, the resulting promise gets rejected. - If no promises were provided, the resulting promise is immediately resolved. - */ - function when() { - var promises = []; - for (var _i = 0; _i < arguments.length; _i++) { - promises[_i - 0] = arguments[_i]; - } - var allDone = defer(); - if (!promises.length) { - allDone.resolve([]); - return allDone.promise(); - } - var resolved = 0; - var results = []; - promises.forEach(function (p, i) { - p - .done(function (v) { - results[i] = v; - ++resolved; - if (resolved === promises.length && allDone.status !== Status.Rejected) - allDone.resolve(results); - }) - .fail(function (e) { - if (allDone.status !== Status.Rejected) - allDone.reject(new Error("when: one or more promises were rejected")); - }); - }); - return allDone.promise(); - } - P.when = when; - /** - Implementation of a promise. - - The Promise instance is a proxy to the Deferred instance. - */ - var PromiseI = (function () { - function PromiseI(deferred) { - this.deferred = deferred; - } - Object.defineProperty(PromiseI.prototype, "status", { - get: function () { return this.deferred.status; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(PromiseI.prototype, "result", { - get: function () { return this.deferred.result; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(PromiseI.prototype, "error", { - get: function () { return this.deferred.error; }, - enumerable: true, - configurable: true - }); - PromiseI.prototype.done = function (f) { - this.deferred.done(f); - return this; - }; - PromiseI.prototype.fail = function (f) { - this.deferred.fail(f); - return this; - }; - PromiseI.prototype.always = function (f) { - this.deferred.always(f); - return this; - }; - PromiseI.prototype.then = function (f) { - return this.deferred.then(f); - }; - return PromiseI; - }()); - /** - Implementation of a deferred. - */ - var DeferredI = (function () { - function DeferredI() { - this._resolved = function (_) { }; - this._rejected = function (_) { }; - this._status = Status.Unfulfilled; - this._error = { message: "" }; - this._promise = new PromiseI(this); - } - DeferredI.prototype.promise = function () { - return this._promise; - }; - Object.defineProperty(DeferredI.prototype, "status", { - get: function () { - return this._status; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DeferredI.prototype, "result", { - get: function () { - if (this._status != Status.Resolved) - throw new Error("Promise: result not available"); - return this._result; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DeferredI.prototype, "error", { - get: function () { - if (this._status != Status.Rejected) - throw new Error("Promise: rejection reason not available"); - return this._error; - }, - enumerable: true, - configurable: true - }); - DeferredI.prototype.then = function (f) { - var d = defer(); - this - .done(function (v) { - var promiseOrValue = f(v); - // todo: need to find another way to check if r is really of interface - // type Promise, otherwise we would not support other - // implementations here. - if (promiseOrValue instanceof PromiseI) { - var p = promiseOrValue; - p.done(function (v2) { return d.resolve(v2); }) - .fail(function (err) { return d.reject(err); }); - return p; - } - d.resolve(promiseOrValue); - }) - .fail(function (err) { return d.reject(err); }); - return d.promise(); - }; - DeferredI.prototype.done = function (f) { - if (this.status === Status.Resolved) { - f(this._result); - return this; - } - if (this.status !== Status.Unfulfilled) - return this; - var prev = this._resolved; - this._resolved = function (v) { - prev(v); - f(v); - }; - return this; - }; - DeferredI.prototype.fail = function (f) { - if (this.status === Status.Rejected) { - f(this._error); - return this; - } - if (this.status !== Status.Unfulfilled) - return this; - var prev = this._rejected; - this._rejected = function (e) { - prev(e); - f(e); - }; - return this; - }; - DeferredI.prototype.always = function (f) { - this - .done(function (v) { return f(v); }) - .fail(function (err) { return f(null, err); }); - return this; - }; - DeferredI.prototype.resolve = function (result) { - if (this._status !== Status.Unfulfilled) - throw new Error("tried to resolve a fulfilled promise"); - this._result = result; - this._status = Status.Resolved; - this._resolved(result); - this.detach(); - return this; - }; - DeferredI.prototype.reject = function (err) { - if (this._status !== Status.Unfulfilled) - throw new Error("tried to reject a fulfilled promise"); - this._error = err; - this._status = Status.Rejected; - this._rejected(err); - this.detach(); - return this; - }; - DeferredI.prototype.detach = function () { - this._resolved = function (_) { }; - this._rejected = function (_) { }; - }; - return DeferredI; - }()); - function generator(g) { - return function () { return iterator(g()); }; - } - P.generator = generator; - ; - function iterator(f) { - return new IteratorI(f); - } - P.iterator = iterator; - var IteratorI = (function () { - function IteratorI(f) { - this.f = f; - this.current = undefined; - } - IteratorI.prototype.advance = function () { - var _this = this; - var res = this.f(); - return res.then(function (value) { - if (isUndefined(value)) - return false; - _this.current = value; - return true; - }); - }; - return IteratorI; - }()); - /** - Iterator functions. - */ - function each(gen, f) { - var d = defer(); - eachCore(d, gen(), f); - return d.promise(); - } - P.each = each; - function eachCore(fin, it, f) { - it.advance() - .done(function (hasValue) { - if (!hasValue) { - fin.resolve({}); - return; - } - f(it.current); - eachCore(fin, it, f); - }) - .fail(function (err) { return fin.reject(err); }); - } - /** - std - */ - function isUndefined(v) { - return typeof v === "undefined"; - } - P.isUndefined = isUndefined; -})(P || (P = {})); +/** + Module P: Generic Promises for TypeScript + + Project, documentation, and license: https://github.com/pragmatrix/Promise +*/ +var P; +(function (P) { + /** + Returns a new "Deferred" value that may be resolved or rejected. + */ + function defer() { + return new DeferredI(); + } + P.defer = defer; + /** + Converts a value to a resolved promise. + */ + function resolve(v) { + return defer().resolve(v).promise(); + } + P.resolve = resolve; + /** + Returns a rejected promise. + */ + function reject(err) { + return defer().reject(err).promise(); + } + P.reject = reject; + /** + http://en.wikipedia.org/wiki/Anamorphism + + Given a seed value, unfold calls the unspool function, waits for the returned promise to be resolved, and then + calls it again if a next seed value was returned. + + All the values of all promise results are collected into the resulting promise which is resolved as soon + the last generated element value is resolved. + */ + function unfold(unspool, seed) { + var d = defer(); + var elements = new Array(); + unfoldCore(elements, d, unspool, seed); + return d.promise(); + } + P.unfold = unfold; + function unfoldCore(elements, deferred, unspool, seed) { + var result = unspool(seed); + if (!result) { + deferred.resolve(elements); + return; + } + // fastpath: don't waste stack space if promise resolves immediately. + while (result.next && result.promise.status == Status.Resolved) { + elements.push(result.promise.result); + result = unspool(result.next); + if (!result) { + deferred.resolve(elements); + return; + } + } + result.promise + .done(function (v) { + elements.push(v); + if (!result.next) + deferred.resolve(elements); + else + unfoldCore(elements, deferred, unspool, result.next); + }) + .fail(function (e) { + deferred.reject(e); + }); + } + /** + The status of a Promise. Initially a Promise is Unfulfilled and may + change to Rejected or Resolved. + + Once a promise is either Rejected or Resolved, it can not change its + status anymore. + */ + (function (Status) { + Status[Status["Unfulfilled"] = 0] = "Unfulfilled"; + Status[Status["Rejected"] = 1] = "Rejected"; + Status[Status["Resolved"] = 2] = "Resolved"; + })(P.Status || (P.Status = {})); + var Status = P.Status; + /** + Creates a promise that gets resolved when all the promises in the argument list get resolved. + As soon one of the arguments gets rejected, the resulting promise gets rejected. + If no promises were provided, the resulting promise is immediately resolved. + */ + function when() { + var promises = []; + for (var _i = 0; _i < arguments.length; _i++) { + promises[_i - 0] = arguments[_i]; + } + var allDone = defer(); + if (!promises.length) { + allDone.resolve([]); + return allDone.promise(); + } + var resolved = 0; + var results = []; + promises.forEach(function (p, i) { + p + .done(function (v) { + results[i] = v; + ++resolved; + if (resolved === promises.length && allDone.status !== Status.Rejected) + allDone.resolve(results); + }) + .fail(function (e) { + if (allDone.status !== Status.Rejected) + allDone.reject(new Error("when: one or more promises were rejected")); + }); + }); + return allDone.promise(); + } + P.when = when; + /** + Implementation of a promise. + + The Promise instance is a proxy to the Deferred instance. + */ + var PromiseI = (function () { + function PromiseI(deferred) { + this.deferred = deferred; + } + Object.defineProperty(PromiseI.prototype, "status", { + get: function () { return this.deferred.status; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PromiseI.prototype, "result", { + get: function () { return this.deferred.result; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PromiseI.prototype, "error", { + get: function () { return this.deferred.error; }, + enumerable: true, + configurable: true + }); + PromiseI.prototype.done = function (f) { + this.deferred.done(f); + return this; + }; + PromiseI.prototype.fail = function (f) { + this.deferred.fail(f); + return this; + }; + PromiseI.prototype.always = function (f) { + this.deferred.always(f); + return this; + }; + PromiseI.prototype.then = function (f) { + return this.deferred.then(f); + }; + return PromiseI; + }()); + /** + Implementation of a deferred. + */ + var DeferredI = (function () { + function DeferredI() { + this._resolved = function (_) { }; + this._rejected = function (_) { }; + this._status = Status.Unfulfilled; + this._error = { message: "" }; + this._promise = new PromiseI(this); + } + DeferredI.prototype.promise = function () { + return this._promise; + }; + Object.defineProperty(DeferredI.prototype, "status", { + get: function () { + return this._status; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DeferredI.prototype, "result", { + get: function () { + if (this._status != Status.Resolved) + throw new Error("Promise: result not available"); + return this._result; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DeferredI.prototype, "error", { + get: function () { + if (this._status != Status.Rejected) + throw new Error("Promise: rejection reason not available"); + return this._error; + }, + enumerable: true, + configurable: true + }); + DeferredI.prototype.then = function (f) { + var d = defer(); + this + .done(function (v) { + var promiseOrValue = f(v); + // todo: need to find another way to check if r is really of interface + // type Promise, otherwise we would not support other + // implementations here. + if (promiseOrValue instanceof PromiseI) { + var p = promiseOrValue; + p.done(function (v2) { return d.resolve(v2); }) + .fail(function (err) { return d.reject(err); }); + return p; + } + d.resolve(promiseOrValue); + }) + .fail(function (err) { return d.reject(err); }); + return d.promise(); + }; + DeferredI.prototype.done = function (f) { + if (this.status === Status.Resolved) { + f(this._result); + return this; + } + if (this.status !== Status.Unfulfilled) + return this; + var prev = this._resolved; + this._resolved = function (v) { + prev(v); + f(v); + }; + return this; + }; + DeferredI.prototype.fail = function (f) { + if (this.status === Status.Rejected) { + f(this._error); + return this; + } + if (this.status !== Status.Unfulfilled) + return this; + var prev = this._rejected; + this._rejected = function (e) { + prev(e); + f(e); + }; + return this; + }; + DeferredI.prototype.always = function (f) { + this + .done(function (v) { return f(v); }) + .fail(function (err) { return f(null, err); }); + return this; + }; + DeferredI.prototype.resolve = function (result) { + if (this._status !== Status.Unfulfilled) + throw new Error("tried to resolve a fulfilled promise"); + this._result = result; + this._status = Status.Resolved; + this._resolved(result); + this.detach(); + return this; + }; + DeferredI.prototype.reject = function (err) { + if (this._status !== Status.Unfulfilled) + throw new Error("tried to reject a fulfilled promise"); + this._error = err; + this._status = Status.Rejected; + this._rejected(err); + this.detach(); + return this; + }; + DeferredI.prototype.detach = function () { + this._resolved = function (_) { }; + this._rejected = function (_) { }; + }; + return DeferredI; + }()); + function generator(g) { + return function () { return iterator(g()); }; + } + P.generator = generator; + ; + function iterator(f) { + return new IteratorI(f); + } + P.iterator = iterator; + var IteratorI = (function () { + function IteratorI(f) { + this.f = f; + this.current = undefined; + } + IteratorI.prototype.advance = function () { + var _this = this; + var res = this.f(); + return res.then(function (value) { + if (isUndefined(value)) + return false; + _this.current = value; + return true; + }); + }; + return IteratorI; + }()); + /** + Iterator functions. + */ + function each(gen, f) { + var d = defer(); + eachCore(d, gen(), f); + return d.promise(); + } + P.each = each; + function eachCore(fin, it, f) { + it.advance() + .done(function (hasValue) { + if (!hasValue) { + fin.resolve({}); + return; + } + f(it.current); + eachCore(fin, it, f); + }) + .fail(function (err) { return fin.reject(err); }); + } + /** + std + */ + function isUndefined(v) { + return typeof v === "undefined"; + } + P.isUndefined = isUndefined; +})(P || (P = {})); //# sourceMappingURL=Promise.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Account/AcceptedViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Account/AcceptedViewModel.js index c49efb15..893acba9 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Account/AcceptedViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Account/AcceptedViewModel.js @@ -1,18 +1,18 @@ -var OneTrueError; -(function (OneTrueError) { - var Account; - (function (Account) { - var AcceptedViewModel = (function () { - function AcceptedViewModel() { - } - AcceptedViewModel.prototype.getTitle = function () { return "Invitation accepted"; }; - AcceptedViewModel.prototype.activate = function (context) { - context.resolve(); - }; - AcceptedViewModel.prototype.deactivate = function () { }; - return AcceptedViewModel; - }()); - Account.AcceptedViewModel = AcceptedViewModel; - })(Account = OneTrueError.Account || (OneTrueError.Account = {})); -})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Account; + (function (Account) { + var AcceptedViewModel = (function () { + function AcceptedViewModel() { + } + AcceptedViewModel.prototype.getTitle = function () { return "Invitation accepted"; }; + AcceptedViewModel.prototype.activate = function (context) { + context.resolve(); + }; + AcceptedViewModel.prototype.deactivate = function () { }; + return AcceptedViewModel; + }()); + Account.AcceptedViewModel = AcceptedViewModel; + })(Account = OneTrueError.Account || (OneTrueError.Account = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=AcceptedViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Account/SettingsViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Account/SettingsViewModel.js index 9d42aa49..6e91d644 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Account/SettingsViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Account/SettingsViewModel.js @@ -1,57 +1,57 @@ -/// -var OneTrueError; -(function (OneTrueError) { - var Account; - (function (Account) { - var CqsClient = Griffin.Cqs.CqsClient; - var GetUserSettings = OneTrueError.Core.Users.Queries.GetUserSettings; - var ChangePassword = OneTrueError.Core.Accounts.Requests.ChangePassword; - var AccountSettings = (function () { - function AccountSettings() { - this.notifyNewIncident = true; - } - return AccountSettings; - }()); - Account.AccountSettings = AccountSettings; - var SettingsViewModel = (function () { - function SettingsViewModel() { - } - SettingsViewModel.load = function () { - var def = P.defer(); - var query = new GetUserSettings(); - CqsClient.query(query) - .done(function (response) { - var vm = new SettingsViewModel(); - def.resolve(vm); - }); - return def.promise(); - }; - SettingsViewModel.prototype.saveSettings = function () { - var mapping = { - 'ignore': ["saveSettings"] - }; - }; - SettingsViewModel.prototype.changePassword = function () { - var json = { - currentPassword: $("#CurrentPassword").val(), - newPassword: $("#NewPassword").val() - }; - if (json.newPassword != $("#NewPassword2").val()) { - alert("The new password fields do not match."); - return; - } - var newPw = $("#NewPassword2").val(); - var oldPw = $("#CurrentPassword").val(); - var pw = new ChangePassword(newPw, oldPw); - CqsClient.command(pw) - .done(function (value) { - }) - .fail(function (err) { - }); - }; - return SettingsViewModel; - }()); - Account.SettingsViewModel = SettingsViewModel; - })(Account = OneTrueError.Account || (OneTrueError.Account = {})); -})(OneTrueError || (OneTrueError = {})); +/// +var OneTrueError; +(function (OneTrueError) { + var Account; + (function (Account) { + var CqsClient = Griffin.Cqs.CqsClient; + var GetUserSettings = OneTrueError.Core.Users.Queries.GetUserSettings; + var ChangePassword = OneTrueError.Core.Accounts.Requests.ChangePassword; + var AccountSettings = (function () { + function AccountSettings() { + this.notifyNewIncident = true; + } + return AccountSettings; + }()); + Account.AccountSettings = AccountSettings; + var SettingsViewModel = (function () { + function SettingsViewModel() { + } + SettingsViewModel.load = function () { + var def = P.defer(); + var query = new GetUserSettings(); + CqsClient.query(query) + .done(function (response) { + var vm = new SettingsViewModel(); + def.resolve(vm); + }); + return def.promise(); + }; + SettingsViewModel.prototype.saveSettings = function () { + var mapping = { + 'ignore': ["saveSettings"] + }; + }; + SettingsViewModel.prototype.changePassword = function () { + var json = { + currentPassword: $("#CurrentPassword").val(), + newPassword: $("#NewPassword").val() + }; + if (json.newPassword != $("#NewPassword2").val()) { + alert("The new password fields do not match."); + return; + } + var newPw = $("#NewPassword2").val(); + var oldPw = $("#CurrentPassword").val(); + var pw = new ChangePassword(newPw, oldPw); + CqsClient.command(pw) + .done(function (value) { + }) + .fail(function (err) { + }); + }; + return SettingsViewModel; + }()); + Account.SettingsViewModel = SettingsViewModel; + })(Account = OneTrueError.Account || (OneTrueError.Account = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=SettingsViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Account/WelcomeViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Account/WelcomeViewModel.js index a20a28d8..340fd992 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Account/WelcomeViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Account/WelcomeViewModel.js @@ -1,18 +1,18 @@ -var OneTrueError; -(function (OneTrueError) { - var Account; - (function (Account) { - var WelcomeViewModel = (function () { - function WelcomeViewModel() { - } - WelcomeViewModel.prototype.getTitle = function () { return "Welcome"; }; - WelcomeViewModel.prototype.activate = function (context) { - context.resolve(); - }; - WelcomeViewModel.prototype.deactivate = function () { }; - return WelcomeViewModel; - }()); - Account.WelcomeViewModel = WelcomeViewModel; - })(Account = OneTrueError.Account || (OneTrueError.Account = {})); -})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Account; + (function (Account) { + var WelcomeViewModel = (function () { + function WelcomeViewModel() { + } + WelcomeViewModel.prototype.getTitle = function () { return "Welcome"; }; + WelcomeViewModel.prototype.activate = function (context) { + context.resolve(); + }; + WelcomeViewModel.prototype.deactivate = function () { }; + return WelcomeViewModel; + }()); + Account.WelcomeViewModel = WelcomeViewModel; + })(Account = OneTrueError.Account || (OneTrueError.Account = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=WelcomeViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Application/DetailsViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Application/DetailsViewModel.js index fed77356..6ba5087f 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Application/DetailsViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Application/DetailsViewModel.js @@ -1,300 +1,300 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Application; - (function (Application) { - var CqsClient = Griffin.Cqs.CqsClient; - var IncidentOrder = OneTrueError.Core.Incidents.IncidentOrder; - var FindIncidents = OneTrueError.Core.Incidents.Queries.FindIncidents; - var Yo = Griffin.Yo; - var DetailsViewModel = (function () { - function DetailsViewModel() { - this.freeText = ''; - this._sortType = IncidentOrder.Newest; - this._sortAscending = false; - this._incidentType = "active"; - } - DetailsViewModel.prototype.getTitle = function () { - $("#appTitle").text(this.applicationName); - return this.applicationName; - }; - DetailsViewModel.prototype.activate = function (ctx) { - var _this = this; - this._ctx = ctx; - this.applicationId = ctx.routeData["applicationId"]; - this.pager = new Griffin.WebApp.Pager(0, 0, 0); - this.pager.subscribe(this); - this.pager.draw(ctx.select.one("#pager")); - var self = this; - var firstIsRun = false; - var chartResult = null; - var chartRendering = function (result) { - //chart must be rendered after the element being attached and visible. - ctx.resolve(); - self.lineChart = new OneTrueError.LineChart(ctx.select.one("#myChart")); - self.renderChart(result); - }; - var appQuery = new OneTrueError.Core.Applications.Queries.GetApplicationInfo(); - appQuery.ApplicationId = ctx.routeData["applicationId"]; - CqsClient.query(appQuery) - .done(function (info) { - Yo.GlobalConfig.applicationScope["application"] = info; - _this.applicationName = info.Name; - if (chartResult != null) { - chartRendering(chartResult); - } - firstIsRun = true; - _this.renderInfo(info); - }); - var query = new OneTrueError.Core.Applications.Queries.GetApplicationOverview(this.applicationId); - CqsClient.query(query) - .done(function (response) { - if (!firstIsRun) { - chartResult = response; - } - else { - chartRendering(response); - } - }); - this.getIncidentsFromServer(1); - ctx.handle.click("#btnClosed", function (e) { return _this.onBtnClosed(e); }); - ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); - ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); - ctx.handle.click("#LastReportCol", function (e) { return _this.onLastReportCol(e); }); - ctx.handle.click("#CountCol", function (e) { return _this.onCountCol(e); }); - ctx.handle.change('[name="range"]', function (e) { return _this.onRange(e); }); - ctx.handle.keyUp('[data-name="freeText"]', function (e) { return _this.onFreeText(e); }); - }; - DetailsViewModel.prototype.deactivate = function () { - }; - DetailsViewModel.prototype.onRange = function (e) { - var _this = this; - var elem = e.target; - var days = parseInt(elem.value, 10); - var query = new OneTrueError.Core.Applications.Queries.GetApplicationOverview(this.applicationId); - query.NumberOfDays = days; - CqsClient.query(query) - .done(function (response) { - _this.renderChart(response); - }); - }; - DetailsViewModel.prototype.onFreeText = function (e) { - var el = (e.target); - if (el.value.length >= 3) { - this.freeText = el.value; - this.getIncidentsFromServer(this.pager.currentPage); - } - else if (el.value === '') { - this.freeText = el.value; - this.getIncidentsFromServer(this.pager.currentPage); - } - else { - this.freeText = el.value; - } - }; - DetailsViewModel.prototype.onBtnActive = function (e) { - e.preventDefault(); - this._incidentType = "active"; - this.pager.reset(); - this.getIncidentsFromServer(-1); - }; - DetailsViewModel.prototype.onBtnClosed = function (e) { - e.preventDefault(); - this._incidentType = "closed"; - this.pager.reset(); - this.getIncidentsFromServer(-1); - }; - DetailsViewModel.prototype.onBtnIgnored = function (e) { - e.preventDefault(); - this._incidentType = "ignored"; - this.pager.reset(); - this.getIncidentsFromServer(-1); - }; - DetailsViewModel.prototype.onPager = function (pager) { - this.getIncidentsFromServer(pager.currentPage); - var table = this._ctx.select.one("#incidentTable"); - //.scrollIntoView(true); - var y = this.findYPosition(table); - window.scrollTo(null, y - 50); //navbar - }; - DetailsViewModel.prototype.findYPosition = function (element) { - if (element.offsetParent) { - var curtop = 0; - do { - curtop += element.offsetTop; - element = (element.offsetParent); - } while (element); - return curtop; - } - }; - DetailsViewModel.prototype.onCountCol = function (args) { - if (this._sortType !== IncidentOrder.MostReports) { - this._sortType = IncidentOrder.MostReports; - this._sortAscending = true; //will be changed below - } - this.updateSortingUI(args.target); - this.getIncidentsFromServer(this.pager.currentPage); - }; - DetailsViewModel.prototype.onLastReportCol = function (args) { - if (this._sortType !== IncidentOrder.Newest) { - this._sortType = IncidentOrder.Newest; - this._sortAscending = true; //will be changed below - } - this.updateSortingUI(args.target); - this.getIncidentsFromServer(this.pager.currentPage); - }; - DetailsViewModel.prototype.renderTable = function (pageNumber, data) { - var directives = { - Items: { - IncidentName: { - text: function (data) { - return data; - }, - href: function (data, dto) { - return "#/application/" + dto.ApplicationId + "/incident/" + dto.Id; - } - }, - CreatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - LastUpdateAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - ApplicationName: { - text: function (value) { - return value; - }, - href: function (value, dto) { - return "#/application/" + dto.ApplicationId; - } - } - } - }; - //workaround for root dto name rendering over our collection name - data.Items.forEach(function (item) { - item.IncidentName = item.Name; - }); - this._ctx.renderPartial("#incidentTable", data, directives); - }; - DetailsViewModel.prototype.renderInfo = function (dto) { - var directives = { - CreatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - UpdatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - SolvedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - } - }; - dto["StatSummary"] = { - AppKey: dto.AppKey, - SharedSecret: dto.SharedSecret - }; - this._ctx.render(dto, directives); - }; - DetailsViewModel.prototype.updateSortingUI = function (parentElement) { - this._sortAscending = !this._sortAscending; - var icon = DetailsViewModel.UP; - if (!this._sortAscending) { - icon = DetailsViewModel.DOWN; - } - $("#ApplicationView thead th span") - .removeClass("glyphicon-chevron-down") - .addClass("glyphicon " + icon) - .css("visibility", "hidden"); - $("span", parentElement) - .attr("class", "glyphicon " + icon) - .css("visibility", "inherit"); - }; - DetailsViewModel.prototype.getIncidentsFromServer = function (pageNumber) { - var _this = this; - if (pageNumber === -1) { - pageNumber = this.pager.currentPage; - } - var query = new FindIncidents(); - query.SortType = this._sortType; - query.SortAscending = this._sortAscending; - query.PageNumber = pageNumber; - query.ItemsPerPage = 10; - query.ApplicationId = this.applicationId; - query.FreeText = this.freeText; - if (this._incidentType === "closed") { - query.Closed = true; - query.Open = false; - } - else if (this._incidentType === "ignored") { - query.Closed = false; - query.Open = false; - query.ReOpened = false; - query.Ignored = true; - } - CqsClient.query(query) - .done(function (response) { - if (_this.pager.pageCount === 0) { - _this.pager.update(response.PageNumber, response.PageSize, response.TotalCount); - } - _this.renderTable(pageNumber, response); - }); - }; - DetailsViewModel.prototype.renderChart = function (result) { - var legend = [ - { - color: OneTrueError.LineChart.LineThemes[0].strokeColor, - label: "Incidents" - }, { - color: OneTrueError.LineChart.LineThemes[1].strokeColor, - label: "Reports" - } - ]; - var incidentsDataset = new OneTrueError.Dataset(); - incidentsDataset.label = "Incidents"; - incidentsDataset.data = result.Incidents; - var reportDataset = new OneTrueError.Dataset(); - reportDataset.label = "Reports"; - reportDataset.data = result.ErrorReports; - var directives = { - color: { - text: function () { - return ""; - }, - style: function (value, dto) { - return "display: inline; font-weight: bold; color: " + dto.color; - } - }, - label: { - style: function (value, dto) { - return "font-weight: bold; color: " + dto.color; - } - } - }; - this._ctx.renderPartial("#chart-legend", legend, directives); - //$('#chart-legend').render(legend, directives); - var data = new OneTrueError.LineData(); - data.datasets = [incidentsDataset, reportDataset]; - data.labels = result.TimeAxisLabels; - this.lineChart.render(data); - this._ctx.renderPartial('[data-name="StatSummary"]', result.StatSummary); - }; - DetailsViewModel.UP = "glyphicon-chevron-up"; - DetailsViewModel.DOWN = "glyphicon-chevron-down"; - return DetailsViewModel; - }()); - Application.DetailsViewModel = DetailsViewModel; - })(Application = OneTrueError.Application || (OneTrueError.Application = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Application; + (function (Application) { + var CqsClient = Griffin.Cqs.CqsClient; + var IncidentOrder = OneTrueError.Core.Incidents.IncidentOrder; + var FindIncidents = OneTrueError.Core.Incidents.Queries.FindIncidents; + var Yo = Griffin.Yo; + var DetailsViewModel = (function () { + function DetailsViewModel() { + this.freeText = ''; + this._sortType = IncidentOrder.Newest; + this._sortAscending = false; + this._incidentType = "active"; + } + DetailsViewModel.prototype.getTitle = function () { + $("#appTitle").text(this.applicationName); + return this.applicationName; + }; + DetailsViewModel.prototype.activate = function (ctx) { + var _this = this; + this._ctx = ctx; + this.applicationId = ctx.routeData["applicationId"]; + this.pager = new Griffin.WebApp.Pager(0, 0, 0); + this.pager.subscribe(this); + this.pager.draw(ctx.select.one("#pager")); + var self = this; + var firstIsRun = false; + var chartResult = null; + var chartRendering = function (result) { + //chart must be rendered after the element being attached and visible. + ctx.resolve(); + self.lineChart = new OneTrueError.LineChart(ctx.select.one("#myChart")); + self.renderChart(result); + }; + var appQuery = new OneTrueError.Core.Applications.Queries.GetApplicationInfo(); + appQuery.ApplicationId = ctx.routeData["applicationId"]; + CqsClient.query(appQuery) + .done(function (info) { + Yo.GlobalConfig.applicationScope["application"] = info; + _this.applicationName = info.Name; + if (chartResult != null) { + chartRendering(chartResult); + } + firstIsRun = true; + _this.renderInfo(info); + }); + var query = new OneTrueError.Core.Applications.Queries.GetApplicationOverview(this.applicationId); + CqsClient.query(query) + .done(function (response) { + if (!firstIsRun) { + chartResult = response; + } + else { + chartRendering(response); + } + }); + this.getIncidentsFromServer(1); + ctx.handle.click("#btnClosed", function (e) { return _this.onBtnClosed(e); }); + ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); + ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); + ctx.handle.click("#LastReportCol", function (e) { return _this.onLastReportCol(e); }); + ctx.handle.click("#CountCol", function (e) { return _this.onCountCol(e); }); + ctx.handle.change('[name="range"]', function (e) { return _this.onRange(e); }); + ctx.handle.keyUp('[data-name="freeText"]', function (e) { return _this.onFreeText(e); }); + }; + DetailsViewModel.prototype.deactivate = function () { + }; + DetailsViewModel.prototype.onRange = function (e) { + var _this = this; + var elem = e.target; + var days = parseInt(elem.value, 10); + var query = new OneTrueError.Core.Applications.Queries.GetApplicationOverview(this.applicationId); + query.NumberOfDays = days; + CqsClient.query(query) + .done(function (response) { + _this.renderChart(response); + }); + }; + DetailsViewModel.prototype.onFreeText = function (e) { + var el = (e.target); + if (el.value.length >= 3) { + this.freeText = el.value; + this.getIncidentsFromServer(this.pager.currentPage); + } + else if (el.value === '') { + this.freeText = el.value; + this.getIncidentsFromServer(this.pager.currentPage); + } + else { + this.freeText = el.value; + } + }; + DetailsViewModel.prototype.onBtnActive = function (e) { + e.preventDefault(); + this._incidentType = "active"; + this.pager.reset(); + this.getIncidentsFromServer(-1); + }; + DetailsViewModel.prototype.onBtnClosed = function (e) { + e.preventDefault(); + this._incidentType = "closed"; + this.pager.reset(); + this.getIncidentsFromServer(-1); + }; + DetailsViewModel.prototype.onBtnIgnored = function (e) { + e.preventDefault(); + this._incidentType = "ignored"; + this.pager.reset(); + this.getIncidentsFromServer(-1); + }; + DetailsViewModel.prototype.onPager = function (pager) { + this.getIncidentsFromServer(pager.currentPage); + var table = this._ctx.select.one("#incidentTable"); + //.scrollIntoView(true); + var y = this.findYPosition(table); + window.scrollTo(null, y - 50); //navbar + }; + DetailsViewModel.prototype.findYPosition = function (element) { + if (element.offsetParent) { + var curtop = 0; + do { + curtop += element.offsetTop; + element = (element.offsetParent); + } while (element); + return curtop; + } + }; + DetailsViewModel.prototype.onCountCol = function (args) { + if (this._sortType !== IncidentOrder.MostReports) { + this._sortType = IncidentOrder.MostReports; + this._sortAscending = true; //will be changed below + } + this.updateSortingUI(args.target); + this.getIncidentsFromServer(this.pager.currentPage); + }; + DetailsViewModel.prototype.onLastReportCol = function (args) { + if (this._sortType !== IncidentOrder.Newest) { + this._sortType = IncidentOrder.Newest; + this._sortAscending = true; //will be changed below + } + this.updateSortingUI(args.target); + this.getIncidentsFromServer(this.pager.currentPage); + }; + DetailsViewModel.prototype.renderTable = function (pageNumber, data) { + var directives = { + Items: { + IncidentName: { + text: function (data) { + return data; + }, + href: function (data, dto) { + return "#/application/" + dto.ApplicationId + "/incident/" + dto.Id; + } + }, + CreatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + LastUpdateAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + ApplicationName: { + text: function (value) { + return value; + }, + href: function (value, dto) { + return "#/application/" + dto.ApplicationId; + } + } + } + }; + //workaround for root dto name rendering over our collection name + data.Items.forEach(function (item) { + item.IncidentName = item.Name; + }); + this._ctx.renderPartial("#incidentTable", data, directives); + }; + DetailsViewModel.prototype.renderInfo = function (dto) { + var directives = { + CreatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + UpdatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + SolvedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + } + }; + dto["StatSummary"] = { + AppKey: dto.AppKey, + SharedSecret: dto.SharedSecret + }; + this._ctx.render(dto, directives); + }; + DetailsViewModel.prototype.updateSortingUI = function (parentElement) { + this._sortAscending = !this._sortAscending; + var icon = DetailsViewModel.UP; + if (!this._sortAscending) { + icon = DetailsViewModel.DOWN; + } + $("#ApplicationView thead th span") + .removeClass("glyphicon-chevron-down") + .addClass("glyphicon " + icon) + .css("visibility", "hidden"); + $("span", parentElement) + .attr("class", "glyphicon " + icon) + .css("visibility", "inherit"); + }; + DetailsViewModel.prototype.getIncidentsFromServer = function (pageNumber) { + var _this = this; + if (pageNumber === -1) { + pageNumber = this.pager.currentPage; + } + var query = new FindIncidents(); + query.SortType = this._sortType; + query.SortAscending = this._sortAscending; + query.PageNumber = pageNumber; + query.ItemsPerPage = 10; + query.ApplicationId = this.applicationId; + query.FreeText = this.freeText; + if (this._incidentType === "closed") { + query.Closed = true; + query.Open = false; + } + else if (this._incidentType === "ignored") { + query.Closed = false; + query.Open = false; + query.ReOpened = false; + query.Ignored = true; + } + CqsClient.query(query) + .done(function (response) { + if (_this.pager.pageCount === 0) { + _this.pager.update(response.PageNumber, response.PageSize, response.TotalCount); + } + _this.renderTable(pageNumber, response); + }); + }; + DetailsViewModel.prototype.renderChart = function (result) { + var legend = [ + { + color: OneTrueError.LineChart.LineThemes[0].strokeColor, + label: "Incidents" + }, { + color: OneTrueError.LineChart.LineThemes[1].strokeColor, + label: "Reports" + } + ]; + var incidentsDataset = new OneTrueError.Dataset(); + incidentsDataset.label = "Incidents"; + incidentsDataset.data = result.Incidents; + var reportDataset = new OneTrueError.Dataset(); + reportDataset.label = "Reports"; + reportDataset.data = result.ErrorReports; + var directives = { + color: { + text: function () { + return ""; + }, + style: function (value, dto) { + return "display: inline; font-weight: bold; color: " + dto.color; + } + }, + label: { + style: function (value, dto) { + return "font-weight: bold; color: " + dto.color; + } + } + }; + this._ctx.renderPartial("#chart-legend", legend, directives); + //$('#chart-legend').render(legend, directives); + var data = new OneTrueError.LineData(); + data.datasets = [incidentsDataset, reportDataset]; + data.labels = result.TimeAxisLabels; + this.lineChart.render(data); + this._ctx.renderPartial('[data-name="StatSummary"]', result.StatSummary); + }; + DetailsViewModel.UP = "glyphicon-chevron-up"; + DetailsViewModel.DOWN = "glyphicon-chevron-down"; + return DetailsViewModel; + }()); + Application.DetailsViewModel = DetailsViewModel; + })(Application = OneTrueError.Application || (OneTrueError.Application = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=DetailsViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Application/InstallationViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Application/InstallationViewModel.js index 2e6725be..7e706313 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Application/InstallationViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Application/InstallationViewModel.js @@ -1,27 +1,27 @@ -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Application; - (function (Application) { - var InstallationViewModel = (function () { - function InstallationViewModel() { - } - InstallationViewModel.prototype.getTitle = function () { return "Installation instructions"; }; - InstallationViewModel.prototype.activate = function (context) { - var service = new OneTrueError.Applications.ApplicationService(); - service.get(context.routeData["applicationId"]) - .done(function (app) { - app.AppUrl = window["API_URL"]; - context.render(app); - $("#appTitle").text(app.Name); - context.resolve(); - }); - }; - InstallationViewModel.prototype.deactivate = function () { }; - return InstallationViewModel; - }()); - Application.InstallationViewModel = InstallationViewModel; - })(Application = OneTrueError.Application || (OneTrueError.Application = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Application; + (function (Application) { + var InstallationViewModel = (function () { + function InstallationViewModel() { + } + InstallationViewModel.prototype.getTitle = function () { return "Installation instructions"; }; + InstallationViewModel.prototype.activate = function (context) { + var service = new OneTrueError.Applications.ApplicationService(); + service.get(context.routeData["applicationId"]) + .done(function (app) { + app.AppUrl = window["API_URL"]; + context.render(app); + $("#appTitle").text(app.Name); + context.resolve(); + }); + }; + InstallationViewModel.prototype.deactivate = function () { }; + return InstallationViewModel; + }()); + Application.InstallationViewModel = InstallationViewModel; + })(Application = OneTrueError.Application || (OneTrueError.Application = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=InstallationViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Application/TeamViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Application/TeamViewModel.js index f6b5f1ef..051b37a4 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Application/TeamViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Application/TeamViewModel.js @@ -1,67 +1,67 @@ -/// -var OneTrueError; -(function (OneTrueError) { - var Application; - (function (Application) { - var CqsClient = Griffin.Cqs.CqsClient; - var RemoveTeamMember = OneTrueError.Core.Applications.Commands.RemoveTeamMember; - var TeamViewModel = (function () { - function TeamViewModel() { - } - TeamViewModel.prototype.getTitle = function () { - return "Team members"; - }; - TeamViewModel.prototype.activate = function (context) { - var _this = this; - this.context = context; - this.applicationId = parseInt(context.routeData["applicationId"], 10); - context.render({ Members: [], Invited: [] }); - var query = new OneTrueError.Core.Applications.Queries.GetApplicationTeam(this.applicationId); - CqsClient.query(query) - .done(function (result) { - context.render(result); - _this.data = result; - context.resolve(); - context.handle.click("#InviteUserBtn", function (e) { return _this.onInviteUser(e); }); - context.handle.click('[data-name="RemoveUser"]', function (e) { return _this.onBtnRemoveUser(e); }); - }); - }; - TeamViewModel.prototype.deactivate = function () { }; - TeamViewModel.prototype.onBtnRemoveUser = function (e) { - e.preventDefault(); - var node = e.target; - var input = node.previousElementSibling; - var accountId = parseInt(input.value, 10); - if (accountId === 0) - throw new Error("Failed to find accountID"); - var cmd = new RemoveTeamMember(this.applicationId, accountId); - CqsClient.command(cmd).done(function (v) { - var parent = node.parentElement; - while (parent.tagName != 'TR') { - parent = parent.parentElement; - } - parent.parentElement.removeChild(parent); - humane.log('User was removed'); - }); - }; - TeamViewModel.prototype.onInviteUser = function (mouseEvent) { - mouseEvent.preventDefault(); - var inputElement = this.context.select.one("emailAddress"); - var email = inputElement.value; - var el = this.context.select.one("reason"); - var reason = el.value; - var cmd = new OneTrueError.Core.Invitations.Commands.InviteUser(this.applicationId, email); - cmd.Text = reason; - CqsClient.command(cmd); - var newItem = new OneTrueError.Core.Applications.Queries.GetApplicationTeamResultInvitation(); - newItem.EmailAddress = email; - this.data.Invited.push(newItem); - this.context.render(this.data); - inputElement.value = ""; - }; - return TeamViewModel; - }()); - Application.TeamViewModel = TeamViewModel; - })(Application = OneTrueError.Application || (OneTrueError.Application = {})); -})(OneTrueError || (OneTrueError = {})); +/// +var OneTrueError; +(function (OneTrueError) { + var Application; + (function (Application) { + var CqsClient = Griffin.Cqs.CqsClient; + var RemoveTeamMember = OneTrueError.Core.Applications.Commands.RemoveTeamMember; + var TeamViewModel = (function () { + function TeamViewModel() { + } + TeamViewModel.prototype.getTitle = function () { + return "Team members"; + }; + TeamViewModel.prototype.activate = function (context) { + var _this = this; + this.context = context; + this.applicationId = parseInt(context.routeData["applicationId"], 10); + context.render({ Members: [], Invited: [] }); + var query = new OneTrueError.Core.Applications.Queries.GetApplicationTeam(this.applicationId); + CqsClient.query(query) + .done(function (result) { + context.render(result); + _this.data = result; + context.resolve(); + context.handle.click("#InviteUserBtn", function (e) { return _this.onInviteUser(e); }); + context.handle.click('[data-name="RemoveUser"]', function (e) { return _this.onBtnRemoveUser(e); }); + }); + }; + TeamViewModel.prototype.deactivate = function () { }; + TeamViewModel.prototype.onBtnRemoveUser = function (e) { + e.preventDefault(); + var node = e.target; + var input = node.previousElementSibling; + var accountId = parseInt(input.value, 10); + if (accountId === 0) + throw new Error("Failed to find accountID"); + var cmd = new RemoveTeamMember(this.applicationId, accountId); + CqsClient.command(cmd).done(function (v) { + var parent = node.parentElement; + while (parent.tagName != 'TR') { + parent = parent.parentElement; + } + parent.parentElement.removeChild(parent); + humane.log('User was removed'); + }); + }; + TeamViewModel.prototype.onInviteUser = function (mouseEvent) { + mouseEvent.preventDefault(); + var inputElement = this.context.select.one("emailAddress"); + var email = inputElement.value; + var el = this.context.select.one("reason"); + var reason = el.value; + var cmd = new OneTrueError.Core.Invitations.Commands.InviteUser(this.applicationId, email); + cmd.Text = reason; + CqsClient.command(cmd); + var newItem = new OneTrueError.Core.Applications.Queries.GetApplicationTeamResultInvitation(); + newItem.EmailAddress = email; + this.data.Invited.push(newItem); + this.context.render(this.data); + inputElement.value = ""; + }; + return TeamViewModel; + }()); + Application.TeamViewModel = TeamViewModel; + })(Application = OneTrueError.Application || (OneTrueError.Application = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=TeamViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/ChartViewModel.js b/src/Server/OneTrueError.Web/ViewModels/ChartViewModel.js index ef75f077..30dc28ce 100644 --- a/src/Server/OneTrueError.Web/ViewModels/ChartViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/ChartViewModel.js @@ -1,169 +1,169 @@ -var OneTrueError; -(function (OneTrueError) { - ; - var Dataset = (function () { - function Dataset() { - } - return Dataset; - }()); - OneTrueError.Dataset = Dataset; - ; - var LineData = (function () { - function LineData() { - } - return LineData; - }()); - OneTrueError.LineData = LineData; - var LineChart = (function () { - function LineChart(targetElementOrId) { - this.chart = null; - this.lineChart = null; - this.initChartGlobals(); - if (typeof targetElementOrId === "string") { - var elem = document.getElementById(targetElementOrId); - if (!elem) - throw new Error("Failed to find " + targetElementOrId); - this.ctx = elem.getContext("2d"); - } - else { - if (!targetElementOrId) - throw new Error("Is not a HTMLElement: " + targetElementOrId); - this.ctx = targetElementOrId.getContext("2d"); - } - this.chart = new Chart(this.ctx); - } - LineChart.prototype.mergeOptions = function (obj1, obj2) { - for (var p in obj2) { - try { - // Property in destination object set; update its value. - if (obj2[p].constructor == Object) { - obj1[p] = this.mergeOptions(obj1[p], obj2[p]); - } - else { - obj1[p] = obj2[p]; - } - } - catch (e) { - // Property in destination object not set; create it and set its value. - obj1[p] = obj2[p]; - } - } - return obj1; - }; - LineChart.prototype.render = function (data) { - if (this.lineChart !== null) - this.lineChart.destroy(); - if (data.datasets.length) { - } - for (var j = 0; j < data.datasets.length; j++) { - data.datasets[j] = this.mergeOptions(data.datasets[j], LineChart.LineThemes[j]); - } - var allEmpty; - data.datasets.forEach(function (dataset) { - dataset.data.forEach(function (item) { - if (item !== 0) { - allEmpty = false; - return; - } - }); - }); - //if (allEmpty || data.datasets.length === 0) { - // this.ctx.font = "20px Arial"; - // this.ctx.fillStyle = 'white'; - // this.ctx.fillText("No reports have been received during the specified period.", 10, 50); - // return; - //} - this.lineChart = this.chart.Line(data, Chart.DefaultOptions); - }; - LineChart.prototype.initChartGlobals = function () { - Chart.defaults.global.scaleLineColor = "#eee"; - Chart.defaults.global.scaleFontColor = "#eee"; - Chart.defaults.global.responsive = true; - Chart.DefaultOptions = { - ///Boolean - Whether grid lines are shown across the chart - scaleShowGridLines: true, - //String - Colour of the grid lines - scaleGridLineColor: "rgba(255,255,255,.05)", - //Number - Width of the grid lines - scaleGridLineWidth: 1, - //Boolean - Whether to show horizontal lines (except X axis) - scaleShowHorizontalLines: true, - //Boolean - Whether to show vertical lines (except Y axis) - scaleShowVerticalLines: false, - //Boolean - Whether the line is curved between points - bezierCurve: true, - //Number - Tension of the bezier curve between points - bezierCurveTension: 0.2, - //Boolean - Whether to show a dot for each point - pointDot: true, - //Number - Radius of each point dot in pixels - pointDotRadius: 4, - //Number - Pixel width of point dot stroke - pointDotStrokeWidth: 1, - //Number - amount extra to add to the radius to cater for hit detection outside the drawn point - pointHitDetectionRadius: 20, - //Boolean - Whether to show a stroke for datasets - datasetStroke: true, - //Number - Pixel width of dataset stroke - datasetStrokeWidth: 2, - //Boolean - Whether to fill the dataset with a colour - datasetFill: false, - //String - A legend template - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
" - }; - }; - LineChart.LineThemes = [ - { - fillColor: "rgba(245,254,22,0.2)", - strokeColor: "#ffda70", - pointColor: "#ffda70", - pointStrokeColor: "#ffda70", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(255,255,255,0.5)" - }, - { - fillColor: "rgba(221,19,165,0.2)", - strokeColor: "#ff9570", - pointColor: "#ff9570", - pointStrokeColor: "#ff9570", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(255,255,255,0.5)" - }, - { - fillColor: "rgba(255,82,22,0.2)", - strokeColor: "#ff5216", - pointColor: "#ff5216", - pointStrokeColor: "#ff5216", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(255,255,255,0.5)" - }, - { - fillColor: "rgba(255,152,22,0.2)", - strokeColor: "#ffc216", - pointColor: "#ffc216", - pointStrokeColor: "#ffc216", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(255,255,255,0.5)", - }, - { - fillColor: "rgba(255,187,22,0.2)", - strokeColor: "#ff9816", - pointColor: "#ff9816", - pointStrokeColor: "#ff9816", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(255,255,255,0.5)", - }, - { - fillColor: "rgba(255,82,22,0.2)", - strokeColor: "#ff5216", - pointColor: "#ff5216", - pointStrokeColor: "#ff5216", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(255,255,255,0.5)", - } - ]; - return LineChart; - }()); - OneTrueError.LineChart = LineChart; -})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + ; + var Dataset = (function () { + function Dataset() { + } + return Dataset; + }()); + OneTrueError.Dataset = Dataset; + ; + var LineData = (function () { + function LineData() { + } + return LineData; + }()); + OneTrueError.LineData = LineData; + var LineChart = (function () { + function LineChart(targetElementOrId) { + this.chart = null; + this.lineChart = null; + this.initChartGlobals(); + if (typeof targetElementOrId === "string") { + var elem = document.getElementById(targetElementOrId); + if (!elem) + throw new Error("Failed to find " + targetElementOrId); + this.ctx = elem.getContext("2d"); + } + else { + if (!targetElementOrId) + throw new Error("Is not a HTMLElement: " + targetElementOrId); + this.ctx = targetElementOrId.getContext("2d"); + } + this.chart = new Chart(this.ctx); + } + LineChart.prototype.mergeOptions = function (obj1, obj2) { + for (var p in obj2) { + try { + // Property in destination object set; update its value. + if (obj2[p].constructor == Object) { + obj1[p] = this.mergeOptions(obj1[p], obj2[p]); + } + else { + obj1[p] = obj2[p]; + } + } + catch (e) { + // Property in destination object not set; create it and set its value. + obj1[p] = obj2[p]; + } + } + return obj1; + }; + LineChart.prototype.render = function (data) { + if (this.lineChart !== null) + this.lineChart.destroy(); + if (data.datasets.length) { + } + for (var j = 0; j < data.datasets.length; j++) { + data.datasets[j] = this.mergeOptions(data.datasets[j], LineChart.LineThemes[j]); + } + var allEmpty; + data.datasets.forEach(function (dataset) { + dataset.data.forEach(function (item) { + if (item !== 0) { + allEmpty = false; + return; + } + }); + }); + //if (allEmpty || data.datasets.length === 0) { + // this.ctx.font = "20px Arial"; + // this.ctx.fillStyle = 'white'; + // this.ctx.fillText("No reports have been received during the specified period.", 10, 50); + // return; + //} + this.lineChart = this.chart.Line(data, Chart.DefaultOptions); + }; + LineChart.prototype.initChartGlobals = function () { + Chart.defaults.global.scaleLineColor = "#eee"; + Chart.defaults.global.scaleFontColor = "#eee"; + Chart.defaults.global.responsive = true; + Chart.DefaultOptions = { + ///Boolean - Whether grid lines are shown across the chart + scaleShowGridLines: true, + //String - Colour of the grid lines + scaleGridLineColor: "rgba(255,255,255,.05)", + //Number - Width of the grid lines + scaleGridLineWidth: 1, + //Boolean - Whether to show horizontal lines (except X axis) + scaleShowHorizontalLines: true, + //Boolean - Whether to show vertical lines (except Y axis) + scaleShowVerticalLines: false, + //Boolean - Whether the line is curved between points + bezierCurve: true, + //Number - Tension of the bezier curve between points + bezierCurveTension: 0.2, + //Boolean - Whether to show a dot for each point + pointDot: true, + //Number - Radius of each point dot in pixels + pointDotRadius: 4, + //Number - Pixel width of point dot stroke + pointDotStrokeWidth: 1, + //Number - amount extra to add to the radius to cater for hit detection outside the drawn point + pointHitDetectionRadius: 20, + //Boolean - Whether to show a stroke for datasets + datasetStroke: true, + //Number - Pixel width of dataset stroke + datasetStrokeWidth: 2, + //Boolean - Whether to fill the dataset with a colour + datasetFill: false, + //String - A legend template + legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
" + }; + }; + LineChart.LineThemes = [ + { + fillColor: "rgba(245,254,22,0.2)", + strokeColor: "#ffda70", + pointColor: "#ffda70", + pointStrokeColor: "#ffda70", + pointHighlightFill: "#fff", + pointHighlightStroke: "rgba(255,255,255,0.5)" + }, + { + fillColor: "rgba(221,19,165,0.2)", + strokeColor: "#ff9570", + pointColor: "#ff9570", + pointStrokeColor: "#ff9570", + pointHighlightFill: "#fff", + pointHighlightStroke: "rgba(255,255,255,0.5)" + }, + { + fillColor: "rgba(255,82,22,0.2)", + strokeColor: "#ff5216", + pointColor: "#ff5216", + pointStrokeColor: "#ff5216", + pointHighlightFill: "#fff", + pointHighlightStroke: "rgba(255,255,255,0.5)" + }, + { + fillColor: "rgba(255,152,22,0.2)", + strokeColor: "#ffc216", + pointColor: "#ffc216", + pointStrokeColor: "#ffc216", + pointHighlightFill: "#fff", + pointHighlightStroke: "rgba(255,255,255,0.5)", + }, + { + fillColor: "rgba(255,187,22,0.2)", + strokeColor: "#ff9816", + pointColor: "#ff9816", + pointStrokeColor: "#ff9816", + pointHighlightFill: "#fff", + pointHighlightStroke: "rgba(255,255,255,0.5)", + }, + { + fillColor: "rgba(255,82,22,0.2)", + strokeColor: "#ff5216", + pointColor: "#ff5216", + pointStrokeColor: "#ff5216", + pointHighlightFill: "#fff", + pointHighlightStroke: "rgba(255,255,255,0.5)", + } + ]; + return LineChart; + }()); + OneTrueError.LineChart = LineChart; +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=ChartViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Feedback/ApplicationViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Feedback/ApplicationViewModel.js index 4bad3753..2c494709 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Feedback/ApplicationViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Feedback/ApplicationViewModel.js @@ -1,76 +1,76 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Feedback; - (function (Feedback) { - var CqsClient = Griffin.Cqs.CqsClient; - var Yo = Griffin.Yo; - var ApplicationViewModel = (function () { - function ApplicationViewModel() { - this.RenderDirectives = { - Items: { - Message: { - html: function (value) { - return nl2br(value); - } - }, - Title: { - style: function () { - return "color:#ccc"; - }, - html: function (value, dto) { - return "Reported for " + dto.ApplicationName + " at " + new Date(dto.WrittenAtUtc).toLocaleString(); - } - }, - EmailAddressVisible: { - style: function (value, dto) { - if (!dto.EmailAddress || dto.EmailAddress === "") { - return "display:none"; - } - return ""; - } - }, - EmailAddress: { - text: function (value) { - return value; - }, - href: function (value) { - return "mailto:" + value; - }, - style: function () { - return "color: #ee99ee"; - } - } - } - }; - } - ApplicationViewModel.prototype.getTitle = function () { - var app = Yo.GlobalConfig - .applicationScope["application"]; - if (app) { - return app.Name; - } - return "Feedback"; - }; - ApplicationViewModel.prototype.activate = function (context) { - var _this = this; - this.context = context; - var query = new OneTrueError.Web.Feedback.Queries.GetFeedbackForApplicationPage(context.routeData["applicationId"]); - CqsClient.query(query) - .done(function (result) { - _this.dto = result; - context.render(result, _this.RenderDirectives); - context.resolve(); - }); - }; - ApplicationViewModel.prototype.deactivate = function () { - }; - return ApplicationViewModel; - }()); - Feedback.ApplicationViewModel = ApplicationViewModel; - })(Feedback = OneTrueError.Feedback || (OneTrueError.Feedback = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Feedback; + (function (Feedback) { + var CqsClient = Griffin.Cqs.CqsClient; + var Yo = Griffin.Yo; + var ApplicationViewModel = (function () { + function ApplicationViewModel() { + this.RenderDirectives = { + Items: { + Message: { + html: function (value) { + return nl2br(value); + } + }, + Title: { + style: function () { + return "color:#ccc"; + }, + html: function (value, dto) { + return "Reported for " + dto.ApplicationName + " at " + new Date(dto.WrittenAtUtc).toLocaleString(); + } + }, + EmailAddressVisible: { + style: function (value, dto) { + if (!dto.EmailAddress || dto.EmailAddress === "") { + return "display:none"; + } + return ""; + } + }, + EmailAddress: { + text: function (value) { + return value; + }, + href: function (value) { + return "mailto:" + value; + }, + style: function () { + return "color: #ee99ee"; + } + } + } + }; + } + ApplicationViewModel.prototype.getTitle = function () { + var app = Yo.GlobalConfig + .applicationScope["application"]; + if (app) { + return app.Name; + } + return "Feedback"; + }; + ApplicationViewModel.prototype.activate = function (context) { + var _this = this; + this.context = context; + var query = new OneTrueError.Web.Feedback.Queries.GetFeedbackForApplicationPage(context.routeData["applicationId"]); + CqsClient.query(query) + .done(function (result) { + _this.dto = result; + context.render(result, _this.RenderDirectives); + context.resolve(); + }); + }; + ApplicationViewModel.prototype.deactivate = function () { + }; + return ApplicationViewModel; + }()); + Feedback.ApplicationViewModel = ApplicationViewModel; + })(Feedback = OneTrueError.Feedback || (OneTrueError.Feedback = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=ApplicationViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Feedback/IncidentViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Feedback/IncidentViewModel.js index 9e6a9c9e..159e58ee 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Feedback/IncidentViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Feedback/IncidentViewModel.js @@ -1,65 +1,65 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Feedback; - (function (Feedback) { - var CqsClient = Griffin.Cqs.CqsClient; - var GetIncidentFeedback = OneTrueError.Web.Feedback.Queries.GetIncidentFeedback; - var IncidentViewModel = (function () { - function IncidentViewModel() { - } - IncidentViewModel.prototype.activate = function (ctx) { - var _this = this; - this.ctx = ctx; - var query = new GetIncidentFeedback(ctx.routeData["incidentId"]); - CqsClient.query(query) - .done(function (result) { - _this.ctx.render(result, IncidentViewModel.directives); - ctx.resolve(); - }); - }; - IncidentViewModel.prototype.deactivate = function () { - }; - IncidentViewModel.prototype.getTitle = function () { - return "Incident"; - }; - IncidentViewModel.directives = { - Items: { - Message: { - html: function (value) { - return nl2br(value); - } - }, - Title: { - style: function () { - return "color:#ccc"; - }, - html: function (value, dto) { - return "Written at " + new Date(dto.WrittenAtUtc).toLocaleString(); - } - }, - EmailAddress: { - text: function (value) { - return value; - }, - href: function (value) { - return "mailto:" + value; - }, - style: function (value) { - if (!value) { - return "display:none"; - } - return "color: #ee99ee"; - } - } - } - }; - return IncidentViewModel; - }()); - Feedback.IncidentViewModel = IncidentViewModel; - })(Feedback = OneTrueError.Feedback || (OneTrueError.Feedback = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Feedback; + (function (Feedback) { + var CqsClient = Griffin.Cqs.CqsClient; + var GetIncidentFeedback = OneTrueError.Web.Feedback.Queries.GetIncidentFeedback; + var IncidentViewModel = (function () { + function IncidentViewModel() { + } + IncidentViewModel.prototype.activate = function (ctx) { + var _this = this; + this.ctx = ctx; + var query = new GetIncidentFeedback(ctx.routeData["incidentId"]); + CqsClient.query(query) + .done(function (result) { + _this.ctx.render(result, IncidentViewModel.directives); + ctx.resolve(); + }); + }; + IncidentViewModel.prototype.deactivate = function () { + }; + IncidentViewModel.prototype.getTitle = function () { + return "Incident"; + }; + IncidentViewModel.directives = { + Items: { + Message: { + html: function (value) { + return nl2br(value); + } + }, + Title: { + style: function () { + return "color:#ccc"; + }, + html: function (value, dto) { + return "Written at " + new Date(dto.WrittenAtUtc).toLocaleString(); + } + }, + EmailAddress: { + text: function (value) { + return value; + }, + href: function (value) { + return "mailto:" + value; + }, + style: function (value) { + if (!value) { + return "display:none"; + } + return "color: #ee99ee"; + } + } + } + }; + return IncidentViewModel; + }()); + Feedback.IncidentViewModel = IncidentViewModel; + })(Feedback = OneTrueError.Feedback || (OneTrueError.Feedback = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=IncidentViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Feedback/OverviewViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Feedback/OverviewViewModel.js index b7a8d86a..14af4727 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Feedback/OverviewViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Feedback/OverviewViewModel.js @@ -1,71 +1,71 @@ -/// -/// -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Feedback; - (function (Feedback) { - var CqsClient = Griffin.Cqs.CqsClient; - var OverviewFeedback = OneTrueError.Web.Feedback.Queries.GetFeedbackForDashboardPage; - //import Yo = Griffin.Yo; - var OverviewViewModel = (function () { - function OverviewViewModel() { - this.feedbackDirectives = { - Items: { - Message: { - html: function (value) { - return nl2br(value); - } - }, - Title: { - style: function () { - return "color:#ccc"; - }, - html: function (value, dto) { - return "Reported for " + dto.ApplicationName + " at " + new Date(dto.WrittenAtUtc).toLocaleString(); - } - }, - EmailAddress: { - text: function (value) { - return value; - }, - href: function (value) { - return "mailto:" + value; - }, - style: function (value) { - if (!value) { - return "display:none"; - } - return "color: #ee99ee"; - } - } - } - }; - } - OverviewViewModel.prototype.getTitle = function () { - return "All feedback"; - }; - OverviewViewModel.prototype.isEmpty = function () { - return this.empty; - }; - OverviewViewModel.prototype.activate = function (context) { - var _this = this; - var query = new OverviewFeedback(); - CqsClient.query(query) - .done(function (result) { - _this.empty = result.TotalCount === 0; - context.render(result, _this.feedbackDirectives); - context.resolve(); - }); - }; - OverviewViewModel.prototype.deactivate = function () { - }; - return OverviewViewModel; - }()); - Feedback.OverviewViewModel = OverviewViewModel; - })(Feedback = OneTrueError.Feedback || (OneTrueError.Feedback = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Feedback; + (function (Feedback) { + var CqsClient = Griffin.Cqs.CqsClient; + var OverviewFeedback = OneTrueError.Web.Feedback.Queries.GetFeedbackForDashboardPage; + //import Yo = Griffin.Yo; + var OverviewViewModel = (function () { + function OverviewViewModel() { + this.feedbackDirectives = { + Items: { + Message: { + html: function (value) { + return nl2br(value); + } + }, + Title: { + style: function () { + return "color:#ccc"; + }, + html: function (value, dto) { + return "Reported for " + dto.ApplicationName + " at " + new Date(dto.WrittenAtUtc).toLocaleString(); + } + }, + EmailAddress: { + text: function (value) { + return value; + }, + href: function (value) { + return "mailto:" + value; + }, + style: function (value) { + if (!value) { + return "display:none"; + } + return "color: #ee99ee"; + } + } + } + }; + } + OverviewViewModel.prototype.getTitle = function () { + return "All feedback"; + }; + OverviewViewModel.prototype.isEmpty = function () { + return this.empty; + }; + OverviewViewModel.prototype.activate = function (context) { + var _this = this; + var query = new OverviewFeedback(); + CqsClient.query(query) + .done(function (result) { + _this.empty = result.TotalCount === 0; + context.render(result, _this.feedbackDirectives); + context.resolve(); + }); + }; + OverviewViewModel.prototype.deactivate = function () { + }; + return OverviewViewModel; + }()); + Feedback.OverviewViewModel = OverviewViewModel; + })(Feedback = OneTrueError.Feedback || (OneTrueError.Feedback = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=OverviewViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Home/WelcomeViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Home/WelcomeViewModel.js index 6398a718..b73257ab 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Home/WelcomeViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Home/WelcomeViewModel.js @@ -1,18 +1,18 @@ -var OneTrueError; -(function (OneTrueError) { - var Home; - (function (Home) { - var WelcomeViewModel = (function () { - function WelcomeViewModel() { - } - WelcomeViewModel.prototype.getTitle = function () { return "Welcome"; }; - WelcomeViewModel.prototype.activate = function (context) { - context.resolve(); - }; - WelcomeViewModel.prototype.deactivate = function () { }; - return WelcomeViewModel; - }()); - Home.WelcomeViewModel = WelcomeViewModel; - })(Home = OneTrueError.Home || (OneTrueError.Home = {})); -})(OneTrueError || (OneTrueError = {})); +var OneTrueError; +(function (OneTrueError) { + var Home; + (function (Home) { + var WelcomeViewModel = (function () { + function WelcomeViewModel() { + } + WelcomeViewModel.prototype.getTitle = function () { return "Welcome"; }; + WelcomeViewModel.prototype.activate = function (context) { + context.resolve(); + }; + WelcomeViewModel.prototype.deactivate = function () { }; + return WelcomeViewModel; + }()); + Home.WelcomeViewModel = WelcomeViewModel; + })(Home = OneTrueError.Home || (OneTrueError.Home = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=WelcomeViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Incident/CloseViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Incident/CloseViewModel.js index 00d00c11..6a339cdd 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Incident/CloseViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Incident/CloseViewModel.js @@ -1,73 +1,73 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Incident; - (function (Incident) { - var CqsClient = Griffin.Cqs.CqsClient; - var ApplicationService = OneTrueError.Applications.ApplicationService; - var GetIncident = OneTrueError.Core.Incidents.Queries.GetIncident; - var CloseIncident = OneTrueError.Core.Incidents.Commands.CloseIncident; - var CloseViewModel = (function () { - function CloseViewModel() { - } - CloseViewModel.prototype.getTitle = function () { - return "Close incident"; - }; - CloseViewModel.prototype.activate = function (context) { - var _this = this; - this.context = context; - this.incidentId = parseInt(context.routeData["incidentId"]); - var query = new GetIncident(parseInt(context.routeData["incidentId"], 10)); - var incidentPromise = CqsClient.query(query); - incidentPromise.done(function (result) { return context.render(result); }); - var service = new ApplicationService(); - var appPromise = service.get(context.routeData["applicationId"]); - appPromise.done(function (result) { - _this.app = result; - }); - P.when(incidentPromise, appPromise) - .then(function (result) { - context.resolve(); - }); - context.handle.click("#saveSolution", function (evt) { return _this.onCloseIncident(); }); - context.handle.click('[name="sendCustomerMessage"]', function (evt) { return _this.onToggleMessagePane(); }); - }; - CloseViewModel.prototype.deactivate = function () { }; - CloseViewModel.prototype.onToggleMessagePane = function () { - var panel = this.context.select.one("#status-panel"); - if (panel.style.display === "none") { - panel.style.display = ""; - } - else { - panel.style.display = "none"; - } - }; - CloseViewModel.prototype.onCloseIncident = function () { - var solution = this.context.select.one('[name="solution"]'); - var closeCmd = new CloseIncident(solution.value, this.incidentId); - var sendMessage = this.context.select.one("sendCustomerMessage"); - console.log(sendMessage); - if (sendMessage.checked) { - var subject = this.context.select.one('[name="UserSubject"]'); - var text = this.context.select.one('[name="UserText"]'); - if (subject.value.length === 0 || text.value.length === 0) { - alert("You specified that you wanted to send a notification to your users, but you have not specified subject or body of the message."); - return; - } - closeCmd.NotificationText = text.value; - closeCmd.CanSendNotification = true; - closeCmd.NotificationTitle = subject.value; - } - CqsClient.command(closeCmd); - window.location.hash = "#/application/" + this.context.routeData["applicationId"]; - humane.log("Incident has been closed."); - }; - return CloseViewModel; - }()); - Incident.CloseViewModel = CloseViewModel; - })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Incident; + (function (Incident) { + var CqsClient = Griffin.Cqs.CqsClient; + var ApplicationService = OneTrueError.Applications.ApplicationService; + var GetIncident = OneTrueError.Core.Incidents.Queries.GetIncident; + var CloseIncident = OneTrueError.Core.Incidents.Commands.CloseIncident; + var CloseViewModel = (function () { + function CloseViewModel() { + } + CloseViewModel.prototype.getTitle = function () { + return "Close incident"; + }; + CloseViewModel.prototype.activate = function (context) { + var _this = this; + this.context = context; + this.incidentId = parseInt(context.routeData["incidentId"]); + var query = new GetIncident(parseInt(context.routeData["incidentId"], 10)); + var incidentPromise = CqsClient.query(query); + incidentPromise.done(function (result) { return context.render(result); }); + var service = new ApplicationService(); + var appPromise = service.get(context.routeData["applicationId"]); + appPromise.done(function (result) { + _this.app = result; + }); + P.when(incidentPromise, appPromise) + .then(function (result) { + context.resolve(); + }); + context.handle.click("#saveSolution", function (evt) { return _this.onCloseIncident(); }); + context.handle.click('[name="sendCustomerMessage"]', function (evt) { return _this.onToggleMessagePane(); }); + }; + CloseViewModel.prototype.deactivate = function () { }; + CloseViewModel.prototype.onToggleMessagePane = function () { + var panel = this.context.select.one("#status-panel"); + if (panel.style.display === "none") { + panel.style.display = ""; + } + else { + panel.style.display = "none"; + } + }; + CloseViewModel.prototype.onCloseIncident = function () { + var solution = this.context.select.one('[name="solution"]'); + var closeCmd = new CloseIncident(solution.value, this.incidentId); + var sendMessage = this.context.select.one("sendCustomerMessage"); + console.log(sendMessage); + if (sendMessage.checked) { + var subject = this.context.select.one('[name="UserSubject"]'); + var text = this.context.select.one('[name="UserText"]'); + if (subject.value.length === 0 || text.value.length === 0) { + alert("You specified that you wanted to send a notification to your users, but you have not specified subject or body of the message."); + return; + } + closeCmd.NotificationText = text.value; + closeCmd.CanSendNotification = true; + closeCmd.NotificationTitle = subject.value; + } + CqsClient.command(closeCmd); + window.location.hash = "#/application/" + this.context.routeData["applicationId"]; + humane.log("Incident has been closed."); + }; + return CloseViewModel; + }()); + Incident.CloseViewModel = CloseViewModel; + })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=CloseViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Incident/IgnoreViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Incident/IgnoreViewModel.js index 57bbf338..c9b103e6 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Incident/IgnoreViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Incident/IgnoreViewModel.js @@ -1,49 +1,49 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Incident; - (function (Incident) { - var CqsClient = Griffin.Cqs.CqsClient; - var ApplicationService = OneTrueError.Applications.ApplicationService; - var GetIncident = OneTrueError.Core.Incidents.Queries.GetIncident; - var IgnoreIncident = OneTrueError.Core.Incidents.Commands.IgnoreIncident; - var IgnoreViewModel = (function () { - function IgnoreViewModel() { - } - IgnoreViewModel.prototype.getTitle = function () { - return "Ignore incident"; - }; - IgnoreViewModel.prototype.activate = function (context) { - var _this = this; - this.context = context; - this.incidentId = parseInt(context.routeData["incidentId"]); - var query = new GetIncident(parseInt(context.routeData["incidentId"], 10)); - var incidentPromise = CqsClient.query(query); - incidentPromise.done(function (result) { return context.render(result); }); - var service = new ApplicationService(); - var appPromise = service.get(context.routeData["applicationId"]); - appPromise.done(function (result) { - _this.app = result; - }); - P.when(incidentPromise, appPromise) - .then(function (result) { - context.resolve(); - }); - context.handle.click("#ignoreIncident", function (evt) { return _this.onIgnoreIncident(); }); - }; - IgnoreViewModel.prototype.deactivate = function () { }; - IgnoreViewModel.prototype.onIgnoreIncident = function () { - var ignoreCmd = new IgnoreIncident(this.incidentId); - CqsClient.command(ignoreCmd); - humane.log("Incident have been marked as ignored."); - window.location.hash = "#/application/" + this.context.routeData["applicationId"]; - }; - return IgnoreViewModel; - }()); - Incident.IgnoreViewModel = IgnoreViewModel; - })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Incident; + (function (Incident) { + var CqsClient = Griffin.Cqs.CqsClient; + var ApplicationService = OneTrueError.Applications.ApplicationService; + var GetIncident = OneTrueError.Core.Incidents.Queries.GetIncident; + var IgnoreIncident = OneTrueError.Core.Incidents.Commands.IgnoreIncident; + var IgnoreViewModel = (function () { + function IgnoreViewModel() { + } + IgnoreViewModel.prototype.getTitle = function () { + return "Ignore incident"; + }; + IgnoreViewModel.prototype.activate = function (context) { + var _this = this; + this.context = context; + this.incidentId = parseInt(context.routeData["incidentId"]); + var query = new GetIncident(parseInt(context.routeData["incidentId"], 10)); + var incidentPromise = CqsClient.query(query); + incidentPromise.done(function (result) { return context.render(result); }); + var service = new ApplicationService(); + var appPromise = service.get(context.routeData["applicationId"]); + appPromise.done(function (result) { + _this.app = result; + }); + P.when(incidentPromise, appPromise) + .then(function (result) { + context.resolve(); + }); + context.handle.click("#ignoreIncident", function (evt) { return _this.onIgnoreIncident(); }); + }; + IgnoreViewModel.prototype.deactivate = function () { }; + IgnoreViewModel.prototype.onIgnoreIncident = function () { + var ignoreCmd = new IgnoreIncident(this.incidentId); + CqsClient.command(ignoreCmd); + humane.log("Incident have been marked as ignored."); + window.location.hash = "#/application/" + this.context.routeData["applicationId"]; + }; + return IgnoreViewModel; + }()); + Incident.IgnoreViewModel = IgnoreViewModel; + })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=IgnoreViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Incident/IncidentViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Incident/IncidentViewModel.js index b64eed8a..39ed5440 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Incident/IncidentViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Incident/IncidentViewModel.js @@ -1,166 +1,166 @@ -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Incident; - (function (Incident) { - var CqsClient = Griffin.Cqs.CqsClient; - var Pager = Griffin.WebApp.Pager; - var IncidentViewModel = (function () { - function IncidentViewModel(appScope) { - this.isIgnored = false; - } - IncidentViewModel.prototype.getTitle = function () { - return "Incident " + this.name; - }; - IncidentViewModel.prototype.activate = function (ctx) { - var _this = this; - var query = new OneTrueError.Core.Incidents.Queries.GetIncident(ctx.routeData["incidentId"]); - this.ctx = ctx; - CqsClient.query(query) - .done(function (response) { - _this.isIgnored = response.IsIgnored; - _this.name = response.Description; - _this.id = response.Id; - _this.applicationId = response.ApplicationId; - _this.pager = new Pager(0, 0, 0); - _this.pager.subscribe(_this); - _this.pager.draw(ctx.select.one("#pager")); - _this.renderInfo(response); - var query = new OneTrueError.Core.Reports.Queries.GetReportList(_this.id); - query.PageNumber = 1; - query.PageSize = 20; - CqsClient.query(query) - .done(function (result) { - _this.pager.update(result.PageNumber, result.PageSize, result.TotalCount); - _this.renderTable(1, result); - }); - var elem = ctx.select.one("#myChart"); - ctx.resolve(); - _this.renderInitialChart(elem, response.DayStatistics); - }); - ctx.handle.change('[name="range"]', function (e) { return _this.onRange(e); }); - }; - IncidentViewModel.prototype.deactivate = function () { - }; - IncidentViewModel.prototype.onPager = function (pager) { - var _this = this; - var query = new OneTrueError.Core.Reports.Queries.GetReportList(this.id); - query.PageNumber = pager.currentPage; - query.PageSize = 20; - CqsClient.query(query) - .done(function (result) { - _this.renderTable(1, result); - }); - }; - IncidentViewModel.prototype.onRange = function (e) { - var elem = e.target; - var days = parseInt(elem.value, 10); - this.loadChartInfo(days); - }; - IncidentViewModel.prototype.renderInitialChart = function (chartElement, stats) { - var labels = new Array(); - var dataset = new OneTrueError.Dataset(); - dataset.label = "Error reports"; - dataset.data = new Array(); - stats.forEach(function (item) { - labels.push(new Date(item.Date).toLocaleDateString()); - dataset.data.push(item.Count); - }); - var data = new OneTrueError.LineData(); - data.datasets = [dataset]; - data.labels = labels; - this.lineChart = new OneTrueError.LineChart(chartElement); - this.lineChart.render(data); - //this.loadChartInfo(30); - }; - IncidentViewModel.prototype.renderTable = function (pageNumber, data) { - var self = this; - var directives = { - Items: { - CreatedAtUtc: { - text: function (value, dto) { - return new Date(value).toLocaleString(); - } - }, - Message: { - text: function (value, dto) { - if (!value) { - return "(No exception message)"; - } - return dto.Message; - }, - href: function (value, dto) { - return "#/application/" + self.applicationId + "/incident/" + self.id + "/report/" + dto.Id; - } - } - } - }; - this.ctx.renderPartial("#reportsTable", data, directives); - }; - IncidentViewModel.prototype.renderInfo = function (dto) { - var self = this; - if (dto.IsSolved) { - dto.Tags.push("solved"); - } - var directives = { - CreatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - UpdatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - SolvedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - Tags: { - "class": function (value) { - if (value === "solved") - return "tag bg-danger"; - return "tag nephritis"; - }, - text: function (value) { - return value; - }, - href: function (value) { - return "http://stackoverflow.com/search?q=%5B" + value + "%5D+" + dto.Description; - } - } - }; - this.ctx.render(dto, directives); - if (dto.IsSolved) { - this.ctx.select.one("#actionButtons").style.display = "none"; - this.ctx.select.one('[data-name="Description"]').style.textDecoration = "line-through"; - } - }; - IncidentViewModel.prototype.loadChartInfo = function (days) { - var _this = this; - var query = new OneTrueError.Core.Incidents.Queries.GetIncidentStatistics(); - query.IncidentId = this.id; - query.NumberOfDays = days; - CqsClient.query(query) - .done(function (response) { - var dataset = new OneTrueError.Dataset(); - dataset.label = "Error reports"; - dataset.data = response.Values; - var data = new OneTrueError.LineData(); - data.datasets = [dataset]; - data.labels = response.Labels; - _this.lineChart.render(data); - }); - }; - IncidentViewModel.UP = "glyphicon-chevron-up"; - IncidentViewModel.DOWN = "glyphicon-chevron-down"; - return IncidentViewModel; - }()); - Incident.IncidentViewModel = IncidentViewModel; - })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Incident; + (function (Incident) { + var CqsClient = Griffin.Cqs.CqsClient; + var Pager = Griffin.WebApp.Pager; + var IncidentViewModel = (function () { + function IncidentViewModel(appScope) { + this.isIgnored = false; + } + IncidentViewModel.prototype.getTitle = function () { + return "Incident " + this.name; + }; + IncidentViewModel.prototype.activate = function (ctx) { + var _this = this; + var query = new OneTrueError.Core.Incidents.Queries.GetIncident(ctx.routeData["incidentId"]); + this.ctx = ctx; + CqsClient.query(query) + .done(function (response) { + _this.isIgnored = response.IsIgnored; + _this.name = response.Description; + _this.id = response.Id; + _this.applicationId = response.ApplicationId; + _this.pager = new Pager(0, 0, 0); + _this.pager.subscribe(_this); + _this.pager.draw(ctx.select.one("#pager")); + _this.renderInfo(response); + var query = new OneTrueError.Core.Reports.Queries.GetReportList(_this.id); + query.PageNumber = 1; + query.PageSize = 20; + CqsClient.query(query) + .done(function (result) { + _this.pager.update(result.PageNumber, result.PageSize, result.TotalCount); + _this.renderTable(1, result); + }); + var elem = ctx.select.one("#myChart"); + ctx.resolve(); + _this.renderInitialChart(elem, response.DayStatistics); + }); + ctx.handle.change('[name="range"]', function (e) { return _this.onRange(e); }); + }; + IncidentViewModel.prototype.deactivate = function () { + }; + IncidentViewModel.prototype.onPager = function (pager) { + var _this = this; + var query = new OneTrueError.Core.Reports.Queries.GetReportList(this.id); + query.PageNumber = pager.currentPage; + query.PageSize = 20; + CqsClient.query(query) + .done(function (result) { + _this.renderTable(1, result); + }); + }; + IncidentViewModel.prototype.onRange = function (e) { + var elem = e.target; + var days = parseInt(elem.value, 10); + this.loadChartInfo(days); + }; + IncidentViewModel.prototype.renderInitialChart = function (chartElement, stats) { + var labels = new Array(); + var dataset = new OneTrueError.Dataset(); + dataset.label = "Error reports"; + dataset.data = new Array(); + stats.forEach(function (item) { + labels.push(new Date(item.Date).toLocaleDateString()); + dataset.data.push(item.Count); + }); + var data = new OneTrueError.LineData(); + data.datasets = [dataset]; + data.labels = labels; + this.lineChart = new OneTrueError.LineChart(chartElement); + this.lineChart.render(data); + //this.loadChartInfo(30); + }; + IncidentViewModel.prototype.renderTable = function (pageNumber, data) { + var self = this; + var directives = { + Items: { + CreatedAtUtc: { + text: function (value, dto) { + return new Date(value).toLocaleString(); + } + }, + Message: { + text: function (value, dto) { + if (!value) { + return "(No exception message)"; + } + return dto.Message; + }, + href: function (value, dto) { + return "#/application/" + self.applicationId + "/incident/" + self.id + "/report/" + dto.Id; + } + } + } + }; + this.ctx.renderPartial("#reportsTable", data, directives); + }; + IncidentViewModel.prototype.renderInfo = function (dto) { + var self = this; + if (dto.IsSolved) { + dto.Tags.push("solved"); + } + var directives = { + CreatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + UpdatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + SolvedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + Tags: { + "class": function (value) { + if (value === "solved") + return "tag bg-danger"; + return "tag nephritis"; + }, + text: function (value) { + return value; + }, + href: function (value) { + return "http://stackoverflow.com/search?q=%5B" + value + "%5D+" + dto.Description; + } + } + }; + this.ctx.render(dto, directives); + if (dto.IsSolved) { + this.ctx.select.one("#actionButtons").style.display = "none"; + this.ctx.select.one('[data-name="Description"]').style.textDecoration = "line-through"; + } + }; + IncidentViewModel.prototype.loadChartInfo = function (days) { + var _this = this; + var query = new OneTrueError.Core.Incidents.Queries.GetIncidentStatistics(); + query.IncidentId = this.id; + query.NumberOfDays = days; + CqsClient.query(query) + .done(function (response) { + var dataset = new OneTrueError.Dataset(); + dataset.label = "Error reports"; + dataset.data = response.Values; + var data = new OneTrueError.LineData(); + data.datasets = [dataset]; + data.labels = response.Labels; + _this.lineChart.render(data); + }); + }; + IncidentViewModel.UP = "glyphicon-chevron-up"; + IncidentViewModel.DOWN = "glyphicon-chevron-down"; + return IncidentViewModel; + }()); + Incident.IncidentViewModel = IncidentViewModel; + })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=IncidentViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Incident/IndexViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Incident/IndexViewModel.js index 382fb438..6ef515cd 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Incident/IndexViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Incident/IndexViewModel.js @@ -1,165 +1,165 @@ -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Incident; - (function (Incident) { - var CqsClient = Griffin.Cqs.CqsClient; - var IncidentOrder = OneTrueError.Core.Incidents.IncidentOrder; - var Yo = Griffin.Yo; - var IndexViewModel = (function () { - function IndexViewModel(dto) { - this.sortType = IncidentOrder.Newest; - this.sortAscending = false; - this.closed = false; - this.open = true; - this.reOpened = false; - } - IndexViewModel.prototype.getTitle = function () { - return "Incidents"; - }; - IndexViewModel.prototype.activate = function (ctx) { - var _this = this; - var query = new OneTrueError.Core.Incidents.Queries.FindIncidents(); - query.PageNumber = 1; - query.ItemsPerPage = 20; - CqsClient.query(query) - .done(function (response) { - var itemsElem = ctx.viewContainer.querySelector("#incidentTable"); - _this.renderTable(itemsElem, response); - ctx.resolve(); - _this.pager = new Griffin.WebApp.Pager(response.PageNumber, 20, response.TotalCount); - _this.pager.subscribe(_this); - _this.pager.draw(ctx.select.one("#pager")); - }); - ctx.handle.click("#btnClosed", function (e) { return _this.onBtnClosed(e); }); - ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); - ctx.handle.click("#btnIgnored", function (e) { return _this.onBtnIgnored(e); }); - ctx.handle.click("#LastReportCol", function (e) { return _this.onLastReportCol(e); }); - ctx.handle.click("#CountCol", function (e) { return _this.onCountCol(e); }); - }; - IndexViewModel.prototype.deactivate = function () { - }; - IndexViewModel.prototype.onPager = function (pager) { - this.loadItems(pager.currentPage); - }; - IndexViewModel.prototype.onBtnActive = function (e) { - e.preventDefault(); - this.reOpened = true; - this.open = true; - this.closed = false; - this.pager.reset(); - this.loadItems(0); - }; - IndexViewModel.prototype.onBtnClosed = function (e) { - e.preventDefault(); - this.reOpened = false; - this.open = false; - this.closed = true; - this.pager.reset(); - this.loadItems(0); - }; - IndexViewModel.prototype.onBtnIgnored = function (e) { - e.preventDefault(); - this.reOpened = false; - this.open = false; - this.closed = false; - this.pager.reset(); - this.loadItems(0); - }; - IndexViewModel.prototype.onCountCol = function (args) { - if (this.sortType !== IncidentOrder.MostReports) { - this.sortType = IncidentOrder.MostReports; - this.sortAscending = true; //will be changed below - } - if (this.sortAscending) { - } - else { - } - this.updateSorting(args.target); - this.loadItems(); - }; - IndexViewModel.prototype.onLastReportCol = function (args) { - if (this.sortType !== IncidentOrder.Newest) { - this.sortType = IncidentOrder.Newest; - this.sortAscending = false; //will be changed below - } - if (this.sortAscending) { - } - else { - } - this.updateSorting(args.target); - this.loadItems(); - }; - IndexViewModel.prototype.updateSorting = function (parentElement) { - this.sortAscending = !this.sortAscending; - var icon = IndexViewModel.UP; - if (!this.sortAscending) { - icon = IndexViewModel.DOWN; - } - $("#IndexView thead th span") - .removeClass("glyphicon-chevron-down") - .addClass("glyphicon " + icon) - .css("visibility", "hidden"); - $("span", parentElement) - .attr("class", "glyphicon " + icon) - .css("visibility", "inherit"); - }; - IndexViewModel.prototype.renderTable = function (target, data) { - var directives = { - Name: { - href: function (params, dto) { - return "#/application/" + dto.ApplicationId + "/incident/" + dto.Id; - }, - text: function (value) { - return value; - } - }, - ApplicationName: { - href: function (params, dto) { - return "#application/" + dto.ApplicationId + "/incidents/"; - }, - text: function (value) { - return value; - } - }, - LastUpdateAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - } - }; - Yo.G.render(target, data.Items, directives); - }; - IndexViewModel.prototype.loadItems = function (pageNumber) { - var _this = this; - if (pageNumber === void 0) { pageNumber = 0; } - var query = new OneTrueError.Core.Incidents.Queries.FindIncidents(); - query.SortType = this.sortType; - query.SortAscending = this.sortAscending; - query.Closed = this.closed; - query.Open = this.open; - query.ReOpened = this.reOpened; - query.Ignored = !this.reOpened && !this.closed && !this.open; - if (pageNumber === 0) { - query.PageNumber = this.pager.currentPage; - } - else { - query.PageNumber = pageNumber; - } - query.ItemsPerPage = 20; - CqsClient.query(query) - .done(function (response) { - //this.pager.update(response.PageNumber, 20, response.TotalCount); - _this.renderTable(document.getElementById("incidentTable"), response); - window.scrollTo(0, 0); - }); - }; - IndexViewModel.UP = "glyphicon-chevron-up"; - IndexViewModel.DOWN = "glyphicon-chevron-down"; - return IndexViewModel; - }()); - Incident.IndexViewModel = IndexViewModel; - })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Incident; + (function (Incident) { + var CqsClient = Griffin.Cqs.CqsClient; + var IncidentOrder = OneTrueError.Core.Incidents.IncidentOrder; + var Yo = Griffin.Yo; + var IndexViewModel = (function () { + function IndexViewModel(dto) { + this.sortType = IncidentOrder.Newest; + this.sortAscending = false; + this.closed = false; + this.open = true; + this.reOpened = false; + } + IndexViewModel.prototype.getTitle = function () { + return "Incidents"; + }; + IndexViewModel.prototype.activate = function (ctx) { + var _this = this; + var query = new OneTrueError.Core.Incidents.Queries.FindIncidents(); + query.PageNumber = 1; + query.ItemsPerPage = 20; + CqsClient.query(query) + .done(function (response) { + var itemsElem = ctx.viewContainer.querySelector("#incidentTable"); + _this.renderTable(itemsElem, response); + ctx.resolve(); + _this.pager = new Griffin.WebApp.Pager(response.PageNumber, 20, response.TotalCount); + _this.pager.subscribe(_this); + _this.pager.draw(ctx.select.one("#pager")); + }); + ctx.handle.click("#btnClosed", function (e) { return _this.onBtnClosed(e); }); + ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); + ctx.handle.click("#btnIgnored", function (e) { return _this.onBtnIgnored(e); }); + ctx.handle.click("#LastReportCol", function (e) { return _this.onLastReportCol(e); }); + ctx.handle.click("#CountCol", function (e) { return _this.onCountCol(e); }); + }; + IndexViewModel.prototype.deactivate = function () { + }; + IndexViewModel.prototype.onPager = function (pager) { + this.loadItems(pager.currentPage); + }; + IndexViewModel.prototype.onBtnActive = function (e) { + e.preventDefault(); + this.reOpened = true; + this.open = true; + this.closed = false; + this.pager.reset(); + this.loadItems(0); + }; + IndexViewModel.prototype.onBtnClosed = function (e) { + e.preventDefault(); + this.reOpened = false; + this.open = false; + this.closed = true; + this.pager.reset(); + this.loadItems(0); + }; + IndexViewModel.prototype.onBtnIgnored = function (e) { + e.preventDefault(); + this.reOpened = false; + this.open = false; + this.closed = false; + this.pager.reset(); + this.loadItems(0); + }; + IndexViewModel.prototype.onCountCol = function (args) { + if (this.sortType !== IncidentOrder.MostReports) { + this.sortType = IncidentOrder.MostReports; + this.sortAscending = true; //will be changed below + } + if (this.sortAscending) { + } + else { + } + this.updateSorting(args.target); + this.loadItems(); + }; + IndexViewModel.prototype.onLastReportCol = function (args) { + if (this.sortType !== IncidentOrder.Newest) { + this.sortType = IncidentOrder.Newest; + this.sortAscending = false; //will be changed below + } + if (this.sortAscending) { + } + else { + } + this.updateSorting(args.target); + this.loadItems(); + }; + IndexViewModel.prototype.updateSorting = function (parentElement) { + this.sortAscending = !this.sortAscending; + var icon = IndexViewModel.UP; + if (!this.sortAscending) { + icon = IndexViewModel.DOWN; + } + $("#IndexView thead th span") + .removeClass("glyphicon-chevron-down") + .addClass("glyphicon " + icon) + .css("visibility", "hidden"); + $("span", parentElement) + .attr("class", "glyphicon " + icon) + .css("visibility", "inherit"); + }; + IndexViewModel.prototype.renderTable = function (target, data) { + var directives = { + Name: { + href: function (params, dto) { + return "#/application/" + dto.ApplicationId + "/incident/" + dto.Id; + }, + text: function (value) { + return value; + } + }, + ApplicationName: { + href: function (params, dto) { + return "#application/" + dto.ApplicationId + "/incidents/"; + }, + text: function (value) { + return value; + } + }, + LastUpdateAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + } + }; + Yo.G.render(target, data.Items, directives); + }; + IndexViewModel.prototype.loadItems = function (pageNumber) { + var _this = this; + if (pageNumber === void 0) { pageNumber = 0; } + var query = new OneTrueError.Core.Incidents.Queries.FindIncidents(); + query.SortType = this.sortType; + query.SortAscending = this.sortAscending; + query.Closed = this.closed; + query.Open = this.open; + query.ReOpened = this.reOpened; + query.Ignored = !this.reOpened && !this.closed && !this.open; + if (pageNumber === 0) { + query.PageNumber = this.pager.currentPage; + } + else { + query.PageNumber = pageNumber; + } + query.ItemsPerPage = 20; + CqsClient.query(query) + .done(function (response) { + //this.pager.update(response.PageNumber, 20, response.TotalCount); + _this.renderTable(document.getElementById("incidentTable"), response); + window.scrollTo(0, 0); + }); + }; + IndexViewModel.UP = "glyphicon-chevron-up"; + IndexViewModel.DOWN = "glyphicon-chevron-down"; + return IndexViewModel; + }()); + Incident.IndexViewModel = IndexViewModel; + })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=IndexViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Incident/OriginsViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Incident/OriginsViewModel.js index ad21109e..2486856d 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Incident/OriginsViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Incident/OriginsViewModel.js @@ -1,67 +1,67 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Incident; - (function (Incident) { - var CqsClient = Griffin.Cqs.CqsClient; - var OriginsViewModel = (function () { - function OriginsViewModel() { - } - OriginsViewModel.prototype.getTitle = function () { - return "Error origins"; - }; - OriginsViewModel.prototype.activate = function (context) { - this.context = context; - context.resolve(); - var js = document.createElement("script"); - js.type = "text/javascript"; - js - .src = - "https://maps.googleapis.com/maps/api/js?key=AIzaSyBleXqcxCLRwuhcXk-3904HaJt9Vd1-CZc&libraries=visualization"; - this.context.viewContainer.appendChild(js); - //var myLatLng = { lat: -25.363, lng: 131.044 }; - //var marker = new google.maps.Marker({ - // position: myLatLng, - // map: map, - // title: 'Hello World!' - //}); - js.onload = function (e) { - var mapDiv = context.select.one("#map"); - var map = new google.maps.Map(mapDiv, { - zoom: 3, - center: { lat: 37.775, lng: -122.434 } - }); - google.maps.event.addDomListener(window, "resize", function () { - var center = map.getCenter(); - google.maps.event.trigger(map, "resize"); - map.setCenter(center); - }); - var query = new OneTrueError.Modules.ErrorOrigins.Queries.GetOriginsForIncident(context.routeData["incidentId"]); - CqsClient.query(query) - .done(function (response) { - var points = []; - response.Items.forEach(function (item) { - var point = new google.maps.LatLng(item.Latitude, item.Longitude); - for (var a = 0; a < item.NumberOfErrorReports; a++) { - points.push(point); - } - }); - var heatmap = new google.maps.visualization.HeatmapLayer({ - data: points, - map: map, - dissipating: false, - radius: 5 - }); - }); - }; - }; - OriginsViewModel.prototype.deactivate = function () { }; - return OriginsViewModel; - }()); - Incident.OriginsViewModel = OriginsViewModel; - })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Incident; + (function (Incident) { + var CqsClient = Griffin.Cqs.CqsClient; + var OriginsViewModel = (function () { + function OriginsViewModel() { + } + OriginsViewModel.prototype.getTitle = function () { + return "Error origins"; + }; + OriginsViewModel.prototype.activate = function (context) { + this.context = context; + context.resolve(); + var js = document.createElement("script"); + js.type = "text/javascript"; + js + .src = + "https://maps.googleapis.com/maps/api/js?key=AIzaSyBleXqcxCLRwuhcXk-3904HaJt9Vd1-CZc&libraries=visualization"; + this.context.viewContainer.appendChild(js); + //var myLatLng = { lat: -25.363, lng: 131.044 }; + //var marker = new google.maps.Marker({ + // position: myLatLng, + // map: map, + // title: 'Hello World!' + //}); + js.onload = function (e) { + var mapDiv = context.select.one("#map"); + var map = new google.maps.Map(mapDiv, { + zoom: 3, + center: { lat: 37.775, lng: -122.434 } + }); + google.maps.event.addDomListener(window, "resize", function () { + var center = map.getCenter(); + google.maps.event.trigger(map, "resize"); + map.setCenter(center); + }); + var query = new OneTrueError.Modules.ErrorOrigins.Queries.GetOriginsForIncident(context.routeData["incidentId"]); + CqsClient.query(query) + .done(function (response) { + var points = []; + response.Items.forEach(function (item) { + var point = new google.maps.LatLng(item.Latitude, item.Longitude); + for (var a = 0; a < item.NumberOfErrorReports; a++) { + points.push(point); + } + }); + var heatmap = new google.maps.visualization.HeatmapLayer({ + data: points, + map: map, + dissipating: false, + radius: 5 + }); + }); + }; + }; + OriginsViewModel.prototype.deactivate = function () { }; + return OriginsViewModel; + }()); + Incident.OriginsViewModel = OriginsViewModel; + })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=OriginsViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Incident/SimilaritiesViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Incident/SimilaritiesViewModel.js index c8ac7dc3..2f9e8ddc 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Incident/SimilaritiesViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Incident/SimilaritiesViewModel.js @@ -1,114 +1,114 @@ -/// -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Incident; - (function (Incident) { - var CqsClient = Griffin.Cqs.CqsClient; - var ViewRenderer = Griffin.Yo.Views.ViewRenderer; - var Similarities = OneTrueError.Modules.ContextData; - var SimilaritiesViewModel = (function () { - function SimilaritiesViewModel() { - } - SimilaritiesViewModel.prototype.activate = function (context) { - var _this = this; - this.incidentId = parseInt(context.routeData["incidentId"], 10); - this.ctx = context; - CqsClient - .query(new Similarities.Queries.GetSimilarities(this.incidentId)) - .done(function (result) { - _this.dto = result; - context.render(result); - context.resolve(); - }); - //context.render(result); - context.handle.click("#ContextCollections", function (evt) { - var target = evt.target; - if (target.tagName === "LI") { - _this.selectCollection(target.firstElementChild.textContent); - $("li", target.parentElement).removeClass("active"); - $(target).addClass("active"); - } - else if (target.tagName === "A") { - _this.selectCollection(target.textContent); - $("li", target.parentElement.parentElement).removeClass("active"); - $(target.parentElement).addClass("active"); - } - }, true); - context.handle.click("#ContextProperty", function (evt) { - var target = evt.target; - if (target.tagName === "LI") { - _this.selectProperty(target.firstElementChild.textContent); - $("li", target.parentElement).removeClass("active"); - $(target).addClass("active"); - } - else if (target.tagName === "A") { - _this.selectProperty(target.textContent); - $("li", target.parentElement.parentElement).removeClass("active"); - $(target.parentElement).addClass("active"); - } - }); - // var service = new ApplicationService(); - // var appId = parseInt(context.routeData["applicationId"], 10); - // service.get(appId).done(result => { - // this.app = result; - // }) - // context.resolve(); - //}); - }; - SimilaritiesViewModel.prototype.getTitle = function () { - return "context data"; - }; - SimilaritiesViewModel.prototype.deactivate = function () { - }; - SimilaritiesViewModel.prototype.selectCollection = function (collectionName) { - var _this = this; - this.dto.Collections.forEach(function (item) { - if (item.Name === collectionName) { - var directives = { - SimilarityName: { - html: function (value, dto) { - return dto.Name; - } - } - }; - _this.currentCollection = item; - var container = _this.ctx.select.one("ContextProperty"); - container.style.display = ""; - var renderer = new ViewRenderer(container); - renderer.render(item.Similarities, directives); - _this.ctx.select.one("Values").style.display = "none"; - return; - } - }); - }; - SimilaritiesViewModel.prototype.selectProperty = function (name) { - var _this = this; - var self = this; - this.currentCollection.Similarities.forEach(function (item) { - if (item.Name === name) { - var directives = { - Value: { - html: function (value, dto) { - return value; - } - } - }; - var elem = _this.ctx.select.one("Values"); - elem.style.display = ""; - var renderer = new ViewRenderer(elem); - renderer.render(item.Values, directives); - return; - } - }); - }; - SimilaritiesViewModel.VIEW_NAME = "SimilaritiesView"; - return SimilaritiesViewModel; - }()); - Incident.SimilaritiesViewModel = SimilaritiesViewModel; - })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Incident; + (function (Incident) { + var CqsClient = Griffin.Cqs.CqsClient; + var ViewRenderer = Griffin.Yo.Views.ViewRenderer; + var Similarities = OneTrueError.Modules.ContextData; + var SimilaritiesViewModel = (function () { + function SimilaritiesViewModel() { + } + SimilaritiesViewModel.prototype.activate = function (context) { + var _this = this; + this.incidentId = parseInt(context.routeData["incidentId"], 10); + this.ctx = context; + CqsClient + .query(new Similarities.Queries.GetSimilarities(this.incidentId)) + .done(function (result) { + _this.dto = result; + context.render(result); + context.resolve(); + }); + //context.render(result); + context.handle.click("#ContextCollections", function (evt) { + var target = evt.target; + if (target.tagName === "LI") { + _this.selectCollection(target.firstElementChild.textContent); + $("li", target.parentElement).removeClass("active"); + $(target).addClass("active"); + } + else if (target.tagName === "A") { + _this.selectCollection(target.textContent); + $("li", target.parentElement.parentElement).removeClass("active"); + $(target.parentElement).addClass("active"); + } + }, true); + context.handle.click("#ContextProperty", function (evt) { + var target = evt.target; + if (target.tagName === "LI") { + _this.selectProperty(target.firstElementChild.textContent); + $("li", target.parentElement).removeClass("active"); + $(target).addClass("active"); + } + else if (target.tagName === "A") { + _this.selectProperty(target.textContent); + $("li", target.parentElement.parentElement).removeClass("active"); + $(target.parentElement).addClass("active"); + } + }); + // var service = new ApplicationService(); + // var appId = parseInt(context.routeData["applicationId"], 10); + // service.get(appId).done(result => { + // this.app = result; + // }) + // context.resolve(); + //}); + }; + SimilaritiesViewModel.prototype.getTitle = function () { + return "context data"; + }; + SimilaritiesViewModel.prototype.deactivate = function () { + }; + SimilaritiesViewModel.prototype.selectCollection = function (collectionName) { + var _this = this; + this.dto.Collections.forEach(function (item) { + if (item.Name === collectionName) { + var directives = { + SimilarityName: { + html: function (value, dto) { + return dto.Name; + } + } + }; + _this.currentCollection = item; + var container = _this.ctx.select.one("ContextProperty"); + container.style.display = ""; + var renderer = new ViewRenderer(container); + renderer.render(item.Similarities, directives); + _this.ctx.select.one("Values").style.display = "none"; + return; + } + }); + }; + SimilaritiesViewModel.prototype.selectProperty = function (name) { + var _this = this; + var self = this; + this.currentCollection.Similarities.forEach(function (item) { + if (item.Name === name) { + var directives = { + Value: { + html: function (value, dto) { + return value; + } + } + }; + var elem = _this.ctx.select.one("Values"); + elem.style.display = ""; + var renderer = new ViewRenderer(elem); + renderer.render(item.Values, directives); + return; + } + }); + }; + SimilaritiesViewModel.VIEW_NAME = "SimilaritiesView"; + return SimilaritiesViewModel; + }()); + Incident.SimilaritiesViewModel = SimilaritiesViewModel; + })(Incident = OneTrueError.Incident || (OneTrueError.Incident = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=SimilaritiesViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Overview/OverviewViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Overview/OverviewViewModel.js index 3beb973f..af7643ef 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Overview/OverviewViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Overview/OverviewViewModel.js @@ -1,255 +1,255 @@ -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Overview; - (function (Overview) { - var CqsClient = Griffin.Cqs.CqsClient; - var IncidentOrder = OneTrueError.Core.Incidents.IncidentOrder; - var Pager = Griffin.WebApp.Pager; - var FindIncidents = OneTrueError.Core.Incidents.Queries.FindIncidents; - var OverviewViewModel = (function () { - function OverviewViewModel() { - this._sortType = IncidentOrder.Newest; - this._sortAscending = false; - this._incidentType = "active"; - this.pager = new Pager(0, 0, 0); - this.pager.subscribe(this); - } - OverviewViewModel.prototype.getTitle = function () { - return "Overview"; - }; - OverviewViewModel.prototype.activate = function (ctx) { - var _this = this; - this._ctx = ctx; - var query = new OneTrueError.Web.Overview.Queries.GetOverview(); - CqsClient.query(query) - .done(function (response) { - _this.renderInfo(response); - ctx.resolve(); - _this.lineChart = new OneTrueError.LineChart(ctx.select.one("#myChart")); - _this.renderChart(response); - }); - var pagerElement = ctx.select.one("pager"); - this.pager.draw(pagerElement); - this.getIncidentsFromServer(1); - ctx.handle.change('[name="range"]', function (e) { return _this.OnRange(e); }); - ctx.handle.click("#btnClosed", function (e) { return _this.onBtnClosed(e); }); - ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); - ctx.handle.click("#btnIgnored", function (e) { return _this.onBtnIgnored(e); }); - ctx.handle.click("#LastReportCol", function (e) { return _this.onLastReportCol(e); }); - ctx.handle.click("#CountCol", function (e) { return _this.onCountCol(e); }); - }; - OverviewViewModel.prototype.deactivate = function () { - }; - OverviewViewModel.prototype.onPager = function (pager) { - this.getIncidentsFromServer(pager.currentPage); - var table = this._ctx.select.one("#incidentTable"); - //.scrollIntoView(true); - var y = this.findYPosition(table); - window.scrollTo(null, y - 50); //navbar - }; - OverviewViewModel.prototype.findYPosition = function (element) { - if (element.offsetParent) { - var curtop = 0; - do { - curtop += element.offsetTop; - element = (element.offsetParent); - } while (element); - return curtop; - } - }; - OverviewViewModel.prototype.OnRange = function (e) { - var _this = this; - var query = new OneTrueError.Web.Overview.Queries.GetOverview(); - var elem = e.target; - query.NumberOfDays = parseInt(elem.value, 10); - CqsClient.query(query) - .done(function (response) { - _this.renderChart(response); - }); - }; - OverviewViewModel.prototype.onBtnClosed = function (e) { - e.preventDefault(); - this._incidentType = "closed"; - this.pager.reset(); - this.getIncidentsFromServer(0); - }; - OverviewViewModel.prototype.onBtnActive = function (e) { - e.preventDefault(); - this._incidentType = "active"; - this.pager.reset(); - this.getIncidentsFromServer(0); - }; - OverviewViewModel.prototype.onBtnIgnored = function (e) { - e.preventDefault(); - this._incidentType = "ignored"; - this.pager.reset(); - this.getIncidentsFromServer(0); - }; - OverviewViewModel.prototype.onCountCol = function (e) { - if (this._sortType !== IncidentOrder.MostReports) { - this._sortType = IncidentOrder.MostReports; - this._sortAscending = true; //will be changed below - } - this.updateSortingUI(e.target); - this.getIncidentsFromServer(this.pager.currentPage); - }; - OverviewViewModel.prototype.onLastReportCol = function (e) { - if (this._sortType !== IncidentOrder.Newest) { - this._sortType = IncidentOrder.Newest; - this._sortAscending = true; //will be changed below - } - this.updateSortingUI(e.target); - this.getIncidentsFromServer(this.pager.currentPage); - }; - OverviewViewModel.prototype.renderTable = function (pageNumber, data) { - var self = this; - var directives = { - Items: { - Name: { - text: function (value) { - return value; - }, - href: function (data, parentDto) { - return "#/application/" + parentDto.ApplicationId + "/incident/" + parentDto.Id; - } - }, - CreatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - LastUpdateAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - ApplicationName: { - text: function (value) { - return value; - }, - href: function (params, parentDto) { - return "#/application/" + parentDto.ApplicationId; - } - } - } - }; - if (data.TotalCount === 0) { - this._ctx.select.one("getting-started").style.display = ""; - } - this._ctx.renderPartial("#incidentTable", data, directives); - }; - OverviewViewModel.prototype.renderInfo = function (dto) { - var self = this; - var directives = { - CreatedAtUtc: { - text: function (params) { - return new Date(this.CreatedAtUtc).toLocaleString(); - } - }, - UpdatedAtUtc: { - text: function (params) { - return new Date(this.UpdatedAtUtc).toLocaleString(); - } - }, - SolvedAtUtc: { - text: function (params) { - return new Date(this.SolvedAtUtc).toLocaleString(); - } - }, - }; - this._ctx.render(dto, directives); - }; - OverviewViewModel.prototype.updateSortingUI = function (parentElement) { - this._sortAscending = !this._sortAscending; - var icon = OverviewViewModel.UP; - if (!this._sortAscending) { - icon = OverviewViewModel.DOWN; - } - $("#OverviewView thead th span") - .removeClass("glyphicon-chevron-down") - .addClass("glyphicon " + icon) - .css("visibility", "hidden"); - $("span", parentElement) - .attr("class", "glyphicon " + icon) - .css("visibility", "inherit"); - }; - OverviewViewModel.prototype.getIncidentsFromServer = function (pageNumber) { - var _this = this; - var query = new FindIncidents(); - query.SortType = this._sortType; - query.SortAscending = this._sortAscending; - query.PageNumber = pageNumber; - query.ItemsPerPage = 10; - if (this._incidentType === "closed") { - query.Closed = true; - query.Open = false; - } - //else if (this._incidentType === '') - CqsClient.query(query) - .done(function (response) { - if (_this.pager.pageCount === 0) { - _this.pager.update(response.PageNumber, response.PageSize, response.TotalCount); - } - _this.renderTable(pageNumber, response); - }); - }; - OverviewViewModel.prototype.renderChart = function (result) { - var data = new OneTrueError.LineData(); - data.datasets = []; - var legend = []; - var found = false; - var index = 0; - result.IncidentsPerApplication.forEach(function (app) { - var sum = app.Values.reduce(function (a, b) { return a + b; }, 0); - if (sum === 0) { - return; - } - var ds = new OneTrueError.Dataset(); - ds.label = app.Label; - ds.data = app.Values; - data.datasets.push(ds); - //not enough color themes to display all. - if (index > OneTrueError.LineChart.LineThemes.length) { - return; - } - var l = { - label: app.Label, - color: OneTrueError.LineChart.LineThemes[index++].strokeColor - }; - legend.push(l); - found = true; - }); - var directives = { - color: { - text: function () { - return ""; - }, - style: function (value, dto) { - return "display: inline; font-weight: bold; color: " + dto.color; - } - }, - label: { - style: function (value, dto) { - return "font-weight: bold; color: " + dto.color; - } - } - }; - this._ctx.renderPartial("#chart-legend", legend, directives); - data.labels = result.TimeAxisLabels; - if (data.datasets.length === 0) { - data.datasets.push({ label: 'No data', data: [] }); - } - this.lineChart.render(data); - this._ctx.renderPartial("StatSummary", result.StatSummary); - }; - OverviewViewModel.UP = "glyphicon-chevron-up"; - OverviewViewModel.DOWN = "glyphicon-chevron-down"; - return OverviewViewModel; - }()); - Overview.OverviewViewModel = OverviewViewModel; - })(Overview = OneTrueError.Overview || (OneTrueError.Overview = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Overview; + (function (Overview) { + var CqsClient = Griffin.Cqs.CqsClient; + var IncidentOrder = OneTrueError.Core.Incidents.IncidentOrder; + var Pager = Griffin.WebApp.Pager; + var FindIncidents = OneTrueError.Core.Incidents.Queries.FindIncidents; + var OverviewViewModel = (function () { + function OverviewViewModel() { + this._sortType = IncidentOrder.Newest; + this._sortAscending = false; + this._incidentType = "active"; + this.pager = new Pager(0, 0, 0); + this.pager.subscribe(this); + } + OverviewViewModel.prototype.getTitle = function () { + return "Overview"; + }; + OverviewViewModel.prototype.activate = function (ctx) { + var _this = this; + this._ctx = ctx; + var query = new OneTrueError.Web.Overview.Queries.GetOverview(); + CqsClient.query(query) + .done(function (response) { + _this.renderInfo(response); + ctx.resolve(); + _this.lineChart = new OneTrueError.LineChart(ctx.select.one("#myChart")); + _this.renderChart(response); + }); + var pagerElement = ctx.select.one("pager"); + this.pager.draw(pagerElement); + this.getIncidentsFromServer(1); + ctx.handle.change('[name="range"]', function (e) { return _this.OnRange(e); }); + ctx.handle.click("#btnClosed", function (e) { return _this.onBtnClosed(e); }); + ctx.handle.click("#btnActive", function (e) { return _this.onBtnActive(e); }); + ctx.handle.click("#btnIgnored", function (e) { return _this.onBtnIgnored(e); }); + ctx.handle.click("#LastReportCol", function (e) { return _this.onLastReportCol(e); }); + ctx.handle.click("#CountCol", function (e) { return _this.onCountCol(e); }); + }; + OverviewViewModel.prototype.deactivate = function () { + }; + OverviewViewModel.prototype.onPager = function (pager) { + this.getIncidentsFromServer(pager.currentPage); + var table = this._ctx.select.one("#incidentTable"); + //.scrollIntoView(true); + var y = this.findYPosition(table); + window.scrollTo(null, y - 50); //navbar + }; + OverviewViewModel.prototype.findYPosition = function (element) { + if (element.offsetParent) { + var curtop = 0; + do { + curtop += element.offsetTop; + element = (element.offsetParent); + } while (element); + return curtop; + } + }; + OverviewViewModel.prototype.OnRange = function (e) { + var _this = this; + var query = new OneTrueError.Web.Overview.Queries.GetOverview(); + var elem = e.target; + query.NumberOfDays = parseInt(elem.value, 10); + CqsClient.query(query) + .done(function (response) { + _this.renderChart(response); + }); + }; + OverviewViewModel.prototype.onBtnClosed = function (e) { + e.preventDefault(); + this._incidentType = "closed"; + this.pager.reset(); + this.getIncidentsFromServer(0); + }; + OverviewViewModel.prototype.onBtnActive = function (e) { + e.preventDefault(); + this._incidentType = "active"; + this.pager.reset(); + this.getIncidentsFromServer(0); + }; + OverviewViewModel.prototype.onBtnIgnored = function (e) { + e.preventDefault(); + this._incidentType = "ignored"; + this.pager.reset(); + this.getIncidentsFromServer(0); + }; + OverviewViewModel.prototype.onCountCol = function (e) { + if (this._sortType !== IncidentOrder.MostReports) { + this._sortType = IncidentOrder.MostReports; + this._sortAscending = true; //will be changed below + } + this.updateSortingUI(e.target); + this.getIncidentsFromServer(this.pager.currentPage); + }; + OverviewViewModel.prototype.onLastReportCol = function (e) { + if (this._sortType !== IncidentOrder.Newest) { + this._sortType = IncidentOrder.Newest; + this._sortAscending = true; //will be changed below + } + this.updateSortingUI(e.target); + this.getIncidentsFromServer(this.pager.currentPage); + }; + OverviewViewModel.prototype.renderTable = function (pageNumber, data) { + var self = this; + var directives = { + Items: { + Name: { + text: function (value) { + return value; + }, + href: function (data, parentDto) { + return "#/application/" + parentDto.ApplicationId + "/incident/" + parentDto.Id; + } + }, + CreatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + LastUpdateAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + ApplicationName: { + text: function (value) { + return value; + }, + href: function (params, parentDto) { + return "#/application/" + parentDto.ApplicationId; + } + } + } + }; + if (data.TotalCount === 0) { + this._ctx.select.one("getting-started").style.display = ""; + } + this._ctx.renderPartial("#incidentTable", data, directives); + }; + OverviewViewModel.prototype.renderInfo = function (dto) { + var self = this; + var directives = { + CreatedAtUtc: { + text: function (params) { + return new Date(this.CreatedAtUtc).toLocaleString(); + } + }, + UpdatedAtUtc: { + text: function (params) { + return new Date(this.UpdatedAtUtc).toLocaleString(); + } + }, + SolvedAtUtc: { + text: function (params) { + return new Date(this.SolvedAtUtc).toLocaleString(); + } + }, + }; + this._ctx.render(dto, directives); + }; + OverviewViewModel.prototype.updateSortingUI = function (parentElement) { + this._sortAscending = !this._sortAscending; + var icon = OverviewViewModel.UP; + if (!this._sortAscending) { + icon = OverviewViewModel.DOWN; + } + $("#OverviewView thead th span") + .removeClass("glyphicon-chevron-down") + .addClass("glyphicon " + icon) + .css("visibility", "hidden"); + $("span", parentElement) + .attr("class", "glyphicon " + icon) + .css("visibility", "inherit"); + }; + OverviewViewModel.prototype.getIncidentsFromServer = function (pageNumber) { + var _this = this; + var query = new FindIncidents(); + query.SortType = this._sortType; + query.SortAscending = this._sortAscending; + query.PageNumber = pageNumber; + query.ItemsPerPage = 10; + if (this._incidentType === "closed") { + query.Closed = true; + query.Open = false; + } + //else if (this._incidentType === '') + CqsClient.query(query) + .done(function (response) { + if (_this.pager.pageCount === 0) { + _this.pager.update(response.PageNumber, response.PageSize, response.TotalCount); + } + _this.renderTable(pageNumber, response); + }); + }; + OverviewViewModel.prototype.renderChart = function (result) { + var data = new OneTrueError.LineData(); + data.datasets = []; + var legend = []; + var found = false; + var index = 0; + result.IncidentsPerApplication.forEach(function (app) { + var sum = app.Values.reduce(function (a, b) { return a + b; }, 0); + if (sum === 0) { + return; + } + var ds = new OneTrueError.Dataset(); + ds.label = app.Label; + ds.data = app.Values; + data.datasets.push(ds); + //not enough color themes to display all. + if (index > OneTrueError.LineChart.LineThemes.length) { + return; + } + var l = { + label: app.Label, + color: OneTrueError.LineChart.LineThemes[index++].strokeColor + }; + legend.push(l); + found = true; + }); + var directives = { + color: { + text: function () { + return ""; + }, + style: function (value, dto) { + return "display: inline; font-weight: bold; color: " + dto.color; + } + }, + label: { + style: function (value, dto) { + return "font-weight: bold; color: " + dto.color; + } + } + }; + this._ctx.renderPartial("#chart-legend", legend, directives); + data.labels = result.TimeAxisLabels; + if (data.datasets.length === 0) { + data.datasets.push({ label: 'No data', data: [] }); + } + this.lineChart.render(data); + this._ctx.renderPartial("StatSummary", result.StatSummary); + }; + OverviewViewModel.UP = "glyphicon-chevron-up"; + OverviewViewModel.DOWN = "glyphicon-chevron-down"; + return OverviewViewModel; + }()); + Overview.OverviewViewModel = OverviewViewModel; + })(Overview = OneTrueError.Overview || (OneTrueError.Overview = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=OverviewViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/Report/ReportViewModel.js b/src/Server/OneTrueError.Web/ViewModels/Report/ReportViewModel.js index 4f85c25c..033f34ee 100644 --- a/src/Server/OneTrueError.Web/ViewModels/Report/ReportViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/Report/ReportViewModel.js @@ -1,96 +1,96 @@ -/// -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Report; - (function (Report) { - var CqsClient = Griffin.Cqs.CqsClient; - var ReportViewModel = (function () { - function ReportViewModel() { - } - ReportViewModel.prototype.renderView = function () { - var directives = { - CreatedAtUtc: { - text: function (value) { - return new Date(value).toLocaleString(); - } - }, - ContextCollections: { - ContextCollectionName: { - html: function (value, dto) { - return dto.Name; - }, - href: function (value, dto) { - return "#" + dto.Name; - } - } - } - }; - this.context.render(this.dto, directives); - }; - ReportViewModel.prototype.getTitle = function () { - return "Report"; - }; - ReportViewModel.prototype.activate = function (context) { - var _this = this; - this.context = context; - var reportId = context.routeData["reportId"]; - var query = new OneTrueError.Core.Reports.Queries.GetReport(reportId); - CqsClient.query(query) - .done(function (dto) { - _this.dto = dto; - _this.renderView(); - context.resolve(); - }); - context.handle.click('[data-collection="ContextCollections"]', function (evt) { - evt.preventDefault(); - var target = evt.target; - if (target.tagName === "LI") { - _this.selectCollection(target.firstElementChild.textContent); - $("li", target.parentElement).removeClass("active"); - $(target).addClass("active"); - } - else if (target.tagName === "A") { - _this.selectCollection(target.textContent); - $("li", target.parentElement.parentElement).removeClass("active"); - $(target.parentElement).addClass("active"); - } - }, true); - }; - ReportViewModel.prototype.selectCollection = function (collectionName) { - var _this = this; - this.dto.ContextCollections.forEach(function (item) { - if (item.Name === collectionName) { - var directives = { - Properties: { - Key: { - html: function (value) { - return value; - } - }, - Value: { - html: function (value, dto) { - if (collectionName === "Screenshots") { - return "\"Embedded"; - } - else { - return value.replace(/;;/g, "
"); - } - } - } - } - }; - _this.context.renderPartial("propertyTable", item, directives); - return; - } - }); - }; - ReportViewModel.prototype.deactivate = function () { }; - return ReportViewModel; - }()); - Report.ReportViewModel = ReportViewModel; - })(Report = OneTrueError.Report || (OneTrueError.Report = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Report; + (function (Report) { + var CqsClient = Griffin.Cqs.CqsClient; + var ReportViewModel = (function () { + function ReportViewModel() { + } + ReportViewModel.prototype.renderView = function () { + var directives = { + CreatedAtUtc: { + text: function (value) { + return new Date(value).toLocaleString(); + } + }, + ContextCollections: { + ContextCollectionName: { + html: function (value, dto) { + return dto.Name; + }, + href: function (value, dto) { + return "#" + dto.Name; + } + } + } + }; + this.context.render(this.dto, directives); + }; + ReportViewModel.prototype.getTitle = function () { + return "Report"; + }; + ReportViewModel.prototype.activate = function (context) { + var _this = this; + this.context = context; + var reportId = context.routeData["reportId"]; + var query = new OneTrueError.Core.Reports.Queries.GetReport(reportId); + CqsClient.query(query) + .done(function (dto) { + _this.dto = dto; + _this.renderView(); + context.resolve(); + }); + context.handle.click('[data-collection="ContextCollections"]', function (evt) { + evt.preventDefault(); + var target = evt.target; + if (target.tagName === "LI") { + _this.selectCollection(target.firstElementChild.textContent); + $("li", target.parentElement).removeClass("active"); + $(target).addClass("active"); + } + else if (target.tagName === "A") { + _this.selectCollection(target.textContent); + $("li", target.parentElement.parentElement).removeClass("active"); + $(target.parentElement).addClass("active"); + } + }, true); + }; + ReportViewModel.prototype.selectCollection = function (collectionName) { + var _this = this; + this.dto.ContextCollections.forEach(function (item) { + if (item.Name === collectionName) { + var directives = { + Properties: { + Key: { + html: function (value) { + return value; + } + }, + Value: { + html: function (value, dto) { + if (collectionName === "Screenshots") { + return "\"Embedded"; + } + else { + return value.replace(/;;/g, "
"); + } + } + } + } + }; + _this.context.renderPartial("propertyTable", item, directives); + return; + } + }); + }; + ReportViewModel.prototype.deactivate = function () { }; + return ReportViewModel; + }()); + Report.ReportViewModel = ReportViewModel; + })(Report = OneTrueError.Report || (OneTrueError.Report = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=ReportViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/User/NotificationsViewModel.js b/src/Server/OneTrueError.Web/ViewModels/User/NotificationsViewModel.js index 716e69e0..da3b07b3 100644 --- a/src/Server/OneTrueError.Web/ViewModels/User/NotificationsViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/User/NotificationsViewModel.js @@ -1,44 +1,44 @@ -/// -/// -var OneTrueError; -(function (OneTrueError) { - var User; - (function (User) { - var cqs = Griffin.Cqs.CqsClient; - var GetUserSettings = OneTrueError.Core.Users.Queries.GetUserSettings; - var CqsClient = Griffin.Cqs.CqsClient; - var NotificationsViewModel = (function () { - function NotificationsViewModel() { - } - NotificationsViewModel.prototype.saveSettings_click = function (e) { - e.isHandled = true; - var dto = this.ctx.readForm("NotificationsView"); - var cmd = new OneTrueError.Core.Users.Commands.UpdateNotifications(); - cmd.NotifyOnNewIncidents = dto.NotifyOnNewIncidents; - cmd.NotifyOnNewReport = dto.NotifyOnNewReport; - cmd.NotifyOnPeaks = dto.NotifyOnPeaks; - cmd.NotifyOnReOpenedIncident = dto.NotifyOnReOpenedIncident; - cmd.NotifyOnUserFeedback = dto.NotifyOnUserFeedback; - CqsClient.command(cmd); - humane.log("Settings have been saved."); - }; - NotificationsViewModel.prototype.getTitle = function () { return "Notifications settings"; }; - NotificationsViewModel.prototype.activate = function (context) { - var _this = this; - this.ctx = context; - context.handle.click("#saveSettings", function (ev) { return _this.saveSettings_click(ev); }); - var query = new GetUserSettings(); - cqs.query(query) - .done(function (result) { - context.render(result.Notifications); - context.resolve(); - }); - }; - NotificationsViewModel.prototype.deactivate = function () { - }; - return NotificationsViewModel; - }()); - User.NotificationsViewModel = NotificationsViewModel; - })(User = OneTrueError.User || (OneTrueError.User = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +var OneTrueError; +(function (OneTrueError) { + var User; + (function (User) { + var cqs = Griffin.Cqs.CqsClient; + var GetUserSettings = OneTrueError.Core.Users.Queries.GetUserSettings; + var CqsClient = Griffin.Cqs.CqsClient; + var NotificationsViewModel = (function () { + function NotificationsViewModel() { + } + NotificationsViewModel.prototype.saveSettings_click = function (e) { + e.isHandled = true; + var dto = this.ctx.readForm("NotificationsView"); + var cmd = new OneTrueError.Core.Users.Commands.UpdateNotifications(); + cmd.NotifyOnNewIncidents = dto.NotifyOnNewIncidents; + cmd.NotifyOnNewReport = dto.NotifyOnNewReport; + cmd.NotifyOnPeaks = dto.NotifyOnPeaks; + cmd.NotifyOnReOpenedIncident = dto.NotifyOnReOpenedIncident; + cmd.NotifyOnUserFeedback = dto.NotifyOnUserFeedback; + CqsClient.command(cmd); + humane.log("Settings have been saved."); + }; + NotificationsViewModel.prototype.getTitle = function () { return "Notifications settings"; }; + NotificationsViewModel.prototype.activate = function (context) { + var _this = this; + this.ctx = context; + context.handle.click("#saveSettings", function (ev) { return _this.saveSettings_click(ev); }); + var query = new GetUserSettings(); + cqs.query(query) + .done(function (result) { + context.render(result.Notifications); + context.resolve(); + }); + }; + NotificationsViewModel.prototype.deactivate = function () { + }; + return NotificationsViewModel; + }()); + User.NotificationsViewModel = NotificationsViewModel; + })(User = OneTrueError.User || (OneTrueError.User = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=NotificationsViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/ViewModels/User/SettingsViewModel.js b/src/Server/OneTrueError.Web/ViewModels/User/SettingsViewModel.js index d869b956..61ee8363 100644 --- a/src/Server/OneTrueError.Web/ViewModels/User/SettingsViewModel.js +++ b/src/Server/OneTrueError.Web/ViewModels/User/SettingsViewModel.js @@ -1,66 +1,66 @@ -/// -/// -var OneTrueError; -(function (OneTrueError) { - var User; - (function (User) { - var cqs = Griffin.Cqs.CqsClient; - var CqsClient = Griffin.Cqs.CqsClient; - var SettingsViewModel = (function () { - function SettingsViewModel() { - } - SettingsViewModel.prototype.changePassword_click = function (e) { - var _this = this; - e.preventDefault(); - var dto = this.context.readForm("PasswordView"); - if (dto.NewPassword !== dto.NewPassword2) { - humane.error("New passwords do not match."); - return; - } - if (!dto.CurrentPassword) { - humane.error("You must enter the current password."); - return; - } - var cmd = new OneTrueError.Core.Accounts.Requests.ChangePassword(dto.CurrentPassword, dto.NewPassword); - CqsClient.request(cmd) - .done(function (result) { - if (result.Success) { - _this.context.render({ NewPassword: "", NewPassword2: "", CurrentPassword: "" }); - humane.log("Password have been changed."); - } - else { - humane.error("Password could not be changed. Did you enter your current password correctly?"); - } - }); - }; - SettingsViewModel.prototype.saveSettings_click = function (e) { - e.isHandled = true; - var dto = this.context.readForm("PersonalSettings"); - var cmd = new OneTrueError.Core.Users.Commands.UpdatePersonalSettings(); - cmd.FirstName = dto.FirstName; - cmd.LastName = dto.LastName; - cmd.MobileNumber = dto.MobileNumber; - CqsClient.command(cmd); - humane.log("Settings have been saved."); - }; - SettingsViewModel.prototype.getTitle = function () { return "Personal settings"; }; - SettingsViewModel.prototype.activate = function (context) { - var _this = this; - this.context = context; - context.handle.click("[name=\"saveSettings\"]", function (ev) { return _this.saveSettings_click(ev); }); - context.handle.click("[name='changePassword']", function (ev) { return _this.changePassword_click(ev); }); - var query = new OneTrueError.Core.Users.Queries.GetUserSettings(); - cqs.query(query) - .done(function (result) { - context.render(result); - context.resolve(); - }); - }; - SettingsViewModel.prototype.deactivate = function () { - }; - return SettingsViewModel; - }()); - User.SettingsViewModel = SettingsViewModel; - })(User = OneTrueError.User || (OneTrueError.User = {})); -})(OneTrueError || (OneTrueError = {})); +/// +/// +var OneTrueError; +(function (OneTrueError) { + var User; + (function (User) { + var cqs = Griffin.Cqs.CqsClient; + var CqsClient = Griffin.Cqs.CqsClient; + var SettingsViewModel = (function () { + function SettingsViewModel() { + } + SettingsViewModel.prototype.changePassword_click = function (e) { + var _this = this; + e.preventDefault(); + var dto = this.context.readForm("PasswordView"); + if (dto.NewPassword !== dto.NewPassword2) { + humane.error("New passwords do not match."); + return; + } + if (!dto.CurrentPassword) { + humane.error("You must enter the current password."); + return; + } + var cmd = new OneTrueError.Core.Accounts.Requests.ChangePassword(dto.CurrentPassword, dto.NewPassword); + CqsClient.request(cmd) + .done(function (result) { + if (result.Success) { + _this.context.render({ NewPassword: "", NewPassword2: "", CurrentPassword: "" }); + humane.log("Password have been changed."); + } + else { + humane.error("Password could not be changed. Did you enter your current password correctly?"); + } + }); + }; + SettingsViewModel.prototype.saveSettings_click = function (e) { + e.isHandled = true; + var dto = this.context.readForm("PersonalSettings"); + var cmd = new OneTrueError.Core.Users.Commands.UpdatePersonalSettings(); + cmd.FirstName = dto.FirstName; + cmd.LastName = dto.LastName; + cmd.MobileNumber = dto.MobileNumber; + CqsClient.command(cmd); + humane.log("Settings have been saved."); + }; + SettingsViewModel.prototype.getTitle = function () { return "Personal settings"; }; + SettingsViewModel.prototype.activate = function (context) { + var _this = this; + this.context = context; + context.handle.click("[name=\"saveSettings\"]", function (ev) { return _this.saveSettings_click(ev); }); + context.handle.click("[name='changePassword']", function (ev) { return _this.changePassword_click(ev); }); + var query = new OneTrueError.Core.Users.Queries.GetUserSettings(); + cqs.query(query) + .done(function (result) { + context.render(result); + context.resolve(); + }); + }; + SettingsViewModel.prototype.deactivate = function () { + }; + return SettingsViewModel; + }()); + User.SettingsViewModel = SettingsViewModel; + })(User = OneTrueError.User || (OneTrueError.User = {})); +})(OneTrueError || (OneTrueError = {})); //# sourceMappingURL=SettingsViewModel.js.map \ No newline at end of file diff --git a/src/Server/OneTrueError.Web/app/Application.js b/src/Server/OneTrueError.Web/app/Application.js index 32c64356..a857760e 100644 --- a/src/Server/OneTrueError.Web/app/Application.js +++ b/src/Server/OneTrueError.Web/app/Application.js @@ -1,36 +1,36 @@ -/// -/// -/// -var OneTrueError; -(function (OneTrueError) { - var Applications; - (function (Applications) { - var Yo = Griffin.Yo; - var CqsClient = Griffin.Cqs.CqsClient; - var ApplicationService = (function () { - function ApplicationService() { - } - ApplicationService.prototype.get = function (applicationId) { - var def = P.defer(); - var cacheItem = Yo.GlobalConfig - .applicationScope["application"]; - if (cacheItem && cacheItem.Id === applicationId) { - def.resolve(cacheItem); - return def.promise(); - } - var query = new OneTrueError.Core.Applications.Queries.GetApplicationInfo(); - query.ApplicationId = applicationId; - CqsClient.query(query) - .done(function (result) { - Yo.GlobalConfig.applicationScope["application"] = result; - def.resolve(result); - }); - return def.promise(); - }; - return ApplicationService; - }()); - Applications.ApplicationService = ApplicationService; - })(Applications = OneTrueError.Applications || (OneTrueError.Applications = {})); -})(OneTrueError || (OneTrueError = {})); -; +/// +/// +/// +var OneTrueError; +(function (OneTrueError) { + var Applications; + (function (Applications) { + var Yo = Griffin.Yo; + var CqsClient = Griffin.Cqs.CqsClient; + var ApplicationService = (function () { + function ApplicationService() { + } + ApplicationService.prototype.get = function (applicationId) { + var def = P.defer(); + var cacheItem = Yo.GlobalConfig + .applicationScope["application"]; + if (cacheItem && cacheItem.Id === applicationId) { + def.resolve(cacheItem); + return def.promise(); + } + var query = new OneTrueError.Core.Applications.Queries.GetApplicationInfo(); + query.ApplicationId = applicationId; + CqsClient.query(query) + .done(function (result) { + Yo.GlobalConfig.applicationScope["application"] = result; + def.resolve(result); + }); + return def.promise(); + }; + return ApplicationService; + }()); + Applications.ApplicationService = ApplicationService; + })(Applications = OneTrueError.Applications || (OneTrueError.Applications = {})); +})(OneTrueError || (OneTrueError = {})); +; //# sourceMappingURL=Application.js.map \ No newline at end of file