Finish v2.0.2(9)
This commit is contained in:
@@ -8,7 +8,9 @@ public class AttachedService : IAttachedService
|
|||||||
public async Task<AttachedDTO?> SelectImageFromCamera()
|
public async Task<AttachedDTO?> SelectImageFromCamera()
|
||||||
{
|
{
|
||||||
var cameraPerm = await Permissions.RequestAsync<Permissions.Camera>();
|
var cameraPerm = await Permissions.RequestAsync<Permissions.Camera>();
|
||||||
if (cameraPerm != PermissionStatus.Granted)
|
var storagePerm = await Permissions.RequestAsync<Permissions.StorageWrite>();
|
||||||
|
|
||||||
|
if (cameraPerm != PermissionStatus.Granted || storagePerm != PermissionStatus.Granted)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
FileResult? result = null;
|
FileResult? result = null;
|
||||||
@@ -20,6 +22,7 @@ public class AttachedService : IAttachedService
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Errore cattura foto: {ex.Message}");
|
Console.WriteLine($"Errore cattura foto: {ex.Message}");
|
||||||
|
SentrySdk.CaptureException(ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,13 +44,13 @@ public class AttachedService : IAttachedService
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Errore selezione galleria: {ex.Message}");
|
Console.WriteLine($"Errore selezione galleria: {ex.Message}");
|
||||||
|
SentrySdk.CaptureException(ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
|
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<AttachedDTO?> SelectFile()
|
public async Task<AttachedDTO?> SelectFile()
|
||||||
{
|
{
|
||||||
var perm = await Permissions.RequestAsync<Permissions.StorageRead>();
|
var perm = await Permissions.RequestAsync<Permissions.StorageRead>();
|
||||||
@@ -115,6 +118,7 @@ public class AttachedService : IAttachedService
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Errore durante il salvataggio dello stream: {e.Message}");
|
Console.WriteLine($"Errore durante il salvataggio dello stream: {e.Message}");
|
||||||
|
SentrySdk.CaptureException(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Storage;
|
|
||||||
using salesbook.Shared.Core.Dto;
|
using salesbook.Shared.Core.Dto;
|
||||||
using salesbook.Shared.Core.Dto.Activity;
|
using salesbook.Shared.Core.Dto.Activity;
|
||||||
using salesbook.Shared.Core.Dto.Contact;
|
using salesbook.Shared.Core.Dto.Contact;
|
||||||
|
using salesbook.Shared.Core.Dto.PageState;
|
||||||
using salesbook.Shared.Core.Entity;
|
using salesbook.Shared.Core.Entity;
|
||||||
using salesbook.Shared.Core.Helpers;
|
using salesbook.Shared.Core.Helpers;
|
||||||
using salesbook.Shared.Core.Helpers.Enum;
|
using salesbook.Shared.Core.Helpers.Enum;
|
||||||
@@ -10,7 +10,7 @@ using salesbook.Shared.Core.Interface;
|
|||||||
using salesbook.Shared.Core.Interface.IntegryApi;
|
using salesbook.Shared.Core.Interface.IntegryApi;
|
||||||
using salesbook.Shared.Core.Interface.System.Network;
|
using salesbook.Shared.Core.Interface.System.Network;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using salesbook.Shared.Core.Dto.PageState;
|
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
|
||||||
|
|
||||||
namespace salesbook.Maui.Core.Services;
|
namespace salesbook.Maui.Core.Services;
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ public class ManageDataService(
|
|||||||
IMapper mapper,
|
IMapper mapper,
|
||||||
UserListState userListState,
|
UserListState userListState,
|
||||||
IIntegryApiService integryApiService,
|
IIntegryApiService integryApiService,
|
||||||
INetworkService networkService
|
INetworkService networkService,
|
||||||
|
IUserSession userSession
|
||||||
) : IManageDataService
|
) : IManageDataService
|
||||||
{
|
{
|
||||||
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
|
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
|
||||||
@@ -260,6 +261,11 @@ public class ManageDataService(
|
|||||||
var returnDto = activities
|
var returnDto = activities
|
||||||
.Select(activity =>
|
.Select(activity =>
|
||||||
{
|
{
|
||||||
|
if (activity.CodJcom is "0000" && userSession.ProfileDb != null && userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
activity.CodJcom = null;
|
||||||
|
}
|
||||||
|
|
||||||
var dto = mapper.Map<ActivityDTO>(activity);
|
var dto = mapper.Map<ActivityDTO>(activity);
|
||||||
|
|
||||||
if (activity is { AlarmTime: not null, EstimatedTime: not null })
|
if (activity is { AlarmTime: not null, EstimatedTime: not null })
|
||||||
|
|||||||
@@ -1,27 +1,57 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.integry.salesbook">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:usesCleartextTraffic="true" android:supportsRtl="true">
|
package="it.integry.salesbook">
|
||||||
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
|
|
||||||
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/appicon"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
android:supportsRtl="true">
|
||||||
|
|
||||||
|
<!-- Firebase push -->
|
||||||
|
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
|
||||||
|
android:exported="false" />
|
||||||
|
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
|
||||||
|
android:exported="true"
|
||||||
|
android:permission="com.google.android.c2dm.permission.SEND">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||||
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
||||||
<category android:name="${applicationId}" />
|
<category android:name="${applicationId}" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
<!-- Rete -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
<!-- Geolocalizzazione -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
|
||||||
|
<!-- Fotocamera -->
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
|
<!-- Storage / Media -->
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
|
<!-- Android 10+ -->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
|
||||||
|
|
||||||
|
<!-- Android 13+ -->
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||||
|
|
||||||
|
<!-- Background / Notifiche -->
|
||||||
<uses-permission android:name="android.permission.BATTERY_STATS" />
|
<uses-permission android:name="android.permission.BATTERY_STATS" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>2.0.2</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>2.0.2</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>8</ApplicationVersion>
|
<ApplicationVersion>9</ApplicationVersion>
|
||||||
|
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||||
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||||
|
|||||||
@@ -10,17 +10,17 @@
|
|||||||
|
|
||||||
.activity-card.memo {
|
.activity-card.memo {
|
||||||
border-left: 5px solid var(--mud-palette-info-darken);
|
border-left: 5px solid var(--mud-palette-info-darken);
|
||||||
background-color: hsl(from var(--mud-palette-info-darken) h s 98%);
|
background-color: hsl(from var(--mud-palette-info-darken) h s 99%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-card.interna {
|
.activity-card.interna {
|
||||||
border-left: 5px solid var(--mud-palette-success-darken);
|
border-left: 5px solid var(--mud-palette-success-darken);
|
||||||
background-color: hsl(from var(--mud-palette-success-darken) h s 98%);
|
background-color: hsl(from var(--mud-palette-success-darken) h s 99%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-card.commessa {
|
.activity-card.commessa {
|
||||||
border-left: 5px solid var(--mud-palette-warning);
|
border-left: 5px solid var(--mud-palette-warning);
|
||||||
background-color: hsl(from var(--mud-palette-warning) h s 98%);
|
background-color: hsl(from var(--mud-palette-warning) h s 99%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-left-section {
|
.activity-left-section {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<MudDialog Class="customDialog-form disable-safe-area">
|
<MudDialog Class="customDialog-form disable-safe-area">
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<HeaderLayout ShowProfile="false" SmallHeader="true" Cancel="true" OnCancel="() => MudDialog.Cancel()" Title="Aggiungi allegati"/>
|
<HeaderLayout ShowProfile="false" SmallHeader="true" Cancel="true" OnCancel="() => MudDialog.Cancel()" Title="@TitleModal"/>
|
||||||
|
|
||||||
@if (RequireNewName)
|
@if (RequireNewName)
|
||||||
{
|
{
|
||||||
@@ -71,9 +71,21 @@
|
|||||||
|
|
||||||
private AttachedDTO? Attached { get; set; }
|
private AttachedDTO? Attached { get; set; }
|
||||||
|
|
||||||
private bool RequireNewName { get; set; }
|
private bool _requireNewName;
|
||||||
|
private bool RequireNewName
|
||||||
|
{
|
||||||
|
get => _requireNewName;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_requireNewName = value;
|
||||||
|
TitleModal = _requireNewName ? "Nome allegato" : "Aggiungi allegati";
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
private bool SelectTypePicture { get; set; }
|
private bool SelectTypePicture { get; set; }
|
||||||
|
|
||||||
|
private string TitleModal { get; set; } = "Aggiungi allegati";
|
||||||
|
|
||||||
private string? _newName;
|
private string? _newName;
|
||||||
private string? NewName
|
private string? NewName
|
||||||
{
|
{
|
||||||
@@ -102,16 +114,22 @@
|
|||||||
{
|
{
|
||||||
Attached = await AttachedService.SelectImageFromCamera();
|
Attached = await AttachedService.SelectImageFromCamera();
|
||||||
|
|
||||||
RequireNewName = true;
|
if (Attached != null)
|
||||||
StateHasChanged();
|
{
|
||||||
|
RequireNewName = true;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnGallery()
|
private async Task OnGallery()
|
||||||
{
|
{
|
||||||
Attached = await AttachedService.SelectImageFromGallery();
|
Attached = await AttachedService.SelectImageFromGallery();
|
||||||
|
|
||||||
RequireNewName = true;
|
if (Attached != null)
|
||||||
StateHasChanged();
|
{
|
||||||
|
RequireNewName = true;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnFile()
|
private async Task OnFile()
|
||||||
@@ -124,8 +142,11 @@
|
|||||||
{
|
{
|
||||||
Attached = await AttachedService.SelectPosition();
|
Attached = await AttachedService.SelectPosition();
|
||||||
|
|
||||||
RequireNewName = true;
|
if (Attached != null)
|
||||||
StateHasChanged();
|
{
|
||||||
|
RequireNewName = true;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnNewName()
|
private void OnNewName()
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public class ActivityDTO : StbActivity
|
|||||||
|
|
||||||
public bool Deleted { get; set; }
|
public bool Deleted { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("stbPosizioni")]
|
||||||
public PositionDTO? Position { get; set; }
|
public PositionDTO? Position { get; set; }
|
||||||
|
|
||||||
public ActivityDTO Clone()
|
public ActivityDTO Clone()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class PositionDTO
|
|||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public long? Id { get; set; }
|
public long? Id { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("description")]
|
[JsonPropertyName("descrizione")]
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("lat")]
|
[JsonPropertyName("lat")]
|
||||||
|
|||||||
@@ -72,8 +72,15 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
|||||||
return integryApiRestClient.AuthorizedGet<object>($"activity/delete", queryParams);
|
return integryApiRestClient.AuthorizedGet<object>($"activity/delete", queryParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
|
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity)
|
||||||
integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
|
{
|
||||||
|
if (activity.CodJcom is null && userSession.ProfileDb != null && userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
activity.CodJcom = "0000";
|
||||||
|
}
|
||||||
|
|
||||||
|
return integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
|
||||||
|
}
|
||||||
|
|
||||||
public Task<CRMCreateContactResponseDTO?> SaveContact(CRMCreateContactRequestDTO request) =>
|
public Task<CRMCreateContactResponseDTO?> SaveContact(CRMCreateContactRequestDTO request) =>
|
||||||
integryApiRestClient.AuthorizedPost<CRMCreateContactResponseDTO>("crm/createContact", request);
|
integryApiRestClient.AuthorizedPost<CRMCreateContactResponseDTO>("crm/createContact", request);
|
||||||
|
|||||||
Reference in New Issue
Block a user