16-12-2022
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
@using ECM.JobRunner.Common.JobRunnerReference;
|
||||
@using ECM.JobRunner.Web.Data;
|
||||
@inject NavigationManager Navigation;
|
||||
@inject ImportService Profile;
|
||||
@inject ImportProfileService Profile;
|
||||
|
||||
<PageTitle>Schritt bearbeiten</PageTitle>
|
||||
|
||||
@@ -21,9 +21,12 @@
|
||||
|
||||
private async void OnFormSubmit(EditContext ctx)
|
||||
{
|
||||
ImportProfile profile = await Profile.GetProfile(ProfileId);
|
||||
ImportProfile? profile = await Profile.GetProfile(ProfileId);
|
||||
ImportProfileStep step = (ImportProfileStep)ctx.Model;
|
||||
|
||||
if (profile == null)
|
||||
return;
|
||||
|
||||
// TODO: This is ugly and manual and needs to be abstracted.
|
||||
var index = profile.Steps.ToList().FindIndex(s => s.Id == StepId);
|
||||
profile.Steps[index] = step;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
@using ECM.JobRunner.Common.JobRunnerReference;
|
||||
@using ECM.JobRunner.Web.Data;
|
||||
@inject NavigationManager Navigation;
|
||||
@inject ImportService Profile;
|
||||
@inject ImportProfileService Profile;
|
||||
|
||||
<PageTitle>Schritt bearbeiten</PageTitle>
|
||||
<PageTitle>Neuen Schritt erstellen</PageTitle>
|
||||
|
||||
<h3>Schritt bearbeiten</h3>
|
||||
<h3>Neuen Schritt erstellen</h3>
|
||||
|
||||
<StepForm ProfileId="ProfileId" StepId="-1" OnValidSubmit="OnFormSubmit" />
|
||||
|
||||
@@ -21,9 +21,12 @@
|
||||
|
||||
private async void OnFormSubmit(EditContext ctx)
|
||||
{
|
||||
ImportProfile profile = await Profile.GetProfile(ProfileId);
|
||||
ImportProfile? profile = await Profile.GetProfile(ProfileId);
|
||||
ImportProfileStep step = (ImportProfileStep)ctx.Model;
|
||||
|
||||
if (profile == null)
|
||||
return;
|
||||
|
||||
// TODO: This is ugly and manual and needs to be abstracted.
|
||||
var steps = profile.Steps.ToList();
|
||||
steps.Add(step);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
@inject NavigationManager Navigation;
|
||||
@inject IJSRuntime JsRuntime;
|
||||
@inject JobService Jobs;
|
||||
@inject ImportService Import;
|
||||
@inject HelperService Jobs;
|
||||
@inject ImportProfileService Import;
|
||||
|
||||
<PageTitle>Profilschritt</PageTitle>
|
||||
|
||||
@@ -143,8 +143,6 @@ else
|
||||
private ImportProfile? profile;
|
||||
private ImportProfileStep? step;
|
||||
|
||||
private DateTime nextExecution;
|
||||
|
||||
protected async override void OnInitialized()
|
||||
{
|
||||
profile = await Import.GetProfile(ProfileId);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@using ECM.JobRunner.Common.JobRunnerReference;
|
||||
@using ECM.JobRunner.Web.Data;
|
||||
@inject ImportService Import;
|
||||
@inject JobService Jobs;
|
||||
@inject ImportProfileService Import;
|
||||
@inject HelperService Jobs;
|
||||
|
||||
@if (step == null || profile == null)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ else
|
||||
}
|
||||
</select>
|
||||
<div id="stepIndexHelp" class="form-text">Der Windream Index, in den das Ergebnis des Schritte geschrieben wird</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="stepScope" class="form-label">
|
||||
@@ -166,7 +166,12 @@ else
|
||||
else
|
||||
{
|
||||
step = profile.Steps.Where(s => s.Id == StepId).SingleOrDefault();
|
||||
SetMethodArgs(step.Method);
|
||||
|
||||
if (step != null)
|
||||
{
|
||||
SetMethodArgs(step.Method);
|
||||
|
||||
}
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
@@ -217,8 +222,8 @@ else
|
||||
|
||||
class StepArgument
|
||||
{
|
||||
public string name;
|
||||
public string helpText;
|
||||
public string name = "";
|
||||
public string helpText = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@using ECM.JobRunner.Web.Data
|
||||
@using ECM.JobRunner.Web.Pages.ImportStep
|
||||
|
||||
@inject ImportService Import
|
||||
@inject ImportProfileService Import
|
||||
|
||||
<h3>Profilschritte</h3>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user