This commit is contained in:
@@ -5,8 +5,6 @@ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTcxODU5OTU0IiwiZXhwIjoiMTU3MjQ
|
||||
|
||||
## IMMEDIATE ITEMS
|
||||
|
||||
INTEGRATION TEST UPDATE Update tests when appropriate (when it's working fully and not mocked)
|
||||
- GET ALL TESTS WORKING!
|
||||
|
||||
TODO: DataFilter how to distinguish between filtering on specific ID value or on value column
|
||||
- Might need to add a filter on ID type of thing maybe?
|
||||
@@ -30,9 +28,8 @@ CLIENT PROJECT CUSTOM FIELDS CHANGE
|
||||
- Additional NUMBER is split now between integer and decimal types update control STEP value for inputs to include decimal places or none depending on type
|
||||
|
||||
TEST CHANGES
|
||||
- Must use numeric instead of text values now
|
||||
- Test datatypes enum picklist
|
||||
- New routes for lists
|
||||
- Need new test for DataList stuff besides the actual lists
|
||||
- Or, does all the code around that get tested automatically with the list fetch itself?
|
||||
- Test validation code for custom template with bad one (field not exists)
|
||||
- Test insufficient roles to fetch test widget datalist (outside staff)
|
||||
|
||||
|
||||
@@ -46,11 +46,8 @@ namespace AyaNova.Biz
|
||||
{
|
||||
case WIDGET_KEY:
|
||||
#region WIDGET_KEY
|
||||
|
||||
//first column is the non visible Default Id column so that the client knows what to open when there is no field with ID selected that matches underlying record type
|
||||
//in this case the default of id is sufficient for this list
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "df" });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "WidgetName", FieldKey = "Name" });
|
||||
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "WidgetName", FieldKey = "Name", Hideable = false });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "WidgetSerial", FieldKey = "Serial" });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "WidgetDollarAmount", FieldKey = "DollarAmount" });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "WidgetCount", FieldKey = "Count" });
|
||||
@@ -84,7 +81,6 @@ namespace AyaNova.Biz
|
||||
#endregion
|
||||
case USER_KEY:
|
||||
#region USER_KEY
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "df" });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "Name", FieldKey = "Name", Hideable = false });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "UserEmployeeNumber", FieldKey = "EmployeeNumber" });
|
||||
l.Add(new AyaFormFieldDefinition { LtKey = "AuthorizationRoles", FieldKey = "Roles", Hideable = false });
|
||||
|
||||
@@ -215,19 +215,19 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var fldKey = formFieldItem["fld"].Value<string>();
|
||||
if (string.IsNullOrWhiteSpace(fldKey))
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Template", $"Template array item {i}, \"fld\" property is empty and required");
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Template", $"Template array item {i}, \"fld\" property exists but is empty, a value is required");
|
||||
|
||||
//validate the field name if we can
|
||||
if (ValidFormFields != null)
|
||||
{
|
||||
|
||||
if (!ValidFormFields.Exists(x => x.LtKey == fldKey))
|
||||
if (!ValidFormFields.Exists(x => x.FieldKey == fldKey))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, fld property value \"{fldKey}\" is not a valid form field value for formKey specified");
|
||||
}
|
||||
else
|
||||
{
|
||||
MasterFormField = ValidFormFields.FirstOrDefault(x => x.LtKey == fldKey);
|
||||
MasterFormField = ValidFormFields.FirstOrDefault(x => x.FieldKey == fldKey);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -241,13 +241,13 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var fieldHideValue = formFieldItem["hide"].Value<bool>();
|
||||
if (!MasterFormField.Hideable && fieldHideValue == true)
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"hide\" property value of \"{fieldHideValue}\" is not valid, this field is core and cannot be hidden");
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i} (\"{MasterFormField.FieldKey}\"), \"hide\" property value of \"{fieldHideValue}\" is not valid, this field is core and cannot be hidden");
|
||||
}
|
||||
|
||||
//validate if it's a custom field that it has a type specified
|
||||
if (MasterFormField.IsCustomField && formFieldItem["type"] == null)
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is MISSING for custom filed, Custom fields MUST have types specified");
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i} (\"{MasterFormField.FieldKey}\"), \"type\" property value is MISSING for custom field, Custom fields MUST have types specified");
|
||||
}
|
||||
|
||||
|
||||
@@ -255,12 +255,12 @@ namespace AyaNova.Biz
|
||||
if (formFieldItem["type"] != null)
|
||||
{
|
||||
if (!MasterFormField.IsCustomField)
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is not valid, only Custom fields can have types specified");
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i} (\"{MasterFormField.FieldKey}\"), \"type\" property value is not valid, only Custom fields can have types specified");
|
||||
else
|
||||
{//It is a custom field, is it a valid type value
|
||||
var templateFieldCustomTypeValue = formFieldItem["type"].Value<int>();
|
||||
if (!ValidCustomFieldTypes.Contains(templateFieldCustomTypeValue))
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value of \"{templateFieldCustomTypeValue}\" is not a valid custom field type");
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i} (\"{MasterFormField.FieldKey}\"), \"type\" property value of \"{templateFieldCustomTypeValue}\" is not a valid custom field type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace AyaNova.Biz
|
||||
|
||||
//other code depends on seeing the required value even if it's not set to true
|
||||
if (formFieldItem["required"] == null)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Template", $"Template array item {i}, object is missing required \"required\" property ");
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Template", $"Template array item {i}, object is missing \"required\" property. All items must contain this property. ");
|
||||
|
||||
|
||||
//NOTE: value of nothing, null or empty is a valid value so no checking for it here
|
||||
|
||||
Reference in New Issue
Block a user