fix(Database) Fixed refresh bug. Fixed wrong data in database

This commit is contained in:
2022-04-03 16:17:32 -04:00
parent b5ea2ec833
commit 8584570a1e
24 changed files with 363 additions and 495 deletions
BIN
View File
Binary file not shown.
+25 -21
View File
@@ -1,14 +1,8 @@
@implements IDisposable;
@inject IEntityDialogService entityDialogService
<div class="dialogBackground" onclick="@CloseDialog">
@{
var entity = DATA.Get()[entityDialogService.GetEntityId()];
}
<div class="dialogContainer"
@onclick:preventDefault="true"
@onclick:stopPropagation="true">
@@ -22,7 +16,6 @@
@if (entityDialogService.HasHistory())
{
<button class="backButton" @onclick="entityDialogService.BackDialog">
<div class="backButtonIcon"> </div>
</button>
}
@@ -33,19 +26,21 @@
</div>
<div class="dialogContent">
<div>
<EntityVanguardAddedComponent Entity=@entity></EntityVanguardAddedComponent>
<EntityInfoComponent Entity=@entity></EntityInfoComponent>
<EntityVanguardsComponent Entity=@entity></EntityVanguardsComponent>
<EntityProductionComponent Entity=@entity></EntityProductionComponent>
<EntityStatsComponent Entity=@entity></EntityStatsComponent>
<EntityMechanicsComponent Entity=@entity></EntityMechanicsComponent>
<EntityPassivesComponent Entity=@entity></EntityPassivesComponent>
<EntityPyreSpellsComponent Entity=@entity></EntityPyreSpellsComponent>
<EntityUpgradesComponent Entity=@entity></EntityUpgradesComponent>
<EntityWeaponsComponent Entity=@entity></EntityWeaponsComponent>
<EntityAbilitiesComponent Entity=@entity></EntityAbilitiesComponent>
</div>
<CascadingValue Value="@entity">
<CascadingValue Value="@refresh">
<EntityVanguardAddedComponent ></EntityVanguardAddedComponent>
<EntityInfoComponent ></EntityInfoComponent>
<EntityVanguardsComponent ></EntityVanguardsComponent>
<EntityProductionComponent ></EntityProductionComponent>
<EntityStatsComponent ></EntityStatsComponent>
<EntityMechanicsComponent ></EntityMechanicsComponent>
<EntityPassivesComponent ></EntityPassivesComponent>
<EntityPyreSpellsComponent ></EntityPyreSpellsComponent>
<EntityUpgradesComponent ></EntityUpgradesComponent>
<EntityWeaponsComponent ></EntityWeaponsComponent>
<EntityAbilitiesComponent ></EntityAbilitiesComponent>
</CascadingValue>
</CascadingValue>
</div>
<div class="dialogFooter"></div>
@@ -140,9 +135,15 @@
</style>
@code {
EntityModel entity = null;
private int refresh = 0;
protected override void OnInitialized()
{
entity = DATA.Get()[entityDialogService.GetEntityId()];
entityDialogService.Subscribe(OnUpdate);
}
@@ -152,10 +153,13 @@
void OnUpdate()
{
entity = DATA.Get()[entityDialogService.GetEntityId()];
refresh++;
Console.WriteLine("OnUpdate()");
StateHasChanged();
}
public void CloseDialog()
{
entityDialogService.CloseDialog();
+1 -4
View File
@@ -2,7 +2,4 @@
@layout PageLayout
<HomePage></HomePage>
<HomePage></HomePage>
+3 -1
View File
@@ -21,7 +21,9 @@
@if (searches != null) {
<div class="databaseItems">
@foreach (var entity in searches) {
<EntityViewComponent Entity=entity></EntityViewComponent>
<CascadingValue Value="entity">
<EntityViewComponent></EntityViewComponent>
</CascadingValue>
}
</div>
}
@@ -2,21 +2,23 @@
var isVanguard = Entity.VanguardAdded() != null ? " vanguard" : "";
<div class="enititiesContainer @isVanguard">
<EntityHeaderComponent Entity=Entity></EntityHeaderComponent>
<EntityHeaderComponent></EntityHeaderComponent>
<div class="entityPartsContainer">
<EntityVanguardAddedComponent Entity=Entity></EntityVanguardAddedComponent>
<EntityInfoComponent Entity=Entity></EntityInfoComponent>
<EntityVanguardsComponent Entity=Entity></EntityVanguardsComponent>
<EntityProductionComponent Entity=Entity></EntityProductionComponent>
<EntityStatsComponent Entity=Entity></EntityStatsComponent>
<EntityMechanicsComponent Entity=Entity></EntityMechanicsComponent>
<EntityPassivesComponent Entity=Entity></EntityPassivesComponent>
<EntityPyreSpellsComponent Entity=Entity></EntityPyreSpellsComponent>
<EntityUpgradesComponent Entity=Entity></EntityUpgradesComponent>
<EntityWeaponsComponent Entity=Entity></EntityWeaponsComponent>
<EntityAbilitiesComponent Entity=Entity></EntityAbilitiesComponent>
</div>
<CascadingValue Value="@Entity">
<div class="entityPartsContainer">
<EntityVanguardAddedComponent></EntityVanguardAddedComponent>
<EntityInfoComponent></EntityInfoComponent>
<EntityVanguardsComponent></EntityVanguardsComponent>
<EntityProductionComponent></EntityProductionComponent>
<EntityStatsComponent></EntityStatsComponent>
<EntityMechanicsComponent></EntityMechanicsComponent>
<EntityPassivesComponent></EntityPassivesComponent>
<EntityPyreSpellsComponent></EntityPyreSpellsComponent>
<EntityUpgradesComponent></EntityUpgradesComponent>
<EntityWeaponsComponent></EntityWeaponsComponent>
<EntityAbilitiesComponent></EntityAbilitiesComponent>
</div>
</CascadingValue>
</div>
}
@@ -48,8 +50,6 @@
</style>
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -47,7 +47,8 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -40,7 +40,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -5,6 +5,13 @@
</div>
}
@if (Entity.Info().Notes != "") {
<div>
<b>Notes:</b> @((MarkupString)Entity.Info().Notes)
</div>
}
<div class="infoDisplayContainer">
<div>
@if (Entity.Faction() != null) {
@@ -51,7 +58,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -21,7 +21,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -44,7 +44,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -1,76 +1,70 @@
@{
var production = Entity.Production();
var supply = Entity.Supply();
var requirements = Entity.Requirements();
}
@if (production != null || supply != null || requirements.Count > 0) {
@if (@Production != null || Supply != null || Requirements.Count > 0) {
<EntityDisplayComponent Title="Production">
<div class="productionContainer">
@if (requirements.Count() > 0) {
<div class="ProductionContainer">
@if (Requirements.Count() > 0) {
<div>
@foreach (var requirement in requirements) {
@foreach (var requirement in Requirements) {
<div>
<span>
<b>@requirement.Requirement.Replace("_", " "):</b> <EntityLabelComponent EntityId="@requirement.DataType"/>
<b>@requirement.Requirement.Replace("_", " "):</b> <EntityLabelComponent EntityId="@requirement.DataType"/>
</span>
</div>
}
</div>
}
@if (production != null && (!production.Alloy.Equals(0)
|| !production.Ether.Equals(0)
|| !production.BuildTime.Equals(0)
|| !production.Cooldown.Equals(0))) {
@if (Production != null && (!Production.Alloy.Equals(0)
|| !Production.Ether.Equals(0)
|| !Production.BuildTime.Equals(0)
|| !Production.Cooldown.Equals(0))) {
<div>
@if (!production.Alloy.Equals(0)) {
@if (!Production.Alloy.Equals(0)) {
<div>
<b>Alloy:</b> @production.Alloy
<b>Alloy:</b> @Production.Alloy
</div>
}
@if (!production.Ether.Equals(0)) {
@if (!Production.Ether.Equals(0)) {
<div>
<b>Ether:</b> @production.Ether
<b>Ether:</b> @Production.Ether
</div>
}
@if (!production.Pyre.Equals(0)) {
@if (!Production.Pyre.Equals(0)) {
<div>
<b>Pyre:</b> @production.Pyre
<b>Pyre:</b> @Production.Pyre
</div>
}
@if (!production.BuildTime.Equals(0)) {
@if (!Production.BuildTime.Equals(0)) {
<div>
<b>Build Time:</b> @production.BuildTime.ToString()s
<b>Build Time:</b> @Production.BuildTime.ToString()s
</div>
}
@if (!production.Energy.Equals(0)) {
@if (!Production.Energy.Equals(0)) {
<div>
<b>Energy:</b> @production.Energy
<b>Energy:</b> @Production.Energy
</div>
}
@if (!production.Cooldown.Equals(0)) {
@if (!Production.Cooldown.Equals(0)) {
<div>
<b>Cooldown:</b> @production.Cooldown.ToString()s
<b>Cooldown:</b> @Production.Cooldown.ToString()s
</div>
}
</div>
}
@if (supply != null) {
@if (Supply != null) {
<div>
@if (!supply.Grants.Equals(0)) {
@if (!Supply.Grants.Equals(0)) {
<div>
<b>Grants:</b> @supply.Grants
<b>Grants:</b> @Supply.Grants
</div>
}
@if (!supply.Takes.Equals(0)) {
@if (!Supply.Takes.Equals(0)) {
<div>
<b>Takes:</b> @supply.Takes Supply
<b>Takes:</b> @Supply.Takes Supply
</div>
}
</div>
@@ -80,13 +74,13 @@
}
<style>
.productionContainer {
.ProductionContainer {
display: flex;
gap: 32px;
}
@@media only screen and (max-width: 1025px) {
.productionContainer {
.ProductionContainer {
flex-direction: column;
gap: 4px;
}
@@ -95,7 +89,19 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
private EntityProductionModel Production => Entity.Production();
private List<EntityRequirementModel> Requirements => Entity.Requirements();
private EntitySupplyModel Supply => Entity.Supply();
protected override void OnParametersSet()
{
StateHasChanged();
}
}
@@ -37,7 +37,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -1,40 +1,36 @@
@{
var vitality = Entity.Vitality();
var movement = Entity.Movement();
}
@if (vitality != null || movement != null) {
@if (Vitality != null || Movement != null) {
<EntityDisplayComponent Title="Stats">
<div class="statContainer">
@if (vitality != null) {
@if (Vitality != null) {
<div>
@if (!vitality.DefenseLayer.Equals(0)) {
@if (!Vitality.DefenseLayer.Equals(0)) {
<div>
<b>Shield:</b> @vitality.DefenseLayer
<b>Shield:</b> @Vitality.DefenseLayer
</div>
}
@if (!vitality.Health.Equals(0)) {
@if (!Vitality.Health.Equals(0)) {
<div>
<b>Health:</b> @vitality.Health
<b>Health:</b> @Vitality.Health
</div>
}
@if (!vitality.Energy.Equals(0)) {
@if (!Vitality.Energy.Equals(0)) {
<div>
<b>Energy:</b> @vitality.Energy
<b>Energy:</b> @Vitality.Energy
</div>
}
@if (vitality.Armor != "") {
@if (Vitality.Armor != "") {
<div>
<b>Armor:</b> @vitality.Armor
<b>Armor:</b> @Vitality.Armor
</div>
}
@if (vitality.IsEtheric) {
@if (Vitality.IsEtheric) {
<div>
<b> + Etheric</b>
</div>
}
@if (vitality.IsStructure) {
@if (Vitality.IsStructure) {
<div>
<b> + Structure</b>
</div>
@@ -43,11 +39,11 @@
}
@if (movement != null) {
@if (Movement != null) {
<div>
@if (!movement.Speed.Equals(0)) {
@if (!Movement.Speed.Equals(0)) {
<div>
<b>Speed:</b> @movement.Speed
<b>Speed:</b> @Movement.Speed
</div>
}
else {
@@ -56,7 +52,7 @@
</div>
}
<div>
<b>Move Type:</b> @movement.Movement
<b>Move Type:</b> @Movement.Movement
</div>
</div>
}
@@ -79,8 +75,9 @@
</style>
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[Parameter]
public EntityModel Entity { get; set; }
private EntityVitalityModel Vitality => Entity.Vitality();
private EntityMovementModel Movement => Entity.Movement();
}
@@ -32,7 +32,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -24,8 +24,8 @@
}
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -26,7 +26,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -108,7 +108,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
+1 -1
View File
@@ -1 +1 @@
[{"Id":1,"Name":"Agile Sprint","Description":"Changelogs and sprint views were going to be pushed till later, but I am feeling inspired by the IGP Content Creators\u0027 minimum weekly lifecycle requirement. So I am going to focus on agile-related tasks, and handle roadmap tasks after this initial sprint. All weekly sprints will release on Sunday, starting next Sunday.","StartDate":"2022-02-14T00:00:00","EndDate":"2022-02-20T00:00:00","Notes":null},{"Id":2,"Name":"SQL Update","Description":"The SQL update is big enough to be a full sprint in of itself, and I spent less time this week for development. Will just extend sprint by 2 week, and remove all non SQL tasks from the sprint.","StartDate":"2022-02-20T00:00:00","EndDate":"2022-03-27T00:00:00","Notes":null},{"Id":3,"Name":"Database Page","Description":"Improvements to the Database page","StartDate":"2022-03-27T00:00:00","EndDate":"2022-04-03T00:00:00","Notes":null}]
[{"Id":1,"Name":"Agile Sprint","Description":"Changelogs and sprint views were going to be pushed till later, but I am feeling inspired by the IGP Content Creators\u0027 minimum weekly lifecycle requirement. So I am going to focus on agile-related tasks, and handle roadmap tasks after this initial sprint. All weekly sprints will release on Sunday, starting next Sunday.","StartDate":"2022-02-14T00:00:00","EndDate":"2022-02-20T00:00:00","Notes":null},{"Id":2,"Name":"SQL Update","Description":"The SQL update is big enough to be a full sprint in of itself, and I spent less time this week for development. Will just extend sprint by 2 week, and remove all non SQL tasks from the sprint.","StartDate":"2022-02-20T00:00:00","EndDate":"2022-03-27T00:00:00","Notes":null},{"Id":3,"Name":"Database Page","Description":"Improvements to the Database page","StartDate":"2022-03-27T00:00:00","EndDate":"2022-04-03T00:00:00","Notes":null},{"Id":4,"Name":"Branding","Description":"Improve streaming branding around the website","StartDate":"2022-04-03T00:00:00","EndDate":"2022-04-10T00:00:00","Notes":null}]
File diff suppressed because one or more lines are too long