Skip to content

Commit

Permalink
Added feature flag for Fertigation
Browse files Browse the repository at this point in the history
  • Loading branch information
dallascrichmond committed Aug 13, 2024
1 parent fd5813d commit 5db7a50
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/Agri.Models/Settings/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class AppSettings
public int ExpectedSeedDataVersion { get; set; }
public bool RELOAD_JOURNEYS { get; set; }
public bool RELOAD_USER_PROMPTS { get; set; }
public bool FLAG_FERTIGATION_WORKFLOW { get; set; }

}
}
3 changes: 2 additions & 1 deletion app/Server/src/SERVERAPI/Controllers/NutrientsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public IActionResult Calculate(string nme)

CalculateViewModel cvm = new CalculateViewModel
{
fields = new List<Field>()
fields = new List<Field>(),
AppSettings = _settings
};

cvm.regionFnd = (fd.FarmRegion.HasValue) ? true : false;
Expand Down
3 changes: 3 additions & 0 deletions app/Server/src/SERVERAPI/ViewModels/CalculateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using Agri.Models.Farm;
using SERVERAPI.Models;
using Agri.Models.Configuration;
using Agri.Models.Settings;
using Microsoft.Extensions.Options;

namespace SERVERAPI.ViewModels
{
Expand All @@ -14,5 +16,6 @@ public class CalculateViewModel
public string noData { get; set; }
public List<Field> fields { get; set; }
public List<NutrientIcon> icons { get; set; }
public AppSettings AppSettings { get; set; }
}
}
5 changes: 3 additions & 2 deletions app/Server/src/SERVERAPI/Views/Nutrients/Calculate.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@using Agri.Models
@model SERVERAPI.ViewModels.CalculateViewModel

@{
ViewBag.Title = "Calculate Nutrients";
}
Expand Down Expand Up @@ -54,7 +53,9 @@
<span>
<button title="Add a Manure/Compost to the Field" aria-label="Add a Manure/Compost to the Field" class="btn btn-success" type="button" data_modal="" data-type="@Url.Action("ManureDetails", "Nutrients", new { fldName = Model.currFld })">Add Manure</button>
<button title="Add a Fertilizer to the Field" aria-label="Add a Fertilizer to the Field" class="btn btn-success" type="button" data_modal="" data-type="@Url.Action("FertilizerDetails", "Nutrients", new { fldName = Model.currFld })">Add Fertilizer</button>
<button title="Add Fertigation" aria-label="Add Fertigation" class="btn btn-success" type="button" data_modal="" data-type="@Url.Action("FertigationDetails", "Nutrients", new { fldName = Model.currFld })">Add Fertigation</button>
@if (Model.AppSettings.FLAG_FERTIGATION_WORKFLOW){
<button title="Add Fertigation" aria-label="Add Fertigation" class="btn btn-success" type="button" data_modal="" data-type="@Url.Action("FertigationDetails", "Nutrients", new { fldName = Model.currFld })">Add Fertigation</button>
}
<button title="Add Other Nutrient to the Field" aria-label="Add Other Nutrient to the Field" class="btn btn-success" type="button" data_modal="" data-type="@Url.Action("OtherDetails", "Nutrients", new { fldName = Model.currFld })">Add Other</button>
</span>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/Server/src/SERVERAPI/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"LoadSeedData": false,
"ExpectedSeedDataVersion": 5,
"RELOAD_JOURNEYS": false,
"RELOAD_USER_PROMPTS": false
"RELOAD_USER_PROMPTS": false,
"FLAG_FERTIGATION_WORKFLOW": true
},
"Logging": {
"IncludeScopes": false,
Expand Down

0 comments on commit 5db7a50

Please sign in to comment.