Fix critical cell editor submit flow
This commit is contained in:
@@ -380,8 +380,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
editorModel = CriticalCellEditorModel.FromResponse(response);
|
|
||||||
await LoadTableDetailAsync();
|
await LoadTableDetailAsync();
|
||||||
|
await CloseCellEditorAsync();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,18 +17,21 @@
|
|||||||
<button type="button" class="btn btn-link critical-editor-close" @onclick="OnClose">Close</button>
|
<button type="button" class="btn btn-link critical-editor-close" @onclick="OnClose">Close</button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(ErrorMessage))
|
|
||||||
{
|
|
||||||
<p class="error-text">@ErrorMessage</p>
|
|
||||||
}
|
|
||||||
|
|
||||||
@if (IsLoading)
|
@if (IsLoading)
|
||||||
{
|
{
|
||||||
|
<div class="critical-editor-body">
|
||||||
<p class="muted">Loading editor...</p>
|
<p class="muted">Loading editor...</p>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
<EditForm Model="Model" OnSubmit="HandleSubmitAsync">
|
||||||
<div class="critical-editor-body">
|
<div class="critical-editor-body">
|
||||||
|
@if (!string.IsNullOrWhiteSpace(ErrorMessage))
|
||||||
|
{
|
||||||
|
<p class="error-text critical-editor-error">@ErrorMessage</p>
|
||||||
|
}
|
||||||
|
|
||||||
<section class="critical-editor-section">
|
<section class="critical-editor-section">
|
||||||
<h4>Base Cell</h4>
|
<h4>Base Cell</h4>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
@@ -37,11 +40,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Description / Prose</label>
|
<label>Description / Prose</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea" @bind-Value="Model.DescriptionText" />
|
<InputText class="input-shell" @bind-Value="Model.DescriptionText" />
|
||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Affix Text</label>
|
<label>Affix Text</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea compact" @bind-Value="Model.RawAffixText" />
|
<InputText class="input-shell" @bind-Value="Model.RawAffixText" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-grid">
|
<div class="form-grid">
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
@@ -50,7 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Parsed Json</label>
|
<label>Parsed Json</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea compact" @bind-Value="Model.ParsedJson" />
|
<InputTextArea class="input-shell critical-editor-textarea json" @bind-Value="Model.ParsedJson" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -115,7 +118,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Condition Text</label>
|
<label>Condition Text</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea compact" @bind-Value="branch.ConditionText" />
|
<InputText class="input-shell" @bind-Value="branch.ConditionText" />
|
||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Raw Text</label>
|
<label>Raw Text</label>
|
||||||
@@ -123,11 +126,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Description / Prose</label>
|
<label>Description / Prose</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea" @bind-Value="branch.DescriptionText" />
|
<InputText class="input-shell" @bind-Value="branch.DescriptionText" />
|
||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Affix Text</label>
|
<label>Affix Text</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea compact" @bind-Value="branch.RawAffixText" />
|
<InputText class="input-shell" @bind-Value="branch.RawAffixText" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-grid">
|
<div class="form-grid">
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
@@ -136,7 +139,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field-shell">
|
<div class="field-shell">
|
||||||
<label>Parsed Json</label>
|
<label>Parsed Json</label>
|
||||||
<InputTextArea class="input-shell critical-editor-textarea compact" @bind-Value="branch.ParsedJson" />
|
<InputTextArea class="input-shell critical-editor-textarea json" @bind-Value="branch.ParsedJson" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -169,14 +172,15 @@
|
|||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
<footer class="critical-editor-footer">
|
<footer class="critical-editor-footer">
|
||||||
<button type="button" class="btn btn-link" @onclick="OnClose" disabled="@IsSaving">Cancel</button>
|
<button type="button" class="btn btn-link" @onclick="OnClose" disabled="@IsSaving">Cancel</button>
|
||||||
<button type="button" class="btn-ritual" @onclick="OnSave" disabled="@IsLoading || IsSaving">
|
<button type="submit" class="btn-ritual" disabled="@IsSaving">
|
||||||
@(IsSaving ? "Saving..." : "Save Cell")
|
@(IsSaving ? "Saving..." : "Save Cell")
|
||||||
</button>
|
</button>
|
||||||
</footer>
|
</footer>
|
||||||
|
</EditForm>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -205,6 +209,11 @@
|
|||||||
await OnClose.InvokeAsync();
|
await OnClose.InvokeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task HandleSubmitAsync(EditContext _)
|
||||||
|
{
|
||||||
|
await OnSave.InvokeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
private void AddBaseEffect()
|
private void AddBaseEffect()
|
||||||
{
|
{
|
||||||
Model?.Effects.Add(new CriticalEffectEditorModel());
|
Model?.Effects.Add(new CriticalEffectEditorModel());
|
||||||
|
|||||||
@@ -710,10 +710,22 @@ textarea {
|
|||||||
min-height: 4.5rem;
|
min-height: 4.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.critical-editor-textarea.json {
|
||||||
|
min-height: 12rem;
|
||||||
|
}
|
||||||
|
|
||||||
.critical-editor-textarea.tall {
|
.critical-editor-textarea.tall {
|
||||||
min-height: 10rem;
|
min-height: 10rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.critical-editor-error {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.85rem 0.95rem;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: rgba(141, 43, 30, 0.08);
|
||||||
|
border: 1px solid rgba(141, 43, 30, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
.critical-editor-checkbox {
|
.critical-editor-checkbox {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user