mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 00:53:37 +00:00
Allowed the attachments dialog to hide the remove button
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
40ac215359
commit
63eedafb1c
@ -9,7 +9,14 @@
|
||||
Disabled="@this.IsZoneDisabled"
|
||||
Context="isDropTarget">
|
||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||
@T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name. You can remove any attachment using the trash can icon.")
|
||||
@if (this.CanRemove)
|
||||
{
|
||||
@T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name. You can remove any attachment using the trash can icon.")
|
||||
}
|
||||
else
|
||||
{
|
||||
@T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name.")
|
||||
}
|
||||
</MudJustifiedText>
|
||||
|
||||
@if (this.CanAttach)
|
||||
@ -66,11 +73,14 @@
|
||||
OnClick="@(() => this.InvestigateFile(fileAttachment))"/>
|
||||
</MudTooltip>
|
||||
|
||||
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
||||
</MudTooltip>
|
||||
@if (this.CanRemove)
|
||||
{
|
||||
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
||||
</MudTooltip>
|
||||
}
|
||||
</MudToolBar>
|
||||
</MudStack>
|
||||
}
|
||||
@ -93,11 +103,14 @@
|
||||
Color="Color.Primary"
|
||||
Disabled="true"/>
|
||||
|
||||
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
||||
</MudTooltip>
|
||||
@if (this.CanRemove)
|
||||
{
|
||||
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
||||
</MudTooltip>
|
||||
}
|
||||
</MudToolBar>
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@ -38,6 +38,16 @@ public partial class ReviewAttachmentsDialog : MSGComponentBase
|
||||
[Parameter]
|
||||
public Func<bool>? IsAttachingUnavailable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the user may remove attachments here.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// False when this dialog gathers the attachments of several messages at once: a removal would
|
||||
/// reach into a message that was already sent, and nothing here could tell which one.
|
||||
/// </remarks>
|
||||
[Parameter]
|
||||
public bool CanRemove { get; set; } = true;
|
||||
|
||||
[Inject]
|
||||
private IDialogService DialogService { get; set; } = null!;
|
||||
|
||||
@ -120,11 +130,12 @@ public partial class ReviewAttachmentsDialog : MSGComponentBase
|
||||
|
||||
private async Task PathsDropped(List<string> paths) => await this.AttachPathsAsync(paths);
|
||||
|
||||
public static async Task<HashSet<FileAttachment>> OpenDialogAsync(IDialogService dialogService, HashSet<FileAttachment> documentPaths, Func<List<string>, Task<IReadOnlyList<FileAttachment>>>? attachPaths = null, Func<bool>? isAttachingUnavailable = null)
|
||||
public static async Task<HashSet<FileAttachment>> OpenDialogAsync(IDialogService dialogService, HashSet<FileAttachment> documentPaths, Func<List<string>, Task<IReadOnlyList<FileAttachment>>>? attachPaths = null, Func<bool>? isAttachingUnavailable = null, bool canRemove = true)
|
||||
{
|
||||
var dialogParameters = new DialogParameters<ReviewAttachmentsDialog>
|
||||
{
|
||||
{ x => x.DocumentPaths, documentPaths }
|
||||
{ x => x.DocumentPaths, documentPaths },
|
||||
{ x => x.CanRemove, canRemove },
|
||||
};
|
||||
|
||||
if (attachPaths is not null)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user