aktueller Stand

This commit is contained in:
Meik
2026-02-09 19:36:39 +01:00
parent 825ddf05d4
commit d6cbbe1ef1
6 changed files with 510 additions and 186 deletions

View File

@@ -33,7 +33,6 @@ namespace FasdDesktopUi.Basics.Services
"UnassignedTickets",
"UnassignedTicketsCritical"
};
private const string DemoTicketDetailsKey = "Demo.HasTicketDetails";
private readonly Dispatcher _dispatcher;
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>>();
@@ -317,18 +316,6 @@ namespace FasdDesktopUi.Basics.Services
}
}
if (_isDemo)
{
foreach (var key in OverviewKeys)
{
var extras = GetDemoRelationCount(key, scope == TileScope.Role);
if (counts.ContainsKey(key))
counts[key] += extras;
else
counts[key] = extras;
}
}
if (!_isEnabled)
return;
@@ -560,15 +547,14 @@ namespace FasdDesktopUi.Basics.Services
Name = record.DisplayName,
id = record.TicketId,
Status = enumF4sdSearchResultStatus.Active,
Infos = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
["Summary"] = record.Summary ?? string.Empty,
["StatusId"] = record.StatusId ?? string.Empty,
["UserDisplayName"] = record.UserDisplayName ?? string.Empty,
["UserAccount"] = record.UserAccount ?? string.Empty,
["UserDomain"] = record.UserDomain ?? string.Empty,
[DemoTicketDetailsKey] = bool.TrueString
},
Infos = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
["Summary"] = record.Summary ?? string.Empty,
["StatusId"] = record.StatusId ?? string.Empty,
["UserDisplayName"] = record.UserDisplayName ?? string.Empty,
["UserAccount"] = record.UserAccount ?? string.Empty,
["UserDomain"] = record.UserDomain ?? string.Empty
},
Identities = new cF4sdIdentityList
{
new cF4sdIdentityEntry { Class = enumFasdInformationClass.Ticket, Id = record.TicketId },

View File

@@ -473,12 +473,7 @@
<Language Lang="DE">Geschlossen</Language>
</UIItem>
<UIItem Name="Searchbar.Demo.NoTicketDetails">
<Language Lang="EN">No demo ticket details available</Language>
<Language Lang="DE">Keine Demo-Ticketdetails verfügbar</Language>
</UIItem>
<UIItem Name="TicketOverview.Notification.Title">
<UIItem Name="TicketOverview.Notification.Title">
<Language Lang="EN">Ticket overview updated</Language>
<Language Lang="DE">Ticketübersicht aktualisiert</Language>
</UIItem>

View File

@@ -47,7 +47,6 @@ namespace FasdDesktopUi.Pages.SearchPage
private EventHandler _ticketOverviewAutoContinueCaseChangedHandler;
private bool _renderTicketOverviewUserNames = false;
private readonly HashSet<cSearchHistorySearchResultEntry> _ticketOverviewHistoryEntries = new HashSet<cSearchHistorySearchResultEntry>();
private const string DemoTicketHasDetailsInfoKey = "Demo.HasTicketDetails";
// Event zum auslösen wenn Toggle geändert wird
public event EventHandler<bool> FilterToggleCheckedChanged;
@@ -216,15 +215,10 @@ namespace FasdDesktopUi.Pages.SearchPage
bool isEnabled = cHealthCardDataHelper.HasAvailableHealthCard(requiredInformationClasses);
string disabledReason = null;
if (!isEnabled)
{
disabledReason = cMultiLanguageSupport.GetItem("Searchbar.NoValidHealthcard") ?? string.Empty;
}
else if (ShouldDisableTicketRelationForDemo(relation))
{
isEnabled = false;
disabledReason = cMultiLanguageSupport.GetItem("Searchbar.Demo.NoTicketDetails") ?? string.Empty;
}
if (!isEnabled)
{
disabledReason = cMultiLanguageSupport.GetItem("Searchbar.NoValidHealthcard") ?? string.Empty;
}
string trailingText = null;
if (_renderTicketOverviewUserNames && relation.Infos != null && relation.Infos.TryGetValue("UserDisplayName", out var relationUserDisplayName))
{
@@ -268,15 +262,10 @@ namespace FasdDesktopUi.Pages.SearchPage
{
var required = new List<enumFasdInformationClass> { cF4sdIdentityEntry.GetFromSearchResult(relation.Type) };
fallbackIsEnabled = cHealthCardDataHelper.HasAvailableHealthCard(required);
if (!fallbackIsEnabled)
{
fallbackDisabledReason = cMultiLanguageSupport.GetItem("Searchbar.NoValidHealthcard") ?? string.Empty;
}
else if (ShouldDisableTicketRelationForDemo(relation))
{
fallbackIsEnabled = false;
fallbackDisabledReason = cMultiLanguageSupport.GetItem("Searchbar.Demo.NoTicketDetails") ?? string.Empty;
}
if (!fallbackIsEnabled)
{
fallbackDisabledReason = cMultiLanguageSupport.GetItem("Searchbar.NoValidHealthcard") ?? string.Empty;
}
}
catch
{
@@ -1470,15 +1459,10 @@ namespace FasdDesktopUi.Pages.SearchPage
var required = new List<enumFasdInformationClass> { cF4sdIdentityEntry.GetFromSearchResult(r.Type) };
bool isEnabled = cHealthCardDataHelper.HasAvailableHealthCard(required);
string disabledReason = null;
if (!isEnabled)
{
disabledReason = cMultiLanguageSupport.GetItem("Searchbar.NoValidHealthcard") ?? string.Empty;
}
else if (ShouldDisableTicketRelationForDemo(r))
{
isEnabled = false;
disabledReason = cMultiLanguageSupport.GetItem("Searchbar.Demo.NoTicketDetails") ?? string.Empty;
}
if (!isEnabled)
{
disabledReason = cMultiLanguageSupport.GetItem("Searchbar.NoValidHealthcard") ?? string.Empty;
}
string trailingUser = null;
if (_renderTicketOverviewUserNames && r.Infos != null && r.Infos.TryGetValue("UserDisplayName", out var userDisplayName))
{
@@ -1574,30 +1558,6 @@ namespace FasdDesktopUi.Pages.SearchPage
return "Searchbar.Header.Filter.Overview";
}
private bool ShouldDisableTicketRelationForDemo(cF4sdApiSearchResultRelation relation)
{
if (relation == null)
return false;
var communication = cFasdCockpitCommunicationBase.Instance;
if (communication?.IsDemo() != true)
return false;
if (relation.Type != enumF4sdSearchResultClass.Ticket)
return false;
if (relation.Infos == null)
return false;
if (!relation.Infos.TryGetValue(DemoTicketHasDetailsInfoKey, out var hasDetailsValue))
return false;
if (bool.TryParse(hasDetailsValue, out var hasDetails))
return !hasDetails;
return true;
}
private async Task<List<cF4sdApiSearchResultRelation>> LoadRelationsForTileAsync(string key, bool useRoleScope, int count)
{
var communication = cFasdCockpitCommunicationBase.Instance;