This commit is contained in:
@@ -23,7 +23,7 @@ namespace raven_integration
|
||||
|
||||
public class DataFilterFilteringLists
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -54,14 +54,14 @@ namespace raven_integration
|
||||
public const string TokenInTheLastYear = "{[lastcalendaryear]}";
|
||||
|
||||
//More business time frames
|
||||
|
||||
|
||||
public const string TokenYearToDate = "{[yeartodate]}";
|
||||
|
||||
|
||||
public const string TokenPast90Days = "{[past90days]}";
|
||||
public const string TokenPast30Days = "{[past30days]}";
|
||||
public const string TokenPast24Hours = "{[past24hours]}";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region DATE REGULAR FILTERS
|
||||
@@ -83,6 +83,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = new DateTime(1968, 3, 12, 10, 0, 0).ToUniversalTime();
|
||||
w.endDate = new DateTime(1968, 3, 12, 11, 0, 0).ToUniversalTime();
|
||||
|
||||
@@ -183,6 +185,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = new DateTime(1970, 3, 12, 10, 0, 0).ToUniversalTime();
|
||||
w.endDate = new DateTime(1970, 3, 12, 11, 0, 0).ToUniversalTime();
|
||||
|
||||
@@ -283,6 +287,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = new DateTime(1970, 3, 12, 10, 0, 0).ToUniversalTime();
|
||||
w.endDate = new DateTime(1970, 3, 12, 11, 0, 0).ToUniversalTime();
|
||||
|
||||
@@ -382,6 +388,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = new DateTime(1970, 3, 12, 10, 0, 0).ToUniversalTime();
|
||||
w.endDate = new DateTime(1970, 3, 12, 11, 0, 0).ToUniversalTime();
|
||||
|
||||
@@ -482,6 +490,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = new DateTime(1970, 3, 12, 10, 0, 0).ToUniversalTime();
|
||||
w.endDate = new DateTime(1970, 3, 12, 11, 0, 0).ToUniversalTime();
|
||||
|
||||
@@ -582,6 +592,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = new DateTime(1970, 3, 12, 10, 0, 0).ToUniversalTime();
|
||||
w.endDate = new DateTime(1970, 3, 12, 11, 0, 0).ToUniversalTime();
|
||||
|
||||
@@ -682,6 +694,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = DateTime.UtcNow.AddDays(-1);
|
||||
w.endDate = DateTime.UtcNow.AddHours(1).AddDays(-1);
|
||||
|
||||
@@ -782,6 +796,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = DateTime.UtcNow;
|
||||
w.endDate = DateTime.UtcNow.AddHours(1);
|
||||
|
||||
@@ -882,6 +898,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = DateTime.UtcNow.AddDays(1);
|
||||
w.endDate = DateTime.UtcNow.AddDays(1).AddHours(1);
|
||||
|
||||
@@ -982,6 +1000,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//My theory is any date - 7 days is last week if you go sunday to sunday
|
||||
w.startDate = DateTime.UtcNow.AddDays(-7);
|
||||
w.endDate = DateTime.UtcNow.AddHours(1).AddDays(-7);
|
||||
@@ -1082,6 +1102,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = DateTime.UtcNow;
|
||||
w.endDate = DateTime.UtcNow.AddHours(1);
|
||||
|
||||
@@ -1183,6 +1205,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//My theory is any date + 7 days is next week if you go sunday to sunday
|
||||
w.startDate = DateTime.UtcNow.AddDays(7);
|
||||
w.endDate = DateTime.UtcNow.AddHours(1).AddDays(7);
|
||||
@@ -1285,6 +1309,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//First day of this month minus 2 days equals second to last day of last month
|
||||
w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddDays(-2).ToUniversalTime();
|
||||
w.endDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddDays(-2).AddHours(1).ToUniversalTime();
|
||||
@@ -1387,6 +1413,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//Put it right at midnight this month to ensure boundaries are respected
|
||||
w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).ToUniversalTime();
|
||||
w.endDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddHours(1).ToUniversalTime();
|
||||
@@ -1490,6 +1518,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//Put it right at midnight next month to ensure boundaries are respected
|
||||
w.startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).ToUniversalTime();
|
||||
w.endDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 00, 00, 00).AddMonths(1).AddHours(1).ToUniversalTime();
|
||||
@@ -1593,6 +1623,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
|
||||
w.startDate = DateTime.UtcNow;
|
||||
w.endDate = DateTime.UtcNow.AddHours(1);
|
||||
@@ -1696,6 +1728,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//Test if for the past, definitely going to be in the past when the list is fetched after saving, but will it work with the server on another machine??
|
||||
//Best to pad in 5 minutes to be on the safe side, these days no two computers on earth should be out by more than 5 minutes to UTC from each other
|
||||
w.startDate = DateTime.UtcNow.AddMinutes(-5);
|
||||
@@ -1798,6 +1832,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//####
|
||||
w.startDate = DateTime.UtcNow.AddMinutes(5);
|
||||
w.endDate = DateTime.UtcNow.AddMinutes(5).AddHours(1);
|
||||
@@ -1900,6 +1936,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//####
|
||||
w.startDate = DateTime.UtcNow.AddYears(-1).AddMinutes(-5);
|
||||
w.endDate = DateTime.UtcNow.AddYears(-1).AddMinutes(-5).AddHours(1);
|
||||
@@ -2005,6 +2043,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//####
|
||||
w.startDate = DateTime.UtcNow;
|
||||
w.endDate = DateTime.UtcNow.AddHours(1);
|
||||
@@ -2109,6 +2149,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//####
|
||||
w.startDate = DateTime.UtcNow.AddMonths(-3).AddMinutes(5);
|
||||
w.endDate = DateTime.UtcNow.AddMonths(-3).AddMinutes(5).AddHours(1);
|
||||
@@ -2210,6 +2252,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//####
|
||||
w.startDate = DateTime.UtcNow.AddMonths(-6).AddMinutes(5);
|
||||
w.endDate = DateTime.UtcNow.AddMonths(-6).AddMinutes(5).AddHours(1);
|
||||
@@ -2311,6 +2355,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
//####
|
||||
w.startDate = DateTime.UtcNow.AddDays(-365).AddMinutes(5);
|
||||
w.endDate = DateTime.UtcNow.AddDays(-365).AddMinutes(5).AddHours(1);
|
||||
@@ -2398,7 +2444,7 @@ namespace raven_integration
|
||||
|
||||
#region DATE TOKEN FILTERS
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -2432,6 +2478,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = InclusiveStartDate;
|
||||
w.endDate = InclusiveEndDate;
|
||||
|
||||
@@ -2547,6 +2595,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = InclusiveStartDate;
|
||||
w.endDate = InclusiveEndDate;
|
||||
|
||||
@@ -2660,6 +2710,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = InclusiveStartDate;
|
||||
w.endDate = InclusiveEndDate;
|
||||
|
||||
@@ -2774,6 +2826,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.startDate = InclusiveStartDate;
|
||||
w.endDate = InclusiveEndDate;
|
||||
|
||||
@@ -2887,6 +2941,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "aardvark";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3011,6 +3066,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "O'Flaherty's pub";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3132,6 +3188,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Bill & Ted's excellent adventure";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3254,6 +3311,7 @@ namespace raven_integration
|
||||
var InclusiveTestString = "Ādam Iñtërnâtiônàližætiøn";
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = InclusiveTestString;
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3376,6 +3434,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Alabama";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3498,6 +3557,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Bjorn";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3620,6 +3680,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "California";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3742,6 +3803,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Donut";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3863,6 +3925,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Egg Salad Sandwich";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -3984,6 +4047,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Gray poupon";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -4105,6 +4169,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Fast Freddy Freak";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -4226,6 +4291,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Granular";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -4348,6 +4414,7 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "Bo Horvat";
|
||||
w.roles = 0;
|
||||
|
||||
@@ -4483,9 +4550,12 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.count = 5;
|
||||
w.notes = "blah";
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -4582,6 +4652,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.count = 55;
|
||||
@@ -4682,6 +4754,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.count = 555;
|
||||
@@ -4784,6 +4858,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.count = -5555;
|
||||
@@ -4885,6 +4961,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.count = -444;
|
||||
@@ -4987,6 +5065,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.count = 222;
|
||||
@@ -5099,6 +5179,8 @@ namespace raven_integration
|
||||
//first active widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
|
||||
@@ -5225,6 +5307,8 @@ namespace raven_integration
|
||||
//first active widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
|
||||
@@ -5354,6 +5438,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.dollarAmount = 5.55;
|
||||
@@ -5453,6 +5539,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.dollarAmount = 55.55;
|
||||
@@ -5553,6 +5641,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.dollarAmount = 555.55;
|
||||
@@ -5655,6 +5745,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.dollarAmount = -5555.55;
|
||||
@@ -5756,6 +5848,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.dollarAmount = -444.44;
|
||||
@@ -5858,6 +5952,8 @@ namespace raven_integration
|
||||
//included widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.active = true;
|
||||
w.roles = 0;
|
||||
w.dollarAmount = 222.22;
|
||||
@@ -5966,6 +6062,8 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
//Tags
|
||||
dynamic InclusiveTagsArray = new JArray();
|
||||
InclusiveTagsArray.Add("red-tag-test");
|
||||
@@ -6110,6 +6208,8 @@ namespace raven_integration
|
||||
//first inclusive widget
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetRunNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
//Tags
|
||||
dynamic InclusiveTagsArray = new JArray();
|
||||
InclusiveTagsArray.Add("red-tag-test");
|
||||
|
||||
@@ -28,18 +28,24 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -112,6 +118,8 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.startDate = DateTime.Now;
|
||||
w.endDate = DateTime.Now.AddHours(1);
|
||||
|
||||
@@ -121,6 +129,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.startDate = DateTime.Now.AddHours(1);
|
||||
w.endDate = DateTime.Now.AddHours(2);
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -129,6 +139,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.startDate = DateTime.Now.AddHours(2);
|
||||
w.endDate = DateTime.Now.AddHours(3);
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -212,6 +224,8 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.count = 999;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -220,6 +234,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.count = 666;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -227,6 +243,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.count = 333;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -329,6 +347,8 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 2.22;
|
||||
w.count = 1;
|
||||
|
||||
@@ -338,6 +358,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 1.11;
|
||||
w.count = 2;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -346,6 +368,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 1.11;
|
||||
w.count = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
@@ -354,6 +378,8 @@ namespace raven_integration
|
||||
|
||||
w = new JObject();
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.dollaramount = 2.22;
|
||||
w.count = 2;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace raven_integration
|
||||
|
||||
dynamic w = new JObject();
|
||||
w.name = Util.Uniquify("EventLog Test WIDGET");
|
||||
w.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
w.notes = "blah";
|
||||
w.created = DateTime.Now.ToString();
|
||||
w.dollarAmount = 2.22m;
|
||||
w.active = true;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace raven_integration
|
||||
dt.fld = "WidgetCustom1";
|
||||
dt.hide = false;
|
||||
dt.required = true;
|
||||
dt.type = "date";
|
||||
dt.type = "text";
|
||||
dtemplate.Add(dt);
|
||||
|
||||
dt = new JObject();
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
D.name = Util.Uniquify("Search NOTES Test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -31,6 +32,7 @@ namespace raven_integration
|
||||
//CREATE FIRST TEST USER WITH PHRASE IN NAME
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("Search NAME DOGS simple Test User");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.notes = "This user has the match in it's name";
|
||||
D.ownerId = 1L;
|
||||
D.active = true;
|
||||
@@ -47,6 +49,7 @@ namespace raven_integration
|
||||
//CREATE A SECOND TEST USER WITH PHRASE IN NOTES
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("Search NOTES Test User");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.notes = "This user has the match simple dogs in its notes";
|
||||
D.ownerId = 1L;
|
||||
D.active = true;
|
||||
@@ -63,6 +66,7 @@ namespace raven_integration
|
||||
//CREATE A SECOND WIDGET
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("Search NAME simple as in dogs Test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -75,6 +79,7 @@ namespace raven_integration
|
||||
//CREATE A THIRD WIDGET
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("Search NO-MATCH THIRD Test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -168,6 +173,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
D.name = Util.Uniquify("Wildcard startswith search test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -230,6 +236,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
D.name = Util.Uniquify("Wildcard endswith search test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -294,6 +301,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
D.name = Util.Uniquify("Wildcard contains search test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -371,6 +379,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
D.name = Util.Uniquify("TAG search test WIDGET TAG AND PHRASE");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -387,6 +396,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET WITH TAG BUT NOT SEARCH PHRASE
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("TAG search test WIDGET TAG ONLY");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -530,6 +540,7 @@ namespace raven_integration
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
D.name = Util.Uniquify("Serial search test WIDGET");
|
||||
D.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace raven_integration
|
||||
w1.active = true;
|
||||
w1.roles = 0;
|
||||
w1.notes = "The quick brown fox jumped over the six lazy dogs!";
|
||||
w1.customFields = Util.GenerateCustomFieldsJsonString("MyCustomText in Custom 1 field");
|
||||
|
||||
//Tags
|
||||
dynamic dTagsArray = new JArray();
|
||||
@@ -54,6 +55,7 @@ namespace raven_integration
|
||||
w2.roles = 0;
|
||||
w2.notes = "What is the frequency Kenneth?";
|
||||
w2.tags = dTagsArray;
|
||||
w2.customFields = Util.GenerateCustomFieldsJsonString("MyCustomText in Custom 1 field");
|
||||
|
||||
ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
@@ -184,6 +186,10 @@ namespace raven_integration
|
||||
w2.active = true;
|
||||
w2.roles = 0;
|
||||
|
||||
w2.notes="blah";
|
||||
w2.customFields = Util.GenerateCustomFieldsJsonString("Meh1");
|
||||
|
||||
|
||||
ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
long w2Id = r2.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
50
util.cs
50
util.cs
@@ -253,20 +253,21 @@ namespace raven_integration
|
||||
var ERR = a.ObjectResponse["error"];
|
||||
if (ERR != null)
|
||||
{
|
||||
var ecode = ERR["code"];
|
||||
if (ecode != null)
|
||||
ErrorMessage += $"CODE: {ecode} ";
|
||||
ErrorMessage=a.ObjectResponse.ToString();
|
||||
// var ecode = ERR["code"];
|
||||
// if (ecode != null)
|
||||
// ErrorMessage += $"CODE: {ecode} ";
|
||||
|
||||
var emsg = ERR["message"];
|
||||
if (emsg != null)
|
||||
ErrorMessage += $"MESSAGE: {emsg} ";
|
||||
// var emsg = ERR["message"];
|
||||
// if (emsg != null)
|
||||
// ErrorMessage += $"MESSAGE: {emsg} ";
|
||||
|
||||
var etarget = ERR["target"];
|
||||
if (etarget != null)
|
||||
ErrorMessage += $"TARGET: {etarget} ";
|
||||
// var etarget = ERR["target"];
|
||||
// if (etarget != null)
|
||||
// ErrorMessage += $"TARGET: {etarget} ";
|
||||
}
|
||||
|
||||
a.ObjectResponse["error"].Should().BeNull("because there should not be an error on an api call, error was: {0}", ErrorMessage);
|
||||
a.ObjectResponse["error"].Should().BeNull("because there should not be an error on an api call, error result was: {0}", ErrorMessage);
|
||||
a.ObjectResponse["data"].Should().NotBeNull("A result should be returned");
|
||||
}
|
||||
|
||||
@@ -400,6 +401,35 @@ namespace raven_integration
|
||||
}
|
||||
|
||||
|
||||
public static string GenerateCustomFieldsJsonString(
|
||||
string c1 = null, string c2 = null, string c3 = null, string c4 = null,
|
||||
string c5 = null, string c6 = null, string c7 = null, string c8 = null, string c9 = null,
|
||||
string c10 = null, string c11 = null, string c12 = null, string c13 = null,
|
||||
string c14 = null, string c15 = null, string c16 = null
|
||||
)
|
||||
{
|
||||
|
||||
//Custom fields
|
||||
//"[{c1:"blah"}]
|
||||
dynamic dCustomField = new JObject();
|
||||
dCustomField.c1 = c1;
|
||||
dCustomField.c2 = c2;
|
||||
dCustomField.c3 = c3;
|
||||
dCustomField.c4 = c4;
|
||||
dCustomField.c5 = c5;
|
||||
dCustomField.c6 = c6;
|
||||
dCustomField.c7 = c7;
|
||||
dCustomField.c8 = c8;
|
||||
dCustomField.c9 = c9;
|
||||
dCustomField.c10 = c10;
|
||||
dCustomField.c11 = c11;
|
||||
dCustomField.c12 = c12;
|
||||
dCustomField.c13 = c13;
|
||||
dCustomField.c14 = c14;
|
||||
dCustomField.c15 = c15;
|
||||
dCustomField.c16 = c16;
|
||||
return dCustomField.ToString();
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
|
||||
Reference in New Issue
Block a user