This commit is contained in:
@@ -640,7 +640,13 @@ namespace AyaNova.Biz
|
|||||||
i.UserOptions.EmailAddress = j["EmailAddress"].Value<string>();
|
i.UserOptions.EmailAddress = j["EmailAddress"].Value<string>();
|
||||||
|
|
||||||
//UI colour
|
//UI colour
|
||||||
i.UserOptions.UiColor = j["ScheduleBackColor"].Value<int>();
|
//TODO: this needs to be switched to a web friendly 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.
|
||||||
|
*/
|
||||||
|
throw new ArgumentOutOfRangeException("UserBiz::ImportV7Async - UI color needs to be pre-converted in DataDump to RGB values");
|
||||||
|
//i.UserOptions.UiColor = j["ScheduleBackColor"].Value<int>();
|
||||||
|
|
||||||
|
|
||||||
//Set unusable random login credentials
|
//Set unusable random login credentials
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ namespace AyaNova.Biz
|
|||||||
if (inObj.UserId == 0)
|
if (inObj.UserId == 0)
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "UserId");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "UserId");
|
||||||
|
|
||||||
|
if (inObj.UiColor.Length > 12)
|
||||||
|
{
|
||||||
|
AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "UiColor", "UiColor must be HEX color value");
|
||||||
|
}
|
||||||
|
|
||||||
//LOOKAT:Validate email address is legitimate (I put the EMailAddress attribute on the field in the model so I think it might validate)
|
//LOOKAT:Validate email address is legitimate (I put the EMailAddress attribute on the field in the model so I think it might validate)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -12,14 +12,13 @@ namespace AyaNova.Models
|
|||||||
//-------------
|
//-------------
|
||||||
[EmailAddress]
|
[EmailAddress]
|
||||||
public string EmailAddress { get; set; }
|
public string EmailAddress { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// As of today Dec 10 2018 all time zones in the world are either on the hour, half hour or 45 minute mark from utc so
|
/*
|
||||||
/// keeping this value as decimal hours for back compatibility with v7 and easier for user to enter
|
Hexadecimal notation: #RGB[A]
|
||||||
/// 8.5 for 8:30 time difference or 12.75 for 12:45 time differnce for example
|
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.
|
||||||
/// </summary>
|
*/
|
||||||
/// <value></value>
|
[MaxLength(12)]
|
||||||
|
public string UiColor { get; set; }
|
||||||
public int UiColor { get; set; }
|
|
||||||
|
|
||||||
//browser forced overrides
|
//browser forced overrides
|
||||||
public string LanguageOverride { get; set; }
|
public string LanguageOverride { get; set; }
|
||||||
@@ -40,7 +39,7 @@ namespace AyaNova.Models
|
|||||||
{
|
{
|
||||||
CurrencyName = "USD";
|
CurrencyName = "USD";
|
||||||
Hour12 = true;
|
Hour12 = true;
|
||||||
UiColor = 0;
|
UiColor = "#000000";//black is the default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
//Add user options table
|
//Add user options table
|
||||||
await ExecQueryAsync("CREATE TABLE auseroptions (id BIGSERIAL PRIMARY KEY, " +
|
await ExecQueryAsync("CREATE TABLE auseroptions (id BIGSERIAL PRIMARY KEY, " +
|
||||||
"userid bigint not null, languageoverride text, timezoneoverride text, currencyname text, hour12 bool not null, emailaddress text, uicolor int not null default 0)");
|
"userid bigint not null, languageoverride text, timezoneoverride text, currencyname text, hour12 bool not null, emailaddress text, uicolor varchar(12) not null default '#000000')");
|
||||||
|
|
||||||
|
|
||||||
//Prime the db with the default MANAGER account
|
//Prime the db with the default MANAGER account
|
||||||
|
|||||||
@@ -593,6 +593,7 @@ namespace AyaNova.Util
|
|||||||
u.UserOptions.EmailAddress = p.Email.Replace("gmail.com", "helloayanova.com").Replace("hotmail.com", "helloayanova.com").Replace("yahoo.com", "helloayanova.com");
|
u.UserOptions.EmailAddress = p.Email.Replace("gmail.com", "helloayanova.com").Replace("hotmail.com", "helloayanova.com").Replace("yahoo.com", "helloayanova.com");
|
||||||
u.UserOptions.Hour12 = true;
|
u.UserOptions.Hour12 = true;
|
||||||
u.UserOptions.CurrencyName = "USD";
|
u.UserOptions.CurrencyName = "USD";
|
||||||
|
u.UserOptions.UiColor= Fake.Internet.Color();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -624,6 +625,7 @@ namespace AyaNova.Util
|
|||||||
// WidgetBiz biz = WidgetBiz.GetBiz(ServiceProviderProvider.DBContext);
|
// WidgetBiz biz = WidgetBiz.GetBiz(ServiceProviderProvider.DBContext);
|
||||||
|
|
||||||
var f = new Bogus.Faker();
|
var f = new Bogus.Faker();
|
||||||
|
|
||||||
|
|
||||||
//RANDOM ROLES
|
//RANDOM ROLES
|
||||||
Array values = Enum.GetValues(typeof(UserType));
|
Array values = Enum.GetValues(typeof(UserType));
|
||||||
|
|||||||
Reference in New Issue
Block a user