This commit is contained in:
@@ -135,11 +135,11 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "UserId");
|
||||
|
||||
|
||||
// //Hexadecimal notation: #RGB[A] R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0–9, A–F). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388.
|
||||
// if (inObj.UiColor.Length > 12 || inObj.UiColor.Length < 4 || inObj.UiColor[0] != '#')
|
||||
// {
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UiColor", "UiColor must be valid HEX color value");
|
||||
// }
|
||||
//Hexadecimal notation: #RGB[A] R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0–9, A–F). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388.
|
||||
if (inObj.UiColor.Length > 12 || inObj.UiColor.Length < 4 || inObj.UiColor[0] != '#')
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UiColor", "UiColor must be valid HEX color value");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace AyaNova.KPI
|
||||
|
||||
|
||||
JArray jData = new JArray();
|
||||
string sMeta = null;
|
||||
JArray jMeta = new JArray();
|
||||
|
||||
#if (DEBUG && AYSHOWKPIQUERYINFO)
|
||||
System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch();
|
||||
@@ -86,11 +86,9 @@ namespace AyaNova.KPI
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(kpi.MetaQuery))
|
||||
{
|
||||
//GET META DATA
|
||||
//GET META DATA ROWS
|
||||
command.CommandText = kpi.MetaQuery;
|
||||
#if (DEBUG && AYSHOWQUERYINFO)
|
||||
stopWatch.Start();
|
||||
@@ -101,14 +99,14 @@ namespace AyaNova.KPI
|
||||
stopWatch.Stop();
|
||||
log.LogInformation($"(debug) KPIFetcher:GetResponse META query took {stopWatch.ElapsedMilliseconds}ms to execute: {qTotalRecordsQuery}");
|
||||
#endif
|
||||
if (dr.Read())
|
||||
while (dr.Read())
|
||||
{
|
||||
sMeta = dr.GetString(0);
|
||||
//only one column and it's the zeroth json string column
|
||||
if (!dr.IsDBNull(0))
|
||||
jMeta.Add(JObject.Parse(dr.GetString(0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Npgsql.PostgresException e)
|
||||
{
|
||||
@@ -133,17 +131,13 @@ namespace AyaNova.KPI
|
||||
throw new System.Exception("KPIFetcher:GetResponseAsync - unexpected failure see log");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(sMeta))
|
||||
return JObject.FromObject(new
|
||||
{
|
||||
meta = JObject.Parse(sMeta),
|
||||
data = jData
|
||||
});
|
||||
else
|
||||
return JObject.FromObject(new
|
||||
{
|
||||
data = jData
|
||||
});
|
||||
|
||||
return JObject.FromObject(new
|
||||
{
|
||||
meta = jMeta,
|
||||
data = jData
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,10 @@ ORDER BY X ASC
|
||||
) t";
|
||||
_metaQuery =
|
||||
@"SELECT row_to_json(t) as res from (
|
||||
select name from auser where id = 10
|
||||
select auser.id as userid, name, uicolor, usertype from auser
|
||||
left outer join auseroptions on auser.id=auseroptions.userid
|
||||
where auser.usertype=1 or auser.usertype=5
|
||||
order by name
|
||||
) t";
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,9 @@ namespace AyaNova.Models
|
||||
Hexadecimal notation: #RGB[A]
|
||||
R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0–9, A–F). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388.
|
||||
*/
|
||||
//removed for v8 alpha due to schedule not really supporting colors and
|
||||
//it's kind of tacky in my opinion and outdated and it would detract from the use of colors already in teh schedule
|
||||
//plus no where else does ayanova use this value so it's a lot of nothing
|
||||
// [MaxLength(12)]
|
||||
// public string UiColor { get; set; }
|
||||
|
||||
[MaxLength(12)]
|
||||
public string UiColor { get; set; }
|
||||
|
||||
//browser forced overrides
|
||||
public string LanguageOverride { get; set; }
|
||||
@@ -52,7 +50,7 @@ namespace AyaNova.Models
|
||||
{
|
||||
CurrencyName = "USD";
|
||||
Hour12 = true;
|
||||
// UiColor = "#000000";//black is the default
|
||||
UiColor = "#ffffff";//black is the default
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,16 +22,16 @@ namespace AyaNova.Util
|
||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
|
||||
private const int DESIRED_SCHEMA_LEVEL = 1;
|
||||
|
||||
internal const long EXPECTED_COLUMN_COUNT = 1325;
|
||||
internal const long EXPECTED_COLUMN_COUNT = 1326;
|
||||
internal const long EXPECTED_INDEX_COUNT = 153;
|
||||
internal const long EXPECTED_CHECK_CONSTRAINTS = 520;
|
||||
internal const long EXPECTED_CHECK_CONSTRAINTS = 521;
|
||||
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 198;
|
||||
internal const long EXPECTED_VIEWS = 11;
|
||||
internal const long EXPECTED_ROUTINES = 2;
|
||||
|
||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
|
||||
|
||||
///////////////////////////////////////// C1325:I153:CC520:FC198:V11:R2
|
||||
///////////////////////////////////////// C1326:I153:CC521:FC198:V11:R2
|
||||
|
||||
|
||||
|
||||
@@ -617,7 +617,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//Add user options table
|
||||
await ExecQueryAsync("CREATE TABLE auseroptions (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, "
|
||||
+ "userid BIGINT NOT NULL UNIQUE REFERENCES auser (id) ON DELETE CASCADE, translationid BIGINT NOT NULL REFERENCES atranslation (id), languageoverride TEXT, timezoneoverride TEXT, "
|
||||
+ "currencyname TEXT, hour12 BOOL NOT NULL, emailaddress TEXT, phone1 TEXT, phone2 TEXT, phone3 TEXT, mapurltemplate TEXT)");
|
||||
+ "currencyname TEXT, hour12 BOOL NOT NULL, emailaddress TEXT, phone1 TEXT, phone2 TEXT, phone3 TEXT, mapurltemplate TEXT, uicolor VARCHAR(12) NOT NULL default '#ffffff')");
|
||||
|
||||
|
||||
//Prime the db with the default SuperUser account
|
||||
|
||||
@@ -1802,7 +1802,7 @@ namespace AyaNova.Util
|
||||
u.UserOptions.EmailAddress = bogusEmail;
|
||||
u.UserOptions.Hour12 = true;
|
||||
u.UserOptions.CurrencyName = "USD";
|
||||
//u.UserOptions.UiColor = Fake.Internet.Color().ToUpperInvariant();
|
||||
u.UserOptions.UiColor = Fake.Internet.Color().ToUpperInvariant();
|
||||
|
||||
|
||||
//this seems wrong to get a new context inside a loop but in testing is actually faster!?
|
||||
|
||||
Reference in New Issue
Block a user