From ae0999647ce23a3e7beeefa958bef8814d8baa8a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 19 Jun 2019 21:55:19 +0000 Subject: [PATCH] --- ayanova/src/api/gzutil.js | 27 ++++++++++++++ ayanova/src/views/inventory-widget-edit.vue | 40 +++++++++------------ 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index be4163bd..f0142894 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -1,5 +1,7 @@ /* Xeslint-disable */ +import _ from "../libs/lodash.min.js"; + ///////////////////////////////// // General utility library // @@ -69,6 +71,31 @@ export default { } } return true; + }, + /////////////////////////////// + // CLEAN TAG NAME + // Clean up a tag with same rules as server + // + normalizeTag: function(tagName) { + //kebab case takes care of all the things we need for tags in one go + tagName = _.kebabCase(tagName); + + //No longer than 255 characters + tagName = tagName.length > 255 ? tagName.substr(0, 255 - 1) : tagName; + + return tagName; + // + // //This may be naive when we get international customers but for now supporting utf-8 and it appears it's safe to do this with unicode + // inObj = inObj.ToLowerInvariant(); + // //No spaces in tags, replace with dashes + // inObj = inObj.Replace(" ", "-"); + // //Remove multiple dash sequences + // inObj = System.Text.RegularExpressions.Regex.Replace(inObj, "-+", "-"); + // //Ensure doesn't start or end with a dash + // inObj = inObj.Trim('-'); + // //No longer than 255 characters + // inObj = StringUtil.MaxLength(inObj, 255); + // return inObj; } //new functions above here diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 23a4aed7..db81c41f 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -148,7 +148,8 @@ @change="onChange('tags')" :items="pickLists.tags" :loading="tagSearchUnderway" - :search-input.sync="searchTags" + :search-input.sync="tagSearchEntry" + no-data-text="ENTER A TAG" hide-selected multiple chips @@ -156,16 +157,14 @@ deletable-chips cache-items > -