fix(ui/templates): dereference string params with @ and stack toolbar below title
Smoke testing revealed two issues introduced by the modal extraction commit: 1. ErrorMessage / InitialName / TemplateName parameters on the dialog components were passed as bare strings (e.g. ErrorMessage="_newFolderError") instead of dereferenced C# expressions (ErrorMessage="@_newFolderError"). Razor treats unquoted-but-not-@-prefixed values to string parameters as string literals — so the error block rendered the literal field name in red whenever the modal opened. Non-string parameters (int/IEnumerable) were fine since Razor treats those as C# expressions by default. 2. The Templates header + 4-button toolbar shared one flex row, but at col-md-4 / col-lg-3 width the buttons overflowed into the right-column empty-state area. Stack title above a full-width btn-group instead.
This commit is contained in:
@@ -21,25 +21,25 @@
|
|||||||
|
|
||||||
<RenameFolderDialog @bind-IsVisible="_showRenameFolderDialog"
|
<RenameFolderDialog @bind-IsVisible="_showRenameFolderDialog"
|
||||||
FolderId="_renameFolderId"
|
FolderId="_renameFolderId"
|
||||||
InitialName="_renameFolderInitialName"
|
InitialName="@_renameFolderInitialName"
|
||||||
ErrorMessage="_renameFolderError"
|
ErrorMessage="@_renameFolderError"
|
||||||
OnSubmit="SubmitRenameFolder" />
|
OnSubmit="SubmitRenameFolder" />
|
||||||
|
|
||||||
<NewFolderDialog @bind-IsVisible="_showNewFolderDialog"
|
<NewFolderDialog @bind-IsVisible="_showNewFolderDialog"
|
||||||
ParentFolderId="_newFolderParentId"
|
ParentFolderId="_newFolderParentId"
|
||||||
ErrorMessage="_newFolderError"
|
ErrorMessage="@_newFolderError"
|
||||||
OnSubmit="SubmitNewFolder" />
|
OnSubmit="SubmitNewFolder" />
|
||||||
|
|
||||||
<NewTemplateDialog @bind-IsVisible="_showNewTemplateDialog"
|
<NewTemplateDialog @bind-IsVisible="_showNewTemplateDialog"
|
||||||
FolderId="_newTemplateFolderId"
|
FolderId="_newTemplateFolderId"
|
||||||
ErrorMessage="_newTemplateError"
|
ErrorMessage="@_newTemplateError"
|
||||||
OnSubmit="SubmitNewTemplate" />
|
OnSubmit="SubmitNewTemplate" />
|
||||||
|
|
||||||
<MoveTemplateDialog @bind-IsVisible="_showMoveTemplateDialog"
|
<MoveTemplateDialog @bind-IsVisible="_showMoveTemplateDialog"
|
||||||
TemplateId="_moveTemplateId"
|
TemplateId="_moveTemplateId"
|
||||||
TemplateName="_moveTemplateName"
|
TemplateName="@_moveTemplateName"
|
||||||
FolderOptions="EnumerateFolderOptions()"
|
FolderOptions="EnumerateFolderOptions()"
|
||||||
ErrorMessage="_moveTemplateError"
|
ErrorMessage="@_moveTemplateError"
|
||||||
OnSubmit="SubmitMoveTemplate" />
|
OnSubmit="SubmitMoveTemplate" />
|
||||||
|
|
||||||
@if (_loading)
|
@if (_loading)
|
||||||
@@ -54,16 +54,14 @@
|
|||||||
{
|
{
|
||||||
<div class="row g-2">
|
<div class="row g-2">
|
||||||
<div class="col-md-4 col-lg-3">
|
<div class="col-md-4 col-lg-3">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<h6 class="mb-2">Templates</h6>
|
||||||
<h6 class="mb-0">Templates</h6>
|
<div class="btn-group btn-group-sm w-100 mb-2">
|
||||||
<div class="btn-group btn-group-sm">
|
<button class="btn btn-outline-secondary" title="New folder at root"
|
||||||
<button class="btn btn-outline-secondary" title="New folder at root"
|
@onclick="() => OpenNewFolderDialog(null)">+ Folder</button>
|
||||||
@onclick="() => OpenNewFolderDialog(null)">+ Folder</button>
|
<button class="btn btn-outline-secondary" title="New template at root"
|
||||||
<button class="btn btn-outline-secondary" title="New template at root"
|
@onclick="() => OpenNewTemplateDialog(null)">+ Template</button>
|
||||||
@onclick="() => OpenNewTemplateDialog(null)">+ Template</button>
|
<button class="btn btn-outline-secondary" @onclick="() => _tree.ExpandAll()">Expand</button>
|
||||||
<button class="btn btn-outline-secondary" @onclick="() => _tree.ExpandAll()">Expand</button>
|
<button class="btn btn-outline-secondary" @onclick="() => _tree.CollapseAll()">Collapse</button>
|
||||||
<button class="btn btn-outline-secondary" @onclick="() => _tree.CollapseAll()">Collapse</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="max-height: calc(100vh - 160px); overflow-y: auto;">
|
<div style="max-height: calc(100vh - 160px); overflow-y: auto;">
|
||||||
|
|||||||
Reference in New Issue
Block a user