Add simplified ticket completion flow
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using C4IT.FASD.Base;
|
||||
using C4IT.FASD.Cockpit.Communication;
|
||||
using C4IT.Logging;
|
||||
|
||||
using FasdDesktopUi.Basics;
|
||||
@@ -15,6 +17,33 @@ namespace FasdDesktopUi.Basics.Helper
|
||||
{
|
||||
private const string DefaultTicketActivityType = "SPSActivityTypeTicket";
|
||||
|
||||
internal static async Task<bool> TryOpenFinalizedTicketExternallyAsync(Guid ticketId, enumTicketExternalOpenMode mode)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ticketId == Guid.Empty || mode == enumTicketExternalOpenMode.None)
|
||||
return false;
|
||||
|
||||
var linkResult = await cFasdCockpitCommunicationBase.Instance.GetTicketExternalLinkAsync(ticketId, mode);
|
||||
if (linkResult?.Success != true ||
|
||||
!Uri.TryCreate(linkResult.Url, UriKind.Absolute, out var ticketUri) ||
|
||||
(ticketUri.Scheme != Uri.UriSchemeHttp && ticketUri.Scheme != Uri.UriSchemeHttps))
|
||||
{
|
||||
LogEntry($"Could not resolve an external link for ticket '{ticketId:D}'.", LogLevels.Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
new cBrowsers().Start("default", ticketUri.AbsoluteUri);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogException(ex);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static bool TryOpenTicketRelationExternally(cF4sdApiSearchResultRelation relation, bool forceExternal = false)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user