aktueller stand
This commit is contained in:
@@ -114,8 +114,6 @@ namespace FasdDesktopUi.Basics
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
await EnsureUserIdentityForTicketAsync(selectedRelation);
|
|
||||||
|
|
||||||
// get the identities of the selected relation
|
// get the identities of the selected relation
|
||||||
var Identities = selectedRelation.Identities.Clone();
|
var Identities = selectedRelation.Identities.Clone();
|
||||||
|
|
||||||
@@ -158,7 +156,7 @@ namespace FasdDesktopUi.Basics
|
|||||||
DataProviders.Add(MainIdentity.Id, _result);
|
DataProviders.Add(MainIdentity.Id, _result);
|
||||||
}
|
}
|
||||||
|
|
||||||
await EnsureSupportCasePagesAsync();
|
//await EnsureSupportCasePagesAsync();
|
||||||
|
|
||||||
_result.NamedParameterEntries = new cNamedParameterList(_result);
|
_result.NamedParameterEntries = new cNamedParameterList(_result);
|
||||||
|
|
||||||
@@ -188,30 +186,23 @@ namespace FasdDesktopUi.Basics
|
|||||||
if (!Status)
|
if (!Status)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var selectedHealthCard = _result.HealthCardDataHelper?.SelectedHealthCard;
|
HashSet<string> requiredTables = cHealthCard.GetRequiredTables(_result.HealthCardDataHelper.SelectedHealthCard); // todo the healthcard is not selected at this point
|
||||||
if (selectedHealthCard != null)
|
|
||||||
_ = cHealthCard.GetRequiredTables(selectedHealthCard); // todo the healthcard is not selected at this point
|
|
||||||
|
|
||||||
if (detailsPage?.WidgetCollection != null)
|
|
||||||
detailsPage.WidgetCollection.WidgetDataList = supportCaseController.GetWidgetData();
|
detailsPage.WidgetCollection.WidgetDataList = supportCaseController.GetWidgetData();
|
||||||
if (detailsPage?.DataHistoryCollectionUserControl != null)
|
|
||||||
detailsPage.DataHistoryCollectionUserControl.HistoryDataList = supportCaseController.GetHistoryData();
|
detailsPage.DataHistoryCollectionUserControl.HistoryDataList = supportCaseController.GetHistoryData();
|
||||||
if (detailsPage?.CustomizableSectionUc != null)
|
|
||||||
detailsPage.CustomizableSectionUc.ContainerCollections = supportCaseController.GetContainerData();
|
detailsPage.CustomizableSectionUc.ContainerCollections = supportCaseController.GetContainerData();
|
||||||
|
|
||||||
CurrentProvider = _result;
|
CurrentProvider = _result;
|
||||||
|
|
||||||
// start the slim or detaild page
|
// start the slim or detaild page
|
||||||
bool shouldSkipSlimView = (Identities?.Any(identity => identity.Class is enumFasdInformationClass.Ticket) ?? false)
|
bool shouldSkipSlimView = Identities.Any(identity => identity.Class is enumFasdInformationClass.Ticket) || cFasdCockpitConfig.Instance.Global.ShouldSkipSlimView;
|
||||||
|| (cFasdCockpitConfig.Instance?.Global?.ShouldSkipSlimView ?? false);
|
|
||||||
if (shouldSkipSlimView)
|
if (shouldSkipSlimView)
|
||||||
{
|
{
|
||||||
cSupportCaseDataProvider.detailsPage?.Show();
|
cSupportCaseDataProvider.detailsPage?.Show();
|
||||||
cSupportCaseDataProvider.slimPage?.Hide();
|
cSupportCaseDataProvider.slimPage.Hide();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cSupportCaseDataProvider.slimPage?.Show();
|
cSupportCaseDataProvider.slimPage.Show();
|
||||||
cSupportCaseDataProvider.detailsPage?.Hide();
|
cSupportCaseDataProvider.detailsPage?.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,87 +306,6 @@ namespace FasdDesktopUi.Basics
|
|||||||
}, DispatcherPriority.Normal);
|
}, 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()
|
public async Task CloseCaseAsync()
|
||||||
{
|
{
|
||||||
var CM = MethodBase.GetCurrentMethod();
|
var CM = MethodBase.GetCurrentMethod();
|
||||||
|
|||||||
@@ -807,6 +807,9 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
|
|
||||||
private bool CheckTicketOverviewAvailability()
|
private bool CheckTicketOverviewAvailability()
|
||||||
{
|
{
|
||||||
|
if (cFasdCockpitCommunicationBase.Instance?.IsDemo() == true)
|
||||||
|
return true;
|
||||||
|
|
||||||
return cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.ShowOverview == true
|
return cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.ShowOverview == true
|
||||||
&& IsTicketIntegrationActive();
|
&& IsTicketIntegrationActive();
|
||||||
}
|
}
|
||||||
@@ -1427,7 +1430,6 @@ 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));
|
||||||
await PopulateTicketOverviewRelationUsersAsync(relations);
|
|
||||||
var firstRelation = relations.FirstOrDefault();
|
var firstRelation = relations.FirstOrDefault();
|
||||||
string displayText = header;
|
string displayText = header;
|
||||||
if (firstRelation != null)
|
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
|
#endregion
|
||||||
|
|
||||||
#region Click-Through fuer transparente SearchView-Bereiche
|
#region Click-Through fuer transparente SearchView-Bereiche
|
||||||
|
|||||||
Reference in New Issue
Block a user