aktueller Stand
This commit is contained in:
BIN
2026-01-28 10_49_55-.png
Normal file
BIN
2026-01-28 10_49_55-.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@@ -67,7 +67,7 @@
|
|||||||
<HintPath>.\Interop.CLMgr.dll</HintPath>
|
<HintPath>.\Interop.CLMgr.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
|
using FasdDesktopUi.Basics.CustomEvents;
|
||||||
using FasdDesktopUi.Basics.Services.RelationService;
|
using FasdDesktopUi.Basics.Services.RelationService;
|
||||||
using FasdDesktopUi.Basics.Services.SupportCase;
|
using FasdDesktopUi.Basics.Services.SupportCase;
|
||||||
using NSubstitute;
|
using NSubstitute;
|
||||||
@@ -62,4 +63,90 @@ public class SupportCaseTest
|
|||||||
Assert.Equal(_supportCase, raisedEvent.Sender);
|
Assert.Equal(_supportCase, raisedEvent.Sender);
|
||||||
Assert.Equal(relations, raisedEvent.Arguments.Relations);
|
Assert.Equal(relations, raisedEvent.Arguments.Relations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void UpdateSupportCaseDataCache_Raise_SupportCaseDataCacheHasChanged()
|
||||||
|
{
|
||||||
|
cF4sdApiSearchResultRelation relation = new()
|
||||||
|
{
|
||||||
|
Type = enumF4sdSearchResultClass.Computer,
|
||||||
|
Name = "My computer",
|
||||||
|
Identities =
|
||||||
|
[
|
||||||
|
new() { Id = Guid.NewGuid(), Class = enumFasdInformationClass.Computer }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
List<cF4SDHealthCardRawData.cHealthCardTable> tables =
|
||||||
|
[
|
||||||
|
new() { Name = "TestTable1", Columns = [], TableType = eDataHistoryTableType.History },
|
||||||
|
];
|
||||||
|
|
||||||
|
var raisedEvent = Assert.Raises<SupportCaseDataEventArgs>(
|
||||||
|
h => _supportCase.SupportCaseDataCacheHasChanged += h,
|
||||||
|
h => _supportCase.SupportCaseDataCacheHasChanged -= h,
|
||||||
|
() => _supportCase.UpdateSupportCaseDataCache(relation, tables));
|
||||||
|
Assert.NotNull(raisedEvent);
|
||||||
|
Assert.Equal(_supportCase, raisedEvent.Sender);
|
||||||
|
Assert.Equal(relation, raisedEvent.Arguments.Relation);
|
||||||
|
Assert.Equal(tables, raisedEvent.Arguments.DataTables);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetSupportCaseData_Contains_UpdateSupportCaseDataCacheData()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
const string columnValue = "Hello world";
|
||||||
|
const string tableName = "TestTable1";
|
||||||
|
const string columnName = "TestColumn1";
|
||||||
|
List<object> expected = [columnValue];
|
||||||
|
|
||||||
|
|
||||||
|
cF4sdApiSearchResultRelation relation = new()
|
||||||
|
{
|
||||||
|
Type = enumF4sdSearchResultClass.Computer,
|
||||||
|
Name = "My computer",
|
||||||
|
Identities =
|
||||||
|
[
|
||||||
|
new() { Id = Guid.NewGuid(), Class = enumFasdInformationClass.Computer }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
cF4SDHealthCardRawData.cHealthCardTable dataTable = new()
|
||||||
|
{
|
||||||
|
Name = tableName,
|
||||||
|
TableType = eDataHistoryTableType.History
|
||||||
|
};
|
||||||
|
dataTable.Columns = new()
|
||||||
|
{
|
||||||
|
[columnName] = new(dataTable) { Values = expected }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
_supportCase.UpdateSupportCaseDataCache(relation, [dataTable]);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
var actual = _supportCase.GetSupportCaseHealthcardData(relation, new cValueAddress() { ValueTable = tableName, ValueColumn = columnName });
|
||||||
|
|
||||||
|
Assert.Equal(expected, actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetSupportCaseData_ReturnsNull_When_NoDataExists()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
cF4sdApiSearchResultRelation relation = new()
|
||||||
|
{
|
||||||
|
Type = enumF4sdSearchResultClass.Computer,
|
||||||
|
Name = "My computer",
|
||||||
|
Identities =
|
||||||
|
[
|
||||||
|
new() { Id = Guid.NewGuid(), Class = enumFasdInformationClass.Computer }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
// Act
|
||||||
|
var actual = _supportCase.GetSupportCaseHealthcardData(relation, new cValueAddress() { ValueTable = "NonExistentTable", ValueColumn = "NonExistentColumn" });
|
||||||
|
// Assert
|
||||||
|
Assert.Null(actual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||||
<PackageReference Include="NSubstitute" Version="5.3.0" />
|
<PackageReference Include="NSubstitute" Version="5.3.0" />
|
||||||
<PackageReference Include="xunit.v3" Version="3.2.0" />
|
<PackageReference Include="xunit.v3" Version="3.2.2" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
|||||||
@@ -53,15 +53,49 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="C4IT.F4SD.DisplayFormatting, Version=1.0.9509.21303, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\C4IT.F4SD.DisplayFormatting.1.0.0\lib\netstandard2.0\C4IT.F4SD.DisplayFormatting.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="C4IT.F4SD.SupportCaseProtocoll, Version=1.0.9516.21165, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\C4IT.F4SD.SupportCaseProtocoll.1.0.0\lib\netstandard2.0\C4IT.F4SD.SupportCaseProtocoll.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="MaterialIcons, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MaterialIcons, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MaterialIcons.1.0.3\lib\MaterialIcons.dll</HintPath>
|
<HintPath>..\packages\MaterialIcons.1.0.3\lib\MaterialIcons.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.2\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=10.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.2\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.10.0.2\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@@ -125,12 +159,13 @@
|
|||||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ExternalToolExecutor.cs" />
|
<Compile Include="ExternalToolExecutor.cs" />
|
||||||
<Compile Include="F4sdCockpitCommunicationM42Base.cs" />
|
<Compile Include="F4sdCockpitCommunicationM42Base.cs" />
|
||||||
<Compile Include="FasdCockpitCommunicationBase.cs" />
|
<Compile Include="FasdCockpitCommunicationBase.cs" />
|
||||||
<Compile Include="Models\F4sdAgentScript.cs" />
|
<Compile Include="Models\F4sdAgentScript.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -140,4 +175,4 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -64,8 +64,9 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
public abstract Task<cF4sdStagedSearchResultRelationTaskId> StartGatheringRelations(IEnumerable<cFasdApiSearchResultEntry> relatedTo, CancellationToken token);
|
public abstract Task<cF4sdStagedSearchResultRelationTaskId> StartGatheringRelations(IEnumerable<cFasdApiSearchResultEntry> relatedTo, CancellationToken token);
|
||||||
public abstract Task<cF4sdStagedSearchResultRelations> GetStagedRelations(Guid id, CancellationToken token);
|
public abstract Task<cF4sdStagedSearchResultRelations> GetStagedRelations(Guid id, CancellationToken token);
|
||||||
|
|
||||||
public abstract Task<List<cF4sdApiSearchResultRelation>> GetSearchResultRelations(enumF4sdSearchResultClass resultType, List<cFasdApiSearchResultEntry> searchResults);
|
public abstract Task<List<cF4sdApiSearchResultRelation>> GetSearchResultRelations(enumF4sdSearchResultClass resultType, List<cFasdApiSearchResultEntry> searchResults);
|
||||||
public abstract Task<List<cF4sdApiSearchResultRelation>> GetTicketOverviewRelations(string key, bool useRoleScope, int count);
|
public abstract Task<List<cF4sdApiSearchResultRelation>> GetTicketOverviewRelations(string key, bool useRoleScope, int count);
|
||||||
|
public abstract Task<Dictionary<string, int>> GetTicketOverviewCounts(IEnumerable<string> keys, bool useRoleScope);
|
||||||
|
|
||||||
public abstract Task<cF4SDHealthCardRawData> GetHealthCardData(cF4sdHealthCardRawDataRequest requestData);
|
public abstract Task<cF4SDHealthCardRawData> GetHealthCardData(cF4sdHealthCardRawDataRequest requestData);
|
||||||
|
|
||||||
|
|||||||
11
FasdCockpitBase/app.config
Normal file
11
FasdCockpitBase/app.config
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.2" newVersion="10.0.0.2" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
@@ -1,5 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="C4IT.F4SD.DisplayFormatting" version="1.0.0" targetFramework="net472" />
|
||||||
|
<package id="C4IT.F4SD.SupportCaseProtocoll" version="1.0.0" targetFramework="net472" />
|
||||||
<package id="MaterialIcons" version="1.0.3" targetFramework="net472" />
|
<package id="MaterialIcons" version="1.0.3" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.2" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="10.0.2" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="10.0.2" targetFramework="net472" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
|
||||||
|
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="10.0.2" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.6.3" targetFramework="net472" />
|
||||||
|
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@@ -95,11 +95,12 @@
|
|||||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="F4sdCockpitCommunicationM42Web.cs" />
|
<Compile Include="F4sdCockpitCommunicationM42Web.cs" />
|
||||||
<Compile Include="FasdCockpitCommunicationWeb.cs" />
|
<Compile Include="FasdCockpitCommunicationWeb.cs" />
|
||||||
<Compile Include="FasdCockpitMachineConfiguration.cs" />
|
<Compile Include="FasdCockpitMachineConfiguration.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="TicketOverview\TicketOverviewCountsResponse.cs" />
|
||||||
</ItemGroup>
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\F4SD-Logging\F4SD-Logging.csproj">
|
<ProjectReference Include="..\F4SD-Logging\F4SD-Logging.csproj">
|
||||||
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
|
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
|
||||||
@@ -115,6 +116,7 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
@@ -123,4 +125,4 @@
|
|||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ using C4IT.Security;
|
|||||||
using C4IT.FASD.Communication.Agent;
|
using C4IT.FASD.Communication.Agent;
|
||||||
|
|
||||||
using FasdCockpitBase.Models;
|
using FasdCockpitBase.Models;
|
||||||
using FasdCockpitCommunication;
|
using FasdCockpitCommunication;
|
||||||
|
using FasdCockpitCommunication.TicketOverview;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
@@ -1095,10 +1096,119 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
public override Task<List<cF4sdApiSearchResultRelation>> GetTicketOverviewRelations(string key, bool useRoleScope, int count)
|
public override async Task<Dictionary<string, int>> GetTicketOverviewCounts(IEnumerable<string> keys, bool useRoleScope)
|
||||||
{
|
{
|
||||||
return Task.FromResult(new List<cF4sdApiSearchResultRelation>());
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
}
|
LogMethodBegin(CM);
|
||||||
|
|
||||||
|
var apiError = 0;
|
||||||
|
var timeStart = DateTime.UtcNow;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var normalizedKeys = (keys ?? Enumerable.Empty<string>())
|
||||||
|
.Where(k => !string.IsNullOrWhiteSpace(k))
|
||||||
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var http = GetHttpHelper(true);
|
||||||
|
var scope = useRoleScope ? "role" : "personal";
|
||||||
|
var urlBuilder = new StringBuilder($"api/TicketOverview/GetCounts?scope={scope}");
|
||||||
|
|
||||||
|
if (normalizedKeys.Count > 0)
|
||||||
|
{
|
||||||
|
var joinedKeys = HttpUtility.UrlEncode(string.Join(",", normalizedKeys));
|
||||||
|
urlBuilder.Append($"&keys={joinedKeys}");
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = urlBuilder.ToString();
|
||||||
|
var result = await http.GetHttpJson(url, 15000, CancellationToken.None);
|
||||||
|
|
||||||
|
if (!result.IsOk)
|
||||||
|
{
|
||||||
|
apiError = (int)result.Status;
|
||||||
|
if (CheckConnectionStatus != null)
|
||||||
|
await CheckConnectionStatus.Invoke();
|
||||||
|
|
||||||
|
LogEntry($"Error on requesting ticket overview counts ({scope}). Status: {result.Status}", LogLevels.Warning);
|
||||||
|
return new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Debug_apiValues) SaveApiResultValueJson("TicketOverview.GetCounts", result.Result, url);
|
||||||
|
|
||||||
|
var response = JsonConvert.DeserializeObject<TicketOverviewCountsResponse>(result.Result);
|
||||||
|
return response?.ToDictionary(normalizedKeys) ?? new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
apiError = E.HResult;
|
||||||
|
if (CheckConnectionStatus != null)
|
||||||
|
await CheckConnectionStatus.Invoke();
|
||||||
|
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (Debug_apiTiming) SaveApiTimingEntry("TicketOverview.GetCounts", timeStart, apiError);
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task<List<cF4sdApiSearchResultRelation>> GetTicketOverviewRelations(string key, bool useRoleScope, int count)
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
|
||||||
|
var apiError = 0;
|
||||||
|
var timeStart = DateTime.UtcNow;
|
||||||
|
var output = new List<cF4sdApiSearchResultRelation>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(key))
|
||||||
|
return output;
|
||||||
|
|
||||||
|
var http = GetHttpHelper(true);
|
||||||
|
var scope = useRoleScope ? "role" : "personal";
|
||||||
|
var safeKey = HttpUtility.UrlEncode(key);
|
||||||
|
var url = $"api/TicketOverview/GetRelations?key={safeKey}&scope={scope}&count={Math.Max(0, count)}";
|
||||||
|
|
||||||
|
var result = await http.GetHttpJson(url, 20000, CancellationToken.None);
|
||||||
|
|
||||||
|
if (!result.IsOk)
|
||||||
|
{
|
||||||
|
apiError = (int)result.Status;
|
||||||
|
if (CheckConnectionStatus != null)
|
||||||
|
await CheckConnectionStatus.Invoke();
|
||||||
|
|
||||||
|
LogEntry($"Error on requesting ticket overview relations for '{key}' ({scope}). Status: {result.Status}", LogLevels.Warning);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Debug_apiValues) SaveApiResultValueJson("TicketOverview.GetRelations", result.Result, url);
|
||||||
|
|
||||||
|
var relations = JsonConvert.DeserializeObject<List<cF4sdApiSearchResultRelation>>(result.Result);
|
||||||
|
if (relations != null)
|
||||||
|
output = relations;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
apiError = E.HResult;
|
||||||
|
if (CheckConnectionStatus != null)
|
||||||
|
await CheckConnectionStatus.Invoke();
|
||||||
|
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (Debug_apiTiming) SaveApiTimingEntry("TicketOverview.GetRelations", timeStart, apiError);
|
||||||
|
LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
public override async Task<cF4SDHealthCardRawData> GetHealthCardData(cF4sdHealthCardRawDataRequest requestData)
|
public override async Task<cF4SDHealthCardRawData> GetHealthCardData(cF4sdHealthCardRawDataRequest requestData)
|
||||||
{
|
{
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace FasdCockpitCommunication.TicketOverview
|
||||||
|
{
|
||||||
|
internal sealed class TicketOverviewCountsResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("counts")]
|
||||||
|
public Dictionary<string, int> Counts { get; set; } = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
public Dictionary<string, int> ToDictionary(IEnumerable<string> expectedKeys)
|
||||||
|
{
|
||||||
|
var comparer = StringComparer.OrdinalIgnoreCase;
|
||||||
|
var output = new Dictionary<string, int>(comparer);
|
||||||
|
|
||||||
|
if (expectedKeys != null)
|
||||||
|
{
|
||||||
|
foreach (var key in expectedKeys)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(key))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (Counts != null && Counts.TryGetValue(key, out var count))
|
||||||
|
output[key] = count;
|
||||||
|
else
|
||||||
|
output[key] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Counts != null)
|
||||||
|
{
|
||||||
|
foreach (var kvp in Counts)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(kvp.Key))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
output[kvp.Key] = kvp.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
FasdCockpitCommunication/app.config
Normal file
11
FasdCockpitCommunication/app.config
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.2" newVersion="10.0.0.2" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -205,9 +205,6 @@
|
|||||||
<NamedParameter ParameterName="ad-dn-User" Name="Distinguished name user" Display="STRING" ValueTable="ad-user" ValueColumn="distinguishedName">
|
<NamedParameter ParameterName="ad-dn-User" Name="Distinguished name user" Display="STRING" ValueTable="ad-user" ValueColumn="distinguishedName">
|
||||||
<Name Lang="DE">Distinguished Name User</Name>
|
<Name Lang="DE">Distinguished Name User</Name>
|
||||||
</NamedParameter>
|
</NamedParameter>
|
||||||
<NamedParameter ParameterName="ad-dn-computer" Name="Distinguished name computer" Display="STRING" ValueTable="ad-computer" ValueColumn="distinguishedName">
|
|
||||||
<Name Lang="DE">Distinguished Name computer</Name>
|
|
||||||
</NamedParameter>
|
|
||||||
<NamedParameter ParameterName="IpAddress" Name="IP address" Display="STRING" ValueTable="agnt-computer-event-string-latest" ValueColumn="NetworkIPLast">
|
<NamedParameter ParameterName="IpAddress" Name="IP address" Display="STRING" ValueTable="agnt-computer-event-string-latest" ValueColumn="NetworkIPLast">
|
||||||
<Name Lang="DE">IP Adresse</Name>
|
<Name Lang="DE">IP Adresse</Name>
|
||||||
</NamedParameter>
|
</NamedParameter>
|
||||||
@@ -282,8 +279,8 @@
|
|||||||
<Computation-Switch-Case ValueId="1">IBM</Computation-Switch-Case>
|
<Computation-Switch-Case ValueId="1">IBM</Computation-Switch-Case>
|
||||||
</Computation-Switch>
|
</Computation-Switch>
|
||||||
<Computation-Format Name="FullDeviceModelName" Format="{0} {1}" ValueTable0="agnt-computer" ValueColumn0="SystemManufacturer" ValueTable1="Computation_DeviceModel" ValueColumn1="default" RemoveDuplicateWords="true" />
|
<Computation-Format Name="FullDeviceModelName" Format="{0} {1}" ValueTable0="agnt-computer" ValueColumn0="SystemManufacturer" ValueTable1="Computation_DeviceModel" ValueColumn1="default" RemoveDuplicateWords="true" />
|
||||||
<Computation-LinearAddition Name="IntuneMobileDeviceCount" a="1" b="1" c="0" ValueTable0="intune-userDeviceCount" ValueColumn0="iOS" ValueTable1="intune-userDeviceCount" ValueColumn1="android" />
|
<!--<Computation-LinearAddition Name="IntuneMobileDeviceCount" a="1" b="1" c="0" ValueTable0="intune-userDeviceCount" ValueColumn0="iOS" ValueTable1="intune-userDeviceCount" ValueColumn1="android" />
|
||||||
<Computation-LinearAddition Name="IntuneOtherDeviceCount" a="1" b="1" c="0" ValueTable0="intune-userDeviceCount" ValueColumn0="macOs" ValueTable1="intune-userDeviceCount" ValueColumn1="linux" />
|
<Computation-LinearAddition Name="IntuneOtherDeviceCount" a="1" b="1" c="0" ValueTable0="intune-userDeviceCount" ValueColumn0="macOs" ValueTable1="intune-userDeviceCount" ValueColumn1="linux" />-->
|
||||||
</Computations>
|
</Computations>
|
||||||
<Translations>
|
<Translations>
|
||||||
<Translator Name="true_good">
|
<Translator Name="true_good">
|
||||||
@@ -470,7 +467,7 @@
|
|||||||
|
|
||||||
<State-Aggregation RefName="Ram_Details_Aggregation" Name="RAM Details">
|
<State-Aggregation RefName="Ram_Details_Aggregation" Name="RAM Details">
|
||||||
<State-Link Reference="RAM_Relative" />
|
<State-Link Reference="RAM_Relative" />
|
||||||
<State-Level Name="Free Memory" ValueTable="agnt-computer-event" ValueColumn="MemoryFree" Warning="4294967296" Error="2147483648" Direction="down">
|
<State-Level Name="Free Memory" ValueTable="agnt-computer-event-numerical" ValueColumn="MemoryFree" Warning="4294967296" Error="2147483648" Direction="down">
|
||||||
<Name Lang="DE">Freier Speicher</Name>
|
<Name Lang="DE">Freier Speicher</Name>
|
||||||
</State-Level>
|
</State-Level>
|
||||||
</State-Aggregation>
|
</State-Aggregation>
|
||||||
@@ -1065,9 +1062,6 @@
|
|||||||
<NamedParameter ParameterName="ad-dn-User" Name="Distinguished name user" Display="STRING" ValueTable="ad-user" ValueColumn="distinguishedName">
|
<NamedParameter ParameterName="ad-dn-User" Name="Distinguished name user" Display="STRING" ValueTable="ad-user" ValueColumn="distinguishedName">
|
||||||
<Name Lang="DE">Distinguished Name User</Name>
|
<Name Lang="DE">Distinguished Name User</Name>
|
||||||
</NamedParameter>
|
</NamedParameter>
|
||||||
<NamedParameter ParameterName="ad-dn-computer" Name="Distinguished name computer" Display="STRING" ValueTable="ad-computer" ValueColumn="distinguishedName">
|
|
||||||
<Name Lang="DE">Distinguished Name computer</Name>
|
|
||||||
</NamedParameter>
|
|
||||||
|
|
||||||
<NamedParameter ParameterName="UserFullName" Name="User name" Display="STRING" ValueTable="ad-user" ValueColumn="name">
|
<NamedParameter ParameterName="UserFullName" Name="User name" Display="STRING" ValueTable="ad-user" ValueColumn="name">
|
||||||
<Name Lang="DE">Anwender</Name>
|
<Name Lang="DE">Anwender</Name>
|
||||||
|
|||||||
@@ -102,6 +102,13 @@
|
|||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
|
|
||||||
|
<xs:simpleType name="ValuedFormat">
|
||||||
|
<xs:restriction base="xs:NCName">
|
||||||
|
<xs:enumeration value="csv" />
|
||||||
|
<xs:enumeration value="json" />
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
|
||||||
<xs:attributeGroup name="ValuePointer">
|
<xs:attributeGroup name="ValuePointer">
|
||||||
<xs:attribute name="Name" type="xs:string" use="optional" />
|
<xs:attribute name="Name" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="ParameterName" type="xs:NCName" use="optional" />
|
<xs:attribute name="ParameterName" type="xs:NCName" use="optional" />
|
||||||
@@ -543,7 +550,8 @@
|
|||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:complexContent>
|
<xs:complexContent>
|
||||||
<xs:extension base="State-Details-Base">
|
<xs:extension base="State-Details-Base">
|
||||||
<xs:attribute name="RowSeparator" type="xs:string" use="required"/>
|
<xs:attribute name="Format" type="ValuedFormat" use="optional"/>
|
||||||
|
<xs:attribute name="RowSeparator" type="xs:string" use="optional"/>
|
||||||
<xs:attribute name="ColSeparator" type="xs:string" use="optional"/>
|
<xs:attribute name="ColSeparator" type="xs:string" use="optional"/>
|
||||||
<xs:attribute name="StringDecorator" type="Separator" use="optional"/>
|
<xs:attribute name="StringDecorator" type="Separator" use="optional"/>
|
||||||
</xs:extension>
|
</xs:extension>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@@ -122,6 +122,7 @@
|
|||||||
<Content Include="Config\F4SD-QuickAction-Configuration.xml">
|
<Content Include="Config\F4SD-QuickAction-Configuration.xml">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="Config\F4SD-CopyTemplate-Configuration.xsd">
|
<None Include="Config\F4SD-CopyTemplate-Configuration.xsd">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -268,7 +268,41 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
return ticket;
|
return ticket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<List<cF4sdApiSearchResultRelation>> GetTicketOverviewRelations(string key, bool useRoleScope, int count)
|
public override Task<Dictionary<string, int>> GetTicketOverviewCounts(IEnumerable<string> keys, bool useRoleScope)
|
||||||
|
{
|
||||||
|
var scopeKey = useRoleScope ? "Role" : "Personal";
|
||||||
|
var comparer = StringComparer.OrdinalIgnoreCase;
|
||||||
|
var result = new Dictionary<string, int>(comparer);
|
||||||
|
|
||||||
|
var requestedKeys = keys == null
|
||||||
|
? TicketOverviewRelations.Keys.ToList()
|
||||||
|
: keys.Where(k => !string.IsNullOrWhiteSpace(k)).Distinct(comparer).ToList();
|
||||||
|
|
||||||
|
if (requestedKeys.Count == 0)
|
||||||
|
requestedKeys.AddRange(TicketOverviewRelations.Keys);
|
||||||
|
|
||||||
|
foreach (var key in requestedKeys)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(key))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (TicketOverviewRelations.TryGetValue(key, out var scopeDictionary) &&
|
||||||
|
scopeDictionary != null &&
|
||||||
|
scopeDictionary.TryGetValue(scopeKey, out var definitions) &&
|
||||||
|
definitions != null)
|
||||||
|
{
|
||||||
|
result[key] = definitions.Count;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result[key] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Task.FromResult(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task<List<cF4sdApiSearchResultRelation>> GetTicketOverviewRelations(string key, bool useRoleScope, int count)
|
||||||
{
|
{
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
LogMethodBegin(CM);
|
LogMethodBegin(CM);
|
||||||
@@ -821,14 +855,14 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
output.Add(new cF4sdApiSearchResultRelation() { id = Guid.NewGuid(), Name = "C4-CK007", DisplayName = "C4-CK007", LastUsed = DateTime.UtcNow, Type = enumF4sdSearchResultClass.Computer, UsingLevel = 1, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = resultIds.First() }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.NewGuid() } } });
|
output.Add(new cF4sdApiSearchResultRelation() { id = Guid.NewGuid(), Name = "C4-CK007", DisplayName = "C4-CK007", LastUsed = DateTime.UtcNow, Type = enumF4sdSearchResultClass.Computer, UsingLevel = 1, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = resultIds.First() }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.NewGuid() } } });
|
||||||
break;
|
break;
|
||||||
case constGuidTimoTicket:
|
case constGuidTimoTicket:
|
||||||
output.Add(new cF4sdApiSearchResultRelation() { id = Guid.Parse(constGuidTimoTicketComputer), Name = "C4-TT007", DisplayName = "C4-TT007", LastUsed = DateTime.UtcNow.AddSeconds(-31), Type = enumF4sdSearchResultClass.Computer, UsingLevel = 1, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.Parse(constGuidTimoTicketComputer) } } });
|
output.Add(new cF4sdApiSearchResultRelation() { id = Guid.Parse(constGuidTimoTicketComputer), Name = "C4-TT007", DisplayName = "C4-TT007", LastUsed = DateTime.UtcNow.AddSeconds(-31), Type = enumF4sdSearchResultClass.Computer, UsingLevel = 1, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.Parse(constGuidTimoTicketComputer) } }, Infos = new Dictionary<string, string>() });
|
||||||
output.Add(new cF4sdApiSearchResultRelation() { id = Guid.NewGuid(), Name = "C4-NB00015", DisplayName = "C4-NB00015", LastUsed = DateTime.UtcNow.AddHours(-10), Type = enumF4sdSearchResultClass.Computer, UsingLevel = 0.6, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.NewGuid() } } });
|
output.Add(new cF4sdApiSearchResultRelation() { id = Guid.NewGuid(), Name = "C4-NB00015", DisplayName = "C4-NB00015", LastUsed = DateTime.UtcNow.AddHours(-10), Type = enumF4sdSearchResultClass.Computer, UsingLevel = 0.6, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.NewGuid() } }, Infos = new Dictionary<string, string>() });
|
||||||
|
|
||||||
var demoTickets = await GetDemoTicketData(new cF4sdHealthCardRawDataRequest() { Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.NewGuid() } } });
|
var demoTickets = await GetDemoTicketData(new cF4sdHealthCardRawDataRequest() { Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Computer, Id = Guid.NewGuid() } } });
|
||||||
|
|
||||||
foreach (var demoTicket in demoTickets)
|
foreach (var demoTicket in demoTickets)
|
||||||
{
|
{
|
||||||
output.Add(new cF4sdApiSearchResultRelation() { id = demoTicket.Id, Name = demoTicket.Name, DisplayName = demoTicket.Name, Infos = new Dictionary<string, string>() { ["Summary"] = demoTicket.Summary, ["StatusId"] = ((int)demoTicket.Status).ToString(), ["Asset"] = demoTicket.Asset }, Type = enumF4sdSearchResultClass.Ticket, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Ticket, Id = demoTicket.Id } } });
|
output.Add(new cF4sdApiSearchResultRelation() { id = demoTicket.Id, Name = demoTicket.Name, DisplayName = demoTicket.Name, Infos = new Dictionary<string, string>() { ["Summary"] = demoTicket.Summary, ["Status"] = demoTicket.Status.ToString(), ["StatusId"] = ((int)demoTicket.Status).ToString(), ["Asset"] = demoTicket.Asset }, Type = enumF4sdSearchResultClass.Ticket, Identities = new cF4sdIdentityList() { new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = Guid.Parse(constGuidTimoTicket) }, new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Ticket, Id = demoTicket.Id } } });
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -855,6 +889,7 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
LogMethodBegin(CM);
|
LogMethodBegin(CM);
|
||||||
|
|
||||||
var output = new cF4SDHealthCardRawData();
|
var output = new cF4SDHealthCardRawData();
|
||||||
|
cF4SDHealthCardRawData.cHealthCardTable outputTable;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -890,47 +925,52 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
output.Tables["M42Wpm-Tickets"] = new cF4SDHealthCardRawData.cHealthCardTable()
|
outputTable = new cF4SDHealthCardRawData.cHealthCardTable()
|
||||||
{
|
{
|
||||||
Name = "M42Wpm-Tickets",
|
Name = "M42Wpm-Tickets",
|
||||||
InformationClass = enumFasdInformationClass.Ticket,
|
InformationClass = enumFasdInformationClass.Ticket,
|
||||||
IsStatic = true,
|
IsStatic = true,
|
||||||
Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
|
||||||
{
|
|
||||||
["name"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Name } },
|
|
||||||
["Status"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { ticketStatusString } },
|
|
||||||
["Priority"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Priority } },
|
|
||||||
["AffectedUser"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.AffectedUser } },
|
|
||||||
["AssetName"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Asset } },
|
|
||||||
["CreationDaysSinceNow"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.CreationDaysSinceNow } },
|
|
||||||
["CreationDate"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.CreationDate.ToUniversalTime() } },
|
|
||||||
["ClosingDaysSinceNow"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.ClosingDaysSinceNow } },
|
|
||||||
["ClosingDate"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.ClosingDate } },
|
|
||||||
["Category"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Category } },
|
|
||||||
["CreationSource"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.CreationSource.ToString() } },
|
|
||||||
["Description"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Description?.ToString() } },
|
|
||||||
["DescriptionHtml"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.DescriptionHtml?.ToString() } },
|
|
||||||
["Summary"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Summary.ToString() } },
|
|
||||||
["Solution"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.Solution?.ToString() } },
|
|
||||||
["SolutionHtml"] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { Values = new List<object>() { selectedTicket.SolutionHtml?.ToString() } },
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
output.Tables["M42Wpm-Ticket-History"] = new cF4SDHealthCardRawData.cHealthCardTable()
|
outputTable.Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
||||||
|
{
|
||||||
|
["name"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Name } },
|
||||||
|
["Status"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { ticketStatusString } },
|
||||||
|
["Priority"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Priority } },
|
||||||
|
["AffectedUser"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.AffectedUser } },
|
||||||
|
["AssetName"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Asset } },
|
||||||
|
["CreationDaysSinceNow"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.CreationDaysSinceNow } },
|
||||||
|
["CreationDate"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.CreationDate.ToUniversalTime() } },
|
||||||
|
["ClosingDaysSinceNow"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.ClosingDaysSinceNow } },
|
||||||
|
["ClosingDate"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.ClosingDate } },
|
||||||
|
["Category"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Category } },
|
||||||
|
["CreationSource"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.CreationSource.ToString() } },
|
||||||
|
["Description"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Description?.ToString() } },
|
||||||
|
["DescriptionHtml"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.DescriptionHtml?.ToString() } },
|
||||||
|
["Summary"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Summary.ToString() } },
|
||||||
|
["Solution"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.Solution?.ToString() } },
|
||||||
|
["SolutionHtml"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { Values = new List<object>() { selectedTicket.SolutionHtml?.ToString() } },
|
||||||
|
};
|
||||||
|
|
||||||
|
output.Tables["M42Wpm-Tickets"] = outputTable;
|
||||||
|
|
||||||
|
outputTable = new cF4SDHealthCardRawData.cHealthCardTable()
|
||||||
{
|
{
|
||||||
Name = "M42Wpm-Ticket-History",
|
Name = "M42Wpm-Ticket-History",
|
||||||
InformationClass = enumFasdInformationClass.Ticket,
|
InformationClass = enumFasdInformationClass.Ticket,
|
||||||
IsStatic = false,
|
IsStatic = false
|
||||||
Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
|
||||||
{
|
|
||||||
["Header"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(),
|
|
||||||
["IsVisibleForUser"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(),
|
|
||||||
["CreationDaysSinceNow"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(),
|
|
||||||
["time"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(),
|
|
||||||
["Description"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(),
|
|
||||||
["DescriptionHtml"] = new cF4SDHealthCardRawData.cHealthCardTableColumn()
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
outputTable.Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
||||||
|
{
|
||||||
|
["Header"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable),
|
||||||
|
["IsVisibleForUser"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable),
|
||||||
|
["CreationDaysSinceNow"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable),
|
||||||
|
["time"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable),
|
||||||
|
["Description"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable),
|
||||||
|
["DescriptionHtml"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable)
|
||||||
|
};
|
||||||
|
|
||||||
|
output.Tables["M42Wpm-Ticket-History"] = outputTable;
|
||||||
|
|
||||||
foreach (var journalItem in selectedTicket.JournalItems)
|
foreach (var journalItem in selectedTicket.JournalItems)
|
||||||
{
|
{
|
||||||
@@ -944,55 +984,63 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
|
|
||||||
foreach (var directLink in selectedTicket.DirectLinks)
|
foreach (var directLink in selectedTicket.DirectLinks)
|
||||||
{
|
{
|
||||||
output.Tables["M42Wpm-Tickets"].Columns[directLink.Key] = new cF4SDHealthCardRawData.cHealthCardTableColumn() { ColumnName = directLink.Key, IsIncomplete = false, Values = new List<object>() { directLink.Value } };
|
outputTable = output.Tables["M42Wpm-Tickets"];
|
||||||
|
if (outputTable?.Columns != null)
|
||||||
|
outputTable.Columns[directLink.Key] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { ColumnName = directLink.Key, IsIncomplete = false, Values = new List<object>() { directLink.Value } };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output.Tables.Add("sequenceTable", new cF4SDHealthCardRawData.cHealthCardTable()
|
outputTable = new cF4SDHealthCardRawData.cHealthCardTable()
|
||||||
{
|
{
|
||||||
IsIncomplete = true,
|
IsIncomplete = true,
|
||||||
IsStatic = false,
|
IsStatic = false,
|
||||||
StartingIndex = 7,
|
StartingIndex = 7
|
||||||
Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
};
|
||||||
|
outputTable.Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
||||||
|
{
|
||||||
|
["sequenceColumn"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable)
|
||||||
{
|
{
|
||||||
["sequenceColumn"] = new cF4SDHealthCardRawData.cHealthCardTableColumn()
|
ColumnName = "sequenceColumn",
|
||||||
{
|
Values = new List<object>() { 1, 0 }
|
||||||
ColumnName = "sequenceColumn",
|
|
||||||
Values = new List<object>() { 1, 0 }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
output.Tables.Add("sequenceTable2", new cF4SDHealthCardRawData.cHealthCardTable()
|
output.Tables.Add("sequenceTable", outputTable);
|
||||||
|
|
||||||
|
outputTable = new cF4SDHealthCardRawData.cHealthCardTable()
|
||||||
{
|
{
|
||||||
IsIncomplete = true,
|
IsIncomplete = true,
|
||||||
IsStatic = false,
|
IsStatic = false,
|
||||||
StartingIndex = 7,
|
StartingIndex = 7
|
||||||
Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
};
|
||||||
|
outputTable.Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
||||||
|
{
|
||||||
|
["sequenceColumn"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable)
|
||||||
{
|
{
|
||||||
["sequenceColumn"] = new cF4SDHealthCardRawData.cHealthCardTableColumn()
|
ColumnName = "sequenceColumn",
|
||||||
{
|
Values = new List<object>() { 8, 1, 0 }
|
||||||
ColumnName = "sequenceColumn",
|
|
||||||
Values = new List<object>() { 8, 1, 0 }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
output.Tables.Add("sequenceTable3", new cF4SDHealthCardRawData.cHealthCardTable()
|
output.Tables.Add("sequenceTable2", outputTable);
|
||||||
|
|
||||||
|
outputTable = new cF4SDHealthCardRawData.cHealthCardTable()
|
||||||
{
|
{
|
||||||
IsIncomplete = false,
|
IsIncomplete = false,
|
||||||
StartingIndex = 0,
|
StartingIndex = 0,
|
||||||
IsStatic = true,
|
IsStatic = true
|
||||||
Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
};
|
||||||
|
outputTable.Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>()
|
||||||
|
{
|
||||||
|
["sequenceColumn"] = new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable)
|
||||||
{
|
{
|
||||||
["sequenceColumn"] = new cF4SDHealthCardRawData.cHealthCardTableColumn()
|
ColumnName = "sequenceColumn",
|
||||||
{
|
Values = new List<object>() { "Static" }
|
||||||
ColumnName = "sequenceColumn",
|
|
||||||
Values = new List<object>() { "Static" }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
output.Tables.Add("sequenceTable3", outputTable);
|
||||||
|
|
||||||
output.Id = Guid.NewGuid();
|
output.Id = Guid.NewGuid();
|
||||||
|
|
||||||
@@ -1041,49 +1089,61 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
await Task.Delay(250);
|
await Task.Delay(250);
|
||||||
lock (CachedHealthCardRawData)
|
lock (CachedHealthCardRawData)
|
||||||
{
|
{
|
||||||
if (!CachedHealthCardRawData.ContainsKey(Id))
|
if (!CachedHealthCardRawData.TryGetValue(Id, out var _rawData))
|
||||||
CachedHealthCardRawData[Id] = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
{
|
||||||
|
_rawData = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
||||||
|
CachedHealthCardRawData[Id] = _rawData;
|
||||||
|
}
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables is null)
|
if (_rawData.Tables is null)
|
||||||
CachedHealthCardRawData[Id].Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
_rawData.Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables.ContainsKey(tableOne))
|
if (!_rawData.Tables.TryGetValue(tableOne, out var _table))
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne] = new cF4SDHealthCardRawData.cHealthCardTable() { Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
{
|
||||||
|
_table = new cF4SDHealthCardRawData.cHealthCardTable() { Name = tableOne, Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
||||||
|
_rawData.Tables[tableOne] = _table;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables[tableOne].Columns.ContainsKey(columnName))
|
if (!_table.Columns.ContainsKey(columnName))
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn();
|
_table.Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn(_table);
|
||||||
|
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].StartingIndex = 3;
|
_table.StartingIndex = 3;
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].IsIncomplete = true;
|
_table.IsIncomplete = true;
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName].Values.Count < 3)
|
if (_table.Columns[columnName].Values.Count < 3)
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName].Values.AddRange(new List<object>() { 5, 4, 3, 2, 1, 0 });
|
_table.Columns[columnName].Values.AddRange(new List<object>() { 5, 4, 3, 2, 1, 0 });
|
||||||
else
|
else
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName].Values.InsertRange(3, new List<object>() { 5, 4, 3, 2, 1, 0 });
|
_table.Columns[columnName].Values.InsertRange(3, new List<object>() { 5, 4, 3, 2, 1, 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(250);
|
await Task.Delay(250);
|
||||||
lock (CachedHealthCardRawData)
|
lock (CachedHealthCardRawData)
|
||||||
{
|
{
|
||||||
if (!CachedHealthCardRawData.ContainsKey(Id))
|
if (!CachedHealthCardRawData.TryGetValue(Id, out var _rawData))
|
||||||
CachedHealthCardRawData[Id] = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
{
|
||||||
|
_rawData = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
||||||
|
CachedHealthCardRawData[Id] = _rawData;
|
||||||
|
}
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables is null)
|
if (_rawData.Tables is null)
|
||||||
CachedHealthCardRawData[Id].Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
_rawData.Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables.ContainsKey(tableTwo))
|
if (!_rawData.Tables.TryGetValue(tableTwo, out var _table))
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo] = new cF4SDHealthCardRawData.cHealthCardTable() { Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
{
|
||||||
|
_table = new cF4SDHealthCardRawData.cHealthCardTable() { Name = tableTwo, Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
||||||
|
_rawData.Tables[tableTwo] = _table;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables[tableTwo].Columns.ContainsKey(columnName))
|
if (!_table.Columns.ContainsKey(columnName))
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn();
|
_table.Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn(_table);
|
||||||
|
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].StartingIndex = 2;
|
_table.StartingIndex = 2;
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].IsIncomplete = true;
|
_table.IsIncomplete = true;
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName].Values.Count < 2)
|
if (_table.Columns[columnName].Values.Count < 2)
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName].Values.AddRange(new List<object>() { 0, 3, 1, 2, 3, 8, 1, 0 });
|
_table.Columns[columnName].Values.AddRange(new List<object>() { 0, 3, 1, 2, 3, 8, 1, 0 });
|
||||||
else
|
else
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName].Values.InsertRange(2, new List<object>() { 0, 3, 1, 2, 3, 8, 1, 0 });
|
_table.Columns[columnName].Values.InsertRange(2, new List<object>() { 0, 3, 1, 2, 3, 8, 1, 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
@@ -1092,61 +1152,79 @@ namespace C4IT.FASD.Cockpit.Communication
|
|||||||
const string numericalTable = "agnt-computer-event-numerical";
|
const string numericalTable = "agnt-computer-event-numerical";
|
||||||
const string processorColumn = "ProcessorUsage";
|
const string processorColumn = "ProcessorUsage";
|
||||||
|
|
||||||
if (!CachedHealthCardRawData.ContainsKey(Id))
|
if (!CachedHealthCardRawData.TryGetValue(Id, out var _rawData))
|
||||||
CachedHealthCardRawData[Id] = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
{
|
||||||
|
_rawData = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
||||||
|
CachedHealthCardRawData[Id] = _rawData;
|
||||||
|
}
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables is null)
|
if (_rawData.Tables is null)
|
||||||
CachedHealthCardRawData[Id].Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
_rawData.Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables.ContainsKey(numericalTable))
|
if (!_rawData.Tables.TryGetValue(numericalTable, out var _table))
|
||||||
CachedHealthCardRawData[Id].Tables[numericalTable] = new cF4SDHealthCardRawData.cHealthCardTable() { Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
{
|
||||||
|
_table = new cF4SDHealthCardRawData.cHealthCardTable() { Name = numericalTable, Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
||||||
|
_rawData.Tables[numericalTable] = _table;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables[numericalTable].Columns.ContainsKey(processorColumn))
|
if (!_table.Columns.ContainsKey(processorColumn))
|
||||||
CachedHealthCardRawData[Id].Tables[numericalTable].Columns[processorColumn] = new cF4SDHealthCardRawData.cHealthCardTableColumn();
|
_table.Columns[processorColumn] = new cF4SDHealthCardRawData.cHealthCardTableColumn(_table);
|
||||||
|
|
||||||
CachedHealthCardRawData[Id].Tables[numericalTable].IsIncomplete = false;
|
_table.IsIncomplete = false;
|
||||||
CachedHealthCardRawData[Id].Tables[numericalTable].Columns[processorColumn].IsIncomplete = false;
|
_table.Columns[processorColumn].IsIncomplete = false;
|
||||||
CachedHealthCardRawData[Id].Tables[numericalTable].Columns[processorColumn].Values = new List<object>() { 12.0, 20.0, 18.0, 15.0, 18.0, 19.0, 20.0, 26.0, 17.0, 11.0, 18.0, 16.0, 16.0, 14.0, 15.0 };
|
_table.Columns[processorColumn].Values = new List<object>() { 12.0, 20.0, 18.0, 15.0, 18.0, 19.0, 20.0, 26.0, 17.0, 11.0, 18.0, 16.0, 16.0, 14.0, 15.0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(250);
|
await Task.Delay(250);
|
||||||
lock (CachedHealthCardRawData)
|
lock (CachedHealthCardRawData)
|
||||||
{
|
{
|
||||||
if (!CachedHealthCardRawData.ContainsKey(Id))
|
if (!CachedHealthCardRawData.TryGetValue(Id, out var _rawData))
|
||||||
CachedHealthCardRawData[Id] = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
{
|
||||||
|
_rawData = new cF4SDHealthCardRawData() { Id = Id, Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>() };
|
||||||
|
CachedHealthCardRawData[Id] = _rawData;
|
||||||
|
}
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables is null)
|
if (_rawData.Tables is null)
|
||||||
CachedHealthCardRawData[Id].Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
_rawData.Tables = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTable>();
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables.ContainsKey(tableOne))
|
if (!_rawData.Tables.TryGetValue(tableOne, out var _table))
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne] = new cF4SDHealthCardRawData.cHealthCardTable() { Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
{
|
||||||
|
_table = new cF4SDHealthCardRawData.cHealthCardTable() { Name = tableOne, Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
||||||
|
_rawData.Tables[tableOne] = _table;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables[tableOne].Columns.ContainsKey(columnName))
|
if (!_table.Columns.TryGetValue(columnName, out var _column))
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn();
|
{
|
||||||
|
_column = new cF4SDHealthCardRawData.cHealthCardTableColumn(_table);
|
||||||
|
_table.Columns[columnName] = _column;
|
||||||
|
}
|
||||||
|
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].StartingIndex = 0;
|
_table.StartingIndex = 0;
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].IsIncomplete = false;
|
_table.IsIncomplete = false;
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName].Values.Count < 0)
|
if (_column.Values.Count < 0)
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName].Values.AddRange(new List<object>() { 8, 7, 6 });
|
_column.Values.AddRange(new List<object>() { 8, 7, 6 });
|
||||||
else
|
else
|
||||||
CachedHealthCardRawData[Id].Tables[tableOne].Columns[columnName].Values.InsertRange(0, new List<object>() { 8, 7, 6 });
|
_column.Values.InsertRange(0, new List<object>() { 8, 7, 6 });
|
||||||
|
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables.ContainsKey(tableTwo))
|
if (!_rawData.Tables.TryGetValue(tableTwo, out var _table2))
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo] = new cF4SDHealthCardRawData.cHealthCardTable() { Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
{
|
||||||
|
_table2 = new cF4SDHealthCardRawData.cHealthCardTable() { Name = tableTwo, Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>() };
|
||||||
|
_rawData.Tables[tableTwo] = _table2;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CachedHealthCardRawData[Id].Tables[tableTwo].Columns.ContainsKey(columnName))
|
if (!_rawData.Tables[tableTwo].Columns.ContainsKey(columnName))
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn();
|
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName] = new cF4SDHealthCardRawData.cHealthCardTableColumn(_table2);
|
||||||
|
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].StartingIndex = 1;
|
_table2.StartingIndex = 1;
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].IsIncomplete = false;
|
_table2.IsIncomplete = false;
|
||||||
|
|
||||||
|
|
||||||
if (CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName].Values.Count < 1)
|
if (_table2.Columns[columnName].Values.Count < 1)
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName].Values.AddRange(new List<object>() { 1 });
|
_table2.Columns[columnName].Values.AddRange(new List<object>() { 1 });
|
||||||
else
|
else
|
||||||
CachedHealthCardRawData[Id].Tables[tableTwo].Columns[columnName].Values.InsertRange(1, new List<object>() { 1 });
|
_table2.Columns[columnName].Values.InsertRange(1, new List<object>() { 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
11
FasdCockpitCommunicationDemo/app.config
Normal file
11
FasdCockpitCommunicationDemo/app.config
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.2" newVersion="10.0.0.2" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
@@ -43,25 +43,26 @@ namespace C4IT.FASD.Base
|
|||||||
if (output.Tables.ContainsKey(table.Name))
|
if (output.Tables.ContainsKey(table.Name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var tableColumns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>();
|
var outputTable = new cF4SDHealthCardRawData.cHealthCardTable()
|
||||||
|
|
||||||
foreach (var column in table.Columns)
|
|
||||||
{
|
|
||||||
if (tableColumns.ContainsKey(column.ColumnName))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var values = new List<object>();
|
|
||||||
values.AddRange(column.Values);
|
|
||||||
tableColumns.Add(column.ColumnName, new cF4SDHealthCardRawData.cHealthCardTableColumn() { ColumnName = column.ColumnName, Values = values });
|
|
||||||
}
|
|
||||||
|
|
||||||
output.Tables.Add(table.Name, new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
{
|
{
|
||||||
Name = table.Name,
|
Name = table.Name,
|
||||||
IsStatic = table.IsStatic,
|
IsStatic = table.IsStatic,
|
||||||
TimeFrames = table.TimeFrames,
|
TimeFrames = table.TimeFrames,
|
||||||
Columns = tableColumns
|
};
|
||||||
});
|
|
||||||
|
outputTable.Columns = new Dictionary<string, cF4SDHealthCardRawData.cHealthCardTableColumn>();
|
||||||
|
|
||||||
|
foreach (var column in table.Columns)
|
||||||
|
{
|
||||||
|
if (outputTable.Columns.ContainsKey(column.ColumnName))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var values = new List<object>();
|
||||||
|
values.AddRange(column.Values);
|
||||||
|
outputTable.Columns.Add(column.ColumnName, new cF4SDHealthCardRawData.cHealthCardTableColumn(outputTable) { ColumnName = column.ColumnName, Values = values });
|
||||||
|
}
|
||||||
|
|
||||||
|
output.Tables.Add(table.Name, outputTable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -25,7 +25,11 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-10.0.1.0" newVersion="10.0.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.2" newVersion="10.0.0.2" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ using C4IT.FASD.Cockpit.Communication;
|
|||||||
using C4IT.FASD.Security;
|
using C4IT.FASD.Security;
|
||||||
using C4IT.Graphics;
|
using C4IT.Graphics;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
using FasdDesktopUi.Basics;
|
using FasdDesktopUi.Basics;
|
||||||
using FasdDesktopUi.Basics.Helper;
|
using FasdDesktopUi.Basics.Helper;
|
||||||
using FasdDesktopUi.Basics.Models;
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using FasdDesktopUi.Basics.Services.Models;
|
||||||
using FasdDesktopUi.Pages.CustomMessageBox;
|
using FasdDesktopUi.Pages.CustomMessageBox;
|
||||||
using FasdDesktopUi.Pages.PhoneSettingsPage;
|
using FasdDesktopUi.Pages.PhoneSettingsPage;
|
||||||
using FasdDesktopUi.Pages.SearchPage;
|
using FasdDesktopUi.Pages.SearchPage;
|
||||||
@@ -35,10 +36,11 @@ namespace FasdDesktopUi
|
|||||||
|
|
||||||
static public System.Windows.Forms.ToolStripItem M42OptionMenuItem = null;
|
static public System.Windows.Forms.ToolStripItem M42OptionMenuItem = null;
|
||||||
|
|
||||||
public System.Windows.Forms.NotifyIcon notifyIcon = new System.Windows.Forms.NotifyIcon() { Text = $"First Aid Service Desk" };
|
public System.Windows.Forms.NotifyIcon notifyIcon = new System.Windows.Forms.NotifyIcon() { Text = $"First Aid Service Desk" };
|
||||||
public bool UseOsLanguage = string.IsNullOrEmpty(cFasdCockpitConfig.Instance.SelectedLanguage);
|
public bool UseOsLanguage = string.IsNullOrEmpty(cFasdCockpitConfig.Instance.SelectedLanguage);
|
||||||
|
|
||||||
private TrayTicketNotificationManager _ticketTrayNotification;
|
private TrayTicketNotificationManager _ticketTrayNotification;
|
||||||
|
private TileScope? _pendingTicketOverviewScope;
|
||||||
|
|
||||||
private async void Application_Startup(object sender, StartupEventArgs e)
|
private async void Application_Startup(object sender, StartupEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -166,42 +168,50 @@ namespace FasdDesktopUi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NotifyIcon_Click(object sender, EventArgs e)
|
private void NotifyIcon_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (e is System.Windows.Forms.MouseEventArgs mouseEventArgs)
|
if (e is System.Windows.Forms.MouseEventArgs mouseEventArgs)
|
||||||
if (mouseEventArgs.Button == System.Windows.Forms.MouseButtons.Right)
|
if (mouseEventArgs.Button == System.Windows.Forms.MouseButtons.Right)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
var searchView = SearchPageView.Instance;
|
var searchView = SearchPageView.Instance;
|
||||||
if (searchView == null)
|
if (searchView == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if isDemo
|
var hasNotification = HasPendingTicketOverviewNotification();
|
||||||
var hasNotification = HasPendingTicketOverviewNotification();
|
if (hasNotification)
|
||||||
|
{
|
||||||
if (searchView.IsVisible && !hasNotification)
|
if (!searchView.IsVisible)
|
||||||
{
|
searchView.ActivateSearchView();
|
||||||
searchView.Hide();
|
else
|
||||||
return;
|
searchView.BringToFrontPreserveState();
|
||||||
}
|
|
||||||
|
searchView.ShowTicketOverviewPaneForScope(PendingTicketOverviewScope);
|
||||||
if (!searchView.IsVisible)
|
ClearTicketOverviewTrayNotification();
|
||||||
searchView.ActivateSearchView();
|
return;
|
||||||
else
|
}
|
||||||
searchView.BringToFrontPreserveState();
|
|
||||||
|
#if isDemo
|
||||||
searchView.ShowTicketOverviewPane();
|
if (searchView.IsVisible)
|
||||||
|
{
|
||||||
if (hasNotification)
|
searchView.Hide();
|
||||||
ClearTicketOverviewTrayNotification();
|
return;
|
||||||
#else
|
}
|
||||||
if (SearchPageView.Instance.IsVisible)
|
|
||||||
SearchPageView.Instance.Hide();
|
if (!searchView.IsVisible)
|
||||||
else
|
searchView.ActivateSearchView();
|
||||||
SearchPageView.Instance.ActivateSearchView();
|
else
|
||||||
|
searchView.BringToFrontPreserveState();
|
||||||
|
|
||||||
|
searchView.ShowTicketOverviewPane();
|
||||||
|
#else
|
||||||
|
if (SearchPageView.Instance.IsVisible)
|
||||||
|
SearchPageView.Instance.Hide();
|
||||||
|
else
|
||||||
|
SearchPageView.Instance.ActivateSearchView();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -271,48 +281,56 @@ namespace FasdDesktopUi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NotifyIcon_BalloonTipClicked(object sender, EventArgs e)
|
private void NotifyIcon_BalloonTipClicked(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SearchPageView.Instance?.BringToFrontPreserveState();
|
SearchPageView.Instance?.BringToFrontPreserveState();
|
||||||
SearchPageView.Instance?.ShowTicketOverviewPane();
|
SearchPageView.Instance?.ShowTicketOverviewPaneForScope(PendingTicketOverviewScope);
|
||||||
ClearTicketOverviewTrayNotification();
|
ClearTicketOverviewTrayNotification();
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
LogException(E);
|
LogException(E);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HasPendingTicketOverviewNotification()
|
private bool HasPendingTicketOverviewNotification()
|
||||||
{
|
{
|
||||||
return _ticketTrayNotification?.HasNotification ?? false;
|
return _ticketTrayNotification?.HasNotification ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowTicketOverviewTrayNotification(string message)
|
public void ShowTicketOverviewTrayNotification(string message)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_ticketTrayNotification?.Show(message);
|
_ticketTrayNotification?.Show(message);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogException(ex);
|
LogException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearTicketOverviewTrayNotification()
|
public void ClearTicketOverviewTrayNotification()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_ticketTrayNotification?.Clear();
|
_pendingTicketOverviewScope = null;
|
||||||
}
|
_ticketTrayNotification?.Clear();
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
catch (Exception ex)
|
||||||
LogException(ex);
|
{
|
||||||
}
|
LogException(ex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetTicketOverviewNotificationScope(TileScope? scope)
|
||||||
|
{
|
||||||
|
_pendingTicketOverviewScope = scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TileScope? PendingTicketOverviewScope => _pendingTicketOverviewScope;
|
||||||
|
|
||||||
private System.Windows.Forms.ToolStripItem SetUpNotifyIconLanguageOption()
|
private System.Windows.Forms.ToolStripItem SetUpNotifyIconLanguageOption()
|
||||||
{
|
{
|
||||||
|
|||||||
16
FasdDesktopUi/Basics/CustomEvents/HeadingDataEventArgs.cs
Normal file
16
FasdDesktopUi/Basics/CustomEvents/HeadingDataEventArgs.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.CustomEvents
|
||||||
|
{
|
||||||
|
public class HeadingDataEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public IEnumerable<cHeadingDataModel> NewValue { get; }
|
||||||
|
|
||||||
|
public HeadingDataEventArgs(IEnumerable<cHeadingDataModel> headingData) : base()
|
||||||
|
{
|
||||||
|
NewValue = headingData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FasdDesktopUi.Basics.Services.RelationService
|
namespace FasdDesktopUi.Basics.CustomEvents
|
||||||
{
|
{
|
||||||
public class RelationEventArgs : EventArgs
|
public class RelationEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using C4IT.FASD.Base;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.CustomEvents
|
||||||
|
{
|
||||||
|
public class SupportCaseDataEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public cF4sdApiSearchResultRelation Relation { get; set; }
|
||||||
|
public IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> DataTables { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -125,7 +125,7 @@ namespace FasdDesktopUi.Basics.Helper
|
|||||||
|
|
||||||
private bool HasRequiredInformationClasses(List<enumFasdInformationClass> required)
|
private bool HasRequiredInformationClasses(List<enumFasdInformationClass> required)
|
||||||
{
|
{
|
||||||
return !(required.Any(informationClass => _dataProvider.Identities.Any(identity => identity.Class == informationClass) == false));
|
return !(required.Any(informationClass => _dataProvider?.Identities?.Any(identity => identity.Class == informationClass) == false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,10 @@ namespace FasdDesktopUi.Basics.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (App.M42OptionMenuItem != null)
|
if (App.M42OptionMenuItem != null)
|
||||||
App.M42OptionMenuItem.Enabled = userInfo != null;
|
App.Current.MainWindow.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
App.M42OptionMenuItem.Enabled = userInfo != null;
|
||||||
|
});
|
||||||
|
|
||||||
// check, if the are logons needed
|
// check, if the are logons needed
|
||||||
bool m42Valid = await CheckAndRefreshM42LogonAsync();
|
bool m42Valid = await CheckAndRefreshM42LogonAsync();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace FasdDesktopUi.Basics.Models
|
|||||||
public enumFasdInformationClass InformationClass { get; set; }
|
public enumFasdInformationClass InformationClass { get; set; }
|
||||||
public bool IsOnline { get; set; }
|
public bool IsOnline { get; set; }
|
||||||
public cF4sdIdentityList Identities { get; set; }
|
public cF4sdIdentityList Identities { get; set; }
|
||||||
|
public cF4sdApiSearchResultRelation Realtion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class cSwapCaseInfo
|
public class cSwapCaseInfo
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
|
|
||||||
using FasdCockpitBase;
|
using FasdCockpitBase;
|
||||||
@@ -49,6 +50,7 @@ namespace FasdDesktopUi.Basics.Models
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
cUtility.RawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
var outputTable = dataProvider.HealthCardDataHelper.HealthCardRawData.GetTableByName(valueAdress.ValueTable, true);
|
var outputTable = dataProvider.HealthCardDataHelper.HealthCardRawData.GetTableByName(valueAdress.ValueTable, true);
|
||||||
if (outputTable != null)
|
if (outputTable != null)
|
||||||
|
|||||||
@@ -69,79 +69,79 @@ namespace FasdDesktopUi.Basics.Models
|
|||||||
set { if (_unassignedTicketsSelected != value) { _unassignedTicketsSelected = value; OnPropertyChanged(nameof(UnassignedTicketsSelected)); } }
|
set { if (_unassignedTicketsSelected != value) { _unassignedTicketsSelected = value; OnPropertyChanged(nameof(UnassignedTicketsSelected)); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _unassignedTicketsCriticalSelected;
|
private bool _unassignedTicketsCriticalSelected;
|
||||||
public bool UnassignedTicketsCriticalSelected
|
public bool UnassignedTicketsCriticalSelected
|
||||||
{
|
{
|
||||||
get => _unassignedTicketsCriticalSelected;
|
get => _unassignedTicketsCriticalSelected;
|
||||||
set { if (_unassignedTicketsCriticalSelected != value) { _unassignedTicketsCriticalSelected = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalSelected)); } }
|
set { if (_unassignedTicketsCriticalSelected != value) { _unassignedTicketsCriticalSelected = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalSelected)); } }
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Highlight-Properties
|
#region Highlight-Properties
|
||||||
private bool _ticketsNewHighlighted;
|
private bool _ticketsNewHighlighted;
|
||||||
public bool TicketsNewHighlighted { get => _ticketsNewHighlighted; set { if (_ticketsNewHighlighted != value) { _ticketsNewHighlighted = value; OnPropertyChanged(nameof(TicketsNewHighlighted)); } } }
|
public bool TicketsNewHighlighted { get => _ticketsNewHighlighted; set { if (_ticketsNewHighlighted != value) { _ticketsNewHighlighted = value; OnPropertyChanged(nameof(TicketsNewHighlighted)); } } }
|
||||||
|
|
||||||
private bool _ticketsActiveHighlighted;
|
private bool _ticketsActiveHighlighted;
|
||||||
public bool TicketsActiveHighlighted { get => _ticketsActiveHighlighted; set { if (_ticketsActiveHighlighted != value) { _ticketsActiveHighlighted = value; OnPropertyChanged(nameof(TicketsActiveHighlighted)); } } }
|
public bool TicketsActiveHighlighted { get => _ticketsActiveHighlighted; set { if (_ticketsActiveHighlighted != value) { _ticketsActiveHighlighted = value; OnPropertyChanged(nameof(TicketsActiveHighlighted)); } } }
|
||||||
|
|
||||||
private bool _ticketsCriticalHighlighted;
|
private bool _ticketsCriticalHighlighted;
|
||||||
public bool TicketsCriticalHighlighted { get => _ticketsCriticalHighlighted; set { if (_ticketsCriticalHighlighted != value) { _ticketsCriticalHighlighted = value; OnPropertyChanged(nameof(TicketsCriticalHighlighted)); } } }
|
public bool TicketsCriticalHighlighted { get => _ticketsCriticalHighlighted; set { if (_ticketsCriticalHighlighted != value) { _ticketsCriticalHighlighted = value; OnPropertyChanged(nameof(TicketsCriticalHighlighted)); } } }
|
||||||
|
|
||||||
private bool _ticketsNewInfoHighlighted;
|
private bool _ticketsNewInfoHighlighted;
|
||||||
public bool TicketsNewInfoHighlighted { get => _ticketsNewInfoHighlighted; set { if (_ticketsNewInfoHighlighted != value) { _ticketsNewInfoHighlighted = value; OnPropertyChanged(nameof(TicketsNewInfoHighlighted)); } } }
|
public bool TicketsNewInfoHighlighted { get => _ticketsNewInfoHighlighted; set { if (_ticketsNewInfoHighlighted != value) { _ticketsNewInfoHighlighted = value; OnPropertyChanged(nameof(TicketsNewInfoHighlighted)); } } }
|
||||||
|
|
||||||
private bool _incidentNewHighlighted;
|
private bool _incidentNewHighlighted;
|
||||||
public bool IncidentNewHighlighted { get => _incidentNewHighlighted; set { if (_incidentNewHighlighted != value) { _incidentNewHighlighted = value; OnPropertyChanged(nameof(IncidentNewHighlighted)); } } }
|
public bool IncidentNewHighlighted { get => _incidentNewHighlighted; set { if (_incidentNewHighlighted != value) { _incidentNewHighlighted = value; OnPropertyChanged(nameof(IncidentNewHighlighted)); } } }
|
||||||
|
|
||||||
private bool _incidentActiveHighlighted;
|
private bool _incidentActiveHighlighted;
|
||||||
public bool IncidentActiveHighlighted { get => _incidentActiveHighlighted; set { if (_incidentActiveHighlighted != value) { _incidentActiveHighlighted = value; OnPropertyChanged(nameof(IncidentActiveHighlighted)); } } }
|
public bool IncidentActiveHighlighted { get => _incidentActiveHighlighted; set { if (_incidentActiveHighlighted != value) { _incidentActiveHighlighted = value; OnPropertyChanged(nameof(IncidentActiveHighlighted)); } } }
|
||||||
|
|
||||||
private bool _incidentCriticalHighlighted;
|
private bool _incidentCriticalHighlighted;
|
||||||
public bool IncidentCriticalHighlighted { get => _incidentCriticalHighlighted; set { if (_incidentCriticalHighlighted != value) { _incidentCriticalHighlighted = value; OnPropertyChanged(nameof(IncidentCriticalHighlighted)); } } }
|
public bool IncidentCriticalHighlighted { get => _incidentCriticalHighlighted; set { if (_incidentCriticalHighlighted != value) { _incidentCriticalHighlighted = value; OnPropertyChanged(nameof(IncidentCriticalHighlighted)); } } }
|
||||||
|
|
||||||
private bool _incidentNewInfoHighlighted;
|
private bool _incidentNewInfoHighlighted;
|
||||||
public bool IncidentNewInfoHighlighted { get => _incidentNewInfoHighlighted; set { if (_incidentNewInfoHighlighted != value) { _incidentNewInfoHighlighted = value; OnPropertyChanged(nameof(IncidentNewInfoHighlighted)); } } }
|
public bool IncidentNewInfoHighlighted { get => _incidentNewInfoHighlighted; set { if (_incidentNewInfoHighlighted != value) { _incidentNewInfoHighlighted = value; OnPropertyChanged(nameof(IncidentNewInfoHighlighted)); } } }
|
||||||
|
|
||||||
private bool _unassignedTicketsHighlighted;
|
private bool _unassignedTicketsHighlighted;
|
||||||
public bool UnassignedTicketsHighlighted { get => _unassignedTicketsHighlighted; set { if (_unassignedTicketsHighlighted != value) { _unassignedTicketsHighlighted = value; OnPropertyChanged(nameof(UnassignedTicketsHighlighted)); } } }
|
public bool UnassignedTicketsHighlighted { get => _unassignedTicketsHighlighted; set { if (_unassignedTicketsHighlighted != value) { _unassignedTicketsHighlighted = value; OnPropertyChanged(nameof(UnassignedTicketsHighlighted)); } } }
|
||||||
|
|
||||||
private bool _unassignedTicketsCriticalHighlighted;
|
private bool _unassignedTicketsCriticalHighlighted;
|
||||||
public bool UnassignedTicketsCriticalHighlighted { get => _unassignedTicketsCriticalHighlighted; set { if (_unassignedTicketsCriticalHighlighted != value) { _unassignedTicketsCriticalHighlighted = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalHighlighted)); } } }
|
public bool UnassignedTicketsCriticalHighlighted { get => _unassignedTicketsCriticalHighlighted; set { if (_unassignedTicketsCriticalHighlighted != value) { _unassignedTicketsCriticalHighlighted = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalHighlighted)); } } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Change Hint Properties
|
#region Change Hint Properties
|
||||||
private string _ticketsNewChangeHint;
|
private string _ticketsNewChangeHint;
|
||||||
public string TicketsNewChangeHint { get => _ticketsNewChangeHint; set { if (_ticketsNewChangeHint != value) { _ticketsNewChangeHint = value; OnPropertyChanged(nameof(TicketsNewChangeHint)); } } }
|
public string TicketsNewChangeHint { get => _ticketsNewChangeHint; set { if (_ticketsNewChangeHint != value) { _ticketsNewChangeHint = value; OnPropertyChanged(nameof(TicketsNewChangeHint)); } } }
|
||||||
|
|
||||||
private string _ticketsActiveChangeHint;
|
private string _ticketsActiveChangeHint;
|
||||||
public string TicketsActiveChangeHint { get => _ticketsActiveChangeHint; set { if (_ticketsActiveChangeHint != value) { _ticketsActiveChangeHint = value; OnPropertyChanged(nameof(TicketsActiveChangeHint)); } } }
|
public string TicketsActiveChangeHint { get => _ticketsActiveChangeHint; set { if (_ticketsActiveChangeHint != value) { _ticketsActiveChangeHint = value; OnPropertyChanged(nameof(TicketsActiveChangeHint)); } } }
|
||||||
|
|
||||||
private string _ticketsCriticalChangeHint;
|
private string _ticketsCriticalChangeHint;
|
||||||
public string TicketsCriticalChangeHint { get => _ticketsCriticalChangeHint; set { if (_ticketsCriticalChangeHint != value) { _ticketsCriticalChangeHint = value; OnPropertyChanged(nameof(TicketsCriticalChangeHint)); } } }
|
public string TicketsCriticalChangeHint { get => _ticketsCriticalChangeHint; set { if (_ticketsCriticalChangeHint != value) { _ticketsCriticalChangeHint = value; OnPropertyChanged(nameof(TicketsCriticalChangeHint)); } } }
|
||||||
|
|
||||||
private string _ticketsNewInfoChangeHint;
|
private string _ticketsNewInfoChangeHint;
|
||||||
public string TicketsNewInfoChangeHint { get => _ticketsNewInfoChangeHint; set { if (_ticketsNewInfoChangeHint != value) { _ticketsNewInfoChangeHint = value; OnPropertyChanged(nameof(TicketsNewInfoChangeHint)); } } }
|
public string TicketsNewInfoChangeHint { get => _ticketsNewInfoChangeHint; set { if (_ticketsNewInfoChangeHint != value) { _ticketsNewInfoChangeHint = value; OnPropertyChanged(nameof(TicketsNewInfoChangeHint)); } } }
|
||||||
|
|
||||||
private string _incidentNewChangeHint;
|
private string _incidentNewChangeHint;
|
||||||
public string IncidentNewChangeHint { get => _incidentNewChangeHint; set { if (_incidentNewChangeHint != value) { _incidentNewChangeHint = value; OnPropertyChanged(nameof(IncidentNewChangeHint)); } } }
|
public string IncidentNewChangeHint { get => _incidentNewChangeHint; set { if (_incidentNewChangeHint != value) { _incidentNewChangeHint = value; OnPropertyChanged(nameof(IncidentNewChangeHint)); } } }
|
||||||
|
|
||||||
private string _incidentActiveChangeHint;
|
private string _incidentActiveChangeHint;
|
||||||
public string IncidentActiveChangeHint { get => _incidentActiveChangeHint; set { if (_incidentActiveChangeHint != value) { _incidentActiveChangeHint = value; OnPropertyChanged(nameof(IncidentActiveChangeHint)); } } }
|
public string IncidentActiveChangeHint { get => _incidentActiveChangeHint; set { if (_incidentActiveChangeHint != value) { _incidentActiveChangeHint = value; OnPropertyChanged(nameof(IncidentActiveChangeHint)); } } }
|
||||||
|
|
||||||
private string _incidentCriticalChangeHint;
|
private string _incidentCriticalChangeHint;
|
||||||
public string IncidentCriticalChangeHint { get => _incidentCriticalChangeHint; set { if (_incidentCriticalChangeHint != value) { _incidentCriticalChangeHint = value; OnPropertyChanged(nameof(IncidentCriticalChangeHint)); } } }
|
public string IncidentCriticalChangeHint { get => _incidentCriticalChangeHint; set { if (_incidentCriticalChangeHint != value) { _incidentCriticalChangeHint = value; OnPropertyChanged(nameof(IncidentCriticalChangeHint)); } } }
|
||||||
|
|
||||||
private string _incidentNewInfoChangeHint;
|
private string _incidentNewInfoChangeHint;
|
||||||
public string IncidentNewInfoChangeHint { get => _incidentNewInfoChangeHint; set { if (_incidentNewInfoChangeHint != value) { _incidentNewInfoChangeHint = value; OnPropertyChanged(nameof(IncidentNewInfoChangeHint)); } } }
|
public string IncidentNewInfoChangeHint { get => _incidentNewInfoChangeHint; set { if (_incidentNewInfoChangeHint != value) { _incidentNewInfoChangeHint = value; OnPropertyChanged(nameof(IncidentNewInfoChangeHint)); } } }
|
||||||
|
|
||||||
private string _unassignedTicketsChangeHint;
|
private string _unassignedTicketsChangeHint;
|
||||||
public string UnassignedTicketsChangeHint { get => _unassignedTicketsChangeHint; set { if (_unassignedTicketsChangeHint != value) { _unassignedTicketsChangeHint = value; OnPropertyChanged(nameof(UnassignedTicketsChangeHint)); } } }
|
public string UnassignedTicketsChangeHint { get => _unassignedTicketsChangeHint; set { if (_unassignedTicketsChangeHint != value) { _unassignedTicketsChangeHint = value; OnPropertyChanged(nameof(UnassignedTicketsChangeHint)); } } }
|
||||||
|
|
||||||
private string _unassignedTicketsCriticalChangeHint;
|
private string _unassignedTicketsCriticalChangeHint;
|
||||||
public string UnassignedTicketsCriticalChangeHint { get => _unassignedTicketsCriticalChangeHint; set { if (_unassignedTicketsCriticalChangeHint != value) { _unassignedTicketsCriticalChangeHint = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalChangeHint)); } } }
|
public string UnassignedTicketsCriticalChangeHint { get => _unassignedTicketsCriticalChangeHint; set { if (_unassignedTicketsCriticalChangeHint != value) { _unassignedTicketsCriticalChangeHint = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalChangeHint)); } } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Ticket & Incident-Properties
|
#region Ticket & Incident-Properties
|
||||||
|
|
||||||
// Ticket Properties
|
// Ticket Properties
|
||||||
private int _ticketsNew;
|
private int _ticketsNew;
|
||||||
@@ -184,11 +184,11 @@ namespace FasdDesktopUi.Basics.Models
|
|||||||
|
|
||||||
#region Helper-Methods
|
#region Helper-Methods
|
||||||
|
|
||||||
public void ResetSelection()
|
public void ResetSelection()
|
||||||
{
|
{
|
||||||
TicketsNewSelected = false;
|
TicketsNewSelected = false;
|
||||||
TicketsActiveSelected = false;
|
TicketsActiveSelected = false;
|
||||||
TicketsCriticalSelected = false;
|
TicketsCriticalSelected = false;
|
||||||
TicketsNewInfoSelected = false;
|
TicketsNewInfoSelected = false;
|
||||||
|
|
||||||
IncidentNewSelected = false;
|
IncidentNewSelected = false;
|
||||||
@@ -196,38 +196,44 @@ namespace FasdDesktopUi.Basics.Models
|
|||||||
IncidentCriticalSelected = false;
|
IncidentCriticalSelected = false;
|
||||||
IncidentNewInfoSelected = false;
|
IncidentNewInfoSelected = false;
|
||||||
|
|
||||||
UnassignedTicketsSelected = false;
|
UnassignedTicketsSelected = false;
|
||||||
UnassignedTicketsCriticalSelected = false;
|
UnassignedTicketsCriticalSelected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetHighlights()
|
public void ResetHighlights()
|
||||||
{
|
{
|
||||||
TicketsNewHighlighted = false;
|
TicketsNewHighlighted = false;
|
||||||
TicketsActiveHighlighted = false;
|
TicketsActiveHighlighted = false;
|
||||||
TicketsCriticalHighlighted = false;
|
TicketsCriticalHighlighted = false;
|
||||||
TicketsNewInfoHighlighted = false;
|
TicketsNewInfoHighlighted = false;
|
||||||
|
|
||||||
IncidentNewHighlighted = false;
|
IncidentNewHighlighted = false;
|
||||||
IncidentActiveHighlighted = false;
|
IncidentActiveHighlighted = false;
|
||||||
IncidentCriticalHighlighted = false;
|
IncidentCriticalHighlighted = false;
|
||||||
IncidentNewInfoHighlighted = false;
|
IncidentNewInfoHighlighted = false;
|
||||||
|
|
||||||
UnassignedTicketsHighlighted = false;
|
UnassignedTicketsHighlighted = false;
|
||||||
UnassignedTicketsCriticalHighlighted = false;
|
UnassignedTicketsCriticalHighlighted = false;
|
||||||
|
|
||||||
TicketsNewChangeHint = null;
|
TicketsNewChangeHint = null;
|
||||||
TicketsActiveChangeHint = null;
|
TicketsActiveChangeHint = null;
|
||||||
TicketsCriticalChangeHint = null;
|
TicketsCriticalChangeHint = null;
|
||||||
TicketsNewInfoChangeHint = null;
|
TicketsNewInfoChangeHint = null;
|
||||||
|
|
||||||
IncidentNewChangeHint = null;
|
IncidentNewChangeHint = null;
|
||||||
IncidentActiveChangeHint = null;
|
IncidentActiveChangeHint = null;
|
||||||
IncidentCriticalChangeHint = null;
|
IncidentCriticalChangeHint = null;
|
||||||
IncidentNewInfoChangeHint = null;
|
IncidentNewInfoChangeHint = null;
|
||||||
|
|
||||||
UnassignedTicketsChangeHint = null;
|
UnassignedTicketsChangeHint = null;
|
||||||
UnassignedTicketsCriticalChangeHint = null;
|
UnassignedTicketsCriticalChangeHint = null;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
|
||||||
}
|
public TicketOverviewModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ namespace FasdDesktopUi.Basics
|
|||||||
if (addRelation)
|
if (addRelation)
|
||||||
foreach (var _caseRelation in CaseRelations)
|
foreach (var _caseRelation in CaseRelations)
|
||||||
{
|
{
|
||||||
if (_caseRelation.isEqual(CaseRelation))
|
if (_caseRelation.Equals(CaseRelation))
|
||||||
{
|
{
|
||||||
addRelation = false;
|
addRelation = false;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -5,15 +5,18 @@ namespace FasdDesktopUi.Basics.Services.Models
|
|||||||
{
|
{
|
||||||
public sealed class TicketOverviewCountsChangedEventArgs : EventArgs
|
public sealed class TicketOverviewCountsChangedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public TicketOverviewCountsChangedEventArgs(IReadOnlyList<TileCountChange> changes, IReadOnlyDictionary<string, TileCounts> currentCounts)
|
public TicketOverviewCountsChangedEventArgs(IReadOnlyList<TileCountChange> changes, IReadOnlyDictionary<string, TileCounts> currentCounts, TileScope? initializedScope = null)
|
||||||
{
|
{
|
||||||
Changes = changes;
|
Changes = changes ?? Array.Empty<TileCountChange>();
|
||||||
CurrentCounts = currentCounts;
|
CurrentCounts = currentCounts;
|
||||||
|
InitializedScope = initializedScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyList<TileCountChange> Changes { get; }
|
public IReadOnlyList<TileCountChange> Changes { get; }
|
||||||
|
|
||||||
public IReadOnlyDictionary<string, TileCounts> CurrentCounts { get; }
|
public IReadOnlyDictionary<string, TileCounts> CurrentCounts { get; }
|
||||||
|
|
||||||
|
public TileScope? InitializedScope { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly struct TileCountChange
|
public readonly struct TileCountChange
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -8,14 +9,14 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
{
|
{
|
||||||
internal class F4SDProtocoll
|
internal class F4SDProtocoll
|
||||||
{
|
{
|
||||||
private readonly ICollection<IProtocollEntry> _protocollEntries = new List<IProtocollEntry>();
|
private readonly ICollection<ProtocollEntryBase> _protocollEntries = new List<ProtocollEntryBase>();
|
||||||
|
|
||||||
public static F4SDProtocoll Instance { get; private set; } = new F4SDProtocoll();
|
public static F4SDProtocoll Instance { get; private set; } = new F4SDProtocoll();
|
||||||
|
|
||||||
private F4SDProtocoll() { }
|
private F4SDProtocoll() { }
|
||||||
|
|
||||||
internal void Add(IProtocollEntry entry) => _protocollEntries.Add(entry);
|
internal void Add(ProtocollEntryBase entry) => _protocollEntries.Add(entry);
|
||||||
internal void Add(IEnumerable<IProtocollEntry> entries)
|
internal void Add(IEnumerable<ProtocollEntryBase> entries)
|
||||||
{
|
{
|
||||||
foreach (var entry in entries)
|
foreach (var entry in entries)
|
||||||
{
|
{
|
||||||
@@ -25,34 +26,34 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
|
|
||||||
internal void Clear() => _protocollEntries.Clear();
|
internal void Clear() => _protocollEntries.Clear();
|
||||||
|
|
||||||
internal T GetLatestOfType<T>() where T : IProtocollEntry => _protocollEntries.OfType<T>().LastOrDefault();
|
internal T GetLatestOfType<T>() where T : ProtocollEntryBase => _protocollEntries.OfType<T>().LastOrDefault();
|
||||||
|
|
||||||
internal IEnumerable<T> GetOfType<T>(int? count = null) where T : IProtocollEntry
|
internal IEnumerable<T> GetOfType<T>(int? count = null) where T : ProtocollEntryBase
|
||||||
{
|
{
|
||||||
if(count.HasValue)
|
if(count.HasValue)
|
||||||
return _protocollEntries.OfType<T>().Reverse().Take(count.Value).Reverse();
|
return _protocollEntries.OfType<T>().Reverse().Take(count.Value).Reverse();
|
||||||
return _protocollEntries.OfType<T>();
|
return _protocollEntries.OfType<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal IEnumerable<IProtocollEntry> GetAll() => _protocollEntries;
|
internal IEnumerable<ProtocollEntryBase> GetAll() => _protocollEntries;
|
||||||
|
|
||||||
internal DataObject GetLatestOfTypeAsDataObject<T>(bool skipHtmlFrame) where T : IProtocollEntry
|
internal DataObject GetLatestOfTypeAsDataObject<T>(bool skipHtmlFrame) where T : ProtocollEntryBase
|
||||||
{
|
{
|
||||||
IProtocollEntry entry = _protocollEntries.OfType<T>().LastOrDefault();
|
ProtocollEntryBase entry = _protocollEntries.OfType<T>().LastOrDefault();
|
||||||
|
|
||||||
if (entry is null)
|
if (entry is null)
|
||||||
return new DataObject();
|
return new DataObject();
|
||||||
|
|
||||||
return GetDataObjectOf(new IProtocollEntry[] { entry }, skipHtmlFrame);
|
return GetDataObjectOf(new ProtocollEntryBase[] { entry }, skipHtmlFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal DataObject GetOfTypeAsDataObject<T>(bool skipHtmlFrame, int? count = null) where T : IProtocollEntry
|
internal DataObject GetOfTypeAsDataObject<T>(bool skipHtmlFrame, int? count = null) where T : ProtocollEntryBase
|
||||||
=> GetDataObjectOf(GetOfType<T>(count).Cast<IProtocollEntry>(), skipHtmlFrame);
|
=> GetDataObjectOf(GetOfType<T>(count).Cast<ProtocollEntryBase>(), skipHtmlFrame);
|
||||||
|
|
||||||
internal DataObject GetAllAsDataObject(bool skipHtmlFrame)
|
internal DataObject GetAllAsDataObject(bool skipHtmlFrame)
|
||||||
=> GetDataObjectOf(_protocollEntries, skipHtmlFrame);
|
=> GetDataObjectOf(_protocollEntries, skipHtmlFrame);
|
||||||
|
|
||||||
private DataObject GetDataObjectOf(IEnumerable<IProtocollEntry> entries, bool skipHtmlFrame, int? count = null)
|
private DataObject GetDataObjectOf(IEnumerable<ProtocollEntryBase> entries, bool skipHtmlFrame, int? count = null)
|
||||||
{
|
{
|
||||||
DataObject dataObject = new DataObject();
|
DataObject dataObject = new DataObject();
|
||||||
|
|
||||||
@@ -67,16 +68,16 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
if (count.HasValue)
|
if (count.HasValue)
|
||||||
entries = entries.Reverse().Take(count.Value).Reverse();
|
entries = entries.Reverse().Take(count.Value).Reverse();
|
||||||
|
|
||||||
foreach (IProtocollEntry entry in entries)
|
foreach (ProtocollEntryBase entry in entries)
|
||||||
{
|
{
|
||||||
string entryAscii = entry.GetAscii();
|
string entryAscii = entry.AsciiContent;
|
||||||
if (!string.IsNullOrEmpty(entryAscii))
|
if (!string.IsNullOrEmpty(entryAscii))
|
||||||
{
|
{
|
||||||
ascii += entryAscii;
|
ascii += entryAscii;
|
||||||
ascii += asciiSeparator;
|
ascii += asciiSeparator;
|
||||||
}
|
}
|
||||||
|
|
||||||
string entryHtml = entry.GetHtml();
|
string entryHtml = entry.HtmlContent;
|
||||||
if (!string.IsNullOrEmpty(entryHtml))
|
if (!string.IsNullOrEmpty(entryHtml))
|
||||||
{
|
{
|
||||||
html += entryHtml;
|
html += entryHtml;
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|
||||||
{
|
|
||||||
internal interface IProtocollEntry
|
|
||||||
{
|
|
||||||
string GetAscii();
|
|
||||||
string GetHtml();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
using FasdDesktopUi.Basics.Models;
|
using FasdDesktopUi.Basics.Models;
|
||||||
@@ -11,17 +11,26 @@ using static FasdDesktopUi.Basics.UserControls.QuickActionStatusMonitor;
|
|||||||
|
|
||||||
namespace FasdDesktopUi.Basics.Services.ProtocollService
|
namespace FasdDesktopUi.Basics.Services.ProtocollService
|
||||||
{
|
{
|
||||||
internal class QuickActionProtocollEntry : IProtocollEntry
|
internal static class QuickActionProtocollEntryOutput
|
||||||
{
|
{
|
||||||
private readonly cFasdQuickAction _quickActionDefinition;
|
|
||||||
private readonly cQuickActionCopyData _quickActionCopyData;
|
|
||||||
|
|
||||||
const string AsciiSeperator = "\n\n";
|
const string AsciiSeperator = "\n\n";
|
||||||
|
|
||||||
public QuickActionProtocollEntry(cFasdQuickAction quickActionDefinition, cQuickActionCopyData quickActionCopyData)
|
public static QuickActionProtocollEntry GetQuickActionProtocollEntry(cFasdQuickAction quickActionDefinition, cQuickActionCopyData quickActionCopyData)
|
||||||
{
|
{
|
||||||
_quickActionDefinition = quickActionDefinition;
|
string ascii = GetAscii(quickActionDefinition, quickActionCopyData);
|
||||||
_quickActionCopyData = quickActionCopyData;
|
string html = GetHtml(quickActionDefinition, quickActionCopyData);
|
||||||
|
|
||||||
|
return new QuickActionProtocollEntry(ascii, html)
|
||||||
|
{
|
||||||
|
Id = quickActionDefinition.Id,
|
||||||
|
Name = quickActionDefinition.Name,
|
||||||
|
ExecutionTypeId = (int)quickActionDefinition.ExecutionType,
|
||||||
|
WasRunningOnAffectedDevice = quickActionCopyData.WasRunningOnAffectedDevice,
|
||||||
|
AffectedDeviceName = quickActionCopyData.AffectedDeviceName,
|
||||||
|
ResultCode = (int?)quickActionCopyData.QuickActionOutput?.ResultCode,
|
||||||
|
ErrorMessage = quickActionCopyData.QuickActionOutput?.ErrorDescription,
|
||||||
|
MeasureValues = GetQuickActionHtmlValueComparison(quickActionCopyData.MeasureValues)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static cQuickActionCopyData GetCopyData(cFasdQuickAction quickActionDefinition, cSupportCaseDataProvider dataProvider, bool wasRunningOnAffectedDevice, cQuickActionOutput quickActionOutput, List<cQuickActionMeasureValue> measureValues)
|
internal static cQuickActionCopyData GetCopyData(cFasdQuickAction quickActionDefinition, cSupportCaseDataProvider dataProvider, bool wasRunningOnAffectedDevice, cQuickActionOutput quickActionOutput, List<cQuickActionMeasureValue> measureValues)
|
||||||
@@ -51,38 +60,21 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return quickActionCopyData;
|
return quickActionCopyData;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal cQuickActionResult GetResult()
|
private static string GetAscii(cFasdQuickAction quickActionDefinition, cQuickActionCopyData quickActionCopyData) => GetQuickActionAscii(quickActionDefinition, quickActionCopyData);
|
||||||
{
|
|
||||||
return new cQuickActionResult()
|
|
||||||
{
|
|
||||||
QuickActionId = _quickActionDefinition.Id,
|
|
||||||
QuickActionName = _quickActionDefinition.Name,
|
|
||||||
QuickActionExecutionType = (int)_quickActionDefinition.ExecutionType,
|
|
||||||
wasRunningOnAffectedDevice = _quickActionCopyData.WasRunningOnAffectedDevice,
|
|
||||||
AffectedDeviceName = _quickActionCopyData.AffectedDeviceName,
|
|
||||||
ExecutionTime = DateTime.UtcNow,
|
|
||||||
ResultCode = (int?)(_quickActionCopyData.QuickActionOutput?.ResultCode),
|
|
||||||
ErrorMessage = _quickActionCopyData.QuickActionOutput?.ErrorDescription,
|
|
||||||
Output = GetQuickActionHtmlOutput(_quickActionCopyData.QuickActionOutput),
|
|
||||||
MeasureValues = GetQuickActionHtmlValueComparison(_quickActionCopyData.MeasureValues)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetAscii() => GetQuickActionAscii(_quickActionCopyData);
|
private static string GetHtml(cFasdQuickAction quickActionDefinition, cQuickActionCopyData quickActionCopyData) => GetQuickActionHtml(quickActionDefinition, quickActionCopyData);
|
||||||
|
|
||||||
public string GetHtml() => GetQuickActionHtml(_quickActionCopyData);
|
private static bool ShouldHideQuickActionOutput(cFasdQuickAction quickActionDefinition, string outputValueKey)
|
||||||
|
|
||||||
private bool ShouldHideQuickActionOutput(string outputValueKey)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_quickActionDefinition.ColumnOutputFormattings is null)
|
if (quickActionDefinition.ColumnOutputFormattings is null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!_quickActionDefinition.ShowAllOutputContent && !_quickActionDefinition.ColumnOutputFormattings.ContainsKey(outputValueKey))
|
if (!quickActionDefinition.ShowAllOutputContent && !quickActionDefinition.ColumnOutputFormattings.ContainsKey(outputValueKey))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (_quickActionDefinition.ColumnOutputFormattings.TryGetValue(outputValueKey, out var columnFormatting))
|
if (quickActionDefinition.ColumnOutputFormattings.TryGetValue(outputValueKey, out var columnFormatting))
|
||||||
return columnFormatting.Hidden;
|
return columnFormatting.Hidden;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -95,19 +87,19 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
|
|
||||||
#region Ascii
|
#region Ascii
|
||||||
|
|
||||||
private string GetQuickActionAscii(cQuickActionCopyData copyData)
|
private static string GetQuickActionAscii(cFasdQuickAction quickActionDefinition, cQuickActionCopyData copyData)
|
||||||
{
|
{
|
||||||
string ascii = string.Empty;
|
string ascii = string.Empty;
|
||||||
|
|
||||||
ascii += GetQuickActionAsciiDescription(copyData.Name, copyData.AffectedDeviceName, copyData.WasRunningOnAffectedDevice, copyData.ExecutionTime, copyData.QuickActionOutput?.ResultCode);
|
ascii += GetQuickActionAsciiDescription(copyData.Name, copyData.AffectedDeviceName, copyData.WasRunningOnAffectedDevice, copyData.ExecutionTime, copyData.QuickActionOutput?.ResultCode);
|
||||||
ascii += GetQuickActionAsciiError(copyData.QuickActionOutput?.ErrorDescription);
|
ascii += GetQuickActionAsciiError(copyData.QuickActionOutput?.ErrorDescription);
|
||||||
ascii += GetQuickActionAsciiOutput(copyData.QuickActionOutput);
|
ascii += GetQuickActionAsciiOutput(quickActionDefinition, copyData.QuickActionOutput);
|
||||||
ascii += GetQuickActionAsciiValueComparisonString(copyData.MeasureValues);
|
ascii += GetQuickActionAsciiValueComparisonString(copyData.MeasureValues);
|
||||||
|
|
||||||
return ascii;
|
return ascii;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionAsciiDescription(string quickActionName, string deviceName, bool wasRunningOnAffectedDevice, DateTime executionTime, enumQuickActionSuccess? quickActionStatus)
|
private static string GetQuickActionAsciiDescription(string quickActionName, string deviceName, bool wasRunningOnAffectedDevice, DateTime executionTime, enumQuickActionSuccess? quickActionStatus)
|
||||||
{
|
{
|
||||||
string asciiDescription = string.Empty;
|
string asciiDescription = string.Empty;
|
||||||
try
|
try
|
||||||
@@ -136,7 +128,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return asciiDescription;
|
return asciiDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionAsciiError(string errorMessage)
|
private static string GetQuickActionAsciiError(string errorMessage)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(errorMessage))
|
if (!string.IsNullOrEmpty(errorMessage))
|
||||||
errorMessage.Insert(0, AsciiSeperator);
|
errorMessage.Insert(0, AsciiSeperator);
|
||||||
@@ -144,7 +136,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionAsciiOutput(QuickActionStatusMonitor.cQuickActionOutput quickActionOutput)
|
private static string GetQuickActionAsciiOutput(cFasdQuickAction quickActionDefinition, QuickActionStatusMonitor.cQuickActionOutput quickActionOutput)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
|
|
||||||
@@ -162,7 +154,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
|
|
||||||
output += AsciiSeperator;
|
output += AsciiSeperator;
|
||||||
output += cMultiLanguageSupport.GetItem("QuickAction.Copy.Output") + " ";
|
output += cMultiLanguageSupport.GetItem("QuickAction.Copy.Output") + " ";
|
||||||
output += singleOutput.GetDisplayValue(_quickActionDefinition.ColumnOutputFormattings);
|
output += singleOutput.GetDisplayValue(quickActionDefinition.ColumnOutputFormattings);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -174,10 +166,10 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
|
|
||||||
foreach (var value in listOutput.Values[0])
|
foreach (var value in listOutput.Values[0])
|
||||||
{
|
{
|
||||||
if (ShouldHideQuickActionOutput(value.Key))
|
if (ShouldHideQuickActionOutput(quickActionDefinition, value.Key))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (_quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
if (quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
||||||
output += outputFormatting.Names.GetValue();
|
output += outputFormatting.Names.GetValue();
|
||||||
else
|
else
|
||||||
output += value.Key;
|
output += value.Key;
|
||||||
@@ -193,10 +185,10 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
{
|
{
|
||||||
string valueKey = listOutput.Values[0][j].Key;
|
string valueKey = listOutput.Values[0][j].Key;
|
||||||
|
|
||||||
if (ShouldHideQuickActionOutput(valueKey))
|
if (ShouldHideQuickActionOutput(quickActionDefinition, valueKey))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string displayValue = listOutput.GetDisplayValue(i, j, _quickActionDefinition.ColumnOutputFormattings);
|
string displayValue = listOutput.GetDisplayValue(i, j, quickActionDefinition.ColumnOutputFormattings);
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(displayValue))
|
if (string.IsNullOrWhiteSpace(displayValue))
|
||||||
continue;
|
continue;
|
||||||
@@ -217,12 +209,12 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
{
|
{
|
||||||
var value = objectOutput.Values[i];
|
var value = objectOutput.Values[i];
|
||||||
|
|
||||||
if (ShouldHideQuickActionOutput(value.Key))
|
if (ShouldHideQuickActionOutput(quickActionDefinition, value.Key))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string columnTitle = string.Empty;
|
string columnTitle = string.Empty;
|
||||||
|
|
||||||
if (_quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
if (quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
||||||
columnTitle = outputFormatting.Names.GetValue();
|
columnTitle = outputFormatting.Names.GetValue();
|
||||||
else
|
else
|
||||||
columnTitle = value.Key;
|
columnTitle = value.Key;
|
||||||
@@ -230,7 +222,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
if (!string.IsNullOrEmpty(columnTitle))
|
if (!string.IsNullOrEmpty(columnTitle))
|
||||||
output += $"{columnTitle}: ";
|
output += $"{columnTitle}: ";
|
||||||
|
|
||||||
string displayValue = objectOutput.GetDisplayValue(i, _quickActionDefinition.ColumnOutputFormattings);
|
string displayValue = objectOutput.GetDisplayValue(i, quickActionDefinition.ColumnOutputFormattings);
|
||||||
output += !string.IsNullOrWhiteSpace(displayValue) ? displayValue : null;
|
output += !string.IsNullOrWhiteSpace(displayValue) ? displayValue : null;
|
||||||
|
|
||||||
output += "\n";
|
output += "\n";
|
||||||
@@ -248,7 +240,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionAsciiValueComparisonString(List<QuickActionStatusMonitor.cQuickActionMeasureValue> measureValues)
|
private static string GetQuickActionAsciiValueComparisonString(List<QuickActionStatusMonitor.cQuickActionMeasureValue> measureValues)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
|
|
||||||
@@ -260,6 +252,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
output += AsciiSeperator + cMultiLanguageSupport.GetItem("QuickAction.Copy.Measure");
|
output += AsciiSeperator + cMultiLanguageSupport.GetItem("QuickAction.Copy.Measure");
|
||||||
|
|
||||||
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
cUtility.RawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
foreach (var measureValue in measureValues)
|
foreach (var measureValue in measureValues)
|
||||||
{
|
{
|
||||||
@@ -292,7 +285,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
|
|
||||||
#region Html
|
#region Html
|
||||||
|
|
||||||
private string GetQuickActionHtml(cQuickActionCopyData copyData)
|
private static string GetQuickActionHtml(cFasdQuickAction quickActionDefinition, cQuickActionCopyData copyData)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
|
|
||||||
@@ -300,7 +293,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
{
|
{
|
||||||
output += GetQuickActionHtmlDescription(copyData.Name, copyData.AffectedDeviceName, copyData.WasRunningOnAffectedDevice, copyData.ExecutionTime, copyData.QuickActionOutput?.ResultCode);
|
output += GetQuickActionHtmlDescription(copyData.Name, copyData.AffectedDeviceName, copyData.WasRunningOnAffectedDevice, copyData.ExecutionTime, copyData.QuickActionOutput?.ResultCode);
|
||||||
output += GetQuickActionHtmlError(copyData.QuickActionOutput?.ErrorDescription);
|
output += GetQuickActionHtmlError(copyData.QuickActionOutput?.ErrorDescription);
|
||||||
output += GetQuickActionHtmlOutput(copyData.QuickActionOutput);
|
output += GetQuickActionHtmlOutput(quickActionDefinition, copyData.QuickActionOutput);
|
||||||
output += GetQuickActionHtmlValueComparison(copyData.MeasureValues);
|
output += GetQuickActionHtmlValueComparison(copyData.MeasureValues);
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -311,7 +304,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionHtmlDescription(string quickActionName, string deviceName, bool wasRunningOnAffectedDevice, DateTime executionTime, enumQuickActionSuccess? quickActionStatus)
|
private static string GetQuickActionHtmlDescription(string quickActionName, string deviceName, bool wasRunningOnAffectedDevice, DateTime executionTime, enumQuickActionSuccess? quickActionStatus)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
try
|
try
|
||||||
@@ -348,7 +341,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionHtmlOutput(QuickActionStatusMonitor.cQuickActionOutput quickActionOutput)
|
private static string GetQuickActionHtmlOutput(cFasdQuickAction quickActionDefinition, QuickActionStatusMonitor.cQuickActionOutput quickActionOutput)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
|
|
||||||
@@ -366,7 +359,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
if (singleOutput.Value is null)
|
if (singleOutput.Value is null)
|
||||||
return output;
|
return output;
|
||||||
|
|
||||||
var displayValue = singleOutput.GetDisplayValue(_quickActionDefinition?.ColumnOutputFormattings);
|
var displayValue = singleOutput.GetDisplayValue(quickActionDefinition?.ColumnOutputFormattings);
|
||||||
output += "<p>" + cMultiLanguageSupport.GetItem("QuickAction.Copy.Output.Html") + " " + displayValue + "</p>";
|
output += "<p>" + cMultiLanguageSupport.GetItem("QuickAction.Copy.Output.Html") + " " + displayValue + "</p>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -379,11 +372,11 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
|
|
||||||
foreach (var value in listOutput.Values[0])
|
foreach (var value in listOutput.Values[0])
|
||||||
{
|
{
|
||||||
if (ShouldHideQuickActionOutput(value.Key))
|
if (ShouldHideQuickActionOutput(quickActionDefinition, value.Key))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string headingValue = value.Key;
|
string headingValue = value.Key;
|
||||||
if (_quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
if (quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
||||||
headingValue = outputFormatting.Names.GetValue();
|
headingValue = outputFormatting.Names.GetValue();
|
||||||
|
|
||||||
output += "<th align=\"left\">";
|
output += "<th align=\"left\">";
|
||||||
@@ -400,10 +393,10 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
for (int j = 0; j < listOutput.Values[i].Count; j++)
|
for (int j = 0; j < listOutput.Values[i].Count; j++)
|
||||||
{
|
{
|
||||||
string valueKey = listOutput.Values[0][j].Key;
|
string valueKey = listOutput.Values[0][j].Key;
|
||||||
if (ShouldHideQuickActionOutput(valueKey))
|
if (ShouldHideQuickActionOutput(quickActionDefinition, valueKey))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string displayValue = listOutput.GetDisplayValue(i, j, _quickActionDefinition.ColumnOutputFormattings);
|
string displayValue = listOutput.GetDisplayValue(i, j, quickActionDefinition.ColumnOutputFormattings);
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(displayValue))
|
if (string.IsNullOrWhiteSpace(displayValue))
|
||||||
continue;
|
continue;
|
||||||
@@ -429,11 +422,11 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
{
|
{
|
||||||
var value = objectOutput.Values[i];
|
var value = objectOutput.Values[i];
|
||||||
|
|
||||||
if (ShouldHideQuickActionOutput(value.Key))
|
if (ShouldHideQuickActionOutput(quickActionDefinition, value.Key))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string headingValue = value.Key;
|
string headingValue = value.Key;
|
||||||
if (_quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
if (quickActionDefinition.ColumnOutputFormattings?.TryGetValue(value.Key, out var outputFormatting) ?? false)
|
||||||
headingValue = outputFormatting.Names.GetValue();
|
headingValue = outputFormatting.Names.GetValue();
|
||||||
|
|
||||||
output += "<tr>";
|
output += "<tr>";
|
||||||
@@ -442,7 +435,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
output += "</td>";
|
output += "</td>";
|
||||||
|
|
||||||
output += "<td>";
|
output += "<td>";
|
||||||
string displayValue = objectOutput.GetDisplayValue(i, _quickActionDefinition.ColumnOutputFormattings);
|
string displayValue = objectOutput.GetDisplayValue(i, quickActionDefinition.ColumnOutputFormattings);
|
||||||
output += !string.IsNullOrWhiteSpace(displayValue) ? displayValue : null;
|
output += !string.IsNullOrWhiteSpace(displayValue) ? displayValue : null;
|
||||||
output += "</td>";
|
output += "</td>";
|
||||||
|
|
||||||
@@ -462,7 +455,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQuickActionHtmlValueComparison(List<QuickActionStatusMonitor.cQuickActionMeasureValue> measureValues)
|
private static string GetQuickActionHtmlValueComparison(List<QuickActionStatusMonitor.cQuickActionMeasureValue> measureValues)
|
||||||
{
|
{
|
||||||
string output = string.Empty;
|
string output = string.Empty;
|
||||||
|
|
||||||
@@ -474,6 +467,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
output += "<p>" + cMultiLanguageSupport.GetItem("QuickAction.Copy.Measure.Html") + "</p>";
|
output += "<p>" + cMultiLanguageSupport.GetItem("QuickAction.Copy.Measure.Html") + "</p>";
|
||||||
|
|
||||||
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
cUtility.RawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
foreach (var measureValue in measureValues)
|
foreach (var measureValue in measureValues)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,27 +1,30 @@
|
|||||||
using C4IT.FASD.Base;
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
|
using C4IT.FASD.Base;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Basics.Services.ProtocollService
|
namespace FasdDesktopUi.Basics.Services.ProtocollService
|
||||||
{
|
{
|
||||||
internal class QuickTipStepProtocollEntry : IProtocollEntry
|
internal static class QuickTipStepProtocollEntryOutput
|
||||||
{
|
{
|
||||||
private readonly cQuickTipElement _quickTipElementDefinition;
|
public static QuickTipStepProtocollEntry GetQuickTipStepProtocollEntry(cQuickTipElement quickTipElementDefinition, bool wasSuccessfull)
|
||||||
private readonly bool _wasSuccessfull;
|
|
||||||
|
|
||||||
public QuickTipStepProtocollEntry(cQuickTipElement quickTipElementDefinition, bool wasSuccessfull)
|
|
||||||
{
|
{
|
||||||
_quickTipElementDefinition = quickTipElementDefinition;
|
string ascii = GetAsciiOutput(quickTipElementDefinition, wasSuccessfull);
|
||||||
_wasSuccessfull = wasSuccessfull;
|
string html = GetHtmlOutput(quickTipElementDefinition, wasSuccessfull);
|
||||||
|
return new QuickTipStepProtocollEntry(ascii, html)
|
||||||
|
{
|
||||||
|
Name = quickTipElementDefinition.Name,
|
||||||
|
WasSuccessfull = wasSuccessfull
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetAscii()
|
private static string GetAsciiOutput(cQuickTipElement quickTipElementDefinition, bool wasSuccessfull)
|
||||||
{
|
{
|
||||||
string currentLanguage = cMultiLanguageSupport.CurrentLanguage;
|
string currentLanguage = cMultiLanguageSupport.CurrentLanguage;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cMultiLanguageSupport.CurrentLanguage = cF4SDCockpitXmlConfig.Instance.HealthCardConfig.ProtocollLanguage ?? currentLanguage;
|
cMultiLanguageSupport.CurrentLanguage = cF4SDCockpitXmlConfig.Instance.HealthCardConfig.ProtocollLanguage ?? currentLanguage;
|
||||||
string ascii = _wasSuccessfull ? cMultiLanguageSupport.GetItem("QuickTips.Copy.ManualStep.Successfull") : cMultiLanguageSupport.GetItem("QuickTips.Copy.ManualStep.Unsuccessfull");
|
string ascii = wasSuccessfull ? cMultiLanguageSupport.GetItem("QuickTips.Copy.ManualStep.Successfull") : cMultiLanguageSupport.GetItem("QuickTips.Copy.ManualStep.Unsuccessfull");
|
||||||
return string.Format(ascii, _quickTipElementDefinition?.Names?.GetValue());
|
return string.Format(ascii, quickTipElementDefinition?.Names?.GetValue());
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -29,7 +32,7 @@ namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetHtml()
|
private static string GetHtmlOutput(cQuickTipElement quickTipElementDefinition, bool wasSuccessfull)
|
||||||
=> GetAscii();
|
=> GetAsciiOutput(quickTipElementDefinition, wasSuccessfull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
namespace FasdDesktopUi.Basics.Services.ProtocollService
|
|
||||||
{
|
|
||||||
internal class TextualProtocollEntry : IProtocollEntry
|
|
||||||
{
|
|
||||||
private readonly string _asciiText;
|
|
||||||
private readonly string _htmlText;
|
|
||||||
|
|
||||||
public TextualProtocollEntry(string asciiText, string htmlText)
|
|
||||||
{
|
|
||||||
_asciiText = asciiText;
|
|
||||||
_htmlText = htmlText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetAscii() => _asciiText;
|
|
||||||
|
|
||||||
public string GetHtml() => _htmlText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,10 +4,8 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("F4SD.Cockpit.Client.Test")]
|
[assembly: InternalsVisibleTo("F4SD.Cockpit.Client.Test")]
|
||||||
@@ -29,7 +27,7 @@ namespace FasdDesktopUi.Basics.Services.RelationService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_relations = new List<cF4sdApiSearchResultRelation>();
|
_relations = relatedTo?.Select(searchResult => new cF4sdApiSearchResultRelation(searchResult)).ToList() ?? new List<cF4sdApiSearchResultRelation>();
|
||||||
cF4sdStagedSearchResultRelationTaskId gatherRelationTask = await cFasdCockpitCommunicationBase.Instance.StartGatheringRelations(relatedTo, token);
|
cF4sdStagedSearchResultRelationTaskId gatherRelationTask = await cFasdCockpitCommunicationBase.Instance.StartGatheringRelations(relatedTo, token);
|
||||||
|
|
||||||
_ = Task.Run(async () =>
|
_ = Task.Run(async () =>
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
using C4IT.FASD.Base;
|
||||||
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
|
using FasdDesktopUi.Basics.CustomEvents;
|
||||||
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using FasdDesktopUi.Pages.DetailsPage.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.Services.SupportCase.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Used to manage the <see cref="ISupportCase"/> for the UI via the <see cref="SupportCaseProcessor"/>"
|
||||||
|
/// </summary>
|
||||||
|
public class SupportCaseController
|
||||||
|
{
|
||||||
|
private SupportCaseProcessor _supportCaseProcessor;
|
||||||
|
private cF4sdApiSearchResultRelation _focusedRelation;
|
||||||
|
private readonly Dictionary<enumFasdInformationClass, cF4sdApiSearchResultRelation> _selectedRelations = new Dictionary<enumFasdInformationClass, cF4sdApiSearchResultRelation>();
|
||||||
|
private cHealthCard _selectedHealthcard = null;
|
||||||
|
private bool _hasDirectionConnection = false;
|
||||||
|
public cSupportCaseDataProvider SupportCaseDataProviderArtifact { get => _supportCaseProcessor?.SupportCaseDataProviderArtifact; }
|
||||||
|
|
||||||
|
internal void SetSupportCaseProcessor(SupportCaseProcessor supportCaseProcessor, IEnumerable<cF4sdIdentityEntry> preselectedIdentities)
|
||||||
|
{
|
||||||
|
IEnumerable<cF4sdApiSearchResultRelation> preselectedRelations = GetPreselectedRelations(supportCaseProcessor.GetCaseRelations(), preselectedIdentities);
|
||||||
|
|
||||||
|
ResetSelectedRelations(preselectedRelations);
|
||||||
|
_hasDirectionConnection = false;
|
||||||
|
|
||||||
|
if (_supportCaseProcessor != null)
|
||||||
|
{
|
||||||
|
_supportCaseProcessor.AvailableCaseRelationsAdded -= HandleAvailableCaseRelationsAdded;
|
||||||
|
_supportCaseProcessor.CaseDataChanged -= HandleCaseDataChanged;
|
||||||
|
_supportCaseProcessor.SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionChanged -= HandleDirectConnectionChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
_supportCaseProcessor = supportCaseProcessor;
|
||||||
|
|
||||||
|
_supportCaseProcessor.AvailableCaseRelationsAdded += HandleAvailableCaseRelationsAdded;
|
||||||
|
_supportCaseProcessor.CaseDataChanged += HandleCaseDataChanged;
|
||||||
|
_supportCaseProcessor.SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionChanged += HandleDirectConnectionChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<cF4sdApiSearchResultRelation> GetPreselectedRelations
|
||||||
|
(ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> loadedRelations, IEnumerable<cF4sdIdentityEntry> preselectedIdentities)
|
||||||
|
{
|
||||||
|
List<cF4sdApiSearchResultRelation> preselectedRelations = new List<cF4sdApiSearchResultRelation>();
|
||||||
|
|
||||||
|
foreach (var relationType in loadedRelations)
|
||||||
|
{
|
||||||
|
foreach (var relation in relationType)
|
||||||
|
{
|
||||||
|
if (relation.Identities.All(ri => preselectedIdentities.Any(i => i.Id == ri.Id)))
|
||||||
|
preselectedRelations.Add(relation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return preselectedRelations;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetSelectedRelations(IEnumerable<cF4sdApiSearchResultRelation> preselectedRelations)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_selectedRelations.Clear();
|
||||||
|
|
||||||
|
if (preselectedRelations is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var relation in preselectedRelations)
|
||||||
|
{
|
||||||
|
_selectedRelations[cF4sdIdentityEntry.GetFromSearchResult(relation.Type)] = relation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleAvailableCaseRelationsAdded(object sender, RelationEventArgs e)
|
||||||
|
=> AvailableCaseRelationsAdded?.Invoke(this, e);
|
||||||
|
|
||||||
|
private void HandleCaseDataChanged(object sender, SupportCaseDataEventArgs e)
|
||||||
|
{
|
||||||
|
CaseDataChanged?.Invoke(this, e);
|
||||||
|
|
||||||
|
_ = Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await UpdateStatusOfSelectedRelations();
|
||||||
|
|
||||||
|
if (!_hasDirectionConnection)
|
||||||
|
await SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionStartAsync();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleDirectConnectionChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_hasDirectionConnection = SupportCaseDataProviderArtifact.DirectConnectionHelper.IsDirectConnectionActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the currently for a support case relevant and shown relation.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Raises <see cref="FocusedRelationsChanged"/></remarks>
|
||||||
|
internal void UpdateFocusedCaseRelation(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_selectedHealthcard = _supportCaseProcessor.GetHealthcardFor(relation);
|
||||||
|
HashSet<string> requiredTables = cHealthCard.GetRequiredTables(_selectedHealthcard);
|
||||||
|
_ = Task.Run(async () => await _supportCaseProcessor.LoadSupportCaseDataAsync(relation, requiredTables));
|
||||||
|
|
||||||
|
List<enumFasdInformationClass> requiredInformationClasses = relation.Identities
|
||||||
|
.Where(i => i.Class != enumFasdInformationClass.User)
|
||||||
|
.Select(i => i.Class)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (relation.Type == enumF4sdSearchResultClass.User)
|
||||||
|
requiredInformationClasses = new List<enumFasdInformationClass>() { enumFasdInformationClass.User };
|
||||||
|
|
||||||
|
if (requiredInformationClasses.Count == 0)
|
||||||
|
requiredInformationClasses.Add(enumFasdInformationClass.User);
|
||||||
|
|
||||||
|
SupportCaseDataProviderArtifact.HealthCardDataHelper.TrySetSelectedHealthcard(requiredInformationClasses);
|
||||||
|
|
||||||
|
_focusedRelation = relation;
|
||||||
|
|
||||||
|
if (!_selectedRelations.Values.Contains(relation))
|
||||||
|
_hasDirectionConnection = false;
|
||||||
|
|
||||||
|
_selectedRelations[cF4sdIdentityEntry.GetFromSearchResult(relation.Type)] = relation;
|
||||||
|
_ = Task.Run(async () => await UpdateStatusOfSelectedRelations());
|
||||||
|
|
||||||
|
var focusedRelations = new cF4sdApiSearchResultRelation[1] { _focusedRelation };
|
||||||
|
FocusedRelationsChanged?.Invoke(this, new RelationEventArgs()
|
||||||
|
{
|
||||||
|
Relations = focusedRelations.ToLookup(r => cF4sdIdentityEntry.GetFromSearchResult(r.Type), r => r)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateStatusOfSelectedRelations()
|
||||||
|
{
|
||||||
|
const string StatusString = "Status";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int? agentUserId = null;
|
||||||
|
int? agentDeviceId = null;
|
||||||
|
|
||||||
|
// todo these values should not be recieved from the NamedParameters, instead from the relation it self
|
||||||
|
if (SupportCaseDataProviderArtifact.NamedParameterEntries.TryGetValue("AgentUserId", out var userNamedParameter))
|
||||||
|
{
|
||||||
|
var value = userNamedParameter.GetValue();
|
||||||
|
if (!string.IsNullOrWhiteSpace(value))
|
||||||
|
agentUserId = int.Parse(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// todo these values should not be recieved from the NamedParameters, instead from the relation it self
|
||||||
|
if (SupportCaseDataProviderArtifact.NamedParameterEntries.TryGetValue("AgentDeviceId", out var deviceNamedParameter))
|
||||||
|
{
|
||||||
|
var value = deviceNamedParameter.GetValue();
|
||||||
|
if (!string.IsNullOrWhiteSpace(value))
|
||||||
|
agentDeviceId = int.Parse(deviceNamedParameter.GetValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var relationEntry in _selectedRelations)
|
||||||
|
{
|
||||||
|
if (relationEntry.Value is null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string statusValue = "Unknown";
|
||||||
|
|
||||||
|
switch (relationEntry.Key)
|
||||||
|
{
|
||||||
|
case enumFasdInformationClass.Computer:
|
||||||
|
if (!agentDeviceId.HasValue)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
bool isDeviceOnline = await cFasdCockpitCommunicationBase.Instance.GetAgentOnlineStatus(agentDeviceId.Value);
|
||||||
|
statusValue = isDeviceOnline ? "Online" : "Offline";
|
||||||
|
break;
|
||||||
|
case enumFasdInformationClass.User:
|
||||||
|
if (!agentDeviceId.HasValue || !agentUserId.HasValue)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
bool isUserOnline = await cFasdCockpitCommunicationBase.Instance.GetAgentOnlineStatus(agentDeviceId.Value, agentUserId.Value);
|
||||||
|
statusValue = isUserOnline ? "Online" : "Offline";
|
||||||
|
break;
|
||||||
|
case enumFasdInformationClass.Ticket:
|
||||||
|
case enumFasdInformationClass.VirtualSession:
|
||||||
|
case enumFasdInformationClass.MobileDevice:
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (relationEntry.Value.Infos is null)
|
||||||
|
relationEntry.Value.Infos = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
relationEntry.Value.Infos[StatusString] = statusValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<cHeadingDataModel> newHeadingData = SupportCaseHeadingController.GetHeadingData(_selectedRelations);
|
||||||
|
HeadingDataChanged?.Invoke(this, new HeadingDataEventArgs(newHeadingData));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task RefreshDataForCurrentlyFocusedRelationAsync()
|
||||||
|
{
|
||||||
|
await _supportCaseProcessor.UpdateLatestCaseDataFor(_focusedRelation);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<cWidgetValueModel>> GetWidgetData()
|
||||||
|
=> _supportCaseProcessor.GetWidgetData(_focusedRelation);
|
||||||
|
|
||||||
|
public cDetailsPageDataHistoryDataModel GetHistoryData()
|
||||||
|
=> _supportCaseProcessor.GetHistoryData(_focusedRelation);
|
||||||
|
|
||||||
|
public List<cContainerCollectionData> GetContainerData()
|
||||||
|
=> _supportCaseProcessor.GetContainerData(_focusedRelation);
|
||||||
|
|
||||||
|
public List<cMenuDataBase> GetMenuBarData()
|
||||||
|
=> _supportCaseProcessor.GetMenuBarData(_focusedRelation);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when the currently for a support case relevant and shown relations have been updated.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<RelationEventArgs> FocusedRelationsChanged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when newly available relations for a support case were added.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<RelationEventArgs> AvailableCaseRelationsAdded;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when the data set of a support case has changed.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<SupportCaseDataEventArgs> CaseDataChanged;
|
||||||
|
|
||||||
|
public event EventHandler<HeadingDataEventArgs> HeadingDataChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
using C4IT.FASD.Base;
|
||||||
|
using C4IT.MultiLanguage;
|
||||||
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.Services.SupportCase.Controllers
|
||||||
|
{
|
||||||
|
internal class SupportCaseHeadingController
|
||||||
|
{
|
||||||
|
internal static IEnumerable<cHeadingDataModel> GetHeadingData(Dictionary<enumFasdInformationClass, cF4sdApiSearchResultRelation> relations)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Enum.GetValues(typeof(enumFasdInformationClass))
|
||||||
|
.Cast<enumFasdInformationClass>()
|
||||||
|
.Select(informationClass =>
|
||||||
|
{
|
||||||
|
if (relations.TryGetValue(informationClass, out var relation) && relation != null)
|
||||||
|
return GetHeadingDataFor(relation);
|
||||||
|
else
|
||||||
|
return GetEmptyHeadingDataFor(informationClass);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Enumerable.Empty<cHeadingDataModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static cHeadingDataModel GetEmptyHeadingDataFor(enumFasdInformationClass informationClass)
|
||||||
|
{
|
||||||
|
string headingText = string.Empty;
|
||||||
|
|
||||||
|
switch (informationClass)
|
||||||
|
{
|
||||||
|
case enumFasdInformationClass.Computer:
|
||||||
|
headingText = cMultiLanguageSupport.GetItem("Header.Select.Computer");
|
||||||
|
break;
|
||||||
|
case enumFasdInformationClass.Ticket:
|
||||||
|
headingText = cMultiLanguageSupport.GetItem("Header.Select.Ticket");
|
||||||
|
break;
|
||||||
|
case enumFasdInformationClass.VirtualSession:
|
||||||
|
headingText = cMultiLanguageSupport.GetItem("Header.Select.VirtualSession");
|
||||||
|
break;
|
||||||
|
case enumFasdInformationClass.MobileDevice:
|
||||||
|
headingText = cMultiLanguageSupport.GetItem("Header.Select.MobileDevice");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new cHeadingDataModel() { InformationClass = informationClass, HeadingText = headingText };
|
||||||
|
}
|
||||||
|
|
||||||
|
private static cHeadingDataModel GetHeadingDataFor(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
const string StatusString = "Status";
|
||||||
|
bool isOnline = false;
|
||||||
|
|
||||||
|
string statusValue = "Unknown";
|
||||||
|
if (relation?.Infos?.TryGetValue(StatusString, out var statusValueFromDictionary) ?? false)
|
||||||
|
statusValue = statusValueFromDictionary;
|
||||||
|
|
||||||
|
switch (relation.Type)
|
||||||
|
{
|
||||||
|
case enumF4sdSearchResultClass.Computer:
|
||||||
|
case enumF4sdSearchResultClass.User:
|
||||||
|
isOnline = string.Equals(statusValue, "Online", StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
break;
|
||||||
|
case enumF4sdSearchResultClass.Ticket:
|
||||||
|
isOnline = !string.Equals(statusValue, nameof(enumTicketStatus.Closed));
|
||||||
|
break;
|
||||||
|
case enumF4sdSearchResultClass.VirtualSession:
|
||||||
|
isOnline = string.Equals(statusValue, nameof(enumCitrixSessionStatus.Active));
|
||||||
|
break;
|
||||||
|
case enumF4sdSearchResultClass.MobileDevice:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new cHeadingDataModel()
|
||||||
|
{
|
||||||
|
HeadingText = string.IsNullOrEmpty(relation.Name) ? relation.DisplayName : relation.Name,
|
||||||
|
InformationClass = cF4sdIdentityEntry.GetFromSearchResult(relation.Type),
|
||||||
|
IsOnline = isOnline,
|
||||||
|
Identities = relation.Identities,
|
||||||
|
Realtion = relation
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using FasdDesktopUi.Basics.Services.RelationService;
|
using FasdDesktopUi.Basics.CustomEvents;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Basics.Services.SupportCase
|
namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||||
{
|
{
|
||||||
@@ -12,10 +13,13 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
|||||||
void Initialize();
|
void Initialize();
|
||||||
void AddCaseRelations(ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> relations);
|
void AddCaseRelations(ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> relations);
|
||||||
ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> GetCaseRelations();
|
ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> GetCaseRelations();
|
||||||
IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> GetSupportCaseHealthcardData(object identities, object valueAddress);
|
Task LoadSupportCaseDataAsync(cF4sdApiSearchResultRelation relation, IEnumerable<string> tablesToLoad);
|
||||||
void UpdateSupportCaseDataCache();
|
IEnumerable<object> GetSupportCaseHealthcardData(cF4sdApiSearchResultRelation relation, cValueAddress valueAddress);
|
||||||
|
void UpdateSupportCaseDataCache(cF4sdApiSearchResultRelation relation, IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> tables);
|
||||||
|
void InvalidateCaseDataCacheFor(cF4sdApiSearchResultRelation relation);
|
||||||
|
void InvalidateLatestCaseDataCacheFor(cF4sdApiSearchResultRelation relation, out ICollection<cF4SDHealthCardRawData.cHealthCardTable> invalidatedTables);
|
||||||
|
|
||||||
event EventHandler<RelationEventArgs> CaseRelationsAdded;
|
event EventHandler<RelationEventArgs> CaseRelationsAdded;
|
||||||
event EventHandler<object> SupportCaseDataCacheHasChanged;
|
event EventHandler<SupportCaseDataEventArgs> SupportCaseDataCacheHasChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
|
using FasdDesktopUi.Basics.CustomEvents;
|
||||||
using FasdDesktopUi.Basics.Services.RelationService;
|
using FasdDesktopUi.Basics.Services.RelationService;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
|||||||
public class SupportCase : ISupportCase
|
public class SupportCase : ISupportCase
|
||||||
{
|
{
|
||||||
private readonly Dictionary<enumFasdInformationClass, IList<cF4sdApiSearchResultRelation>> _caseRelations = new Dictionary<enumFasdInformationClass, IList<cF4sdApiSearchResultRelation>>();
|
private readonly Dictionary<enumFasdInformationClass, IList<cF4sdApiSearchResultRelation>> _caseRelations = new Dictionary<enumFasdInformationClass, IList<cF4sdApiSearchResultRelation>>();
|
||||||
//private readonly Lookup<IdentitySet, cF4SDHealthCardRawData.cHealthCardTable> _supportCaseDataCache;
|
private readonly Dictionary<string, Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData.cHealthCardTable>> _supportCaseDataCache = new Dictionary<string, Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData.cHealthCardTable>>();
|
||||||
|
|
||||||
internal readonly Guid Id;
|
internal readonly Guid Id;
|
||||||
private readonly IRelationService _relationService;
|
private readonly IRelationService _relationService;
|
||||||
@@ -67,12 +67,12 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
|||||||
foreach (var relationType in relations)
|
foreach (var relationType in relations)
|
||||||
{
|
{
|
||||||
if (_caseRelations.TryGetValue(relationType.Key, out var caseRelation))
|
if (_caseRelations.TryGetValue(relationType.Key, out var caseRelation))
|
||||||
caseRelation = caseRelation.Union(relationType, new SearchResultRelationEqualityComparer()).ToList();
|
caseRelation = caseRelation.Union(relationType).ToList();
|
||||||
else
|
else
|
||||||
_caseRelations.Add(relationType.Key, relationType.ToList());
|
_caseRelations.Add(relationType.Key, relationType.ToList());
|
||||||
|
|
||||||
if (SupportCaseDataProviderArtifact?.CaseRelations?.TryGetValue(relationType.Key, out var caseRelations) ?? false)
|
if (SupportCaseDataProviderArtifact?.CaseRelations?.TryGetValue(relationType.Key, out var caseRelations) ?? false)
|
||||||
caseRelations = caseRelations.Union(relationType, new SearchResultRelationEqualityComparer()).ToList();
|
caseRelations = caseRelations.Union(relationType).ToList();
|
||||||
else
|
else
|
||||||
SupportCaseDataProviderArtifact?.CaseRelations?.Add(relationType.Key, relationType.ToList());
|
SupportCaseDataProviderArtifact?.CaseRelations?.Add(relationType.Key, relationType.ToList());
|
||||||
}
|
}
|
||||||
@@ -85,14 +85,158 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSupportCaseDataCache()
|
public async Task LoadSupportCaseDataAsync(cF4sdApiSearchResultRelation relation, IEnumerable<string> tablesToLoad)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
try
|
||||||
|
{
|
||||||
|
cF4SDHealthCardRawData rawData = null;
|
||||||
|
|
||||||
|
// todo this is only a temporary fix. Currently the tablesToLoad contain also detail tables
|
||||||
|
// and tables won't be loaded e.g. the QuickActionHistory
|
||||||
|
bool isDataComplete = tablesToLoad.Any(t =>
|
||||||
|
_supportCaseDataCache.TryGetValue(t, out var cachedTables)
|
||||||
|
&& cachedTables.TryGetValue(relation, out var table)
|
||||||
|
&& !table.IsIncomplete && !table.Columns.Values.Any(c => c.IsIncomplete)
|
||||||
|
);
|
||||||
|
|
||||||
|
var rawDataRequest = new cF4sdHealthCardRawDataRequest()
|
||||||
|
{
|
||||||
|
Identities = relation.Identities,
|
||||||
|
Tables = tablesToLoad.ToList(),
|
||||||
|
MaxAge = cF4SDCockpitXmlConfig.Instance?.HealthCardConfig?.SearchResultAge ?? 14
|
||||||
|
};
|
||||||
|
|
||||||
|
while (!isDataComplete)
|
||||||
|
{
|
||||||
|
if (rawData is null)
|
||||||
|
{
|
||||||
|
rawData = await cFasdCockpitCommunicationBase.Instance.GetHealthCardData(rawDataRequest);
|
||||||
|
await SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.SetHealthCardRawData(rawData, rawDataRequest.Identities);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rawData = await cFasdCockpitCommunicationBase.Instance.GetHealthCardData(rawData.Id);
|
||||||
|
await SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.UpdateHealthcardRawData(rawData);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateSupportCaseDataCache(relation, rawData?.Tables?.Values);
|
||||||
|
|
||||||
|
isDataComplete = rawData?.Tables?
|
||||||
|
.Where(table => table.Key.StartsWith("Computation_") == false)
|
||||||
|
.All(table => !table.Value.IsIncomplete && !table.Value.Columns.Values.Any(c => c.IsIncomplete)) ?? false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> GetSupportCaseHealthcardData(object identities, object valueAddress)
|
public void UpdateSupportCaseDataCache(cF4sdApiSearchResultRelation relation, IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> tables)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
try
|
||||||
|
{
|
||||||
|
if (tables is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
List<cF4SDHealthCardRawData.cHealthCardTable> dataTables = tables?.ToList();
|
||||||
|
|
||||||
|
foreach (var table in dataTables)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(table.Name))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!_supportCaseDataCache.ContainsKey(table.Name))
|
||||||
|
_supportCaseDataCache.Add(table.Name, new Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData.cHealthCardTable>());
|
||||||
|
|
||||||
|
if (!_supportCaseDataCache[table.Name].ContainsKey(relation))
|
||||||
|
_supportCaseDataCache[table.Name][relation] = table;
|
||||||
|
else
|
||||||
|
MergeTable(_supportCaseDataCache[table.Name][relation], table);
|
||||||
|
}
|
||||||
|
|
||||||
|
SupportCaseDataCacheHasChanged?.Invoke(this, new SupportCaseDataEventArgs() { Relation = relation, DataTables = dataTables });
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MergeTable(cF4SDHealthCardRawData.cHealthCardTable existingTable, cF4SDHealthCardRawData.cHealthCardTable newTable)
|
||||||
|
{
|
||||||
|
foreach (var newColumn in newTable.Columns)
|
||||||
|
{
|
||||||
|
existingTable.Columns[newColumn.Key] = newColumn.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InvalidateCaseDataCacheFor(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var tableCache in _supportCaseDataCache.Values)
|
||||||
|
{
|
||||||
|
tableCache.Remove(relation);
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo: invoke SupportCaseDataChache with empty tables
|
||||||
|
// SupportCaseDataCacheHasChanged?.Invoke(this, new SupportCaseDataEventArgs() { Relation = relation });
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InvalidateLatestCaseDataCacheFor(cF4sdApiSearchResultRelation relation, out ICollection<cF4SDHealthCardRawData.cHealthCardTable> invalidatedTables)
|
||||||
|
{
|
||||||
|
invalidatedTables = new HashSet<cF4SDHealthCardRawData.cHealthCardTable>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var tableCache in _supportCaseDataCache.Values)
|
||||||
|
{
|
||||||
|
if (!tableCache.TryGetValue(relation, out cF4SDHealthCardRawData.cHealthCardTable table))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
table.IsIncomplete = true;
|
||||||
|
|
||||||
|
foreach (var column in table.Columns.Values)
|
||||||
|
{
|
||||||
|
column.Values[0] = null;
|
||||||
|
column.IsIncomplete = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
invalidatedTables.Add(table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<object> GetSupportCaseHealthcardData(cF4sdApiSearchResultRelation relation, cValueAddress valueAddress)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!_supportCaseDataCache.TryGetValue(valueAddress.ValueTable, out var tables))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (!tables.TryGetValue(relation, out var table))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (!table.Columns.TryGetValue(valueAddress.ValueColumn, out var column))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return column.Values;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleRelationsFound(object sender, StagedSearchResultRelationsEventArgs e)
|
private void HandleRelationsFound(object sender, StagedSearchResultRelationsEventArgs e)
|
||||||
@@ -107,19 +251,6 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
|||||||
=> AddCaseRelations(relations?.ToLookup(r => cF4sdIdentityEntry.GetFromSearchResult(r.Type), r => r));
|
=> AddCaseRelations(relations?.ToLookup(r => cF4sdIdentityEntry.GetFromSearchResult(r.Type), r => r));
|
||||||
|
|
||||||
public event EventHandler<RelationEventArgs> CaseRelationsAdded;
|
public event EventHandler<RelationEventArgs> CaseRelationsAdded;
|
||||||
public event EventHandler<object> SupportCaseDataCacheHasChanged; // Lookup for IdentitySet and tables which has been updated
|
public event EventHandler<SupportCaseDataEventArgs> SupportCaseDataCacheHasChanged;
|
||||||
|
|
||||||
private class SearchResultRelationEqualityComparer : IEqualityComparer<cF4sdApiSearchResultRelation>
|
|
||||||
{
|
|
||||||
public bool Equals(cF4sdApiSearchResultRelation x, cF4sdApiSearchResultRelation y)
|
|
||||||
{
|
|
||||||
return x.isEqual(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetHashCode(cF4sdApiSearchResultRelation obj)
|
|
||||||
{
|
|
||||||
return obj.GetHashCode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
|||||||
if (primaryIdentity is null)
|
if (primaryIdentity is null)
|
||||||
throw new InvalidEnumArgumentException($"{nameof(primaryIdentity)} must not be null.");
|
throw new InvalidEnumArgumentException($"{nameof(primaryIdentity)} must not be null.");
|
||||||
|
|
||||||
if (primaryIdentity.Class != enumFasdInformationClass.User)
|
|
||||||
throw new InvalidEnumArgumentException($"{nameof(primaryIdentity)} must be of class {nameof(enumFasdInformationClass.User)}.");
|
|
||||||
|
|
||||||
if (_supportCases.TryGetValue(primaryIdentity.Id, out var supportCase))
|
if (_supportCases.TryGetValue(primaryIdentity.Id, out var supportCase))
|
||||||
{
|
{
|
||||||
supportCase.Initialize();
|
supportCase.Initialize();
|
||||||
|
|||||||
@@ -0,0 +1,274 @@
|
|||||||
|
using C4IT.FASD.Base;
|
||||||
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
|
using C4IT.Logging;
|
||||||
|
using FasdDesktopUi.Basics.CustomEvents;
|
||||||
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using FasdDesktopUi.Pages.DetailsPage.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Used for processing raw data of a <see cref="ISupportCase"/> for the UI in a certain way.
|
||||||
|
/// </summary>
|
||||||
|
internal class SupportCaseProcessor
|
||||||
|
{
|
||||||
|
private ISupportCase _supportCase;
|
||||||
|
public cSupportCaseDataProvider SupportCaseDataProviderArtifact { get => _supportCase?.SupportCaseDataProviderArtifact; }
|
||||||
|
|
||||||
|
private readonly Dictionary<cF4sdApiSearchResultRelation, cDetailsPageData> _detailsPageDataCache = new Dictionary<cF4sdApiSearchResultRelation, cDetailsPageData>();
|
||||||
|
|
||||||
|
private readonly Dictionary<cF4sdApiSearchResultRelation, Dictionary<string, object>> _namedParameterCache = new Dictionary<cF4sdApiSearchResultRelation, Dictionary<string, object>>();
|
||||||
|
|
||||||
|
internal void SetSupportCase(ISupportCase supportCase)
|
||||||
|
{
|
||||||
|
if (_supportCase != null)
|
||||||
|
{
|
||||||
|
_supportCase.CaseRelationsAdded -= HandleSupportCaseRelationsAdded;
|
||||||
|
_supportCase.SupportCaseDataCacheHasChanged -= HandleSupportCaseDataCacheHasChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
_supportCase = supportCase;
|
||||||
|
|
||||||
|
_supportCase.CaseRelationsAdded += HandleSupportCaseRelationsAdded;
|
||||||
|
_supportCase.SupportCaseDataCacheHasChanged += HandleSupportCaseDataCacheHasChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleSupportCaseRelationsAdded(object sender, RelationEventArgs e)
|
||||||
|
=> AvailableCaseRelationsAdded?.Invoke(this, e);
|
||||||
|
|
||||||
|
private async void HandleSupportCaseDataCacheHasChanged(object sender, SupportCaseDataEventArgs e)
|
||||||
|
{
|
||||||
|
bool isArtifactShowingCorrectHealthCard
|
||||||
|
= SupportCaseDataProviderArtifact.HealthCardDataHelper.SelectedHealthCard == GetHealthcardFor(e.Relation);
|
||||||
|
|
||||||
|
if (!isArtifactShowingCorrectHealthCard)
|
||||||
|
{
|
||||||
|
// todo this can probably be removed, as soon as the last dependency of the SupportCaseDataProviderArtifact is gone.
|
||||||
|
// till then the detailspageData gets overriden with the detailspageData of the new relation.
|
||||||
|
// However, the removal shouldn't be much of a problem, due to the fact the Artifact also stores the raw data
|
||||||
|
_detailsPageDataCache.Remove(e.Relation);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_detailsPageDataCache.TryGetValue(e.Relation, out var cachedData))
|
||||||
|
{
|
||||||
|
cDetailsPageData detailData = _supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.DetailPage.GetDataWithoutHeading();
|
||||||
|
cachedData.WidgetData = detailData.WidgetData;
|
||||||
|
cachedData.DataHistoryList = detailData.DataHistoryList;
|
||||||
|
cachedData.MenuBarData = detailData.MenuBarData;
|
||||||
|
cachedData.DataContainerCollectionList = detailData.DataContainerCollectionList;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_detailsPageDataCache[e.Relation] = await _supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.DetailPage.GetDataAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateNamedParameters(e.Relation, e.DataTables);
|
||||||
|
CaseDataChanged?.Invoke(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateNamedParameters(cF4sdApiSearchResultRelation relation, IEnumerable<cF4SDHealthCardRawData.cHealthCardTable> dataTables)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!_namedParameterCache.ContainsKey(relation))
|
||||||
|
_namedParameterCache.Add(relation, new Dictionary<string, object>());
|
||||||
|
|
||||||
|
var healthcard = GetHealthcardFor(relation);
|
||||||
|
|
||||||
|
foreach (var namedParameter in cHealthCardPrerequisites.GetNamedParameters(healthcard).Values)
|
||||||
|
{
|
||||||
|
var table = dataTables.FirstOrDefault(t => t.Name == namedParameter.DatabaseInfo.ValueTable);
|
||||||
|
|
||||||
|
if (table is null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!table.Columns.TryGetValue(namedParameter.DatabaseInfo.ValueColumn, out var column))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = cUtility.RawValueFormatter.GetDisplayValue(column.Values.FirstOrDefault(), namedParameter.Display);
|
||||||
|
_namedParameterCache[relation][namedParameter.ParameterName] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task LoadSupportCaseDataAsync(cF4sdApiSearchResultRelation relation, IEnumerable<string> tablesToLoad)
|
||||||
|
{
|
||||||
|
_ = Task.Run(async () => await _supportCase.LoadSupportCaseDataAsync(relation, tablesToLoad.Where(t => !t.Contains("-details-"))));
|
||||||
|
|
||||||
|
if (!_detailsPageDataCache.TryGetValue(relation, out var detailsData))
|
||||||
|
{
|
||||||
|
detailsData = await _supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.DetailPage.GetDataAsync();
|
||||||
|
_detailsPageDataCache.Add(relation, detailsData);
|
||||||
|
}
|
||||||
|
|
||||||
|
CaseDataChanged?.Invoke(this, new SupportCaseDataEventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateLatestCaseDataFor(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int? agentUserId = relation.Identities.FirstOrDefault(i => i.Class == enumFasdInformationClass.User)?.agentId;
|
||||||
|
int? agentDeviceId = relation.Identities.FirstOrDefault(i => i.Class == enumFasdInformationClass.Computer)?.agentId;
|
||||||
|
|
||||||
|
await ActualizeDataAsync(agentUserId, agentDeviceId);
|
||||||
|
_supportCase.InvalidateLatestCaseDataCacheFor(relation, out var invalidatedTables);
|
||||||
|
_detailsPageDataCache.Remove(relation);
|
||||||
|
await _supportCase.LoadSupportCaseDataAsync(relation, invalidatedTables.Select(t => t.Name));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<enumActualizeStatus> ActualizeDataAsync(int? agentUserId, int? agentDeviceId)
|
||||||
|
{
|
||||||
|
var status = enumActualizeStatus.unknown;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TimeSpan refreshDelay = TimeSpan.FromMilliseconds(500);
|
||||||
|
const int maxPollCount = 20;
|
||||||
|
|
||||||
|
if (!agentDeviceId.HasValue)
|
||||||
|
{
|
||||||
|
LogEntry("Coudldn't acutalize data. There was no valid AgentDeviceId found.", LogLevels.Error);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
var taskId = await cFasdCockpitCommunicationBase.Instance.ActualizeAgentData(agentDeviceId.Value, agentUserId);
|
||||||
|
|
||||||
|
if (taskId == Guid.Empty)
|
||||||
|
return enumActualizeStatus.failed;
|
||||||
|
|
||||||
|
enumFasdInformationClass informationClass = agentUserId != null ? enumFasdInformationClass.User : enumFasdInformationClass.Computer;
|
||||||
|
int pollCount = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status = await cFasdCockpitCommunicationBase.Instance.GetActualizeAgentDataStatus(taskId, informationClass);
|
||||||
|
|
||||||
|
if (status == enumActualizeStatus.unknown)
|
||||||
|
{
|
||||||
|
pollCount++;
|
||||||
|
if (pollCount >= maxPollCount)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
await Task.Delay(refreshDelay);
|
||||||
|
}
|
||||||
|
} while (status == enumActualizeStatus.unknown);
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal ILookup<enumFasdInformationClass, cF4sdApiSearchResultRelation> GetCaseRelations()
|
||||||
|
=> _supportCase.GetCaseRelations();
|
||||||
|
|
||||||
|
internal cHealthCard GetHealthcardFor(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
var availableHealthCards = cF4SDCockpitXmlConfig.Instance?.HealthCardConfig?.HealthCards?.Values;
|
||||||
|
|
||||||
|
if (availableHealthCards is null || availableHealthCards.Count == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return availableHealthCards
|
||||||
|
.FirstOrDefault(hc =>
|
||||||
|
hc.InformationClasses.All(i => i == cF4sdIdentityEntry.GetFromSearchResult(relation.Type))
|
||||||
|
&& HasCockpitUserRequiredRoles(hc.RequiredRoles));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool HasCockpitUserRequiredRoles(List<string> requiredRoles)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (requiredRoles is null || requiredRoles.Count == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
List<string> roles = null;
|
||||||
|
lock (cFasdCockpitCommunicationBase.CockpitUserInfoLock)
|
||||||
|
{
|
||||||
|
roles = cFasdCockpitCommunicationBase.CockpitUserInfo?.Roles;
|
||||||
|
}
|
||||||
|
if (roles is null || roles.Count == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
foreach (var requiredRole in requiredRoles)
|
||||||
|
{
|
||||||
|
if (roles.Contains(requiredRole, StringComparer.InvariantCultureIgnoreCase))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<cWidgetValueModel>> GetWidgetData(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
List<List<cWidgetValueModel>> widgetData = null;
|
||||||
|
|
||||||
|
if (_detailsPageDataCache.TryGetValue(relation, out var detailsData))
|
||||||
|
widgetData = detailsData?.WidgetData;
|
||||||
|
|
||||||
|
return widgetData ?? new List<List<cWidgetValueModel>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public cDetailsPageDataHistoryDataModel GetHistoryData(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
cDetailsPageDataHistoryDataModel historyData = null;
|
||||||
|
|
||||||
|
if (_detailsPageDataCache.TryGetValue(relation, out var detailsData))
|
||||||
|
historyData = detailsData?.DataHistoryList;
|
||||||
|
|
||||||
|
return historyData ?? new cDetailsPageDataHistoryDataModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<cContainerCollectionData> GetContainerData(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
List<cContainerCollectionData> containerData = null;
|
||||||
|
|
||||||
|
if (_detailsPageDataCache.TryGetValue(relation, out var detailsData))
|
||||||
|
containerData = detailsData?.DataContainerCollectionList;
|
||||||
|
|
||||||
|
return containerData ?? new List<cContainerCollectionData>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<cMenuDataBase> GetMenuBarData(cF4sdApiSearchResultRelation relation)
|
||||||
|
{
|
||||||
|
List<cMenuDataBase> menuData = null;
|
||||||
|
|
||||||
|
if (_detailsPageDataCache.TryGetValue(relation, out var detailsData))
|
||||||
|
menuData = detailsData?.MenuBarData;
|
||||||
|
|
||||||
|
return menuData ?? new List<cMenuDataBase>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when newly available relations for a support case were added.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<RelationEventArgs> AvailableCaseRelationsAdded;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when the data set of a support case has changed.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<SupportCaseDataEventArgs> CaseDataChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||||
|
{
|
||||||
|
internal class SupportCaseProcessorFactory
|
||||||
|
{
|
||||||
|
private readonly static Dictionary<Guid, SupportCaseProcessor> _supportCaseProccesors = new Dictionary<Guid, SupportCaseProcessor>();
|
||||||
|
|
||||||
|
internal static SupportCaseProcessor Get(Guid id)
|
||||||
|
{
|
||||||
|
if (!_supportCaseProccesors.ContainsKey(id))
|
||||||
|
_supportCaseProccesors.Add(id, new SupportCaseProcessor());
|
||||||
|
|
||||||
|
return _supportCaseProccesors[id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,8 +7,9 @@ using System.Windows.Threading;
|
|||||||
|
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
using FasdDesktopUi.Basics.Models;
|
using FasdDesktopUi;
|
||||||
using FasdDesktopUi.Basics.Services.Models;
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using FasdDesktopUi.Basics.Services.Models;
|
||||||
#if isDemo
|
#if isDemo
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using FasdCockpitCommunicationDemo;
|
using FasdCockpitCommunicationDemo;
|
||||||
@@ -19,11 +20,10 @@ namespace FasdDesktopUi.Basics.Services
|
|||||||
{
|
{
|
||||||
public sealed class TicketOverviewUpdateService
|
public sealed class TicketOverviewUpdateService
|
||||||
{
|
{
|
||||||
private static readonly TimeSpan RefreshInterval = TimeSpan.FromMinutes(5);
|
private static readonly string[] OverviewKeys = new[]
|
||||||
private static readonly string[] OverviewKeys = new[]
|
{
|
||||||
{
|
"TicketsNew",
|
||||||
"TicketsNew",
|
"TicketsActive",
|
||||||
"TicketsActive",
|
|
||||||
"TicketsCritical",
|
"TicketsCritical",
|
||||||
"TicketsNewInfo",
|
"TicketsNewInfo",
|
||||||
"IncidentNew",
|
"IncidentNew",
|
||||||
@@ -33,16 +33,22 @@ namespace FasdDesktopUi.Basics.Services
|
|||||||
"UnassignedTickets",
|
"UnassignedTickets",
|
||||||
"UnassignedTicketsCritical"
|
"UnassignedTicketsCritical"
|
||||||
};
|
};
|
||||||
private const string DemoTicketDetailsKey = "Demo.HasTicketDetails";
|
private const string DemoTicketDetailsKey = "Demo.HasTicketDetails";
|
||||||
private readonly Dispatcher _dispatcher;
|
private readonly Dispatcher _dispatcher;
|
||||||
private readonly Dictionary<string, TileCounts> _currentCounts = new Dictionary<string, TileCounts>(StringComparer.OrdinalIgnoreCase);
|
private readonly Dictionary<string, TileCounts> _currentCounts = new Dictionary<string, TileCounts>(StringComparer.OrdinalIgnoreCase);
|
||||||
private readonly Dictionary<(string Key, bool UseRoleScope), List<cF4sdApiSearchResultRelation>> _demoRelations = new Dictionary<(string, bool), List<cF4sdApiSearchResultRelation>>();
|
private readonly Dictionary<(string Key, bool UseRoleScope), List<cF4sdApiSearchResultRelation>> _demoRelations = new Dictionary<(string, bool), List<cF4sdApiSearchResultRelation>>();
|
||||||
private DispatcherTimer _timer;
|
private readonly HashSet<TileScope> _pendingScopes = new HashSet<TileScope>();
|
||||||
private bool _isFetching;
|
private readonly HashSet<TileScope> _initializedScopes = new HashSet<TileScope>();
|
||||||
private bool _fetchRetryPending;
|
private readonly object _fetchLock = new object();
|
||||||
private bool _isDemo;
|
private readonly HashSet<TileScope> _retryScopes = new HashSet<TileScope>();
|
||||||
private bool _initialized;
|
private DispatcherTimer _personalTimer;
|
||||||
private readonly Random _random = new Random();
|
private DispatcherTimer _roleTimer;
|
||||||
|
private Task _fetchWorker;
|
||||||
|
private bool _retryScheduled;
|
||||||
|
private bool _isDemo;
|
||||||
|
private bool _initialized;
|
||||||
|
private bool _isEnabled;
|
||||||
|
private readonly Random _random = new Random();
|
||||||
#if isDemo
|
#if isDemo
|
||||||
private readonly List<DemoTicketRecord> _persistedDemoTickets = new List<DemoTicketRecord>();
|
private readonly List<DemoTicketRecord> _persistedDemoTickets = new List<DemoTicketRecord>();
|
||||||
private readonly List<DemoTicketTemplate> _demoTemplates = new List<DemoTicketTemplate>();
|
private readonly List<DemoTicketTemplate> _demoTemplates = new List<DemoTicketTemplate>();
|
||||||
@@ -67,138 +73,338 @@ namespace FasdDesktopUi.Basics.Services
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static TicketOverviewUpdateService()
|
static TicketOverviewUpdateService()
|
||||||
{
|
{
|
||||||
#if isDemo
|
Instance = new TicketOverviewUpdateService();
|
||||||
Instance = new TicketOverviewUpdateService();
|
}
|
||||||
#endif
|
|
||||||
}
|
public static TicketOverviewUpdateService Instance { get; }
|
||||||
|
|
||||||
public static TicketOverviewUpdateService Instance { get; } = null;
|
|
||||||
|
|
||||||
public event EventHandler<TicketOverviewCountsChangedEventArgs> OverviewCountsChanged;
|
public event EventHandler<TicketOverviewCountsChangedEventArgs> OverviewCountsChanged;
|
||||||
|
|
||||||
public IReadOnlyDictionary<string, TileCounts> CurrentCounts => _currentCounts;
|
public IReadOnlyDictionary<string, TileCounts> CurrentCounts => _currentCounts;
|
||||||
|
|
||||||
|
public bool IsScopeInitialized(TileScope scope)
|
||||||
|
{
|
||||||
|
lock (_fetchLock)
|
||||||
|
{
|
||||||
|
return _initializedScopes.Contains(scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AreAllScopesInitialized
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
lock (_fetchLock)
|
||||||
|
{
|
||||||
|
return _initializedScopes.Contains(TileScope.Personal)
|
||||||
|
&& _initializedScopes.Contains(TileScope.Role);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
if (_initialized)
|
UpdateAvailability(true);
|
||||||
return;
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
UpdateAvailability(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateAvailability(bool isEnabled)
|
||||||
|
{
|
||||||
|
if (isEnabled)
|
||||||
|
{
|
||||||
|
if (!_isEnabled)
|
||||||
|
{
|
||||||
|
_isEnabled = true;
|
||||||
|
StartInternal();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RefreshTimerIntervals();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_isEnabled)
|
||||||
|
StopInternal();
|
||||||
|
|
||||||
|
_isEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StartInternal()
|
||||||
|
{
|
||||||
|
if (_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
|
#if isDemo
|
||||||
|
_isDemo = true;
|
||||||
|
LoadPersistedDemoTickets();
|
||||||
|
#else
|
||||||
|
_isDemo = cFasdCockpitCommunicationBase.Instance?.IsDemo() == true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
InitializeTimers();
|
||||||
|
_ = FetchAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopInternal()
|
||||||
|
{
|
||||||
|
if (!_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_initialized = false;
|
||||||
|
lock (_fetchLock)
|
||||||
|
{
|
||||||
|
_pendingScopes.Clear();
|
||||||
|
_initializedScopes.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (_retryScopes)
|
||||||
|
{
|
||||||
|
_retryScheduled = false;
|
||||||
|
_retryScopes.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
_dispatcher.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
_personalTimer?.Stop();
|
||||||
|
_roleTimer?.Stop();
|
||||||
|
_personalTimer = null;
|
||||||
|
_roleTimer = null;
|
||||||
|
|
||||||
|
foreach (var key in OverviewKeys)
|
||||||
|
{
|
||||||
|
_currentCounts[key] = TileCounts.Empty;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeTimers()
|
||||||
|
{
|
||||||
|
_personalTimer = CreateScopeTimer(TileScope.Personal);
|
||||||
|
_roleTimer = CreateScopeTimer(TileScope.Role);
|
||||||
|
|
||||||
|
_personalTimer?.Start();
|
||||||
|
_roleTimer?.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private DispatcherTimer CreateScopeTimer(TileScope scope)
|
||||||
|
{
|
||||||
|
var interval = GetPollingInterval(scope);
|
||||||
|
var timer = new DispatcherTimer(interval, DispatcherPriority.Background, async (s, e) => await FetchAsync(scope).ConfigureAwait(false), _dispatcher)
|
||||||
|
{
|
||||||
|
IsEnabled = false
|
||||||
|
};
|
||||||
|
return timer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private TimeSpan GetPollingInterval(TileScope scope)
|
||||||
|
{
|
||||||
|
var ticketConfig = cFasdCockpitConfig.Instance?.Global?.TicketConfiguration;
|
||||||
|
int minutes = scope == TileScope.Role
|
||||||
|
? cF4sdTicketConfig.DefaultOverviewPollingRole
|
||||||
|
: cF4sdTicketConfig.DefaultOverviewPollingPersonal;
|
||||||
|
|
||||||
|
if (ticketConfig != null)
|
||||||
|
{
|
||||||
|
minutes = scope == TileScope.Role
|
||||||
|
? ticketConfig.OverviewPollingRole
|
||||||
|
: ticketConfig.OverviewPollingPersonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (minutes < 1)
|
||||||
|
minutes = 1;
|
||||||
|
|
||||||
|
return TimeSpan.FromMinutes(minutes);
|
||||||
|
}
|
||||||
|
|
||||||
_initialized = true;
|
public Task FetchAsync()
|
||||||
#if isDemo
|
{
|
||||||
_isDemo = true;
|
if (!_isEnabled)
|
||||||
LoadPersistedDemoTickets();
|
return Task.CompletedTask;
|
||||||
#else
|
|
||||||
_isDemo = cFasdCockpitCommunicationBase.Instance?.IsDemo() == true;
|
return QueueFetchAsync(new[] { TileScope.Personal, TileScope.Role });
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if (!_isDemo)
|
public Task FetchAsync(TileScope scope)
|
||||||
{
|
{
|
||||||
_timer = new DispatcherTimer(RefreshInterval, DispatcherPriority.Background, async (s, e) => await FetchAsync().ConfigureAwait(false), _dispatcher);
|
if (!_isEnabled)
|
||||||
_timer.Start();
|
return Task.CompletedTask;
|
||||||
_ = FetchAsync();
|
|
||||||
}
|
return QueueFetchAsync(new[] { scope });
|
||||||
else
|
}
|
||||||
{
|
|
||||||
_ = FetchAsync();
|
private Task QueueFetchAsync(IEnumerable<TileScope> scopes)
|
||||||
}
|
{
|
||||||
}
|
if (!_isEnabled)
|
||||||
|
return Task.CompletedTask;
|
||||||
public async Task FetchAsync()
|
|
||||||
{
|
if (scopes == null)
|
||||||
if (_isFetching)
|
return Task.CompletedTask;
|
||||||
return;
|
|
||||||
|
lock (_fetchLock)
|
||||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
{
|
||||||
if (communication == null)
|
foreach (var scope in scopes)
|
||||||
{
|
{
|
||||||
ScheduleFetchRetry();
|
_pendingScopes.Add(scope);
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
if (_fetchWorker == null || _fetchWorker.IsCompleted)
|
||||||
_isFetching = true;
|
{
|
||||||
try
|
_fetchWorker = Task.Run(ProcessFetchQueueAsync);
|
||||||
{
|
}
|
||||||
_isDemo = communication?.IsDemo() == true;
|
|
||||||
if (_isDemo && _timer != null)
|
return _fetchWorker;
|
||||||
{
|
}
|
||||||
_timer.Stop();
|
}
|
||||||
_timer = null;
|
|
||||||
}
|
private async Task ProcessFetchQueueAsync()
|
||||||
var counts = await Task.Run(() => RetrieveCountsAsync()).ConfigureAwait(false);
|
{
|
||||||
if (counts != null)
|
while (true)
|
||||||
{
|
{
|
||||||
await _dispatcher.InvokeAsync(() => ProcessCounts(counts));
|
TileScope scope;
|
||||||
}
|
|
||||||
}
|
lock (_fetchLock)
|
||||||
finally
|
{
|
||||||
{
|
if (_pendingScopes.Count == 0)
|
||||||
_isFetching = false;
|
{
|
||||||
}
|
_fetchWorker = null;
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
private Dictionary<string, TileCounts> RetrieveCountsAsync()
|
|
||||||
{
|
scope = _pendingScopes.First();
|
||||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
_pendingScopes.Remove(scope);
|
||||||
if (communication == null)
|
}
|
||||||
return null;
|
|
||||||
|
await FetchScopeAsync(scope).ConfigureAwait(false);
|
||||||
var result = new Dictionary<string, TileCounts>(StringComparer.OrdinalIgnoreCase);
|
}
|
||||||
|
}
|
||||||
foreach (var key in OverviewKeys)
|
|
||||||
{
|
private async Task FetchScopeAsync(TileScope scope)
|
||||||
var personalTask = communication.GetTicketOverviewRelations(key, useRoleScope: false, count: 0);
|
{
|
||||||
var roleTask = communication.GetTicketOverviewRelations(key, useRoleScope: true, count: 0);
|
if (!_isEnabled)
|
||||||
Task.WaitAll(personalTask, roleTask);
|
return;
|
||||||
|
|
||||||
int personalCount = personalTask.Result?.Count ?? 0;
|
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||||
int roleCount = roleTask.Result?.Count ?? 0;
|
if (communication == null)
|
||||||
|
{
|
||||||
if (_isDemo)
|
ScheduleFetchRetry(scope);
|
||||||
{
|
return;
|
||||||
personalCount += GetDemoRelationCount(key, useRoleScope: false);
|
}
|
||||||
roleCount += GetDemoRelationCount(key, useRoleScope: true);
|
|
||||||
}
|
try
|
||||||
|
{
|
||||||
result[key] = new TileCounts(personalCount, roleCount);
|
_isDemo = communication.IsDemo();
|
||||||
}
|
|
||||||
|
var rawCounts = await communication.GetTicketOverviewCounts(OverviewKeys, scope == TileScope.Role).ConfigureAwait(false);
|
||||||
return result;
|
var counts = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||||
}
|
|
||||||
|
if (rawCounts != null)
|
||||||
private void ProcessCounts(Dictionary<string, TileCounts> newCounts)
|
{
|
||||||
{
|
foreach (var kvp in rawCounts)
|
||||||
var changes = new List<TileCountChange>();
|
{
|
||||||
bool hasPrevious = _currentCounts.Values.Any(tc => tc.Personal > 0 || tc.Role > 0);
|
if (string.IsNullOrWhiteSpace(kvp.Key))
|
||||||
|
continue;
|
||||||
foreach (var key in OverviewKeys)
|
|
||||||
{
|
counts[kvp.Key] = Math.Max(0, kvp.Value);
|
||||||
var previous = _currentCounts[key];
|
}
|
||||||
var current = newCounts.TryGetValue(key, out var value) ? value : TileCounts.Empty;
|
}
|
||||||
|
|
||||||
if (previous.Personal != current.Personal)
|
if (_isDemo)
|
||||||
{
|
{
|
||||||
changes.Add(new TileCountChange(key, TileScope.Personal, previous.Personal, current.Personal));
|
foreach (var key in OverviewKeys)
|
||||||
}
|
{
|
||||||
|
var extras = GetDemoRelationCount(key, scope == TileScope.Role);
|
||||||
if (previous.Role != current.Role)
|
if (counts.ContainsKey(key))
|
||||||
{
|
counts[key] += extras;
|
||||||
changes.Add(new TileCountChange(key, TileScope.Role, previous.Role, current.Role));
|
else
|
||||||
}
|
counts[key] = extras;
|
||||||
|
}
|
||||||
_currentCounts[key] = current;
|
}
|
||||||
}
|
|
||||||
|
if (!_isEnabled)
|
||||||
if (!hasPrevious)
|
return;
|
||||||
return;
|
|
||||||
|
await _dispatcher.InvokeAsync(() => ProcessScopeCounts(scope, counts));
|
||||||
if (changes.Count == 0)
|
}
|
||||||
return;
|
catch (Exception ex)
|
||||||
|
{
|
||||||
var args = new TicketOverviewCountsChangedEventArgs(changes, new Dictionary<string, TileCounts>(_currentCounts));
|
System.Diagnostics.Debug.WriteLine($"[TicketOverview] Fetch {scope} failed: {ex}");
|
||||||
OverviewCountsChanged?.Invoke(this, args);
|
ScheduleFetchRetry(scope);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RefreshTimerIntervals()
|
||||||
|
{
|
||||||
|
_dispatcher.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
if (_personalTimer != null)
|
||||||
|
_personalTimer.Interval = GetPollingInterval(TileScope.Personal);
|
||||||
|
|
||||||
|
if (_roleTimer != null)
|
||||||
|
_roleTimer.Interval = GetPollingInterval(TileScope.Role);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessScopeCounts(TileScope scope, IDictionary<string, int> newCounts)
|
||||||
|
{
|
||||||
|
if (newCounts == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var hasInitializedScope = _initializedScopes.Contains(scope);
|
||||||
|
var changes = new List<TileCountChange>();
|
||||||
|
|
||||||
|
foreach (var key in OverviewKeys)
|
||||||
|
{
|
||||||
|
var previous = _currentCounts.TryGetValue(key, out var counts) ? counts : TileCounts.Empty;
|
||||||
|
var incoming = newCounts.TryGetValue(key, out var value) ? value : 0;
|
||||||
|
|
||||||
|
TileCounts updated;
|
||||||
|
int oldValue;
|
||||||
|
|
||||||
|
if (scope == TileScope.Role)
|
||||||
|
{
|
||||||
|
updated = new TileCounts(previous.Personal, incoming);
|
||||||
|
oldValue = previous.Role;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updated = new TileCounts(incoming, previous.Role);
|
||||||
|
oldValue = previous.Personal;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentCounts[key] = updated;
|
||||||
|
|
||||||
|
if (hasInitializedScope && oldValue != incoming)
|
||||||
|
{
|
||||||
|
changes.Add(new TileCountChange(key, scope, oldValue, incoming));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasInitializedScope)
|
||||||
|
{
|
||||||
|
_initializedScopes.Add(scope);
|
||||||
|
var initArgs = new TicketOverviewCountsChangedEventArgs(
|
||||||
|
Array.Empty<TileCountChange>(),
|
||||||
|
new Dictionary<string, TileCounts>(_currentCounts, StringComparer.OrdinalIgnoreCase),
|
||||||
|
scope);
|
||||||
|
OverviewCountsChanged?.Invoke(this, initArgs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changes.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var args = new TicketOverviewCountsChangedEventArgs(changes, new Dictionary<string, TileCounts>(_currentCounts, StringComparer.OrdinalIgnoreCase));
|
||||||
|
OverviewCountsChanged?.Invoke(this, args);
|
||||||
|
}
|
||||||
|
|
||||||
public void SimulateDemoTicket()
|
public void SimulateDemoTicket()
|
||||||
{
|
{
|
||||||
@@ -318,9 +524,9 @@ namespace FasdDesktopUi.Basics.Services
|
|||||||
if (appliedChanges.Count == 0)
|
if (appliedChanges.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var args = new TicketOverviewCountsChangedEventArgs(appliedChanges, new Dictionary<string, TileCounts>(_currentCounts));
|
var args = new TicketOverviewCountsChangedEventArgs(appliedChanges, new Dictionary<string, TileCounts>(_currentCounts));
|
||||||
OverviewCountsChanged?.Invoke(this, args);
|
OverviewCountsChanged?.Invoke(this, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddRelationForRecord(DemoTicketRecord record)
|
private void AddRelationForRecord(DemoTicketRecord record)
|
||||||
{
|
{
|
||||||
@@ -577,24 +783,43 @@ namespace FasdDesktopUi.Basics.Services
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ScheduleFetchRetry()
|
private void ScheduleFetchRetry(TileScope scope)
|
||||||
{
|
{
|
||||||
if (_fetchRetryPending)
|
if (!_isEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_fetchRetryPending = true;
|
lock (_retryScopes)
|
||||||
_ = _dispatcher.InvokeAsync(async () =>
|
{
|
||||||
{
|
_retryScopes.Add(scope);
|
||||||
try
|
if (_retryScheduled)
|
||||||
{
|
return;
|
||||||
await Task.Delay(250).ConfigureAwait(false);
|
|
||||||
await FetchAsync().ConfigureAwait(false);
|
_retryScheduled = true;
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
_ = _dispatcher.InvokeAsync(async () =>
|
||||||
_fetchRetryPending = false;
|
{
|
||||||
}
|
try
|
||||||
}, DispatcherPriority.Background);
|
{
|
||||||
}
|
await Task.Delay(TimeSpan.FromSeconds(5)).ConfigureAwait(false);
|
||||||
|
TileScope[] scopes;
|
||||||
|
lock (_retryScopes)
|
||||||
|
{
|
||||||
|
scopes = _retryScopes.ToArray();
|
||||||
|
_retryScopes.Clear();
|
||||||
|
_retryScheduled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var pendingScope in scopes)
|
||||||
|
{
|
||||||
|
await FetchAsync(pendingScope).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
System.Diagnostics.Debug.WriteLine($"[TicketOverview] Retry scheduling failed: {ex}");
|
||||||
|
}
|
||||||
|
}, DispatcherPriority.Background);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ using System.Windows;
|
|||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
@@ -26,6 +27,8 @@ using Newtonsoft.Json;
|
|||||||
using FasdDesktopUi.Basics.Services.ProtocollService;
|
using FasdDesktopUi.Basics.Services.ProtocollService;
|
||||||
using FasdDesktopUi.Basics.Services.SupportCase;
|
using FasdDesktopUi.Basics.Services.SupportCase;
|
||||||
using FasdDesktopUi.Basics.Services.RelationService;
|
using FasdDesktopUi.Basics.Services.RelationService;
|
||||||
|
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace FasdDesktopUi.Basics
|
namespace FasdDesktopUi.Basics
|
||||||
@@ -100,10 +103,10 @@ namespace FasdDesktopUi.Basics
|
|||||||
QuickActionProtocollHelper = new cQuickActionProtocollHelper(this);
|
QuickActionProtocollHelper = new cQuickActionProtocollHelper(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<cSupportCaseDataProvider> GetDataProviderForAsync(List<cF4sdApiSearchResultRelation> storedRelations, cF4sdApiSearchResultRelation selectedRelation, IRelationService relationService)
|
public static async Task<cSupportCaseDataProvider> GetDataProviderForAsync(cF4sdApiSearchResultRelation selectedRelation, IRelationService relationService)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (selectedRelation == null)
|
if (selectedRelation == null)
|
||||||
{
|
{
|
||||||
Debug.Assert(true, "The selected relation must not be null here!");
|
Debug.Assert(true, "The selected relation must not be null here!");
|
||||||
@@ -147,43 +150,68 @@ namespace FasdDesktopUi.Basics
|
|||||||
cSupportCaseDataProvider.CurrentProvider = null;
|
cSupportCaseDataProvider.CurrentProvider = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DataProviders.TryGetValue(MainIdentity.Id, out var _result))
|
if (!DataProviders.TryGetValue(MainIdentity.Id, out var _result))
|
||||||
{
|
{
|
||||||
_result = new cSupportCaseDataProvider();
|
_result = new cSupportCaseDataProvider();
|
||||||
DataProviders.Add(MainIdentity.Id, _result);
|
DataProviders.Add(MainIdentity.Id, _result);
|
||||||
}
|
}
|
||||||
|
|
||||||
_result.NamedParameterEntries = new cNamedParameterList(_result);
|
await EnsureSupportCasePagesAsync();
|
||||||
|
|
||||||
_result.StartCase(MainIdentity.Id);
|
_result.NamedParameterEntries = new cNamedParameterList(_result);
|
||||||
|
|
||||||
|
_result.StartCase(MainIdentity.Id);
|
||||||
|
|
||||||
var supportCase = SupportCaseFactory.Get(MainIdentity, relationService, _result);
|
var supportCase = SupportCaseFactory.Get(MainIdentity, relationService, _result);
|
||||||
cSupportCaseDataProvider.detailsPage.SetSupportCase(supportCase);
|
var supportCaseProcessor = SupportCaseProcessorFactory.Get(MainIdentity.Id);
|
||||||
cSupportCaseDataProvider.slimPage.SetSupportCase(supportCase);
|
var supportCaseController = new SupportCaseController();
|
||||||
|
|
||||||
|
supportCaseProcessor.SetSupportCase(supportCase);
|
||||||
|
supportCaseController.SetSupportCaseProcessor(supportCaseProcessor, Identities);
|
||||||
|
|
||||||
|
if (cSupportCaseDataProvider.detailsPage == null || cSupportCaseDataProvider.slimPage == null)
|
||||||
|
{
|
||||||
|
LogEntry("Support case pages are not initialized; aborting case start.", LogLevels.Error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
cSupportCaseDataProvider.detailsPage.SetSupportCaseController(supportCaseController);
|
||||||
|
cSupportCaseDataProvider.slimPage.SetSupportCaseController(supportCaseController);
|
||||||
|
|
||||||
var Status = await _result.SetViewDataAsync(requiredInformationClasses, Identities, true);
|
var Status = await _result.SetViewDataAsync(requiredInformationClasses, Identities, true);
|
||||||
|
|
||||||
|
cF4sdApiSearchResultRelation relationToFocus = GetRelationToFocus(selectedRelation, relationService.GetLoadedRelations());
|
||||||
|
// relation to focus may not have all identities
|
||||||
|
supportCaseController.UpdateFocusedCaseRelation(relationToFocus);
|
||||||
if (!Status)
|
if (!Status)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
var selectedHealthCard = _result.HealthCardDataHelper?.SelectedHealthCard;
|
||||||
|
if (selectedHealthCard != null)
|
||||||
|
_ = cHealthCard.GetRequiredTables(selectedHealthCard); // todo the healthcard is not selected at this point
|
||||||
|
|
||||||
|
if (detailsPage?.WidgetCollection != null)
|
||||||
|
detailsPage.WidgetCollection.WidgetDataList = supportCaseController.GetWidgetData();
|
||||||
|
if (detailsPage?.DataHistoryCollectionUserControl != null)
|
||||||
|
detailsPage.DataHistoryCollectionUserControl.HistoryDataList = supportCaseController.GetHistoryData();
|
||||||
|
if (detailsPage?.CustomizableSectionUc != null)
|
||||||
|
detailsPage.CustomizableSectionUc.ContainerCollections = supportCaseController.GetContainerData();
|
||||||
|
|
||||||
CurrentProvider = _result;
|
CurrentProvider = _result;
|
||||||
|
|
||||||
// start the direct connection
|
|
||||||
if (_result.DirectConnectionHelper.IsDirectConnectionActive is false)
|
|
||||||
_ = Task.Run(async () =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _result.DirectConnectionHelper.DirectConnectionStartAsync();
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
});
|
|
||||||
|
|
||||||
// start the slim or detaild page
|
// start the slim or detaild page
|
||||||
bool shouldSkipSlimView = Identities.Any(identity => identity.Class is enumFasdInformationClass.Ticket) || cFasdCockpitConfig.Instance.Global.ShouldSkipSlimView;
|
bool shouldSkipSlimView = (Identities?.Any(identity => identity.Class is enumFasdInformationClass.Ticket) ?? false)
|
||||||
if (shouldSkipSlimView)
|
|| (cFasdCockpitConfig.Instance?.Global?.ShouldSkipSlimView ?? false);
|
||||||
cSupportCaseDataProvider.detailsPage?.Show();
|
if (shouldSkipSlimView)
|
||||||
else
|
{
|
||||||
cSupportCaseDataProvider.slimPage.Show();
|
cSupportCaseDataProvider.detailsPage?.Show();
|
||||||
|
cSupportCaseDataProvider.slimPage?.Hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cSupportCaseDataProvider.slimPage?.Show();
|
||||||
|
cSupportCaseDataProvider.detailsPage?.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
@@ -194,11 +222,35 @@ namespace FasdDesktopUi.Basics
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartCase(Guid userId)
|
private static cF4sdApiSearchResultRelation GetRelationToFocus(cF4sdApiSearchResultRelation selectedRelation, IEnumerable<cF4sdApiSearchResultRelation> loadedRelations)
|
||||||
{
|
{
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
|
||||||
LogMethodBegin(CM);
|
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if (selectedRelation.Type != enumF4sdSearchResultClass.User)
|
||||||
|
return selectedRelation;
|
||||||
|
|
||||||
|
cF4sdIdentityEntry alternativeIdentity = selectedRelation.Identities.FirstOrDefault(i => i.Class != enumFasdInformationClass.User);
|
||||||
|
cF4sdApiSearchResultRelation relationToFocus = loadedRelations.FirstOrDefault(r => r.id == alternativeIdentity?.Id && cF4sdIdentityEntry.GetFromSearchResult(r.Type) == alternativeIdentity.Class);
|
||||||
|
|
||||||
|
if (relationToFocus is null)
|
||||||
|
return selectedRelation;
|
||||||
|
|
||||||
|
relationToFocus.Identities = selectedRelation.Identities;
|
||||||
|
return relationToFocus;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedRelation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartCase(Guid userId)
|
||||||
|
{
|
||||||
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
LogMethodBegin(CM);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
lock (caseIdLockObject)
|
lock (caseIdLockObject)
|
||||||
{
|
{
|
||||||
@@ -238,11 +290,28 @@ namespace FasdDesktopUi.Basics
|
|||||||
{
|
{
|
||||||
LogException(E);
|
LogException(E);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
LogMethodEnd(CM);
|
LogMethodEnd(CM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static async Task EnsureSupportCasePagesAsync()
|
||||||
|
{
|
||||||
|
if (detailsPage != null && slimPage != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Application.Current == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await Application.Current.Dispatcher.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
if (slimPage == null)
|
||||||
|
slimPage = new Pages.SlimPage.SlimPageView();
|
||||||
|
if (detailsPage == null)
|
||||||
|
detailsPage = new Pages.DetailsPage.DetailsPageView();
|
||||||
|
}, DispatcherPriority.Normal);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task CloseCaseAsync()
|
public async Task CloseCaseAsync()
|
||||||
{
|
{
|
||||||
@@ -452,35 +521,12 @@ namespace FasdDesktopUi.Basics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var isOk = await HealthCardDataHelper.LoadingHelper.GetHealthCardRawDataAsync(new cF4sdHealthCardRawDataRequest()
|
|
||||||
{
|
|
||||||
Identities = Identities,
|
|
||||||
Tables = requiredTables.ToList(),
|
|
||||||
MaxAge = cF4SDCockpitXmlConfig.Instance?.HealthCardConfig?.SearchResultAge ?? 14
|
|
||||||
});
|
|
||||||
|
|
||||||
if (isNewCase)
|
if (isNewCase)
|
||||||
HealthCardDataHelper.LoadingHelper.LastDataRequest = DateTime.Now;
|
HealthCardDataHelper.LoadingHelper.LastDataRequest = DateTime.Now;
|
||||||
|
|
||||||
if (isOk == false)
|
|
||||||
{
|
|
||||||
string identityString = "";
|
|
||||||
|
|
||||||
foreach (var identity in Identities)
|
|
||||||
{
|
|
||||||
identityString += "\n" + identity.Id + " (Type: " + identity.Class + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
LogEntry($"Error trying to receive healthcard data for following identities: {identityString}", LogLevels.Error);
|
|
||||||
CustomMessageBox.Show($"Error trying to receive healthcard data for following identities: {identityString}", "Data Error", enumHealthCardStateLevel.Error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var slimPageData = await HealthCardDataHelper.SlimCard.GetDataAsync();
|
var slimPageData = await HealthCardDataHelper.SlimCard.GetDataAsync();
|
||||||
var detailsPageData = await HealthCardDataHelper.DetailPage.GetDataAsync();
|
|
||||||
|
|
||||||
slimPage?.SetPropertyValues(slimPageData);
|
slimPage?.SetPropertyValues(slimPageData);
|
||||||
detailsPage?.SetPropertyValues(detailsPageData);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -545,11 +591,6 @@ namespace FasdDesktopUi.Basics
|
|||||||
}
|
}
|
||||||
relationIdentity.CopyTo(existingIdentity);
|
relationIdentity.CopyTo(existingIdentity);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Identities.Add(relationIdentity.CreateCopy());
|
|
||||||
ComputerAdded |= relationIdentity.Class == enumFasdInformationClass.Computer;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,16 +602,6 @@ namespace FasdDesktopUi.Basics
|
|||||||
var searchResultInfoClass = cF4sdIdentityEntry.GetFromSearchResult(searchResultRelation.Type);
|
var searchResultInfoClass = cF4sdIdentityEntry.GetFromSearchResult(searchResultRelation.Type);
|
||||||
await SetViewDataAsync(new List<enumFasdInformationClass>() { searchResultInfoClass }, Identities, false);
|
await SetViewDataAsync(new List<enumFasdInformationClass>() { searchResultInfoClass }, Identities, false);
|
||||||
|
|
||||||
if (ComputerAdded)
|
|
||||||
_ = Task.Run(async () =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await DirectConnectionHelper.DirectConnectionStartAsync();
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,24 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||||
using C4IT.Logging;
|
|
||||||
using C4IT.MultiLanguage;
|
|
||||||
|
|
||||||
using FasdDesktopUi.Basics.Models;
|
|
||||||
|
|
||||||
using FasdDesktopUi.Basics.UserControls;
|
|
||||||
using FasdDesktopUi.Pages.DetailsPage;
|
using FasdDesktopUi.Pages.DetailsPage;
|
||||||
using FasdDesktopUi.Pages.DetailsPage.UserControls;
|
|
||||||
|
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
@@ -26,11 +13,14 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
{
|
{
|
||||||
public class cChangeHealthCardAction : cUiActionBase
|
public class cChangeHealthCardAction : cUiActionBase
|
||||||
{
|
{
|
||||||
|
private readonly SupportCaseController _supportCaseController;
|
||||||
|
|
||||||
public cF4sdApiSearchResultRelation ResultRelation { get; private set; } = null;
|
public cF4sdApiSearchResultRelation ResultRelation { get; private set; } = null;
|
||||||
|
|
||||||
public cChangeHealthCardAction(cF4sdApiSearchResultRelation resultRelation)
|
public cChangeHealthCardAction(cF4sdApiSearchResultRelation resultRelation, SupportCaseController supportCaseController)
|
||||||
{
|
{
|
||||||
ResultRelation = resultRelation;
|
ResultRelation = resultRelation;
|
||||||
|
_supportCaseController = supportCaseController;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
||||||
@@ -52,6 +42,8 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
detailsPage.NavigationHeadingUc.ResetSelectors();
|
detailsPage.NavigationHeadingUc.ResetSelectors();
|
||||||
|
|
||||||
await dataProvider.ExchangeCaseIdentitiesAsync(ResultRelation);
|
await dataProvider.ExchangeCaseIdentitiesAsync(ResultRelation);
|
||||||
|
_supportCaseController.UpdateFocusedCaseRelation(ResultRelation);
|
||||||
|
detailsPage.UpdateHealthcardSectionVisibilities();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,17 +34,17 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
|
|
||||||
private string Recommendation { get; set; }
|
private string Recommendation { get; set; }
|
||||||
|
|
||||||
private cHealthCardDetailsTable ValuedDetailsData = null;
|
private readonly cHealthCardDetailsTable _valuedDetailsData = null;
|
||||||
|
|
||||||
public cShowDetailedDataAction(cHealthCardStateBase StateDefinition, int DayIndex = 0, cHealthCardDetailsTable ValuedDetailsData = null)
|
public cShowDetailedDataAction(cHealthCardStateBase stateDefinition, int dayIndex = 0, cHealthCardDetailsTable valuedDetailsData = null)
|
||||||
{
|
{
|
||||||
this.StateDefinition = StateDefinition;
|
StateDefinition = stateDefinition;
|
||||||
this.DayIndex = DayIndex;
|
DayIndex = dayIndex;
|
||||||
this.DetailsTitle = StateDefinition.Names.GetValue();
|
DetailsTitle = stateDefinition.Names.GetValue();
|
||||||
this.Recommendation = StateDefinition.Descriptions.GetValue();
|
Recommendation = stateDefinition.Descriptions.GetValue();
|
||||||
if (this.Recommendation == String.Empty)
|
if (Recommendation == string.Empty)
|
||||||
this.Recommendation = null;
|
Recommendation = null;
|
||||||
this.ValuedDetailsData = ValuedDetailsData;
|
_valuedDetailsData = valuedDetailsData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
||||||
@@ -61,7 +61,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
|
|
||||||
if (StateDefinition.Details is cHealthCardDetailsValued)
|
if (StateDefinition.Details is cHealthCardDetailsValued)
|
||||||
{
|
{
|
||||||
if (ValuedDetailsData == null)
|
if (_valuedDetailsData == null)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -240,26 +240,37 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
|
|
||||||
private cDetailedDataModel GetValuedDataModel()
|
private cDetailedDataModel GetValuedDataModel()
|
||||||
{
|
{
|
||||||
if (!(StateDefinition.Details is cHealthCardDetailsValued _details) || ValuedDetailsData == null)
|
if (!(StateDefinition.Details is cHealthCardDetailsValued details) || _valuedDetailsData == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (ValuedDetailsData.Columns.Count > 1)
|
var _colCount = details.Count;
|
||||||
|
|
||||||
|
if (_colCount == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var _rowHeadings = _details.Select(v => v.Names.GetValue() as object).ToList();
|
var rowHeadings = details.Select(v => (object)v.Names.GetValue()).ToList();
|
||||||
cDetailedDataModel output = new cDetailedDataModel()
|
cDetailedDataModel output = new cDetailedDataModel()
|
||||||
{
|
{
|
||||||
Heading = StateDefinition.Names.GetValue(),
|
Heading = StateDefinition.Names.GetValue(),
|
||||||
FullDetailedData = new List<object>(),
|
FullDetailedData = new List<object>(),
|
||||||
HasColumnHeaders = _rowHeadings.Count > 1
|
HasColumnHeaders = _colCount > 1
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_rowHeadings.Count > 1)
|
if (rowHeadings.Count > 1)
|
||||||
output.FullDetailedData.Add(_rowHeadings);
|
output.FullDetailedData.Add(rowHeadings);
|
||||||
|
|
||||||
var _data = ValuedDetailsData.Values[0];
|
var _data = _valuedDetailsData.Values[0];
|
||||||
foreach (var _row in _data)
|
foreach (var _row in _data)
|
||||||
output.FullDetailedData.Add(new List<object>() { _row[0] });
|
{
|
||||||
|
var _rowValues = new List<object>();
|
||||||
|
for (int i = 0; i < _colCount; i++)
|
||||||
|
{
|
||||||
|
_rowValues.Add(_row[i]);
|
||||||
|
}
|
||||||
|
output.FullDetailedData.Add(_rowValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
var _json = Newtonsoft.Json.JsonConvert.SerializeObject(output);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@@ -307,7 +318,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
var valueProcessing = splitColumnName.Length > 1 ? splitColumnName[1] : null;
|
var valueProcessing = splitColumnName.Length > 1 ? splitColumnName[1] : null;
|
||||||
|
|
||||||
rawColumnIndexes.Add(rawColumnIndex);
|
rawColumnIndexes.Add(rawColumnIndex);
|
||||||
displayTypes.Add(cUtility.GetRawValueType(displayType));
|
displayTypes.Add(displayType);
|
||||||
valueProcessings.Add(valueProcessing);
|
valueProcessings.Add(valueProcessing);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +337,8 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
shouldHideRow = true;
|
shouldHideRow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
cUtility.RawValueFormatter.SetDefaultCulture(new CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
cUtility.RawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
foreach (var index in rawColumnIndexes)
|
foreach (var index in rawColumnIndexes)
|
||||||
{
|
{
|
||||||
@@ -366,6 +378,8 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
output.FullDetailedData.Add(displayValuesOfRow);
|
output.FullDetailedData.Add(displayValuesOfRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _json = Newtonsoft.Json.JsonConvert.SerializeObject(output);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
@@ -135,8 +136,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
StatusMonitor.QuickActionOutputs.Add(_ref.Output);
|
StatusMonitor.QuickActionOutputs.Add(_ref.Output);
|
||||||
quickActionOutput = QuickActionStatusMonitor.cQuickActionOutput.GetQuickActionOutput(_ref.Output, DataProvider);
|
quickActionOutput = QuickActionStatusMonitor.cQuickActionOutput.GetQuickActionOutput(_ref.Output, DataProvider);
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(quickActionDemo, DataProvider, true, quickActionOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(quickActionDemo, DataProvider, true, quickActionOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(quickActionDemo, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(quickActionDemo, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
|
|
||||||
_msg = cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.FinishedSuccessfull");
|
_msg = cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.FinishedSuccessfull");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Text;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
@@ -154,9 +155,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(LocalQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(LocalQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
|
|
||||||
string quickActionStatus;
|
string quickActionStatus;
|
||||||
switch (ResultRevision.Status)
|
switch (ResultRevision.Status)
|
||||||
@@ -193,8 +195,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(LocalQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(LocalQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
|
|
||||||
output = new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
output = new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
@@ -124,8 +125,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(LocalQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(LocalQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
|
|
||||||
return new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.FinishedSuccessfull"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
return new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.FinishedSuccessfull"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
||||||
}
|
}
|
||||||
@@ -141,8 +144,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = cF4SDCockpitXmlConfig.Instance.HealthCardConfig.ProtocollLanguage;
|
cMultiLanguageSupport.CurrentLanguage = cF4SDCockpitXmlConfig.Instance.HealthCardConfig.ProtocollLanguage;
|
||||||
|
|
||||||
protocollOutput = new cQuickActionOutputSingle(new cF4sdQuickActionRevision.cOutput() { ResultCode = enumQuickActionSuccess.error, ErrorDescription = cMultiLanguageSupport.GetItem("QuickAction.Copy.Output.Cancel") });
|
protocollOutput = new cQuickActionOutputSingle(new cF4sdQuickActionRevision.cOutput() { ResultCode = enumQuickActionSuccess.error, ErrorDescription = cMultiLanguageSupport.GetItem("QuickAction.Copy.Output.Cancel") });
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(LocalQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(LocalQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(LocalQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
|
|
||||||
return new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
return new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
HistoryEntry.isSeen = true;
|
HistoryEntry.isSeen = true;
|
||||||
dataProvider = await cSupportCaseDataProvider.GetDataProviderForAsync(RelationEntry.Relations, RelationEntry.SelectedRelation, relationService);
|
dataProvider = await cSupportCaseDataProvider.GetDataProviderForAsync(RelationEntry.SelectedRelation, relationService);
|
||||||
if (dataProvider is null)
|
if (dataProvider is null)
|
||||||
{
|
{
|
||||||
Debug.Assert(true, "Could not start a data provider for the selected criterias.");
|
Debug.Assert(true, "Could not start a data provider for the selected criterias.");
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
@@ -23,7 +24,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
|
|
||||||
public cUiProcessSearchRelationAction(cSearchHistorySearchResultEntry searchHistoryEntry, cF4sdApiSearchResultRelation selectedRelation, IRelationService relationService, ISearchUiProvider searchUiProvider)
|
public cUiProcessSearchRelationAction(cSearchHistorySearchResultEntry searchHistoryEntry, cF4sdApiSearchResultRelation selectedRelation, IRelationService relationService, ISearchUiProvider searchUiProvider)
|
||||||
{
|
{
|
||||||
Name = $"{searchHistoryEntry.HeaderText} → {selectedRelation.DisplayName}";
|
Name = !string.IsNullOrWhiteSpace(selectedRelation.DisplayName) ? $"{searchHistoryEntry.HeaderText} → {selectedRelation.DisplayName}" : searchHistoryEntry.HeaderText;
|
||||||
_selectedSearchResult = searchHistoryEntry.SelectedSearchResult;
|
_selectedSearchResult = searchHistoryEntry.SelectedSearchResult;
|
||||||
_relations = searchHistoryEntry.Relations;
|
_relations = searchHistoryEntry.Relations;
|
||||||
_selectedRelation = selectedRelation;
|
_selectedRelation = selectedRelation;
|
||||||
@@ -32,7 +33,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
_searchHistoryEntry = searchHistoryEntry;
|
_searchHistoryEntry = searchHistoryEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public cUiProcessSearchRelationAction(string name, List<cFasdApiSearchResultEntry> selectedSearchResult, List<cF4sdApiSearchResultRelation> relations, cF4sdApiSearchResultRelation selectedRelation, ISearchUiProvider searchUiProvider, cSearchHistoryEntryBase searchHistoryEntry)
|
public cUiProcessSearchRelationAction(string name, List<cFasdApiSearchResultEntry> selectedSearchResult, List<cF4sdApiSearchResultRelation> relations, cF4sdApiSearchResultRelation selectedRelation, ISearchUiProvider searchUiProvider, cSearchHistoryEntryBase searchHistoryEntry, IRelationService relationService)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
_selectedSearchResult = selectedSearchResult;
|
_selectedSearchResult = selectedSearchResult;
|
||||||
@@ -40,6 +41,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
_selectedRelation = selectedRelation;
|
_selectedRelation = selectedRelation;
|
||||||
_searchUiProvider = searchUiProvider;
|
_searchUiProvider = searchUiProvider;
|
||||||
_searchHistoryEntry = searchHistoryEntry;
|
_searchHistoryEntry = searchHistoryEntry;
|
||||||
|
_relationService = relationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
||||||
@@ -84,10 +86,15 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// set the new result menu properies for loading ....
|
// set the new result menu properies for loading ....
|
||||||
_seachHistoryEntry.isSeen = true;
|
_seachHistoryEntry.isSeen = true;
|
||||||
// get the new data provider for the support call informations (get it from the cache or create a new one)
|
// get the new data provider for the support call informations (get it from the cache or create a new one)
|
||||||
dataProvider = await cSupportCaseDataProvider.GetDataProviderForAsync(_relations, _selectedRelation, _relationService);
|
dataProvider = await cSupportCaseDataProvider.GetDataProviderForAsync(_selectedRelation, _relationService);
|
||||||
|
|
||||||
|
bool shouldLoadRelationsForSelectedRelation = _selectedRelation.Type == enumF4sdSearchResultClass.User;
|
||||||
|
if (shouldLoadRelationsForSelectedRelation)
|
||||||
|
StartLoadingRelationsFor(_selectedRelation);
|
||||||
|
|
||||||
if (dataProvider is null)
|
if (dataProvider is null)
|
||||||
{
|
{
|
||||||
@@ -106,5 +113,26 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StartLoadingRelationsFor(cF4sdApiSearchResultRelation selectedRelation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var relationsToReload = new List<cFasdApiSearchResultEntry>() { new cFasdApiSearchResultEntry()
|
||||||
|
{
|
||||||
|
DisplayName = selectedRelation.DisplayName,
|
||||||
|
id = selectedRelation.id,
|
||||||
|
Infos = selectedRelation.Infos,
|
||||||
|
Name = selectedRelation.Name,
|
||||||
|
Status = selectedRelation.Status,
|
||||||
|
Type = selectedRelation.Type
|
||||||
|
} };
|
||||||
|
_ = Task.Run(async () => _relationService.LoadRelationsAsync(relationsToReload), CancellationToken.None);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
private readonly List<cF4sdApiSearchResultRelation> _loadedRelations = new List<cF4sdApiSearchResultRelation>();
|
private readonly List<cF4sdApiSearchResultRelation> _loadedRelations = new List<cF4sdApiSearchResultRelation>();
|
||||||
private readonly TaskCompletionSource<bool> _isSearchUnambigous = new TaskCompletionSource<bool>();
|
private readonly TaskCompletionSource<bool> _isSearchUnambigous = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
|
private IRelationService _relationService = null;
|
||||||
|
|
||||||
public cF4sdApiSearchResultRelation PreSelectedSearchRelation { get; set; } = null;
|
public cF4sdApiSearchResultRelation PreSelectedSearchRelation { get; set; } = null;
|
||||||
|
|
||||||
public cUiProcessSearchResultAction(string name, ISearchUiProvider searchUiProvider, List<cFasdApiSearchResultEntry> searchResults)
|
public cUiProcessSearchResultAction(string name, ISearchUiProvider searchUiProvider, List<cFasdApiSearchResultEntry> searchResults)
|
||||||
@@ -115,10 +117,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
private async Task<bool> ProcessSearchResultRelationAsync(string name, List<cF4sdApiSearchResultRelation> caseRelations, cF4sdApiSearchResultRelation selectedRelation)
|
private async Task<bool> ProcessSearchResultRelationAsync(string name, List<cF4sdApiSearchResultRelation> caseRelations, cF4sdApiSearchResultRelation selectedRelation)
|
||||||
{
|
{
|
||||||
var relationSearchResult = new cSearchHistorySearchResultEntry(_searchResults.FirstOrDefault().DisplayName, _searchResults.FirstOrDefault().DisplayName, _searchResults, caseRelations, _searchUiProvider);
|
var relationSearchResult = new cSearchHistorySearchResultEntry(_searchResults.FirstOrDefault().DisplayName, _searchResults.FirstOrDefault().DisplayName, _searchResults, caseRelations, _searchUiProvider);
|
||||||
string displayName = selectedRelation != null ? $"{name} → {selectedRelation.Name}" : name;
|
string displayName = !string.IsNullOrWhiteSpace(selectedRelation?.Name) ? $"{name} → {selectedRelation.Name}" : name;
|
||||||
|
|
||||||
cUiProcessSearchRelationAction action
|
cUiProcessSearchRelationAction action
|
||||||
= new cUiProcessSearchRelationAction(displayName, _searchResults, caseRelations, caseRelations.FirstOrDefault(), _searchUiProvider, relationSearchResult)
|
= new cUiProcessSearchRelationAction(displayName, _searchResults, caseRelations, selectedRelation, _searchUiProvider, relationSearchResult, _relationService)
|
||||||
{
|
{
|
||||||
DisplayType = enumActionDisplayType.enabled,
|
DisplayType = enumActionDisplayType.enabled,
|
||||||
};
|
};
|
||||||
@@ -155,6 +157,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_loadedRelations.AddRange(e.StagedResultRelations.Relations);
|
_loadedRelations.AddRange(e.StagedResultRelations.Relations);
|
||||||
|
_relationService = e.RelationService;
|
||||||
|
|
||||||
if (!e.StagedResultRelations.IsComplete)
|
if (!e.StagedResultRelations.IsComplete)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
cUtility.RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
cUtility.RawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
shouldRunImmidiate = QuickActionConfig.RunImmediate;
|
shouldRunImmidiate = QuickActionConfig.RunImmediate;
|
||||||
Description = QuickActionConfig.Descriptions?.GetValue(Default: null);
|
Description = QuickActionConfig.Descriptions?.GetValue(Default: null);
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
_quickTip = quickTip;
|
_quickTip = quickTip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!(UiLocation is QuickTipStatusMonitor quickTipStatusMonitor))
|
if (!(UiLocation is QuickTipStatusMonitor quickTipStatusMonitor))
|
||||||
return Task.FromResult(false);
|
return false;
|
||||||
|
|
||||||
DataProvider = dataProvider;
|
DataProvider = dataProvider;
|
||||||
|
|
||||||
@@ -49,13 +49,13 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
|
|
||||||
quickTipStatusMonitor.Visibility = Visibility.Visible;
|
quickTipStatusMonitor.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
return Task.FromResult(true);
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
LogException(E);
|
LogException(E);
|
||||||
}
|
}
|
||||||
return Task.FromResult(false);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateElementData()
|
private void CreateElementData()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
@@ -137,9 +138,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cQuickActionStatusMonitorModel.cQuickActionStep.SetQuickActionStepStatuses(StatusMonitor.QuickActionData.ActionSteps, RemoteQuickAction.Name, enumActionStepType.running, status);
|
cQuickActionStatusMonitorModel.cQuickActionStep.SetQuickActionStepStatuses(StatusMonitor.QuickActionData.ActionSteps, RemoteQuickAction.Name, enumActionStepType.running, status);
|
||||||
cQuickActionStatusMonitorModel.cQuickActionStep.SetQuickActionStepStatuses(StatusMonitor.QuickActionData.ActionSteps, RemoteQuickAction.Name, enumActionStepType.main, status);
|
cQuickActionStatusMonitorModel.cQuickActionStep.SetQuickActionStepStatuses(StatusMonitor.QuickActionData.ActionSteps, RemoteQuickAction.Name, enumActionStepType.main, status);
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(RemoteQuickAction, DataProvider, true, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(RemoteQuickAction, DataProvider, true, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(RemoteQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(RemoteQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -155,8 +157,11 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(RemoteQuickAction, DataProvider, true, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(RemoteQuickAction, DataProvider, true, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(RemoteQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(RemoteQuickAction, copyData);
|
||||||
|
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
return new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
return new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +246,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
{
|
{
|
||||||
Id = measure.Id,
|
Id = measure.Id,
|
||||||
Names = measureDefinition.Names,
|
Names = measureDefinition.Names,
|
||||||
Display = cUtility.GetRawValueType(measureDefinition.Display),
|
Display = measureDefinition.Display,
|
||||||
Value = measure.Value,
|
Value = measure.Value,
|
||||||
PostValue = measure.PostValue
|
PostValue = measure.PostValue
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
using C4IT.Logging;
|
using C4IT.Logging;
|
||||||
@@ -170,8 +171,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(ServerQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(ServerQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(ServerQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(ServerQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
|
|
||||||
string quickActionStatus;
|
string quickActionStatus;
|
||||||
switch (ResultRevision.Status)
|
switch (ResultRevision.Status)
|
||||||
@@ -208,8 +211,10 @@ namespace FasdDesktopUi.Basics.UiActions
|
|||||||
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
cMultiLanguageSupport.CurrentLanguage = tempLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
cQuickActionCopyData copyData = QuickActionProtocollEntry.GetCopyData(ServerQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
cQuickActionCopyData copyData = QuickActionProtocollEntryOutput.GetCopyData(ServerQuickAction, DataProvider, false, protocollOutput, StatusMonitor.MeasureValues);
|
||||||
F4SDProtocoll.Instance.Add(new QuickActionProtocollEntry(ServerQuickAction, copyData));
|
QuickActionProtocollEntry protocollEntry = QuickActionProtocollEntryOutput.GetQuickActionProtocollEntry(ServerQuickAction, copyData);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
|
|
||||||
output = new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
output = new List<object>() { cMultiLanguageSupport.GetItem("QuickAction.Revision.Status.Canceled"), cUtility.RawValueFormatter.GetDisplayValue(DateTime.UtcNow, RawValueType.DATETIME) };
|
||||||
}
|
}
|
||||||
|
|||||||
41
FasdDesktopUi/Basics/UiActions/UiShowRawHealthcardValues.cs
Normal file
41
FasdDesktopUi/Basics/UiActions/UiShowRawHealthcardValues.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
using C4IT.Logging;
|
||||||
|
|
||||||
|
using FasdDesktopUi.Pages.RawHealthCardValuesPage;
|
||||||
|
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.UiActions
|
||||||
|
{
|
||||||
|
public class UiShowRawHealthcardValues : cUiActionBase
|
||||||
|
{
|
||||||
|
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
||||||
|
{
|
||||||
|
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var _rawValueWindow = new RawHealthCardValuesPage();
|
||||||
|
_rawValueWindow.Show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (CM != null) LogMethodEnd(CM);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
27
FasdDesktopUi/Basics/UserControls/Badge.xaml
Normal file
27
FasdDesktopUi/Basics/UserControls/Badge.xaml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<UserControl x:Class="FasdDesktopUi.Basics.UserControls.Badge"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="20"
|
||||||
|
d:DesignWidth="40"
|
||||||
|
x:Name="BadgeControl">
|
||||||
|
|
||||||
|
<Border Background="{DynamicResource Color.F4SD}"
|
||||||
|
CornerRadius="5">
|
||||||
|
|
||||||
|
<StackPanel HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Margin="7.5 2.5">
|
||||||
|
<TextBlock FontSize="12"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="White"
|
||||||
|
Text="{Binding ElementName=BadgeControl, Path=Text}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
</UserControl>
|
||||||
27
FasdDesktopUi/Basics/UserControls/Badge.xaml.cs
Normal file
27
FasdDesktopUi/Basics/UserControls/Badge.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using F4SD_AdaptableIcon;
|
||||||
|
using FasdDesktopUi.Basics.Helper;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Basics.UserControls
|
||||||
|
{
|
||||||
|
public partial class Badge : UserControl
|
||||||
|
{
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(TextProperty); }
|
||||||
|
set { SetValue(TextProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty TextProperty =
|
||||||
|
DependencyProperty.Register(nameof(Text), typeof(string), typeof(Badge), new PropertyMetadata("Beta"));
|
||||||
|
|
||||||
|
|
||||||
|
public Badge()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,12 +23,6 @@
|
|||||||
Visibility="{Binding ElementName=DataCanvasUc, Path=IsDetailedLayout, Converter={StaticResource BoolToVisibility}}"
|
Visibility="{Binding ElementName=DataCanvasUc, Path=IsDetailedLayout, Converter={StaticResource BoolToVisibility}}"
|
||||||
IsCloseButtonVisible="{Binding ElementName=DataCanvasUc, Path=DataCanvasData, Converter={StaticResource IsCloseButtonVisible}, ConverterParameter={x:Static converter:enumDataCanvasTypes.detailedData} }" />
|
IsCloseButtonVisible="{Binding ElementName=DataCanvasUc, Path=DataCanvasData, Converter={StaticResource IsCloseButtonVisible}, ConverterParameter={x:Static converter:enumDataCanvasTypes.detailedData} }" />
|
||||||
|
|
||||||
<local:DetailedChart x:Name="DetailedChartUc"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Width="385"
|
|
||||||
Visibility="{Binding ElementName=DataCanvasUc, Path=IsDetailedLayout, Converter={StaticResource BoolToVisibility}}"
|
|
||||||
IsCloseButtonVisible="{Binding ElementName=DataCanvasUc, Path=DataCanvasData, Converter={StaticResource IsCloseButtonVisible}, ConverterParameter={x:Static converter:enumDataCanvasTypes.detailedData} }" />
|
|
||||||
|
|
||||||
<local:DynamicChart x:Name="DynamicChartUc"
|
<local:DynamicChart x:Name="DynamicChartUc"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Width="385"
|
Width="385"
|
||||||
|
|||||||
@@ -72,20 +72,16 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
_me.DetailedDataUc.DetailedInformationData = _me.DataCanvasData.DetailedData;
|
_me.DetailedDataUc.DetailedInformationData = _me.DataCanvasData.DetailedData;
|
||||||
_me.DetailedDataUc.CloseButtonClickedAction = _me.CloseDataCanvas;
|
_me.DetailedDataUc.CloseButtonClickedAction = _me.CloseDataCanvas;
|
||||||
_me.DetailedChartUc.ChartData = null;
|
|
||||||
_me.DynamicChartUc.ChartData = null;
|
_me.DynamicChartUc.ChartData = null;
|
||||||
}
|
}
|
||||||
else if (_me.DataCanvasData.ChartData is null)
|
else if (_me.DataCanvasData.ChartData is null)
|
||||||
{
|
{
|
||||||
_me.DetailedChartUc.ChartData = _me.DataCanvasData.DetailedChartData;
|
|
||||||
_me.DynamicChartUc.ChartData = null;
|
_me.DynamicChartUc.ChartData = null;
|
||||||
_me.DetailedDataUc.DetailedInformationData = null;
|
_me.DetailedDataUc.DetailedInformationData = null;
|
||||||
_me.DetailedChartUc.CloseButtonClickedAction = _me.CloseDataCanvas;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_me.DynamicChartUc.ChartData = _me.DataCanvasData.ChartData;
|
_me.DynamicChartUc.ChartData = _me.DataCanvasData.ChartData;
|
||||||
_me.DetailedChartUc.ChartData = null;
|
|
||||||
_me.DetailedDataUc.DetailedInformationData = null;
|
_me.DetailedDataUc.DetailedInformationData = null;
|
||||||
_me.DynamicChartUc.CloseButtonClickedAction = _me.CloseDataCanvas;
|
_me.DynamicChartUc.CloseButtonClickedAction = _me.CloseDataCanvas;
|
||||||
}
|
}
|
||||||
@@ -169,7 +165,6 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
public DataCanvas()
|
public DataCanvas()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DetailedChartUc.Visibility = Visibility.Visible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataCanvas(bool drawInScrollViewer)
|
public DataCanvas(bool drawInScrollViewer)
|
||||||
@@ -186,6 +181,11 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async void HealthCardDataHelper_DataRefreshed(object sender, EventArgs e)
|
private async void HealthCardDataHelper_DataRefreshed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await UpdateDataAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal async Task UpdateDataAsync()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -215,7 +215,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
tempDataCanvasData.DetailedData = detailedData;
|
tempDataCanvasData.DetailedData = detailedData;
|
||||||
else if (chartData is null)
|
else if (chartData is null)
|
||||||
tempDataCanvasData.DetailedChartData = detailedChartData;
|
tempDataCanvasData.DetailedChartData = detailedChartData;
|
||||||
else
|
else
|
||||||
tempDataCanvasData.ChartData = chartData;
|
tempDataCanvasData.ChartData = chartData;
|
||||||
|
|
||||||
DataCanvasData = tempDataCanvasData;
|
DataCanvasData = tempDataCanvasData;
|
||||||
|
|||||||
@@ -555,21 +555,34 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SetValuesLineGraph()
|
public void SetValuesLineGraph()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
double oneDayMs = TimeSpan.FromDays(1).TotalMilliseconds;
|
||||||
|
double chartStartMs = 0;
|
||||||
|
double chartEndMs = oneDayMs;
|
||||||
|
|
||||||
foreach (var data in GraphicDataProperty)
|
foreach (var data in GraphicDataProperty)
|
||||||
{
|
{
|
||||||
DateTime dataTime = data.Time;
|
DateTime dataTime = data.Time;
|
||||||
double dataValue = data.Value;
|
double dataValue = data.Value;
|
||||||
int dataDuration = data.Duration;
|
int dataDuration = data.Duration;
|
||||||
|
|
||||||
double time = dataTime.TimeOfDay.TotalMilliseconds;
|
double startMs = dataTime.TimeOfDay.TotalMilliseconds;
|
||||||
|
double endMs = startMs + dataDuration;
|
||||||
|
|
||||||
double xLeft = xCoordinate.GetCoordinate(time);
|
if (startMs >= chartEndMs || endMs <= chartStartMs)
|
||||||
double xRight = xCoordinate.GetCoordinate(time + dataDuration);
|
continue;
|
||||||
|
|
||||||
|
if (startMs < chartStartMs)
|
||||||
|
startMs = chartStartMs;
|
||||||
|
|
||||||
|
if (endMs > chartEndMs)
|
||||||
|
endMs = chartEndMs;
|
||||||
|
|
||||||
|
double xLeft = xCoordinate.GetCoordinate(startMs);
|
||||||
|
double xRight = xCoordinate.GetCoordinate(endMs);
|
||||||
|
|
||||||
double y = 0;
|
double y = 0;
|
||||||
|
|
||||||
@@ -585,19 +598,19 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
y = yCoordinate.GetCoordinate(dataValue);
|
y = yCoordinate.GetCoordinate(dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Border border = new Border()
|
Border border = new Border()
|
||||||
{
|
{
|
||||||
Height = 6.0,
|
Height = 6.0,
|
||||||
Width = xRight - xLeft,
|
Width = xRight - xLeft,
|
||||||
CornerRadius = new CornerRadius(4.0),
|
CornerRadius = new CornerRadius(4.0),
|
||||||
ToolTip = dataTime.ToShortTimeString() + " - " + dataTime.AddMilliseconds(dataDuration).ToShortTimeString() + " | " + dataValue,
|
ToolTip = dataTime.ToShortTimeString() + " - " + dataTime.AddMilliseconds(dataDuration).ToShortTimeString() + " | " + dataValue,
|
||||||
};
|
};
|
||||||
if (border.Width < 6)
|
if (border.Width < 6)
|
||||||
{
|
{
|
||||||
border.Width = 6;
|
border.Width = 6;
|
||||||
}
|
}
|
||||||
if (ChartData.IsThresholdActive == false)
|
if (ChartData.IsThresholdActive == false)
|
||||||
{
|
{
|
||||||
border.Background = new SolidColorBrush(Color.FromRgb(0, 157, 221));
|
border.Background = new SolidColorBrush(Color.FromRgb(0, 157, 221));
|
||||||
@@ -652,16 +665,30 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
double oneDayMs = TimeSpan.FromDays(1).TotalMilliseconds;
|
||||||
|
double chartStartMs = 0;
|
||||||
|
double chartEndMs = oneDayMs;
|
||||||
|
|
||||||
foreach (var data in GraphicDataProperty)
|
foreach (var data in GraphicDataProperty)
|
||||||
{
|
{
|
||||||
DateTime dataTime = data.Time;
|
DateTime dataTime = data.Time;
|
||||||
double dataValue = data.Value;
|
double dataValue = data.Value;
|
||||||
int dataDuration = data.Duration;
|
int dataDuration = data.Duration;
|
||||||
|
|
||||||
double time = dataTime.TimeOfDay.TotalMilliseconds;
|
double startMs = dataTime.TimeOfDay.TotalMilliseconds;
|
||||||
|
double endMs = startMs + dataDuration;
|
||||||
|
|
||||||
double xLeft = xCoordinate.GetCoordinate(time);
|
if (startMs >= chartEndMs || endMs <= chartStartMs)
|
||||||
double xRight = xCoordinate.GetCoordinate(time + dataDuration);
|
continue;
|
||||||
|
|
||||||
|
if (startMs < chartStartMs)
|
||||||
|
startMs = chartStartMs;
|
||||||
|
|
||||||
|
if (endMs > chartEndMs)
|
||||||
|
endMs = chartEndMs;
|
||||||
|
|
||||||
|
double xLeft = xCoordinate.GetCoordinate(startMs);
|
||||||
|
double xRight = xCoordinate.GetCoordinate(endMs);
|
||||||
|
|
||||||
double y = 0;
|
double y = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using C4IT.F4SD.DisplayFormatting;
|
using C4IT.F4SD.DisplayFormatting;
|
||||||
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
using C4IT.FASD.Base;
|
using C4IT.FASD.Base;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
using F4SD_AdaptableIcon.Enums;
|
using F4SD_AdaptableIcon.Enums;
|
||||||
@@ -38,6 +39,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
public cQuickActionOutput(cF4sdQuickActionRevision.cOutput scriptOutput)
|
public cQuickActionOutput(cF4sdQuickActionRevision.cOutput scriptOutput)
|
||||||
{
|
{
|
||||||
_rawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
_rawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
_rawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
ErrorCode = scriptOutput.ErrorCode;
|
ErrorCode = scriptOutput.ErrorCode;
|
||||||
ErrorDescription = scriptOutput.ErrorDescription;
|
ErrorDescription = scriptOutput.ErrorDescription;
|
||||||
ResultCode = scriptOutput.ResultCode.GetValueOrDefault();
|
ResultCode = scriptOutput.ResultCode.GetValueOrDefault();
|
||||||
@@ -246,7 +248,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
return veiledText;
|
return veiledText;
|
||||||
|
|
||||||
if (outputFormatting.DisplayType != null)
|
if (outputFormatting.DisplayType != null)
|
||||||
output = _rawValueFormatter.GetDisplayValue(Value, cUtility.GetRawValueType(outputFormatting.DisplayType.Value));
|
output = _rawValueFormatter.GetDisplayValue(Value, outputFormatting.DisplayType.Value);
|
||||||
|
|
||||||
if (outputFormatting.Translation != null)
|
if (outputFormatting.Translation != null)
|
||||||
{
|
{
|
||||||
@@ -372,7 +374,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
return veiledText;
|
return veiledText;
|
||||||
|
|
||||||
if (outputFormatting.DisplayType != null)
|
if (outputFormatting.DisplayType != null)
|
||||||
output = _rawValueFormatter.GetDisplayValue(selectedItem.Value, cUtility.GetRawValueType(outputFormatting.DisplayType.Value));
|
output = _rawValueFormatter.GetDisplayValue(selectedItem.Value, outputFormatting.DisplayType.Value);
|
||||||
|
|
||||||
if (outputFormatting.Translation != null)
|
if (outputFormatting.Translation != null)
|
||||||
{
|
{
|
||||||
@@ -464,7 +466,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
return veiledText;
|
return veiledText;
|
||||||
|
|
||||||
if (outputFormatting.DisplayType != null)
|
if (outputFormatting.DisplayType != null)
|
||||||
output = _rawValueFormatter.GetDisplayValue(Values[row][column].Value, cUtility.GetRawValueType(outputFormatting.DisplayType.Value));
|
output = _rawValueFormatter.GetDisplayValue(Values[row][column].Value, outputFormatting.DisplayType.Value);
|
||||||
|
|
||||||
if (outputFormatting.Translation != null)
|
if (outputFormatting.Translation != null)
|
||||||
{
|
{
|
||||||
@@ -803,6 +805,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_rawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
_rawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
|
_rawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
for (int i = 0; i < measureValues.Count; i++)
|
for (int i = 0; i < measureValues.Count; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
<UserControl x:Class="FasdDesktopUi.Basics.UserControls.QuickTip.QuickTipStatusMonitor"
|
<UserControl x:Class="FasdDesktopUi.Basics.UserControls.QuickTip.QuickTipStatusMonitor"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:uc="clr-namespace:FasdDesktopUi.Basics.UserControls"
|
||||||
xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls.QuickTip"
|
xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls.QuickTip"
|
||||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
xmlns:icod="clr-namespace:F4SD_AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||||
xmlns:converter="clr-namespace:FasdDesktopUi.Basics.Converter"
|
xmlns:converter="clr-namespace:FasdDesktopUi.Basics.Converter"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="400"
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="400"
|
||||||
MinWidth="400"
|
MinWidth="400"
|
||||||
MinHeight="200"
|
MinHeight="200"
|
||||||
IsVisibleChanged="QuickTipStatusMonitorUc_IsVisibleChanged"
|
IsVisibleChanged="QuickTipStatusMonitorUc_IsVisibleChanged"
|
||||||
@@ -16,116 +19,122 @@
|
|||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<converter:LanguageDefinitionsConverter x:Key="LanguageConverter" />
|
<converter:LanguageDefinitionsConverter x:Key="LanguageConverter" />
|
||||||
<Style x:Key="BorderButtonWithText" TargetType="Border">
|
<Style x:Key="BorderButtonWithText"
|
||||||
<Setter Property="CornerRadius" Value="5"/>
|
TargetType="Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource Color.AppBackground}"/>
|
<Setter Property="CornerRadius"
|
||||||
<Setter Property="Height" Value="35"/>
|
Value="5" />
|
||||||
<EventSetter Event="MouseEnter" Handler="ButtonBorder_MouseEnter"/>
|
<Setter Property="Background"
|
||||||
<EventSetter Event="MouseLeave" Handler="ButtonBorder_MouseLeave"/>
|
Value="{DynamicResource Color.AppBackground}" />
|
||||||
|
<Setter Property="Height"
|
||||||
|
Value="35" />
|
||||||
|
<EventSetter Event="MouseEnter"
|
||||||
|
Handler="ButtonBorder_MouseEnter" />
|
||||||
|
<EventSetter Event="MouseLeave"
|
||||||
|
Handler="ButtonBorder_MouseLeave" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver"
|
||||||
<Setter Property="Background" Value="{DynamicResource BackgroundColor.Menu.MainCategory}"/>
|
Value="True">
|
||||||
|
<Setter Property="Background"
|
||||||
|
Value="{DynamicResource BackgroundColor.Menu.MainCategory}" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Border CornerRadius="10"
|
<Grid>
|
||||||
Padding="10"
|
<uc:Badge Panel.ZIndex="999"
|
||||||
Margin="0 0 0 10"
|
HorizontalAlignment="Right"
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
VerticalAlignment="Top"
|
||||||
VerticalAlignment="Top">
|
Margin="10" />
|
||||||
|
|
||||||
<DockPanel>
|
<Border CornerRadius="10"
|
||||||
<DockPanel LastChildFill="False" DockPanel.Dock="Top">
|
Padding="10"
|
||||||
|
Margin="0 0 0 10"
|
||||||
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
|
VerticalAlignment="Top">
|
||||||
|
|
||||||
<ico:AdaptableIcon
|
<DockPanel>
|
||||||
x:Name="HeadingIcon"
|
<DockPanel LastChildFill="False"
|
||||||
DockPanel.Dock="Left"
|
DockPanel.Dock="Top">
|
||||||
Style="{DynamicResource Menu.MenuBar.PinnedIcon.Base}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Margin="7.5 0 0 0"
|
|
||||||
BorderPadding="0"
|
|
||||||
IconHeight="15"
|
|
||||||
IconWidth="15"
|
|
||||||
SelectedInternIcon="{Binding QuickTipIcon.Intern, ElementName=QuickTipStatusMonitorUc}"
|
|
||||||
SelectedMaterialIcon="{Binding QuickTipIcon.Material, ElementName=QuickTipStatusMonitorUc}"/>
|
|
||||||
|
|
||||||
<TextBlock
|
<ico:AdaptableIcon x:Name="HeadingIcon"
|
||||||
x:Name="HeadingText"
|
DockPanel.Dock="Left"
|
||||||
Text="{Binding QuickTipName, ElementName=QuickTipStatusMonitorUc}"
|
Style="{DynamicResource Menu.MenuBar.PinnedIcon.Base}"
|
||||||
DockPanel.Dock="Left"
|
VerticalAlignment="Center"
|
||||||
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
Margin="7.5 0 0 0"
|
||||||
VerticalAlignment="Center"
|
BorderPadding="0"
|
||||||
HorizontalAlignment="Left"
|
IconHeight="15"
|
||||||
Margin="10" />
|
IconWidth="15"
|
||||||
|
SelectedInternIcon="{Binding QuickTipIcon.Intern, ElementName=QuickTipStatusMonitorUc}"
|
||||||
|
SelectedMaterialIcon="{Binding QuickTipIcon.Material, ElementName=QuickTipStatusMonitorUc}" />
|
||||||
|
|
||||||
|
<TextBlock x:Name="HeadingText"
|
||||||
|
Text="{Binding QuickTipName, ElementName=QuickTipStatusMonitorUc}"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Margin="10" />
|
||||||
|
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
|
<Grid Margin="0,5,0,0"
|
||||||
|
DockPanel.Dock="Bottom">
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="1.5*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="1.5*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Border x:Name="CompleteButton"
|
||||||
|
Grid.Column="1"
|
||||||
|
Style="{DynamicResource BorderButtonWithText}"
|
||||||
|
MouseLeftButtonUp="CompleteButton_Click"
|
||||||
|
TouchDown="CompleteButton_Click">
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickTips.Complete}"
|
||||||
|
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border x:Name="CancelButton"
|
||||||
|
Grid.Column="3"
|
||||||
|
Style="{DynamicResource BorderButtonWithText}"
|
||||||
|
MouseLeftButtonUp="CancelButton_Click"
|
||||||
|
TouchDown="CancelButton_Click">
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickTips.Cancel}"
|
||||||
|
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<TextBlock x:Name="StepCountTextBlock"
|
||||||
|
TextAlignment="Center"
|
||||||
|
Text="0 von 0 Schritten abgeschlossen"
|
||||||
|
Foreground="{DynamicResource FontColor.DetailsPage.DataHistory.Value}"
|
||||||
|
DockPanel.Dock="Bottom" />
|
||||||
|
|
||||||
|
<ScrollViewer x:Name="QuickTipElementViewer"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
DockPanel.Dock="Top">
|
||||||
|
<StackPanel x:Name="QuickTipElementPanel">
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
<Grid Margin="0,5,0,0" DockPanel.Dock="Bottom">
|
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="1.5*"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="1.5*"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<Border
|
|
||||||
x:Name="CompleteButton"
|
|
||||||
Grid.Column="1"
|
|
||||||
Style="{DynamicResource BorderButtonWithText}"
|
|
||||||
MouseLeftButtonUp="CompleteButton_Click"
|
|
||||||
TouchDown="CompleteButton_Click">
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickTips.Complete}"
|
|
||||||
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center"/>
|
|
||||||
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<Border
|
|
||||||
x:Name="CancelButton"
|
|
||||||
Grid.Column="3"
|
|
||||||
Style="{DynamicResource BorderButtonWithText}"
|
|
||||||
MouseLeftButtonUp="CancelButton_Click"
|
|
||||||
TouchDown="CancelButton_Click">
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickTips.Cancel}"
|
|
||||||
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center"/>
|
|
||||||
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
x:Name="StepCountTextBlock"
|
|
||||||
TextAlignment="Center"
|
|
||||||
Text="0 von 0 Schritten abgeschlossen"
|
|
||||||
Foreground="{DynamicResource FontColor.DetailsPage.DataHistory.Value}"
|
|
||||||
DockPanel.Dock="Bottom"/>
|
|
||||||
|
|
||||||
<ScrollViewer
|
|
||||||
x:Name="QuickTipElementViewer"
|
|
||||||
VerticalScrollBarVisibility="Auto"
|
|
||||||
DockPanel.Dock="Top">
|
|
||||||
<StackPanel
|
|
||||||
x:Name="QuickTipElementPanel">
|
|
||||||
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</ScrollViewer>
|
|
||||||
|
|
||||||
</DockPanel>
|
|
||||||
|
|
||||||
</Border>
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using C4IT.FASD.Base;
|
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||||
|
using C4IT.FASD.Base;
|
||||||
using C4IT.MultiLanguage;
|
using C4IT.MultiLanguage;
|
||||||
using F4SD_AdaptableIcon;
|
using F4SD_AdaptableIcon;
|
||||||
using F4SD_AdaptableIcon.Enums;
|
using F4SD_AdaptableIcon.Enums;
|
||||||
@@ -254,7 +255,9 @@ namespace FasdDesktopUi.Basics.UserControls.QuickTip
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool wasSuccessfull = step.SuccessState == enumQuickActionSuccess.finished || step.SuccessState == enumQuickActionSuccess.successfull;
|
bool wasSuccessfull = step.SuccessState == enumQuickActionSuccess.finished || step.SuccessState == enumQuickActionSuccess.successfull;
|
||||||
F4SDProtocoll.Instance.Add(new QuickTipStepProtocollEntry(step.StepData.QuickTipElementDefinition, wasSuccessfull));
|
ProtocollEntryBase protocollEntry = QuickTipStepProtocollEntryOutput.GetQuickTipStepProtocollEntry(step.StepData.QuickTipElementDefinition, wasSuccessfull);
|
||||||
|
|
||||||
|
F4SDProtocoll.Instance.Add(protocollEntry);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}
|
}
|
||||||
SearchTextBox.Text = search;
|
SearchTextBox.Text = search;
|
||||||
|
|
||||||
await ChangedSearchValue.Invoke(_result);
|
await ChangedSearchValue?.Invoke(_result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1911,7 +1911,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
ResponsibleRole = selectedRole,
|
ResponsibleRole = selectedRole,
|
||||||
ResponsiblePerson = selectedPerson,
|
ResponsiblePerson = selectedPerson,
|
||||||
Comment = comment,
|
Comment = comment,
|
||||||
QuickActionHistory = TransferQuickActionHistoryCheck.IsChecked ?? false ? F4SDProtocoll.Instance.GetOfType<QuickActionProtocollEntry>().Select(e => e.GetResult()).ToList() : null,
|
SupportCaseProtocollEntries = TransferQuickActionHistoryCheck.IsChecked ?? false ? F4SDProtocoll.Instance.GetAll().ToList() : null,
|
||||||
workTimes = workingTimes,
|
workTimes = workingTimes,
|
||||||
StatusIdValue = statusIdValue,
|
StatusIdValue = statusIdValue,
|
||||||
CaseId = DataProvider.CaseId
|
CaseId = DataProvider.CaseId
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using System.Windows.Threading;
|
|||||||
|
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
using FasdDesktopUi.Basics.Models;
|
using FasdDesktopUi.Basics.Models;
|
||||||
|
using FasdDesktopUi.Basics.Services;
|
||||||
using FasdDesktopUi.Basics.Services.Models;
|
using FasdDesktopUi.Basics.Services.Models;
|
||||||
using FasdDesktopUi.Pages.SearchPage;
|
using FasdDesktopUi.Pages.SearchPage;
|
||||||
namespace FasdDesktopUi.Basics.UserControls
|
namespace FasdDesktopUi.Basics.UserControls
|
||||||
@@ -217,36 +218,33 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
|
|
||||||
private async Task RefreshCountsAsync(bool useRoleTickets)
|
private async Task RefreshCountsAsync(bool useRoleTickets)
|
||||||
{
|
{
|
||||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
Dictionary<string, int> counts = null;
|
||||||
|
var service = TicketOverviewUpdateService.Instance;
|
||||||
|
|
||||||
var counts = CategorySetters.ToDictionary(item => item.Key, _ => 0);
|
if (service != null)
|
||||||
|
|
||||||
if (communication != null)
|
|
||||||
{
|
{
|
||||||
var tasks = CategorySetters.ToDictionary(
|
try
|
||||||
item => item.Key,
|
|
||||||
item => communication.GetTicketOverviewRelations(item.Key, useRoleTickets, 0));
|
|
||||||
|
|
||||||
foreach (var kvp in tasks)
|
|
||||||
{
|
{
|
||||||
try
|
var scope = useRoleTickets ? TileScope.Role : TileScope.Personal;
|
||||||
{
|
await service.FetchAsync(scope).ConfigureAwait(false);
|
||||||
var relations = await kvp.Value.ConfigureAwait(false);
|
counts = service.GetCountsForScope(useRoleTickets);
|
||||||
counts[kvp.Key] = relations?.Count ?? 0;
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
catch (Exception ex)
|
{
|
||||||
{
|
Debug.WriteLine($"[TicketOverview] Service refresh failed: {ex}");
|
||||||
Debug.WriteLine($"[TicketOverview] Failed to load count for '{kvp.Key}': {ex}");
|
counts = null;
|
||||||
counts[kvp.Key] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (counts == null || counts.Count == 0)
|
||||||
|
counts = await LoadCountsFallbackAsync(useRoleTickets).ConfigureAwait(false);
|
||||||
|
|
||||||
await Dispatcher.InvokeAsync(() =>
|
await Dispatcher.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
foreach (var (key, setter) in CategorySetters)
|
foreach (var (key, setter) in CategorySetters)
|
||||||
{
|
{
|
||||||
setter(_viewModel, counts[key]);
|
counts.TryGetValue(key, out var value);
|
||||||
|
setter(_viewModel, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
_viewModel.ResetSelection();
|
_viewModel.ResetSelection();
|
||||||
@@ -255,6 +253,34 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}, DispatcherPriority.Background);
|
}, DispatcherPriority.Background);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<Dictionary<string, int>> LoadCountsFallbackAsync(bool useRoleTickets)
|
||||||
|
{
|
||||||
|
var counts = CategorySetters.ToDictionary(item => item.Key, _ => 0);
|
||||||
|
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||||
|
if (communication == null)
|
||||||
|
return counts;
|
||||||
|
|
||||||
|
var tasks = CategorySetters.ToDictionary(
|
||||||
|
item => item.Key,
|
||||||
|
item => communication.GetTicketOverviewRelations(item.Key, useRoleTickets, 0));
|
||||||
|
|
||||||
|
foreach (var kvp in tasks)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var relations = await kvp.Value.ConfigureAwait(false);
|
||||||
|
counts[kvp.Key] = relations?.Count ?? 0;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"[TicketOverview] Fallback load failed for '{kvp.Key}': {ex}");
|
||||||
|
counts[kvp.Key] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return counts;
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateCounts(IDictionary<string, int> counts, bool useRoleTickets)
|
public void UpdateCounts(IDictionary<string, int> counts, bool useRoleTickets)
|
||||||
{
|
{
|
||||||
if (counts == null)
|
if (counts == null)
|
||||||
@@ -272,6 +298,16 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}, DispatcherPriority.Background);
|
}, DispatcherPriority.Background);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearHighlightsForScope(TileScope scope)
|
||||||
|
{
|
||||||
|
var highlightStates = scope == TileScope.Role ? _roleHighlightStates : _personalHighlightStates;
|
||||||
|
if (highlightStates.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
highlightStates.Clear();
|
||||||
|
UpdateHighlightState(scope == TileScope.Role);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetHighlights(IEnumerable<TileCountChange> changes, bool useRoleTickets)
|
public void SetHighlights(IEnumerable<TileCountChange> changes, bool useRoleTickets)
|
||||||
{
|
{
|
||||||
if (changes != null)
|
if (changes != null)
|
||||||
|
|||||||
@@ -26,55 +26,6 @@ namespace FasdDesktopUi.Basics
|
|||||||
{
|
{
|
||||||
public static readonly IRawValueFormatter RawValueFormatter = new RawValueFormatter();
|
public static readonly IRawValueFormatter RawValueFormatter = new RawValueFormatter();
|
||||||
|
|
||||||
internal static RawValueType GetRawValueType(enumHealthCardDisplayTypes displayType)
|
|
||||||
{
|
|
||||||
switch (displayType)
|
|
||||||
{
|
|
||||||
case enumHealthCardDisplayTypes.STRING:
|
|
||||||
return RawValueType.STRING;
|
|
||||||
case enumHealthCardDisplayTypes.INTEGER:
|
|
||||||
return RawValueType.INTEGER;
|
|
||||||
case enumHealthCardDisplayTypes.PERCENT:
|
|
||||||
return RawValueType.PERCENT;
|
|
||||||
case enumHealthCardDisplayTypes.PERCENT100:
|
|
||||||
return RawValueType.PERCENT100;
|
|
||||||
case enumHealthCardDisplayTypes.PERCENT1000:
|
|
||||||
return RawValueType.PERCENT1000;
|
|
||||||
case enumHealthCardDisplayTypes.TIME:
|
|
||||||
return RawValueType.TIME;
|
|
||||||
case enumHealthCardDisplayTypes.DATE:
|
|
||||||
return RawValueType.DATE;
|
|
||||||
case enumHealthCardDisplayTypes.DATE_CALC:
|
|
||||||
return RawValueType.DATE_CALC;
|
|
||||||
case enumHealthCardDisplayTypes.DATETIME:
|
|
||||||
return RawValueType.DATETIME;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_DAY:
|
|
||||||
return RawValueType.DURATION_DAY;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_HOUR:
|
|
||||||
return RawValueType.DURATION_HOUR;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_MINUTE:
|
|
||||||
return RawValueType.DURATION_MINUTE;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_SECOND:
|
|
||||||
return RawValueType.DURATION_SECOND;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_MILLI:
|
|
||||||
return RawValueType.DURATION_MILLI;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_MICRO:
|
|
||||||
return RawValueType.DURATION_MICRO;
|
|
||||||
case enumHealthCardDisplayTypes.DURATION_DAY_SINCE_NOW:
|
|
||||||
return RawValueType.DURATION_DAY_SINCE_NOW;
|
|
||||||
case enumHealthCardDisplayTypes.BITS_PERSECOND:
|
|
||||||
return RawValueType.BITS_PERSECOND;
|
|
||||||
case enumHealthCardDisplayTypes.BYTES:
|
|
||||||
return RawValueType.BYTES;
|
|
||||||
case enumHealthCardDisplayTypes.HERTZ:
|
|
||||||
return RawValueType.HERTZ;
|
|
||||||
case enumHealthCardDisplayTypes.MEGA_HERTZ:
|
|
||||||
return RawValueType.MEGA_HERTZ;
|
|
||||||
default:
|
|
||||||
return RawValueType.STRING;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int SmoothedInt(int oldValue, int newValue)
|
public static int SmoothedInt(int oldValue, int newValue)
|
||||||
{
|
{
|
||||||
if (oldValue < newValue)
|
if (oldValue < newValue)
|
||||||
@@ -410,24 +361,25 @@ namespace FasdDesktopUi.Basics
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FormattingOptions options = new FormattingOptions() { ReferenceDate = DateTime.UtcNow.AddDays(_v.ReferenceDays) };
|
FormattingOptions options = new FormattingOptions() { ReferenceDate = DateTime.UtcNow.AddDays(_v.ReferenceDays), TimeZone = TimeZoneInfo.Local };
|
||||||
|
|
||||||
RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
RawValueFormatter.SetDefaultCulture(new System.Globalization.CultureInfo(cFasdCockpitConfig.Instance.SelectedLanguage));
|
||||||
var _strVal = RawValueFormatter.GetDisplayValue(_v.Value, GetRawValueType(_v.StateDefinition.DisplayType), options);
|
RawValueFormatter.SetDefaultTimeZone(TimeZoneInfo.Local);
|
||||||
|
|
||||||
|
var _strVal = RawValueFormatter.GetDisplayValue(_v.Value, _v.StateDefinition.DisplayType, options);
|
||||||
_t.rawValue.Text = _strVal;
|
_t.rawValue.Text = _strVal;
|
||||||
|
|
||||||
if (_v.StateDefinition is cHealthCardStateLevel _sl)
|
if (_v.StateDefinition is cHealthCardStateLevel _sl)
|
||||||
{
|
{
|
||||||
_strVal = RawValueFormatter.GetDisplayValue(_sl.Warning, GetRawValueType(_v.StateDefinition.DisplayType), options);
|
_strVal = RawValueFormatter.GetDisplayValue(_sl.Warning, _v.StateDefinition.DisplayType, options);
|
||||||
_t.tresholdWarning.Text = _strVal;
|
_t.tresholdWarning.Text = _strVal;
|
||||||
_strVal = RawValueFormatter.GetDisplayValue(_sl.Error, GetRawValueType(_v.StateDefinition.DisplayType), options);
|
_strVal = RawValueFormatter.GetDisplayValue(_sl.Error, _v.StateDefinition.DisplayType, options);
|
||||||
_t.tresholdError.Text = _strVal;
|
_t.tresholdError.Text = _strVal;
|
||||||
}
|
}
|
||||||
else if (_v.StateDefinition is cHealthCardStateVersion _sv)
|
else if (_v.StateDefinition is cHealthCardStateVersion _sv)
|
||||||
{
|
{
|
||||||
_strVal = RawValueFormatter.GetDisplayValue(_sv.Warning, GetRawValueType(_v.StateDefinition.DisplayType), options);
|
_strVal = RawValueFormatter.GetDisplayValue(_sv.Warning, _v.StateDefinition.DisplayType, options);
|
||||||
_t.tresholdWarning.Text = _strVal;
|
_t.tresholdWarning.Text = _strVal;
|
||||||
_strVal = RawValueFormatter.GetDisplayValue(_sv.Error, GetRawValueType(_v.StateDefinition.DisplayType), options);
|
_strVal = RawValueFormatter.GetDisplayValue(_sv.Error, _v.StateDefinition.DisplayType, options);
|
||||||
_t.tresholdError.Text = _strVal;
|
_t.tresholdError.Text = _strVal;
|
||||||
}
|
}
|
||||||
else if (_v.StateDefinition is cHealthCardStateDateTime _sd)
|
else if (_v.StateDefinition is cHealthCardStateDateTime _sd)
|
||||||
|
|||||||
@@ -71,6 +71,11 @@
|
|||||||
<Language Lang="DE">Als angedocktes Fenster anzeigen</Language>
|
<Language Lang="DE">Als angedocktes Fenster anzeigen</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
|
<UIItem Name="Global.NavBar.ShowRawValues">
|
||||||
|
<Language Lang="EN">Show raw values of healthcard</Language>
|
||||||
|
<Language Lang="DE">Rohwerte der Healthcard anzeigen</Language>
|
||||||
|
</UIItem>
|
||||||
|
|
||||||
<UIItem Name="Global.Time.Suffix">
|
<UIItem Name="Global.Time.Suffix">
|
||||||
<Language Lang="EN"></Language>
|
<Language Lang="EN"></Language>
|
||||||
<Language Lang="DE"> Uhr</Language>
|
<Language Lang="DE"> Uhr</Language>
|
||||||
@@ -96,7 +101,35 @@
|
|||||||
<Language Lang="DE">Nicht erneut anzeigen</Language>
|
<Language Lang="DE">Nicht erneut anzeigen</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.Unknown">
|
||||||
|
<Language Lang="EN">All</Language>
|
||||||
|
<Language Lang="DE">Alle</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.Main">
|
||||||
|
<Language Lang="EN">Main Information</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.F4sdAgent">
|
||||||
|
<Language Lang="EN">F4SD Agent</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.NexthinkNxql">
|
||||||
|
<Language Lang="EN">Nexthink NXQL</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.ActiveDirectory">
|
||||||
|
<Language Lang="EN">Active Directory</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.AzureAD">
|
||||||
|
<Language Lang="EN">Azure AD</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.M42Wpm">
|
||||||
|
<Language Lang="EN">Matrix42 WPM</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.Intune">
|
||||||
|
<Language Lang="EN">MS Intune</Language>
|
||||||
|
</UIItem>
|
||||||
|
<UIItem Name="Global.Enumeration.DataHistoryOrigin.Citrix">
|
||||||
|
<Language Lang="EN">Citrix</Language>
|
||||||
|
</UIItem>
|
||||||
|
|
||||||
<UIItem Name="App.Startup.SecurityInitFailed.Text">
|
<UIItem Name="App.Startup.SecurityInitFailed.Text">
|
||||||
<Language Lang="EN">The RSA encryption could not be initialised correctly. The cockpit will be closed.</Language>
|
<Language Lang="EN">The RSA encryption could not be initialised correctly. The cockpit will be closed.</Language>
|
||||||
<Language Lang="DE">Die RSA Verschlüsselung konnte nicht korrekt initialisiert werden. Das Cockpit wird beendet.</Language>
|
<Language Lang="DE">Die RSA Verschlüsselung konnte nicht korrekt initialisiert werden. Das Cockpit wird beendet.</Language>
|
||||||
@@ -1355,10 +1388,10 @@
|
|||||||
<Language Lang="DE">Kategorie</Language>
|
<Language Lang="DE">Kategorie</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
<UIItem Name="Dialog.CloseCase.Save">
|
<UIItem Name="Dialog.CloseCase.Save">
|
||||||
<Language Lang="EN">Save</Language>
|
<Language Lang="EN">Save</Language>
|
||||||
<Language Lang="DE">Speichern</Language>
|
<Language Lang="DE">Speichern</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
<UIItem Name="Dialog.CloseCase.Abort">
|
<UIItem Name="Dialog.CloseCase.Abort">
|
||||||
<Language Lang="EN">Cancel</Language>
|
<Language Lang="EN">Cancel</Language>
|
||||||
@@ -1578,21 +1611,21 @@
|
|||||||
<Language Lang="DE">Fehler: </Language>
|
<Language Lang="DE">Fehler: </Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
<UIItem Name="Dialog.CloseCase.ValidationErrorSummaryEmpty">
|
<UIItem Name="Dialog.CloseCase.ValidationErrorSummaryEmpty">
|
||||||
<Language Lang="EN">Fill summary</Language>
|
<Language Lang="EN">Fill summary</Language>
|
||||||
<Language Lang="DE">Zusammenfassung angeben</Language>
|
<Language Lang="DE">Zusammenfassung angeben</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
<UIItem Name="Dialog.CloseCase.ValidationErrorCategoryEmpty">
|
<UIItem Name="Dialog.CloseCase.ValidationErrorCategoryEmpty">
|
||||||
<Language Lang="EN">Select a category</Language>
|
<Language Lang="EN">Select a category</Language>
|
||||||
<Language Lang="DE">Kategorie auswählen</Language>
|
<Language Lang="DE">Kategorie auswählen</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
<UIItem Name="Dialog.CloseCase.ValidationErrorQuickCallEmpty">
|
<UIItem Name="Dialog.CloseCase.ValidationErrorQuickCallEmpty">
|
||||||
<Language Lang="EN">Select a quickcall template</Language>
|
<Language Lang="EN">Select a quickcall template</Language>
|
||||||
<Language Lang="DE">Quickcall auswählen</Language>
|
<Language Lang="DE">Quickcall auswählen</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
<UIItem Name="Dialog.CloseCase.ValidationErrorSolutionEmpty">
|
<UIItem Name="Dialog.CloseCase.ValidationErrorSolutionEmpty">
|
||||||
<Language Lang="EN">Fill solution</Language>
|
<Language Lang="EN">Fill solution</Language>
|
||||||
<Language Lang="DE">Lösung angeben</Language>
|
<Language Lang="DE">Lösung angeben</Language>
|
||||||
</UIItem>
|
</UIItem>
|
||||||
|
|
||||||
|
|||||||
@@ -91,32 +91,58 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="C4IT.F4SD.DisplayFormatting, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="C4IT.F4SD.DisplayFormatting, Version=1.0.9509.21303, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\C4IT.F4SD.DisplayFormatting.0.0.1-preview-0.0.2\lib\netstandard2.0\C4IT.F4SD.DisplayFormatting.dll</HintPath>
|
<HintPath>..\packages\C4IT.F4SD.DisplayFormatting.1.0.0\lib\netstandard2.0\C4IT.F4SD.DisplayFormatting.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="C4IT.F4SD.SupportCaseProtocoll, Version=1.0.9516.21165, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\C4IT.F4SD.SupportCaseProtocoll.1.0.0\lib\netstandard2.0\C4IT.F4SD.SupportCaseProtocoll.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MaterialIcons, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MaterialIcons, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MaterialIcons.1.0.3\lib\MaterialIcons.dll</HintPath>
|
<HintPath>..\packages\MaterialIcons.1.0.3\lib\MaterialIcons.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.2\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=10.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.3240.44, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.3240.44\lib\net462\Microsoft.Web.WebView2.Core.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Web.WebView2.WinForms, Version=1.0.3240.44, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.3240.44\lib\net462\Microsoft.Web.WebView2.WinForms.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.10.0.2\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.3240.44, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.3650.58, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.3240.44\lib\net462\Microsoft.Web.WebView2.Wpf.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.3650.58\lib\net462\Microsoft.Web.WebView2.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Web.WebView2.WinForms, Version=1.0.3650.58, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.3650.58\lib\net462\Microsoft.Web.WebView2.WinForms.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.3650.58, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.3650.58\lib\net462\Microsoft.Web.WebView2.Wpf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=10.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.10.0.2\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Numerics" />
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
@@ -151,6 +177,9 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="AppStartUp.cs" />
|
<Compile Include="AppStartUp.cs" />
|
||||||
<Compile Include="Basics\Browser.cs" />
|
<Compile Include="Basics\Browser.cs" />
|
||||||
|
<Compile Include="Basics\CustomEvents\HeadingDataEventArgs.cs" />
|
||||||
|
<Compile Include="Basics\Services\SupportCase\Controllers\SupportCaseController.cs" />
|
||||||
|
<Compile Include="Basics\Services\SupportCase\Controllers\SupportCaseHeadingController.cs" />
|
||||||
<Compile Include="Basics\ExternalToolExecutorEnh.cs" />
|
<Compile Include="Basics\ExternalToolExecutorEnh.cs" />
|
||||||
<Compile Include="Basics\Converter\BoolOrToVisibilityConverter.cs" />
|
<Compile Include="Basics\Converter\BoolOrToVisibilityConverter.cs" />
|
||||||
<Compile Include="Basics\Converter\DataCanvasIsCloseButtonVisibileConverter.cs" />
|
<Compile Include="Basics\Converter\DataCanvasIsCloseButtonVisibileConverter.cs" />
|
||||||
@@ -173,18 +202,19 @@
|
|||||||
<Compile Include="Basics\Models\TicketOverviewSelectionRequestedEventArgs.cs" />
|
<Compile Include="Basics\Models\TicketOverviewSelectionRequestedEventArgs.cs" />
|
||||||
<Compile Include="Basics\SearchHistoryManager.cs" />
|
<Compile Include="Basics\SearchHistoryManager.cs" />
|
||||||
<Compile Include="Basics\Services\ProtocollService\F4SDProtocoll.cs" />
|
<Compile Include="Basics\Services\ProtocollService\F4SDProtocoll.cs" />
|
||||||
<Compile Include="Basics\Services\ProtocollService\IProtocollEntry.cs" />
|
|
||||||
<Compile Include="Basics\Services\ProtocollService\QuickActionProtocollEntry.cs" />
|
<Compile Include="Basics\Services\ProtocollService\QuickActionProtocollEntry.cs" />
|
||||||
<Compile Include="Basics\Services\ProtocollService\QuickTipStepProtocollEntry.cs" />
|
<Compile Include="Basics\Services\ProtocollService\QuickTipStepProtocollEntry.cs" />
|
||||||
<Compile Include="Basics\Services\ProtocollService\TextualProtocollEntry.cs" />
|
|
||||||
<Compile Include="Basics\Services\RelationService\IRelationService.cs" />
|
<Compile Include="Basics\Services\RelationService\IRelationService.cs" />
|
||||||
<Compile Include="Basics\Services\RelationService\RelationService.cs" />
|
<Compile Include="Basics\Services\RelationService\RelationService.cs" />
|
||||||
<Compile Include="Basics\Services\RelationService\RelationEventArgs.cs" />
|
<Compile Include="Basics\CustomEvents\RelationEventArgs.cs" />
|
||||||
<Compile Include="Basics\Services\RelationService\StagedSearchResultRelationsEventArgs.cs" />
|
<Compile Include="Basics\Services\RelationService\StagedSearchResultRelationsEventArgs.cs" />
|
||||||
<Compile Include="Basics\Services\SupportCaseSearchService\SupportCaseSearchService.cs" />
|
<Compile Include="Basics\Services\SupportCaseSearchService\SupportCaseSearchService.cs" />
|
||||||
<Compile Include="Basics\Services\SupportCase\ISupportCase.cs" />
|
<Compile Include="Basics\Services\SupportCase\ISupportCase.cs" />
|
||||||
<Compile Include="Basics\Services\SupportCase\SupportCase.cs" />
|
<Compile Include="Basics\Services\SupportCase\SupportCase.cs" />
|
||||||
|
<Compile Include="Basics\CustomEvents\SupportCaseDataEventArgs.cs" />
|
||||||
<Compile Include="Basics\Services\SupportCase\SupportCaseFactory.cs" />
|
<Compile Include="Basics\Services\SupportCase\SupportCaseFactory.cs" />
|
||||||
|
<Compile Include="Basics\Services\SupportCase\SupportCaseProcessor.cs" />
|
||||||
|
<Compile Include="Basics\Services\SupportCase\SupportCaseProcessorFactory.cs" />
|
||||||
<Compile Include="Basics\SupportCaseDataProvider.cs" />
|
<Compile Include="Basics\SupportCaseDataProvider.cs" />
|
||||||
<Compile Include="Basics\Enums\enumActionDisplayType.cs" />
|
<Compile Include="Basics\Enums\enumActionDisplayType.cs" />
|
||||||
<Compile Include="Basics\Helper\DirectConnectionHelper.cs" />
|
<Compile Include="Basics\Helper\DirectConnectionHelper.cs" />
|
||||||
@@ -234,13 +264,18 @@
|
|||||||
<Compile Include="Basics\UiActions\UiQuickTipAction.cs" />
|
<Compile Include="Basics\UiActions\UiQuickTipAction.cs" />
|
||||||
<Compile Include="Basics\UiActions\UiRemoteQuickAction.cs" />
|
<Compile Include="Basics\UiActions\UiRemoteQuickAction.cs" />
|
||||||
<Compile Include="Basics\UiActions\UiServerQuickAction.cs" />
|
<Compile Include="Basics\UiActions\UiServerQuickAction.cs" />
|
||||||
|
<Compile Include="Basics\UiActions\UiShowRawHealthcardValues.cs" />
|
||||||
<Compile Include="Basics\UiActions\UiSystemDefaultQuickAction.cs" />
|
<Compile Include="Basics\UiActions\UiSystemDefaultQuickAction.cs" />
|
||||||
<Compile Include="Basics\UserControls\BlurInvokerContainer.xaml.cs">
|
<Compile Include="Basics\UserControls\Badge.xaml.cs">
|
||||||
<DependentUpon>BlurInvokerContainer.xaml</DependentUpon>
|
<DependentUpon>Badge.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Basics\UserControls\ComboBoxPageAble.xaml.cs">
|
<Compile Include="Basics\UserControls\BlurInvokerContainer.xaml.cs">
|
||||||
<DependentUpon>ComboBoxPageAble.xaml</DependentUpon>
|
<DependentUpon>BlurInvokerContainer.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Basics\UserControls\ComboBoxPageAble.xaml.cs">
|
||||||
|
<DependentUpon>ComboBoxPageAble.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
|
||||||
<Compile Include="Basics\UserControls\HierarchicalSelectionControl.xaml.cs">
|
<Compile Include="Basics\UserControls\HierarchicalSelectionControl.xaml.cs">
|
||||||
<DependentUpon>HierarchicalSelectionControl.xaml</DependentUpon>
|
<DependentUpon>HierarchicalSelectionControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -340,6 +375,12 @@
|
|||||||
<DependentUpon>CustomMessageBox.xaml</DependentUpon>
|
<DependentUpon>CustomMessageBox.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\CustomPopupBase.cs" />
|
<Compile Include="Pages\CustomPopupBase.cs" />
|
||||||
|
<Compile Include="Pages\RawHealthCardValuesPage\RawHealthCardValuesPage.xaml.cs">
|
||||||
|
<DependentUpon>RawHealthCardValuesPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pages\SearchPage\SearchPageView.xaml.cs">
|
||||||
|
<DependentUpon>SearchPageView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Pages\SplashScreenView\IntroView.xaml.cs">
|
<Compile Include="Pages\SplashScreenView\IntroView.xaml.cs">
|
||||||
<DependentUpon>IntroView.xaml</DependentUpon>
|
<DependentUpon>IntroView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -398,9 +439,6 @@
|
|||||||
<Compile Include="Pages\SettingsPage\PhoneSettingsPage.xaml.cs">
|
<Compile Include="Pages\SettingsPage\PhoneSettingsPage.xaml.cs">
|
||||||
<DependentUpon>PhoneSettingsPage.xaml</DependentUpon>
|
<DependentUpon>PhoneSettingsPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\SearchPage\SearchPageView.xaml.cs">
|
|
||||||
<DependentUpon>SearchPageView.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\SettingsPage\M42SettingsPageView.xaml.cs">
|
<Compile Include="Pages\SettingsPage\M42SettingsPageView.xaml.cs">
|
||||||
<DependentUpon>M42SettingsPageView.xaml</DependentUpon>
|
<DependentUpon>M42SettingsPageView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -443,6 +481,10 @@
|
|||||||
<Compile Include="Pages\SlimPage\UserControls\SlimPageWidgetCollection.xaml.cs">
|
<Compile Include="Pages\SlimPage\UserControls\SlimPageWidgetCollection.xaml.cs">
|
||||||
<DependentUpon>SlimPageWidgetCollection.xaml</DependentUpon>
|
<DependentUpon>SlimPageWidgetCollection.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Page Include="Basics\UserControls\Badge.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="Basics\UserControls\BlurInvokerContainer.xaml">
|
<Page Include="Basics\UserControls\BlurInvokerContainer.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -701,13 +743,17 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPage\PhoneSettingsPage.xaml">
|
<Page Include="Pages\RawHealthCardValuesPage\RawHealthCardValuesPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\SearchPage\SearchPageView.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SearchPage\SearchPageView.xaml">
|
<Page Include="Pages\SettingsPage\PhoneSettingsPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPage\M42SettingsPageView.xaml">
|
<Page Include="Pages\SettingsPage\M42SettingsPageView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -854,15 +900,6 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="..\..\C4IT FASD\_Common\XmlSchemas\LanguageDefinitions.xsd">
|
<EmbeddedResource Include="..\..\C4IT FASD\_Common\XmlSchemas\LanguageDefinitions.xsd">
|
||||||
<Link>Config\LanguageDefinitions.xsd</Link>
|
<Link>Config\LanguageDefinitions.xsd</Link>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -993,6 +1030,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<WCFMetadata Include="Connected Services\" />
|
<WCFMetadata Include="Connected Services\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>if $(ConfigurationName) == BuildToTeams powershell.exe -ExecutionPolicy remotesigned -file "$(SolutionDir)BuildToTeams.ps1" -DirectoryToZip "$(SolutionDir)\FasdDesktopUi\bin\Release"</PostBuildEvent>
|
<PostBuildEvent>if $(ConfigurationName) == BuildToTeams powershell.exe -ExecutionPolicy remotesigned -file "$(SolutionDir)BuildToTeams.ps1" -DirectoryToZip "$(SolutionDir)\FasdDesktopUi\bin\Release"</PostBuildEvent>
|
||||||
@@ -1008,11 +1046,11 @@ taskkill -im "F4SD-Cockpit-Client.exe" -f -FI "STATUS eq RUNNING"
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PreBuildEvent>copy "$(ProjectDir)..\..\C4IT FASD\_Common\XmlSchemas\LanguageDefinitions.xsd" "$(ProjectDir)Config"</PreBuildEvent>
|
<PreBuildEvent>copy "$(ProjectDir)..\..\C4IT FASD\_Common\XmlSchemas\LanguageDefinitions.xsd" "$(ProjectDir)Config"</PreBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.3240.44\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.3240.44\build\Microsoft.Web.WebView2.targets')" />
|
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.3650.58\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.3650.58\build\Microsoft.Web.WebView2.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.3240.44\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.3240.44\build\Microsoft.Web.WebView2.targets'))" />
|
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.3650.58\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.3650.58\build\Microsoft.Web.WebView2.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -90,12 +90,11 @@
|
|||||||
<Border x:Name="DialogCloseElement"
|
<Border x:Name="DialogCloseElement"
|
||||||
x:FieldModifier="private"
|
x:FieldModifier="private"
|
||||||
DockPanel.Dock="Bottom"
|
DockPanel.Dock="Bottom"
|
||||||
Width="{Binding ElementName=WindowStateBarUserControl, Path=ActualWidth}"
|
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
CornerRadius="5"
|
CornerRadius="5"
|
||||||
Margin="0 2.5 7.5 -30"
|
Margin="0 2.5 7.5 -30"
|
||||||
Padding="0 2.5"
|
Padding="10 2.5"
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.Widget.Value}"
|
Background="{DynamicResource BackgroundColor.DetailsPage.Widget.Value}"
|
||||||
MouseLeftButtonUp="CloseCaseWithTicketIcon_MouseLeftButtonUp"
|
MouseLeftButtonUp="CloseCaseWithTicketIcon_MouseLeftButtonUp"
|
||||||
TouchDown="CloseCaseWithTicketIcon_TouchDown">
|
TouchDown="CloseCaseWithTicketIcon_TouchDown">
|
||||||
@@ -220,8 +219,7 @@
|
|||||||
<uc:DetailsPageWidgetCollection x:Name="WidgetCollection"
|
<uc:DetailsPageWidgetCollection x:Name="WidgetCollection"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0 35 0 10"
|
Margin="0 35 0 10"
|
||||||
WidgetGeometryList="{Binding WidgetGeometryList}"
|
WidgetGeometryList="{Binding WidgetGeometryList}" />
|
||||||
WidgetDataList="{Binding WidgetDataList}" />
|
|
||||||
|
|
||||||
<uc:DetailsPageRefreshControl x:Name="RefreshControl"
|
<uc:DetailsPageRefreshControl x:Name="RefreshControl"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ using static C4IT.Logging.cLogManager;
|
|||||||
using F4SD_AdaptableIcon.Enums;
|
using F4SD_AdaptableIcon.Enums;
|
||||||
using FasdDesktopUi.Basics.CustomEvents;
|
using FasdDesktopUi.Basics.CustomEvents;
|
||||||
using FasdDesktopUi.Basics.Converter;
|
using FasdDesktopUi.Basics.Converter;
|
||||||
using FasdDesktopUi.Basics.Services.SupportCase;
|
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||||
using FasdDesktopUi.Basics.Services.RelationService;
|
|
||||||
|
|
||||||
namespace FasdDesktopUi.Pages.DetailsPage
|
namespace FasdDesktopUi.Pages.DetailsPage
|
||||||
{
|
{
|
||||||
@@ -54,7 +53,9 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
private bool isQuickActionDecoratorVisible = false;
|
private bool isQuickActionDecoratorVisible = false;
|
||||||
private bool isNotepadDecoratorVisible = false;
|
private bool isNotepadDecoratorVisible = false;
|
||||||
|
|
||||||
private DispatcherTimer midnightTimer = new DispatcherTimer();
|
private readonly DispatcherTimer _midnightTimer = new DispatcherTimer();
|
||||||
|
|
||||||
|
private double _lastDesiredHeightOfWidgetCollection = 0; // to avoid resizing the main grid on every data changed event
|
||||||
|
|
||||||
#region Notepad
|
#region Notepad
|
||||||
|
|
||||||
@@ -131,9 +132,9 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
midnightTimer.Interval = TimeSpan.FromSeconds(1);
|
_midnightTimer.Interval = TimeSpan.FromSeconds(1);
|
||||||
midnightTimer.Tick += MidnightTimer_Tick;
|
_midnightTimer.Tick += MidnightTimer_Tick;
|
||||||
midnightTimer.Start();
|
_midnightTimer.Start();
|
||||||
SupportNotepad = true;
|
SupportNotepad = true;
|
||||||
|
|
||||||
var _screen = System.Windows.Forms.Screen.PrimaryScreen;
|
var _screen = System.Windows.Forms.Screen.PrimaryScreen;
|
||||||
@@ -159,44 +160,150 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
BlurInvoker.BlurInvokerVisibilityChanged -= (obj, e) => UpdateBlurStatus(obj);
|
BlurInvoker.BlurInvokerVisibilityChanged -= (obj, e) => UpdateBlurStatus(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetSupportCase(ISupportCase supportCase)
|
internal override void SetSupportCaseController(SupportCaseController supportCaseController)
|
||||||
{
|
{
|
||||||
if (_supportCase != null)
|
if (_supportCaseController != null)
|
||||||
_supportCase.CaseRelationsAdded -= HandleCaseRelationsAdded;
|
UnsubscribeEventsOf(_supportCaseController);
|
||||||
|
|
||||||
supportCase.CaseRelationsAdded += HandleCaseRelationsAdded;
|
ResetPageToDefaultState();
|
||||||
base.SetSupportCase(supportCase);
|
SubscribeEventsOf(supportCaseController);
|
||||||
|
|
||||||
|
base.SetSupportCaseController(supportCaseController);
|
||||||
|
|
||||||
|
NavigationHeadingUc.SupportCaseController = supportCaseController;
|
||||||
IsBlurred = true;
|
IsBlurred = true;
|
||||||
|
|
||||||
RefreshControl.DataProvider = supportCase.SupportCaseDataProviderArtifact;
|
RefreshControl.DataProvider = supportCaseController.SupportCaseDataProviderArtifact;
|
||||||
NavigationHeadingUc.DataProvider = supportCase.SupportCaseDataProviderArtifact;
|
NavigationHeadingUc.DataProvider = supportCaseController.SupportCaseDataProviderArtifact;
|
||||||
|
|
||||||
cSupportCaseDataProvider.CaseChanged += DataProvider_CaseChanged;
|
cSupportCaseDataProvider.CaseChanged += DataProvider_CaseChanged;
|
||||||
|
|
||||||
RefreshControl.IsDataIncomplete = true;
|
RefreshControl.IsDataIncomplete = true;
|
||||||
RefreshControl.LoadingDataIndicatorUc.LoadingText = cMultiLanguageSupport.GetItem("DetailsPage.Loading");
|
RefreshControl.LoadingDataIndicatorUc.LoadingText = cMultiLanguageSupport.GetItem("DetailsPage.Loading");
|
||||||
CustomizableSectionUc.IsDataIncomplete = true;
|
CustomizableSectionUc.IsDataIncomplete = true;
|
||||||
supportCase.SupportCaseDataProviderArtifact.NotepadDocumentUpdated += ResetNotepadNotification;
|
supportCaseController.SupportCaseDataProviderArtifact.NotepadDocumentUpdated += ResetNotepadNotification;
|
||||||
|
|
||||||
|
void SubscribeEventsOf(SupportCaseController controller)
|
||||||
|
{
|
||||||
|
controller.AvailableCaseRelationsAdded += HandleAvailableRelationsAdded;
|
||||||
|
controller.FocusedRelationsChanged += HandleFocusedRelationsChanged;
|
||||||
|
controller.CaseDataChanged += HandleCaseDataChanged;
|
||||||
|
controller.HeadingDataChanged += HandleHeadingDataChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UnsubscribeEventsOf(SupportCaseController controller)
|
||||||
|
{
|
||||||
|
controller.AvailableCaseRelationsAdded -= HandleAvailableRelationsAdded;
|
||||||
|
controller.FocusedRelationsChanged -= HandleFocusedRelationsChanged;
|
||||||
|
controller.CaseDataChanged -= HandleCaseDataChanged;
|
||||||
|
controller.HeadingDataChanged -= HandleHeadingDataChanged;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void HandleCaseRelationsAdded(object sender, RelationEventArgs e)
|
private void HandleAvailableRelationsAdded(object sender, RelationEventArgs e)
|
||||||
{
|
{
|
||||||
await Dispatcher.Invoke(async () =>
|
}
|
||||||
|
|
||||||
|
private void HandleFocusedRelationsChanged(object sender, RelationEventArgs e)
|
||||||
|
{
|
||||||
|
IsBlurred = false;
|
||||||
|
_supportCaseController.SupportCaseDataProviderArtifact.Identities = e.Relations.FirstOrDefault()?.FirstOrDefault()?.Identities; // todo remove when ShowDetailedDataAction is not dependent on Artifact anymore
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
NavigationHeadingUc.HeadingData = _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.GetHeadingDataWithoutOnlineStatus();
|
ResetPageToDefaultState();
|
||||||
NavigationHeadingUc.HeadingData = await _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.UpdateOnlineStatusAsync();
|
UpdateHealthcardSectionVisibilities();
|
||||||
|
HandleCaseDataChanged(null, null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleHeadingDataChanged(object sender, HeadingDataEventArgs e)
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(() => NavigationHeadingUc.HeadingData = e.NewValue.ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo update NavigationHeadingUc_HeadingIconClickedEvent as soon as EventArgs are taken into account
|
||||||
|
private void HandleCaseDataChanged(object sender, SupportCaseDataEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isDataChangedEventRunning)
|
||||||
|
{
|
||||||
|
shouldReRunDataChangedEvent = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
isDataChangedEventRunning = true;
|
||||||
|
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (QuickActionDecorator.Child is DataCanvas dataCanvas)
|
||||||
|
Dispatcher.Invoke(async () => await dataCanvas.UpdateDataAsync());
|
||||||
|
|
||||||
|
if (WidgetCollection.WidgetDataList is null || WidgetCollection.WidgetDataList.Count == 0)
|
||||||
|
WidgetCollection.WidgetDataList = _supportCaseController?.GetWidgetData();
|
||||||
|
|
||||||
|
WidgetCollection.UpdateWidgetData(_supportCaseController?.GetWidgetData());
|
||||||
|
|
||||||
|
if (DataHistoryCollectionUserControl.HistoryDataList is null || DataHistoryCollectionUserControl.HistoryDataList.Count == 0)
|
||||||
|
DataHistoryCollectionUserControl.HistoryDataList = _supportCaseController?.GetHistoryData();
|
||||||
|
|
||||||
|
DataHistoryCollectionUserControl.UpdateHistory(_supportCaseController?.GetHistoryData());
|
||||||
|
|
||||||
|
if (CustomizableSectionUc.ContainerCollections is null || CustomizableSectionUc.ContainerCollections.Count == 0)
|
||||||
|
CustomizableSectionUc.ContainerCollections = _supportCaseController?.GetContainerData();
|
||||||
|
|
||||||
|
CustomizableSectionUc.UpdateContainerCollection(_supportCaseController?.GetContainerData());
|
||||||
|
|
||||||
|
if (this.DataContext is DetailsPageViewModel viewModel)
|
||||||
|
viewModel.MenuBarData = _supportCaseController?.GetMenuBarData();
|
||||||
|
|
||||||
|
if (_lastDesiredHeightOfWidgetCollection != WidgetCollection.DesiredSize.Height)
|
||||||
|
{
|
||||||
|
_lastDesiredHeightOfWidgetCollection = WidgetCollection.DesiredSize.Height;
|
||||||
|
MainGrid.InvalidateMeasure();
|
||||||
|
MainGrid.UpdateLayout();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (shouldReRunDataChangedEvent)
|
||||||
|
HandleCaseDataChanged(sender, e);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
isDataChangedEventRunning = false;
|
||||||
|
shouldReRunDataChangedEvent = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the visibility of History and Customizable Section based on the currently selected Healthcard.
|
||||||
|
/// </summary>
|
||||||
|
internal void UpdateHealthcardSectionVisibilities()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cHealthCard selectedHealthcard = _supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.SelectedHealthCard;
|
||||||
|
bool showHistorySection = selectedHealthcard.CategoriesHistory?.StateCategories != null && selectedHealthcard.CategoriesHistory.StateCategories.Count > 0;
|
||||||
|
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
DataHistoryCollectionUserControl.Visibility = showHistorySection ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
CustomizableSectionUc.Visibility = showHistorySection ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ReinitializeNotepad()
|
private void ReinitializeNotepad()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (SupportNotepad == true)
|
if (SupportNotepad == true)
|
||||||
{
|
{
|
||||||
|
|
||||||
notepad = new Notepad(_supportCase?.SupportCaseDataProviderArtifact);
|
notepad = new Notepad(_supportCaseController?.SupportCaseDataProviderArtifact);
|
||||||
ChangeNotepadNotification();
|
ChangeNotepadNotification();
|
||||||
NotepadDecorator.Child = notepad;
|
NotepadDecorator.Child = notepad;
|
||||||
NotepadDecorator.Visibility = Visibility.Collapsed;
|
NotepadDecorator.Visibility = Visibility.Collapsed;
|
||||||
@@ -319,31 +426,34 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Panel.SetZIndex(NavigationHeadingUc, 1);
|
Dispatcher.Invoke(() =>
|
||||||
NavigationHeadingUc.ResetSelectors();
|
|
||||||
|
|
||||||
if (cConnectionStatusHelper.Instance?.ApiConnectionStatus == cConnectionStatusHelper.enumOnlineStatus.online)
|
|
||||||
{
|
{
|
||||||
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
Panel.SetZIndex(NavigationHeadingUc, 1);
|
||||||
SearchBarUserControl.Clear();
|
NavigationHeadingUc.ResetSelectors();
|
||||||
MenuBarUserControl.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchResultBorder.Visibility = Visibility.Collapsed;
|
if (cConnectionStatusHelper.Instance?.ApiConnectionStatus == cConnectionStatusHelper.enumOnlineStatus.online)
|
||||||
|
|
||||||
OverlayBorder.Child = null;
|
|
||||||
OverlayBorder.Visibility = Visibility.Collapsed;
|
|
||||||
|
|
||||||
if (BlurInvokers?.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var blurInvoker in BlurInvokers.ToArray())
|
|
||||||
{
|
{
|
||||||
if (blurInvoker is Window blurInvokerWindow)
|
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
||||||
blurInvokerWindow.Hide();
|
SearchBarUserControl.Clear();
|
||||||
|
MenuBarUserControl.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
IsBlurred = BlurInvokers?.Count > 0;
|
SearchResultBorder.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
OverlayBorder.Child = null;
|
||||||
|
OverlayBorder.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
if (BlurInvokers?.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var blurInvoker in BlurInvokers.ToArray())
|
||||||
|
{
|
||||||
|
if (blurInvoker is Window blurInvokerWindow)
|
||||||
|
blurInvokerWindow.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IsBlurred = BlurInvokers?.Count > 0;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -450,21 +560,8 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
NavigationHeadingUc.IsHitTestVisible = false;
|
|
||||||
NavigationHeadingUc.Opacity = 0.7;
|
|
||||||
});
|
|
||||||
|
|
||||||
RefreshControl.IsDataIncomplete = true;
|
RefreshControl.IsDataIncomplete = true;
|
||||||
|
await _supportCaseController.RefreshDataForCurrentlyFocusedRelationAsync();
|
||||||
List<Task> tasks = new List<Task>
|
|
||||||
{
|
|
||||||
_supportCase?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.UpdateOnlineStatusAsync(),
|
|
||||||
_supportCase?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.LoadingHelper?.RefreshLatestDataAsync()
|
|
||||||
};
|
|
||||||
|
|
||||||
await Task.WhenAll(tasks);
|
|
||||||
RefreshControl.UpdateLastDataRequestTime();
|
RefreshControl.UpdateLastDataRequestTime();
|
||||||
RefreshControl.IsDataIncomplete = false;
|
RefreshControl.IsDataIncomplete = false;
|
||||||
}
|
}
|
||||||
@@ -495,6 +592,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
{
|
{
|
||||||
case cChangeHealthCardAction _:
|
case cChangeHealthCardAction _:
|
||||||
case cShowHeadingSelectionMenuAction _:
|
case cShowHeadingSelectionMenuAction _:
|
||||||
|
case UiShowRawHealthcardValues _:
|
||||||
break;
|
break;
|
||||||
case cUiQuickAction _:
|
case cUiQuickAction _:
|
||||||
case cShowRecommendationAction _:
|
case cShowRecommendationAction _:
|
||||||
@@ -515,7 +613,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await e.UiAction.RunUiActionAsync(e.OriginalSource, drawingArea, true, _supportCase?.SupportCaseDataProviderArtifact);
|
await e.UiAction.RunUiActionAsync(e.OriginalSource, drawingArea, true, _supportCaseController?.SupportCaseDataProviderArtifact);
|
||||||
UpdateHistoryWidth();
|
UpdateHistoryWidth();
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -545,21 +643,13 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (isDataProviderLoading)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!(sender is FrameworkElement senderElement))
|
if (!(sender is FrameworkElement senderElement))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(senderElement.Tag is enumFasdInformationClass informationClassTag))
|
if (!(senderElement.Tag is cF4sdApiSearchResultRelation selectedRelation))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_supportCase?.SupportCaseDataProviderArtifact is null || !_supportCase.SupportCaseDataProviderArtifact.Identities.Any(identity => identity.Class == informationClassTag))
|
_supportCaseController.UpdateFocusedCaseRelation(selectedRelation);
|
||||||
return;
|
|
||||||
|
|
||||||
Mouse.OverrideCursor = Cursors.Wait;
|
|
||||||
|
|
||||||
await _supportCase?.SupportCaseDataProviderArtifact.ChangeHealthCardAsync(informationClassTag);
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -654,7 +744,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
private void F4SDIcon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
private void F4SDIcon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
CustomMessageBox.CustomMessageBox.Show("1. Have you tried turning it off and on again?\n2. Are you sure it is plugged in?", "How to solve (almost) any computer problem", enumHealthCardStateLevel.Info, this);
|
CustomMessageBox.CustomMessageBox.Show("1. Have you tried turning it off and on again?\n2. Are you sure it is plugged in?", "How to solve (almost) any computer problem", enumHealthCardStateLevel.Info, this);
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.IsInEditMode = true;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.IsInEditMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region CloseCaseWithTicketIcon_Click
|
#region CloseCaseWithTicketIcon_Click
|
||||||
@@ -701,17 +791,14 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!(e.NewValue is bool isVisible))
|
if (!(e.NewValue is bool isVisible && isVisible))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (isVisible)
|
Show();
|
||||||
{
|
Activate();
|
||||||
Show();
|
Focus();
|
||||||
Activate();
|
if (IsWindowLoaded)
|
||||||
Focus();
|
WindowState = WindowState.Maximized;
|
||||||
if (IsWindowLoaded)
|
|
||||||
WindowState = WindowState.Maximized;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -936,7 +1023,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
LogMethodBegin(CM);
|
LogMethodBegin(CM);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LogEntry($"DataChanged - DataProvider for Class: {_supportCase?.SupportCaseDataProviderArtifact.Identities[0].Class} - Id: {_supportCase?.SupportCaseDataProviderArtifact.Identities[0].Id}");
|
LogEntry($"DataChanged - DataProvider for Class: {_supportCaseController?.SupportCaseDataProviderArtifact.Identities[0].Class} - Id: {_supportCaseController?.SupportCaseDataProviderArtifact.Identities[0].Id}");
|
||||||
|
|
||||||
if (isDataChangedEventRunning)
|
if (isDataChangedEventRunning)
|
||||||
{
|
{
|
||||||
@@ -949,21 +1036,6 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
|
|
||||||
if (!(e is BooleanEventArgs booleanArg) || booleanArg.BooleanArg == false)
|
if (!(e is BooleanEventArgs booleanArg) || booleanArg.BooleanArg == false)
|
||||||
isDataProviderLoading = true;
|
isDataProviderLoading = true;
|
||||||
var data = _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.DetailPage.GetDataWithoutHeading();
|
|
||||||
await Dispatcher.Invoke(async () =>
|
|
||||||
{
|
|
||||||
NavigationHeadingUc.HeadingData = _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.GetHeadingDataWithoutOnlineStatus();
|
|
||||||
NavigationHeadingUc.HeadingData = await _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.UpdateOnlineStatusAsync();
|
|
||||||
});
|
|
||||||
Dispatcher.Invoke(() => { WidgetCollection.UpdateWidgetData(data.WidgetData); });
|
|
||||||
Dispatcher.Invoke(() => DataHistoryCollectionUserControl.UpdateHistory(data.DataHistoryList));
|
|
||||||
Dispatcher.Invoke(() => CustomizableSectionUc.UpdateContainerCollection(data.DataContainerCollectionList));
|
|
||||||
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
if (DataContext is DetailsPageViewModel viewModel)
|
|
||||||
viewModel.SetPropertyValues(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
Dispatcher.Invoke(UpdateHistoryWidth);
|
Dispatcher.Invoke(UpdateHistoryWidth);
|
||||||
|
|
||||||
@@ -1023,7 +1095,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
{
|
{
|
||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
bool hasDirectConnection = _supportCase?.SupportCaseDataProviderArtifact?.DirectConnectionHelper?.IsDirectConnectionActive ?? false;
|
bool hasDirectConnection = _supportCaseController?.SupportCaseDataProviderArtifact?.DirectConnectionHelper?.IsDirectConnectionActive ?? false;
|
||||||
NavigationHeadingUc.HasDirectConnection = hasDirectConnection;
|
NavigationHeadingUc.HasDirectConnection = hasDirectConnection;
|
||||||
|
|
||||||
if (hasDirectConnection)
|
if (hasDirectConnection)
|
||||||
@@ -1295,7 +1367,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
|
|
||||||
private void ChangeNotepadNotification()
|
private void ChangeNotepadNotification()
|
||||||
{
|
{
|
||||||
FlowDocument document = _supportCase?.SupportCaseDataProviderArtifact.CaseNotes;
|
FlowDocument document = _supportCaseController?.SupportCaseDataProviderArtifact.CaseNotes;
|
||||||
bool isFlowDocumentEmpty = !document.Blocks.Any(block =>
|
bool isFlowDocumentEmpty = !document.Blocks.Any(block =>
|
||||||
{
|
{
|
||||||
if (block is Paragraph paragraph)
|
if (block is Paragraph paragraph)
|
||||||
@@ -1358,22 +1430,16 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
BlurBorder_Click();
|
BlurBorder_Click();
|
||||||
MenuBarUserControl.Visibility = Visibility.Visible;
|
MenuBarUserControl.Visibility = Visibility.Visible;
|
||||||
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
SearchBarUserControl.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
QuickActionSelectorUc.QuickActionList = null;
|
QuickActionSelectorUc.QuickActionList = null;
|
||||||
QuickActionSelectorUc.Visibility = Visibility.Collapsed;
|
QuickActionSelectorUc.Visibility = Visibility.Collapsed;
|
||||||
QuickActionDecorator.Child.Visibility = Visibility.Collapsed;
|
QuickActionDecorator.Child.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
NotepadDecorator.Visibility = Visibility.Collapsed;
|
NotepadDecorator.Visibility = Visibility.Collapsed;
|
||||||
NotepadDecorator.Child = null;
|
NotepadDecorator.Child = null;
|
||||||
notepad = null;
|
notepad = null;
|
||||||
|
|
||||||
isQuickActionDecoratorVisible = false;
|
isQuickActionDecoratorVisible = false;
|
||||||
|
|
||||||
isQuickActionSelectorVisible = false;
|
isQuickActionSelectorVisible = false;
|
||||||
|
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
ReinitializeNotepad();
|
ReinitializeNotepad();
|
||||||
|
|
||||||
DataHistoryCollectionUserControl.ToggleVerticalCollapseDetails(true);
|
DataHistoryCollectionUserControl.ToggleVerticalCollapseDetails(true);
|
||||||
UpdateHistoryWidth();
|
UpdateHistoryWidth();
|
||||||
}
|
}
|
||||||
@@ -1383,64 +1449,6 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPropertyValues(cDetailsPageData detailPageData)
|
|
||||||
{
|
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
|
||||||
LogMethodBegin(CM);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (DataContext is DetailsPageViewModel viewModel)
|
|
||||||
{
|
|
||||||
viewModel.SetPropertyValues(detailPageData);
|
|
||||||
|
|
||||||
NavigationHeadingUc.HeadingData = detailPageData.HeadingData;
|
|
||||||
|
|
||||||
ResetPageToDefaultState();
|
|
||||||
|
|
||||||
if (detailPageData.DataHistoryList?.Count > 0)
|
|
||||||
{
|
|
||||||
CustomizableSectionUc.Visibility = Visibility.Collapsed;
|
|
||||||
DataHistoryCollectionUserControl.Visibility = Visibility.Visible;
|
|
||||||
DataHistoryCollectionUserControl.HistoryDataList = detailPageData.DataHistoryList;
|
|
||||||
DataHistoryCollectionUserControl.DataProvider = _supportCase?.SupportCaseDataProviderArtifact;
|
|
||||||
|
|
||||||
QuickActionSelectorUc.IsLocked = cFasdCockpitConfig.Instance.IsHistoryQuickActionSelectorVisible;
|
|
||||||
|
|
||||||
if (cFasdCockpitConfig.Instance.IsHistoryQuickActionSelectorVisible)
|
|
||||||
MoreButtonClickedAction();
|
|
||||||
}
|
|
||||||
else if (detailPageData.DataContainerCollectionList?.Count > 0)
|
|
||||||
{
|
|
||||||
DataHistoryCollectionUserControl.Visibility = Visibility.Collapsed;
|
|
||||||
CustomizableSectionUc.Visibility = Visibility.Visible;
|
|
||||||
CustomizableSectionUc.ContainerCollections = detailPageData.DataContainerCollectionList;
|
|
||||||
|
|
||||||
var ticketMenuData = detailPageData.MenuBarData.FirstOrDefault(menuData => menuData.MenuText == "Ticket");
|
|
||||||
|
|
||||||
if (ticketMenuData != null)
|
|
||||||
if (ticketMenuData is cMenuDataContainer containerMenuData)
|
|
||||||
{
|
|
||||||
QuickActionSelectorUc.QuickActionSelectorHeading = containerMenuData.MenuText;
|
|
||||||
QuickActionSelectorUc.QuickActionList = containerMenuData.SubMenuData;
|
|
||||||
}
|
|
||||||
|
|
||||||
QuickActionSelectorUc.IsLocked = cFasdCockpitConfig.Instance.IsCustomizableQuickActionSelectorVisible;
|
|
||||||
|
|
||||||
if (cFasdCockpitConfig.Instance.IsCustomizableQuickActionSelectorVisible)
|
|
||||||
QuickActionSelectorUc.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
LogMethodEnd(CM);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DataHistoryCollection
|
#region DataHistoryCollection
|
||||||
@@ -1589,9 +1597,9 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
midnightTimer.Stop();
|
_midnightTimer.Stop();
|
||||||
|
|
||||||
var from = _supportCase?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.LoadingHelper?.LastDataRequest;
|
var from = _supportCaseController?.SupportCaseDataProviderArtifact?.HealthCardDataHelper?.LoadingHelper?.LastDataRequest;
|
||||||
|
|
||||||
if (from == null)
|
if (from == null)
|
||||||
{
|
{
|
||||||
@@ -1618,7 +1626,7 @@ namespace FasdDesktopUi.Pages.DetailsPage
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
midnightTimer.Start();
|
_midnightTimer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
using FasdDesktopUi.Basics.Models;
|
using FasdDesktopUi.Basics.Models;
|
||||||
using FasdDesktopUi.Pages.DetailsPage.Models;
|
using FasdDesktopUi.Pages.DetailsPage.Models;
|
||||||
using FasdDesktopUi.Basics;
|
using FasdDesktopUi.Basics;
|
||||||
|
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
||||||
@@ -48,56 +39,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Header Properties
|
|
||||||
|
|
||||||
#region PageTitle Property
|
|
||||||
|
|
||||||
private string pageTitle;
|
|
||||||
public string PageTitle
|
|
||||||
{
|
|
||||||
get { return pageTitle; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
pageTitle = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region HeadingData Property
|
|
||||||
|
|
||||||
private List<cHeadingDataModel> headingData;
|
|
||||||
|
|
||||||
public List<cHeadingDataModel> HeadingData
|
|
||||||
{
|
|
||||||
get { return headingData; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
headingData = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Widget Properties
|
|
||||||
|
|
||||||
#region WidgetData Property
|
|
||||||
private List<List<cWidgetValueModel>> widgetDataList;
|
|
||||||
public List<List<cWidgetValueModel>> WidgetDataList
|
|
||||||
{
|
|
||||||
get { return widgetDataList; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
widgetDataList = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region WidgetGeometry Property
|
#region WidgetGeometry Property
|
||||||
private List<DetailsPageWidgetGeometryModel> widgetGeometryList;
|
private List<DetailsPageWidgetGeometryModel> widgetGeometryList;
|
||||||
public List<DetailsPageWidgetGeometryModel> WidgetGeometryList
|
public List<DetailsPageWidgetGeometryModel> WidgetGeometryList
|
||||||
@@ -112,8 +53,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Details Properties
|
#region Details Properties
|
||||||
|
|
||||||
#region TimeSinceLastRefresh property
|
#region TimeSinceLastRefresh property
|
||||||
@@ -145,21 +84,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DetailsData property
|
|
||||||
|
|
||||||
private cDetailsPageDataHistoryDataModel detailsDataList;
|
|
||||||
public cDetailsPageDataHistoryDataModel DetailsDataList
|
|
||||||
{
|
|
||||||
get { return detailsDataList; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
detailsDataList = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region ShownValueColumnsCount
|
#region ShownValueColumnsCount
|
||||||
public int ShownValueColumnsCount
|
public int ShownValueColumnsCount
|
||||||
{
|
{
|
||||||
@@ -245,39 +169,6 @@ namespace FasdDesktopUi.Pages.DetailsPage.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPropertyValues(cDetailsPageData propertyValues)
|
|
||||||
{
|
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
|
||||||
LogMethodBegin(CM);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DataProvider = propertyValues.DataProvider;
|
|
||||||
|
|
||||||
//Heading Properties
|
|
||||||
HeadingData = propertyValues.HeadingData;
|
|
||||||
|
|
||||||
//Widget Properties
|
|
||||||
WidgetDataList = propertyValues.WidgetData;
|
|
||||||
|
|
||||||
//Details Properties
|
|
||||||
TimeSinceLastRefresh = propertyValues.TimeSinceLastRefresh;
|
|
||||||
ShownValueColumnsCount = propertyValues.ShownValueColumnsCount;
|
|
||||||
DetailsDataList = propertyValues.DataHistoryList;
|
|
||||||
|
|
||||||
//Menu Properties
|
|
||||||
MenuBarData = propertyValues.MenuBarData;
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogEntry($"Passed history values: {propertyValues}");
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
LogMethodEnd(CM);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
xmlns:local="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
||||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon"
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
xmlns:config="clr-namespace:C4IT.FASD.Base;assembly=F4SD-Cockpit-Client-Base"
|
xmlns:config="clr-namespace:C4IT.FASD.Base;assembly=F4SD-Cockpit-Client-Base"
|
||||||
xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
|
xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|||||||
@@ -1,21 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using C4IT.Logging;
|
|
||||||
using C4IT.MultiLanguage;
|
|
||||||
using FasdDesktopUi.Basics;
|
using FasdDesktopUi.Basics;
|
||||||
using FasdDesktopUi.Basics.Enums;
|
using FasdDesktopUi.Basics.Enums;
|
||||||
using FasdDesktopUi.Pages.DetailsPage.Models;
|
using FasdDesktopUi.Pages.DetailsPage.Models;
|
||||||
@@ -509,7 +503,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
default:
|
default:
|
||||||
subtitleStyle = titleColumnMainTitleStyle;
|
subtitleStyle = titleColumnMainTitleStyle;
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
|
|
||||||
double subtitleLength = MeasureStringSize(subtitle.Content, new TextBox { Style = subtitleStyle }).Width;
|
double subtitleLength = MeasureStringSize(subtitle.Content, new TextBox { Style = subtitleStyle }).Width;
|
||||||
maxTitleLength = maxTitleLength < subtitleLength ? subtitleLength + 70 : maxTitleLength;
|
maxTitleLength = maxTitleLength < subtitleLength ? subtitleLength + 70 : maxTitleLength;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ using C4IT.FASD.Base;
|
|||||||
|
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
using C4IT.FASD.Cockpit.Communication;
|
using C4IT.FASD.Cockpit.Communication;
|
||||||
|
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||||
{
|
{
|
||||||
@@ -41,6 +42,8 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SupportCaseController SupportCaseController { get; set; }
|
||||||
|
|
||||||
private List<Border> _highlightBorders;
|
private List<Border> _highlightBorders;
|
||||||
|
|
||||||
private void UpdateHeaderHighlights()
|
private void UpdateHeaderHighlights()
|
||||||
@@ -457,6 +460,8 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
|
|
||||||
if (headingIcon != null)
|
if (headingIcon != null)
|
||||||
{
|
{
|
||||||
|
headingIcon.Tag = heading.Realtion;
|
||||||
|
|
||||||
if (heading.IsOnline)
|
if (heading.IsOnline)
|
||||||
{
|
{
|
||||||
headingIcon.SetResourceReference(AdaptableIcon.PrimaryIconColorProperty, "Color.Green");
|
headingIcon.SetResourceReference(AdaptableIcon.PrimaryIconColorProperty, "Color.Green");
|
||||||
@@ -471,6 +476,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
|
|
||||||
if (headingTextBlock != null && string.IsNullOrWhiteSpace(heading.HeadingText) is false)
|
if (headingTextBlock != null && string.IsNullOrWhiteSpace(heading.HeadingText) is false)
|
||||||
{
|
{
|
||||||
|
headingTextBlock.Tag = heading.Realtion;
|
||||||
headingTextBlock.Text = heading.HeadingText;
|
headingTextBlock.Text = heading.HeadingText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +638,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
var action = new cShowHeadingSelectionMenuAction();
|
var action = new cShowHeadingSelectionMenuAction();
|
||||||
ShowsRelations = true;
|
ShowsRelations = true;
|
||||||
cUiActionBase.RaiseEvent(new cShowHeadingSelectionMenuAction(), this, sender);
|
cUiActionBase.RaiseEvent(new cShowHeadingSelectionMenuAction(), this, sender);
|
||||||
DoShowRelations(swapCaseData, location);
|
DoShowRelations(swapCaseData, location, SupportCaseController);
|
||||||
//Dispatcher.Invoke(async () => await action.RunUiActionAsync(sender, location, false, DataProvider));
|
//Dispatcher.Invoke(async () => await action.RunUiActionAsync(sender, location, false, DataProvider));
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -642,7 +648,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void DoShowRelations(cSwapCaseInfo swapCaseData, CustomMenu customMenu)
|
private void DoShowRelations(cSwapCaseInfo swapCaseData, CustomMenu customMenu, SupportCaseController supportCaseController)
|
||||||
{
|
{
|
||||||
|
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
@@ -669,7 +675,7 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
{
|
{
|
||||||
IsMatchingRelation = isMatchingRelation,
|
IsMatchingRelation = isMatchingRelation,
|
||||||
IsUsedForCaseEnrichment = true,
|
IsUsedForCaseEnrichment = true,
|
||||||
UiAction = new cChangeHealthCardAction(storedRelation)
|
UiAction = new cChangeHealthCardAction(storedRelation, supportCaseController)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
xmlns:local="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
||||||
xmlns:uc="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
xmlns:uc="clr-namespace:FasdDesktopUi.Pages.DetailsPage.UserControls"
|
||||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon"
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
xmlns:config="clr-namespace:C4IT.FASD.Base;assembly=F4SD-Cockpit-Client-Base"
|
xmlns:config="clr-namespace:C4IT.FASD.Base;assembly=F4SD-Cockpit-Client-Base"
|
||||||
x:Name="_this"
|
x:Name="_this"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
d:Background="White"
|
d:Background="White"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
DataContext="{Binding RelativeSource={RelativeSource Self}}" Loaded="UserControl_Loaded">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
|
<vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
|
||||||
@@ -50,6 +50,15 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</StackPanel.Resources>
|
</StackPanel.Resources>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="RawValuesButton"
|
||||||
|
Margin="7.5 0 0 0"
|
||||||
|
Visibility="Collapsed"
|
||||||
|
ToolTip="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.NavBar.ShowRawValues}"
|
||||||
|
SelectedMaterialIcon="ic_view_list"
|
||||||
|
MouseUp="RawValuesButton_Click"
|
||||||
|
TouchDown="RawValuesButton_Click"
|
||||||
|
/>
|
||||||
|
|
||||||
<ico:AdaptableIcon x:Name="MinimizeButton"
|
<ico:AdaptableIcon x:Name="MinimizeButton"
|
||||||
BorderPadding="0 10 0 0"
|
BorderPadding="0 10 0 0"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
using System.Windows;
|
using System;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
using FasdDesktopUi.Basics.UiActions;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
||||||
{
|
{
|
||||||
public partial class DetailsPageWindowStateBar : UserControl
|
public partial class DetailsPageWindowStateBar : UserControl
|
||||||
@@ -11,6 +14,14 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (cFasdCockpitConfig.Instance?.ShowRawHealthcardValues == true)
|
||||||
|
RawValuesButton.Visibility = Visibility.Visible;
|
||||||
|
else
|
||||||
|
RawValuesButton.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
private void MinimizeButton_Click(object sender, InputEventArgs e)
|
private void MinimizeButton_Click(object sender, InputEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is UIElement senderVisual)
|
if (sender is UIElement senderVisual)
|
||||||
@@ -28,5 +39,11 @@ namespace FasdDesktopUi.Pages.DetailsPage.UserControls
|
|||||||
if (sender is UIElement senderVisual)
|
if (sender is UIElement senderVisual)
|
||||||
Window.GetWindow(senderVisual).Close();
|
Window.GetWindow(senderVisual).Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RawValuesButton_Click(object sender, InputEventArgs e)
|
||||||
|
{
|
||||||
|
cUiActionBase.RaiseEvent(new UiShowRawHealthcardValues(), this, this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
<Window x:Class="FasdDesktopUi.Pages.RawHealthCardValuesPage.RawHealthCardValuesPage"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:FasdDesktopUi.Pages.RawHealthCardValuesPage"
|
||||||
|
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||||
|
xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="F4SD Raw healthcard values"
|
||||||
|
Height="800" Width="1024"
|
||||||
|
MinHeight="800" MinWidth="1024" Loaded="Window_Loaded"
|
||||||
|
>
|
||||||
|
<WindowChrome.WindowChrome>
|
||||||
|
<WindowChrome CaptionHeight="20" />
|
||||||
|
</WindowChrome.WindowChrome>
|
||||||
|
<Window.Resources>
|
||||||
|
<vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
|
||||||
|
<Style x:Key="AdaptableIconButtonStyle" TargetType="ico:AdaptableIcon">
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource Color.Menu.Icon}" />
|
||||||
|
<Setter Property="Margin" Value="7.5 0" />
|
||||||
|
<Setter Property="BorderPadding" Value="0" />
|
||||||
|
<Setter Property="IconHeight" Value="25" />
|
||||||
|
<Setter Property="IconWidth" Value="25" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="PrimaryIconColor" Value="{DynamicResource Color.Menu.Icon.Hover}" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Window.Resources>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="45"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="20"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" FontSize="12" Margin="0,0,0,0" Text="Dieter Sagawe | PC010089" />
|
||||||
|
<TextBlock VerticalAlignment="Center" Margin="20,0,0,0" FontSize="12" Text="Origin filter:" />
|
||||||
|
<ComboBox Name="OriginFilterComboBox" Width="150" Height="28" FontSize="12" Margin="5,0,0,0" SelectionChanged="OriginFilterComboBox_SelectionChanged">
|
||||||
|
<ComboBoxItem Content="All" IsSelected="True"/>
|
||||||
|
<ComboBoxItem Content="Main"/>
|
||||||
|
<ComboBoxItem Content="Active Directory"/>
|
||||||
|
<ComboBoxItem Content="Azure AD"/>
|
||||||
|
<ComboBoxItem Content="F4SD Agent"/>
|
||||||
|
<ComboBoxItem Content="Intune"/>
|
||||||
|
<ComboBoxItem Content="Citrix"/>
|
||||||
|
<ComboBoxItem Content="Matrix42"/>
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" WindowChrome.IsHitTestVisibleInChrome="True">
|
||||||
|
<ico:AdaptableIcon x:Name="MinimizeButton"
|
||||||
|
Style="{StaticResource AdaptableIconButtonStyle}"
|
||||||
|
BorderPadding="0 10 0 0"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
MouseUp="MinimizeButton_Click"
|
||||||
|
TouchDown="MinimizeButton_Click"
|
||||||
|
ToolTip="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.NavBar.Minimize}"
|
||||||
|
SelectedInternIcon="window_minimize" />
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="WindowSizeButton"
|
||||||
|
MouseUp="WindowSizeButton_Click"
|
||||||
|
TouchDown="WindowSizeButton_Click">
|
||||||
|
|
||||||
|
<ico:AdaptableIcon.Resources>
|
||||||
|
<Style TargetType="ico:AdaptableIcon"
|
||||||
|
BasedOn="{StaticResource AdaptableIconButtonStyle}">
|
||||||
|
<Setter Property="SelectedInternIcon"
|
||||||
|
Value="window_fullscreen" />
|
||||||
|
<Setter Property="ToolTip"
|
||||||
|
Value="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.NavBar.Maximize}" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=WindowState}"
|
||||||
|
Value="Normal">
|
||||||
|
<Setter Property="SelectedInternIcon"
|
||||||
|
Value="window_fullscreen" />
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=WindowState}"
|
||||||
|
Value="Maximized">
|
||||||
|
<Setter Property="SelectedInternIcon"
|
||||||
|
Value="window_fullscreenExit" />
|
||||||
|
<Setter Property="ToolTip"
|
||||||
|
Value="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.NavBar.UnMaximize}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ico:AdaptableIcon.Resources>
|
||||||
|
</ico:AdaptableIcon>
|
||||||
|
|
||||||
|
<ico:AdaptableIcon x:Name="CloseButton"
|
||||||
|
Style="{StaticResource AdaptableIconButtonStyle}"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
ToolTip="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.NavBar.Close}"
|
||||||
|
MouseUp="CloseButton_Click"
|
||||||
|
TouchDown="CloseButton_Click"
|
||||||
|
SelectedInternIcon="window_close" />
|
||||||
|
</StackPanel>
|
||||||
|
<TreeView Grid.Row="1" Grid.Column="1" Name="RawValuesTreeView" />
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
using C4IT.FASD.Base;
|
||||||
|
using C4IT.MultiLanguage;
|
||||||
|
|
||||||
|
namespace FasdDesktopUi.Pages.RawHealthCardValuesPage
|
||||||
|
{
|
||||||
|
public partial class RawHealthCardValuesPage : Window
|
||||||
|
{
|
||||||
|
private enumDataHistoryOrigin originFilter = enumDataHistoryOrigin.Unknown;
|
||||||
|
|
||||||
|
public RawHealthCardValuesPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CloseButton_Click(object sender, InputEventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MinimizeButton_Click(object sender, InputEventArgs e)
|
||||||
|
{
|
||||||
|
this.WindowState = WindowState.Minimized;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void WindowSizeButton_Click(object sender, InputEventArgs e)
|
||||||
|
{
|
||||||
|
this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
OriginFilterComboBox.Items.Clear();
|
||||||
|
foreach (enumDataHistoryOrigin origin in Enum.GetValues(typeof(enumDataHistoryOrigin)))
|
||||||
|
{
|
||||||
|
string _name = cMultiLanguageSupport.GetItem("Global.Enumeration.DataHistoryOrigin." + origin.ToString());
|
||||||
|
if (string.IsNullOrEmpty(_name))
|
||||||
|
_name = origin.ToString();
|
||||||
|
OriginFilterComboBox.Items.Add(new ComboBoxItem() { Content = _name, Tag = origin});
|
||||||
|
}
|
||||||
|
OriginFilterComboBox.SelectedIndex = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OriginFilterComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (OriginFilterComboBox.SelectedItem is ComboBoxItem selectedItem && selectedItem.Tag is enumDataHistoryOrigin selectedOrigin)
|
||||||
|
originFilter = selectedOrigin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,13 +75,13 @@
|
|||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Border Grid.Row="0">
|
<Border Grid.Row="0">
|
||||||
<CheckBox x:Name="FilterCheckbox"
|
<CheckBox x:Name="FilterCheckbox"
|
||||||
Style="{DynamicResource ToggleSwitch}"
|
Style="{DynamicResource ToggleSwitch}"
|
||||||
Margin="0 7 50 129"
|
Margin="0 7 50 129"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Visibility="Visible">
|
Visibility="Visible">
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
@@ -107,16 +107,27 @@
|
|||||||
Visibility="Visible" />
|
Visibility="Visible" />
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Border Grid.Row="0">
|
<Border Grid.Row="0">
|
||||||
<Label x:Name="TicketOverviewLabel"
|
<StackPanel Orientation="Horizontal"
|
||||||
Content="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=TicketOverview.Header}"
|
Margin="9 0 0 0"
|
||||||
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
VerticalAlignment="Top"
|
||||||
Margin="9 0 0 0"
|
HorizontalAlignment="Left">
|
||||||
VerticalAlignment="Top"
|
<Label x:Name="TicketOverviewLabel"
|
||||||
HorizontalAlignment="Left"
|
Content="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=TicketOverview.Header}"
|
||||||
FontWeight="Bold"
|
Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
|
||||||
Visibility="Visible" />
|
VerticalAlignment="Top"
|
||||||
</Border>
|
HorizontalAlignment="Left"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Visibility="Visible" />
|
||||||
|
<buc:Badge Margin="6 0 0 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="Beta">
|
||||||
|
<buc:Badge.LayoutTransform>
|
||||||
|
<ScaleTransform ScaleX="0.85" ScaleY="0.85" />
|
||||||
|
</buc:Badge.LayoutTransform>
|
||||||
|
</buc:Badge>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!--Grid Row 2 SearchResult + SearchHistory-->
|
<!--Grid Row 2 SearchResult + SearchHistory-->
|
||||||
@@ -154,8 +165,11 @@
|
|||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Visibility="Collapsed">
|
Visibility="Collapsed">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<buc:CustomSearchResultCollection x:Name="ResultMenu"
|
<buc:CustomSearchResultCollection x:Name="ResultMenu"
|
||||||
x:FieldModifier="private" />
|
x:FieldModifier="private"
|
||||||
|
PreviewMouseWheel="ResultMenu_PreviewMouseWheel"/>
|
||||||
|
</ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using System.Reflection;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
@@ -32,9 +33,12 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
{
|
{
|
||||||
public partial class SearchPageView : Window, ISearchUiProvider
|
public partial class SearchPageView : Window, ISearchUiProvider
|
||||||
{
|
{
|
||||||
private static SearchPageView _instance = null;
|
private static SearchPageView _instance = null;
|
||||||
private const int WM_NCHITTEST = 0x0084;
|
private const int WM_NCHITTEST = 0x0084;
|
||||||
private const int HTTRANSPARENT = -1;
|
private const int HTTRANSPARENT = -1;
|
||||||
|
private readonly HashSet<TileScope> _ticketOverviewNotificationScopesPrimed = new HashSet<TileScope>();
|
||||||
|
private bool _ticketOverviewFirstEventHandled;
|
||||||
|
private readonly HashSet<TileScope> _ticketOverviewInitWasEmptyScopes = new HashSet<TileScope>();
|
||||||
public static SearchPageView Instance
|
public static SearchPageView Instance
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -62,72 +66,155 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
|
|
||||||
public SupportCaseSearchService SearchService { get; } = new SupportCaseSearchService(new RelationService());
|
public SupportCaseSearchService SearchService { get; } = new SupportCaseSearchService(new RelationService());
|
||||||
|
|
||||||
private SearchPageView()
|
private SearchPageView()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Visibility = Visibility.Visible;
|
Visibility = Visibility.Visible;
|
||||||
_instance = this;
|
_instance = this;
|
||||||
|
|
||||||
// FilterToggleCheckBox-Events registrieren
|
GetPrimaryScreenSize();
|
||||||
FilterCheckbox.Checked += (s, e) => FilterToggleCheckedChanged?.Invoke(this, true);
|
|
||||||
FilterCheckbox.Unchecked += (s, e) => FilterToggleCheckedChanged?.Invoke(this, false);
|
// FilterToggleCheckBox-Events registrieren
|
||||||
|
FilterCheckbox.Checked += (s, e) => FilterToggleCheckedChanged?.Invoke(this, true);
|
||||||
Loaded += (s, e) =>
|
FilterCheckbox.Unchecked += (s, e) => FilterToggleCheckedChanged?.Invoke(this, false);
|
||||||
{
|
|
||||||
Hide();
|
Loaded += (s, e) =>
|
||||||
SearchBarUc.ActivateManualSearch();
|
{
|
||||||
};
|
Hide();
|
||||||
|
SearchBarUc.ActivateManualSearch();
|
||||||
AddCustomEventHandlers();
|
ScheduleSearchResultMaxHeightUpdate();
|
||||||
|
};
|
||||||
UiSettingsChanged(null, null);
|
SizeChanged += (s, e) => ScheduleSearchResultMaxHeightUpdate();
|
||||||
|
SearchBarUc.SizeChanged += (s, e) => ScheduleSearchResultMaxHeightUpdate();
|
||||||
if (TicketOverviewUpdateService.Instance != null)
|
BodyStack_TicketOverview.SizeChanged += (s, e) => ScheduleSearchResultMaxHeightUpdate();
|
||||||
{
|
SearchHistoryBorder.SizeChanged += (s, e) => ScheduleSearchResultMaxHeightUpdate();
|
||||||
TicketOverviewUpdateService.Instance.Start();
|
|
||||||
TicketOverviewUpdateService.Instance.OverviewCountsChanged += TicketOverviewUpdateService_OverviewCountsChanged;
|
AddCustomEventHandlers();
|
||||||
}
|
|
||||||
}
|
if (TicketOverviewUpdateService.Instance != null)
|
||||||
catch (Exception E)
|
{
|
||||||
{
|
TicketOverviewUpdateService.Instance.OverviewCountsChanged += TicketOverviewUpdateService_OverviewCountsChanged;
|
||||||
LogException(E);
|
}
|
||||||
}
|
|
||||||
|
UiSettingsChanged(null, null);
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetSearchResultVisibility(bool isVisible)
|
public void GetPrimaryScreenSize()
|
||||||
{
|
{
|
||||||
SearchResultBorder.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
|
UpdateSearchResultMaxHeight();
|
||||||
BodyStack_SearchResults.Visibility = (isVisible || SearchResultBorder.IsVisible) ? Visibility.Visible : Visibility.Collapsed;
|
}
|
||||||
}
|
|
||||||
|
private void ScheduleSearchResultMaxHeightUpdate()
|
||||||
|
{
|
||||||
|
if (Dispatcher == null || Dispatcher.HasShutdownStarted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Dispatcher.BeginInvoke((Action)UpdateSearchResultMaxHeight, DispatcherPriority.Loaded);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateSearchResultMaxHeight()
|
||||||
|
{
|
||||||
|
if (SearchResultBorder == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var workAreaHeight = ActualHeight > 0 ? ActualHeight : SystemParameters.WorkArea.Height;
|
||||||
|
var reservedHeight = 0.0;
|
||||||
|
|
||||||
|
reservedHeight += GetVisibleHeightWithMargin(SearchBarUc);
|
||||||
|
reservedHeight += GetVisibleHeightWithMargin(BodyStack_TicketOverview);
|
||||||
|
reservedHeight += GetVisibleHeightWithMargin(SearchHistoryBorder);
|
||||||
|
|
||||||
|
if (MainBorder != null)
|
||||||
|
{
|
||||||
|
reservedHeight += MainBorder.Padding.Top + MainBorder.Padding.Bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
var searchResultMargin = SearchResultBorder.Margin;
|
||||||
|
var availableHeight = workAreaHeight - reservedHeight - searchResultMargin.Top - searchResultMargin.Bottom;
|
||||||
|
availableHeight = Math.Max(0, availableHeight);
|
||||||
|
SearchResultBorder.MaxHeight = availableHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double GetVisibleHeightWithMargin(FrameworkElement element)
|
||||||
|
{
|
||||||
|
if (element == null || element.Visibility != Visibility.Visible)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
var margin = element.Margin;
|
||||||
|
return element.ActualHeight + margin.Top + margin.Bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetSearchResultVisibility(bool isVisible)
|
||||||
|
{
|
||||||
|
SearchResultBorder.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
BodyStack_SearchResults.Visibility = (isVisible || SearchResultBorder.IsVisible) ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
ScheduleSearchResultMaxHeightUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSearchHistoryVisibility(bool isVisible)
|
||||||
|
{
|
||||||
|
SearchHistoryBorder.Visibility = isVisible && !SearchHistory.IsEmpty() ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
BodyStack_SearchResults.Visibility = (isVisible || SearchResultBorder.IsVisible) ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
ScheduleSearchResultMaxHeightUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
public void SetSearchHistoryVisibility(bool isVisible)
|
private bool CheckTicketOverviewAvailability()
|
||||||
{
|
{
|
||||||
SearchHistoryBorder.Visibility = isVisible && !SearchHistory.IsEmpty() ? Visibility.Visible : Visibility.Collapsed;
|
return cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.ShowOverview == true;
|
||||||
BodyStack_SearchResults.Visibility = (isVisible || SearchResultBorder.IsVisible) ? Visibility.Visible : Visibility.Collapsed;
|
}
|
||||||
}
|
|
||||||
|
private void UpdateTicketOverviewAvailability()
|
||||||
|
{
|
||||||
|
var enabled = CheckTicketOverviewAvailability();
|
||||||
|
var service = TicketOverviewUpdateService.Instance;
|
||||||
|
service?.UpdateAvailability(enabled);
|
||||||
|
if (enabled)
|
||||||
|
_ = service?.FetchAsync();
|
||||||
|
|
||||||
|
if (!enabled)
|
||||||
|
{
|
||||||
|
if (Dispatcher.CheckAccess())
|
||||||
|
{
|
||||||
|
ApplyTicketOverviewDisabledState();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(ApplyTicketOverviewDisabledState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyTicketOverviewDisabledState()
|
||||||
|
{
|
||||||
|
_renderTicketOverviewUserNames = false;
|
||||||
|
_ticketOverviewNotificationScopesPrimed.Clear();
|
||||||
|
_ticketOverviewFirstEventHandled = false;
|
||||||
|
_ticketOverviewInitWasEmptyScopes.Clear();
|
||||||
|
SetTicketOverviewVisibility(false);
|
||||||
|
(Application.Current as App)?.ClearTicketOverviewTrayNotification();
|
||||||
|
}
|
||||||
|
|
||||||
private bool CheckTicketOverviewAvailability()
|
private void SetTicketOverviewVisibility(bool isVisible)
|
||||||
{
|
{
|
||||||
if (cFasdCockpitCommunicationBase.Instance.IsDemo())
|
var b = isVisible;
|
||||||
return true;
|
if (!CheckTicketOverviewAvailability())
|
||||||
return false;
|
b = false;
|
||||||
}
|
|
||||||
|
|
||||||
private void SetTicketOverviewVisibility(bool isVisible)
|
|
||||||
{
|
|
||||||
var b = isVisible;
|
|
||||||
if (!CheckTicketOverviewAvailability())
|
|
||||||
b = false;
|
|
||||||
|
|
||||||
BodyStack_TicketOverview.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
BodyStack_TicketOverview.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
||||||
TicketOverviewBorder.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
TicketOverviewBorder.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
||||||
FilterCheckbox.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
FilterCheckbox.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
||||||
RoleLabel.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
RoleLabel.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
||||||
OwnTicketsLabel.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
OwnTicketsLabel.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
||||||
TicketOverviewLabel.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
TicketOverviewLabel.Visibility = b ? Visibility.Visible : Visibility.Collapsed;
|
||||||
}
|
ScheduleSearchResultMaxHeightUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
public void ShowLoadingTextItem(string itemText)
|
public void ShowLoadingTextItem(string itemText)
|
||||||
{
|
{
|
||||||
@@ -135,10 +222,10 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
ResultMenu.ShowLoadingTextItem(itemText);
|
ResultMenu.ShowLoadingTextItem(itemText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowTicketOverviewPane()
|
public void ShowTicketOverviewPane()
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
bool overviewAlreadyVisible = TicketOverviewBorder.Visibility == Visibility.Visible;
|
bool overviewAlreadyVisible = TicketOverviewBorder.Visibility == Visibility.Visible;
|
||||||
|
|
||||||
SetTicketOverviewVisibility(true);
|
SetTicketOverviewVisibility(true);
|
||||||
@@ -151,10 +238,28 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
}
|
}
|
||||||
TicketOverviewUc?.RefreshHighlightState(IsFilterChecked);
|
TicketOverviewUc?.RefreshHighlightState(IsFilterChecked);
|
||||||
|
|
||||||
var app = Application.Current as FasdDesktopUi.App;
|
var app = Application.Current as FasdDesktopUi.App;
|
||||||
app?.ClearTicketOverviewTrayNotification();
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowTicketOverviewPaneForScope(TileScope? scope)
|
||||||
|
{
|
||||||
|
if (scope.HasValue)
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (TicketOverviewBorder.Visibility == Visibility.Visible)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var useRoleScope = scope.Value == TileScope.Role;
|
||||||
|
if (FilterCheckbox != null && FilterCheckbox.IsChecked != useRoleScope)
|
||||||
|
FilterCheckbox.IsChecked = useRoleScope;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowTicketOverviewPane();
|
||||||
|
}
|
||||||
|
|
||||||
internal void CloseTicketOverviewResults()
|
internal void CloseTicketOverviewResults()
|
||||||
{
|
{
|
||||||
@@ -192,7 +297,7 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
|
|
||||||
enumFasdInformationClass GetInformationClass(cF4sdApiSearchResultRelation relation) => cF4sdIdentityEntry.GetFromSearchResult(relation.Type);
|
enumFasdInformationClass GetInformationClass(cF4sdApiSearchResultRelation relation) => cF4sdIdentityEntry.GetFromSearchResult(relation.Type);
|
||||||
|
|
||||||
cMenuDataBase GetMenuData(cF4sdApiSearchResultRelation relation, IRelationService trelationService)
|
cMenuDataBase GetMenuData(cF4sdApiSearchResultRelation relation, IRelationService subRelationService)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -837,37 +942,178 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TicketOverviewUpdateService_OverviewCountsChanged(object sender, TicketOverviewCountsChangedEventArgs e)
|
private void TicketOverviewUpdateService_OverviewCountsChanged(object sender, TicketOverviewCountsChangedEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ApplyLatestCounts();
|
ApplyLatestCounts();
|
||||||
var positiveChanges = e.Changes?.Where(change => change.Delta > 0).ToList();
|
var positiveChanges = e.Changes?.Where(change => change.Delta > 0).ToList();
|
||||||
TicketOverviewUc?.SetHighlights(positiveChanges, IsFilterChecked);
|
var app = Application.Current as FasdDesktopUi.App;
|
||||||
|
var service = TicketOverviewUpdateService.Instance;
|
||||||
var app = Application.Current as FasdDesktopUi.App;
|
|
||||||
|
if (!_ticketOverviewFirstEventHandled)
|
||||||
if (positiveChanges == null || positiveChanges.Count == 0)
|
{
|
||||||
{
|
_ticketOverviewFirstEventHandled = true;
|
||||||
app?.ClearTicketOverviewTrayNotification();
|
foreach (var scope in GetTicketOverviewEventScopes(e))
|
||||||
return;
|
{
|
||||||
}
|
PrimeTicketOverviewScope(scope);
|
||||||
|
TrackEmptyInitScope(scope, e?.CurrentCounts);
|
||||||
var message = BuildNotificationMessage(positiveChanges);
|
}
|
||||||
if (string.IsNullOrWhiteSpace(message))
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
{
|
return;
|
||||||
app?.ClearTicketOverviewTrayNotification();
|
}
|
||||||
return;
|
|
||||||
}
|
if (e.InitializedScope.HasValue)
|
||||||
|
{
|
||||||
app?.ShowTicketOverviewTrayNotification(message);
|
PrimeTicketOverviewScope(e.InitializedScope.Value);
|
||||||
ShowTicketOverviewNotification(message);
|
TrackEmptyInitScope(e.InitializedScope.Value, e?.CurrentCounts);
|
||||||
}
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
catch (Exception ex)
|
return;
|
||||||
{
|
}
|
||||||
LogException(ex);
|
|
||||||
}
|
if (positiveChanges == null || positiveChanges.Count == 0)
|
||||||
}
|
{
|
||||||
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (service != null && !service.AreAllScopesInitialized)
|
||||||
|
{
|
||||||
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var filteredChanges = FilterChangesForPrimedScopes(positiveChanges);
|
||||||
|
if (filteredChanges.Count == 0)
|
||||||
|
{
|
||||||
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TicketOverviewUc?.SetHighlights(filteredChanges, IsFilterChecked);
|
||||||
|
|
||||||
|
var pendingScope = ResolveSingleScope(filteredChanges);
|
||||||
|
app?.SetTicketOverviewNotificationScope(pendingScope);
|
||||||
|
|
||||||
|
var message = BuildNotificationMessage(filteredChanges);
|
||||||
|
if (string.IsNullOrWhiteSpace(message))
|
||||||
|
{
|
||||||
|
app?.ClearTicketOverviewTrayNotification();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
app?.ShowTicketOverviewTrayNotification(message);
|
||||||
|
ShowTicketOverviewNotification(message);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PrimeTicketOverviewScope(TileScope scope)
|
||||||
|
{
|
||||||
|
if (_ticketOverviewNotificationScopesPrimed.Add(scope))
|
||||||
|
{
|
||||||
|
TicketOverviewUc?.ClearHighlightsForScope(scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private IReadOnlyList<TileCountChange> FilterChangesForPrimedScopes(IReadOnlyList<TileCountChange> changes)
|
||||||
|
{
|
||||||
|
if (changes == null || changes.Count == 0)
|
||||||
|
return Array.Empty<TileCountChange>();
|
||||||
|
|
||||||
|
var filteredChanges = new List<TileCountChange>(changes.Count);
|
||||||
|
var unprimedScopes = new HashSet<TileScope>();
|
||||||
|
var silentInitScopes = new HashSet<TileScope>();
|
||||||
|
|
||||||
|
foreach (var change in changes)
|
||||||
|
{
|
||||||
|
if (_ticketOverviewInitWasEmptyScopes.Contains(change.Scope))
|
||||||
|
{
|
||||||
|
silentInitScopes.Add(change.Scope);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_ticketOverviewNotificationScopesPrimed.Contains(change.Scope))
|
||||||
|
{
|
||||||
|
filteredChanges.Add(change);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unprimedScopes.Add(change.Scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var scope in unprimedScopes)
|
||||||
|
{
|
||||||
|
PrimeTicketOverviewScope(scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (silentInitScopes.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var scope in silentInitScopes)
|
||||||
|
{
|
||||||
|
_ticketOverviewInitWasEmptyScopes.Remove(scope);
|
||||||
|
PrimeTicketOverviewScope(scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return filteredChanges;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TrackEmptyInitScope(TileScope scope, IReadOnlyDictionary<string, TileCounts> counts)
|
||||||
|
{
|
||||||
|
if (IsScopeCountsEmpty(scope, counts))
|
||||||
|
{
|
||||||
|
_ticketOverviewInitWasEmptyScopes.Add(scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsScopeCountsEmpty(TileScope scope, IReadOnlyDictionary<string, TileCounts> counts)
|
||||||
|
{
|
||||||
|
if (counts == null || counts.Count == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
foreach (var kvp in counts)
|
||||||
|
{
|
||||||
|
var value = scope == TileScope.Role ? kvp.Value.Role : kvp.Value.Personal;
|
||||||
|
if (value != 0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<TileScope> GetTicketOverviewEventScopes(TicketOverviewCountsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e == null)
|
||||||
|
return Enumerable.Empty<TileScope>();
|
||||||
|
|
||||||
|
if (e.InitializedScope.HasValue)
|
||||||
|
return new[] { e.InitializedScope.Value };
|
||||||
|
|
||||||
|
if (e.Changes == null || e.Changes.Count == 0)
|
||||||
|
return Enumerable.Empty<TileScope>();
|
||||||
|
|
||||||
|
return e.Changes.Select(change => change.Scope).Distinct();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static TileScope? ResolveSingleScope(IReadOnlyList<TileCountChange> changes)
|
||||||
|
{
|
||||||
|
if (changes == null || changes.Count == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var scope = changes[0].Scope;
|
||||||
|
for (int i = 1; i < changes.Count; i++)
|
||||||
|
{
|
||||||
|
if (changes[i].Scope != scope)
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return scope;
|
||||||
|
}
|
||||||
|
|
||||||
private void ApplyLatestCounts()
|
private void ApplyLatestCounts()
|
||||||
{
|
{
|
||||||
@@ -1082,11 +1328,12 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
|
|
||||||
SetPendingInformationClasses(new HashSet<enumFasdInformationClass> { enumFasdInformationClass.Ticket });
|
SetPendingInformationClasses(new HashSet<enumFasdInformationClass> { enumFasdInformationClass.Ticket });
|
||||||
|
|
||||||
var relations = await LoadRelationsForTileAsync(e.Key, e.UseRoleScope, Math.Max(0, e.Count));
|
var relations = await LoadRelationsForTileAsync(e.Key, e.UseRoleScope, Math.Max(0, e.Count));
|
||||||
Debug.WriteLine($"[TicketOverview] Relations loaded: {relations?.Count ?? 0}");
|
Debug.WriteLine($"[TicketOverview] Relations loaded: {relations?.Count ?? 0}");
|
||||||
var firstRelation = relations.FirstOrDefault();
|
var ticketOverviewRelationService = new RelationService();
|
||||||
string displayText = header;
|
var firstRelation = relations.FirstOrDefault();
|
||||||
if (firstRelation != null)
|
string displayText = header;
|
||||||
|
if (firstRelation != null)
|
||||||
{
|
{
|
||||||
string firstSummary = null;
|
string firstSummary = null;
|
||||||
if (firstRelation.Infos != null && firstRelation.Infos.TryGetValue("Summary", out var summaryValue))
|
if (firstRelation.Infos != null && firstRelation.Infos.TryGetValue("Summary", out var summaryValue))
|
||||||
@@ -1130,16 +1377,16 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
{
|
{
|
||||||
trailingUser = userDisplayName;
|
trailingUser = userDisplayName;
|
||||||
}
|
}
|
||||||
return (cMenuDataBase)new cMenuDataSearchRelation(r)
|
return (cMenuDataBase)new cMenuDataSearchRelation(r)
|
||||||
{
|
{
|
||||||
MenuText = r.DisplayName,
|
MenuText = r.DisplayName,
|
||||||
TrailingText = trailingUser,
|
TrailingText = trailingUser,
|
||||||
UiAction = new cUiProcessSearchRelationAction(entry, r, null, this)
|
UiAction = new cUiProcessSearchRelationAction(entry, r, ticketOverviewRelationService, this)
|
||||||
{
|
{
|
||||||
DisplayType = isEnabled ? enumActionDisplayType.enabled : enumActionDisplayType.disabled,
|
DisplayType = isEnabled ? enumActionDisplayType.enabled : enumActionDisplayType.disabled,
|
||||||
Description = isEnabled ? string.Empty : disabledReason,
|
Description = isEnabled ? string.Empty : disabledReason,
|
||||||
AlternativeDescription = isEnabled ? string.Empty : disabledReason
|
AlternativeDescription = isEnabled ? string.Empty : disabledReason
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -1381,11 +1628,11 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UiSettingsChanged(object sender, EventArgs e)
|
private void UiSettingsChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var positionAlignement = cFasdCockpitConfig.Instance.Global.SmallViewAlignment;
|
var positionAlignement = cFasdCockpitConfig.Instance.Global.SmallViewAlignment;
|
||||||
|
|
||||||
switch (positionAlignement)
|
switch (positionAlignement)
|
||||||
{
|
{
|
||||||
@@ -1396,18 +1643,49 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
Dispatcher.Invoke(() => MainBorder.HorizontalAlignment = HorizontalAlignment.Right);
|
Dispatcher.Invoke(() => MainBorder.HorizontalAlignment = HorizontalAlignment.Right);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Dispatcher.Invoke(() => MainBorder.HorizontalAlignment = HorizontalAlignment.Left);
|
Dispatcher.Invoke(() => MainBorder.HorizontalAlignment = HorizontalAlignment.Left);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception E)
|
UpdateTicketOverviewAvailability();
|
||||||
{
|
}
|
||||||
LogException(E);
|
catch (Exception E)
|
||||||
}
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPendingInformationClasses(HashSet<enumFasdInformationClass> informationClasses) => Dispatcher.Invoke(() => ResultMenu.SetPendingInformationClasses(informationClasses));
|
public void SetPendingInformationClasses(HashSet<enumFasdInformationClass> informationClasses) => Dispatcher.Invoke(() => ResultMenu.SetPendingInformationClasses(informationClasses));
|
||||||
|
|
||||||
public void UpdatePendingInformationClasses(HashSet<enumFasdInformationClass> informationClasses) => Dispatcher.Invoke(() => ResultMenu.UpdatePendingInformationClasses(informationClasses));
|
public void UpdatePendingInformationClasses(HashSet<enumFasdInformationClass> informationClasses) => Dispatcher.Invoke(() => ResultMenu.UpdatePendingInformationClasses(informationClasses));
|
||||||
|
|
||||||
|
private void ResultMenu_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
var scrollViewer = FindParent<ScrollViewer>((DependencyObject)sender);
|
||||||
|
|
||||||
|
if (scrollViewer != null)
|
||||||
|
{
|
||||||
|
if (e.Delta > 0)
|
||||||
|
scrollViewer.LineUp();
|
||||||
|
else
|
||||||
|
scrollViewer.LineDown();
|
||||||
|
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private T FindParent<T>(DependencyObject child) where T : DependencyObject
|
||||||
|
{
|
||||||
|
DependencyObject parent = VisualTreeHelper.GetParent(child);
|
||||||
|
|
||||||
|
while (parent != null)
|
||||||
|
{
|
||||||
|
if (parent is T typed)
|
||||||
|
return typed;
|
||||||
|
|
||||||
|
parent = VisualTreeHelper.GetParent(parent);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
|
xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
|
||||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="PhoneSettingsPage"
|
Title="M42SettingsPage"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ namespace FasdDesktopUi.Pages.SlimPage
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = await _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.SlimCard.GetDataAsync();
|
var data = await _supportCaseController?.SupportCaseDataProviderArtifact.HealthCardDataHelper.SlimCard.GetDataAsync();
|
||||||
//todo: check if there is a more performant way solving this
|
//todo: check if there is a more performant way solving this
|
||||||
Dispatcher.Invoke(() => WidgetCollectionUc.HeadingData = data.HeadingData);
|
Dispatcher.Invoke(() => WidgetCollectionUc.HeadingData = data.HeadingData);
|
||||||
Dispatcher.Invoke(() => WidgetCollectionUc.WidgetData = data.WidgetData);
|
Dispatcher.Invoke(() => WidgetCollectionUc.WidgetData = data.WidgetData);
|
||||||
@@ -339,17 +339,17 @@ namespace FasdDesktopUi.Pages.SlimPage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var data = await _supportCase?.SupportCaseDataProviderArtifact.HealthCardDataHelper.SlimCard.GetDataAsync();
|
var data = await _supportCaseController?.SupportCaseDataProviderArtifact.HealthCardDataHelper.SlimCard.GetDataAsync();
|
||||||
//todo: check if there is a more performant way solving this
|
//todo: check if there is a more performant way solving this
|
||||||
Dispatcher.Invoke(() => WidgetCollectionUc.HeadingData = data.HeadingData);
|
Dispatcher.Invoke(() => WidgetCollectionUc.HeadingData = data.HeadingData);
|
||||||
Dispatcher.Invoke(() => WidgetCollectionUc.WidgetData = data.WidgetData);
|
Dispatcher.Invoke(() => WidgetCollectionUc.WidgetData = data.WidgetData);
|
||||||
Dispatcher.Invoke(() => MenuBarUc.MenuBarItemData = GetSlimpageMenuBarData(data.MenuBarData));
|
Dispatcher.Invoke(() => MenuBarUc.MenuBarItemData = GetSlimpageMenuBarData(data.MenuBarData));
|
||||||
Dispatcher.Invoke(() => DataHistoryCollectionUc.UpdateHistory(data.DataHistoryList));
|
Dispatcher.Invoke(() => DataHistoryCollectionUc.UpdateHistory(data.DataHistoryList));
|
||||||
|
|
||||||
if (_supportCase != null)
|
if (_supportCaseController != null)
|
||||||
{
|
{
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataChanged -= DataProvider_DataChanged;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataChanged -= DataProvider_DataChanged;
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataFullyLoaded -= DataProvider_DataFullyLoaded;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataFullyLoaded -= DataProvider_DataFullyLoaded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -364,7 +364,7 @@ namespace FasdDesktopUi.Pages.SlimPage
|
|||||||
{
|
{
|
||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
bool hasDirectConnection = _supportCase?.SupportCaseDataProviderArtifact?.DirectConnectionHelper?.IsDirectConnectionActive ?? false;
|
bool hasDirectConnection = _supportCaseController?.SupportCaseDataProviderArtifact?.DirectConnectionHelper?.IsDirectConnectionActive ?? false;
|
||||||
WidgetCollectionUc.HasDirectConnection = hasDirectConnection;
|
WidgetCollectionUc.HasDirectConnection = hasDirectConnection;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -495,7 +495,7 @@ namespace FasdDesktopUi.Pages.SlimPage
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await e.UiAction?.RunUiActionAsync(e.OriginalSource, drawingArea, false, _supportCase?.SupportCaseDataProviderArtifact);
|
await e.UiAction?.RunUiActionAsync(e.OriginalSource, drawingArea, false, _supportCaseController?.SupportCaseDataProviderArtifact);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
|
|||||||
@@ -4,30 +4,30 @@ using System.Windows;
|
|||||||
|
|
||||||
using FasdDesktopUi.Basics;
|
using FasdDesktopUi.Basics;
|
||||||
using FasdDesktopUi.Basics.Models;
|
using FasdDesktopUi.Basics.Models;
|
||||||
using FasdDesktopUi.Basics.Services.SupportCase;
|
using FasdDesktopUi.Basics.Services.SupportCase.Controllers;
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Pages
|
namespace FasdDesktopUi.Pages
|
||||||
{
|
{
|
||||||
public class SupportCasePageBase : Window, IBlurrable
|
public class SupportCasePageBase : Window, IBlurrable
|
||||||
{
|
{
|
||||||
protected ISupportCase _supportCase;
|
protected SupportCaseController _supportCaseController;
|
||||||
|
|
||||||
internal bool isDataChangedEventRunning = false;
|
internal bool isDataChangedEventRunning = false;
|
||||||
|
|
||||||
public virtual void SetSupportCase(ISupportCase supportCase)
|
internal virtual void SetSupportCaseController(SupportCaseController supportCase)
|
||||||
{
|
{
|
||||||
if (_supportCase != null)
|
if (_supportCaseController != null)
|
||||||
{
|
{
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataChanged -= DataProvider_DataChanged;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataChanged -= DataProvider_DataChanged;
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataFullyLoaded -= DataProvider_DataFullyLoaded;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataFullyLoaded -= DataProvider_DataFullyLoaded;
|
||||||
_supportCase.SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionChanged -= DirectConnectionHelper_DirectConnectionChanged;
|
_supportCaseController.SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionChanged -= DirectConnectionHelper_DirectConnectionChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
_supportCase = supportCase;
|
_supportCaseController = supportCase;
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataChanged += DataProvider_DataChanged;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataChanged += DataProvider_DataChanged;
|
||||||
_supportCase.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataFullyLoaded += DataProvider_DataFullyLoaded;
|
_supportCaseController.SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.DataFullyLoaded += DataProvider_DataFullyLoaded;
|
||||||
_supportCase.SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionChanged += DirectConnectionHelper_DirectConnectionChanged;
|
_supportCaseController.SupportCaseDataProviderArtifact.DirectConnectionHelper.DirectConnectionChanged += DirectConnectionHelper_DirectConnectionChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
internal async void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
<Style x:Key="ToggleSwitch"
|
<Style x:Key="ToggleSwitch"
|
||||||
TargetType="CheckBox">
|
TargetType="CheckBox">
|
||||||
<Setter Property="Height"
|
<Setter Property="Height"
|
||||||
Value="15" />
|
Value="15" />
|
||||||
<Setter Property="ToolTipService.ShowOnDisabled"
|
<Setter Property="ToolTipService.ShowOnDisabled"
|
||||||
@@ -105,5 +105,6 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
</ResourceDictionary>
|
|
||||||
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<!--Cursors-->
|
<!--Cursors-->
|
||||||
<Cursor x:Key="Cursor.Copy">../Resources/Cursors/Hand_Clipboard_Light.cur</Cursor>
|
<Cursor x:Key="Cursor.Copy">../Resources/Cursors/Hand_Clipboard_Light.cur</Cursor>
|
||||||
|
|
||||||
<!--Common Styles-->
|
<!--Common Styles-->
|
||||||
|
|
||||||
<SolidColorBrush x:Key="Color.AppBackground"
|
<SolidColorBrush x:Key="Color.AppBackground"
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ namespace FasdDesktopUi
|
|||||||
[RegConfig]
|
[RegConfig]
|
||||||
public string LastDownloadPath = "";
|
public string LastDownloadPath = "";
|
||||||
|
|
||||||
|
[RegConfig]
|
||||||
|
public bool ShowRawHealthcardValues = false;
|
||||||
|
|
||||||
[RegConfigSubItem]
|
[RegConfigSubItem]
|
||||||
public cFasdCockpitConfigPhoneSupport PhoneSupport = new cFasdCockpitConfigPhoneSupport();
|
public cFasdCockpitConfigPhoneSupport PhoneSupport = new cFasdCockpitConfigPhoneSupport();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="C4IT.F4SD.DisplayFormatting" version="0.0.1-preview-0.0.2" targetFramework="net472" />
|
<package id="C4IT.F4SD.DisplayFormatting" version="1.0.0" targetFramework="net472" />
|
||||||
|
<package id="C4IT.F4SD.SupportCaseProtocoll" version="1.0.0" targetFramework="net472" />
|
||||||
<package id="MaterialIcons" version="1.0.3" targetFramework="net472" />
|
<package id="MaterialIcons" version="1.0.3" targetFramework="net472" />
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="3.1.32" targetFramework="net472" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.2" targetFramework="net472" />
|
||||||
<package id="Microsoft.Web.WebView2" version="1.0.3240.44" targetFramework="net472" />
|
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="10.0.2" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="10.0.2" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Web.WebView2" version="1.0.3650.58" targetFramework="net472" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
|
||||||
|
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="10.0.2" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.6.3" targetFramework="net472" />
|
||||||
|
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net472" />
|
||||||
<package id="WpfAnimatedGif" version="2.0.2" targetFramework="net472" />
|
<package id="WpfAnimatedGif" version="2.0.2" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.2" newVersion="10.0.0.2" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -96,7 +96,7 @@ namespace FasdExcelToJsonConverter
|
|||||||
if (tableDictionaryEntry.Columns.ContainsKey(columnName))
|
if (tableDictionaryEntry.Columns.ContainsKey(columnName))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
tableDictionaryEntry.Columns.Add(columnName, new cF4SDHealthCardRawData.cHealthCardTableColumn() { ColumnName = columnName, Values = values.ToList() });
|
tableDictionaryEntry.Columns.Add(columnName, new cF4SDHealthCardRawData.cHealthCardTableColumn(tableDictionaryEntry) { ColumnName = columnName, Values = values.ToList() });
|
||||||
|
|
||||||
if (tableDictionaryEntry.TimeFrames == null)
|
if (tableDictionaryEntry.TimeFrames == null)
|
||||||
tableDictionaryEntry.TimeFrames = new DateTime[1, 2];
|
tableDictionaryEntry.TimeFrames = new DateTime[1, 2];
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user