open source update. Fixed Database filters, added docs page
This commit is contained in:
@@ -5,13 +5,17 @@ using Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Model.Work.Tasks;
|
||||
|
||||
namespace Services.Work;
|
||||
namespace Services.Development;
|
||||
|
||||
public class AgileService : IAgileService {
|
||||
private readonly HttpClient httpClient;
|
||||
|
||||
private bool isLoaded;
|
||||
|
||||
|
||||
private event Action _onChange;
|
||||
|
||||
|
||||
public AgileService(HttpClient httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
@@ -46,8 +50,8 @@ public class AgileService : IAgileService {
|
||||
return;
|
||||
}
|
||||
|
||||
SprintModels = (await httpClient.GetFromJsonAsync<SprintModel[]>("generated/SprintModels.json")).ToList();
|
||||
TaskModels =(await httpClient.GetFromJsonAsync<TaskModel[]>("generated/TaskModels.json")).ToList();
|
||||
SprintModels = (await httpClient.GetFromJsonAsync<SprintModel[]>("generated/SprintModels.json")?? Array.Empty<SprintModel>() ).ToList();
|
||||
TaskModels =(await httpClient.GetFromJsonAsync<TaskModel[]>("generated/TaskModels.json") ?? Array.Empty<TaskModel>()).ToList();
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
@@ -76,8 +80,6 @@ public class AgileService : IAgileService {
|
||||
NotifyDataChanged();
|
||||
}
|
||||
|
||||
private event Action _onChange;
|
||||
|
||||
private void NotifyDataChanged() {
|
||||
_onChange?.Invoke();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
using System.Net.Http.Json;
|
||||
using Model.Documentation;
|
||||
|
||||
#if NO_SQL
|
||||
|
||||
#else
|
||||
using Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#endif
|
||||
|
||||
namespace Services.Development;
|
||||
|
||||
public class DocumentationService : IDocumentationService
|
||||
{
|
||||
private readonly HttpClient httpClient;
|
||||
|
||||
private bool isLoaded;
|
||||
|
||||
|
||||
private event Action _onChange;
|
||||
|
||||
|
||||
public DocumentationService(HttpClient httpClient)
|
||||
{
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
|
||||
public List<DocumentationModel> DocumentationModels { get; set; }
|
||||
|
||||
|
||||
public void Subscribe(Action action)
|
||||
{
|
||||
_onChange += action;
|
||||
}
|
||||
|
||||
public void Unsubscribe(Action action)
|
||||
{
|
||||
_onChange -= action;
|
||||
}
|
||||
|
||||
public bool IsLoaded()
|
||||
{
|
||||
return isLoaded;
|
||||
}
|
||||
|
||||
|
||||
public async Task Load()
|
||||
{
|
||||
if (isLoaded) return;
|
||||
|
||||
DocumentationModels =
|
||||
(await httpClient.GetFromJsonAsync<DocumentationModel[]>("generated/DocumentationModels.json") ?? Array.Empty<DocumentationModel>()).ToList();
|
||||
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
NotifyDataChanged();
|
||||
}
|
||||
|
||||
|
||||
public void Update()
|
||||
{
|
||||
NotifyDataChanged();
|
||||
}
|
||||
|
||||
|
||||
private void NotifyDataChanged()
|
||||
{
|
||||
_onChange?.Invoke();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
using System.Net.Http.Json;
|
||||
using System.Net.Http.Json;
|
||||
using Model.Work.Git;
|
||||
|
||||
#if NO_SQL
|
||||
@@ -10,7 +8,7 @@ using Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#endif
|
||||
|
||||
namespace Services.Work;
|
||||
namespace Services.Development;
|
||||
|
||||
public class GitService : IGitService {
|
||||
private readonly HttpClient httpClient;
|
||||
@@ -53,8 +51,8 @@ public class GitService : IGitService {
|
||||
return;
|
||||
}
|
||||
|
||||
ChangeModels = (await httpClient.GetFromJsonAsync<ChangeModel[]>("generated/ChangeModels.json")).ToList();
|
||||
PatchModels = (await httpClient.GetFromJsonAsync<PatchModel[]>("generated/PatchModels.json")).ToList();
|
||||
ChangeModels = (await httpClient.GetFromJsonAsync<ChangeModel[]>("generated/ChangeModels.json") ?? Array.Empty<ChangeModel>()).ToList();
|
||||
PatchModels = (await httpClient.GetFromJsonAsync<PatchModel[]>("generated/PatchModels.json") ?? Array.Empty<PatchModel>()).ToList();
|
||||
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
|
||||
|
||||
using System.Net.Http.Json;
|
||||
using System.Net.Http.Json;
|
||||
using Model.Immortal.Notes;
|
||||
using Model.Work.Git;
|
||||
|
||||
#if NO_SQL
|
||||
|
||||
@@ -11,7 +8,7 @@ using Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#endif
|
||||
|
||||
namespace Services.Work;
|
||||
namespace Services.Development;
|
||||
|
||||
public class NoteService : INoteService {
|
||||
private readonly HttpClient httpClient;
|
||||
@@ -52,7 +49,7 @@ public class NoteService : INoteService {
|
||||
return;
|
||||
}
|
||||
|
||||
NoteModels = (await httpClient.GetFromJsonAsync<NoteModel[]>("generated/NoteModels.json")).ToList();
|
||||
NoteModels = (await httpClient.GetFromJsonAsync<NoteModel[]>("generated/NoteModels.json") ?? Array.Empty<NoteModel>()).ToList();
|
||||
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#endif
|
||||
using Model.Documentation;
|
||||
using Model.Immortal.BuildOrders;
|
||||
using Model.Immortal.Economy;
|
||||
using Model.Immortal.Entity;
|
||||
@@ -92,6 +93,16 @@ public interface INoteService {
|
||||
public bool IsLoaded();
|
||||
}
|
||||
|
||||
public interface IDocumentationService {
|
||||
public List<DocumentationModel> DocumentationModels { get; set; }
|
||||
public void Subscribe(Action action);
|
||||
public void Unsubscribe(Action action);
|
||||
public void Update();
|
||||
public Task Load();
|
||||
public bool IsLoaded();
|
||||
}
|
||||
|
||||
|
||||
public interface IGitService {
|
||||
|
||||
#if NO_SQL
|
||||
|
||||
@@ -142,7 +142,7 @@ public class EntityFilterService : IEntityFilterService {
|
||||
private void RefreshEntityChoices() {
|
||||
_entityChoices.Clear();
|
||||
|
||||
if (_selectedFaction == FactionType.QRath || _selectedFaction == FactionType.Aru) {
|
||||
if (_selectedFaction == FactionType.QRath || _selectedFaction == FactionType.Aru || _selectedFaction == FactionType.Any) {
|
||||
_entityChoices.Add(EntityType.Army);
|
||||
_entityChoices.Add(EntityType.Immortal);
|
||||
_entityChoices.Add(EntityType.Passive);
|
||||
@@ -150,16 +150,10 @@ public class EntityFilterService : IEntityFilterService {
|
||||
_entityChoices.Add(EntityType.Tech);
|
||||
_entityChoices.Add(EntityType.Ability);
|
||||
_entityChoices.Add(EntityType.Pyre_Spell);
|
||||
_entityChoices.Add(EntityType.Building_Upgrade);
|
||||
_entityChoices.Add(EntityType.Worker);
|
||||
}
|
||||
|
||||
if (_selectedFaction == FactionType.Any) {
|
||||
_entityChoices.Add(EntityType.Teapot);
|
||||
_entityChoices.Add(EntityType.Command);
|
||||
_entityChoices.Add(EntityType.Pyre_Event);
|
||||
_entityChoices.Add(EntityType.Family);
|
||||
_entityChoices.Add(EntityType.Faction);
|
||||
_entityChoices.Add(EntityType.Any);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
using Model.Website;
|
||||
|
||||
namespace Services.Work;
|
||||
namespace Services.Development;
|
||||
|
||||
public class WebsiteService : IWebsiteService {
|
||||
private readonly HttpClient httpClient;
|
||||
|
||||
Reference in New Issue
Block a user