Gestiti allegati da galleria e fotocamera e aggiunto sentry
This commit is contained in:
@@ -36,7 +36,7 @@ else
|
||||
</div>
|
||||
|
||||
<div class="my-4 login-footer">
|
||||
<span>@($"v{GenericSystemService.GetCurrentAppVersion()} | Powered by")</span>
|
||||
<span>@GenericSystemService.GetCurrentAppVersion() | Powered by")</span>
|
||||
<img src="_content/SteUp.Shared/images/logoIntegry.svg" class="img-fluid" alt="Integry">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,21 +2,5 @@
|
||||
@inject IGenericSystemService GenericSystemService
|
||||
|
||||
<div class="app-version">
|
||||
<span>@Version</span>
|
||||
<span>@GenericSystemService.GetCurrentAppVersion()</span>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
private string Version { get; set; } = "";
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
#if DEBUG
|
||||
Version = $"v{GenericSystemService.GetCurrentAppVersion()} [DEBUG]";
|
||||
#else
|
||||
Version = $"v{GenericSystemService.GetCurrentAppVersion()}";
|
||||
#endif
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@using SteUp.Shared.Components.Layout
|
||||
@using SteUp.Shared.Components.Layout.Overlay
|
||||
@using SteUp.Shared.Core.Dto
|
||||
@using SteUp.Shared.Core.Interface.System
|
||||
@inject IAttachedService AttachedService
|
||||
|
||||
<MudDialog Class="customDialog-form disable-safe-area">
|
||||
<DialogContent>
|
||||
@@ -34,18 +36,11 @@
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
|
||||
[Parameter] public bool CanAddPosition { get; set; }
|
||||
|
||||
//Overlay for save
|
||||
private bool VisibleOverlay { get; set; }
|
||||
private bool SuccessAnimation { get; set; }
|
||||
|
||||
// private AttachedDTO? Attached { get; set; }
|
||||
|
||||
private AttachedDto? Attached { get; set; }
|
||||
|
||||
private bool _requireNewName;
|
||||
|
||||
@@ -60,8 +55,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
private bool SelectTypePicture { get; set; }
|
||||
|
||||
private string TitleModal { get; set; } = "Aggiungi allegati";
|
||||
|
||||
private string? _newName;
|
||||
@@ -76,66 +69,53 @@
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
SelectTypePicture = true;
|
||||
RequireNewName = false;
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
}
|
||||
|
||||
private async Task OnCamera()
|
||||
{
|
||||
// Attached = await AttachedService.SelectImageFromCamera();
|
||||
//
|
||||
// if (Attached != null)
|
||||
// {
|
||||
// RequireNewName = true;
|
||||
// StateHasChanged();
|
||||
// }
|
||||
Attached = await AttachedService.SelectImageFromCamera();
|
||||
|
||||
if (Attached != null)
|
||||
{
|
||||
RequireNewName = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnGallery()
|
||||
{
|
||||
// Attached = await AttachedService.SelectImageFromGallery();
|
||||
//
|
||||
// if (Attached != null)
|
||||
// {
|
||||
// RequireNewName = true;
|
||||
// StateHasChanged();
|
||||
// }
|
||||
Attached = await AttachedService.SelectImageFromGallery();
|
||||
|
||||
if (Attached != null)
|
||||
{
|
||||
RequireNewName = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnNewName()
|
||||
{
|
||||
// if (Attached != null)
|
||||
// {
|
||||
// switch (Attached.Type)
|
||||
// {
|
||||
// case AttachedDTO.TypeAttached.Position:
|
||||
// {
|
||||
// CanAddPosition = false;
|
||||
//
|
||||
// Attached.Description = NewName!;
|
||||
// Attached.Name = NewName!;
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// case AttachedDTO.TypeAttached.Image:
|
||||
// {
|
||||
// var extension = Path.GetExtension(Attached.Name);
|
||||
// Attached.Name = NewName! + extension;
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// case AttachedDTO.TypeAttached.Document:
|
||||
// break;
|
||||
// default:
|
||||
// throw new ArgumentOutOfRangeException();
|
||||
// }
|
||||
// }
|
||||
if (Attached != null)
|
||||
{
|
||||
switch (Attached.Type)
|
||||
{
|
||||
case AttachedDto.TypeAttached.Image:
|
||||
{
|
||||
var extension = Path.GetExtension(Attached.Name);
|
||||
Attached.Name = NewName! + extension;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
// MudDialog.Close(Attached);
|
||||
MudDialog.Close();
|
||||
MudDialog.Close(Attached);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user