This commit is contained in:
2019-06-21 20:21:06 +00:00
parent 1f24ac9173
commit 0fa4d69304
2 changed files with 6 additions and 87 deletions

View File

@@ -78,7 +78,7 @@ DONE: Turn widget edit ROLES into a static select populated from server
DONE: Widget - NOTES FIELD
TODO: TAGS!!!
- COMPONENTIZE
- something funky with not clearing the last typed thing on an add
- Also it seems to keep the default blank entry in the list that was intended to be nothing to avoid showing the default no data found text WTF?
- Adding a new tag doesn't trigger isDirty anymore as it's out of the form so need to figure out why that's happening (onChange in form not getting called?? maybe need to emit another event like "change" or something??)
- Could auto-insert tags in suggestion list like the current year or month or year/month/day or user name or ??

View File

@@ -26,88 +26,25 @@
</v-layout>
</v-container>
</template>
<template slot="append-outer">
<v-flex xs6 sm4>
PICKER VALUE: {{ value }}
<br />
PICKER SOURCE TAGS: {{ sourcetags }}
</v-flex>
</template>
</v-autocomplete>
<!--
v-on:input="$emit('input', $event.target.value)"
<v-autocomplete
v-model="obj.tags"
:readonly="this.formState.readOnly"
:label="this.$gzlocale.get('Tags')"
:error-messages="this.$gzform.serverErrors(this, 'tags')"
ref="tags"
@change="onChange('tags')"
:items="pickLists.tags"
:loading="tagSearchUnderway"
:search-input.sync="tagSearchEntry"
hide-selected
multiple
chips
clearable
deletable-chips
cache-items
>
<template slot="no-data" v-if="tagSearchEntry">
<v-container>
<v-layout row>
<v-layout justify-center>
<v-chip
color="primary"
text-color="white"
class="display-1"
>
{{ this.$gzutil.normalizeTag(tagSearchEntry) }}</v-chip
>
<v-btn large icon @click="addTag()">
<v-icon large color="success">fa-plus-circle</v-icon>
</v-btn>
</v-layout>
</v-layout>
</v-container>
</template>
</v-autocomplete> -->
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* eslint-disable */
/* Xeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// import _ from "../libs/lodash.min.js";
export default {
created() {
//debugger;
},
mounted() {
//Populate tags pick list, this is required to cache it at least once and display it when form opens
// this.sourcetags = this.value;
//debugger;
},
beforeUpdate() {
//Set the initial picklist items based on the record items, this only needs to be called once at init
if (!this.initialized && this.value.length > 0) {
this.sourcetags = this.value;
this.initialized = true;
}
//debugger;
},
updated() {
//debugger;
},
beforeMount() {
//debugger;
},
data() {
return {
sourcetags: [""],
testvalue: ["me", "you"],
// localValue: [],
tagSearchEntry: null,
tagSearchUnderway: false,
initialized: false
@@ -119,7 +56,7 @@ export default {
watch: {
tagSearchEntry(val) {
var vm = this;
if (vm.tagSearchUnderway) {
if (!val || vm.tagSearchUnderway) {
return;
}
vm.tagSearchUnderway = true;
@@ -145,9 +82,6 @@ export default {
},
methods: {
test(ev) {
debugger;
},
addTag() {
var theTag = this.tagSearchEntry;
theTag = this.normalizeTag(theTag);
@@ -158,28 +92,13 @@ export default {
},
normalizeTag(tagName) {
//kebab case takes care of all the things we need for tags in one go
tagName = _.kebabCase(tagName);
tagName = this.$_.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;
}
},
beforeCreate() {
//debugger;
//check pre-requisites exist just in case
if (this.$gzdevmode()) {
if (!this.$_) {