This commit is contained in:
2020-03-18 19:56:58 +00:00
parent 6253a838f6
commit c99eed383f
8 changed files with 13 additions and 26 deletions

View File

@@ -21,10 +21,10 @@ namespace AyaNova.Api.Controllers
[Route("api/v{version:apiVersion}/[controller]")] [Route("api/v{version:apiVersion}/[controller]")]
[Produces("application/json")] [Produces("application/json")]
[Authorize] [Authorize]
public class EnumPickListController : ControllerBase public class EnumListController : ControllerBase
{ {
private readonly AyContext ct; private readonly AyContext ct;
private readonly ILogger<EnumPickListController> log; private readonly ILogger<EnumListController> log;
private readonly ApiServerState serverState; private readonly ApiServerState serverState;
@@ -34,7 +34,7 @@ namespace AyaNova.Api.Controllers
/// <param name="dbcontext"></param> /// <param name="dbcontext"></param>
/// <param name="logger"></param> /// <param name="logger"></param>
/// <param name="apiServerState"></param> /// <param name="apiServerState"></param>
public EnumPickListController(AyContext dbcontext, ILogger<EnumPickListController> logger, ApiServerState apiServerState) public EnumListController(AyContext dbcontext, ILogger<EnumListController> logger, ApiServerState apiServerState)
{ {
ct = dbcontext; ct = dbcontext;
log = logger; log = logger;
@@ -48,7 +48,7 @@ namespace AyaNova.Api.Controllers
/// <param name="enumkey">The key name of the enumerated type</param> /// <param name="enumkey">The key name of the enumerated type</param>
/// <returns>List</returns> /// <returns>List</returns>
[HttpGet("list/{enumkey}")] [HttpGet("list/{enumkey}")]
public ActionResult GetPickList([FromRoute]string enumkey) public ActionResult GetList([FromRoute]string enumkey)
{ {
if (!serverState.IsOpen) if (!serverState.IsOpen)
{ {
@@ -166,9 +166,9 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get all possible enumerated values picklist key names /// Get all possible enumerated values list key names
/// </summary> /// </summary>
/// <returns>List of AyaNova enumerated type list key names that can be fetched from the AyaEnumPickList/GetPickListRoute</returns> /// <returns>List of AyaNova enumerated type list key names that can be fetched from the GetList Route</returns>
[HttpGet("listkeys")] [HttpGet("listkeys")]
public ActionResult GetTypesList() public ActionResult GetTypesList()
{ {

View File

@@ -98,7 +98,7 @@ namespace AyaNova.Api.Controllers
/// Get available types allowed for Custom fields /// Get available types allowed for Custom fields
/// Used to build UI for customizing a form /// Used to build UI for customizing a form
/// These values are a subset of the AyaDataTypes values /// These values are a subset of the AyaDataTypes values
/// which can be fetched from the EnumPickList route /// which can be fetched from the EnumList route
/// </summary> /// </summary>
/// <returns>A list of valid values for custom field types</returns> /// <returns>A list of valid values for custom field types</returns>
[HttpGet("AvailableCustomTypes")] [HttpGet("AvailableCustomTypes")]

View File

@@ -8,9 +8,6 @@ namespace AyaNova.DataList
public static class DataListSqlFilterOrderByBuilder public static class DataListSqlFilterOrderByBuilder
{ {
// public static string DefaultGetManyOrderBy => "ORDER BY ID DESC";
// public static string DefaultPickListOrderBy => "ORDER BY NAME ASC";
public static string DataFilterToSQLOrderBy(List<AyaDataListFieldDefinition> objectFieldsList, JArray listViewArray) public static string DataFilterToSQLOrderBy(List<AyaDataListFieldDefinition> objectFieldsList, JArray listViewArray)
{ {
@@ -60,8 +57,8 @@ namespace AyaNova.DataList
if (sb.Length == 0) if (sb.Length == 0)
{ {
//no sort specified so default it //no sort specified so default it
AyaDataListFieldDefinition rid = objectFieldsList.FirstOrDefault(x => x.IsRowId == true); AyaDataListFieldDefinition rid = objectFieldsList.FirstOrDefault(x => x.IsRowId == true);
if (rid!=null) if (rid != null)
{ {
return $"ORDER BY {rid.SqlIdColumnName} DESC"; return $"ORDER BY {rid.SqlIdColumnName} DESC";
} }

View File

@@ -129,7 +129,7 @@ namespace AyaNova.Biz
//get picklist (NOT PAGED) //get ViewList (NOT PAGED)
internal async Task<List<NameIdItem>> GetViewListAsync(string listKey) internal async Task<List<NameIdItem>> GetViewListAsync(string listKey)
{ {
List<NameIdItem> items = new List<NameIdItem>(); List<NameIdItem> items = new List<NameIdItem>();

View File

@@ -88,7 +88,7 @@ namespace AyaNova.Biz
//get picklist (simple non-paged) //get list (simple non-paged)
internal async Task<List<NameIdItem>> GetTranslationListAsync() internal async Task<List<NameIdItem>> GetTranslationListAsync()
{ {
List<NameIdItem> l = new List<NameIdItem>(); List<NameIdItem> l = new List<NameIdItem>();

View File

@@ -10,7 +10,7 @@ namespace AyaNova.Models
public uint ConcurrencyToken { get; set; } public uint ConcurrencyToken { get; set; }
[Required] [Required]
public long UserId { get; set; }//only relevant if non-public for fetching either in picklist or single (public true OR userid matches) public long UserId { get; set; }//only relevant if non-public for fetching either in list or single (public true OR userid matches)
[Required, MaxLength(255)] [Required, MaxLength(255)]
public string Name { get; set; }//max 255 characters ascii set public string Name { get; set; }//max 255 characters ascii set
[Required] [Required]

View File

@@ -10,7 +10,7 @@ namespace AyaNova.Models
- FieldKey "fld" - FieldKey "fld"
- Hide "hide" - Hide "hide"
- Required "required" - Required "required"
- Type One of values from AyDataType but not tags or enum (bool, date, date time, decimal, number, picklist(FUTURE), and text) - Type One of values from AyDataType but not tags or enum (bool, date, date time, decimal, number, p icklist(FUTURE), and text)
- e.g.: [{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"bool"},{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"text"] - e.g.: [{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"bool"},{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"text"]
*/ */

View File

@@ -1,10 +0,0 @@
namespace AyaNova.Models
{
public partial class PickListResult
{
public int TotalRecordCount { get; set; }
public NameIdItem[] Items { get; set; }
}
}