Skip to content

Commit

Permalink
Search by message id now performed when selected. Fixes #331
Browse files Browse the repository at this point in the history
  • Loading branch information
distantcam committed May 29, 2014
1 parent 826e365 commit fda9de9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ public void CopyMessageUri(StoredMessage message)
AppServices.Clipboard.CopyTo(serviceControl.GetUri(message).ToString());
}

public void SearchByMessageId(StoredMessage message)
public void SearchByMessageId(StoredMessage message, bool performSearch = false)
{
searchBar.Search(performSearch: false, searchQuery: message.MessageId);
searchBar.Search(performSearch: performSearch, searchQuery: message.MessageId);
eventAggregator.Publish(new RequestSelectingEndpoint(message.ReceivingEndpoint));
}

Expand Down
34 changes: 12 additions & 22 deletions src/ServiceInsight.Desktop/MessageFlow/MessageNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class MessageNode : DiagramNode
int heightNoEndpoints = 56;
const int endpointsHeight = 25;

public MessageNode(MessageFlowViewModel owner, StoredMessage message)
public MessageNode(MessageFlowViewModel owner, StoredMessage message)
{
IsResizable = false;
Owner = owner;
Expand All @@ -28,10 +28,10 @@ public MessageNode(MessageFlowViewModel owner, StoredMessage message)
string ProcessSagaType(StoredMessage message)
{
if (message.Sagas == null) return string.Empty;

var originatingSaga = message.Sagas.FirstOrDefault();
if (originatingSaga == null) return string.Empty;

return ProcessType(originatingSaga.SagaType);
}

Expand All @@ -54,10 +54,7 @@ public StoredMessage Message
get { return Data as StoredMessage; }
}

public MessageFlowViewModel Owner
{
get; private set;
}
public MessageFlowViewModel Owner { get; private set; }

public void CopyMessageUri()
{
Expand All @@ -71,7 +68,7 @@ public void CopyConversationId()

public void SearchMessage()
{
Owner.SearchByMessageId(Message);
Owner.SearchByMessageId(Message, performSearch: true);
}

public async void Retry()
Expand All @@ -85,7 +82,6 @@ public async void Retry()
public bool CanRetry()
{
return HasFailed;

}

public void ShowBody()
Expand All @@ -102,10 +98,7 @@ public void Refresh()
{
}

public bool ShowEndpoints
{
get; set;
}
public bool ShowEndpoints { get; set; }

public void OnShowEndpointsChanged()
{
Expand Down Expand Up @@ -146,21 +139,21 @@ public bool IsSagaCompleted

public bool IsTimeout
{
get
get
{
var isTimeoutString = Message.GetHeaderByKey(MessageHeaderKeys.IsSagaTimeout);
return !string.IsNullOrEmpty(isTimeoutString) && bool.Parse(isTimeoutString);
return !string.IsNullOrEmpty(isTimeoutString) && bool.Parse(isTimeoutString);
}
}

public DateTime? TimeSent
{
get
{
get
{
var timeString = Message.GetHeaderByKey(MessageHeaderKeys.TimeSent);
if (string.IsNullOrEmpty(timeString))
return null;
return DateTime.ParseExact(timeString, HeaderInfo.MessageDateFormat, System.Globalization.CultureInfo.InvariantCulture);
return DateTime.ParseExact(timeString, HeaderInfo.MessageDateFormat, System.Globalization.CultureInfo.InvariantCulture);
}
}

Expand Down Expand Up @@ -191,10 +184,7 @@ public bool HasSaga
}
}

public string ExceptionMessage
{
get; set;
}
public string ExceptionMessage { get; set; }

public bool IsFocused
{
Expand Down

0 comments on commit fda9de9

Please sign in to comment.