-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event Grid Explorer - Adding Support for Event Grid V2 #737
Merged
Merged
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f87a0d9
Event Grid Explorer - Adding support for Event Grid V2 in Service Bus…
t-wangamy cdd396b
Merge branch 'main' of https://github.com/paolosalvatori/ServiceBusEx…
t-wangamy e8e6791
Event Grid Explorer
t-wangamy b11b0c1
Event Grid Explorer
t-wangamy f0ad8fe
Event Grid Explorer
t-wangamy afe8a98
Wording
SeanFeldman 38d75ec
Event Grid Explorer
t-wangamy e5b1c2a
Merge branch 'EventGridExplorer' of https://github.com/paolosalvatori…
t-wangamy 7a7c463
Adhare to the license in the repo
SeanFeldman 96e96e1
Fall back to the default API version
SeanFeldman f174fb4
Change tenantId
ErikMogensen 5a76072
Added api-version commit
ErikMogensen bbc7b45
Change tenantId when logging in
ErikMogensen 74bc13d
Merge pull request #747 from ErikMogensen/EventGridLogin
paolosalvatori 8207abc
Improve UI event grid explorer (#752)
ErikMogensen fd86d19
Using Control plane sdk instead of generated files
harrieoriowo 764e8cb
Finishing up the sdks
harrieoriowo 2797407
Adding Filter UI
harrieoriowo a366114
Allowing multiple filters
harrieoriowo b7c3f54
Refining the explorer with proper error handling and the filters acce…
harrieoriowo e143794
Merge branch 'main' into EventGridExplorer
harrieoriowo 1d43822
Resolving comments
harrieoriowo f1ed2e4
Merge branch 'EventGridExplorer' of https://github.com/paolosalvatori…
harrieoriowo 46113e7
Resolving comments
harrieoriowo 274791e
Removing custom exception and moving logic into filterfactory
harrieoriowo b45d3d5
Handling build warnings
harrieoriowo 59b24b9
Build warnings resolved
harrieoriowo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#region Copyright | ||
//======================================================================================= | ||
// Microsoft Azure Customer Advisory Team | ||
// | ||
// This sample is supplemental to the technical guidance published on my personal | ||
// blog at http://blogs.msdn.com/b/paolos/. | ||
// | ||
// Author: Paolo Salvatori | ||
//======================================================================================= | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE | ||
// FILES EXCEPT IN COMPLIANCE WITH THE LICENSE. YOU MAY OBTAIN A COPY OF THE LICENSE AT | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE | ||
// LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING | ||
// PERMISSIONS AND LIMITATIONS UNDER THE LICENSE. | ||
//======================================================================================= | ||
#endregion | ||
|
||
#region Using Directives | ||
|
||
using System; | ||
|
||
#endregion | ||
|
||
|
||
namespace ServiceBusExplorer.Helpers | ||
{ | ||
public class EventGridException : Exception | ||
{ | ||
#region Public constructors | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="EventGridException"/> class. | ||
/// </summary> | ||
/// <param name="message">Message</param> | ||
/// <param name="innerException">Inner exception</param> | ||
public EventGridException( | ||
string message, | ||
Exception innerException = null) | ||
: base(message, innerException) | ||
{ | ||
FullMessage = message; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the full message of the exception. | ||
/// </summary> | ||
public string FullMessage { get; } | ||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
162 changes: 162 additions & 0 deletions
162
src/EventGridExplorerLibrary/Management/EventGridFilterValues.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
// <copyright file="EventGridClient.cs" company="Microsoft"> | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// </copyright> | ||
|
||
namespace EventGridExplorerLibrary | ||
{ | ||
using System.Collections.Generic; | ||
using global::Azure.ResourceManager.EventGrid.Models; | ||
|
||
/// <summary> | ||
/// Implementation of the EventGridFilterValues class | ||
harrieoriowo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// </summary> | ||
public class EventGridFilterValues | ||
{ | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="EventGridFilterValues"/> class. | ||
/// </summary> | ||
public EventGridFilterValues() | ||
{ | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void GetValueForBoolEqualsFilter(BoolEqualsFilter filter, string value) | ||
{ | ||
filter.Value = bool.Parse(value); | ||
} | ||
|
||
public void GetValueForStringInFilter(StringInFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
|
||
public void GetValueForStringNotInFilter(StringNotInFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
|
||
public void GetValueForStringContainsFilter(StringContainsFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
|
||
public void GetValueForStringNotContainsFilter(StringNotContainsFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
harrieoriowo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
public void GetValueForStringBeginsWithFilter(StringBeginsWithFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
public void GetValueForStringNotBeginsWithFilter(StringNotBeginsWithFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
public void GetValueForStringEndsWithFilter(StringEndsWithFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
public void GetValueForStringNotEndsWithFilter(StringNotEndsWithFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(filterValue); | ||
} | ||
} | ||
public void GetValueForNumberLessThanFilter(NumberLessThanFilter filter, string value) | ||
{ | ||
filter.Value = double.Parse(value); | ||
} | ||
public void GetValueForNumberGreaterThanFilter(NumberGreaterThanFilter filter, string value) | ||
{ | ||
filter.Value = double.Parse(value); | ||
} | ||
public void GetValueForNumberLessThanOrEqualsFilter(NumberLessThanOrEqualsFilter filter, string value) | ||
{ | ||
filter.Value = double.Parse(value); | ||
} | ||
public void GetValueForNumberGreaterThanOrEqualsFilter(NumberGreaterThanOrEqualsFilter filter, string value) | ||
{ | ||
filter.Value = double.Parse(value); | ||
} | ||
public void GetValueForNumberInFilter(NumberInFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(double.Parse(filterValue)); | ||
} | ||
} | ||
public void GetValueForNumberNotInFilter(NumberNotInFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
foreach (string filterValue in filterValuesList) | ||
{ | ||
filter.Values.Add(double.Parse(filterValue)); | ||
} | ||
} | ||
|
||
public void GetValueForNumberNotInRangeFilter(NumberNotInRangeFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
|
||
foreach (string filterValue in filterValuesList) | ||
{ | ||
List<double> doubleRangeValues = new List<double>(); | ||
var rangeValues = filterValue.Split('-'); | ||
foreach (string rangeValue in rangeValues) | ||
{ | ||
doubleRangeValues.Add(double.Parse(rangeValue)); | ||
} | ||
filter.Values.Add(doubleRangeValues); | ||
} | ||
} | ||
public void GetValueForNumberInRangeFilter(NumberInRangeFilter filter, string value) | ||
{ | ||
string[] filterValuesList = value.Split(','); | ||
|
||
foreach (string filterValue in filterValuesList) | ||
{ | ||
List<double> doubleRangeValues = new List<double>(); | ||
var rangeValues = filterValue.Split('-'); | ||
foreach (string rangeValue in rangeValues) | ||
{ | ||
doubleRangeValues.Add(double.Parse(rangeValue)); | ||
} | ||
filter.Values.Add(doubleRangeValues); | ||
} | ||
|
||
} | ||
|
||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question - what does this custom exception type bring that is not handled by
Exception
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to make this custom exception so I can throw them without having to hit the client and have the client throw the exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have missed that use. Could you point to where it's used? Thanks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it here. That use is on the form. When an exception is thrown, the form logs it and swallows the exception. But with EventGrid, you're going to throw? Could you help me understand why it would need to be re-thrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea for the user experience is that I can check the format of the filter key, operator and value and verify them without depending on the armclient to do the verification.
Yes, the form will log the error, but it will still go ahead and still hit the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something and would love to meet today to resolve it if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's continue the discussion at the method level comments, no need for a meeting 🙂