diff --git a/Disco.Models/Disco.Models.csproj b/Disco.Models/Disco.Models.csproj index 48b32c7f..b5dc7b8c 100644 --- a/Disco.Models/Disco.Models.csproj +++ b/Disco.Models/Disco.Models.csproj @@ -145,7 +145,6 @@ - diff --git a/Disco.Models/Services/Plugins/Details/DetailsResult.cs b/Disco.Models/Services/Plugins/Details/DetailsResult.cs deleted file mode 100644 index 264e5063..00000000 --- a/Disco.Models/Services/Plugins/Details/DetailsResult.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Disco.Models.Services.Plugins.Details -{ - public class DetailsResult - { - public DateTime GatheredOn { get; private set; } - public DateTime ExpiresOn { get; private set; } - public Dictionary Details { get; } - - public bool SetExpiration(DateTime expireOn) - { - if (ExpiresOn > expireOn) - { - // only set the expiration if it is sooner - ExpiresOn = expireOn; - return true; - } - else - { - return false; - } - } - - public DetailsResult() - { - GatheredOn = DateTime.Now; - ExpiresOn = DateTime.Now.AddDays(7); - Details = new Dictionary(); - } - - [JsonConstructor] - public DetailsResult(DateTime gatheredOn, DateTime expiresOn, Dictionary details) - { - GatheredOn = gatheredOn; - ExpiresOn = expiresOn; - Details = details ?? new Dictionary(); - } - } -} diff --git a/Disco.Models/UI/Device/DeviceShowModel.cs b/Disco.Models/UI/Device/DeviceShowModel.cs index de6222ef..b785b3a5 100644 --- a/Disco.Models/UI/Device/DeviceShowModel.cs +++ b/Disco.Models/UI/Device/DeviceShowModel.cs @@ -1,7 +1,6 @@ using Disco.Models.BI.Config; using Disco.Models.Services.Documents; using Disco.Models.Services.Jobs.JobLists; -using Disco.Models.Services.Plugins.Details; using System.Collections.Generic; namespace Disco.Models.UI.Device @@ -21,7 +20,7 @@ namespace Disco.Models.UI.Device List DocumentTemplates { get; set; } List DocumentTemplatePackages { get; set; } - DetailsResult AssignedUserDetails { get; set; } + Dictionary AssignedUserDetails { get; set; } bool HasAssignedUserPhoto { get; set; } } } diff --git a/Disco.Models/UI/Job/JobShowModel.cs b/Disco.Models/UI/Job/JobShowModel.cs index 494610c6..293bd7ac 100644 --- a/Disco.Models/UI/Job/JobShowModel.cs +++ b/Disco.Models/UI/Job/JobShowModel.cs @@ -1,7 +1,6 @@ using Disco.Models.Services.Documents; using Disco.Models.Services.Job; using Disco.Models.Services.Jobs.JobLists; -using Disco.Models.Services.Plugins.Details; using System; using System.Collections.Generic; @@ -18,7 +17,7 @@ namespace Disco.Models.UI.Job LocationModes LocationMode { get; set; } List LocationOptions { get; set; } - DetailsResult UserDetails { get; set; } + Dictionary UserDetails { get; set; } bool HasUserPhoto { get; set; } } } diff --git a/Disco.Models/UI/User/UserShowModel.cs b/Disco.Models/UI/User/UserShowModel.cs index 483471c8..e2582864 100644 --- a/Disco.Models/UI/User/UserShowModel.cs +++ b/Disco.Models/UI/User/UserShowModel.cs @@ -2,7 +2,6 @@ using Disco.Models.Services.Authorization; using Disco.Models.Services.Documents; using Disco.Models.Services.Jobs.JobLists; -using Disco.Models.Services.Plugins.Details; using System.Collections.Generic; namespace Disco.Models.UI.User @@ -18,7 +17,7 @@ namespace Disco.Models.UI.User IAuthorizationToken AuthorizationToken { get; set; } IClaimNavigatorItem ClaimNavigator { get; set; } - DetailsResult UserDetails { get; set; } + Dictionary UserDetails { get; set; } bool HasUserPhoto { get; set; } } } \ No newline at end of file diff --git a/Disco.Services/Devices/Exporting/DeviceExport.cs b/Disco.Services/Devices/Exporting/DeviceExport.cs index ee922734..be053807 100644 --- a/Disco.Services/Devices/Exporting/DeviceExport.cs +++ b/Disco.Services/Devices/Exporting/DeviceExport.cs @@ -61,7 +61,7 @@ namespace Disco.Services.Devices.Exporting if (Options.AssignedUserDetailCustom && r.AssignedUser != null) { var detailsService = new DetailsProviderService(Database); - r.AssignedUserCustomDetails = detailsService.GetDetails(r.AssignedUser).Details; + r.AssignedUserCustomDetails = detailsService.GetDetails(r.AssignedUser); } }); diff --git a/Disco.Services/Expressions/Expression.cs b/Disco.Services/Expressions/Expression.cs index 1d091a00..4eec93af 100644 --- a/Disco.Services/Expressions/Expression.cs +++ b/Disco.Services/Expressions/Expression.cs @@ -208,15 +208,15 @@ namespace Disco.Services.Expressions { if (target is User targetUser) { - detailsVariables.Add("UserDetails", new LazyDictionary(() => detailsService.GetDetails(targetUser).Details)); + detailsVariables.Add("UserDetails", new LazyDictionary(() => detailsService.GetDetails(targetUser))); } else if (target is Job targetJob) { - detailsVariables.Add("UserDetails", targetJob.User == null ? (IDictionary)new Dictionary() : new LazyDictionary(() => detailsService.GetDetails(targetJob.User).Details)); + detailsVariables.Add("UserDetails", targetJob.User == null ? (IDictionary)new Dictionary() : new LazyDictionary(() => detailsService.GetDetails(targetJob.User))); } else if (target is Device targetDevice) { - detailsVariables.Add("UserDetails", targetDevice.AssignedUser == null ? (IDictionary)new Dictionary() : new LazyDictionary(() => detailsService.GetDetails(targetDevice.AssignedUser).Details)); + detailsVariables.Add("UserDetails", targetDevice.AssignedUser == null ? (IDictionary)new Dictionary() : new LazyDictionary(() => detailsService.GetDetails(targetDevice.AssignedUser))); } } diff --git a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderFeature.cs b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderFeature.cs index bd48240a..9c79cf8c 100644 --- a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderFeature.cs +++ b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderFeature.cs @@ -1,6 +1,5 @@ using Disco.Data.Repository; using Disco.Models.Repository; -using Disco.Models.Services.Plugins.Details; using System; namespace Disco.Services.Plugins.Features.DetailsProvider @@ -8,9 +7,8 @@ namespace Disco.Services.Plugins.Features.DetailsProvider [PluginFeatureCategory(DisplayName = "Detail Providers")] public abstract class DetailsProviderFeature : PluginFeature { - public abstract DetailsResult GetDetails(DiscoDataContext database, User user, DateTime? cacheTimestamp); - [Obsolete("Never used")] - public abstract DetailsResult GetDetails(DiscoDataContext database, Device device, DateTime? cacheTimestamp); + public abstract void UpdateAllDetails(DiscoDataContext database); + public abstract byte[] GetUserPhoto(DiscoDataContext database, User user, DateTime? cacheTimestamp); } } diff --git a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs index a8074417..836b44ed 100644 --- a/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs +++ b/Disco.Services/Plugins/Features/DetailsProvider/DetailsProviderService.cs @@ -1,10 +1,9 @@ using Disco.Data.Repository; using Disco.Models.Repository; -using Disco.Models.Services.Plugins.Details; using Disco.Services.Authorization; using Disco.Services.Users; -using Newtonsoft.Json; using System; +using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; @@ -86,77 +85,23 @@ namespace Disco.Services.Plugins.Features.DetailsProvider return Path.Combine(database.DiscoConfiguration.PluginUserPhotosLocation, userHash.Substring(0, 2), $"{userHash}.jpg"); } - public DetailsResult GetDetails(User user) + public Dictionary GetDetails(User user) { - var result = new DetailsResult(); - var saveChangesRequired = false; - if (!UserService.CurrentAuthorization.HasAll(Claims.User.Show, Claims.User.ShowDetails)) - return result; + return new Dictionary(); - var features = Plugins.GetPluginFeatures(typeof(DetailsProviderFeature)); - - if (features.Count == 0) - return result; - - var cache = user.UserDetails?.Where(d => d.Scope == DetailsScope).ToDictionary(d => d.Key, d => new { DbDetails = d, Details = JsonConvert.DeserializeObject(d.Value) }, StringComparer.OrdinalIgnoreCase); - - foreach (var feature in features) + if (user.UserDetails != null) { - var featureResult = default(DetailsResult); - if (!cache.TryGetValue(feature.Id, out var cacheResult) || cacheResult.Details.ExpiresOn < DateTime.Now || cacheResult.Details.GatheredOn < database.DiscoConfiguration.PluginDetailsCacheExpiration) - { - var timestamp = cacheResult?.Details.GatheredOn; - if (timestamp.HasValue && timestamp.Value < database.DiscoConfiguration.PluginDetailsCacheExpiration) - timestamp = null; - - try - { - var featureInstance = feature.CreateInstance(); - featureResult = featureInstance.GetDetails(database, user, timestamp); - - if (featureResult != null) - { - if (featureResult.ExpiresOn > DateTime.Now) - { - if (cacheResult == null) - database.UserDetails.Add(new UserDetail() { UserId = user.UserId, Scope = DetailsScope, Key = feature.Id, Value = JsonConvert.SerializeObject(featureResult) }); - else - cacheResult.DbDetails.Value = JsonConvert.SerializeObject(featureResult); - saveChangesRequired = true; - } - else if (cacheResult != null) - { - database.UserDetails.Remove(cacheResult.DbDetails); - saveChangesRequired = true; - } - } - } - catch (Exception) - { - // ignore exceptions when plugins behave badly - } - } - else - { - featureResult = cacheResult.Details; - } - - // apply feature results - if (featureResult != null) - { - result.SetExpiration(featureResult.ExpiresOn); - foreach (var value in featureResult.Details) - { - result.Details[value.Key] = value.Value; - } - } + return user.UserDetails + .Where(d => string.Equals(d.Scope, DetailsScope, StringComparison.Ordinal)) + .ToDictionary(d => d.Key, d => d.Value, StringComparer.OrdinalIgnoreCase); + } else + { + return database.UserDetails + .Where(d => d.UserId == user.UserId && + d.Scope == DetailsScope) + .ToDictionary(d => d.Key, d => d.Value, StringComparer.OrdinalIgnoreCase); } - - if (saveChangesRequired) - database.SaveChanges(); - - return result; } } } diff --git a/Disco.Services/Users/Contact/UserContactService.cs b/Disco.Services/Users/Contact/UserContactService.cs index 06b1ec4e..8aa054fd 100644 --- a/Disco.Services/Users/Contact/UserContactService.cs +++ b/Disco.Services/Users/Contact/UserContactService.cs @@ -67,10 +67,10 @@ namespace Disco.Services.Users.Contact user = database.Users.First(u => u.UserId == user.UserId); var details = service.GetDetails(user); - if ((details?.Details?.Count ?? 0) == 0) + if ((details?.Count ?? 0) == 0) yield break; - foreach (var item in details.Details) + foreach (var item in details) { if (!contactType.HasValue || contactType.Value.HasFlag(UserContactType.Email)) { diff --git a/Disco.Web/Controllers/DeviceController.cs b/Disco.Web/Controllers/DeviceController.cs index cea6a428..1ea1147f 100644 --- a/Disco.Web/Controllers/DeviceController.cs +++ b/Disco.Web/Controllers/DeviceController.cs @@ -283,8 +283,11 @@ namespace Disco.Web.Controllers m.DeviceProfileWirelessProfileProviders = m.Device.DeviceProfile.GetWirelessProfileProviders().ToList(); } - // Populate Custom Details - m.PopulateDetails(Database); + if (Authorization.Has(Claims.User.ShowDetails)) + { + // Populate Custom Details + m.PopulateDetails(Database); + } // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); diff --git a/Disco.Web/Controllers/JobController.cs b/Disco.Web/Controllers/JobController.cs index ecef8c83..38c6fd3c 100644 --- a/Disco.Web/Controllers/JobController.cs +++ b/Disco.Web/Controllers/JobController.cs @@ -377,7 +377,10 @@ namespace Disco.Web.Controllers } // Populate Custom Details - m.PopulateDetails(Database); + if (Authorization.Has(Claims.User.ShowDetails)) + { + m.PopulateDetails(Database); + } // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); @@ -847,7 +850,7 @@ namespace Disco.Web.Controllers Tuple details = providerInstance.JobDetails(Database, this, job); model.JobDetailsSupported = true; - model.ViewType = details.Item1; + model.ViewType = details.Item1; model.ViewModel = details.Item2; return View(model); } diff --git a/Disco.Web/Controllers/UserController.cs b/Disco.Web/Controllers/UserController.cs index 4b78416c..44d6b7ac 100644 --- a/Disco.Web/Controllers/UserController.cs +++ b/Disco.Web/Controllers/UserController.cs @@ -114,7 +114,10 @@ namespace Disco.Web.Controllers } // Populate Custom Details - m.PopulateDetails(Database); + if (Authorization.Has(Claims.User.ShowDetails)) + { + m.PopulateDetails(Database); + } // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); diff --git a/Disco.Web/Models/Device/ShowModel.cs b/Disco.Web/Models/Device/ShowModel.cs index ce7ddf80..22cc971a 100644 --- a/Disco.Web/Models/Device/ShowModel.cs +++ b/Disco.Web/Models/Device/ShowModel.cs @@ -1,6 +1,5 @@ using Disco.Models.Services.Documents; using Disco.Models.Services.Jobs.JobLists; -using Disco.Models.Services.Plugins.Details; using Disco.Models.UI.Device; using Disco.Services.Plugins; using Disco.Services.Plugins.Features.DocumentHandlerProvider; @@ -35,7 +34,7 @@ namespace Disco.Web.Models.Device HandlersPresent = Plugins.GetPluginFeatures(typeof(DocumentHandlerProviderFeature)).Any(), }; - public DetailsResult AssignedUserDetails { get; set; } + public Dictionary AssignedUserDetails { get; set; } public bool HasAssignedUserPhoto { get; set; } } } \ No newline at end of file diff --git a/Disco.Web/Models/Job/ShowModel.cs b/Disco.Web/Models/Job/ShowModel.cs index 39970fc5..3f45575c 100644 --- a/Disco.Web/Models/Job/ShowModel.cs +++ b/Disco.Web/Models/Job/ShowModel.cs @@ -1,7 +1,6 @@ using Disco.Models.Services.Documents; using Disco.Models.Services.Job; using Disco.Models.Services.Jobs.JobLists; -using Disco.Models.Services.Plugins.Details; using Disco.Models.UI.Job; using Disco.Services.Plugins; using Disco.Services.Plugins.Features.DocumentHandlerProvider; @@ -34,7 +33,7 @@ namespace Disco.Web.Models.Job public LocationModes LocationMode { get; set; } public List LocationOptions { get; set; } - public DetailsResult UserDetails { get; set; } + public Dictionary UserDetails { get; set; } public bool HasUserPhoto { get; set; } } } \ No newline at end of file diff --git a/Disco.Web/Models/User/ShowModel.cs b/Disco.Web/Models/User/ShowModel.cs index 4247cd35..a10b71a7 100644 --- a/Disco.Web/Models/User/ShowModel.cs +++ b/Disco.Web/Models/User/ShowModel.cs @@ -2,7 +2,6 @@ using Disco.Models.Services.Authorization; using Disco.Models.Services.Documents; using Disco.Models.Services.Jobs.JobLists; -using Disco.Models.Services.Plugins.Details; using Disco.Models.UI.User; using Disco.Services.Plugins; using Disco.Services.Plugins.Features.DocumentHandlerProvider; @@ -31,7 +30,7 @@ namespace Disco.Web.Models.User public IAuthorizationToken AuthorizationToken { get; set; } public IClaimNavigatorItem ClaimNavigator { get; set; } - public DetailsResult UserDetails { get; set; } + public Dictionary UserDetails { get; set; } public bool HasUserPhoto { get; set; } public FancyTreeNode[] ClaimNavigatorFancyTreeNodes diff --git a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml index ee6550d5..ab223811 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml +++ b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml @@ -272,10 +272,10 @@ } - @if (Model.AssignedUserDetails != null && Model.AssignedUserDetails.Details.Count(d => !d.Key.EndsWith("&")) > 0) + @if (Model.AssignedUserDetails != null && Model.AssignedUserDetails.Count(d => !d.Key.EndsWith("&")) > 0) {
- @foreach (var detail in Model.AssignedUserDetails.Details.Where(d => !d.Key.EndsWith("&"))) + @foreach (var detail in Model.AssignedUserDetails.Where(d => !d.Key.EndsWith("&"))) {
@detail.Key.TrimEnd('*'): diff --git a/Disco.Web/Views/Device/DeviceParts/_Subject.generated.cs b/Disco.Web/Views/Device/DeviceParts/_Subject.generated.cs index 32ac989b..64043548 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Subject.generated.cs +++ b/Disco.Web/Views/Device/DeviceParts/_Subject.generated.cs @@ -1212,7 +1212,7 @@ WriteLiteral(" "); #line 275 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - if (Model.AssignedUserDetails != null && Model.AssignedUserDetails.Details.Count(d => !d.Key.EndsWith("&")) > 0) + if (Model.AssignedUserDetails != null && Model.AssignedUserDetails.Count(d => !d.Key.EndsWith("&")) > 0) { @@ -1234,7 +1234,7 @@ WriteLiteral(">\r\n"); #line hidden #line 278 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - foreach (var detail in Model.AssignedUserDetails.Details.Where(d => !d.Key.EndsWith("&"))) + foreach (var detail in Model.AssignedUserDetails.Where(d => !d.Key.EndsWith("&"))) { @@ -1691,39 +1691,39 @@ WriteLiteral("\""); WriteLiteral(" name=\"DeviceProfile\""); -WriteAttribute("id", Tuple.Create(" id=\"", 25287), Tuple.Create("\"", 25314) -, Tuple.Create(Tuple.Create("", 25292), Tuple.Create("DeviceProfile_", 25292), true) +WriteAttribute("id", Tuple.Create(" id=\"", 25271), Tuple.Create("\"", 25298) +, Tuple.Create(Tuple.Create("", 25276), Tuple.Create("DeviceProfile_", 25276), true) #line 397 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 25306), Tuple.Create(dp.Id + , Tuple.Create(Tuple.Create("", 25290), Tuple.Create(dp.Id #line default #line hidden -, 25306), false) +, 25290), false) ); WriteLiteral(" />(dp.Id + , Tuple.Create(Tuple.Create("", 25328), Tuple.Create(dp.Id #line default #line hidden -, 25344), false) +, 25328), false) ); -WriteAttribute("title", Tuple.Create(" title=\"", 25353), Tuple.Create("\"", 25397) -, Tuple.Create(Tuple.Create("", 25361), Tuple.Create("Distribution:", 25361), true) +WriteAttribute("title", Tuple.Create(" title=\"", 25337), Tuple.Create("\"", 25381) +, Tuple.Create(Tuple.Create("", 25345), Tuple.Create("Distribution:", 25345), true) #line 397 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create(" ", 25374), Tuple.Create(dp.DistributionType + , Tuple.Create(Tuple.Create(" ", 25358), Tuple.Create(dp.DistributionType #line default #line hidden -, 25375), false) +, 25359), false) ); WriteLiteral(">"); @@ -1933,14 +1933,14 @@ WriteLiteral(" title=\"Warranty Valid Until\""); WriteLiteral(">Warranty Until:\r\n \r\n " + " (Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null +, Tuple.Create(Tuple.Create("", 31049), Tuple.Create(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null #line default #line hidden -, 31065), false) +, 31049), false) ); WriteLiteral(">\r\n"); @@ -1981,14 +1981,14 @@ WriteLiteral(" title=\"Insured Until\""); WriteLiteral(">Insured Until:\r\n \r\n " + " (Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null +, Tuple.Create(Tuple.Create("", 32051), Tuple.Create(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null #line default #line hidden -, 32067), false) +, 32051), false) ); WriteLiteral(">\r\n"); @@ -2094,39 +2094,39 @@ WriteLiteral("\""); WriteLiteral(" name=\"DeviceBatch\""); -WriteAttribute("id", Tuple.Create(" id=\"", 33383), Tuple.Create("\"", 33408) -, Tuple.Create(Tuple.Create("", 33388), Tuple.Create("DeviceBatch_", 33388), true) +WriteAttribute("id", Tuple.Create(" id=\"", 33367), Tuple.Create("\"", 33392) +, Tuple.Create(Tuple.Create("", 33372), Tuple.Create("DeviceBatch_", 33372), true) #line 527 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 33400), Tuple.Create(db.Id + , Tuple.Create(Tuple.Create("", 33384), Tuple.Create(db.Id #line default #line hidden -, 33400), false) +, 33384), false) ); WriteLiteral(" />(db.Id + , Tuple.Create(Tuple.Create("", 33420), Tuple.Create(db.Id #line default #line hidden -, 33436), false) +, 33420), false) ); -WriteAttribute("title", Tuple.Create(" title=\"", 33445), Tuple.Create("\"", 33501) -, Tuple.Create(Tuple.Create("", 33453), Tuple.Create("Purchased:", 33453), true) +WriteAttribute("title", Tuple.Create(" title=\"", 33429), Tuple.Create("\"", 33485) +, Tuple.Create(Tuple.Create("", 33437), Tuple.Create("Purchased:", 33437), true) #line 527 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create(" ", 33463), Tuple.Create(db.PurchaseDate.ToLongDateString() + , Tuple.Create(Tuple.Create(" ", 33447), Tuple.Create(db.PurchaseDate.ToLongDateString() #line default #line hidden -, 33464), false) +, 33448), false) ); WriteLiteral(">"); @@ -2285,14 +2285,14 @@ WriteLiteral(" id=\"Device_Show_Aspects_Model_Image\""); WriteLiteral(" alt=\"Model Image\""); -WriteAttribute("src", Tuple.Create(" src=\"", 38248), Tuple.Create("\"", 38358) +WriteAttribute("src", Tuple.Create(" src=\"", 38232), Tuple.Create("\"", 38342) #line 604 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 38254), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) + , Tuple.Create(Tuple.Create("", 38238), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) #line default #line hidden -, 38254), false) +, 38238), false) ); WriteLiteral(" />\r\n
\r\n
\r\n \r\n \r\n \r\n WriteLiteral(" type=\"radio\""); -WriteAttribute("id", Tuple.Create(" id=\"", 49923), Tuple.Create("\"", 50001) -, Tuple.Create(Tuple.Create("", 49928), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 49928), true) +WriteAttribute("id", Tuple.Create(" id=\"", 49907), Tuple.Create("\"", 49985) +, Tuple.Create(Tuple.Create("", 49912), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 49912), true) #line 808 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 49975), Tuple.Create((int)decommissionReason + , Tuple.Create(Tuple.Create("", 49959), Tuple.Create((int)decommissionReason #line default #line hidden -, 49975), false) +, 49959), false) ); WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Dec" + "ommission_Reason\""); -WriteAttribute("value", Tuple.Create(" value=\"", 50100), Tuple.Create("\"", 50134) +WriteAttribute("value", Tuple.Create(" value=\"", 50084), Tuple.Create("\"", 50118) #line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 50108), Tuple.Create((int)decommissionReason + , Tuple.Create(Tuple.Create("", 50092), Tuple.Create((int)decommissionReason #line default #line hidden -, 50108), false) +, 50092), false) ); WriteLiteral(" "); @@ -2818,15 +2818,15 @@ WriteLiteral(" "); #line hidden WriteLiteral(" />\r\n ((int)decommissionReason + , Tuple.Create(Tuple.Create("", 50315), Tuple.Create((int)decommissionReason #line default #line hidden -, 50331), false) +, 50315), false) ); WriteLiteral(">"); diff --git a/Disco.Web/Views/Job/JobParts/_Subject.cshtml b/Disco.Web/Views/Job/JobParts/_Subject.cshtml index bc774ae2..70a000e8 100644 --- a/Disco.Web/Views/Job/JobParts/_Subject.cshtml +++ b/Disco.Web/Views/Job/JobParts/_Subject.cshtml @@ -499,10 +499,10 @@ Since: @Model.Job.WaitingForUserAction.ToFullDateTime() } - @if (Model.UserDetails != null && Model.UserDetails.Details.Count(d => !d.Key.EndsWith("&")) > 0) + @if (Model.UserDetails != null && Model.UserDetails.Count(d => !d.Key.EndsWith("&")) > 0) {
- @foreach (var detail in Model.UserDetails.Details.Where(d => !d.Key.EndsWith("&"))) + @foreach (var detail in Model.UserDetails.Where(d => !d.Key.EndsWith("&"))) {
@detail.Key.TrimEnd('*'): diff --git a/Disco.Web/Views/Job/JobParts/_Subject.generated.cs b/Disco.Web/Views/Job/JobParts/_Subject.generated.cs index 162b57cc..d0c953d4 100644 --- a/Disco.Web/Views/Job/JobParts/_Subject.generated.cs +++ b/Disco.Web/Views/Job/JobParts/_Subject.generated.cs @@ -1959,7 +1959,7 @@ WriteLiteral(" "); #line 502 "..\..\Views\Job\JobParts\_Subject.cshtml" - if (Model.UserDetails != null && Model.UserDetails.Details.Count(d => !d.Key.EndsWith("&")) > 0) + if (Model.UserDetails != null && Model.UserDetails.Count(d => !d.Key.EndsWith("&")) > 0) { @@ -1981,7 +1981,7 @@ WriteLiteral(">\r\n"); #line hidden #line 505 "..\..\Views\Job\JobParts\_Subject.cshtml" - foreach (var detail in Model.UserDetails.Details.Where(d => !d.Key.EndsWith("&"))) + foreach (var detail in Model.UserDetails.Where(d => !d.Key.EndsWith("&"))) { @@ -2557,14 +2557,14 @@ WriteLiteral(" type=\"hidden\""); WriteLiteral(" name=\"JobId\""); -WriteAttribute("value", Tuple.Create(" value=\"", 47112), Tuple.Create("\"", 47133) +WriteAttribute("value", Tuple.Create(" value=\"", 47096), Tuple.Create("\"", 47117) #line 733 "..\..\Views\Job\JobParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 47120), Tuple.Create(Model.Job.Id + , Tuple.Create(Tuple.Create("", 47104), Tuple.Create(Model.Job.Id #line default #line hidden -, 47120), false) +, 47104), false) ); WriteLiteral(" />\r\n"); @@ -2628,26 +2628,26 @@ WriteLiteral("\""); WriteLiteral(">\r\n (jobQueue.Icon +, Tuple.Create(Tuple.Create("", 47600), Tuple.Create(jobQueue.Icon #line default #line hidden -, 47616), false) -, Tuple.Create(Tuple.Create(" ", 47632), Tuple.Create("fa-fw", 47633), true) -, Tuple.Create(Tuple.Create(" ", 47638), Tuple.Create("fa-lg", 47639), true) -, Tuple.Create(Tuple.Create(" ", 47644), Tuple.Create("d-", 47645), true) +, 47600), false) +, Tuple.Create(Tuple.Create(" ", 47616), Tuple.Create("fa-fw", 47617), true) +, Tuple.Create(Tuple.Create(" ", 47622), Tuple.Create("fa-lg", 47623), true) +, Tuple.Create(Tuple.Create(" ", 47628), Tuple.Create("d-", 47629), true) #line 738 "..\..\Views\Job\JobParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 47647), Tuple.Create(jobQueue.IconColour + , Tuple.Create(Tuple.Create("", 47631), Tuple.Create(jobQueue.IconColour #line default #line hidden -, 47647), false) +, 47631), false) ); WriteLiteral(">"); @@ -2688,27 +2688,27 @@ WriteLiteral(" "); #line hidden WriteLiteral(" (priorityValue.ToLower() + , Tuple.Create(Tuple.Create("", 48072), Tuple.Create(priorityValue.ToLower() #line default #line hidden -, 48088), false) +, 48072), false) ); -WriteAttribute("title", Tuple.Create(" title=\"", 48115), Tuple.Create("\"", 48148) +WriteAttribute("title", Tuple.Create(" title=\"", 48099), Tuple.Create("\"", 48132) #line 745 "..\..\Views\Job\JobParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 48123), Tuple.Create(priorityValue + , Tuple.Create(Tuple.Create("", 48107), Tuple.Create(priorityValue #line default #line hidden -, 48123), false) -, Tuple.Create(Tuple.Create(" ", 48139), Tuple.Create("Priority", 48140), true) +, 48107), false) +, Tuple.Create(Tuple.Create(" ", 48123), Tuple.Create("Priority", 48124), true) ); WriteLiteral(">\r\n
\r\n
\r\n " + diff --git a/Disco.Web/Views/User/UserParts/_Subject.cshtml b/Disco.Web/Views/User/UserParts/_Subject.cshtml index 3afe4079..4fff1da9 100644 --- a/Disco.Web/Views/User/UserParts/_Subject.cshtml +++ b/Disco.Web/Views/User/UserParts/_Subject.cshtml @@ -72,11 +72,11 @@
} - @if (Model.UserDetails != null && Model.UserDetails.Details.Count(d => !d.Key.EndsWith("&")) > 0) + @if (Model.UserDetails != null && Model.UserDetails.Count(d => !d.Key.EndsWith("&")) > 0) {
- @foreach (var detail in Model.UserDetails.Details.Where(d => !d.Key.EndsWith("&"))) + @foreach (var detail in Model.UserDetails.Where(d => !d.Key.EndsWith("&"))) { diff --git a/Disco.Web/Views/User/UserParts/_Subject.generated.cs b/Disco.Web/Views/User/UserParts/_Subject.generated.cs index ad12399e..f0a6fffc 100644 --- a/Disco.Web/Views/User/UserParts/_Subject.generated.cs +++ b/Disco.Web/Views/User/UserParts/_Subject.generated.cs @@ -375,7 +375,7 @@ WriteLiteral(" "); #line 75 "..\..\Views\User\UserParts\_Subject.cshtml" - if (Model.UserDetails != null && Model.UserDetails.Details.Count(d => !d.Key.EndsWith("&")) > 0) + if (Model.UserDetails != null && Model.UserDetails.Count(d => !d.Key.EndsWith("&")) > 0) { @@ -401,7 +401,7 @@ WriteLiteral(">\r\n"); #line hidden #line 79 "..\..\Views\User\UserParts\_Subject.cshtml" - foreach (var detail in Model.UserDetails.Details.Where(d => !d.Key.EndsWith("&"))) + foreach (var detail in Model.UserDetails.Where(d => !d.Key.EndsWith("&"))) { @@ -664,14 +664,14 @@ WriteLiteral(" class=\"CreateJob_Assignment_Image\""); WriteLiteral(" alt=\"Model Image\""); -WriteAttribute("src", Tuple.Create(" src=\"", 8645), Tuple.Create("\"", 8766) +WriteAttribute("src", Tuple.Create(" src=\"", 8629), Tuple.Create("\"", 8750) #line 140 "..\..\Views\User\UserParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 8651), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash())) + , Tuple.Create(Tuple.Create("", 8635), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash())) #line default #line hidden -, 8651), false) +, 8635), false) ); WriteLiteral(@" /> @@ -929,14 +929,14 @@ WriteLiteral(" type=\"hidden\""); WriteLiteral(" name=\"UserId\""); -WriteAttribute("value", Tuple.Create(" value=\"", 15831), Tuple.Create("\"", 15857) +WriteAttribute("value", Tuple.Create(" value=\"", 15815), Tuple.Create("\"", 15841) #line 245 "..\..\Views\User\UserParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 15839), Tuple.Create(Model.User.UserId + , Tuple.Create(Tuple.Create("", 15823), Tuple.Create(Model.User.UserId #line default #line hidden -, 15839), false) +, 15823), false) ); WriteLiteral(" />\r\n"); @@ -978,26 +978,26 @@ WriteLiteral("\""); WriteLiteral(">\r\n (userFlag.Icon +, Tuple.Create(Tuple.Create("", 16229), Tuple.Create(userFlag.Icon #line default #line hidden -, 16245), false) -, Tuple.Create(Tuple.Create(" ", 16261), Tuple.Create("fa-fw", 16262), true) -, Tuple.Create(Tuple.Create(" ", 16267), Tuple.Create("fa-lg", 16268), true) -, Tuple.Create(Tuple.Create(" ", 16273), Tuple.Create("d-", 16274), true) +, 16229), false) +, Tuple.Create(Tuple.Create(" ", 16245), Tuple.Create("fa-fw", 16246), true) +, Tuple.Create(Tuple.Create(" ", 16251), Tuple.Create("fa-lg", 16252), true) +, Tuple.Create(Tuple.Create(" ", 16257), Tuple.Create("d-", 16258), true) #line 250 "..\..\Views\User\UserParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 16276), Tuple.Create(userFlag.IconColour + , Tuple.Create(Tuple.Create("", 16260), Tuple.Create(userFlag.IconColour #line default #line hidden -, 16276), false) +, 16260), false) ); WriteLiteral(">"); @@ -1178,14 +1178,14 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (Url.Action(MVC.Device.Show(assignment.Device.SerialNumber)) +, Tuple.Create(Tuple.Create("", 21687), Tuple.Create(Url.Action(MVC.Device.Show(assignment.Device.SerialNumber)) #line default #line hidden -, 21703), false) +, 21687), false) ); WriteLiteral(">\r\n (Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash())) + , Tuple.Create(Tuple.Create("", 21885), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash())) #line default #line hidden -, 21901), false) +, 21885), false) ); WriteLiteral(" />\r\n \r\n"); @@ -1221,14 +1221,14 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Image\""); WriteLiteral(" alt=\"Model Image\""); -WriteAttribute("src", Tuple.Create(" src=\"", 22328), Tuple.Create("\"", 22449) +WriteAttribute("src", Tuple.Create(" src=\"", 22312), Tuple.Create("\"", 22433) #line 350 "..\..\Views\User\UserParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 22334), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash())) + , Tuple.Create(Tuple.Create("", 22318), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash())) #line default #line hidden -, 22334), false) +, 22318), false) ); WriteLiteral(" />\r\n");
@detail.Key.TrimEnd('*'):