generated from Integry/Template_NetMauiBlazorHybrid
Compare commits
41 Commits
v2.0.3(10)
...
39c34e7c7d
| Author | SHA1 | Date | |
|---|---|---|---|
| 39c34e7c7d | |||
| 1f530bc130 | |||
| a4c2eee49d | |||
| 70a34eef06 | |||
| c61ebe348c | |||
| e586279c6b | |||
| 85e227a5cb | |||
| 71ce027fb8 | |||
| 9318d7bd3f | |||
| 3ae0a7f7d1 | |||
| 2879008c20 | |||
| 0dfc0baa28 | |||
| b423ce8d16 | |||
| 514f98a8a7 | |||
| a26f1a57cc | |||
| f4b2e70881 | |||
| bb0bf1e496 | |||
| d0f961b052 | |||
| 61ea1776b3 | |||
| 8dcd61b697 | |||
| 2480a6a60c | |||
| dd5f354b14 | |||
| 6a8414ff6c | |||
| b93f2f2d16 | |||
| a741d60e01 | |||
| 5c1c9130ec | |||
| 8a97506dfd | |||
| 56c7d80c7c | |||
| 3d231ac7c7 | |||
| 5814243c2b | |||
| f36741b8de | |||
| 38eaaa9db2 | |||
| bd15ab5106 | |||
| 42004f82a1 | |||
| cf6e11193e | |||
| 4698e43fd7 | |||
| 5ade3b7a5f | |||
| b7522fb116 | |||
| a593141185 | |||
| 3609749a26 | |||
| 48930550fe |
@@ -175,9 +175,7 @@ public class ManageDataService(
|
||||
|
||||
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
|
||||
{
|
||||
List<StbActivity>? activities;
|
||||
|
||||
activities = await localDb.Get<StbActivity>(x =>
|
||||
var activities = await localDb.Get<StbActivity>(x =>
|
||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||
@@ -198,6 +196,7 @@ public class ManageDataService(
|
||||
|
||||
_ = UpdateDb(activities);
|
||||
}
|
||||
else return [];
|
||||
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
@@ -219,16 +218,7 @@ public class ManageDataService(
|
||||
|
||||
_ = UpdateDb(activities);
|
||||
}
|
||||
else
|
||||
{
|
||||
activities = await localDb.Get<StbActivity>(x =>
|
||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||
(x.EffectiveTime >= whereCond.Start && x.EffectiveTime <= whereCond.End) ||
|
||||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
||||
);
|
||||
}
|
||||
else return await GetActivityTryLocalDb(whereCond);
|
||||
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<linker>
|
||||
<assembly fullname="salesbook.Shared" preserve="all" />
|
||||
|
||||
<assembly fullname="System.Private.CoreLib">
|
||||
<type fullname="System.Runtime.InteropServices.SafeHandle" preserve="all" />
|
||||
<type fullname="System.IO.FileStream" preserve="all" />
|
||||
</assembly>
|
||||
|
||||
<assembly fullname="SourceGear.sqlite3" preserve="all"/>
|
||||
<assembly fullname="sqlite-net-e" preserve="all"/>
|
||||
|
||||
<assembly fullname="Sentry.Maui" preserve="all"/>
|
||||
<assembly fullname="Shiny.Hosting.Maui" preserve="all"/>
|
||||
<assembly fullname="Shiny.Notifications" preserve="all"/>
|
||||
<assembly fullname="Shiny.Push" preserve="all"/>
|
||||
</linker>
|
||||
@@ -104,6 +104,9 @@ namespace salesbook.Maui
|
||||
builder.Services.AddSingleton<INetworkService, NetworkService>();
|
||||
builder.Services.AddSingleton<LocalDbService>();
|
||||
|
||||
_ = typeof(System.Runtime.InteropServices.SafeHandle);
|
||||
_ = typeof(System.IO.FileStream);
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,11 @@
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>Questa app utilizza la tua posizione per migliorare alcune funzionalità basate sulla localizzazione.</string>
|
||||
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>L'app utilizza la tua posizione per allegarla alle attività.</string>
|
||||
<string>Questa app utilizza la tua posizione solo mentre è in uso per allegarla alle attività.</string>
|
||||
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Questa app necessita di accedere alla fotocamera per scattare foto.</string>
|
||||
@@ -48,6 +51,9 @@
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string>
|
||||
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>Alcune librerie di sistema potrebbero accedere al Bluetooth. L’app non utilizza direttamente il Bluetooth.</string>
|
||||
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>remote-notification</string>
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>C617.1</string>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
@@ -23,29 +22,21 @@
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
|
||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>E174.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
<string>C617.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array>
|
||||
<!--user info-->
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataTypeUserID</key>
|
||||
<string>NSPrivacyCollectedDataTypeLocation</string>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypeCrashData</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<true />
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
@@ -54,10 +45,10 @@
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataTypeEmailAddress</key>
|
||||
<string>NSPrivacyCollectedDataTypeLocation</string>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypePerformanceData</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<true />
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
@@ -65,20 +56,6 @@
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataTypePhoneNumber</key>
|
||||
<string>NSPrivacyCollectedDataTypeLocation</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<true />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
|
||||
<!--crashlytics/analytics-->
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypeOtherDiagnosticData</string>
|
||||
@@ -93,9 +70,9 @@
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypeCrashData</string>
|
||||
<string>NSPrivacyCollectedDataTypePreciseLocation</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<true />
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
@@ -103,8 +80,30 @@
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypeCoarseLocation</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
<dict>
|
||||
<key>NSPrivacyCollectedDataType</key>
|
||||
<string>NSPrivacyCollectedDataTypePhotosorVideos</string>
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1 +1,8 @@
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 230" width="230" height="230"><style>.a{fill:#dff2ff}</style><path fill-rule="evenodd" class="a" d="m230 0v230h-230v-230z"/></svg>
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456 456" width="456" height="456">
|
||||
<defs>
|
||||
<image width="456" height="456" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAHIAQMAAADwb+ipAAAAAXNSR0IB2cksfwAAAANQTFRF3/L/KicjZQAAAGhJREFUeJztyzENAAAMA6DVv+l5aHrCT64V0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN05zNB6OcAcm2KNubAAAAAElFTkSuQmCC"/>
|
||||
</defs>
|
||||
<style>
|
||||
</style>
|
||||
<use id="Background" href="#img1" x="0" y="0"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 522 B |
@@ -1 +1,10 @@
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 230" width="230" height="230"><style>.a{fill:none;stroke:#002339;stroke-linecap:round;stroke-linejoin:round;stroke-width:16}.b{fill:none;stroke:#00a0de;stroke-linecap:round;stroke-linejoin:round;stroke-width:16}</style><path fill-rule="evenodd" class="a" d="m119.9 71.4h34.4c20.3 0 36.8 16.5 36.8 36.9v28.3c0 20.4-16.5 36.9-36.8 36.9h-5.1l0.1 32.2-34.7-32.2h-72.2"/><path fill-rule="evenodd" class="b" d="m117.3 24l-77.1 47.4v102.1l77.1-47.4v-102.1z"/></svg>
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024">
|
||||
<defs>
|
||||
<image width="920" height="920" id="img1" href="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDIzMCAyMzAiIHdpZHRoPSIyMzAiIGhlaWdodD0iMjMwIj48c3R5bGU+LmF7ZmlsbDpub25lO3N0cm9rZTojMDAyMzM5O3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MTZ9LmJ7ZmlsbDpub25lO3N0cm9rZTojMDBhMGRlO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MTZ9PC9zdHlsZT48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJhIiBkPSJtMTE5LjkgNzEuNGgzNC40YzIwLjMgMCAzNi44IDE2LjUgMzYuOCAzNi45djI4LjNjMCAyMC40LTE2LjUgMzYuOS0zNi44IDM2LjloLTUuMWwwLjEgMzIuMi0zNC43LTMyLjJoLTcyLjIiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJiIiBkPSJtMTE3LjMgMjRsLTc3LjEgNDcuNHYxMDIuMWw3Ny4xLTQ3LjR2LTEwMi4xeiIvPjwvc3ZnPg=="/>
|
||||
</defs>
|
||||
<style>
|
||||
</style>
|
||||
<g>
|
||||
<use id="appiconfg" href="#img1" transform="matrix(1.113,0,0,1.113,0,0)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 1.0 KiB |
@@ -29,8 +29,8 @@
|
||||
<ApplicationId>it.integry.salesbook</ApplicationId>
|
||||
|
||||
<!-- Versions -->
|
||||
<ApplicationDisplayVersion>2.0.3</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>10</ApplicationVersion>
|
||||
<ApplicationDisplayVersion>2.1.5</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>23</ApplicationVersion>
|
||||
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||
@@ -78,8 +78,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
|
||||
<CodesignKey>Apple Development: Created via API (5B7B69P4JY)</CodesignKey>
|
||||
<CodesignProvision>VS: it.integry.salesbook Development</CodesignProvision>
|
||||
<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
|
||||
<CodesignProvision>salesbook</CodesignProvision>
|
||||
<ProvisioningType>manual</ProvisioningType>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -114,6 +114,15 @@
|
||||
<RunAOTCompilation>true</RunAOTCompilation>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios' and '$(Configuration)'=='Release'">
|
||||
<UseInterpreter>true</UseInterpreter>
|
||||
<RunAOTCompilation>true</RunAOTCompilation>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishAot>true</PublishAot>
|
||||
<MonoAotMode>Hybrid</MonoAotMode>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootAssembly Include="salesbook.Shared" RootMode="All" />
|
||||
<TrimmerRootDescriptor Include="ILLink.Descriptors.xml" />
|
||||
@@ -147,13 +156,13 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Maui" Version="12.2.0" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.110" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.110" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.110" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.9" />
|
||||
<PackageReference Include="Sentry.Maui" Version="5.15.1" />
|
||||
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.120" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.120" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.10" />
|
||||
<PackageReference Include="Sentry.Maui" Version="5.16.1" />
|
||||
<PackageReference Include="Shiny.Hosting.Maui" Version="3.3.4" />
|
||||
<PackageReference Include="Shiny.Notifications" Version="3.3.4" />
|
||||
<PackageReference Include="Shiny.Push" Version="3.3.4" />
|
||||
|
||||
@@ -492,6 +492,8 @@
|
||||
// Selezione giorno in settimana
|
||||
private async Task SelezionaData(DateTime day)
|
||||
{
|
||||
if (IsLoading) return;
|
||||
|
||||
SelectedDate = day;
|
||||
|
||||
var cacheInternalMonth = _internalMonth;
|
||||
@@ -513,6 +515,8 @@
|
||||
// Selezione giorno dal mese (chiude la vista mese!)
|
||||
private async Task SelezionaDataDalMese(DateTime day)
|
||||
{
|
||||
if (IsLoading) return;
|
||||
|
||||
SelectedDate = day;
|
||||
SliderAnimation = "collapse-animation";
|
||||
Expanded = false;
|
||||
|
||||
@@ -15,12 +15,22 @@
|
||||
@inject PreloadService PreloadService
|
||||
@inject IMessenger Messenger
|
||||
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
<SpinnerLayout FullScreen="true"/>
|
||||
|
||||
@code
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
|
||||
var syncAllData = lastSyncDate.Equals(DateTime.MinValue) || (DateTime.Now - lastSyncDate).TotalDays >= 7;
|
||||
|
||||
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && syncAllData)
|
||||
{
|
||||
var returnPath = System.Web.HttpUtility.UrlEncode("/");
|
||||
NavigationManager.NavigateTo($"/sync?path={returnPath}");
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
|
||||
|
||||
await LoadNotification();
|
||||
@@ -35,14 +45,6 @@
|
||||
Console.WriteLine($"Firebase init: {e.Message}");
|
||||
}
|
||||
|
||||
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
|
||||
|
||||
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && lastSyncDate.Equals(DateTime.MinValue))
|
||||
{
|
||||
NavigationManager.NavigateTo("/sync");
|
||||
return;
|
||||
}
|
||||
|
||||
_ = StartSyncUser();
|
||||
NavigationManager.NavigateTo("/Calendar");
|
||||
}
|
||||
@@ -60,9 +62,6 @@
|
||||
|
||||
private Task StartSyncUser()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
_ = PreloadService.PreloadUsersAsync();
|
||||
});
|
||||
return Task.Run(() => { _ = PreloadService.PreloadUsersAsync(); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,17 +20,32 @@
|
||||
|
||||
<MudDialog Class="customDialog-form">
|
||||
<DialogContent>
|
||||
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuova" : $"{ActivityModel.ActivityId}")"/>
|
||||
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave"
|
||||
OnSave="Save" Title="@(IsNew ? "Nuova" : $"{ActivityModel.ActivityId}")"/>
|
||||
|
||||
<div class="content">
|
||||
<div class="input-card">
|
||||
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Descrizione" Variant="Variant.Text" Lines="3" @bind-Value="ActivityModel.ActivityDescription" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Descrizione" Variant="Variant.Text" Lines="3"
|
||||
@bind-Value="ActivityModel.ActivityDescription" @bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings blue-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.Description"
|
||||
Size="Size.Medium"
|
||||
OnClick="@SuggestActivityDescription"
|
||||
Variant="Variant.Outlined">
|
||||
Suggerisci descrizione
|
||||
</MudButton>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<MudAutocomplete ReadOnly="IsView" T="string?" Placeholder="Cliente"
|
||||
SearchFunc="@SearchCliente" @bind-Value="ActivityModel.Cliente" @bind-Value:after="OnClienteChanged"
|
||||
SearchFunc="@SearchCliente" @bind-Value="ActivityModel.Cliente"
|
||||
@bind-Value:after="OnClienteChanged"
|
||||
CoerceValue="true"/>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +61,6 @@
|
||||
else
|
||||
{
|
||||
<MudAutocomplete
|
||||
Disabled="ActivityModel.Cliente.IsNullOrEmpty()"
|
||||
T="JtbComt?" ReadOnly="IsView"
|
||||
@bind-Value="SelectedComessa"
|
||||
@bind-Value:after="OnCommessaSelectedAfter"
|
||||
@@ -66,7 +80,10 @@
|
||||
<div class="form-container">
|
||||
<span>Inizio</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture"
|
||||
InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime"
|
||||
@bind-Value:after="OnAfterChangeValue" DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -74,7 +91,10 @@
|
||||
<div class="form-container">
|
||||
<span>Fine</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture"
|
||||
InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime"
|
||||
@bind-Value:after="OnAfterChangeValue" DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -82,14 +102,31 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Avviso</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || ActivityModel.EstimatedTime == null)" T="int" Variant="Variant.Text" @bind-Value="ActivityModel.MinuteBefore" @bind-Value:after="OnAfterChangeTimeBefore" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="Nessuno" Value="-1">Nessuno</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="All'ora pianificata" Value="0">All'ora pianificata</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="30 minuti prima" Value="30">30 minuti prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 ora prima" Value="60">1 ora prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="2 ore prima" Value="120">2 ore prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 giorno prima" Value="1440">1 giorno prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 settimana prima" Value="10080">1 settimana prima</MudSelectItemExtended>
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || ActivityModel.EstimatedTime == null)"
|
||||
T="int" Variant="Variant.Text" @bind-Value="ActivityModel.MinuteBefore"
|
||||
@bind-Value:after="OnAfterChangeTimeBefore" Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="Nessuno" Value="-1">
|
||||
Nessuno
|
||||
</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="All'ora pianificata" Value="0">All'ora
|
||||
pianificata
|
||||
</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="30 minuti prima" Value="30">
|
||||
30 minuti prima
|
||||
</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 ora prima" Value="60">
|
||||
1 ora prima
|
||||
</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="2 ore prima" Value="120">
|
||||
2 ore prima
|
||||
</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 giorno prima" Value="1440">
|
||||
1 giorno prima
|
||||
</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 settimana prima" Value="10080">
|
||||
1 settimana prima
|
||||
</MudSelectItemExtended>
|
||||
</MudSelectExtended>
|
||||
</div>
|
||||
</div>
|
||||
@@ -132,10 +169,14 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text"
|
||||
@bind-Value="ActivityModel.ActivityTypeId"
|
||||
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var type in ActivityType)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select"
|
||||
Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
}
|
||||
@@ -146,17 +187,23 @@
|
||||
<div class="form-container" @onclick="OpenSelectEsito">
|
||||
<span class="disable-full-width">Esito</span>
|
||||
|
||||
<MudSelectExtended ReadOnly="true" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityResultId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
<MudSelectExtended ReadOnly="true" FullWidth="true" T="string?" Variant="Variant.Text"
|
||||
@bind-Value="ActivityModel.ActivityResultId"
|
||||
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var result in ActivityResult)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@result.ActivityResultId">@result.ActivityResultId</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select"
|
||||
Value="@result.ActivityResultId">@result.ActivityResultId</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="4" @bind-Value="ActivityModel.Note" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="4"
|
||||
@bind-Value="ActivityModel.Note" @bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="container-chip-attached">
|
||||
@@ -166,28 +213,39 @@
|
||||
{
|
||||
@if (item.p.Type == AttachedDTO.TypeAttached.Position)
|
||||
{
|
||||
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success" OnClick="() => OpenPosition(item.p)" OnClose="() => OnRemoveAttached(item.index)">
|
||||
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
|
||||
OnClick="@(() => OpenPosition(item.p))"
|
||||
OnClose="@(() => OnRemoveAttached(item.index))">
|
||||
@item.p.Description
|
||||
</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudChip T="string" Color="Color.Default" OnClick="() => OpenAttached(item.p)" OnClose="() => OnRemoveAttached(item.index)">
|
||||
<MudChip T="string" Color="Color.Default" OnClick="@(() => OpenAttached(item.p))"
|
||||
OnClose="@(() => OnRemoveAttached(item.index))">
|
||||
@item.p.Name
|
||||
</MudChip>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if (ActivityFileList != null)
|
||||
@if (!IsLoading)
|
||||
{
|
||||
if (ActivityFileList != null)
|
||||
{
|
||||
foreach (var file in ActivityFileList)
|
||||
{
|
||||
<MudChip T="string" OnClick="() => OpenAttached(file.Id, file.FileName)" OnClose="() => DeleteAttach(file)" Color="Color.Default">
|
||||
<MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))"
|
||||
OnClose="@(() => DeleteAttach(file))" Color="Color.Default">
|
||||
@file.FileName
|
||||
</MudChip>
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (!IsView)
|
||||
@@ -246,7 +304,8 @@
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
|
||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeEsito"/>
|
||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel"
|
||||
@bind-ActivityModel:after="OnAfterChangeEsito"/>
|
||||
|
||||
<AddMemo @bind-IsSheetVisible="OpenAddMemo"/>
|
||||
|
||||
@@ -268,6 +327,7 @@
|
||||
private List<ActivityFileDto>? ActivityFileList { get; set; }
|
||||
|
||||
private bool IsNew { get; set; }
|
||||
private bool IsLoading { get; set; }
|
||||
private bool IsView => !NetworkService.ConnectionAvailable;
|
||||
|
||||
private string? LabelSave { get; set; }
|
||||
@@ -393,6 +453,9 @@
|
||||
{
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
IsLoading = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
SelectedComessa = ActivityModel.Commessa;
|
||||
|
||||
Users = await ManageData.GetTable<StbUser>();
|
||||
@@ -400,30 +463,13 @@
|
||||
SelectedUser = Users.FindLast(x => x.UserName.Equals(ActivityModel.UserName));
|
||||
|
||||
if (!IsNew && Id != null)
|
||||
{
|
||||
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
||||
if (ActivityModel.IdPosizione != null)
|
||||
{
|
||||
ActivityModel.Position = await IntegryApiService.RetrievePosition(ActivityModel.IdPosizione.Value);
|
||||
CanAddPosition = false;
|
||||
|
||||
AttachedList ??= [];
|
||||
AttachedList.Add(
|
||||
new AttachedDTO
|
||||
{
|
||||
Name = ActivityModel.Position.Description!,
|
||||
Lat = ActivityModel.Position.Lat,
|
||||
Lng = ActivityModel.Position.Lng,
|
||||
Type = AttachedDTO.TypeAttached.Position
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ActivityResult = await ManageData.GetTable<StbActivityResult>();
|
||||
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
|
||||
Pros = await ManageData.GetProspect();
|
||||
|
||||
IsLoading = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
}
|
||||
@@ -440,18 +486,29 @@
|
||||
);
|
||||
}
|
||||
|
||||
private async Task LoadCommesse()
|
||||
private async Task LoadCommesse(string searchValue)
|
||||
{
|
||||
if (_lastLoadedCodAnag == ActivityModel.CodAnag) return;
|
||||
if (_lastLoadedCodAnag == ActivityModel.CodAnag && searchValue.IsNullOrEmpty()) return;
|
||||
|
||||
if (ActivityModel.CodAnag == null)
|
||||
{
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x =>
|
||||
x.CodJcom.ToUpper().Contains(searchValue.ToUpper()) ||
|
||||
x.Descrizione.ToUpper().Contains(searchValue.ToUpper())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag == ActivityModel.CodAnag);
|
||||
}
|
||||
|
||||
Commesse = Commesse.OrderByDescending(x => x.CodJcom).ToList();
|
||||
_lastLoadedCodAnag = ActivityModel.CodAnag;
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<JtbComt>> SearchCommesseAsync(string value, CancellationToken token)
|
||||
{
|
||||
await LoadCommesse();
|
||||
await LoadCommesse(value);
|
||||
if (Commesse.IsNullOrEmpty()) return [];
|
||||
|
||||
IEnumerable<JtbComt> list;
|
||||
@@ -501,11 +558,11 @@
|
||||
var results = new List<string>();
|
||||
|
||||
results.AddRange(Clienti
|
||||
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Where(x => (x.CodAnag != null && x.CodAnag.Contains(value, StringComparison.OrdinalIgnoreCase)) || x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(x => $"{x.CodAnag} - {x.RagSoc}"));
|
||||
|
||||
results.AddRange(Pros
|
||||
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Where(x => (x.CodPpro != null && x.CodPpro.Contains(value, StringComparison.OrdinalIgnoreCase)) || x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(x => $"{x.CodPpro} - {x.RagSoc}"));
|
||||
|
||||
return Task.FromResult<IEnumerable<string>?>(results);
|
||||
@@ -521,24 +578,49 @@
|
||||
{
|
||||
ActivityModel.CodAnag = parts[0];
|
||||
ActivityModel.Cliente = parts[1];
|
||||
|
||||
var isCliente = Clienti.FirstOrDefault(x => x.CodAnag != null && x.CodAnag.Equals(ActivityModel.CodAnag));
|
||||
ActivityModel.TipoAnag = isCliente == null ? "P" : "C";
|
||||
}
|
||||
|
||||
OnAfterChangeValue();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task OnCommessaSelectedAfter()
|
||||
private void OnCommessaSelectedAfter()
|
||||
{
|
||||
var com = SelectedComessa;
|
||||
if (com != null)
|
||||
{
|
||||
ActivityModel.CodJcom = com.CodJcom;
|
||||
ActivityModel.Commessa = com;
|
||||
|
||||
if (com.CodAnag != null)
|
||||
{
|
||||
ActivityModel.CodAnag = com.CodAnag;
|
||||
ActivityModel.TipoAnag = com.TipoAnag;
|
||||
ActivityModel.Cliente = Clienti
|
||||
.Where(x => x.CodAnag != null && x.CodAnag.Equals(com.CodAnag))
|
||||
.Select(x => x.RagSoc)
|
||||
.FirstOrDefault() ?? Pros
|
||||
.Where(x => x.CodPpro != null && x.CodPpro.Equals(com.CodAnag))
|
||||
.Select(x => x.RagSoc)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
ActivityModel.CodAnag = null;
|
||||
ActivityModel.Cliente = null;
|
||||
ActivityModel.TipoAnag = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ActivityModel.CodJcom = null;
|
||||
ActivityModel.Commessa = null;
|
||||
ActivityModel.CodAnag = null;
|
||||
ActivityModel.Cliente = null;
|
||||
ActivityModel.TipoAnag = null;
|
||||
}
|
||||
|
||||
OnAfterChangeValue();
|
||||
@@ -700,6 +782,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OpenAttached(AttachedDTO attached)
|
||||
{
|
||||
if (attached is { FileContent: not null, MimeType: not null })
|
||||
{
|
||||
await AttachedService.OpenFile(attached.FileContent!, attached.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Clear();
|
||||
Snackbar.Add("Impossibile aprire il file", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DeleteAttach(ActivityFileDto file)
|
||||
{
|
||||
Snackbar.Clear();
|
||||
@@ -727,19 +822,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OpenAttached(AttachedDTO attached)
|
||||
{
|
||||
if (attached is { FileContent: not null, MimeType: not null })
|
||||
{
|
||||
await AttachedService.OpenFile(attached.FileContent!, attached.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Clear();
|
||||
Snackbar.Add("Impossibile aprire il file", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenPosition(AttachedDTO attached)
|
||||
{
|
||||
if (attached is { Lat: not null, Lng: not null })
|
||||
@@ -759,4 +841,29 @@
|
||||
private static string AdjustCoordinate(double coordinate) =>
|
||||
coordinate.ToString(CultureInfo.InvariantCulture).Replace(",", ".");
|
||||
|
||||
private async Task SuggestActivityDescription()
|
||||
{
|
||||
if (ActivityModel.ActivityTypeId == null)
|
||||
{
|
||||
Snackbar.Add("Indicare prima il tipo attività", Severity.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(ActivityModel.ActivityTypeId);
|
||||
|
||||
var modal = ModalHelpers.OpenSuggestActivityDescription(Dialog, activityDescriptions);
|
||||
|
||||
if (modal is { IsCanceled: false, Result: not null })
|
||||
ActivityModel.ActivityDescription = modal.Result.Data!.ToString();
|
||||
|
||||
VisibleOverlay = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
@using salesbook.Shared.Core.Entity
|
||||
|
||||
<MudDialog OnBackdropClick="Cancel">
|
||||
<DialogContent>
|
||||
@if (!ActivityTypers.IsNullOrEmpty())
|
||||
{
|
||||
<MudList T="string" SelectedValueChanged="OnClickItem">
|
||||
@foreach (var item in ActivityTypers!)
|
||||
{
|
||||
<MudListItem Text="@item.ActivityTypeDescription" Value="item.ActivityTypeDescription"/>
|
||||
}
|
||||
</MudList>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="spinner-container">
|
||||
<MudIcon Size="Size.Large" Color="Color.Error" Icon="@Icons.Material.Rounded.Close"/>
|
||||
<MudText>Nessuna descrizione consigliata</MudText>
|
||||
</div>
|
||||
}
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||
[Parameter] public List<StbActivityTyper>? ActivityTypers { get; set; }
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void OnClickItem(string? selectedValue) =>
|
||||
MudDialog.Close(DialogResult.Ok(selectedValue));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
18
salesbook.Shared/Core/Entity/StbActivityTyper.cs
Normal file
18
salesbook.Shared/Core/Entity/StbActivityTyper.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Entity;
|
||||
|
||||
public class StbActivityTyper
|
||||
{
|
||||
[JsonPropertyName("activityTypeId")]
|
||||
public string? ActivityTypeId { get; set; }
|
||||
|
||||
[JsonPropertyName("activityTypeDescription")]
|
||||
public string? ActivityTypeDescription { get; set; }
|
||||
|
||||
[JsonPropertyName("flagTipologia")]
|
||||
public string? FlagTipologia { get; set; }
|
||||
|
||||
[JsonPropertyName("idRiga")]
|
||||
public int IdRiga { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using salesbook.Shared.Components.SingleElements.Modal;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
@@ -54,7 +55,7 @@ public class ModalHelpers
|
||||
new DialogParameters<PersRifForm>
|
||||
{
|
||||
{ x => x.OriginalModel, persRif },
|
||||
{ x => x.ContactModel, contactModel},
|
||||
{ x => x.ContactModel, contactModel },
|
||||
{ x => x.PersRifList, persRifList }
|
||||
},
|
||||
new DialogOptions
|
||||
@@ -74,7 +75,28 @@ public class ModalHelpers
|
||||
"Add attached",
|
||||
new DialogParameters<AddAttached>
|
||||
{
|
||||
{ x => x.CanAddPosition, canAddPosition}
|
||||
{ x => x.CanAddPosition, canAddPosition }
|
||||
},
|
||||
new DialogOptions
|
||||
{
|
||||
FullScreen = false,
|
||||
CloseButton = false,
|
||||
NoHeader = true,
|
||||
BackdropClick = false
|
||||
}
|
||||
);
|
||||
|
||||
return await modal.Result;
|
||||
}
|
||||
|
||||
public static async Task<DialogResult?> OpenSuggestActivityDescription(IDialogService dialog,
|
||||
List<StbActivityTyper>? activityTypers)
|
||||
{
|
||||
var modal = await dialog.ShowAsync<ModalSuggestDescription>(
|
||||
"Suggest activity description",
|
||||
new DialogParameters<ModalSuggestDescription>
|
||||
{
|
||||
{ x => x.ActivityTypers, activityTypers }
|
||||
},
|
||||
new DialogOptions
|
||||
{
|
||||
|
||||
@@ -32,6 +32,8 @@ public interface IIntegryApiService
|
||||
|
||||
Task<CRMJobProgressResponseDTO> RetrieveJobProgress(string codJcom);
|
||||
|
||||
Task<List<StbActivityTyper>?> SuggestActivityDescription(string activityType);
|
||||
|
||||
//Position
|
||||
Task<PositionDTO> SavePosition(PositionDTO position);
|
||||
Task<PositionDTO> RetrievePosition(long id);
|
||||
|
||||
@@ -74,7 +74,8 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
|
||||
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity)
|
||||
{
|
||||
if (activity.CodJcom is null && userSession.ProfileDb != null && userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
|
||||
if (activity.CodJcom is null && userSession.ProfileDb != null &&
|
||||
userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
activity.CodJcom = "0000";
|
||||
}
|
||||
@@ -159,7 +160,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -188,4 +189,10 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
|
||||
return integryApiRestClient.Get<CRMJobProgressResponseDTO>("crm/retrieveJobProgress", queryParams)!;
|
||||
}
|
||||
|
||||
public Task<List<StbActivityTyper>?> SuggestActivityDescription(string activityType) =>
|
||||
integryApiRestClient.Get<List<StbActivityTyper>>(
|
||||
"activity/suggestActivityDescription",
|
||||
new Dictionary<string, object> { { "activityType", activityType } }
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
@@ -24,14 +24,14 @@
|
||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.4" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="IntegryApiClient.Core" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.110" />
|
||||
<PackageReference Include="IntegryApiClient.Core" Version="1.2.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.120" />
|
||||
<PackageReference Include="SourceGear.sqlite3" Version="3.50.4.2" />
|
||||
<PackageReference Include="sqlite-net-e" Version="1.10.0-beta2" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.9" />
|
||||
<PackageReference Include="MudBlazor" Version="8.12.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.10" />
|
||||
<PackageReference Include="MudBlazor" Version="8.13.0" />
|
||||
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IntegryApiClient.Blazor" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.9" />
|
||||
<PackageReference Include="IntegryApiClient.Blazor" Version="1.2.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user