bug fix IUserSettings
This commit is contained in:
parent
0965caaf40
commit
0cc82fec5d
5 changed files with 8 additions and 20 deletions
|
|
@ -1,21 +1,12 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using PostIt.Models;
|
||||
using PostIt.Services;
|
||||
using PostIt.ViewModels;
|
||||
using Xunit;
|
||||
|
||||
namespace PostIt;
|
||||
namespace PostIt.Tests;
|
||||
|
||||
public class PostItViewModelTests
|
||||
{
|
||||
|
||||
[Fact]
|
||||
public void SearchCommand_filters_posts_by_title_article_or_author()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ namespace Yavsc.Controllers
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Models;
|
||||
using Models.Workflow;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Server.Helpers;
|
||||
|
||||
[Authorize("AdministratorOnly")]
|
||||
|
|
@ -18,7 +17,7 @@ namespace Yavsc.Controllers
|
|||
readonly IStringLocalizer<ActivityController> SR;
|
||||
readonly ILogger logger;
|
||||
|
||||
public ActivityController(ApplicationDbContext context,
|
||||
public ActivityController(ApplicationDbContext context,
|
||||
IStringLocalizer<ActivityController> SR,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
|
|
@ -65,15 +64,15 @@ namespace Yavsc.Controllers
|
|||
var existing = _context.Activities.Include(a => a.Children).FirstOrDefault(a => a.Code == code);
|
||||
if (existing == null) return acts;
|
||||
var pi = acts.FirstOrDefault(i => i.Value == existing.ParentCode);
|
||||
if (pi!=null) pi.Selected = true;
|
||||
if (pi!=null) pi.Selected = true;
|
||||
else nullItem.Selected = true;
|
||||
RecursivelyFilterChild(acts, existing);
|
||||
RecursivelyFilterChild(acts, existing);
|
||||
return acts;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filters a activity selection list
|
||||
/// in order to exclude any descendant
|
||||
/// in order to exclude any descendant
|
||||
/// from the eligible list at the <c>Parent</c> property.
|
||||
/// WARN! results in a infinite loop when
|
||||
/// data is corrupted and there is a circularity
|
||||
|
|
@ -172,6 +171,7 @@ namespace Yavsc.Controllers
|
|||
_context.SaveChanges(User.GetUserId());
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
SetSettingClasseInfo();
|
||||
return View(activity);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using Microsoft.Extensions.Localization;
|
|||
namespace Yavsc.Controllers
|
||||
{
|
||||
using Helpers;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Models;
|
||||
|
|
@ -16,8 +15,6 @@ namespace Yavsc.Controllers
|
|||
using Models.Workflow;
|
||||
using Services;
|
||||
using Yavsc.Interface;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Yavsc.Settings;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace Yavsc.Helpers
|
|||
foreach (var c in a.GetTypes())
|
||||
{
|
||||
if (c.IsClass && !c.IsAbstract &&
|
||||
c.GetInterface("ISpecializationSettings") != null)
|
||||
c.GetInterface(nameof(IUserSettings)) != null)
|
||||
{
|
||||
Config.ProfileTypes.Add(c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue