Ripristinata cancellazione documenti
This commit is contained in:
@@ -214,14 +214,14 @@
|
|||||||
@if (item.p.Type == AttachedDTO.TypeAttached.Position)
|
@if (item.p.Type == AttachedDTO.TypeAttached.Position)
|
||||||
{
|
{
|
||||||
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
|
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
|
||||||
OnClick="() => OpenPosition(item.p)" OnClose="() => OnRemoveAttached(item.index)">
|
OnClick="@(() => OpenPosition(item.p))" OnClose="@(() => OnRemoveAttached(item.index))">
|
||||||
@item.p.Description
|
@item.p.Description
|
||||||
</MudChip>
|
</MudChip>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<MudChip T="string" Color="Color.Default" OnClick="() => OpenAttached(item.p)"
|
<MudChip T="string" Color="Color.Default" OnClick="@(() => OpenAttached(item.p))"
|
||||||
OnClose="() => OnRemoveAttached(item.index)">
|
OnClose="@(() => OnRemoveAttached(item.index))">
|
||||||
@item.p.Name
|
@item.p.Name
|
||||||
</MudChip>
|
</MudChip>
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
{
|
{
|
||||||
foreach (var file in ActivityFileList)
|
foreach (var file in ActivityFileList)
|
||||||
{
|
{
|
||||||
<MudChip T="string" OnClick="() => OpenAttached(file.Id, file.FileName)" Color="Color.Default">
|
<MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))" OnClose="@(() => DeleteAttach(file))" Color="Color.Default">
|
||||||
@file.FileName
|
@file.FileName
|
||||||
</MudChip>
|
</MudChip>
|
||||||
}
|
}
|
||||||
@@ -774,6 +774,33 @@
|
|||||||
Snackbar.Add("Impossibile aprire il file", Severity.Error);
|
Snackbar.Add("Impossibile aprire il file", Severity.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task DeleteAttach(ActivityFileDto file)
|
||||||
|
{
|
||||||
|
Snackbar.Clear();
|
||||||
|
|
||||||
|
if (ActivityFileList == null) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ActivityFileList.Remove(file);
|
||||||
|
StateHasChanged();
|
||||||
|
|
||||||
|
await IntegryApiService.DeleteFile(ActivityModel.ActivityId!, file.FileName);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ActivityFileList.Add(file);
|
||||||
|
StateHasChanged();
|
||||||
|
|
||||||
|
Snackbar.Add("Impossibile eliminare il file", Severity.Error);
|
||||||
|
Console.WriteLine($"Impossibile eliminare il file: {ex.Message}");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Snackbar.Add($"{file.FileName} eliminato con successo", Severity.Info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OpenPosition(AttachedDTO attached)
|
private void OpenPosition(AttachedDTO attached)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Task<Stream> DownloadFile(string activityId, string fileName) =>
|
public Task<Stream> DownloadFile(string activityId, string fileName) =>
|
||||||
integryApiRestClient.Download($"downloadStbFileAttachment/{activityId}/{fileName}")!;
|
integryApiRestClient.Download($"downloadStbActivityFileAttachment/{activityId}/{fileName}")!;
|
||||||
|
|
||||||
public Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName)
|
public Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user