aktueller stand
This commit is contained in:
@@ -114,8 +114,6 @@ namespace FasdDesktopUi.Basics
|
||||
return null;
|
||||
}
|
||||
|
||||
await EnsureUserIdentityForTicketAsync(selectedRelation);
|
||||
|
||||
// get the identities of the selected relation
|
||||
var Identities = selectedRelation.Identities.Clone();
|
||||
|
||||
@@ -158,7 +156,7 @@ namespace FasdDesktopUi.Basics
|
||||
DataProviders.Add(MainIdentity.Id, _result);
|
||||
}
|
||||
|
||||
await EnsureSupportCasePagesAsync();
|
||||
//await EnsureSupportCasePagesAsync();
|
||||
|
||||
_result.NamedParameterEntries = new cNamedParameterList(_result);
|
||||
|
||||
@@ -188,31 +186,24 @@ namespace FasdDesktopUi.Basics
|
||||
if (!Status)
|
||||
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();
|
||||
HashSet<string> requiredTables = cHealthCard.GetRequiredTables(_result.HealthCardDataHelper.SelectedHealthCard); // todo the healthcard is not selected at this point
|
||||
detailsPage.WidgetCollection.WidgetDataList = supportCaseController.GetWidgetData();
|
||||
detailsPage.DataHistoryCollectionUserControl.HistoryDataList = supportCaseController.GetHistoryData();
|
||||
detailsPage.CustomizableSectionUc.ContainerCollections = supportCaseController.GetContainerData();
|
||||
|
||||
CurrentProvider = _result;
|
||||
|
||||
// start the slim or detaild page
|
||||
bool shouldSkipSlimView = (Identities?.Any(identity => identity.Class is enumFasdInformationClass.Ticket) ?? false)
|
||||
|| (cFasdCockpitConfig.Instance?.Global?.ShouldSkipSlimView ?? false);
|
||||
if (shouldSkipSlimView)
|
||||
{
|
||||
cSupportCaseDataProvider.detailsPage?.Show();
|
||||
cSupportCaseDataProvider.slimPage?.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
cSupportCaseDataProvider.slimPage?.Show();
|
||||
cSupportCaseDataProvider.detailsPage?.Hide();
|
||||
bool shouldSkipSlimView = Identities.Any(identity => identity.Class is enumFasdInformationClass.Ticket) || cFasdCockpitConfig.Instance.Global.ShouldSkipSlimView;
|
||||
if (shouldSkipSlimView)
|
||||
{
|
||||
cSupportCaseDataProvider.detailsPage?.Show();
|
||||
cSupportCaseDataProvider.slimPage.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
cSupportCaseDataProvider.slimPage.Show();
|
||||
cSupportCaseDataProvider.detailsPage?.Hide();
|
||||
}
|
||||
|
||||
return _result;
|
||||
@@ -314,87 +305,6 @@ namespace FasdDesktopUi.Basics
|
||||
detailsPage = new Pages.DetailsPage.DetailsPageView();
|
||||
}, DispatcherPriority.Normal);
|
||||
}
|
||||
|
||||
private static async Task EnsureUserIdentityForTicketAsync(cF4sdApiSearchResultRelation relation)
|
||||
{
|
||||
if (relation == null || relation.Type != enumF4sdSearchResultClass.Ticket)
|
||||
return;
|
||||
|
||||
if (relation.Identities == null)
|
||||
relation.Identities = new cF4sdIdentityList();
|
||||
|
||||
var existingUsers = relation.Identities
|
||||
.Where(identity => identity.Class == enumFasdInformationClass.User)
|
||||
.ToList();
|
||||
|
||||
Guid userId = Guid.Empty;
|
||||
if (relation.Infos != null)
|
||||
{
|
||||
if (relation.Infos.TryGetValue("Sids", out var sidsValue) ||
|
||||
relation.Infos.TryGetValue("UserSid", out sidsValue))
|
||||
{
|
||||
var sids = sidsValue?.Split(',')
|
||||
.Select(v => v.Trim())
|
||||
.Where(v => !string.IsNullOrWhiteSpace(v))
|
||||
.ToList();
|
||||
|
||||
if (sids != null && sids.Count > 0)
|
||||
{
|
||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||
if (communication != null)
|
||||
{
|
||||
relation.Infos.TryGetValue("UserDisplayName", out var userDisplayName);
|
||||
var result = await communication.GetUserSearchResults(userDisplayName, sids);
|
||||
var user = result?.Values?.FirstOrDefault()?.FirstOrDefault();
|
||||
if (user != null)
|
||||
userId = user.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId == Guid.Empty && relation.Infos.TryGetValue("UserAccount", out var userAccount))
|
||||
{
|
||||
relation.Infos.TryGetValue("UserDomain", out var userDomain);
|
||||
if (!string.IsNullOrWhiteSpace(userAccount))
|
||||
{
|
||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||
if (communication != null)
|
||||
{
|
||||
userId = await communication.GetUserIdByAccount(userAccount, userDomain ?? string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId == Guid.Empty)
|
||||
{
|
||||
if (relation.Infos.TryGetValue("UserId", out var userIdString) ||
|
||||
relation.Infos.TryGetValue("UserGuid", out userIdString) ||
|
||||
relation.Infos.TryGetValue("UserIdentityId", out userIdString))
|
||||
{
|
||||
Guid.TryParse(userIdString, out userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId == Guid.Empty)
|
||||
return;
|
||||
|
||||
if (existingUsers.Count == 0 || existingUsers.Any(identity => identity.Id != userId))
|
||||
{
|
||||
relation.Identities.RemoveAll(identity => identity.Class == enumFasdInformationClass.User);
|
||||
relation.Identities.Add(new cF4sdIdentityEntry
|
||||
{
|
||||
Class = enumFasdInformationClass.User,
|
||||
Id = userId
|
||||
});
|
||||
}
|
||||
|
||||
if (relation.Infos == null)
|
||||
relation.Infos = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
relation.Infos["UserId"] = userId.ToString();
|
||||
relation.Infos["UserGuid"] = userId.ToString();
|
||||
}
|
||||
|
||||
public async Task CloseCaseAsync()
|
||||
{
|
||||
|
||||
@@ -399,7 +399,7 @@ namespace FasdDesktopUi.Pages.AdvancedSearchPage
|
||||
{
|
||||
await SearchBarUc.SetFixedSearchResultAsync(Class, strInfo, result);
|
||||
|
||||
if (result.AutoContinue && result.Results?.Count == 1)
|
||||
if (result.AutoContinue && result.Results?.Count == 1)
|
||||
{
|
||||
ResultMenu.IndexOfSelectedResultItem = 0;
|
||||
ResultMenu.SelectCurrentResultItem();
|
||||
|
||||
@@ -807,6 +807,9 @@ namespace FasdDesktopUi.Pages.SearchPage
|
||||
|
||||
private bool CheckTicketOverviewAvailability()
|
||||
{
|
||||
if (cFasdCockpitCommunicationBase.Instance?.IsDemo() == true)
|
||||
return true;
|
||||
|
||||
return cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.ShowOverview == true
|
||||
&& IsTicketIntegrationActive();
|
||||
}
|
||||
@@ -1427,7 +1430,6 @@ namespace FasdDesktopUi.Pages.SearchPage
|
||||
SetPendingInformationClasses(new HashSet<enumFasdInformationClass> { enumFasdInformationClass.Ticket });
|
||||
|
||||
var relations = await LoadRelationsForTileAsync(e.Key, e.UseRoleScope, Math.Max(0, e.Count));
|
||||
await PopulateTicketOverviewRelationUsersAsync(relations);
|
||||
var firstRelation = relations.FirstOrDefault();
|
||||
string displayText = header;
|
||||
if (firstRelation != null)
|
||||
@@ -1587,106 +1589,6 @@ namespace FasdDesktopUi.Pages.SearchPage
|
||||
}
|
||||
}
|
||||
|
||||
private async Task PopulateTicketOverviewRelationUsersAsync(List<cF4sdApiSearchResultRelation> relations)
|
||||
{
|
||||
if (relations == null || relations.Count == 0)
|
||||
return;
|
||||
|
||||
foreach (var relation in relations)
|
||||
{
|
||||
if (relation == null || relation.Type != enumF4sdSearchResultClass.Ticket)
|
||||
continue;
|
||||
|
||||
if (relation.Identities == null)
|
||||
relation.Identities = new cF4sdIdentityList();
|
||||
|
||||
var existingUsers = relation.Identities
|
||||
.Where(identity => identity.Class == enumFasdInformationClass.User)
|
||||
.ToList();
|
||||
|
||||
Guid userId = Guid.Empty;
|
||||
if (relation.Infos != null)
|
||||
{
|
||||
if (relation.Infos.TryGetValue("Sids", out var sidsValue) ||
|
||||
relation.Infos.TryGetValue("UserSid", out sidsValue))
|
||||
{
|
||||
var sids = sidsValue?.Split(',')
|
||||
.Select(v => v.Trim())
|
||||
.Where(v => !string.IsNullOrWhiteSpace(v))
|
||||
.ToList();
|
||||
|
||||
if (sids != null && sids.Count > 0)
|
||||
{
|
||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||
if (communication != null)
|
||||
{
|
||||
relation.Infos.TryGetValue("UserDisplayName", out var userDisplayName);
|
||||
var result = await communication.GetUserSearchResults(userDisplayName, sids);
|
||||
var user = result?.Values?.FirstOrDefault()?.FirstOrDefault();
|
||||
if (user != null)
|
||||
userId = user.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId == Guid.Empty && relation.Infos.TryGetValue("UserAccount", out var userAccount))
|
||||
{
|
||||
relation.Infos.TryGetValue("UserDomain", out var userDomain);
|
||||
if (!string.IsNullOrWhiteSpace(userAccount))
|
||||
{
|
||||
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||
if (communication != null)
|
||||
{
|
||||
userId = await communication.GetUserIdByAccount(userAccount, userDomain ?? string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId == Guid.Empty)
|
||||
{
|
||||
if (relation.Infos.TryGetValue("UserId", out var userIdString) ||
|
||||
relation.Infos.TryGetValue("UserGuid", out userIdString) ||
|
||||
relation.Infos.TryGetValue("UserIdentityId", out userIdString))
|
||||
{
|
||||
Guid.TryParse(userIdString, out userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId == Guid.Empty)
|
||||
{
|
||||
if (existingUsers.Count == 0)
|
||||
continue;
|
||||
|
||||
if (relation.Infos != null)
|
||||
{
|
||||
if (!relation.Infos.ContainsKey("UserId"))
|
||||
relation.Infos["UserId"] = existingUsers[0].Id.ToString();
|
||||
if (!relation.Infos.ContainsKey("UserGuid"))
|
||||
relation.Infos["UserGuid"] = existingUsers[0].Id.ToString();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (existingUsers.Count == 0 || existingUsers.Any(identity => identity.Id != userId))
|
||||
{
|
||||
relation.Identities.RemoveAll(identity => identity.Class == enumFasdInformationClass.User);
|
||||
relation.Identities.Add(new cF4sdIdentityEntry
|
||||
{
|
||||
Class = enumFasdInformationClass.User,
|
||||
Id = userId
|
||||
});
|
||||
}
|
||||
|
||||
if (relation.Infos == null)
|
||||
relation.Infos = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
relation.Infos["UserId"] = userId.ToString();
|
||||
relation.Infos["UserGuid"] = userId.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Click-Through fuer transparente SearchView-Bereiche
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="ToggleSwitch"
|
||||
TargetType="CheckBox">
|
||||
<Style x:Key="ToggleSwitch"
|
||||
TargetType="CheckBox">
|
||||
<Setter Property="Height"
|
||||
Value="15" />
|
||||
<Setter Property="ToolTipService.ShowOnDisabled"
|
||||
@@ -105,5 +105,5 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user