This commit is contained in:
2018-12-19 19:21:18 +00:00
parent c15d8277cb
commit 6c5b726210
3 changed files with 15 additions and 12 deletions

View File

@@ -80,16 +80,10 @@ TODO CLIENT STUFF
TODO SERVER STUFF
- TAGS: REally need to have a think about how tags are used in the UI, probably need a autofill route that has a source of used or common tags to drive it
- so user can type first fiew characters adn select
- So consistency is maintained and not sloppy multiple spellings
- Maybe a db stored procedure and trigger or biz code that feeds a consolidated tag table of all entered tags in the system?
- Maybe a reference count for each tag to drive a tag cloud feature and also a order by commonality feature when offering and also to know when to remove from
the tag repository when no one is using that tag anymore in any records
- TAG ROUTE: LIST route to fetch tags in Alphabetical order by name based on starts with (or maybe contains) used for quickly autofilling a list at UI level
- TAG ROUTE: CLOUD route to fetch tags in order of refcount decreasing
- TAG repo tests: ensure updates delete and add properly, ensure new adds properly, ensure lists work properly
- TAG Ref count test:
- Boot server and seed with debug log turned on, see what is being tracked by EF that doesn't need to, seems some of that shit is being tracked.
- Docs: pagingOptions, sort and filter need to be documented for API

View File

@@ -47,8 +47,8 @@ namespace AyaNova.Api.Controllers
/// </summary>
/// <param name="query">The query to filter the returned list by</param>
/// <returns>List</returns>
[HttpGet("list/{query}")]
public ActionResult GetPickList([FromRoute]string query)
[HttpGet("picklist")]
public ActionResult GetPickList([FromQuery]string query)
{
if (!serverState.IsOpen)
{

View File

@@ -153,8 +153,17 @@ namespace AyaNova.Biz
//going with contains for now as I think it's more useful in the long run and still captures startswith intent by user
public static List<string> PickListFiltered(AyContext ct, string q)
{
q = NormalizeTag(q);
return ct.Tag.Where(x => x.Name.Contains(q)).OrderBy(x => x.Name).Select(x => x.Name).ToList();
//This path is intended for internal use and accepts that there may not be a filter specified
//however the client will always require a filter to display a tag list for choosing from
if (string.IsNullOrWhiteSpace(q))
{
return ct.Tag.OrderBy(x => x.Name).Select(x => x.Name).ToList();
}
else
{
q = NormalizeTag(q);
return ct.Tag.Where(x => x.Name.Contains(q)).OrderBy(x => x.Name).Select(x => x.Name).ToList();
}
}